购物车,订单,霸王餐
This commit is contained in:
parent
9da31e2faa
commit
5b8100aa64
|
|
@ -32,7 +32,8 @@ export const APIhistoryOrder = (data) => {
|
|||
return request({
|
||||
url: url + '/user/order/historyOrder',
|
||||
method: 'get',
|
||||
data: data
|
||||
data: data,
|
||||
toast: false
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,6 +312,10 @@ const useWebSocket = (options = {}) => {
|
|||
// 页面显示,尝试连接 WebSocket
|
||||
const onShowconnect = () => {
|
||||
if (autoReconnect.value) {
|
||||
uni.showLoading({
|
||||
title: `尝试再次连接`,
|
||||
mask: true
|
||||
})
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
<view class="paymentMethod">
|
||||
<view class="paymentMethod_content">
|
||||
<view class="paymentMethod_title">支付方式</view>
|
||||
<up-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :size="28"
|
||||
<up-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChanges" :size="28"
|
||||
placement="column">
|
||||
<block v-for="(item,index) in paymentMethodList" :key="index">
|
||||
<view class="method_list" @click="groupChange(item.type)">
|
||||
<view class="method_list" @click="groupChanges(item.type)" v-if="index == 0?!changeFreeenable:true">
|
||||
<view class="method_list_top">
|
||||
<view class="method_list_top_left">
|
||||
<image class="icon" :src="item.url" mode="aspectFill" />
|
||||
|
|
@ -38,7 +38,8 @@
|
|||
computed,
|
||||
defineEmits,
|
||||
watch,
|
||||
watchEffect
|
||||
watchEffect,
|
||||
defineExpose
|
||||
} from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -53,10 +54,15 @@
|
|||
freeCheck: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
changeFreeenable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
const orderVIP = ref(uni.cache.get('orderVIP'))
|
||||
const emits = defineEmits(['customevent', 'groupChange']);
|
||||
|
||||
|
|
@ -113,7 +119,7 @@
|
|||
const storeInfo = ref({})
|
||||
|
||||
// * 监听支付方式切换
|
||||
const groupChange = (type) => {
|
||||
const groupChanges = (type) => {
|
||||
if (props.freeCheck && type == 1) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -132,6 +138,10 @@
|
|||
shopId: orderVIP.value.shopId
|
||||
})
|
||||
}
|
||||
// 将方法暴露给父组件
|
||||
defineExpose({
|
||||
groupChanges
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-item"
|
||||
<!-- <view class="cell-item"
|
||||
v-if="listinfo && listinfo.pointsDiscountAmount && listinfo.pointsDiscountAmount > 0">
|
||||
<view class="label">积分抵扣</view>
|
||||
<view class="val">
|
||||
|
|
@ -179,7 +179,7 @@
|
|||
<view style="font-size: 28rpx;">¥</view>
|
||||
<view>{{listinfo.pointsDiscountAmount.toFixed(2)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</block>
|
||||
|
||||
<view class="total-wrap">
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
||||
<text class="t">订单编号:</text>
|
||||
<text class="info"
|
||||
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{listinfo.orderNo}}(点击复制)</text>
|
||||
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{listinfo.orderNo}}(点击复制)</text>
|
||||
</view>
|
||||
<view class="row">
|
||||
<text class="t">下单时间:</text>
|
||||
|
|
@ -316,7 +316,12 @@
|
|||
default: {
|
||||
isTableFee: 0
|
||||
}
|
||||
},
|
||||
changeFreeenable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const is_type = ref(0)
|
||||
|
|
@ -337,8 +342,23 @@
|
|||
|
||||
}
|
||||
|
||||
// 清空
|
||||
const bwcclear = () => {
|
||||
IntegralInputclose()
|
||||
// 清空优惠卷
|
||||
favorablelist[1].value = ''
|
||||
favorablelist[0].value = ''
|
||||
}
|
||||
|
||||
// 跳转
|
||||
const goUrl = (item) => {
|
||||
if (props.changeFreeenable) {
|
||||
uni.showToast({
|
||||
title: '不可与其他优惠共享!',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
switch (item.type) {
|
||||
case 'coupon':
|
||||
// 清空积分
|
||||
|
|
@ -433,7 +453,8 @@
|
|||
// 将方法暴露给父组件
|
||||
defineExpose({
|
||||
dataprocessing,
|
||||
getCalcUsablePoints
|
||||
getCalcUsablePoints,
|
||||
bwcclear
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -701,6 +722,7 @@
|
|||
}
|
||||
|
||||
.shop-info {
|
||||
padding-top: 28rpx;
|
||||
border-bottom: 2rpx dashed #e5e5e5;
|
||||
|
||||
.item:nth-child(1) {
|
||||
|
|
|
|||
|
|
@ -4,99 +4,84 @@
|
|||
<view class="rechargeFree_bg" @click="changeFree">
|
||||
<view class="left">
|
||||
<view class="icon">优惠</view>
|
||||
<view class="text">充值消费{{freeDingConfig.rechargeTimes}}倍(订单满¥{{freeDingConfig.rechargeThreshold}}元可用),本单立享免单!</view>
|
||||
<view class="text">
|
||||
充值消费{{freeDineConfig.rechargeTimes}}倍(订单满¥{{freeDineConfig.rechargeThreshold}}元可用),本单立享免单!</view>
|
||||
</view>
|
||||
<u-checkbox-group iconPlacement="right" >
|
||||
<u-checkbox :disabled="freeDisabled" v-model="rechargeFreeChecked" :checked="rechargeFreeChecked" @change="changeFree" activeColor="#E8AD7B" shape="circle" icon-size="36" size="36">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<up-checkbox :disabled="!freeDineConfig.enable" @change="change" shape="circle" usedAlone v-model:checked="changeFreeenable" icon-size="20" size="20">
|
||||
</up-checkbox>
|
||||
<!-- <up-checkbox-group iconPlacement="right">
|
||||
<up-checkbox : v-model="changeFreeenable"
|
||||
:checked="freeDineConfig.enable" @change="change" activeColor="#E8AD7B" shape="circle"
|
||||
icon-size="16" size="16">
|
||||
</up-checkbox>
|
||||
</up-checkbox-group> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
freeDisabled: false,
|
||||
}
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
defineProps,
|
||||
defineEmits
|
||||
} from 'vue';
|
||||
|
||||
// 定义接收的属性
|
||||
const props = defineProps({
|
||||
freeDineConfig: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
props:{
|
||||
shopUserInfo:{
|
||||
type: Object
|
||||
},
|
||||
freeDingConfig:{
|
||||
type: Object
|
||||
},
|
||||
payAmount: {
|
||||
type: Number
|
||||
},
|
||||
rechargeFreeChecked: {
|
||||
type: Boolean
|
||||
},
|
||||
|
||||
payAmount: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
watch: {
|
||||
payAmount (newVal) {
|
||||
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||
this.freeDisabled = true
|
||||
} else {
|
||||
this.freeDisabled = false
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
|
||||
this.freeDisabled = true
|
||||
} else {
|
||||
this.freeDisabled = false
|
||||
}
|
||||
console.log(this.freeDisabled )
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 监听是否免单
|
||||
*/
|
||||
changeFree ( e ) {
|
||||
if ( this.freeDisabled ) {
|
||||
return;
|
||||
}
|
||||
this.$emit("changeFree",this.rechargeFreeChecked)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const emits = defineEmits(['changeFree']);
|
||||
|
||||
const changeFreeenable = ref(false)
|
||||
|
||||
/**
|
||||
* 监听是否免单
|
||||
*/
|
||||
const change = (e) => {
|
||||
emits('changeFree', e);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// 充值免单
|
||||
.rechargeFree{
|
||||
<style lang="scss" scoped>
|
||||
.rechargeFree {
|
||||
// padding: 0 20rpx;
|
||||
margin-top: 32rpx;
|
||||
.rechargeFree_bg{
|
||||
|
||||
.rechargeFree_bg {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
background-color: #fff;
|
||||
.left{
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon{
|
||||
|
||||
.icon {
|
||||
width: 68rpx;
|
||||
height: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 36rpx;
|
||||
background: linear-gradient( 180deg, #FEDE81 0%, #FEB263 100%);
|
||||
background: linear-gradient(180deg, #FEDE81 0%, #FEB263 100%);
|
||||
border-radius: 12rpx 0rpx 12rpx 0rpx;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #FFFFFF;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.text{
|
||||
width: 90%;
|
||||
|
||||
.text {
|
||||
width: 80%;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
|
@ -104,5 +89,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
@ -80,6 +80,7 @@
|
|||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
|
|
@ -113,7 +114,7 @@
|
|||
|
||||
// 去使用优惠券
|
||||
const navigatorGo = (item) => {
|
||||
console.log(Orderinfo.payAmount, item)
|
||||
// console.log(Orderinfo.payAmount, item)
|
||||
if (Orderinfo.payAmount < item.fullAmount) {
|
||||
uni.showToast({
|
||||
title: "当前订单金额不足使用金额",
|
||||
|
|
@ -138,6 +139,23 @@
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 计算合并后的数组 num相加
|
||||
const mergedArray = computed(() => {
|
||||
const map = new Map();
|
||||
Orderinfo.shoppingCart.forEach(item => {
|
||||
if (map.has(item.productId)) {
|
||||
const existingItem = map.get(item.productId);
|
||||
existingItem.num += item.num;
|
||||
} else {
|
||||
map.set(item.productId, {
|
||||
...item
|
||||
});
|
||||
}
|
||||
});
|
||||
return Array.from(map.values());
|
||||
});
|
||||
|
||||
const Selectedlist = ref([])
|
||||
|
||||
// 商品卷
|
||||
|
|
@ -146,12 +164,31 @@
|
|||
if (!item.show) {
|
||||
return false;
|
||||
}
|
||||
console.log(Orderinfo.shoppingCart)
|
||||
if (Orderinfo.shoppingCart.length < Selectedlist.value.length) {
|
||||
// 查找选中的数组里面 统计指定 id 的重复次数
|
||||
const count = Selectedlist.value.filter(item => item.id === item.id).length;
|
||||
|
||||
// 查找选中的数组里面 统计指定 id 的重复次数
|
||||
const foundObject = mergedArray.value.find(i => i.productId === item.proId)
|
||||
if (foundObject.num <= count) {
|
||||
uni.showToast({
|
||||
title: '不可多余下单参数哦!'
|
||||
title: '不可多余商品!',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
// 查找选中的数组里面 统计指定 id 的重复次数
|
||||
|
||||
console.log(mergedArray.value)
|
||||
console.log(item)
|
||||
console.log(Selectedlist.value)
|
||||
console.log(Orderinfo.shoppingCart)
|
||||
// if (Orderinfo.shoppingCart.length <= Selectedlist.value.length) {
|
||||
// uni.showToast({
|
||||
// title: '不可多余下单数!',
|
||||
// icon:'none'
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (item.Selected) {
|
||||
Selectedlist.value = Selectedlist.value.filter(i => i.id !== item.id)
|
||||
|
|
@ -251,15 +288,12 @@
|
|||
};
|
||||
});
|
||||
}
|
||||
console.log(res)
|
||||
if (res.length > 0) {
|
||||
fromInfo.list = res
|
||||
} else {
|
||||
fromInfo.list = []
|
||||
return false
|
||||
}
|
||||
console.log(res)
|
||||
|
||||
}
|
||||
// 商品取消
|
||||
const cancelCoupon = () => {
|
||||
|
|
@ -296,12 +330,8 @@
|
|||
|
||||
uni.setNavigationBarTitle({
|
||||
title: Orderinfo.typeOrder == 2 ? '商品卷' : '优惠卷',
|
||||
success: () => {
|
||||
console.log('导航栏标题修改成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('导航栏标题修改失败', err);
|
||||
}
|
||||
success: () => {},
|
||||
fail: (err) => {}
|
||||
});
|
||||
|
||||
Orderinfo.shopUserId = options.shopUserId
|
||||
|
|
|
|||
|
|
@ -36,39 +36,18 @@
|
|||
<!-- x详情 -->
|
||||
<orderInfoAfter ref="orderInfoAfterRef" :rechargeFreeChecked="rechargeFreeChecked" :freeCheck="freeCheck"
|
||||
:listinfo="listinfo" :orderVIP="orderVIP" :ordershopUserInfo='ordershopUserInfo' @istype="istype"
|
||||
@clickPointsamount='clickPointsamount' @learcoupons="learcoupons">
|
||||
@clickPointsamount='clickPointsamount' @learcoupons="learcoupons" :changeFreeenable='changeFreeenable'>
|
||||
</orderInfoAfter>
|
||||
|
||||
<!-- 充值免单 -->
|
||||
<!-- <block v-if="listinfo.useType == 'dine-in-after'">
|
||||
<rechargeFree
|
||||
:rechargeFreeChecked="rechargeFreeChecked"
|
||||
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||
ref="rechargeFree"
|
||||
:freeDisabled="freeDisabled"
|
||||
:payAmount="listinfo.payAmount"
|
||||
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
|
||||
</block>
|
||||
<block v-else>
|
||||
<rechargeFree
|
||||
:rechargeFreeChecked="rechargeFreeChecked"
|
||||
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(!listinfo.couponInfoList&&listinfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||
ref="rechargeFree"
|
||||
:freeDisabled="freeDisabled"
|
||||
:payAmount="listinfo.payAmount"
|
||||
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
|
||||
|
||||
</block> -->
|
||||
<!-- 霸王餐 -->
|
||||
<rechargeFree :freeDineConfig="orderVIP.freeDineConfig" :payAmount="listinfo.totalPrices"
|
||||
v-if="listinfo.status == 'unpaid' && orderVIP.freeDineConfig.enable" @changeFree="changeFree">
|
||||
</rechargeFree>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange"
|
||||
v-if="listinfo.status == 'unpaid'">
|
||||
:changeFreeenable='changeFreeenable' v-if="listinfo.status == 'unpaid'">
|
||||
</paymentMethodes>
|
||||
<!-- <paymentMethodes ref="paymentMethodes" :rechargeFreeChecked="rechargeFreeChecked"
|
||||
v-if="orderVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck"
|
||||
:payAmount="listinfo.payAmount" :orderVIP="orderVIP" @groupChange="groupChange"></paymentMethodes> -->
|
||||
|
||||
|
||||
<view class="fixedview">
|
||||
<view class="flex-between" v-if="listinfo.status == 'unpaid'">
|
||||
<view class="fixedview_one flex-start">
|
||||
|
|
@ -77,8 +56,13 @@
|
|||
<text>¥</text>{{listinfo.totalCost}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fixedview_tow" @tap="$u.debounce(goToPay,1000)">
|
||||
{{paymentmethod.paymentBtnText}}
|
||||
<view class="flex-colum-end">
|
||||
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders,1000)">
|
||||
{{paymentmethod.paymentBtnText}}
|
||||
</view>
|
||||
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
|
||||
取消订单
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -97,11 +81,12 @@
|
|||
} from 'vue';
|
||||
|
||||
import {
|
||||
APIgetOrderById
|
||||
APIgetOrderById,
|
||||
APIputuserorder,
|
||||
APIhistoryOrder
|
||||
} from '@/common/api/order/index.js'
|
||||
|
||||
import {
|
||||
APIusershopInfodetail,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
|
|
@ -131,7 +116,7 @@
|
|||
import payPassword from '@/components/payPassword.vue'
|
||||
import orderInfoAfter from './components/orderInfoAfter.vue'
|
||||
// import orderInfoBefore from '../components/orderInfoBefore.vue'
|
||||
// import rechargeFree from '../components/rechargeFree.vue'
|
||||
import rechargeFree from './components/rechargeFree.vue'
|
||||
import paymentMethodes from '@/components/paymentMethod.vue'; //支付方式
|
||||
import {
|
||||
onBackPress
|
||||
|
|
@ -186,13 +171,13 @@
|
|||
})
|
||||
if (res) {
|
||||
Object.assign(listinfo, res);
|
||||
if (listinfo.status == 'unpaid') {
|
||||
try {
|
||||
let res = await APIhistoryOrder({
|
||||
orderId: orderId.value
|
||||
})
|
||||
} catch (error) {}
|
||||
}
|
||||
// if (listinfo.status == 'unpaid') {
|
||||
// try {
|
||||
// let res = await APIhistoryOrder({
|
||||
// orderId: orderId.value
|
||||
// })
|
||||
// } catch (error) {}
|
||||
// }
|
||||
// 历史订单
|
||||
if (listinfo.detailMap) {
|
||||
let combinedArray = [];
|
||||
|
|
@ -245,6 +230,13 @@
|
|||
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
|
||||
.coupondiscountAmount || 0) - (listinfo.pointsDiscountAmount || 0);
|
||||
listinfo.totalCost = Math.round(sums * 100) / 100;
|
||||
// 霸王餐
|
||||
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') {
|
||||
uni.$u.debounce(memberPointscalcUsablePoints, 500)
|
||||
|
|
@ -256,6 +248,34 @@
|
|||
}
|
||||
});
|
||||
|
||||
// 霸王餐
|
||||
const changeFreeenable = ref(false)
|
||||
|
||||
const changeFree = (e) => {
|
||||
console.log(e)
|
||||
if (e) {
|
||||
uniqueIds.value = [] // 筛选出商品卷的id
|
||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||
listinfo.Productroll = 0 // 商品卷总价价格
|
||||
uniqueIds.value = [] // 筛选出商品卷的id
|
||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||
// 支付方式切换
|
||||
// #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
|
||||
}
|
||||
changeFreeenable.value = e
|
||||
}
|
||||
|
||||
const saveImage = (url) => {
|
||||
uni.saveImage({
|
||||
url: url,
|
||||
|
|
@ -268,6 +288,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
//
|
||||
const paymentMethodref = ref(null)
|
||||
|
||||
// 支付方式切换
|
||||
const paymentmethod = reactive({
|
||||
radiovalue: 2,
|
||||
|
|
@ -330,8 +353,52 @@
|
|||
}
|
||||
}
|
||||
|
||||
// 删除订单
|
||||
const APIputuserorderclick = async () => {
|
||||
await APIputuserorder(listinfo.id)
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const istoricalorders = async () => {
|
||||
console.log(paymentmethod.payType, '1212')
|
||||
// 先调用历史订单
|
||||
let APIhistoryOrderres = await APIhistoryOrder({
|
||||
tableCode: listinfo.tableCode
|
||||
})
|
||||
// 判断是否有历史订单
|
||||
if (APIhistoryOrderres.detailMap) {
|
||||
let combinedArray = [];
|
||||
for (const key in APIhistoryOrderres.detailMap) {
|
||||
if (APIhistoryOrderres.detailMap.hasOwnProperty(key)) {
|
||||
let subArray = APIhistoryOrderres.detailMap[key];
|
||||
combinedArray = [...combinedArray, ...subArray]
|
||||
}
|
||||
}
|
||||
// 判断支付之前是是否还有新加订单
|
||||
if (listinfo.combinedArray.length === combinedArray.length) {
|
||||
goToPay()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '你的订单已更新!',
|
||||
icon: 'none'
|
||||
})
|
||||
orderorderInfo()
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '你的小伙伴已提交订单~',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
orderorderInfo()
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
// * 去支付
|
||||
const goToPay = async () => {
|
||||
// 霸王餐
|
||||
|
||||
// 余额支付
|
||||
if (paymentmethod.payType == 'accountPay') {
|
||||
if (orderVIP.value.isVip == 0) {
|
||||
|
|
@ -369,34 +436,48 @@
|
|||
}
|
||||
return false
|
||||
}
|
||||
let checkOrderPay = {
|
||||
orderId: orderId.value,
|
||||
vipPrice: orderVIP.value.isVip == 1 && ordershopUserInfo.value.isMemberPrice == 1 ? 1 :
|
||||
0, //是否使用会员价0否1是
|
||||
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //用餐人数
|
||||
originAmount: listinfo.originAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||
discountAmount: 0, //手动优惠金额 写死0
|
||||
productCouponDiscountAmount: listinfo.Productroll, //商品优惠券抵扣金额
|
||||
fullCouponDiscountAmount: listinfo.coupondiscountAmount, //满减优惠券抵扣金额
|
||||
couponList: uniqueIds.value, //用户使用的卡券
|
||||
orderAmount: listinfo.totalCost, // 最中订单金额
|
||||
roundAmount: 0, //抹零金额 减免多少钱
|
||||
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
||||
remark: '', //用户备注
|
||||
}
|
||||
try {
|
||||
await storeMemberpay.actionsltPayOrder({
|
||||
checkOrderPay,
|
||||
payType: paymentmethod.payType,
|
||||
buyerRemark: '',
|
||||
returnUrl: ''
|
||||
if (orderVIP.value.freeDineConfig.enable && changeFreeenable.value) {
|
||||
await storeMemberpay.actionspayltPayVip({
|
||||
shopId: orderVIP.value.shopId,
|
||||
shopUserId: orderVIP.value.id,
|
||||
orderId: orderId.value,
|
||||
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||
amount: listinfo.totalCost, // 最终订单金额
|
||||
returnUrl: '', //跳转地址
|
||||
buyerRemark: ''
|
||||
})
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
return false;
|
||||
} else {
|
||||
let checkOrderPay = {
|
||||
orderId: orderId.value,
|
||||
vipPrice: orderVIP.value.isVip == 1 && ordershopUserInfo.value.isMemberPrice == 1 ? 1 :
|
||||
0, //是否使用会员价0否1是
|
||||
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //用餐人数
|
||||
originAmount: listinfo.originAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||
discountAmount: 0, //手动优惠金额 写死0
|
||||
productCouponDiscountAmount: listinfo.Productroll, //商品优惠券抵扣金额
|
||||
fullCouponDiscountAmount: listinfo.coupondiscountAmount, //满减优惠券抵扣金额
|
||||
couponList: uniqueIds.value, //用户使用的卡券
|
||||
orderAmount: listinfo.totalCost, // 最终订单金额
|
||||
roundAmount: 0, //抹零金额 减免多少钱
|
||||
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
||||
remark: '', //用户备注
|
||||
}
|
||||
try {
|
||||
await storeMemberpay.actionsltPayOrder({
|
||||
checkOrderPay,
|
||||
payType: paymentmethod.payType,
|
||||
buyerRemark: '',
|
||||
returnUrl: ''
|
||||
})
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
|
||||
orderorderInfo()
|
||||
}
|
||||
|
||||
|
|
@ -906,6 +987,7 @@
|
|||
left: 0;
|
||||
width: 100%;
|
||||
|
||||
// height: 80rpx;
|
||||
.flex-between {
|
||||
width: 100%;
|
||||
padding: 36rpx 54rpx 102rpx 54rpx;
|
||||
|
|
@ -932,14 +1014,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
.fixedview_tow {
|
||||
background: #E3AD7F;
|
||||
border-radius: 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 14rpx 44rpx;
|
||||
.flex-colum-end {
|
||||
.fixedview_tow {
|
||||
background: #E3AD7F;
|
||||
border-radius: 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 14rpx 44rpx;
|
||||
}
|
||||
|
||||
.fixedview_tows {
|
||||
background: #c3c3c3;
|
||||
border-radius: 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 14rpx 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -145,6 +145,7 @@
|
|||
product_id: item.id,
|
||||
sku_id: item.skuId,
|
||||
number: await calculateValue(item.cartNumber, i),
|
||||
is_print: 1,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<Nav />
|
||||
<!-- 顶部面板 -->
|
||||
<view class="top--panel">
|
||||
<view class="top--panel" :class="{ 'grayscale':!isBusinessTime }">
|
||||
<image class="panelimgbackground"
|
||||
:src="shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'"
|
||||
mode="aspectFill">
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 滚动区域 -->
|
||||
<view class="scroll-panel" id="scroll-panel">
|
||||
<view class="scroll-panel" id="scroll-panel" :class="{ 'grayscale':!isBusinessTime }">
|
||||
<view class="list-box">
|
||||
<view class="left" :style="{top: `${store.height}px`}">
|
||||
<scroll-view :scroll-into-view="leftIntoView" :scroll-with-animation="false" :scroll-y="true"
|
||||
|
|
@ -319,7 +319,8 @@
|
|||
</view>
|
||||
<view class="operation-wrap">
|
||||
<view class="btn">
|
||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
||||
v-if="shopCartNumber>0"></up-icon>
|
||||
<view class="btnClick" @click="shopCart('-')">
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -611,28 +612,35 @@
|
|||
const selectSpec = async (specType, option) => {
|
||||
// 规格清零
|
||||
shopCartNumber.value = 0
|
||||
|
||||
// 更新 selectedSpecs 对象,将当前规格类型的选中值设置为用户点击的选项
|
||||
selectedSpecs.value = {
|
||||
...selectedSpecs.value,
|
||||
[specType]: option
|
||||
};
|
||||
if (allSpecsSelected.value) {
|
||||
try {
|
||||
let result = await APIminiAppskuinfo({
|
||||
specInfo: selectedSpecsStr.value,
|
||||
id: specifications.item.id
|
||||
});
|
||||
specifications.sku_id = result.id
|
||||
specifications.product_id = result.productId
|
||||
// 添加多规格分组
|
||||
specifications.item.result = result
|
||||
if (result.isPauseSale == 0) {
|
||||
canSubmit.value = true;
|
||||
// skuBtnText.value = '添加到购物车'
|
||||
}
|
||||
} catch (error) {
|
||||
canSubmit.value = false;
|
||||
const newSelectedSpecs = {};
|
||||
const specKeys = Object.keys(specifications.item.selectSpecInfo);
|
||||
for (const key of specKeys) {
|
||||
if (key === specType) {
|
||||
newSelectedSpecs[key] = option;
|
||||
} else {
|
||||
newSelectedSpecs[key] = selectedSpecs.value[key];
|
||||
}
|
||||
}
|
||||
selectedSpecs.value = newSelectedSpecs;
|
||||
if (allSpecsSelected.value) {
|
||||
// try {
|
||||
let result = await APIminiAppskuinfo({
|
||||
specInfo: selectedSpecsStr.value,
|
||||
id: specifications.item.id
|
||||
});
|
||||
specifications.sku_id = result.id
|
||||
specifications.product_id = result.productId
|
||||
// 添加多规格分组
|
||||
specifications.item.result = result
|
||||
if (result.isPauseSale == 0) {
|
||||
canSubmit.value = true;
|
||||
// skuBtnText.value = '添加到购物车'
|
||||
}
|
||||
// } catch (error) {
|
||||
// canSubmit.value = false;
|
||||
// }
|
||||
} else {
|
||||
canSubmit.value = false;
|
||||
}
|
||||
|
|
@ -691,12 +699,17 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
// 计算所有选中条件是否都符合
|
||||
// 计算所有选中条件是否都符合
|
||||
const allConditionsSatisfied = computed(() => {
|
||||
return specifications.item.groupSnap.every((setmenu, index) => {
|
||||
// 检查 specifications.item.groupSnap 是否存在
|
||||
if (!specifications.item?.groupSnap) {
|
||||
return false;
|
||||
}
|
||||
return specifications.item.groupSnap.every((optionGroup, index) => {
|
||||
// 获取当前索引对应的已选选项,如果不存在则默认为空数组
|
||||
const selected = selectedOptions.value[index] || [];
|
||||
// 检查是否达到最大选择数量
|
||||
const hasEnoughSelection = selected.length === setmenu.number;
|
||||
const hasEnoughSelection = selected.length === optionGroup.number;
|
||||
return hasEnoughSelection;
|
||||
});
|
||||
});
|
||||
|
|
@ -836,7 +849,8 @@
|
|||
shopCartNumber.value,
|
||||
pro_group_info: selectedGroupSnap.value,
|
||||
goods_type: specifications.item.type == "package" ? 'package' : '',
|
||||
is_print: 1
|
||||
is_print: 1,
|
||||
product_type: specifications.item.type
|
||||
})
|
||||
// 清空套餐选中
|
||||
selectedGroupSnap.value = []
|
||||
|
|
@ -884,6 +898,7 @@
|
|||
|
||||
// 单规格
|
||||
const singleclick = async (item, i) => {
|
||||
console.log(item, i)
|
||||
// 判断购物车是否有该选中商品
|
||||
let res = await matchingProduct(item)
|
||||
websocketsendMessage({
|
||||
|
|
@ -895,7 +910,8 @@
|
|||
product_id: item.id,
|
||||
sku_id: item.skuId,
|
||||
number: await calculateValue(item.cartNumber, i),
|
||||
is_print: 1
|
||||
is_print: 1,
|
||||
product_type: item.type
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -1017,7 +1033,9 @@
|
|||
|
||||
// 删除除购物车
|
||||
if (Message.operate_type == 'del' && Message.status == 1) {
|
||||
cartList.value = cartList.value.filter(item => item.id != Message.data.id);
|
||||
// 优化:使用可选链操作符避免报错
|
||||
cartList.value = cartList.value.filter(item => item.id !== Message.data?.id);
|
||||
// cartList.value = cartList.value.filter(item => item.id != Message.data.id);
|
||||
}
|
||||
|
||||
// 添加或者减少购物后返回
|
||||
|
|
@ -1084,49 +1102,6 @@
|
|||
}
|
||||
if (cartItem.is_temporary === 1) {
|
||||
return [{
|
||||
// cartListId: 5309
|
||||
// cartListinfo: Proxy {id: 5309, shop_id: 203, table_code: "40309814459", sku_id: 2863, product_id: 1273, …}
|
||||
// cartNumber: "2.00"
|
||||
// coverImg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/490de935cc9042bfa56d0c392f806484.jpg"
|
||||
// groupType: null
|
||||
// id: "1273"
|
||||
// isHot: 1
|
||||
// isSaleTime: 1
|
||||
// isSoldStock: 0
|
||||
// memberPrice: 0.88
|
||||
// name: "连衣裙"
|
||||
// originPrice: 0.88
|
||||
// packFee: 0
|
||||
// salePrice: 2.88
|
||||
// skuId: "2863"
|
||||
// skuList: Proxy {0: {…}}
|
||||
// stockNumber: 0
|
||||
// suitNum: 1
|
||||
// type: "single"
|
||||
// unitName: "个"
|
||||
|
||||
// cartListId: 5324
|
||||
// cartListinfo: Proxy {id: 5324, shop_id: 203, table_code: "40309814459", sku_id: 0, product_id: -74982031, …}
|
||||
// cartNumber: "25.00"
|
||||
// create_time: "2025-03-18 15:05:37"
|
||||
// discount_sale_amount: "357.00"
|
||||
// discount_sale_note: ""
|
||||
// id: 5324
|
||||
// is_gift: 0
|
||||
// is_print: 0
|
||||
// is_temporary: 1
|
||||
// is_wait_call: 0
|
||||
// number: "25.00"
|
||||
// pack_number: "0.00"
|
||||
// pro_group_info: ""
|
||||
// product_id: -74982031
|
||||
// product_name: "零食吃"
|
||||
// remark: ""
|
||||
// shop_id: 203
|
||||
// sku_id: 0
|
||||
// sku_name: "VB宝贝"
|
||||
// table_code: "40309814459"
|
||||
// update_time: null
|
||||
...cartItem,
|
||||
memberPrice: cartItem.discount_sale_amount,
|
||||
salePrice: cartItem.discount_sale_amount,
|
||||
|
|
@ -1174,7 +1149,7 @@
|
|||
}
|
||||
}, 0);
|
||||
// 向上取整并保留两位小数
|
||||
return cart = Math.ceil(cart * 100) / 100;
|
||||
return parseFloat(cart.toFixed(2));
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
|
|
@ -1250,6 +1225,54 @@
|
|||
}));
|
||||
})
|
||||
|
||||
// // 获取当前时间
|
||||
// const getCurrentDateTime = () => {
|
||||
// const now = new Date();
|
||||
// const dayOfWeek = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'][now.getDay()];
|
||||
// const hours = now.getHours().toString().padStart(2, '0');
|
||||
// const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
// const currentTime = `${hours}:${minutes}`;
|
||||
// return {
|
||||
// dayOfWeek,
|
||||
// currentTime
|
||||
// };
|
||||
// };
|
||||
// // 计算是否在营业时间内
|
||||
// const isBusinessTime = computed(() => {
|
||||
// const {
|
||||
// dayOfWeek,
|
||||
// currentTime
|
||||
// } = getCurrentDateTime();
|
||||
// console.log(shopInfo)
|
||||
// const [startDay, endDay] = [shopInfo.businessStartDay, shopInfo.businessEndDay];
|
||||
// const [startTime, endTime] = shopInfo.businessTime.split('-');
|
||||
|
||||
// const dayIndex = ['周一', '周二', '周三', '周四', '周五', '周六', '周天'].indexOf(dayOfWeek);
|
||||
// const startDayIndex = ['周一', '周二', '周三', '周四', '周五', '周六', '周天'].indexOf(startDay);
|
||||
// const endDayIndex = ['周一', '周二', '周三', '周四', '周五', '周六', '周天'].indexOf(endDay);
|
||||
// console.log(shopInfo.businessTime, 1111)
|
||||
// const isInDayRange = dayIndex >= startDayIndex && dayIndex <= endDayIndex;
|
||||
// const isInTimeRange = currentTime >= startTime && currentTime <= endTime;
|
||||
// console.log(isInDayRange, isInTimeRange, 1111)
|
||||
// return isInDayRange && isInTimeRange;
|
||||
// });
|
||||
|
||||
// 获取当前时间
|
||||
const getCurrentTime = () => {
|
||||
const now = new Date();
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
return `${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
// 计算是否在营业时间内
|
||||
const isBusinessTime = computed(() => {
|
||||
const currentTime = getCurrentTime();
|
||||
const [startTime, endTime] = shopInfo.businessTime.split('-');
|
||||
return currentTime >= startTime && currentTime <= endTime;
|
||||
});
|
||||
|
||||
|
||||
// 列表请求
|
||||
const productqueryProduct = async () => {
|
||||
try {
|
||||
|
|
@ -1272,9 +1295,10 @@
|
|||
// userStore.actionsAPIuser()
|
||||
// 数据可以更新
|
||||
isDataLoaded.value = true;
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '错误二维码'
|
||||
title: '暂无列表数据...'
|
||||
});
|
||||
isDataLoaded.value = false;
|
||||
setTimeout(() => {
|
||||
|
|
@ -1307,20 +1331,6 @@
|
|||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const options = currentPage.options;
|
||||
|
||||
// // #ifdef MP-WEIXIN
|
||||
// if (options.q) {
|
||||
// console.log(options.q)
|
||||
// const store = productStore();
|
||||
// await store.scanCodeactions(options.q)
|
||||
// }
|
||||
// // #endif
|
||||
// // #ifdef MP-ALIPAY
|
||||
// if (getApp().globalData.tableCode) {
|
||||
// await store.scanCodeactions(getApp().globalData.tableCode)
|
||||
// }
|
||||
// // #endif
|
||||
|
||||
await productqueryProduct()
|
||||
setTimeout(() => {
|
||||
// 启动网络监听
|
||||
|
|
@ -1331,6 +1341,11 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.grayscale {
|
||||
filter: grayscale(100%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.top--panel {
|
||||
// padding: 0 20rpx;
|
||||
background-color: #fff;
|
||||
|
|
@ -1920,9 +1935,12 @@
|
|||
border-bottom: 2rpx solid #F0F0F0;
|
||||
}
|
||||
|
||||
.shop_sku_box:last-child {
|
||||
padding-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.shop_sku_box {
|
||||
padding: 20rpx 28rpx;
|
||||
padding: 20rpx;
|
||||
|
||||
.shop_sku_box_name {
|
||||
margin-top: 20rpx;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,9 @@
|
|||
}
|
||||
|
||||
// 去使用优惠券
|
||||
const navigatorGo = (item) => {}
|
||||
const navigatorGo = (item) => {
|
||||
uni.pro.switchTab('index/index')
|
||||
}
|
||||
|
||||
const getCouponList = async () => {
|
||||
let res = await APIcouponfindByUserId({
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
res = await APIshopUserpointsRecord({
|
||||
page: formData.form.page,
|
||||
size: formData.form.size,
|
||||
status: formData.status
|
||||
status: formData.form.status
|
||||
})
|
||||
}
|
||||
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
align-items: center;
|
||||
color: #333;
|
||||
margin-top: -60rpx;
|
||||
padding: 0 120rpx;
|
||||
// padding: 0 120rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.fonts {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@
|
|||
|
||||
import {
|
||||
APIuseractivate,
|
||||
APIusershopInfodetail,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
|
|
@ -250,7 +249,7 @@
|
|||
uni.pro.navigateTo(item.url, {
|
||||
shopId: infoForn.shopId,
|
||||
type: item.name == '明细' ? 1 : 2,
|
||||
shopInfo: JSON.stringify(infoForn.userInfo.shopInfo)
|
||||
shopInfo: JSON.stringify(infoForn.userInfo)
|
||||
})
|
||||
|
||||
// uni.navigateTo({
|
||||
|
|
@ -320,7 +319,7 @@
|
|||
});
|
||||
return false;
|
||||
}
|
||||
console.log({
|
||||
await store.actionspayltPayVip({
|
||||
shopId: infoForn.shopId,
|
||||
activateId: infoForn.id,
|
||||
shopUserId: infoForn.userInfo.id,
|
||||
|
|
@ -328,15 +327,6 @@
|
|||
returnUrl: '', //跳转地址
|
||||
buyerRemark: ''
|
||||
})
|
||||
let res = await store.actionspayltPayVip({
|
||||
shopId: infoForn.shopId,
|
||||
activateId: infoForn.id,
|
||||
shopUserId: infoForn.userInfo.id,
|
||||
amount: infoForn.amount, //金额
|
||||
returnUrl: '', //跳转地址
|
||||
buyerRemark: ''
|
||||
})
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -377,11 +367,6 @@
|
|||
uni.cache.set('shopId', options.shopId, 30)
|
||||
infoForn.shopId = options.shopId ? options.shopId : uni.cache.get('shopId')
|
||||
}
|
||||
|
||||
// let resone = await APIusershopInfodetail({
|
||||
// shopId: infoForn.shopId
|
||||
// })
|
||||
// infoForn.shopUserInfo = resone.shopInfo
|
||||
asyncshopUserInfo()
|
||||
if (options.type == 'detail') {
|
||||
detailtype.value = 'detail'
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@
|
|||
onMounted
|
||||
} from 'vue'
|
||||
import {
|
||||
APIusershopInfodetail,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
|
||||
|
|
@ -135,7 +134,7 @@
|
|||
uni.pro.navigateTo('user/member/billDetails', {
|
||||
shopId: shopUserInfo.shopId,
|
||||
type: type,
|
||||
shopInfo: JSON.stringify(shopUserInfo.shopInfo)
|
||||
shopInfo: JSON.stringify(shopUserInfo)
|
||||
})
|
||||
} else if (type == 3) {
|
||||
uni.pro.navigateTo('user/coupon', {
|
||||
|
|
@ -183,11 +182,6 @@
|
|||
if (pageParams.shopId) {
|
||||
shopUserInfo.shopId = pageParams.shopId
|
||||
uni.cache.set('shopId', pageParams.shopId, 30)
|
||||
// let res = await APIusershopInfodetail({
|
||||
// shopId: pageParams.shopId
|
||||
// })
|
||||
// 根据传的shopInfo来返回上面的值
|
||||
// shopUserInfo.shopExtend = res.shopExtend.member_bg
|
||||
asyncshopUserInfo()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ||'0'}}</view>
|
||||
<view class="my_list_item_num">{{userInfo.accountPoints ||userInfo.points}}</view>
|
||||
</view>
|
||||
<view class="my_list_item">
|
||||
<image class="my_list_item_icon"
|
||||
|
|
@ -131,10 +131,17 @@
|
|||
|
||||
// 我的资产
|
||||
const Myassets = () => {
|
||||
uni.pro.navigateTo('user/member/memberdetails', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index'
|
||||
})
|
||||
if (uni.cache.get('shopId')) {
|
||||
uni.pro.navigateTo('user/member/memberdetails', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index'
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('user/member/list', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const clickTo = (item, index) => {
|
||||
|
|
@ -191,13 +198,12 @@
|
|||
|
||||
onShow(async () => {
|
||||
await store.actionsAPIuser()
|
||||
let res = uni.cache.get('orderVIP')
|
||||
if (uni.cache.get('shopId')) {
|
||||
Object.assign(userInfo, res)
|
||||
Object.assign(userInfo, uni.cache.get('orderVIP'))
|
||||
} else {
|
||||
Object.assign(userInfo, {
|
||||
...res,
|
||||
...res.assetsSummary
|
||||
...uni.cache.get('userInfo'),
|
||||
...uni.cache.get('userInfo').assetsSummary
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ export const Memberpay = defineStore('memberpay', {
|
|||
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||
// #endif
|
||||
returnUrl: data.returnUrl ? data.returnUrl : '',
|
||||
buyerRemark: data.buyerRemark ? data.buyerRemark : ''
|
||||
buyerRemark: data.buyerRemark ? data.buyerRemark : '',
|
||||
orderId: data.orderId,
|
||||
userAllPack: data.userAllPack
|
||||
})
|
||||
if (res) {
|
||||
uni.showLoading({
|
||||
|
|
|
|||
Loading…
Reference in New Issue