add
This commit is contained in:
parent
6605fe5571
commit
002937f5a2
|
@ -10,6 +10,7 @@ switch (env) {
|
|||
case 'dev':
|
||||
BASE_URL = 'https://test-multi-store.lihaink.cn';
|
||||
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
|
||||
// WSS_URL = 'ws://192.168.1.22:8787'
|
||||
break;
|
||||
case 'liu':
|
||||
BASE_URL = 'http://192.168.1.201:8545';
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
});
|
||||
|
||||
// 浏览器监听user-1
|
||||
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}}`);
|
||||
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
|
||||
|
||||
user_channel.on('message', function(data) {
|
||||
console.log("收到消息--", data);
|
||||
|
@ -425,6 +425,9 @@
|
|||
const submit = async () => {
|
||||
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
|
||||
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
formData.store_id = STORE_INFO.id
|
||||
if (Role.value == 1) {
|
||||
uni.scanCode({
|
||||
|
@ -433,29 +436,10 @@
|
|||
formData.recharge_type = 'INDUSTRYMEMBERS'
|
||||
formData.user_ship = 1
|
||||
vipRechargeApi(formData).then(res => {
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
});
|
||||
timer = setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
uni.$u.toast('支付超时');
|
||||
// formData.real_name = ''
|
||||
// formData.mobile = ''
|
||||
// formData.address = ''
|
||||
// formData.label_name = ''
|
||||
// formData.city = ''
|
||||
// formData.area = ''
|
||||
// formData.street = ''
|
||||
// formData.village = ''
|
||||
// formData.brigade = ''
|
||||
// currentAddressIndex.value = 0
|
||||
// tabsList.forEach(item => {
|
||||
// item.name = '请选择'
|
||||
// })
|
||||
}, 30000)
|
||||
|
||||
// uni.$u.toast('操作成功');
|
||||
|
||||
})
|
||||
getCount()
|
||||
getLists()
|
||||
|
|
|
@ -109,14 +109,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<view style="width: 200rpx;">
|
||||
<up-button color="#20b128" shape="circle" :disabled="!checkAll || c_price0<500 "
|
||||
@click="settleAccounts">
|
||||
<view class="" v-if='c_price0>=500'>
|
||||
<up-button color="#20b128" shape="circle" @click="settleAccounts">
|
||||
<view class="">
|
||||
去结算<text v-if="checkAll">({{checkAll}})</text>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
¥500起订
|
||||
</view>
|
||||
|
||||
</up-button>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -206,22 +203,22 @@
|
|||
|
||||
// 购物车相关
|
||||
const addCart = (id, cart_num) => { //加入购物车
|
||||
if (uni.getStorageSync('STORE_INFO').length) {
|
||||
let data = JSON.parse(uni.getStorageSync('STORE_INFO'))
|
||||
let STORE_INFO = {};
|
||||
for (let key in data) {
|
||||
STORE_INFO[key] = data[key]
|
||||
}
|
||||
cartCreateApi({
|
||||
cart_num: +cart_num,
|
||||
product_id: id,
|
||||
store_id: STORE_INFO.id
|
||||
// store_id:
|
||||
}).then(res => {
|
||||
getcartList();
|
||||
})
|
||||
}
|
||||
|
||||
if (uni.getStorageSync('STORE_INFO').length) {
|
||||
let data = JSON.parse(uni.getStorageSync('STORE_INFO'))
|
||||
let STORE_INFO = {};
|
||||
for (let key in data) {
|
||||
STORE_INFO[key] = data[key]
|
||||
}
|
||||
cartCreateApi({
|
||||
cart_num: +cart_num,
|
||||
product_id: id,
|
||||
store_id: STORE_INFO.id
|
||||
// store_id:
|
||||
}).then(res => {
|
||||
getcartList();
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
const isAdmin = ref(false); //是否管理
|
||||
|
||||
|
@ -253,10 +250,10 @@
|
|||
} else {
|
||||
checkAll.value = 0
|
||||
}
|
||||
res.data.lists = res.data.lists.map(item => {
|
||||
if(!item.price) item.price = item.sell; // 兼容旧数据,新数据已经添加了price字段
|
||||
return item;
|
||||
})
|
||||
res.data.lists = res.data.lists.map(item => {
|
||||
if (!item.price) item.price = item.sell; // 兼容旧数据,新数据已经添加了price字段
|
||||
return item;
|
||||
})
|
||||
cartList.value = res.data.lists;
|
||||
cartInfo.value = {
|
||||
total_price: res.data?.extend.total_price || '0.00',
|
||||
|
|
|
@ -148,26 +148,24 @@
|
|||
<view class="shop-content">
|
||||
<view class="title">
|
||||
<view class="name u-line-2">{{ item.store_name }}</view>
|
||||
<view class="tip u-line-1">
|
||||
<text>{{ item.spec }}</text>
|
||||
</view>
|
||||
<view class="title">
|
||||
<view>
|
||||
<text style="font-size: 22rpx;color: #FC452F;">
|
||||
活动价: ¥ <text style="font-size: 28rpx;">{{ 66.65}}</text>
|
||||
</text>
|
||||
<text style="color:grey;font-size: 22rpx;">/{{ item.unit_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;" v-if='item.batch > 0'>
|
||||
<view style="color: red;">起批量: {{ item.batch }}{{ item.unit_name }}起卖</view>
|
||||
<view class="title">
|
||||
<view class="name u-line-2"><text> 原价:</text> {{ item.store_name }}</view>
|
||||
</view>
|
||||
<view style="display: flex;" v-if='item.batch > 0'>
|
||||
<view style="color: red;">规格: {{ item.price }}/{{ item.unit_name }}</view>
|
||||
</view>
|
||||
<!-- <view style="display: flex;align-items: center;" v-if='userStore?.userInfo?.user_ship == 1'>
|
||||
<text class='price' style="font-size: 24rpx;">会员价¥</text>
|
||||
<text class="price" style="margin-right: 10rpx;">{{ item.vip_price }}
|
||||
</text>
|
||||
<text class='price' style="font-size: 24rpx;">/{{ item.unit_name }}</text>
|
||||
</view> -->
|
||||
<view class="price-btn">
|
||||
<!-- <view class="price" style="font-size: 24rpx;"
|
||||
v-if='userStore?.userInfo?.user_ship == 1'>
|
||||
¥{{ item.price }}/{{ item.unit_name }}
|
||||
</view> -->
|
||||
<view class="price">
|
||||
¥{{ item.price }}/{{ item.unit_name }}
|
||||
起批量: {{ item.batch }}{{ item.unit_name }}起卖
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
|
||||
|
@ -185,19 +183,14 @@
|
|||
<view>合计</view>
|
||||
<view class="price" v-if='cartInfo.pay_price<=0||userStore?.userInfo?.user_ship !=4'>¥<text
|
||||
style="font-size: 36rpx;">{{ cartInfo.total_price }}</text></view>
|
||||
<view class="price" v-else>¥<text style="font-size: 30rpx;">{{ cartInfo.total_price }}</text></view>
|
||||
<view class="price" v-if="cartInfo.pay_price>0 &&userStore?.userInfo?.user_ship == 4"><text
|
||||
style="font-size: 36rpx;">优惠后
|
||||
{{ cartInfo.pay_price }}</text></view>
|
||||
</view>
|
||||
<!-- <view class="row">
|
||||
<view style="color: #777;">原价 ¥50.00</view>
|
||||
<view class="price">优惠 ¥0.00</view>
|
||||
</view> -->
|
||||
<view style="font-size: 22rpx;text-indent: 3em;color: #F55726;"
|
||||
v-if="cartInfo.msg&&cartInfo.total_price>0 ">
|
||||
{{cartInfo.msg }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<up-button color="#20b128" :disabled="cartInfo.total_price < 500" @click="settleAccounts">
|
||||
{{ cartInfo.total_price < 500 ? "¥500起订" : "结算" }} </up-button>
|
||||
<up-button color="#20b128" @click="settleAccounts"> 结算</up-button>
|
||||
</view>
|
||||
<view class="cart" @click="navTo('/pages/cart/cart')">
|
||||
<image src="@/static/icon/cart.png"></image>
|
||||
|
@ -557,7 +550,8 @@
|
|||
const cartInfo = ref({
|
||||
total_price: '0.00',
|
||||
pay_price: 0,
|
||||
count: 0
|
||||
count: 0,
|
||||
msg: ''
|
||||
})
|
||||
const getCartList = (res) => {
|
||||
cartListApi({
|
||||
|
@ -567,6 +561,7 @@
|
|||
cartInfo.value = {
|
||||
total_price: res.data?.extend?.total_price || '0.00',
|
||||
pay_price: res.data?.extend?.pay_price || '0.00',
|
||||
msg: res.data?.extend?.msg || '',
|
||||
count: res.data?.count || 0
|
||||
}
|
||||
cartStore.setCartList(res.data?.lists.map(item => item.id))
|
||||
|
@ -980,8 +975,8 @@
|
|||
display: flex;
|
||||
|
||||
.shop-img {
|
||||
height: 120rpx;
|
||||
width: 120rpx;
|
||||
height: 164rpx;
|
||||
width: 164rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 14rpx;
|
||||
overflow: hidden;
|
||||
|
|
Loading…
Reference in New Issue