msb_beta
ch 2 years ago
parent a1cf7f8192
commit 0680ede160

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-17 17:42:32
* @LastEditors: ch
* @LastEditTime: 2022-04-29 18:11:28
* @LastEditTime: 2022-04-29 20:19:22
* @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法
*/

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-04-25 14:39:19
* @LastEditors: ch
* @LastEditTime: 2022-04-28 23:33:33
* @LastEditTime: 2022-04-29 20:19:36
* @Description: file content
*/
import store from "../store";
@ -87,7 +87,7 @@ export let MsbWebSkt = null;
export const MsbWebSktInit = () => {
return new Promise((resolve, reject) => {
MsbWebSkt = uni.connectSocket({
url : `ws://192.168.10.92:8090/ws?client=${store.state.token}`, // url是websocket连接ip
url : `ws://you-gateway.mashibing.com/ws?client=${store.state.token}`, // url是websocket连接ip
fail: e => {
reject(e)
}

@ -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.c3f897b1.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.792088ec.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

@ -50,7 +50,7 @@
</view>
</template>
<view>
<view v-if="item.status === 'notSku'">
<UiButton size="small" class="cart-item--reset-btn" type="line">重新选择</UiButton>
</view>
</view>
@ -66,7 +66,7 @@
<view v-if="list.length" :class="`footer footer__${type}`">
<label class="all-radio" @click="handleCheckAll">
<radio class="radio" color="#FF875B"
:checked="checkedIds.length > 0 && checkedIds.length === list.length" />
:checked="checkedIds.length > 0 && checkedIds.length === list.filter(i => i.status == 'normal').length" />
<text>全选</text>
</label>
<view class="total-info" v-if="mode == 'normal'">
@ -114,9 +114,11 @@ export default {
//
isLoading: true,
// : normal edit
mode: 'normal',
//
list: [],
mode: 'normal',
// notSkuSDKnormal isDisable
settlementList : [],
//
delList : [],
//
total: null,
// ID
@ -134,6 +136,10 @@ export default {
}
},
computed : {
//
list(){
return (this.mode === 'normal' ? this.settlementList : this.delList) || []
},
totalPrice(){
const checkedList = this.list.filter(item => this.checkedIds.includes(item.id));
let tempPrice = 0;
@ -173,7 +179,7 @@ export default {
uni.$u.toast(error.message);
return false;
}
this.list = result.map(item => {
this.settlementList = result.map(item => {
const singleBuyLimit = item.product.singleBuyLimit;
const stock = item.productSku.stock;
const maxBuyNum = singleBuyLimit ? Math.min(singleBuyLimit, stock || 1) : stock
@ -185,6 +191,12 @@ export default {
maxBuyNum
}
});
this.delList = result.map(item => {
return {
...item,
status : 'normal'
}
})
this.onClearInvalidId();
this.isLoading = false;
},
@ -259,11 +271,15 @@ export default {
/**
* 全选事件
* 取到当前列表状态正常的商品列表
* 如果选中IDS等于正常状态列表则判断为取消全部
* 否则选中全部正常状态商品
*/
handleCheckAll() {
const { checkedIds, list } = this;
this.checkedIds = checkedIds.length === list.length ? [] :
list.filter(i => i.status == 'normal').map(item => item.id);
const normalList = list.filter(i => i.status == 'normal');
this.checkedIds = checkedIds.length === normalList.length ? [] :
normalList.map(item => item.id);
},
/**
@ -299,7 +315,9 @@ export default {
uni.$u.toast(error.message);
return false;
}
this.list = this.list.filter(item => !ids.includes(item.id));
this.delList = this.delList.filter(item => !ids.includes(item.id));
this.settlementList = this.settlementList.filter(item => !ids.includes(item.id));
this.checkedIds = [];
this.onClearInvalidId();
}

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-23 17:27:21
* @LastEditors: ch
* @LastEditTime: 2022-04-29 17:01:20
* @LastEditTime: 2022-04-29 19:56:18
* @Description: file content
-->
<template>
@ -32,7 +32,7 @@
<view class="goods-desc">
<mp-html :content="goods.detail"/>
</view>
<view class="footer--not-stock" v-if="stock == 0">~</view>
<view class="footer--not-stock" v-if="stock === 0">~</view>
<view class="footer">
<view class="footer--left">
<view class="icon service">客服</view>
@ -58,6 +58,8 @@ export default {
components: { SlideImage, mpHtml, Service, SkuPopup, UiButton, SeckillPrice},
data(){
return {
// 1
stock : 1,
goods : {
pictureList : []
},
@ -84,13 +86,6 @@ export default {
status = 'startActivity';
}
return status;
},
stock(){
let stock = 0;
this.skuInfoData.forEach(i => {
stock += i.stock
})
return stock
}
},
onLoad(){
@ -125,6 +120,11 @@ export default {
return false;
}
this.skuInfoData = result;
//
this.stock = 0;
this.skuInfoData.forEach(i => {
this.stock += i.stock
})
},
/**
* 显示/隐藏SKU弹窗

Loading…
Cancel
Save