白屏,首页,霸王餐,网络完善
This commit is contained in:
@@ -65,12 +65,15 @@
|
||||
</view>
|
||||
<view class="info">
|
||||
<text class="productName">{{item.productName}}</text>
|
||||
<text class="productSkuName" v-if="item.productSkuName">{{item.productSkuName}}</text>
|
||||
<text class="productSkuName" v-if="item.skuName">{{item.skuName}}</text>
|
||||
</view>
|
||||
|
||||
<view class="price">
|
||||
<view class="priceAmount">
|
||||
¥{{orderVIP.isVip ==1 && ordershopUserInfo.isMemberPrice==1?(item.memberPrice|| item.price):item.price}}
|
||||
<text v-if="changeFreeenable">{{item.price}}</text>
|
||||
<text v-else>
|
||||
¥{{orderVIP.isVip ==1 && ordershopUserInfo.isMemberPrice==1?(item.memberPrice|| item.price):item.price}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="num">x{{item.num}}</view>
|
||||
</view>
|
||||
|
||||
@@ -212,41 +212,34 @@
|
||||
// 监听价格算法
|
||||
watchEffect(async () => {
|
||||
if (listinfo.combinedArray.length > 0) {
|
||||
console.log(11)
|
||||
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge
|
||||
try {
|
||||
let sum = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
||||
.value == 0 ? listinfo.Seatcharge : 0);
|
||||
console.log(listinfo.totalPrices,11)
|
||||
listinfo.originAmount = Math.round(sum * 100) / 100;
|
||||
// try {
|
||||
let sum = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
||||
.value == 0 ? listinfo.Seatcharge : 0);
|
||||
listinfo.originAmount = Math.round(sum * 100) / 100;
|
||||
|
||||
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge 商品卷Productroll 优惠卷coupondiscountAmount 积分listinfo.pointsDiscountAmount
|
||||
let sums = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
||||
.value ==
|
||||
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
|
||||
.coupondiscountAmount || 0) - (listinfo.pointsDiscountAmount || 0);
|
||||
listinfo.totalCost = Math.round(sums * 100) / 100;
|
||||
//总价格
|
||||
console.log(listinfo.combinedArray, listinfo.packFeess, listinfo.totalPrices, listinfo
|
||||
.Seatcharge, listinfo.Productroll, listinfo.coupondiscountAmount, sums)
|
||||
// 霸王餐
|
||||
try {
|
||||
// console.log(orderVIP.value.freeDineConfig.enable, changeFreeenable.value)
|
||||
if (orderVIP.value.freeDineConfig.enable && changeFreeenable.value) {
|
||||
listinfo.totalCost = (parseFloat(listinfo.totalCost) * parseFloat(orderVIP.value
|
||||
.freeDineConfig
|
||||
.rechargeTimes)).toFixed(2)
|
||||
}
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// 积分
|
||||
if (listinfo.totalCost && listinfo.status == 'unpaid' && orderVIP.value.id) {
|
||||
uni.$u.debounce(memberPointscalcUsablePoints, 500)
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
// 打包费packFeess 计算购物车商品费用totalPrices 餐位费Seatcharge 商品卷Productroll 优惠卷coupondiscountAmount 积分listinfo.pointsDiscountAmount
|
||||
let sums = (is_type.value != 0 ? listinfo.packFeess : 0) + listinfo.totalPrices + (is_type
|
||||
.value ==
|
||||
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
|
||||
.coupondiscountAmount || 0) - (listinfo.pointsDiscountAmount || 0);
|
||||
listinfo.totalCost = Math.round(sums * 100) / 100;
|
||||
//总价格
|
||||
// console.log(listinfo.combinedArray, listinfo.packFeess, listinfo.totalPrices, listinfo
|
||||
// .Seatcharge, listinfo.Productroll, listinfo.coupondiscountAmount, sums) // 霸王餐
|
||||
console.log(orderVIP.value.freeDineConfig.enable, changeFreeenable.value)
|
||||
if (orderVIP.value.freeDineConfig.enable && changeFreeenable.value) {
|
||||
listinfo.totalCost = (parseFloat(listinfo.totalCost) * parseFloat(orderVIP.value
|
||||
.freeDineConfig.rechargeTimes)).toFixed(2)
|
||||
}
|
||||
// 积分
|
||||
if (listinfo.totalCost && listinfo.status == 'unpaid' && orderVIP.value.id) {
|
||||
uni.$u.debounce(memberPointscalcUsablePoints, 500)
|
||||
}
|
||||
// } catch (error) {
|
||||
// //TODO handle the exception
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
@@ -259,22 +252,21 @@
|
||||
uniqueIds.value = [] // 筛选出商品卷的id
|
||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||
listinfo.pointsNum = 0 // 商品卷总价价格
|
||||
let res = cartStore.getTotalTotalPrices(listinfo.combinedArray, 1)
|
||||
// 商品价格
|
||||
listinfo.totalPrices = cartStore.getTotalTotalPrices(listinfo.combinedArray, false)
|
||||
// 支付方式切换
|
||||
// #ifdef MP-WEIXIN
|
||||
paymentMethodref.value.groupChanges(2)
|
||||
// paymentmethod.radiovalue = 2;
|
||||
// paymentmethod.paymentBtnText = "微信支付";
|
||||
// paymentmethod.payType = 'wechatPay';
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
paymentMethodref.value.groupChanges(3)
|
||||
// paymentmethod.radiovalue = 3;
|
||||
// paymentmethod.paymentBtnText = "支付宝支付";
|
||||
// paymentmethod.payType = 'wechatPay';
|
||||
// #endif
|
||||
} else {
|
||||
// 商品价格
|
||||
listinfo.totalPrices = cartStore.getTotalTotalPrices(listinfo.combinedArray)
|
||||
}
|
||||
changeFreeenable.value = e
|
||||
|
||||
}
|
||||
|
||||
const saveImage = (url) => {
|
||||
@@ -482,7 +474,6 @@
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
|
||||
orderorderInfo()
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
</view>
|
||||
<view class="item" @click="tabCut(-1)">
|
||||
<view class="num_item" :style="numIndex==-1?'background-color: #E8AD7B;':'' ">
|
||||
<up--input v-model="otherNum" @input="isOtherNum" @blur="blur()"
|
||||
border="none" type="nubmer" maxlength="3" placeholder='请输入..'></up--input>
|
||||
<up--input v-model="otherNum" @input="isOtherNum" @blur="blur()" border="none" type="nubmer"
|
||||
maxlength="3" placeholder='请输入..'></up--input>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<Loading :isLoading="isLoading" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
getCurrentInstance,
|
||||
nextTick
|
||||
} from 'vue'
|
||||
|
||||
import {
|
||||
@@ -46,6 +47,8 @@
|
||||
Storelogin
|
||||
} from '@/stores/user.js';
|
||||
|
||||
import Loading from '@/components/Loading.vue';
|
||||
|
||||
// 获取全局属性
|
||||
const {
|
||||
proxy
|
||||
@@ -55,6 +58,9 @@
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
|
||||
// 初始加载中
|
||||
const isLoading = ref(true);
|
||||
|
||||
const otherNum = ref('')
|
||||
|
||||
const numIndex = ref(0)
|
||||
@@ -125,6 +131,8 @@
|
||||
await store.scanCodeactions(getApp().globalData.tableCode)
|
||||
}
|
||||
// #endif
|
||||
await nextTick()
|
||||
isLoading.value = uni.cache.get('shopInfo').isTableFee == 0 ? false : true
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
v-for="(item1,index1) in item.productList" :key="index1">
|
||||
<image class="goodsImg" v-if="item1.coverImg!=null" :lazy-load="true"
|
||||
@load="imageLoaded(item1,index,index1)"
|
||||
:src="`${item1.coverImg}${!item1.imgLoad?'?x-oss-process=image/resize,m_lfit,w_300,h_300':''}`"
|
||||
:src="`${item1.coverImg}${!item1.imgLoad?'?x-oss-process=image/resize,m_lfit,w_150,h_150':''}`"
|
||||
mode="aspectFill"></image>
|
||||
<image class="goodsImg"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/1.gif" mode="" v-else
|
||||
@@ -363,7 +363,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
|
||||
<Loading :isLoading="isLoading" />
|
||||
</view>
|
||||
</template>
|
||||
@@ -457,8 +457,8 @@
|
||||
const showShopInfoRef = ref(null)
|
||||
|
||||
// 初始加载中
|
||||
const isLoading = ref(true);
|
||||
|
||||
const isLoading = ref(true);
|
||||
|
||||
//调用shop组件
|
||||
const callChildMethod = () => {
|
||||
if (showShopInfoRef.value) {
|
||||
@@ -466,7 +466,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
const shopExtend = uni.cache.get('shopTable').shopExtendMap.shopinfo_bg
|
||||
try {
|
||||
const shopExtend = uni.cache.get('shopTable').shopExtendMap.shopinfo_bg
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
// 计算高度
|
||||
const navScroll = ref(null)
|
||||
@@ -495,7 +499,7 @@
|
||||
const topArr = ref([])
|
||||
|
||||
// 填充高度,用于最后一项低于滚动区域时使用
|
||||
const fillHeight = ref(0)
|
||||
const fillHeight = ref(200)
|
||||
|
||||
//距离顶部的高度
|
||||
const scrollTopSize = ref(0)
|
||||
@@ -1022,7 +1026,7 @@
|
||||
product.cartNumber = cartItem.number
|
||||
product.cartListId = cartItem.id
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
// 遍历购物车数组
|
||||
@@ -1066,9 +1070,10 @@
|
||||
// 初始化
|
||||
if (Message.operate_type == "init") {
|
||||
cartList.value = Message.data
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
isLoading.value = false;
|
||||
},1000)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
// 清空购物车
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png">
|
||||
</image>
|
||||
<view class="my_list_item_name">积分</view>
|
||||
<view class="my_list_item_num">{{userInfo.accountPoints || userInfo.points}}</view>
|
||||
<view class="my_list_item_num">{{userInfo.accountPoints || 0}}</view>
|
||||
</view>
|
||||
<view class="my_list_item">
|
||||
<image class="my_list_item_icon"
|
||||
|
||||
Reference in New Issue
Block a user