Merge branch 'dev1.0.0' into develop

msb_beta
ch 2 years ago
commit a00ba04a04

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-17 17:42:32
* @LastEditors: ch
* @LastEditTime: 2022-04-29 17:06:35
* @LastEditTime: 2022-04-29 18:11:28
* @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法
*/
@ -29,7 +29,8 @@ const successIntercept = (response, option) =>{
return result.data;
}
if(result.code === 'TOKEN_FAIL'){
uni.navigateTo({url : '/login'})
uni.navigateTo({url : '/login'});
$store.commit('SET_TOKEN', '');
return result;
}
return Promise.reject(result);
@ -106,13 +107,7 @@ MsbRequestTk.use('request', (option) => {
if(!token){
// 登录状态处理没有token直接跳转至登录
uni.redirectTo({
url: '/login',
success(res){
console.log(res,'s');
},
fail (e){
console.log(e,'e');
}
url: '/login'
});
return Promise.reject({message:'要先登录才能操作哦~'});
}else{

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.4c73f1a7.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.c3f897b1.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -25,24 +25,33 @@
<!-- 购物车商品列表 -->
<template v-else >
<UiWhiteBox class="cart-item" v-for="(item, index) in list" :key="index" >
<label class="cart-item--radio" @click.stop="handleCheckItem(item.id)">
<label class="cart-item--radio" @click.stop="handleCheckItem(item.id, item.status)">
<radio class="radio" color="#FF875B"
:checked="checkedIds.length ? checkedIds.includes(item.id) : false" />
:checked="checkedIds.length ? checkedIds.includes(item.id) : false"
:disabled="item.status !== 'normal'"/>
</label>
<image class="cart-item--image" :src="item.product.mainPicture" mode="scaleToFill"
@click="$Router.push(`/goodsDetail?id=${item.productId}`)"></image>
<view class="cart-item--content" @click="$Router.push(`/goodsDetail?id=${item.productId}`)">
<view class="cart-item--title">{{ item.product.name }}</view>
<view class="cart-item--props">{{ item.productSku.name }}</view>
<view class="cart-item--footer">
<UiMoney class="cart-item--price" :money="item.productSku.sellPrice" prefix></UiMoney>
<view class="cart-item--stepper">
<u-number-box :min="1" button-size="40rpx" bgColor="#F5F6FA"
:value="item.number" :max="item.maxBuyNum" @change="onChangeStepper($event, item)" >
<text slot="minus" class="cart-item--stepper-icon">-</text>
<text slot="plus" class="cart-item--stepper-icon">+</text>
</u-number-box>
<view class="cart-item--title" :class="item.status !== 'normal' && 'cart-item--title__disabled'">{{ item.product.name }}</view>
<view v-if="item.status === 'notSku'" class="cart-item--props"></view>
<view v-if="item.status === 'isDisable'" class="cart-item--props"></view>
<template v-if="item.status === 'normal'">
<view class="cart-item--props">{{ item.productSku.name }}</view>
<view class="cart-item--footer">
<UiMoney class="cart-item--price" :money="item.productSku.sellPrice" prefix></UiMoney>
<view class="cart-item--stepper">
<u-number-box :min="1" button-size="40rpx" bgColor="#F5F6FA"
:value="item.number" :max="item.maxBuyNum" @change="onChangeStepper($event, item)" >
<text slot="minus" class="cart-item--stepper-icon">-</text>
<text slot="plus" class="cart-item--stepper-icon">+</text>
</u-number-box>
</view>
</view>
</template>
<view>
<UiButton size="small" class="cart-item--reset-btn" type="line">重新选择</UiButton>
</view>
</view>
</UiWhiteBox>
@ -170,6 +179,9 @@ export default {
const maxBuyNum = singleBuyLimit ? Math.min(singleBuyLimit, stock || 1) : stock
return {
...item,
status : item.product.isEnable ?
(!item.productSku || item.productSku.stock == 0) ? 'notSku': 'normal' :
'isDisable',
maxBuyNum
}
});
@ -236,7 +248,10 @@ export default {
/**
* 选中商品
*/
handleCheckItem(cartId) {
handleCheckItem(cartId, status) {
if(status !== 'normal'){
return false;
}
const { checkedIds } = this
const index = checkedIds.findIndex(id => id === cartId)
index < 0 ? checkedIds.push(cartId) : checkedIds.splice(index, 1)
@ -246,8 +261,9 @@ export default {
* 全选事件
*/
handleCheckAll() {
const { checkedIds, list } = this
this.checkedIds = checkedIds.length === list.length ? [] : list.map(item => item.id)
const { checkedIds, list } = this;
this.checkedIds = checkedIds.length === list.length ? [] :
list.filter(i => i.status == 'normal').map(item => item.id);
},
/**
@ -374,6 +390,9 @@ export default {
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
&__disabled{
color: $color-grey3;
}
}
@ -404,6 +423,10 @@ export default {
height:40rpx;
margin: 0 14rpx;
}
&--reset-btn{
margin-top: 22rpx;
float: right;
}
}
//

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-22 15:36:46
* @LastEditors: ch
* @LastEditTime: 2022-04-29 00:11:21
* @LastEditTime: 2022-04-29 17:12:13
* @Description: file content
-->
<template>
@ -24,8 +24,8 @@
</u-form-item>
</u--form>
<UiButton class="login--btn" type="gradual" size="max" @click="login"></UiButton>
<label class="login--agreement">
<radio class="radio" :checked="checked" @click="checked = !checked" color="#FF875B"/>
<label class="login--agreement" @click="checked = !checked">
<radio class="radio" :checked="checked" color="#FF875B"/>
同意<text class="link">用户协议</text><text class="link">隐私协议</text>首次登录将自动注册
</label>
</view>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-20 14:14:53
* @LastEditors: ch
* @LastEditTime: 2022-04-29 16:58:05
* @LastEditTime: 2022-04-29 17:25:32
* @Description: file content
-->
<template>
@ -86,29 +86,28 @@ export default {
},
onLoad(){
//
uni.$on('changeAddress',(item, type)=>{
if(type == 'submitOrder'){
this.address = item;
}
uni.$on('changeAddress',(item)=>{
this.address = item;
this.getBeforeOrder();
});
//
this.address = this.$store.state.address.find(i => i.isDefault) || {};
},
onShow(){
//
this.address = this.$store.state.address.find(i => i.isDefault) || {};
this.getBeforeOrder();
},
methods:{
/**
* 获取预订单信息将要提交的订单信息
*/
async getBeforeOrder(addressId){
async getBeforeOrder(){
const query = this.$Route.query;
let res = {};
//
if(query.mode === 'cart'){
res = await ApiGetBeforeCartOrder({
cartIds: query.ids,
recipientAddressId : addressId
recipientAddressId : this.address.id
})
}
//
@ -120,7 +119,7 @@ export default {
activityTimeId : query.activityTimeId,
// 1 2
activityType : query.activityType,
recipientAddressId : addressId
recipientAddressId : this.address.id
});
}
if(res.error){

Loading…
Cancel
Save