优惠卷和商品卷
This commit is contained in:
@@ -23,6 +23,15 @@ export const APIshopUserInfo = (data) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加入会员
|
||||||
|
export const APIshopUser = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/shopUser',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 获取动态会员码 3分钟内可用
|
// 获取动态会员码 3分钟内可用
|
||||||
export const APIusershopUsercode = (data) => {
|
export const APIusershopUsercode = (data) => {
|
||||||
return request({
|
return request({
|
||||||
@@ -51,7 +60,7 @@ export const APIusershopInfodetail = (data) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//桌码换取详细店铺信息
|
//通过用户Id 查找优惠券
|
||||||
export const APIcouponfindByUserId = (data) => {
|
export const APIcouponfindByUserId = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: urlAccount + '/user/coupon/findByUserId',
|
url: urlAccount + '/user/coupon/findByUserId',
|
||||||
@@ -59,6 +68,14 @@ export const APIcouponfindByUserId = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//生成订单后使用
|
||||||
|
export const APIfindCoupon = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/coupon/findCoupon',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
//桌码换取详细店铺信息
|
//桌码换取详细店铺信息
|
||||||
export const APIuseractivate = (data) => {
|
export const APIuseractivate = (data) => {
|
||||||
@@ -69,3 +86,29 @@ export const APIuseractivate = (data) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取余额余额明细
|
||||||
|
export const APIshopUsermoneyRecord = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/shopUser/moneyRecord',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取积分明细
|
||||||
|
export const APIshopUserpointsRecord = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/shopUser/pointsRecord',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取动态会员码
|
||||||
|
export const APIshopUsercode = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/shopUser/code',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
14
common/api/shop/index.js
Normal file
14
common/api/shop/index.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// 引入 request 文件
|
||||||
|
import request from '@/common/api/request.js'
|
||||||
|
const urlAccount = '/account'
|
||||||
|
const urlProduct = '/product'
|
||||||
|
const urlOrder = '/order'
|
||||||
|
|
||||||
|
//商品列表
|
||||||
|
export const APIgeocodelocation = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/points/mall/goods/page',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
1437
common/js/uqrCode.js
1437
common/js/uqrCode.js
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,15 @@ const useWebSocket = (options = {}) => {
|
|||||||
|
|
||||||
// 连接 WebSocket
|
// 连接 WebSocket
|
||||||
const connect = () => {
|
const connect = () => {
|
||||||
|
|
||||||
if (!isNetworkConnected.value) {
|
if (!isNetworkConnected.value) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络未连接...',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
console.log('网络未连接,暂不尝试连接 WebSocket');
|
console.log('网络未连接,暂不尝试连接 WebSocket');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -70,7 +78,7 @@ const useWebSocket = (options = {}) => {
|
|||||||
isConnected.value = true;
|
isConnected.value = true;
|
||||||
reconnectAttempts.value = 0;
|
reconnectAttempts.value = 0;
|
||||||
// 监听初始化成功在开启心跳
|
// 监听初始化成功在开启心跳
|
||||||
// startHeartbeat();
|
startHeartbeat();
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
console.error('WebSocket 连接失败,尝试重连');
|
console.error('WebSocket 连接失败,尝试重连');
|
||||||
@@ -104,6 +112,7 @@ const useWebSocket = (options = {}) => {
|
|||||||
clearTimeout(reconnectTimer.value); // 清除重连定时器
|
clearTimeout(reconnectTimer.value); // 清除重连定时器
|
||||||
if (res.code == '1006') {
|
if (res.code == '1006') {
|
||||||
console.log('服务器正常关闭,停止重连');
|
console.log('服务器正常关闭,停止重连');
|
||||||
|
uni.navigateBack()
|
||||||
autoReconnect.value = false;
|
autoReconnect.value = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -129,6 +138,13 @@ const useWebSocket = (options = {}) => {
|
|||||||
const startHeartbeat = () => {
|
const startHeartbeat = () => {
|
||||||
if (!isNetworkConnected.value) {
|
if (!isNetworkConnected.value) {
|
||||||
console.log('网络未连接,暂停心跳');
|
console.log('网络未连接,暂停心跳');
|
||||||
|
uni.showToast({
|
||||||
|
title: '网络未连接...',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
heartbeatTimer.value = setInterval(() => {
|
heartbeatTimer.value = setInterval(() => {
|
||||||
@@ -168,6 +184,7 @@ const useWebSocket = (options = {}) => {
|
|||||||
// 手动关闭连接
|
// 手动关闭连接
|
||||||
const closeSocket = () => {
|
const closeSocket = () => {
|
||||||
isManuallyClosed.value = true;
|
isManuallyClosed.value = true;
|
||||||
|
uni.navigateBack()
|
||||||
closeExistingConnection();
|
closeExistingConnection();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -213,6 +230,7 @@ const useWebSocket = (options = {}) => {
|
|||||||
title: '重连次数达到上限,停止重连',
|
title: '重连次数达到上限,停止重连',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
128
components/payPassword.vue
Normal file
128
components/payPassword.vue
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<template>
|
||||||
|
<view class="password-input-modal" v-if="isShow">
|
||||||
|
<view class="modal-mask" @click="closeModal"></view>
|
||||||
|
<view class="modal-content">
|
||||||
|
<view class="title">请输入支付密码</view>
|
||||||
|
<view class="input-container">
|
||||||
|
<view v-for="(item, index) in 6" :key="index" class="input-box">
|
||||||
|
{{ password[index] ? '*' : '' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="keyboard">
|
||||||
|
<view v-for="(num, index) in [1, 2, 3, 4, 5, 6, 7, 8, 9, '', 0, 'delete']" :key="index" class="key"
|
||||||
|
@click="handleKeyClick(num)">
|
||||||
|
{{ num === 'delete' ? '删除' : num }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
defineProps,
|
||||||
|
defineEmits
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
|
// 接收父组件传递的显示状态
|
||||||
|
const props = defineProps({
|
||||||
|
isShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 定义向父组件发送事件
|
||||||
|
const emits = defineEmits(['inputComplete', 'close']);
|
||||||
|
|
||||||
|
// 存储输入的密码
|
||||||
|
const password = ref('');
|
||||||
|
|
||||||
|
// 处理键盘点击事件
|
||||||
|
const handleKeyClick = (num) => {
|
||||||
|
if (num === 'delete') {
|
||||||
|
password.value = password.value.slice(0, -1);
|
||||||
|
} else if (password.value.length < 6) {
|
||||||
|
password.value += num;
|
||||||
|
}
|
||||||
|
if (password.value.length === 6) {
|
||||||
|
emits('inputComplete', password.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭模态框
|
||||||
|
const closeModal = () => {
|
||||||
|
emits('close');
|
||||||
|
password.value = '';
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.password-input-modal {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-mask {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 40rpx;
|
||||||
|
border-radius: 30rpx 30rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-box {
|
||||||
|
width: 90rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin: 0 10rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 90rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.keyboard {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key {
|
||||||
|
text-align: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
font-size: 26rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<view class="method_list_top_cen">
|
<view class="method_list_top_cen">
|
||||||
<view class="name"> {{ item.name }} </view>
|
<view class="name"> {{ item.name }} </view>
|
||||||
<view class="method_list_bom" v-if="item.type == 1">
|
<view class="method_list_bom" v-if="item.type == 1">
|
||||||
<text class="balance">会员卡余额 ¥{{amountVIP?amountVIP.amount:0}}</text>
|
<text class="balance">会员卡余额 ¥{{orderVIP?orderVIP.amount:0}}</text>
|
||||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
<text class="topUpNow" @click="goRecharge">去充值</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,14 +51,18 @@
|
|||||||
freeCheck: {
|
freeCheck: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
orderVIP: {
|
||||||
|
type: Object,
|
||||||
|
default: {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['customevent', 'groupChange']);
|
const emits = defineEmits(['customevent', 'groupChange']);
|
||||||
|
|
||||||
const amountVIP = uni.cache.get('shopUserInfo')
|
|
||||||
|
|
||||||
const paymentMethodList = ref([{
|
const paymentMethodList = ref([{
|
||||||
name: "余额支付",
|
name: "余额支付",
|
||||||
type: 1,
|
type: 1,
|
||||||
@@ -112,7 +116,6 @@
|
|||||||
|
|
||||||
// * 监听支付方式切换
|
// * 监听支付方式切换
|
||||||
const groupChange = (type) => {
|
const groupChange = (type) => {
|
||||||
console.log(type)
|
|
||||||
if (props.freeCheck && type == 1) {
|
if (props.freeCheck && type == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -121,13 +124,14 @@
|
|||||||
// }
|
// }
|
||||||
radiovalue.value = type;
|
radiovalue.value = type;
|
||||||
let name = paymentMethodName.value[type - 1].name;
|
let name = paymentMethodName.value[type - 1].name;
|
||||||
emits("groupChange", type)
|
|
||||||
|
emits("groupChange", paymentMethodName.value[type - 1])
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去充值
|
// 去充值
|
||||||
const goRecharge = () => {
|
const goRecharge = () => {
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
uni.pro.navigateTo('user/member/index', {
|
||||||
shopId: uni.cache.get('shopId')
|
shopId: props.orderVIP.shopId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dcloudio/uni-app": "^2.0.2-4040520250103001",
|
"@dcloudio/uni-app": "^2.0.2-4040520250103001",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"jsbarcode": "^3.11.6",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
"pinia-plugin-persistedstate": "^4.2.0"
|
"pinia-plugin-persistedstate": "^4.2.0"
|
||||||
}
|
}
|
||||||
|
|||||||
29
pages.json
29
pages.json
@@ -59,6 +59,12 @@
|
|||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/order/coupon",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "优惠卷"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/user",
|
"path": "pages/user/user",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -90,6 +96,12 @@
|
|||||||
"navigationBarTitleText": "会员卡"
|
"navigationBarTitleText": "会员卡"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/user/member/paycode",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "会员支付码"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/member/billDetails",
|
"path": "pages/user/member/billDetails",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -101,6 +113,23 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "会员支付码"
|
"navigationBarTitleText": "会员支付码"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "pages/user/member/setPassword",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "密码设置"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/user/member/storedManage",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "会员管理"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/user/member/instructions",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "使用须知"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/myself",
|
"path": "pages/user/myself",
|
||||||
|
|||||||
@@ -4,6 +4,46 @@
|
|||||||
<view class="card_head_box">
|
<view class="card_head_box">
|
||||||
<view class="card_head_item" v-for="(item,index) in 8" :key="index"></view>
|
<view class="card_head_item" v-for="(item,index) in 8" :key="index"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 先付款 -->
|
||||||
|
<view class="tabBox">
|
||||||
|
<view class="tab">
|
||||||
|
<view v-for="(item,index) in tebtypeList" :key="index"
|
||||||
|
:class="is_type==index?'tab_item'+(is_type+1)+' tab_item active ':'tab_item'"
|
||||||
|
@click="tabClick(item,index)">
|
||||||
|
<view></view>
|
||||||
|
<image class="icon" :src="is_type==index?item.url_active:item.url" mode="aspectFill" />
|
||||||
|
<text class="title" :class="{active:is_type==index}">{{item.title}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="table" v-if=" is_type == 0 ">
|
||||||
|
<view class="table_left">
|
||||||
|
<image class="icon"
|
||||||
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png"
|
||||||
|
mode="aspectFill" />
|
||||||
|
<text class="title">桌台</text>
|
||||||
|
</view>
|
||||||
|
<view class="value" v-if="listinfo.tableName"> {{ listinfo.tableName || '' }} </view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="pack" v-else>
|
||||||
|
<view class="top">
|
||||||
|
<text class="title">{{ shopInfo.shopName }}</text>
|
||||||
|
<text class="address">{{ shopInfo.address }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<view class="item">
|
||||||
|
<view class="lable">取餐时间</view>
|
||||||
|
<view class="text">立即取餐</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="lable">预留电话</view>
|
||||||
|
<view class="getPhone text"><u-input class="inputVal" v-model="order.phone"
|
||||||
|
input-align="right" placeholder="请输入预留电话以便联系您"></u-input><text
|
||||||
|
class="getBtn">获取手机号</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<!-- 订单头部 -->
|
<!-- 订单头部 -->
|
||||||
<view class="card_item" v-for="(value, key) in listinfo.detailMap" :key="key">
|
<view class="card_item" v-for="(value, key) in listinfo.detailMap" :key="key">
|
||||||
@@ -29,58 +69,84 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<view class="priceAmount">¥{{item.priceAmount}}</view>
|
<view class="priceAmount">
|
||||||
|
¥{{orderVIP.isVip ==1 && ordershopUserInfo.isMemberPrice==1?item.memberPrice:item.price}}
|
||||||
|
</view>
|
||||||
<view class="num">x{{item.num}}</view>
|
<view class="num">x{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">未付款</view>
|
<!--<view class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">未付款</view>
|
||||||
<view class="totalAmount">
|
<view class="totalAmount">
|
||||||
<view class="label">小计¥</view>
|
<view class="label">小计¥</view>
|
||||||
<view class="price"> {{item.totalAmount}} </view>
|
<view class="price"> {{item.totalAmount}} </view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="semicircle_icon" v-if="index > 0">
|
<view class="semicircle_icon" v-if="index > 0">
|
||||||
<view class="semicircle_left_icon"></view>
|
<view class="semicircle_left_icon"></view>
|
||||||
<view class="semicircle_right_icon"></view>
|
<view class="semicircle_right_icon"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cell-item" v-if="listinfo.seatCount > 0">
|
|
||||||
<view class="label">餐位费</view>
|
<view class="cell-item" v-if="is_type != 0">
|
||||||
|
<view class="label">打包费</view>
|
||||||
<view class="val">
|
<view class="val">
|
||||||
<view>X{{listinfo.seatCount}}</view>
|
<view></view>
|
||||||
<view style="font-size: 28rpx;">¥</view>
|
<view style="font-size: 28rpx;">¥</view>
|
||||||
<view>{{listinfo.seatAmount}}</view>
|
<view>{{listinfo.packFee}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- isTableFee == 0是不免除 -->
|
||||||
|
<view class="cell-item"
|
||||||
|
v-if="ordershopUserInfo.isTableFee == 0 && is_type == 0 && listinfo.Seatcharge != 0">
|
||||||
|
<view class="label">餐位费</view>
|
||||||
|
<view class="val">
|
||||||
|
<view>X{{listinfo.Seatcharge}}</view>
|
||||||
|
<view style="font-size: 28rpx;">¥</view>
|
||||||
|
<view>{{listinfo.Seatcharge}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- <view class="cell-item" v-else>
|
||||||
|
<view class="label">免餐位费</view>
|
||||||
|
<view class="val">
|
||||||
|
<view></view>
|
||||||
|
<view style="font-size: 28rpx;">¥</view>
|
||||||
|
<view>{{listinfo.Seatcharge}}</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
<!-- 支付之前 -->
|
||||||
<block v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<block v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<view v-for="(item,indexe) in favorable" :key="indexe">
|
<view v-for="(item,indexe) in favorablelist" :key="indexe">
|
||||||
<view v-if="!rechargeFreeChecked" class="favorable"
|
<view class="favorable" :class="{column:item.value.length>0&&item.type=='product'}"
|
||||||
:class="{column:item.value.length>0&&item.type=='product'}" @click="goUrl(item)">
|
@click="goUrl(item)">
|
||||||
<view class="favorable_left">
|
<view class="favorable_left">
|
||||||
<!-- <image class="icon" :src="item.url" mode="aspectFill"/> -->
|
|
||||||
<text class="name"> {{ item.name }} </text>
|
<text class="name"> {{ item.name }} </text>
|
||||||
</view>
|
</view>
|
||||||
<view class="favorable_right" v-if="item.type=='coupon'">
|
|
||||||
<text class="favorable_right_text">{{item.value}}</text>
|
<!-- 商品卷 -->
|
||||||
<up-icon name="arrow-right" color="#575B66" size="16"
|
<view class="favorable_right" :class="{column:item.value}" v-if="item.type=='product'">
|
||||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></up-icon>
|
<view :class="{column:item.value}">
|
||||||
</view>
|
<view class="favorable_right_text" v-if="item.value.uniqueIds">
|
||||||
<view class="favorable_right" :class="{column:item.value.length>0}"
|
<text>{{item.value.uniqueIds}}个</text>
|
||||||
v-if="item.type=='product'">
|
<text>-¥{{item.value.Productroll}}</text>
|
||||||
<view :class="{column:item.value.length>0}">
|
|
||||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value"
|
|
||||||
:key="indexs">
|
|
||||||
<text>{{items.name}}</text>
|
|
||||||
<text>X{{items.num}}</text>
|
|
||||||
<text>-¥{{items.discountAmount || 0}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<up-icon name="arrow-right" color="#575B66" size="16"
|
<up-icon name="arrow-right" color="#575B66" size="16"
|
||||||
style="margin-top: 5rpx;"></up-icon>
|
style="margin-top: 5rpx;"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 优惠卷 -->
|
||||||
|
<view class="favorable_right" v-if="item.type=='coupon'">
|
||||||
|
<text class="favorable_right_text">{{item.value.name}}</text>
|
||||||
|
<up-icon name="arrow-right" color="#575B66" size="16"
|
||||||
|
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'"></up-icon>
|
||||||
|
</view>
|
||||||
|
<!-- 积分 -->
|
||||||
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
<view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
||||||
v-if="calcUsablePointsData.usable">
|
v-if="calcUsablePointsData.usable">
|
||||||
@@ -95,16 +161,15 @@
|
|||||||
<up-checkbox-group iconPlacement="right" @change="pointsChange">
|
<up-checkbox-group iconPlacement="right" @change="pointsChange">
|
||||||
<up-checkbox v-model="isPointsChecked"
|
<up-checkbox v-model="isPointsChecked"
|
||||||
:disabled="freeCheck||!calcUsablePointsData.usable" :checked="isPointsChecked"
|
:disabled="freeCheck||!calcUsablePointsData.usable" :checked="isPointsChecked"
|
||||||
activeColor="#E8AD7B" shape="circle" icon-size="36" size="36">
|
activeColor="#E8AD7B" shape="circle" icon-size="18" size="18">
|
||||||
</up-checkbox>
|
</up-checkbox>
|
||||||
</up-checkbox-group>
|
</up-checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<block v-for="(item,index) in listinfo.couponInfoList.fullReductionCoupon" :key="index">
|
<block v-for="(item,index) in listinfo.couponInfoList" :key="index">
|
||||||
<view class="cell-item" v-if="item.type == 1">
|
<view class="cell-item" v-if="item.type == 1">
|
||||||
<view class="label">优惠券</view>
|
<view class="label">优惠券</view>
|
||||||
<view class="val">
|
<view class="val">
|
||||||
@@ -114,11 +179,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="cell-item column" v-if="listinfo.couponInfoList.productCoupon.length > 0">
|
<view class="cell-item column" v-if="listinfo.couponInfoList.length > 0">
|
||||||
<view class="label">商品券</view>
|
<view class="label">商品券</view>
|
||||||
<view class="val column">
|
<view class="val column">
|
||||||
<view class="productCoupon" v-for="(item,index) in listinfo.couponInfoList.productCoupon"
|
<view class="productCoupon" v-for="(item,index) in listinfo.couponInfoList" :key="index">
|
||||||
:key="index">
|
|
||||||
<view class="name">{{item.name}}</view>
|
<view class="name">{{item.name}}</view>
|
||||||
<view class="num">X{{item.finalUseNum}}</view>
|
<view class="num">X{{item.finalUseNum}}</view>
|
||||||
<view class="amount">-¥{{item.finalDiscountAmount}}</view>
|
<view class="amount">-¥{{item.finalDiscountAmount}}</view>
|
||||||
@@ -138,7 +202,7 @@
|
|||||||
|
|
||||||
<view class="total-wrap">
|
<view class="total-wrap">
|
||||||
<view>总计¥</view>
|
<view>总计¥</view>
|
||||||
<view class="price"> {{listinfo.payAmount}} </view>
|
<view class="price"> {{listinfo.totalCost}} </view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -146,30 +210,30 @@
|
|||||||
<view class="orderInfo">
|
<view class="orderInfo">
|
||||||
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
<view class="row" @click="copyHandle(listinfo.orderNo)">
|
||||||
<text class="t">订单编号:</text>
|
<text class="t">订单编号:</text>
|
||||||
<text class="info">{{listinfo.orderNo}}(点击复制)</text>
|
<text class="info"
|
||||||
|
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{listinfo.orderNo}}(点击复制)</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row">
|
||||||
<text class="t">下单时间:</text>
|
<text class="t">下单时间:</text>
|
||||||
<text class="info">{{$u.timeFormat(listinfo.time, 'yyyy-mm-dd hh:MM:ss')}}</text>
|
<text class="info">{{$u.timeFormat(listinfo.updateTime, 'yyyy-mm-dd hh:MM:ss')}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<!-- <view class="row">
|
||||||
<text class="t">下单门店:</text>
|
<text class="t">下单门店:</text>
|
||||||
<text class="info">{{listinfo.name}}</text>
|
<text class="info">{{listinfo.name}}</text>
|
||||||
|
</view> -->
|
||||||
|
<view class="row" v-if="listinfo.dineMod">
|
||||||
|
<text class="t">用餐模式:</text>
|
||||||
|
<text class="info" v-if="listinfo.dineMod == 'dine-in'">堂食</text>
|
||||||
|
<text class="info" v-if="listinfo.dineMod == 'take-out'">外带</text>
|
||||||
|
<text class="info" v-if="listinfo.dineMod == 'take-away'">外卖</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row" v-if="listinfo.remark">
|
||||||
<text class="t">订单类型:</text>
|
|
||||||
<text class="info" v-if="listinfo.sendType == 'post'">快递</text>
|
|
||||||
<text class="info" v-if="listinfo.sendType == 'takeaway'">外卖</text>
|
|
||||||
<text class="info" v-if="listinfo.sendType == 'takeself'">自提</text>
|
|
||||||
<text class="info" v-if="listinfo.sendType == 'table'">堂食</text>
|
|
||||||
</view>
|
|
||||||
<view class="row">
|
|
||||||
<text class="t">备注:</text>
|
<text class="t">备注:</text>
|
||||||
<text class="info">{{ listinfo.remark || ""}}</text>
|
<text class="info">{{ listinfo.remark || ""}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="row">
|
<view class="row" v-if="listinfo.seatNum">
|
||||||
<text class="t">就餐人数:</text>
|
<text class="t">就餐人数:</text>
|
||||||
<text class="info">{{ listinfo.seatCount || ""}}</text>
|
<text class="info">{{ listinfo.seatNum || ""}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -184,9 +248,13 @@
|
|||||||
computed,
|
computed,
|
||||||
defineEmits,
|
defineEmits,
|
||||||
watch,
|
watch,
|
||||||
watchEffect
|
watchEffect,
|
||||||
|
defineExpose
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
|
// 定义自定义事件
|
||||||
|
const emits = defineEmits(['customevent', 'istype']);
|
||||||
|
|
||||||
// teb 切换送餐和打包
|
// teb 切换送餐和打包
|
||||||
const tebtypeList = reactive([{
|
const tebtypeList = reactive([{
|
||||||
title: "送餐到桌",
|
title: "送餐到桌",
|
||||||
@@ -206,17 +274,16 @@
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const favorable = reactive([{
|
const favorablelist = reactive([{
|
||||||
name: "优惠券",
|
|
||||||
type: "coupon",
|
|
||||||
value: "",
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "商品券",
|
name: "商品券",
|
||||||
type: "product",
|
type: "product",
|
||||||
value: [],
|
value: [],
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
||||||
|
}, {
|
||||||
|
name: "优惠券",
|
||||||
|
type: "coupon",
|
||||||
|
value: "",
|
||||||
|
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
||||||
},
|
},
|
||||||
// { name: "团购优惠", type: "group",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
// { name: "团购优惠", type: "group",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||||
{
|
{
|
||||||
@@ -227,267 +294,90 @@
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
rechargeFreeChecked: {
|
|
||||||
type: Boolean
|
|
||||||
},
|
|
||||||
freeCheck: {
|
freeCheck: {
|
||||||
type: Boolean
|
type: Boolean
|
||||||
},
|
},
|
||||||
|
|
||||||
listinfo: {
|
listinfo: {
|
||||||
type: Object
|
type: Object
|
||||||
|
|
||||||
},
|
},
|
||||||
amountVIP: {
|
orderVIP: {
|
||||||
type: Object
|
type: Object
|
||||||
},
|
},
|
||||||
})
|
ordershopUserInfo: {
|
||||||
|
type: Object,
|
||||||
const data = reactive({
|
default: {
|
||||||
calcUsablePointsData: null,
|
isTableFee: 0
|
||||||
isShow: false,
|
}
|
||||||
payAmount: 0,
|
|
||||||
isPointsChecked: false,
|
|
||||||
userCouponInfos: [],
|
|
||||||
selectCouponData: [],
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const childOnShow = () => {
|
|
||||||
console.log('isShow==', this.isShow)
|
|
||||||
if (!this.isShow) {
|
|
||||||
this.getCalcUsablePoints()
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// uni.$on('couponItem',this.changeCoupon)
|
})
|
||||||
this.userCouponInfos = [];
|
|
||||||
this.favorable[0].value = ""
|
const calcUsablePointsData = reactive({
|
||||||
this.favorable[1].value = []
|
usable: '',
|
||||||
this.listinfo.payAmount = this.payAmount
|
pointsNum: '',
|
||||||
this.selectCouponData = uni.cache.get('selectCouponData') || []
|
equivalentPoints: '',
|
||||||
this.changeCoupon();
|
unusableReason: '',
|
||||||
|
|
||||||
|
})
|
||||||
|
const isPointsChecked = ref(false)
|
||||||
|
|
||||||
|
const is_type = ref(0)
|
||||||
|
// 监听送餐/打包切换
|
||||||
|
const tabClick = (item, index) => {
|
||||||
|
is_type.value = index
|
||||||
|
emits("istype", is_type.value)
|
||||||
|
// this.getchoseEatModel('tabClick', index, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 操作优惠卷
|
||||||
|
const dataprocessing = (data) => {
|
||||||
|
if (data.typeOrder == 1) {
|
||||||
|
favorablelist[1].value = data.item
|
||||||
|
} else {
|
||||||
|
favorablelist[0].value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const childOnShow = () => {}
|
||||||
|
|
||||||
// * 监听优惠券/商品券选择
|
// * 监听优惠券/商品券选择
|
||||||
const changeCoupon = (data) => {
|
const changeCoupon = (data) => {}
|
||||||
// 优惠券数据
|
|
||||||
let couponList = this.selectCouponData.filter(v => v.type == 1);
|
|
||||||
// 商品券列表
|
|
||||||
let productList = this.selectCouponData.filter(v => v.type == 2);
|
|
||||||
// 优惠券处理
|
|
||||||
if (couponList.length > 0) {
|
|
||||||
let couponData = couponList[0]
|
|
||||||
//不包含优惠券的金额
|
|
||||||
let currentPayAmount = (this.userCouponInfos.filter(v => v.type == 1).length > 0 ? Number(this.listinfo
|
|
||||||
.payAmount) + couponData.discountAmount : this.listinfo.payAmount)
|
|
||||||
// 判断优惠金额不能大于支付金额
|
|
||||||
if (couponData.discountAmount <= currentPayAmount) {
|
|
||||||
|
|
||||||
// if ( this.isPointsChecked && this.calcUsablePointsData) {
|
const setPayAmount = (cartLists) => {}
|
||||||
// this.listinfo.payAmount = (this.listinfo.payAmount-(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
|
||||||
// } else {
|
|
||||||
// this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
|
||||||
// }
|
|
||||||
this.listinfo.payAmount = (currentPayAmount - couponData.discountAmount).toFixed(2)
|
|
||||||
this.favorable[0].value = ('-¥' + couponData.discountAmount)
|
|
||||||
|
|
||||||
this.userCouponInfos.push({
|
|
||||||
userCouponId: couponData.id,
|
|
||||||
type: couponData.type,
|
|
||||||
discountAmount: couponData.discountAmount,
|
|
||||||
num: couponData.type == 1 ? 1 : couponData.num,
|
|
||||||
})
|
|
||||||
|
|
||||||
this.$emit("setPayAmount", {
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
userCouponInfos: this.userCouponInfos,
|
|
||||||
freeCheck: this.freeCheck,
|
|
||||||
calcUsablePointsData: this.calcUsablePointsData,
|
|
||||||
isPointsChecked: this.isPointsChecked,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "优惠券满减金额大于订单金额不可使用",
|
|
||||||
icon: "none",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 商品券处理
|
|
||||||
if (productList.length > 0) {
|
|
||||||
//商品券使用数量
|
|
||||||
|
|
||||||
let payAmount = this.listinfo.payAmount
|
|
||||||
productList.map((item, index) => {
|
|
||||||
// 筛选选中商品券商品列表
|
|
||||||
let productDetails = this.listinfo.details.filter(v => v.productId == item.proId);
|
|
||||||
//金额从小到大排序
|
|
||||||
let minCouponList = productDetails.sort((a, b) => (a.memberPrice > 0 ? a.memberPrice : a
|
|
||||||
.salePrice) - (b.memberPrice > 0 ? b.memberPrice : b.salePrice))
|
|
||||||
// 商品数量
|
|
||||||
let productAllNum = 0;
|
|
||||||
let productNum = 0
|
|
||||||
let productPayAmount = 0
|
|
||||||
minCouponList.map((v, indexs) => {
|
|
||||||
productNum = 0;
|
|
||||||
productPayAmount = 0;
|
|
||||||
let productDetailsNum = 0;
|
|
||||||
productDetails.map((v, indexs) => {
|
|
||||||
productDetailsNum += v.num;
|
|
||||||
})
|
|
||||||
for (let i = 0; i < v.num; i++) {
|
|
||||||
if (productAllNum < productDetailsNum && productNum < item.num && ((v
|
|
||||||
.memberPrice > 0 ? v.memberPrice : v.price) <= (payAmount -
|
|
||||||
productPayAmount))) {
|
|
||||||
productNum++
|
|
||||||
productAllNum++
|
|
||||||
productPayAmount += v.memberPrice > 0 ? v.memberPrice : v.price
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
payAmount = payAmount - productPayAmount
|
|
||||||
|
|
||||||
})
|
|
||||||
if (productNum > 0) {
|
|
||||||
this.userCouponInfos.push({
|
|
||||||
userCouponId: item.id,
|
|
||||||
type: item.type,
|
|
||||||
productId: item.proId,
|
|
||||||
discountAmount: productPayAmount,
|
|
||||||
num: productNum,
|
|
||||||
})
|
|
||||||
this.favorable[1].value.push({
|
|
||||||
userCouponId: item.id,
|
|
||||||
name: item.name,
|
|
||||||
type: item.type,
|
|
||||||
productId: item.proId,
|
|
||||||
discountAmount: productPayAmount,
|
|
||||||
num: productNum,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
this.setPayAmount()
|
|
||||||
}
|
|
||||||
|
|
||||||
const setPayAmount = (cartLists) => {
|
|
||||||
let tableFee;
|
|
||||||
// this.storeInfo.registerType == 'munchies'
|
|
||||||
if (this.userCouponInfos.length > 0) {
|
|
||||||
console.log(this.userCouponInfos)
|
|
||||||
this.userCouponInfos.forEach(item => {
|
|
||||||
if (item.type == 2) {
|
|
||||||
if (item.discountAmount && item.discountAmount > 0) {
|
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount - item.discountAmount).toFixed(
|
|
||||||
2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.isPointsChecked = false;
|
|
||||||
this.getCalcUsablePoints()
|
|
||||||
this.$emit("setPayAmount", {
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
userCouponInfos: this.userCouponInfos,
|
|
||||||
freeCheck: this.freeCheck,
|
|
||||||
calcUsablePointsData: this.calcUsablePointsData,
|
|
||||||
isPointsChecked: this.isPointsChecked,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 积分状态监听
|
// * 积分状态监听
|
||||||
const pointsChange = () => {
|
const pointsChange = () => {}
|
||||||
if (this.freeCheck || !this.calcUsablePointsData.usable) {
|
|
||||||
return;
|
// 跳转
|
||||||
}
|
|
||||||
this.isPointsChecked = !this.isPointsChecked
|
|
||||||
if (this.isPointsChecked) {
|
|
||||||
this.listinfo.payAmount = (this.listinfo.payAmount - (this.calcUsablePointsData.pointsNum / this
|
|
||||||
.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
|
||||||
} else {
|
|
||||||
this.listinfo.payAmount = (Number(this.listinfo.payAmount) + (this.calcUsablePointsData.pointsNum /
|
|
||||||
this.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
|
||||||
}
|
|
||||||
this.$emit("setPayAmount", {
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
userCouponInfos: this.userCouponInfos,
|
|
||||||
freeDisabled: this.freeDisabled,
|
|
||||||
freeCheck: this.freeCheck,
|
|
||||||
calcUsablePointsData: this.calcUsablePointsData,
|
|
||||||
isPointsChecked: this.isPointsChecked,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const goUrl = (item) => {
|
const goUrl = (item) => {
|
||||||
if (this.listinfo.status == 'unpaid' || this.listinfo.status == 'paying') {
|
switch (item.type) {
|
||||||
let couopnInfo;
|
case 'coupon':
|
||||||
switch (item.type) {
|
uni.pro.navigateTo('/pages/order/coupon', {
|
||||||
case 'coupon':
|
type: "confirm_order_coupon",
|
||||||
let payAmount = this.listinfo.payAmount;
|
shopId: uni.cache.get('orderVIP').shopId,
|
||||||
let couponList = this.userCouponInfos.filter(v => v.type == 1);
|
shopUserId: props.orderVIP.id,
|
||||||
if (couponList.length > 0) {
|
payAmount: props.listinfo.totalCost,
|
||||||
payAmount = payAmount + couponList.discountAmount;
|
shoppingCart: JSON.stringify(props.listinfo.combinedArray)
|
||||||
}
|
})
|
||||||
couopnInfo = {
|
break;
|
||||||
payAmount: this.listinfo.payAmount,
|
case 'product':
|
||||||
userCouponInfos: this.userCouponInfos,
|
uni.pro.navigateTo('/pages/order/coupon', {
|
||||||
freeDisabled: this.freeDisabled,
|
type: "confirm_order_product",
|
||||||
freeCheck: this.freeCheck,
|
shopId: uni.cache.get('orderVIP').shopId,
|
||||||
calcUsablePointsData: this.calcUsablePointsData,
|
shopUserId: props.orderVIP.id,
|
||||||
isPointsChecked: this.isPointsChecked,
|
payAmount: props.listinfo.totalCost,
|
||||||
}
|
shoppingCart: JSON.stringify(props.listinfo.combinedArray)
|
||||||
uni.pro.navigateTo('/pages/user/coupon', {
|
})
|
||||||
type: "orderInfo_coupon",
|
break;
|
||||||
shopId: this.listinfo.shopId,
|
|
||||||
orderId: this.listinfo.id,
|
|
||||||
couopnInfo: JSON.stringify(couopnInfo),
|
|
||||||
payAmount: payAmount,
|
|
||||||
shoppingCart: JSON.stringify(this.listinfo.details),
|
|
||||||
productList: JSON.stringify(couponList)
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 'product':
|
|
||||||
let productList = this.userCouponInfos.filter(v => v.type == 2);
|
|
||||||
couopnInfo = {
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
userCouponInfos: this.userCouponInfos,
|
|
||||||
freeDisabled: this.freeDisabled,
|
|
||||||
freeCheck: this.freeCheck,
|
|
||||||
calcUsablePointsData: this.calcUsablePointsData,
|
|
||||||
isPointsChecked: this.isPointsChecked,
|
|
||||||
}
|
|
||||||
uni.pro.navigateTo('/pages/user/coupon', {
|
|
||||||
type: "orderInfo_product",
|
|
||||||
shopId: this.listinfo.shopId,
|
|
||||||
orderId: this.listinfo.id,
|
|
||||||
couopnInfo: JSON.stringify(couopnInfo),
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
shoppingCart: JSON.stringify(this.listinfo.details),
|
|
||||||
productList: JSON.stringify(productList)
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 获取积分相关信息
|
// * 获取积分相关信息
|
||||||
const getCalcUsablePoints = async () => {
|
const getCalcUsablePoints = async () => {}
|
||||||
let params = {
|
|
||||||
memberId: this.listinfo.memberId,
|
|
||||||
}
|
|
||||||
if (this.listinfo.pointsDiscountAmount) {
|
|
||||||
params.orderAmount = this.listinfo.payAmount + this.listinfo.pointsDiscountAmount
|
|
||||||
} else {
|
|
||||||
params.orderAmount = this.listinfo.payAmount
|
|
||||||
}
|
|
||||||
let res = await this.api.calcUsablePoints(params)
|
|
||||||
this.calcUsablePointsData = res.data;
|
|
||||||
if (this.calcUsablePointsData.usable && params.orderAmount >= this.calcUsablePointsData
|
|
||||||
.minPaymentAmount) {
|
|
||||||
this.calcUsablePointsData.pointsNum = this.calcUsablePointsData.accountPoints >= this
|
|
||||||
.calcUsablePointsData.maxUsablePoints ? this.calcUsablePointsData.maxUsablePoints : this
|
|
||||||
.calcUsablePointsData.accountPoints
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 复制订单号
|
// * 复制订单号
|
||||||
const copyHandle = (e) => {
|
const copyHandle = (e) => {
|
||||||
@@ -501,9 +391,14 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将方法暴露给父组件
|
||||||
|
defineExpose({
|
||||||
|
dataprocessing
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
.card_box {
|
.card_box {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
// box-shadow: 0rpx 8rpx 12rpx 2rpx rgba(87,86,86,0.35);
|
// box-shadow: 0rpx 8rpx 12rpx 2rpx rgba(87,86,86,0.35);
|
||||||
@@ -514,6 +409,201 @@
|
|||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
padding-bottom: 32rpx;
|
padding-bottom: 32rpx;
|
||||||
|
|
||||||
|
.tabBox {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 52rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 22rpx 22rpx 0 0;
|
||||||
|
// background-color: $uni-bg-color;
|
||||||
|
|
||||||
|
.tab_item {
|
||||||
|
width: 50%;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #FEFBF8;
|
||||||
|
border-radius: 22rpx 22rpx 0 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title.active {
|
||||||
|
color: #E8AD7B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab_item.active {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .tab_item.active:after {
|
||||||
|
// content: "";
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0;
|
||||||
|
// left: -4px;
|
||||||
|
// width: 40px;
|
||||||
|
// height: 26px;
|
||||||
|
// background: orange;
|
||||||
|
// }
|
||||||
|
.tab_item.active:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -20rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: 2px;
|
||||||
|
background: #fff;
|
||||||
|
transform: skewX(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab_item1.active:before {
|
||||||
|
border-radius: 22rpx 40rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab_item2.active:before {
|
||||||
|
border-radius: 40rpx 22rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 90rpx;
|
||||||
|
background-color: $uni-bg-color;
|
||||||
|
border-radius: 0 0 22rpx 22rpx;
|
||||||
|
|
||||||
|
.table_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 32.86rpx;
|
||||||
|
height: 39.07rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #E8AD7B;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pack {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: $uni-bg-color;
|
||||||
|
border-radius: 0 0 22rpx 22rpx;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
height: 70rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
.lable {
|
||||||
|
color: #666;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.getPhone {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.u-input {
|
||||||
|
width: 340rpx;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
input {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-placeholder {
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text,
|
||||||
|
.getBtn {
|
||||||
|
color: #E8AD7B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.getBtn {
|
||||||
|
border-radius: 12rpx;
|
||||||
|
border: 2rpx solid #E8AD7B;
|
||||||
|
padding: 8rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.card_head_box {
|
.card_head_box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,223 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 支付方式 -->
|
|
||||||
<view class="paymentMethod">
|
|
||||||
<view class="paymentMethod_content">
|
|
||||||
<view class="paymentMethod_title">支付方式</view>
|
|
||||||
<u-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :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_top">
|
|
||||||
<view class="method_list_top_left">
|
|
||||||
<image class="icon" :src="item.url" mode="aspectFill"/>
|
|
||||||
<view class="method_list_top_cen">
|
|
||||||
<view class="name"> {{ item.name }} </view>
|
|
||||||
<view class="method_list_bom" v-if="item.type == 1">
|
|
||||||
<text class="balance">会员卡余额 ¥{{amountVIP?amountVIP.amount:0}}</text>
|
|
||||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<u-radio activeColor="#E8AD7B" :disabled="(freeCheck&&index==0) || (index!=0&&payAmount<=0) || (rechargeFreeChecked&&index==0)" icon-size="36" size="36" :name="item.type">
|
|
||||||
</u-radio>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</u-radio-group>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
paymentMethodList:[
|
|
||||||
{ name: "余额支付", type: 1, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
{ name: "微信支付", type: 2, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
{ name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
|
|
||||||
// #endif
|
|
||||||
],
|
|
||||||
paymentMethodName:[
|
|
||||||
{ name: "余额支付", type: 1, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
|
||||||
{ name: "微信支付", type: 2, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
|
||||||
{ name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
|
|
||||||
],
|
|
||||||
radiovalue: 1, // 支付方式
|
|
||||||
ispws: false, // 输入支付密码
|
|
||||||
storeInfo: {},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props:{
|
|
||||||
rechargeFreeChecked:{
|
|
||||||
type: Boolean
|
|
||||||
},
|
|
||||||
payAmount:{
|
|
||||||
type: Number
|
|
||||||
},
|
|
||||||
amountVIP:{
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
freeCheck: {
|
|
||||||
type: Boolean
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
|
|
||||||
// freeCheck(newVal,oldVal) {
|
|
||||||
// if ( newVal ) {
|
|
||||||
// // #ifdef MP-WEIXIN
|
|
||||||
// this.radiovalue = 2
|
|
||||||
// // #endif
|
|
||||||
// // #ifdef MP-ALIPAY
|
|
||||||
// this.radiovalue = 3
|
|
||||||
// // #endif
|
|
||||||
// let name = this.paymentMethodName[this.radiovalue-1].name;
|
|
||||||
// console.log({type:this.radiovalue ,name: name })
|
|
||||||
// this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
payAmount:{
|
|
||||||
immediate: true,
|
|
||||||
handler (newVal) {
|
|
||||||
if ( newVal <= 0 ) {
|
|
||||||
this.radiovalue = 1
|
|
||||||
let name = this.paymentMethodName[this.radiovalue-1].name;
|
|
||||||
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rechargeFreeChecked:{
|
|
||||||
immediate: true,
|
|
||||||
handler (newVal) {
|
|
||||||
if ( newVal ) {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
this.radiovalue = 2
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
this.radiovalue = 3
|
|
||||||
// #endif
|
|
||||||
let name = this.paymentMethodName[this.radiovalue-1].name;
|
|
||||||
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
freeCheck:{
|
|
||||||
immediate: true,
|
|
||||||
handler (newVal) {
|
|
||||||
if ( newVal ) {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
this.radiovalue = 2
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
this.radiovalue = 3
|
|
||||||
// #endif
|
|
||||||
let name = this.paymentMethodName[this.radiovalue-1].name;
|
|
||||||
this.$emit("groupChange",{type:this.radiovalue ,name: name })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// console.log(this.amountVIP)
|
|
||||||
// this.getAount();
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 监听支付方式切换
|
|
||||||
* @param {Object}
|
|
||||||
*/
|
|
||||||
groupChange(type) {
|
|
||||||
if ( this.freeCheck && type == 1 ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( this.payAmount<=0 && type != 1 ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.radiovalue = type;
|
|
||||||
let name = this.paymentMethodName[type-1].name;
|
|
||||||
this.$emit("groupChange",{type:type ,name: name })
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 去充值
|
|
||||||
*/
|
|
||||||
goRecharge() {
|
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
|
||||||
shopId: uni.cache.get('shopId')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.paymentMethod{
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
.paymentMethod_content{
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 22rpx;
|
|
||||||
padding:30rpx 30rpx 0 30rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.paymentMethod_title{
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.method_list{
|
|
||||||
padding: 40rpx 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.method_list_top{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
.method_list_top_left{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.icon{
|
|
||||||
width: 54.67rpx!important;
|
|
||||||
height: 48rpx!important;
|
|
||||||
margin-right: 22rpx;
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.method_list_top_cen{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.method_list_bom{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.balance{
|
|
||||||
margin-right: 20rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
.topUpNow{
|
|
||||||
color: #FF803D;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.method_list:nth-child(odd){
|
|
||||||
border-bottom: 2rpx solid #e5e5e5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
572
pages/order/coupon.vue
Normal file
572
pages/order/coupon.vue
Normal file
@@ -0,0 +1,572 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="containertop">
|
||||||
|
<view class="containertopbox">
|
||||||
|
<view class="containertopboxitem flex-start" v-for="(item,index) in fromInfo.list" :key="index">
|
||||||
|
<view class="containertopboxitemleft flex-colum"
|
||||||
|
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': fromInfo.status != 1,}">
|
||||||
|
<view class="containertopboxitemleft_one" v-if="Orderinfo.typeOrder == 1"
|
||||||
|
:class="Orderinfo.typeOrder == 1 ?'':'containertopboxitemleft_ones'">
|
||||||
|
<block v-if="item.type == 2">
|
||||||
|
<text>{{item.num || 0}}</text>
|
||||||
|
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<text style="font-size: 28rpx;margin-right: 6rpx;">¥</text>
|
||||||
|
<text>{{item.discountAmount || 0}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<view class="containertopboxitemleft_tow"
|
||||||
|
:class="{'containertopboxitemleft_nameVip': item.type == 2}">
|
||||||
|
{{ item.type == 2 ? item.name : '优惠券(元)'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="containertopboxitemright">
|
||||||
|
<view class="containertopboxitemright_one">
|
||||||
|
<view class="flex-start">
|
||||||
|
<image class="icon"
|
||||||
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/coupon_icon.png"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
<text class="title">{{ item.shopName }}</text>
|
||||||
|
</view>
|
||||||
|
<!-- 商品卷显示 -->
|
||||||
|
<text v-if="Orderinfo.typeOrder == 2">无门槛使用</text>
|
||||||
|
</view>
|
||||||
|
<view class="containertopboxitemright_tow">
|
||||||
|
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
|
||||||
|
<!-- 优惠卷 -->
|
||||||
|
<view @click="navigatorGo(item)" v-if="Orderinfo.typeOrder == 1"
|
||||||
|
class="containertopboxitemright_four containertopboxitemright_btn"
|
||||||
|
style="padding: 10rpx 15rpx;">
|
||||||
|
去使用
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品卷 -->
|
||||||
|
<view @click="clickupicon(item,index)" v-if="Orderinfo.typeOrder == 2 && item.show"
|
||||||
|
class="containertopboxitemright_btn">
|
||||||
|
<up-icon v-if="item.Selected" name="checkmark-circle-fill" color="#2979ff"
|
||||||
|
size="28"></up-icon>
|
||||||
|
<view v-else class="upicon"></view>
|
||||||
|
</view>
|
||||||
|
<view v-if="Orderinfo.typeOrder == 2 && !item.show" class="containertopboxitemright_fours">
|
||||||
|
不可使用
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="containertopboxitemright_there">
|
||||||
|
有效期至:{{item.endTime}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="fromInfo.list.length <= 0" style="text-align: center;">
|
||||||
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
||||||
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="height:120rpx;" v-if="Orderinfo.typeOrder == 2"></view>
|
||||||
|
|
||||||
|
<view class="btnBox" v-if="Orderinfo.typeOrder == 2">
|
||||||
|
<view class="btn" @click="cancelCoupon">确定</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
onMounted,
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onReady,
|
||||||
|
onShow,
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
import {
|
||||||
|
APIcouponfindByUserId,
|
||||||
|
APIfindCoupon
|
||||||
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
|
const fromInfo = reactive({
|
||||||
|
tabIndex: 0,
|
||||||
|
list: [],
|
||||||
|
status: 1,
|
||||||
|
shopId: null,
|
||||||
|
orderId: null,
|
||||||
|
couopnInfo: null,
|
||||||
|
shoppingCart: [],
|
||||||
|
productList: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
// 判断是选择优惠卷
|
||||||
|
const Orderinfo = reactive({
|
||||||
|
typeOrder: '',
|
||||||
|
shopUserId: "",
|
||||||
|
payAmount: "",
|
||||||
|
shoppingCart: [],
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
|
||||||
|
// 去使用优惠券
|
||||||
|
const navigatorGo = (item) => {
|
||||||
|
console.log(Orderinfo.payAmount, item)
|
||||||
|
if (Orderinfo.payAmount < item.fullAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前订单金额不足使用金额",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Orderinfo.payAmount < item.discountAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "当前订单金额不足抵扣金额",
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.$emit('returnData', {
|
||||||
|
typeOrder: Orderinfo.typeOrder,
|
||||||
|
item,
|
||||||
|
});
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const Selectedlist = ref([])
|
||||||
|
|
||||||
|
// 商品卷
|
||||||
|
const clickupicon = async (item, index) => {
|
||||||
|
lowestPrices.value = []
|
||||||
|
if (!item.show) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.log(Orderinfo.shoppingCart)
|
||||||
|
if (Orderinfo.shoppingCart.length < Selectedlist.value.length) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '不可多余下单参数哦!'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.Selected) {
|
||||||
|
Selectedlist.value = Selectedlist.value.filter(i => i.id !== item.id)
|
||||||
|
} else {
|
||||||
|
// 筛查出最低价格
|
||||||
|
await productmethod()
|
||||||
|
const matchedItem = lowestPrices.value.find(cartItem => cartItem.productId == item.proId);
|
||||||
|
Selectedlist.value.push({
|
||||||
|
...item,
|
||||||
|
price: matchedItem.price,
|
||||||
|
memberPrice: matchedItem.memberPrice
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fromInfo.list[index].Selected = !item.Selected
|
||||||
|
}
|
||||||
|
|
||||||
|
// 这是判断是否符合选中规格
|
||||||
|
const groupByPropertyAndCount = (arr, property) => {
|
||||||
|
// 创建一个空对象来存储每个属性值对应的数量
|
||||||
|
const propertyMap = {};
|
||||||
|
|
||||||
|
// 遍历原始数组
|
||||||
|
arr.forEach(item => {
|
||||||
|
const key = item[property];
|
||||||
|
const num = item.number || 1;
|
||||||
|
if (!propertyMap[key]) {
|
||||||
|
// 如果该属性值还没有在 propertyMap 中,初始化一个对象
|
||||||
|
propertyMap[key] = {
|
||||||
|
value: item[property],
|
||||||
|
count: num
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// 如果该属性值已经存在,增加数量
|
||||||
|
propertyMap[key].count += num;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 将 propertyMap 中的结果转换为数组
|
||||||
|
return Object.values(propertyMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 存储每个 productId 对应的最低价格
|
||||||
|
const lowestPrices = ref([]);
|
||||||
|
|
||||||
|
// 筛选出携带的商品是否有相同的商品 productId
|
||||||
|
const productmethod = () => {
|
||||||
|
const groupedProducts = {};
|
||||||
|
// 第一步:将相同 productId 的商品分组
|
||||||
|
Orderinfo.shoppingCart.forEach(product => {
|
||||||
|
const {
|
||||||
|
productId
|
||||||
|
} = product;
|
||||||
|
if (!groupedProducts[productId]) {
|
||||||
|
groupedProducts[productId] = [];
|
||||||
|
}
|
||||||
|
groupedProducts[productId].push(product);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 第二步:遍历每个分组,找出最低价格
|
||||||
|
for (const productId in groupedProducts) {
|
||||||
|
let minPrice = Infinity;
|
||||||
|
let minMemberPrice = Infinity;
|
||||||
|
groupedProducts[productId].forEach(product => {
|
||||||
|
if (product.price < minPrice) {
|
||||||
|
minPrice = product.price;
|
||||||
|
minMemberPrice = product.memberPrice;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 将每个 productId 的最低价格信息添加到 lowestPrices 数组中
|
||||||
|
lowestPrices.value.push({
|
||||||
|
productId: Number(productId),
|
||||||
|
price: minPrice,
|
||||||
|
memberPrice: minMemberPrice
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCouponList = async () => {
|
||||||
|
let res = await APIfindCoupon({
|
||||||
|
type: Orderinfo.typeOrder,
|
||||||
|
shopUserId: Orderinfo.shopUserId,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (Orderinfo.typeOrder == 2) {
|
||||||
|
res.forEach((item) => {
|
||||||
|
item.Selected = false
|
||||||
|
})
|
||||||
|
res = res.map(item => {
|
||||||
|
const matchedItem = Orderinfo.shoppingCart.find(cartItem => cartItem.productId == item
|
||||||
|
.proId);
|
||||||
|
const hasMatch = Boolean(matchedItem);
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
show: hasMatch,
|
||||||
|
price: hasMatch ? matchedItem.price : undefined,
|
||||||
|
memberPrice: hasMatch ? matchedItem.memberPrice : undefined
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
fromInfo.list = []
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
fromInfo.list = res
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
}
|
||||||
|
const cancelCoupon = () => {
|
||||||
|
uni.$emit('returnData', Selectedlist.value);
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取当前页面栈
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const options = currentPage.options;
|
||||||
|
|
||||||
|
if (options.shopId) {
|
||||||
|
fromInfo.shopId = options.shopId
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.type) {
|
||||||
|
Orderinfo.typeOrder = options.type == 'confirm_order_product' ? 2 : 1
|
||||||
|
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: Orderinfo.typeOrder == 2 ? '商品卷' : '优惠卷',
|
||||||
|
success: () => {
|
||||||
|
console.log('导航栏标题修改成功');
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('导航栏标题修改失败', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Orderinfo.shopUserId = options.shopUserId
|
||||||
|
Orderinfo.payAmount = options.payAmount
|
||||||
|
Orderinfo.shoppingCart = JSON.parse(decodeURIComponent(options.shoppingCart))
|
||||||
|
}
|
||||||
|
getCouponList()
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
.towcontent {
|
||||||
|
padding: 0 28rpx;
|
||||||
|
border-top: 16rpx solid #f7f7f7;
|
||||||
|
|
||||||
|
.towcontentlistxitem {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 32rpx;
|
||||||
|
|
||||||
|
.towcontentlistxitembox {
|
||||||
|
width: 33.33%;
|
||||||
|
font-family: PingFang SC, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
justify-content: flex-start;
|
||||||
|
height: 50rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
margin-top: 6rpx;
|
||||||
|
width: 38.83rpx;
|
||||||
|
height: 8.62rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.towcontentlistxitemboxopacity {
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #E3AD7F;
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
margin-top: 6rpx;
|
||||||
|
width: 38.83rpx;
|
||||||
|
height: 8.62rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertop {
|
||||||
|
padding: 40rpx 32rpx;
|
||||||
|
|
||||||
|
.containertopbox {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
|
||||||
|
.containertopboxitem::after {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 14rpx;
|
||||||
|
left: 14rpx;
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/coupontop.png) no-repeat;
|
||||||
|
width: 72.83rpx;
|
||||||
|
height: 77.14rpx;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitem {
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.containertopboxitemleft {
|
||||||
|
position: relative;
|
||||||
|
width: 182rpx;
|
||||||
|
height: 192rpx;
|
||||||
|
background: #E3AD7F;
|
||||||
|
border-radius: 18rpx 0rpx 0rpx 18rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
|
||||||
|
|
||||||
|
// ::before {
|
||||||
|
// content: '';
|
||||||
|
// position: absolute;
|
||||||
|
// bottom: 0rpx;
|
||||||
|
// left: 166rpx;
|
||||||
|
// background: #fff;
|
||||||
|
// display: inline-block;
|
||||||
|
// width: 32rpx;
|
||||||
|
// height: 16rpx;
|
||||||
|
// line-height: 32rpx;
|
||||||
|
// border-radius: 32rpx 32rpx 0 0;
|
||||||
|
// box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
||||||
|
// z-index: 999;
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
.containertopboxitemleft_one {
|
||||||
|
text {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 60rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft_ones {
|
||||||
|
text {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft_tow {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft_nameVip {
|
||||||
|
color: #967152;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft_tows {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -20rpx;
|
||||||
|
left: 166rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 0rpx 1rpx 9rpx 21rpx rgba(0, 0, 0, 0.04);
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -20rpx;
|
||||||
|
left: 166rpx;
|
||||||
|
background: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: inset 0rpx 0rpx 15rpx 1rpx rgba(0, 0, 0, 0.1);
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemleft_vip {
|
||||||
|
background-color: #E1D4B2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemlefts {
|
||||||
|
background: #F7F7F7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright {
|
||||||
|
position: relative;
|
||||||
|
padding: 0 32rpx;
|
||||||
|
flex: auto;
|
||||||
|
height: 192rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
||||||
|
|
||||||
|
.containertopboxitemright_one {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
padding: 16rpx 0 20rpx 0;
|
||||||
|
border-bottom: 1rpx dashed #707070;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 26rpx;
|
||||||
|
height: 26rpx;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright_tow {
|
||||||
|
margin-top: 24rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright_there {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright_btn {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||||
|
|
||||||
|
.upicon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1rpx solid #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright_four {
|
||||||
|
color: #FFFFFF;
|
||||||
|
background: #967152;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containertopboxitemright_fours {
|
||||||
|
color: #999999;
|
||||||
|
background: #F7F7F7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select {
|
||||||
|
padding-bottom: 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnBox {
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 999;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx 30rpx 50rpx 30rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background: #E3AD7F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,9 +3,8 @@
|
|||||||
<view class="headStatus"
|
<view class="headStatus"
|
||||||
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||listinfo.status=='closed'">
|
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'||listinfo.status=='closed'">
|
||||||
<view class="status">
|
<view class="status">
|
||||||
<u-icon name="checkmark-circle-fill" color="#03C061" size="46"></u-icon>
|
<up-icon name="checkmark-circle-fill" color="#03C061" size="23"></up-icon>
|
||||||
<view class="statusName" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<view class="statusName" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<!-- {{listinfo.registerType == 'munchies'?'待支付':'下单成功'}} -->
|
|
||||||
待支付
|
待支付
|
||||||
</view>
|
</view>
|
||||||
<view class="statusName" v-if="listinfo.status=='closed'">已完成</view>
|
<view class="statusName" v-if="listinfo.status=='closed'">已完成</view>
|
||||||
@@ -33,11 +32,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 先下单后支付 -->
|
<!-- 先下单后支付 -->
|
||||||
<!-- <orderInfoAfter ref="orderInfoAfterRef" :amountVIP="amountVIP" :rechargeFreeChecked="rechargeFreeChecked"
|
|
||||||
:freeCheck="freeCheck" :listinfo="listinfo" @setPayAmount="setPayAmount"
|
|
||||||
v-if="listinfo.useType == 'dine-in-after'"></orderInfoAfter> -->
|
|
||||||
<orderInfoAfter ref="orderInfoAfterRef" :rechargeFreeChecked="rechargeFreeChecked" :freeCheck="freeCheck"
|
<orderInfoAfter ref="orderInfoAfterRef" :rechargeFreeChecked="rechargeFreeChecked" :freeCheck="freeCheck"
|
||||||
:listinfo="listinfo"></orderInfoAfter>
|
:listinfo="listinfo" :orderVIP="orderVIP" :ordershopUserInfo='ordershopUserInfo' @istype="istype">
|
||||||
|
</orderInfoAfter>
|
||||||
|
|
||||||
<!-- 先支付后下单 -->
|
<!-- 先支付后下单 -->
|
||||||
<!-- <orderInfoBefore ref="orderInfoBefore" :listinfo="listinfo" v-else></orderInfoBefore> -->
|
<!-- <orderInfoBefore ref="orderInfoBefore" :listinfo="listinfo" v-else></orderInfoBefore> -->
|
||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
@@ -48,7 +46,7 @@
|
|||||||
ref="rechargeFree"
|
ref="rechargeFree"
|
||||||
:freeDisabled="freeDisabled"
|
:freeDisabled="freeDisabled"
|
||||||
:payAmount="listinfo.payAmount"
|
:payAmount="listinfo.payAmount"
|
||||||
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
|
||||||
</block>
|
</block>
|
||||||
<block v-else>
|
<block v-else>
|
||||||
<rechargeFree
|
<rechargeFree
|
||||||
@@ -57,42 +55,33 @@
|
|||||||
ref="rechargeFree"
|
ref="rechargeFree"
|
||||||
:freeDisabled="freeDisabled"
|
:freeDisabled="freeDisabled"
|
||||||
:payAmount="listinfo.payAmount"
|
:payAmount="listinfo.payAmount"
|
||||||
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
|
||||||
|
|
||||||
|
</block> -->
|
||||||
|
|
||||||
|
<!-- 支付方式 -->
|
||||||
|
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange">
|
||||||
|
</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> -->
|
||||||
|
|
||||||
</block>
|
|
||||||
<paymentMethod ref="paymentMethod" :rechargeFreeChecked="rechargeFreeChecked" v-if="amountVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck" :payAmount="listinfo.payAmount" :amountVIP="amountVIP" @groupChange="groupChange"></paymentMethod>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<view class="fixedview">
|
<view class="fixedview">
|
||||||
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<view class="flex-between" v-if="listinfo.status == 'unpaid'">
|
||||||
<view class="fixedview_one flex-start">
|
<view class="fixedview_one flex-start">
|
||||||
<view class="fixedview_oneone"> 实付金额: </view>
|
<view class="fixedview_oneone"> 实付金额: </view>
|
||||||
<view class="fixedview_onetow">
|
<view class="fixedview_onetow">
|
||||||
<text>¥</text>{{listinfo.payAmount}}
|
<text>¥</text>{{listinfo.totalCost}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(goToPay,1000)">
|
<view class="fixedview_tow" @tap="$u.debounce(goToPay,1000)">
|
||||||
{{11}}
|
{{paymentmethod.paymentBtnText}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 100%;height: 200rpx;"> </view>
|
<view style="width: 100%;height: 200rpx;"> </view>
|
||||||
<u-popup :show="ispws" :round="20" mode="bottom" @close="payClose" height="500" :safeAreaInsetBottom="false">
|
<payPassword :isShow="ispws" @inputComplete="accountPayevent" @close="ispws = false" />
|
||||||
<view class="pay-info-wrap">
|
|
||||||
<view class="info-wrap flex-between">
|
|
||||||
<view class="close" @click="payClose">
|
|
||||||
<u-icon name="close" color="#999999" size="40"></u-icon>
|
|
||||||
</view>
|
|
||||||
<text class="title">请输入支付密码</text>
|
|
||||||
<view></view>
|
|
||||||
</view>
|
|
||||||
<view class="info-content">
|
|
||||||
<payPasswordtwo ref="payPwd" :payAmount="listinfo.payAmount" @accountPayevent="accountPayevent"
|
|
||||||
v-if="ispws"></payPasswordtwo>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -100,7 +89,9 @@
|
|||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted
|
onMounted,
|
||||||
|
onUnmounted,
|
||||||
|
watchEffect
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -108,6 +99,7 @@
|
|||||||
} from '@/common/api/order/index.js'
|
} from '@/common/api/order/index.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
APIusershopInfodetail,
|
||||||
APIshopUserInfo
|
APIshopUserInfo
|
||||||
} from '@/common/api/member.js'
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
@@ -117,24 +109,30 @@
|
|||||||
|
|
||||||
const cartStore = useCartStore()
|
const cartStore = useCartStore()
|
||||||
|
|
||||||
// import payPasswordtwo from '@/components/payPasswordtwo.vue'
|
// 结账管理
|
||||||
|
import {
|
||||||
|
Memberpay
|
||||||
|
} from '@/stores/pay.js';
|
||||||
|
|
||||||
|
const storeMemberpay = Memberpay();
|
||||||
|
|
||||||
|
import payPassword from '@/components/payPassword.vue'
|
||||||
import orderInfoAfter from './components/orderInfoAfter.vue'
|
import orderInfoAfter from './components/orderInfoAfter.vue'
|
||||||
// import orderInfoBefore from '../components/orderInfoBefore.vue'
|
// import orderInfoBefore from '../components/orderInfoBefore.vue'
|
||||||
// import rechargeFree from '../components/rechargeFree.vue'
|
// import rechargeFree from '../components/rechargeFree.vue'
|
||||||
// import paymentMethod from '../components/paymentMethod.vue'
|
import paymentMethodes from '@/components/paymentMethod.vue'; //支付方式
|
||||||
|
|
||||||
// 输入支付密码
|
// 输入支付密码
|
||||||
const ispws = ref(false)
|
const ispws = ref(false)
|
||||||
|
|
||||||
// 支付方式切换
|
// 商品订单会员
|
||||||
const paymentmethod = reactive({
|
const ordershopUserInfo = ref({
|
||||||
radiovalue: 1,
|
isTableFee: 0
|
||||||
paymentBtnText: "余额支付",
|
|
||||||
payType: ''
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 是否显示商家二维码信息
|
||||||
try {
|
try {
|
||||||
const shopQrcode = uni.cache.get('shopInfo').shopQrcode
|
const shopQrcode = ref(uni.cache.get('shopInfo').shopQrcode)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
@@ -144,117 +142,87 @@
|
|||||||
|
|
||||||
// 订单详情
|
// 订单详情
|
||||||
const listinfo = reactive({
|
const listinfo = reactive({
|
||||||
|
combinedArray: {},
|
||||||
})
|
Productroll: 0,
|
||||||
const listinfoId = ref('')
|
coupondiscountAmount: "",
|
||||||
|
couponInfoList: ''
|
||||||
// 会员信息?
|
|
||||||
const amountVIP = reactive({})
|
|
||||||
|
|
||||||
//优惠卷信息
|
|
||||||
const couopnInfo = reactive({
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const freeDisabled = ref(false)
|
// 会员信息
|
||||||
|
const orderVIP = ref()
|
||||||
|
|
||||||
|
//判断是否是打包商品
|
||||||
|
const is_type = ref(0)
|
||||||
|
|
||||||
|
//打包商品切换
|
||||||
|
const istype = (newValue) => {
|
||||||
|
is_type.value = newValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
//积分
|
||||||
const freeCheck = ref(false)
|
const freeCheck = ref(false)
|
||||||
const rechargeFreeChecked = ref(false)
|
|
||||||
|
|
||||||
// * 获取订单详情接口
|
// * 获取订单详情接口
|
||||||
const orderorderInfo = async () => {
|
const orderorderInfo = async () => {
|
||||||
let res = await APIgetOrderById({
|
let res = await APIgetOrderById({
|
||||||
orderId: orderId.value
|
orderId: orderId.value
|
||||||
})
|
})
|
||||||
console.log(res)
|
|
||||||
if (res) {
|
if (res) {
|
||||||
Object.assign(listinfo, res);
|
Object.assign(listinfo, res);
|
||||||
console.log(listinfo)
|
if (listinfo.status == 'unpaid') {
|
||||||
if (listinfo.couponInfoList) {
|
try {
|
||||||
listinfo.couponInfoList = JSON.parse(listinfo.couponInfoList)
|
let res = await APIhistoryOrder({
|
||||||
}
|
orderId: orderId.value
|
||||||
// this.listinfoId = res.data.orderId;
|
|
||||||
// this.shopId = res.data.shopId;
|
|
||||||
// if (listinfo.useType == " ") {
|
|
||||||
// //堂食先付费
|
|
||||||
// }
|
|
||||||
// if (listinfo.freeDingConfig && listinfo.payAmount < listinfo.freeDingConfig
|
|
||||||
// .rechargeThreshold) {
|
|
||||||
// this.freeDisabled = true
|
|
||||||
// }
|
|
||||||
// console.log(listinfo)
|
|
||||||
// if (listinfo.useType == "dine-in-after") {
|
|
||||||
// console.log(this.$refs.orderInfoAfterRef)
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs.orderInfoAfterRef.childOnShow();
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// this.getAount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const setPayAmount = (data) => {
|
|
||||||
console.log(data)
|
|
||||||
listinfo.payAmount = data.payAmount
|
|
||||||
this.couopnInfo = data;
|
|
||||||
this.freeDisabled = data.freeDisabled
|
|
||||||
this.freeCheck = data.freeCheck
|
|
||||||
if (listinfo.freeDingConfig && listinfo.payAmount < listinfo.freeDingConfig
|
|
||||||
.rechargeThreshold) {
|
|
||||||
this.freeDisabled = true
|
|
||||||
} else {
|
|
||||||
this.freeDisabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 免单状态监听
|
|
||||||
const changeFree = (val) => {
|
|
||||||
// this.freeCheck = val;
|
|
||||||
this.rechargeFreeChecked = !val
|
|
||||||
|
|
||||||
if (this.rechargeFreeChecked) {
|
|
||||||
if (this.couopnInfo) {
|
|
||||||
if (this.couopnInfo.isPointsChecked) {
|
|
||||||
listinfo.payAmount = (Number(listinfo.payAmount) + (this.couopnInfo
|
|
||||||
.calcUsablePointsData.pointsNum / this.couopnInfo.calcUsablePointsData
|
|
||||||
.equivalentPoints)).toFixed(2);
|
|
||||||
}
|
|
||||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
|
||||||
if (couponList.length > 0) {
|
|
||||||
listinfo.payAmount = (couponList.length > 0 ? Number(listinfo.payAmount) +
|
|
||||||
couponList[0].discountAmount : listinfo.payAmount)
|
|
||||||
}
|
|
||||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
|
||||||
if (productList.length > 0) {
|
|
||||||
productList.map(item => {
|
|
||||||
|
|
||||||
listinfo.payAmount = Number(listinfo.payAmount) + item.discountAmount
|
|
||||||
})
|
})
|
||||||
}
|
} catch (error) {}
|
||||||
|
// if (listinfo.couponInfoList) {
|
||||||
|
// listinfo.couponInfoList = JSON.parse(listinfo.couponInfoList)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
listinfo.payAmount = (listinfo.payAmount * listinfo.freeDingConfig.rechargeTimes)
|
|
||||||
.toFixed(2)
|
|
||||||
} else {
|
|
||||||
listinfo.payAmount = (listinfo.payAmount / listinfo.freeDingConfig.rechargeTimes)
|
|
||||||
.toFixed(2)
|
|
||||||
if (this.couopnInfo) {
|
|
||||||
this.couopnInfo.isPointsChecked = false;
|
|
||||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
|
||||||
if (couponList.length > 0) {
|
|
||||||
listinfo.payAmount = (couponList.length > 0 ? Number(listinfo.payAmount) -
|
|
||||||
couponList[0].discountAmount : listinfo.payAmount)
|
|
||||||
}
|
|
||||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
|
||||||
if (productList.length > 0) {
|
|
||||||
productList.map(item => {
|
|
||||||
listinfo.payAmount = Number(listinfo.payAmount) - item.discountAmount
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 历史订单
|
||||||
|
if (listinfo.detailMap) {
|
||||||
|
let combinedArray = [];
|
||||||
|
for (const key in listinfo.detailMap) {
|
||||||
|
if (listinfo.detailMap.hasOwnProperty(key)) {
|
||||||
|
let subArray = listinfo.detailMap[key];
|
||||||
|
combinedArray = [...combinedArray, ...subArray]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
listinfo.combinedArray = combinedArray
|
||||||
|
setTimeout(async () => {
|
||||||
|
listinfo.packFee = await cartStore.getTotalPackFee(listinfo.combinedArray)
|
||||||
|
// 计算购物车商品费用
|
||||||
|
listinfo.totalPrices = await cartStore.getTotalTotalPrices(listinfo.combinedArray)
|
||||||
|
// 餐位费listinfo.seatNum
|
||||||
|
listinfo.Seatcharge = await cartStore.getTotalSeatcharge(listinfo.seatNum)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 监听价格算法
|
||||||
|
watchEffect(async () => {
|
||||||
|
if (listinfo.combinedArray.length > 0) {
|
||||||
|
//总价格
|
||||||
|
console.log(listinfo.combinedArray, listinfo.packFee, listinfo.totalPrices, listinfo.Seatcharge,
|
||||||
|
listinfo.Productroll, listinfo.coupondiscountAmount)
|
||||||
|
// 打包费packFee 计算购物车商品费用totalPrices 餐位费Seatcharge
|
||||||
|
let sum = (is_type.value != 0 ? listinfo.packFee : 0) + listinfo.totalPrices + (is_type.value ==
|
||||||
|
0 ? listinfo.Seatcharge : 0);
|
||||||
|
listinfo.originAmount = Math.round(sum * 100) / 100;
|
||||||
|
|
||||||
|
// 打包费packFee 计算购物车商品费用totalPrices 餐位费Seatcharge 商品卷Productroll 优惠卷coupondiscountAmount
|
||||||
|
let sums = (is_type.value != 0 ? listinfo.packFee : 0) + listinfo.totalPrices + (is_type.value ==
|
||||||
|
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
|
||||||
|
.coupondiscountAmount || 0);
|
||||||
|
listinfo.totalCost = Math.round(sums * 100) / 100;
|
||||||
|
console.log(listinfo.totalCost)
|
||||||
|
// totalCost.value = Math.round(sums * 100) / 100;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const saveImage = (url) => {
|
const saveImage = (url) => {
|
||||||
uni.saveImage({
|
uni.saveImage({
|
||||||
url: url,
|
url: url,
|
||||||
@@ -267,22 +235,17 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 获取会员信息
|
// 支付方式切换
|
||||||
const getAount = async () => {
|
const paymentmethod = reactive({
|
||||||
let res = await this.api.shopUserInfo({
|
radiovalue: 1,
|
||||||
"shopId": listinfo.shopId,
|
paymentBtnText: "余额支付",
|
||||||
"userId": uni.cache.get('userInfo').id,
|
payType: ''
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
|
||||||
console.log("会员信息===", res)
|
|
||||||
this.amountVIP = res.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 获取会员信息
|
|
||||||
const groupChange = async (e) => {
|
const groupChange = async (e) => {
|
||||||
this.radiovalue = e.type;
|
paymentmethod.radiovalue = e.type;
|
||||||
this.paymentBtnText = e.name;
|
paymentmethod.paymentBtnText = e.name;
|
||||||
|
paymentmethod.payType = e.payType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 去充值
|
// * 去充值
|
||||||
@@ -292,250 +255,83 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 操作下单时候
|
||||||
|
const orderInfoAfterRef = ref(null)
|
||||||
|
|
||||||
|
// 商品卷的id储存
|
||||||
|
const uniqueIds = ref([])
|
||||||
|
|
||||||
|
// 这是优惠卷传的值
|
||||||
|
const handleReturnData = async (data) => {
|
||||||
|
console.log(data)
|
||||||
|
// 这是优惠卷
|
||||||
|
if (data.typeOrder == 1) {
|
||||||
|
// 优惠卷减去的金额
|
||||||
|
listinfo.coupondiscountAmount = data.item.discountAmount
|
||||||
|
uniqueIds.value.push(data.item.id)
|
||||||
|
orderInfoAfterRef.value.dataprocessing(data)
|
||||||
|
} else {
|
||||||
|
// 筛选出商品卷的id
|
||||||
|
uniqueIds.value = [...uniqueIds.value, ...new Set(data.map(item => item.id))]
|
||||||
|
// 商品卷总价价格
|
||||||
|
listinfo.Productroll = await cartStore.getTotalProductroll(data)
|
||||||
|
let res = {
|
||||||
|
Productroll: listinfo.Productroll,
|
||||||
|
uniqueIds: uniqueIds.value.length
|
||||||
|
}
|
||||||
|
orderInfoAfterRef.value.dataprocessing(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
// * 去支付
|
// * 去支付
|
||||||
const goToPay = async () => {
|
const goToPay = async () => {
|
||||||
if ((this.radiovalue == 2 || this.radiovalue == 3) && listinfo.payAmount <= 0) {
|
// 余额支付
|
||||||
uni.showToast({
|
if (paymentmethod.payType == '') {
|
||||||
title: "支付金额必须大于0",
|
ispws.value = true
|
||||||
icon: 'none'
|
return false
|
||||||
})
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (this.couopnInfo) {
|
let checkOrderPay = {
|
||||||
let params = {
|
orderId: orderId.value,
|
||||||
shopId: listinfo.shopId,
|
vipPrice: orderVIP.value.isVip == 1 && ordershopUserInfo.value.isMemberPrice == 1 ? 1 :
|
||||||
orderId: listinfo.orderId,
|
0, //是否使用会员价0否1是
|
||||||
userCouponInfos: this.couopnInfo.userCouponInfos,
|
allPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||||
}
|
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //用餐人数
|
||||||
if (this.couopnInfo.isPointsChecked && this.couopnInfo.calcUsablePointsData.pointsNum && this
|
originAmount: listinfo.originAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||||
.couopnInfo.calcUsablePointsData.pointsNum > 0) {
|
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||||
params.pointsNum = this.couopnInfo.calcUsablePointsData.pointsNum;
|
discountAmount: 0, //手动优惠金额 写死0
|
||||||
}
|
productCouponDiscountAmount: listinfo.Productroll, //商品优惠券抵扣金额
|
||||||
let res = await this.api.useCoupon(params)
|
fullCouponDiscountAmount: listinfo.coupondiscountAmount, //满减优惠券抵扣金额
|
||||||
|
couponList: uniqueIds.value, //用户使用的卡券
|
||||||
|
orderAmount: listinfo.totalCost, // 最中订单金额
|
||||||
|
roundAmount: 0, //抹零金额 减免多少钱
|
||||||
|
pointsDiscountAmount: 0, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
|
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
||||||
|
remark: '', //用户备注
|
||||||
}
|
}
|
||||||
|
let res = await storeMemberpay.actionsltPayOrder({
|
||||||
if (this.radiovalue == 2 || this.radiovalue == 3) {
|
checkOrderPay,
|
||||||
this.wechatPay() //微信支付
|
payType: paymentmethod.payType,
|
||||||
} else {
|
buyerRemark: '',
|
||||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
returnUrl: ''
|
||||||
// console.log(isPwd,'是否设置了支付密码')
|
|
||||||
if (this.amountVIP.isVip == 0) { //非会员情况
|
|
||||||
|
|
||||||
this.goRecharge();
|
|
||||||
} else {
|
|
||||||
if (uni.cache.get('userInfo').isPwd == 0) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/member/setPassword?shopUserInfo=' + JSON.stringify(this.amountVIP)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.hideLoading()
|
|
||||||
// this.payPasswordShow = false;
|
|
||||||
this.ispws = true
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 取消支付
|
|
||||||
const payClose = async () => {
|
|
||||||
this.ispws = false;
|
|
||||||
console.log(2)
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '取消支付'
|
|
||||||
})
|
})
|
||||||
setTimeout(res => {
|
if (res) {
|
||||||
uni.switchTab({
|
await orderorderInfo()
|
||||||
url: '/pages/order/order'
|
// uni.redirectTo({
|
||||||
});
|
// url: '/order/detail?orderId=' + res.id
|
||||||
}, 500)
|
// });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 余额支付
|
// 余额支付
|
||||||
const accountPayevent = async (pwd) => {
|
const accountPayevent = async (pwd) => {
|
||||||
this.ispws = false;
|
console.log('输入的密码是:', pwd);
|
||||||
let res = await this.api.accountPay({
|
ispws.value = false;
|
||||||
orderId: this.listinfoId,
|
|
||||||
memberId: this.amountVIP.id,
|
|
||||||
pwd: pwd
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
// data ->1 支付成功
|
|
||||||
// ->2 余额不足
|
|
||||||
// ->3 未设置支付密码,
|
|
||||||
// ->4 不是会员,
|
|
||||||
if (res.data == 1) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功",
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
let _this = this
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ["z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ",
|
|
||||||
"AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"
|
|
||||||
],
|
|
||||||
complete() {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoId
|
|
||||||
});
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else if (res.data == 2) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "余额不足",
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
} else if (res.data == 3) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "未设置支付密码",
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/member/setPassword?shopUserInfo=' + JSON.stringify(this
|
|
||||||
.amountVIP)
|
|
||||||
})
|
|
||||||
}, 1500)
|
|
||||||
|
|
||||||
} else if (res.data == 4) {
|
|
||||||
uni.showToast({
|
|
||||||
title: "非会员请充值",
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
// 去充值
|
|
||||||
this.goRecharge()
|
|
||||||
}, 1500)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
onUnmounted(() => {
|
||||||
* 微信支付
|
uni.$off('returnData', handleReturnData);
|
||||||
*/
|
});
|
||||||
const wechatPay = async () => {
|
|
||||||
let res;
|
|
||||||
console.log(this.rechargeFreeChecked)
|
|
||||||
if (!this.rechargeFreeChecked) {
|
|
||||||
res = await this.api.orderPay({
|
|
||||||
orderId: orderId.value,
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
payType: 'wechatPay',
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
payType: 'aliPay',
|
|
||||||
// #endif
|
|
||||||
// payType: this.radiovalue == 2 ? 'wechatPay' : 'aliPay'
|
|
||||||
}) //判断是否支付成功
|
|
||||||
} else {
|
|
||||||
console.log(listinfo.payAmount)
|
|
||||||
res = await this.api.paymemeberIn({
|
|
||||||
shopId: listinfo.shopId,
|
|
||||||
amount: listinfo.payAmount,
|
|
||||||
orderId: orderId.value,
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
payType: 'wechatPay',
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
payType: 'aliPay',
|
|
||||||
// #endif
|
|
||||||
// payType: this.radiovalue == 2 ? 'wechatPay' : 'aliPay'
|
|
||||||
}) //判断是否支付成功
|
|
||||||
}
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
uni.requestPayment({
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
provider: 'wxpay', //支付类型-固定值
|
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
|
||||||
nonceStr: res.data.nonceStr, // 随机字符串
|
|
||||||
package: res.data.package, // 固定值
|
|
||||||
signType: res.data.signType, //固定值
|
|
||||||
paySign: res.data.paySign, //签名
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
provider: 'alipay', //支付类型-固定值
|
|
||||||
orderInfo: res.data.tradeNo, // 微信支付商户号
|
|
||||||
// #endif
|
|
||||||
success: (res) => {
|
|
||||||
let _this = this
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功"
|
|
||||||
})
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
uni.requestSubscribeMessage({
|
|
||||||
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
|
||||||
complete() {
|
|
||||||
|
|
||||||
_this.paymodfiyOrderInfo()
|
|
||||||
setTimeout(res => {
|
|
||||||
uni.hideLoading()
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/order/order'
|
|
||||||
});
|
|
||||||
}, 500)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
_this.paymodfiyOrderInfo()
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/order/order'
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
fail: async (err) => {
|
|
||||||
|
|
||||||
let res = await this.api.cancelOrderPay({
|
|
||||||
orderId: orderId.value,
|
|
||||||
}) //判断是否支付成功
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '支付失败'
|
|
||||||
})
|
|
||||||
setTimeout(res => {
|
|
||||||
uni.hideLoading()
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/order/order'
|
|
||||||
});
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 支付完成后请求
|
|
||||||
const paymodfiyOrderInfo = async () => {
|
|
||||||
let res = await this.api.paymodfiyOrderInfo({
|
|
||||||
orderId: listinfo.orderId,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// * 复制订单号
|
|
||||||
const copyHandle = async (e) => {
|
|
||||||
uni.setClipboardData({
|
|
||||||
data: e,
|
|
||||||
success() {
|
|
||||||
uni.showToast({
|
|
||||||
title: '复制成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 获取当前页面栈
|
// 获取当前页面栈
|
||||||
@@ -545,16 +341,25 @@
|
|||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
const options = currentPage.options;
|
const options = currentPage.options;
|
||||||
orderId.value = options.orderId
|
orderId.value = options.orderId
|
||||||
let res = await APIshopUserInfo({
|
if (options.shopId) {
|
||||||
shopId: options.shopId
|
// 每次进来全局更新shopId
|
||||||
})
|
uni.cache.set('shopId', options.shopId, 30)
|
||||||
cartStore.shopInfo = res.shopInfo
|
uni.$on('returnData', handleReturnData);
|
||||||
orderorderInfo()
|
// * 获取会员信息
|
||||||
|
let res = await APIshopUserInfo({
|
||||||
|
shopId: options.shopId
|
||||||
|
})
|
||||||
|
uni.cache.set('orderVIP', res)
|
||||||
|
uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||||
|
orderVIP.value = res
|
||||||
|
ordershopUserInfo.value = res.shopInfo
|
||||||
|
}
|
||||||
|
await orderorderInfo()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss">
|
||||||
::v-deep page {
|
page {
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,12 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view></view>
|
<view></view>
|
||||||
<view class="intro-wrap">
|
<view class="intro-wrap">
|
||||||
下单日期:{{$u.timeFormat(item.createdAt, 'yyyy-mm-dd hh:MM')}}
|
下单日期:{{item.createTime}}
|
||||||
</view>
|
</view>
|
||||||
<view class="shop-info">
|
<view class="shop-info">
|
||||||
<view class="shop-item">
|
<view class="shop-item">
|
||||||
<view class="cover" v-for="(item1,index1) in item.goods" :key="index1">
|
<view class="cover" v-for="(item1,index1) in item.goods" :key="index1">
|
||||||
<u-image width="112" height="112" radius="20" :src='item1.productImg'
|
<u-image width="56" height="56" radius="10" :src='item1.productImg'
|
||||||
v-if="item1.productId!=-999"></u-image>
|
v-if="item1.productId!=-999"></u-image>
|
||||||
<u-image width="112" height="112" radius="20"
|
<u-image width="112" height="112" radius="20"
|
||||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||||
@@ -73,47 +73,19 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="shop-amount">
|
<view class="shop-amount">
|
||||||
<text class="orderAmount">¥{{item.orderAmount}}</text>
|
<text class="orderAmount">¥{{item.orderAmount}}</text>
|
||||||
<text class="totalNumber">共{{item.totalNumber}}件</text>
|
<text class="totalNumber">共{{item.goods.length}}件</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="footer-wrap">
|
<!-- <view class="footer-wrap">
|
||||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)"
|
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)"
|
||||||
v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
||||||
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)"
|
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)"
|
||||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 新订单 -->
|
|
||||||
<!-- <view class="orderList" v-if="navtabindex == 1">
|
|
||||||
<view class="listBox" v-for="(item,i) in groupList" :key="i" @click="orderinfoTo(item)">
|
|
||||||
<view class="df">
|
|
||||||
<view style="display: flex;">
|
|
||||||
<text>{{item.proName.length>10?item.proName.substring(0,10)+'...':item.proName}}</text><u-icon
|
|
||||||
name="arrow-right" color="#000" size="28"></u-icon>
|
|
||||||
</view>
|
|
||||||
<text
|
|
||||||
:class="[item.status=='unpaid'||item.status=='unused'?'state':'state2']">{{item.status|statusFirter}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="df" style="justify-content: flex-start;margin-top: 32rpx;">
|
|
||||||
<image style="width:120rpx; height: 120rpx;border-radius: 12rpx 12rpx 12rpx 12rpx;"
|
|
||||||
:src="item.proImg" mode="aspectFill">
|
|
||||||
</image>
|
|
||||||
<view class="ml-20 fontStyle">
|
|
||||||
<view>数量:{{item.number}}份</view>
|
|
||||||
<view>实付:<text style="color: #FF4C11;">¥{{item.payAmount}}</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<button v-if="item.status=='unused'" type="primary" class="buttonStyle">查看券码</button>
|
|
||||||
<button v-if="item.status=='unpaid'" type="primary" class="buttonStyle">去付款</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<u-modal width="450rpx" :show="removeOrderShow" @confirm="$u.debounce(removeOrder(),1000)"
|
|
||||||
@cancel="removeOrderShow = false" @close="removeOrderShow = false" :showCancelButton="true"
|
|
||||||
:closeOnClickOverlay="true" :title="'是否删除当前订单'"></u-modal>-->
|
|
||||||
<view v-if="orderForm.list.length <= 0" style="text-align: center;">
|
<view v-if="orderForm.list.length <= 0" style="text-align: center;">
|
||||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||||
@@ -127,13 +99,14 @@
|
|||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted
|
onMounted,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onReady,
|
onReady,
|
||||||
onShow,
|
onShow,
|
||||||
onPageScroll
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import Nav from '@/components/CustomNavbar.vue'; //导航栏
|
import Nav from '@/components/CustomNavbar.vue'; //导航栏
|
||||||
import {
|
import {
|
||||||
@@ -152,11 +125,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '待支付',
|
name: '待支付',
|
||||||
status: 'in-production'
|
status: 'unpaid'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '订单完成',
|
name: '订单完成',
|
||||||
status: 'refunding'
|
status: 'done'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '取消订单',
|
name: '取消订单',
|
||||||
@@ -187,8 +160,7 @@
|
|||||||
size: orderForm.form.size,
|
size: orderForm.form.size,
|
||||||
status: orderForm.status
|
status: orderForm.status
|
||||||
})
|
})
|
||||||
console.log(res)
|
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
|
||||||
if (res.totalPage == 1 && res.totalRow <= 10) {
|
|
||||||
orderForm.form.status = 'nomore'
|
orderForm.form.status = 'nomore'
|
||||||
orderForm.list = res.records
|
orderForm.list = res.records
|
||||||
if (orderForm.form.page == 1 && res.records.length == 0) {
|
if (orderForm.form.page == 1 && res.records.length == 0) {
|
||||||
@@ -198,7 +170,11 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
orderForm.form.status = 'loading';
|
orderForm.form.status = 'loading';
|
||||||
orderForm.list = [...orderForm.list, ...res.records];
|
if (orderForm.form.page == 1) {
|
||||||
|
orderForm.list = res.records
|
||||||
|
} else {
|
||||||
|
orderForm.list = [...orderForm.list, ...res.records];
|
||||||
|
}
|
||||||
orderForm.form.page = ++orderForm.form.page;
|
orderForm.form.page = ++orderForm.form.page;
|
||||||
if (orderForm.form.page > res.totalPage) {
|
if (orderForm.form.page > res.totalPage) {
|
||||||
orderForm.form.status = 'nomore';
|
orderForm.form.status = 'nomore';
|
||||||
@@ -221,24 +197,31 @@
|
|||||||
orderForm.form.page = 1
|
orderForm.form.page = 1
|
||||||
orderForm.form.size = 10
|
orderForm.form.size = 10
|
||||||
orderForm.form.status = 'loadmore'
|
orderForm.form.status = 'loadmore'
|
||||||
navtabindex.value == '1' ? getorderList() : userorderList()
|
// navtabindex.value == '1' ? getorderList() : userorderList()
|
||||||
|
userorderList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderinfo = (e) => {
|
const orderinfo = (e) => {
|
||||||
uni.pro.navigateTo('order/detail', {
|
uni.pro.navigateTo('order/detail', {
|
||||||
orderId: e.id,
|
orderId: e.id,
|
||||||
shopId:e.shopId
|
shopId: e.shopId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onReachBottom(() => {
|
||||||
|
if (orderForm.form.status != 'nomore') {
|
||||||
|
console.log('页面滚动到底部');
|
||||||
|
userorderList()
|
||||||
|
}
|
||||||
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
init_fn()
|
init_fn()
|
||||||
})
|
})
|
||||||
// onMounted(() => {})
|
// onMounted(() => {})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
// background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navtab {
|
.navtab {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
if (numIndex.value == -1 && otherNum.value != "其他") {
|
if (numIndex.value == -1 && otherNum.value != "其他") {
|
||||||
dinersNum.value = otherNum.value
|
dinersNum.value = otherNum.value
|
||||||
}
|
}
|
||||||
if (shopTable.useNum < dinersNum.value) {
|
if (shopTable.useNum < dinersNum.value && shopTable.useNum > 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `最多${shopTable.useNum}人`,
|
title: `最多${shopTable.useNum}人`,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
@@ -6,66 +6,58 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<view class="head_bg"></view>
|
<view class="head_bg"></view>
|
||||||
<view class="tips" v-if="shopInfo.registerType == 'before'">
|
<!-- <view class="tips" v-if="shopInfo.registerType == 'before'"> -->
|
||||||
|
<view class="tips">
|
||||||
<image class="informIcon"
|
<image class="informIcon"
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/informIcon.png"
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/informIcon.png"
|
||||||
mode="aspectFill" />
|
mode="aspectFill" />
|
||||||
<text class="informText">温馨提示:请适量点餐,避免浪费</text>
|
<text class="informText">温馨提示:请适量点餐,避免浪费</text>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 先下单子切换 -->
|
<view class="card" v-if="orderinfo.detailMap">
|
||||||
<view class="tabBox" v-if="shopInfo.registerType == 'before'">
|
<!-- 订单头部 -->
|
||||||
<view class="tab">
|
<view class="card_item" v-for="(value, key) in orderinfo.detailMap" :key="key">
|
||||||
<view v-for="(item,index) in tebtypeList" :key="index"
|
<view class="head">
|
||||||
:class="is_type==index?'tab_item'+(is_type+1)+' tab_item active ':'tab_item'"
|
<view class="head_left">
|
||||||
@click="tabClick(item,index)">
|
<text class="placeNum">第{{key}}次下单</text>
|
||||||
<view></view>
|
<!-- <text class="placeTime">{{item.placeTime}}</text> -->
|
||||||
<image class="icon" :src="is_type==index?item.url_active:item.url" mode="aspectFill" />
|
|
||||||
<text class="title" :class="{active:is_type==index}">{{item.title}}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="table" v-if=" is_type==0 ">
|
<!-- 订单详情 -->
|
||||||
<view class="table_left">
|
<view class="shop-info">
|
||||||
<image class="icon"
|
<view class="item" v-for="item in value" :key="item.id">
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png"
|
<view class="cover">
|
||||||
mode="aspectFill" />
|
<up-image width="76" height="76" radius="16" :src="item.productImg"
|
||||||
<text class="title">桌台</text>
|
v-if="item.productId!=-999"></up-image>
|
||||||
|
<up-image width="76" height="76" radius="16"
|
||||||
|
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||||
|
mode="heightFix" v-else></up-image>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<text class="productName">{{item.productName}}</text>
|
||||||
|
<text class="productSkuName"
|
||||||
|
v-if="item.productSkuName">{{item.productSkuName}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="price">
|
||||||
|
<view class="priceAmount">
|
||||||
|
¥{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}
|
||||||
|
</view>
|
||||||
|
<view class="num">x{{item.num}}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="value" v-if="tableCode"> {{ shopTable.name || '' }} </view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="pack" v-else>
|
<view class="semicircle_icon" v-if="index > 0">
|
||||||
<view class="top">
|
<view class="semicircle_left_icon"></view>
|
||||||
<text class="title">{{ shopInfo.shopName }}</text>
|
<view class="semicircle_right_icon"></view>
|
||||||
<text class="address">{{ shopInfo.address }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="list">
|
|
||||||
<view class="item">
|
|
||||||
<view class="lable">取餐时间</view><view class="text">立即取餐</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="lable">预留电话</view><view class="getPhone text"><u-input class="inputVal" v-model="order.phone" input-align="right" placeholder="请输入预留电话以便联系您" ></u-input><text class="getBtn">获取手机号</text></view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 先下单在在支付 -->
|
|
||||||
<view class="addDish" @click="addDish" v-if="shopInfo.registerType == 'after'">加菜下单</view>
|
|
||||||
<view class="tabBox_t " v-if="shopInfo.registerType == 'after'">
|
|
||||||
<view class="shopName">{{ shopInfo.name }}</view>
|
|
||||||
<view class="tableName"
|
|
||||||
style="display: flex;align-items: center;justify-content: space-between;">
|
|
||||||
<view style="display: flex;">
|
|
||||||
<view>桌号:</view>
|
|
||||||
<view class="name" v-if="shopTable.name">{{ shopTable.name || '' }} </view>
|
|
||||||
<view class="num" v-if="shopTable&&shopTable.seatNum">{{ shopTable.seatNum }}人
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 订单内容区域 -->
|
<!-- 订单内容区域 -->
|
||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
|
<text class="placeNum">购物车</text>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title"> {{ shopInfo.name }} </view>
|
<view class="title"> {{ shopInfo.name }} </view>
|
||||||
<view class="list_item" v-for="(item,index) in cartList" :key="item.id">
|
<view class="list_item" v-for="(item,index) in cartList" :key="item.id">
|
||||||
@@ -85,19 +77,8 @@
|
|||||||
class="price">¥{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
|
class="price">¥{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 打包费 -->
|
|
||||||
<view class="cell-item" v-if="is_type != 0">
|
|
||||||
<view class="label">打包费</view>
|
|
||||||
<view class="val">
|
|
||||||
<view></view>
|
|
||||||
<view style="font-size: 28rpx;">¥</view>
|
|
||||||
<view>{{packFee}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 餐位费 -->
|
<!-- 餐位费 -->
|
||||||
<view class="cell-item"
|
<view class="cell-item" v-if="shopTable.useNum>0">
|
||||||
v-if="shopTable.useNum>0 && shopInfo.registerType == 'before' && is_type == 0">
|
|
||||||
<view class="label">餐位费</view>
|
<view class="label">餐位费</view>
|
||||||
<view class="val">
|
<view class="val">
|
||||||
<view>X{{shopTable.seatNum}}</view>
|
<view>X{{shopTable.seatNum}}</view>
|
||||||
@@ -105,60 +86,10 @@
|
|||||||
<view>{{Seatcharge}}</view>
|
<view>{{Seatcharge}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="totalPrice">
|
||||||
<view v-for="(item,index) in favorable" :key="index"
|
|
||||||
v-if="shopInfo.registerType == 'before'&&!thisdata.rechargeFreeChecked">
|
|
||||||
<view class="favorable" :class="{column:item.value.length>0&&item.type=='product'}"
|
|
||||||
@click="goUrl(item)">
|
|
||||||
<view class="favorable_left">
|
|
||||||
<!-- <image class="icon" :src="item.url" mode="aspectFill"/> -->
|
|
||||||
<text class="name"> {{ item.name }} </text>
|
|
||||||
</view>
|
|
||||||
<view class="favorable_right" v-if="item.type=='coupon'">
|
|
||||||
<text class="favorable_right_text">{{item.value}}</text>
|
|
||||||
<up-icon name="arrow-right" color="#575B66" size="14"></up-icon>
|
|
||||||
</view>
|
|
||||||
<view class="favorable_right" :class="{column:item.value.length>0}"
|
|
||||||
v-if="item.type=='product'">
|
|
||||||
<view :class="{column:item.value.length>0}">
|
|
||||||
<view class="favorable_right_text" v-for="(items,indexs) in item.value"
|
|
||||||
:key="indexs">
|
|
||||||
<text>{{items.name}}</text>
|
|
||||||
<text>X{{items.num}}</text>
|
|
||||||
<text>-¥{{items.discountAmount || 0}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<up-icon name="arrow-right" color="#575B66" size="14"
|
|
||||||
style="margin-top: 5rpx;"></up-icon>
|
|
||||||
</view>
|
|
||||||
<!-- 积分 -->
|
|
||||||
<!-- <view class="favorable_right" v-if="item.type=='points'" @click.stop="pointsChange">
|
|
||||||
<text class="favorable_right_text" style="color: #666;margin-right: 16rpx;"
|
|
||||||
v-if="thisdata.calcUsablePointsData.usable">
|
|
||||||
使用 {{thisdata.calcUsablePointsData.pointsNum}}
|
|
||||||
积分抵扣¥{{thisdata.calcUsablePointsData.pointsNum/thisdata.calcUsablePointsData.equivalentPoints}}
|
|
||||||
</text>
|
|
||||||
<text class="favorable_right_text"
|
|
||||||
style="color: #666;margin-right: 16rpx;color: #DE4D3A;" v-else>
|
|
||||||
{{thisdata.calcUsablePointsData.unusableReason||''}}
|
|
||||||
</text>
|
|
||||||
|
|
||||||
<up-checkbox-group iconPlacement="right" @change="pointsChange">
|
|
||||||
<up-checkbox v-model="isPointsChecked"
|
|
||||||
:disabled="thisdata.freeCheck||!thisdata.calcUsablePointsData.usable"
|
|
||||||
:checked="thisdata.isPointsChecked" activeColor="#E8AD7B" shape="circle"
|
|
||||||
icon-size="36" size="36">
|
|
||||||
</up-checkbox>
|
|
||||||
</up-checkbox-group>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="totalPrice">
|
|
||||||
<text style="margin-bottom: 5rpx;">小计¥</text>
|
<text style="margin-bottom: 5rpx;">小计¥</text>
|
||||||
<text class="totalPriceNum"> {{totalCost}} </text>
|
<text class="totalPriceNum"> {{totalCost}} </text>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- <u-divider color="#fa3534" half-width="200" border-color="#6d6d6d">姑苏城外寒山寺</u-divider> -->
|
<!-- <u-divider color="#fa3534" half-width="200" border-color="#6d6d6d">姑苏城外寒山寺</u-divider> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -167,34 +98,35 @@
|
|||||||
<view class="remark">
|
<view class="remark">
|
||||||
<view class="remark_bg">
|
<view class="remark_bg">
|
||||||
<view class="remark_title">订单备注</view>
|
<view class="remark_title">订单备注</view>
|
||||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'"
|
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark"
|
||||||
v-model="thisdata.remark" :border="thisdata.textareaBorder" :clearable="true" />
|
:clearable="true" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 支付方式 -->
|
<!-- 支付方式 -->
|
||||||
<view style="padding: 0 20rpx;" v-if="shopInfo.registerType == 'before'">
|
<!-- <view style="padding: 0 20rpx;" v-if="shopInfo.registerType == 'before'">
|
||||||
<paymentMethod ref="paymentMethodref" @groupChange="groupChange">
|
<paymentMethod ref="paymentMethodref" @groupChange="groupChange">
|
||||||
</paymentMethod>
|
</paymentMethod>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- boutton -->
|
<!-- boutton -->
|
||||||
<view style="width: 100%;height: 200rpx;"> </view>
|
<view style="width: 100%;height: 200rpx;"> </view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="bottom_left">
|
<view class="bottom_left">
|
||||||
<text style="margin-bottom: 5rpx;">实付金额</text>
|
<text style="margin-bottom: 5rpx;">实付金额</text>
|
||||||
<text class="totalAmount">¥{{ totalCost }} </text>
|
<text class="totalAmount">¥{{ totalPrices }} </text>
|
||||||
</view>
|
</view>
|
||||||
<block v-if="shopInfo.registerType == 'before'">
|
<!-- <block v-if="shopInfo.registerType == 'before'">
|
||||||
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)" v-if="shopInfo">
|
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)" v-if="shopInfo">
|
||||||
{{ paymentmethod.paymentBtnText }}11
|
{{ paymentmethod.paymentBtnText }}
|
||||||
</view>
|
</view>
|
||||||
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)" v-else>
|
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)" v-else>
|
||||||
{{ paymentmethod.paymentBtnText }}22
|
{{ paymentmethod.paymentBtnText }}
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="shopInfo.registerType == 'after'">
|
<block v-if="shopInfo.registerType == 'after'"> -->
|
||||||
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)"> 提交订单33 </view>
|
<block>
|
||||||
|
<view class="paymentBtnText" @tap="$u.debounce(orderdetail, 500)"> 提交订单 </view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -233,8 +165,15 @@
|
|||||||
confirmordershow: {
|
confirmordershow: {
|
||||||
type: Boolean
|
type: Boolean
|
||||||
},
|
},
|
||||||
|
orderinfo: {
|
||||||
|
type: Object,
|
||||||
|
default: {
|
||||||
|
detailMap: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const remark = ref('')
|
||||||
|
|
||||||
// 定义自定义事件
|
// 定义自定义事件
|
||||||
const emits = defineEmits(['customevent', 'close']);
|
const emits = defineEmits(['customevent', 'close']);
|
||||||
@@ -255,71 +194,74 @@
|
|||||||
|
|
||||||
const tableCode = uni.cache.get('tableCode')
|
const tableCode = uni.cache.get('tableCode')
|
||||||
|
|
||||||
// 监听送餐/打包切换
|
|
||||||
const is_type = ref(0)
|
|
||||||
|
|
||||||
// teb 切换送餐和打包
|
|
||||||
const tebtypeList = reactive([{
|
|
||||||
title: "送餐到桌",
|
|
||||||
show: false,
|
|
||||||
type: "table",
|
|
||||||
val: "dine-in",
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1.png",
|
|
||||||
url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab1_active.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "打包外带",
|
|
||||||
show: false,
|
|
||||||
type: "takeself",
|
|
||||||
val: "take-out",
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2.png",
|
|
||||||
url_active: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/tab2_active.png"
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
const favorable = reactive([{
|
|
||||||
name: "优惠券",
|
|
||||||
type: "coupon",
|
|
||||||
value: "",
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "商品券",
|
|
||||||
type: "product",
|
|
||||||
value: [],
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"
|
|
||||||
},
|
|
||||||
// { name: "团购优惠", type: "group",value: "", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
|
||||||
{
|
|
||||||
name: "积分抵扣",
|
|
||||||
type: "points",
|
|
||||||
value: "",
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/points.png"
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
// 开始计算费用
|
// 开始计算费用
|
||||||
|
|
||||||
// 打包费
|
// 打包费
|
||||||
const packFee = computed(() => cartStore.getTotalPackFee(props.cartList).value);
|
// const packFee = computed(() => cartStore.getTotalPackFee(props.cartList).value);
|
||||||
|
|
||||||
// 计算购物车商品费用
|
// 计算购物车商品费用
|
||||||
const totalPrices = computed(() => cartStore.getTotalTotalPrices(props.cartList).value);
|
// const totalPrices = computed(() => cartStore.getTotalTotalPrices(props.cartList));
|
||||||
|
|
||||||
|
// 计算购物车商品费用
|
||||||
|
const totalPrices = computed(() => {
|
||||||
|
let combinedArray = [];
|
||||||
|
for (const key in props.orderinfo.detailMap) {
|
||||||
|
if (props.orderinfo.detailMap.hasOwnProperty(key)) {
|
||||||
|
combinedArray = props.orderinfo.detailMap[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 购物车总数价格
|
||||||
|
let cartone = combinedArray.reduce((total, item) => {
|
||||||
|
// 是否启用会员价 0否1是
|
||||||
|
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
|
||||||
|
// memberPrice会员价
|
||||||
|
return total + parseFloat(item.memberPrice) * parseFloat(item.num);
|
||||||
|
} else {
|
||||||
|
// salePrice销售价
|
||||||
|
return total + parseFloat(item.salePrice) * parseFloat(item.num);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
console.log(cartone)
|
||||||
|
// 购物车总数价格
|
||||||
|
let cart = props.cartList.reduce((total, item) => {
|
||||||
|
// 是否启用会员价 0否1是
|
||||||
|
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
|
||||||
|
// memberPrice会员价
|
||||||
|
return total + parseFloat(item.memberPrice) * parseFloat(item.cartNumber);
|
||||||
|
} else {
|
||||||
|
// salePrice销售价
|
||||||
|
return total + parseFloat(item.salePrice) * parseFloat(item.cartNumber);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
cart = cartone + cart
|
||||||
|
// 向上取整并保留两位小数
|
||||||
|
return cart = Math.ceil(cart * 100) / 100;
|
||||||
|
});
|
||||||
|
|
||||||
// 餐位费
|
// 餐位费
|
||||||
const Seatcharge = computed(() => cartStore.getTotalSeatcharge(props.cartList).value);
|
const getTotalSeatcharge = computed(() => {
|
||||||
|
// 是否免除桌位费 0 否 1 是
|
||||||
|
let tableFeeTotals = 0
|
||||||
|
|
||||||
|
if (isTableFee == 0 && dinersNum) {
|
||||||
|
tableFeeTotals = Math.ceil(parseFloat(dinersNum) * parseFloat(tableFee) *
|
||||||
|
100) / 100;
|
||||||
|
}
|
||||||
|
console.log(tableFeeTotals)
|
||||||
|
return Math.floor(tableFeeTotals * 100) / 100 ? Math.floor(tableFeeTotals * 100) / 100 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
//总价格
|
//总价格
|
||||||
const totalCost = ref(0);
|
const totalCost = ref(0);
|
||||||
|
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.cartList.length > 0) {
|
// if (props.cartList.length > 0) {
|
||||||
// 打包费 计算购物车商品费用 餐位费
|
// // 打包费 计算购物车商品费用 餐位费
|
||||||
const sum = (is_type.value != 0 ? packFee.value : 0) + totalPrices.value + (is_type.value == 0 ?
|
// const sum = (is_type.value != 0 ? packFee.value : 0) + totalPrices.value + (is_type.value == 0 ?
|
||||||
Seatcharge.value : 0);
|
// Seatcharge.value : 0);
|
||||||
totalCost.value = Math.round(sum * 100) / 100;
|
// totalCost.value = Math.round(sum * 100) / 100;
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 监听送餐/打包切换
|
// 监听送餐/打包切换
|
||||||
@@ -341,82 +283,76 @@
|
|||||||
paymentmethod.payType = e.payType;
|
paymentmethod.payType = e.payType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转
|
|
||||||
const goUrl = (item) => {
|
|
||||||
switch (item.type) {
|
|
||||||
case 'coupon':
|
|
||||||
let payAmount = Seatcharge.value;
|
|
||||||
// let couponList = this.userCouponInfos.filter(v => v.type == 1);
|
|
||||||
// if (couponList.length > 0) {
|
|
||||||
// payAmount = payAmount + couponList.discountAmount;
|
|
||||||
// }
|
|
||||||
uni.pro.navigateTo('/pages/user/coupon', {
|
|
||||||
type: "confirm_order_coupon",
|
|
||||||
shopId: uni.cache.get('shopId'),
|
|
||||||
payAmount: payAmount
|
|
||||||
// shoppingCart: JSON.stringify(this.listinfo.details)
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 'product':
|
|
||||||
let productList = this.userCouponInfos.filter(v => v.type == 2);
|
|
||||||
uni.pro.navigateTo('/pages/user/coupon', {
|
|
||||||
type: "confirm_order_product",
|
|
||||||
shopId: this.shopId,
|
|
||||||
payAmount: this.listinfo.payAmount,
|
|
||||||
shoppingCart: JSON.stringify(this.listinfo.details),
|
|
||||||
productList: JSON.stringify(productList)
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交订单
|
// 提交订单
|
||||||
const orderdetail = async () => {
|
const orderdetail = async () => {
|
||||||
let res = await storeMemberpay.actionscreateOrder({
|
let res = await storeMemberpay.actionscreateOrder({
|
||||||
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
|
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
|
||||||
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
||||||
packFee: packFee.value, //打包费
|
// packFee: packFee.value, //打包费
|
||||||
|
packFee: 0, //打包费
|
||||||
originAmount: totalPrices.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费
|
originAmount: totalPrices.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费
|
||||||
remark: '', //备注
|
remark: remark.value, //备注
|
||||||
placeNum: '', //当前订单下单次数
|
placeNum: props.orderinfo.placeNum + 1, //当前订单下单次数
|
||||||
waitCall: '' //是否等叫 0 否 1 等叫
|
waitCall: '', //是否等叫 0 否 1 等叫
|
||||||
|
orderId: props.orderinfo.id
|
||||||
|
|
||||||
})
|
})
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.showLoading({
|
// 清空购物车
|
||||||
title: '正在生成订单',
|
emits('customevent', {
|
||||||
mask: true
|
type: 'shopping',
|
||||||
|
table_code: uni.cache.get('tableCode'),
|
||||||
|
shop_id: uni.cache.get('shopId'),
|
||||||
|
operate_type: 'cleanup',
|
||||||
})
|
})
|
||||||
if (res) {
|
uni.pro.redirectTo('order/detail', {
|
||||||
let checkOrderPay = {
|
orderId: res.id,
|
||||||
orderId: res.id,
|
shopId: uni.cache.get('shopId')
|
||||||
vipPrice: shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? 1 : 0, //是否使用会员价0否1是
|
})
|
||||||
allPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
// uni.redirectTo({
|
||||||
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
// url: '/pages/index/index?orderId=' + res.id + '&shopId=' + uni.cache.get('shopId')
|
||||||
orderAmount: totalCost.value, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
// })
|
||||||
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
// uni.pro.navigateTo('order/detail', {
|
||||||
discountAmount: 0, //手动优惠金额 写死0
|
// orderId: res.id,
|
||||||
productCouponDiscountAmount: '', //商品优惠券抵扣金额
|
// shopId: uni.cache.get('shopId')
|
||||||
fullCouponDiscountAmount: '', //满减优惠券抵扣金额
|
// })
|
||||||
couponList: '', //用户使用的卡券
|
// uni.showLoading({
|
||||||
orderAmount: totalCost.value, // 最中订单金额
|
// title: '正在生成订单',
|
||||||
roundAmount: 0, //抹零金额 减免多少钱
|
// mask: true
|
||||||
pointsDiscountAmount: 0, //积分抵扣金额(tb_points_basic_setting表)
|
// })
|
||||||
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
// if (res) {
|
||||||
remark: '', //用户备注
|
// let checkOrderPay = {
|
||||||
}
|
// orderId: res.id,
|
||||||
let successdata = await storeMemberpay.actionsltPayOrder({
|
// vipPrice: shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? 1 : 0, //是否使用会员价0否1是
|
||||||
checkOrderPay,
|
// allPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
||||||
payType: paymentmethod.payType,
|
// seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
||||||
buyerRemark: '',
|
// orderAmount: totalCost.value, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||||
returnUrl: ''
|
// discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
||||||
})
|
// discountAmount: 0, //手动优惠金额 写死0
|
||||||
if (successdata) {
|
// productCouponDiscountAmount: '', //商品优惠券抵扣金额
|
||||||
console.log(res.id, '支付成功res.id')
|
// fullCouponDiscountAmount: '', //满减优惠券抵扣金额
|
||||||
uni.redirectTo({
|
// couponList: '', //用户使用的卡券
|
||||||
url: '/order/detail?orderId=' + res.id
|
// orderAmount: totalCost.value, // 最中订单金额
|
||||||
});
|
// roundAmount: 0, //抹零金额 减免多少钱
|
||||||
}
|
// pointsDiscountAmount: 0, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
}
|
// pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
||||||
|
// remark: '', //用户备注
|
||||||
|
// }
|
||||||
|
// let successdata = await storeMemberpay.actionsltPayOrder({
|
||||||
|
// checkOrderPay,
|
||||||
|
// payType: paymentmethod.payType,
|
||||||
|
// buyerRemark: '',
|
||||||
|
// returnUrl: ''
|
||||||
|
// })
|
||||||
|
// if (successdata) {
|
||||||
|
// console.log(res.id, '支付成功res.id')
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/order/detail?orderId=' + res.id
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -485,6 +421,357 @@
|
|||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
|
.card {
|
||||||
|
// background-color: #fff;
|
||||||
|
border-radius: 20upx;
|
||||||
|
margin-bottom: 28upx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.card_item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
padding: 0 34rpx;
|
||||||
|
|
||||||
|
.head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
|
||||||
|
.head_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.placeNum {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-right: 32rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeTime {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #666666;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-info {
|
||||||
|
border-bottom: 2rpx dashed #e5e5e5;
|
||||||
|
|
||||||
|
.item:nth-child(1) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.cover {}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-left: 16upx;
|
||||||
|
|
||||||
|
.productName {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productSkuName {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.n {
|
||||||
|
font-size: 24upx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding-left: 68rpx;
|
||||||
|
|
||||||
|
.priceAmount {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
align-self: flex-end;
|
||||||
|
width: 92rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: #999999;
|
||||||
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
margin-top: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalAmount {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding: 32rpx 0;
|
||||||
|
border-bottom: 2rpx dashed #e5e5e5;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.semicircle_icon {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: -22.5rpx;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.semicircle_left_icon {
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
margin-left: -22.5rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 50%;
|
||||||
|
// box-shadow: inset -20rpx 0rpx 22rpx -20rpx rgba(87, 86, 86, 0.35);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.semicircle_right_icon {
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
margin-right: -22.5rpx;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: 50%;
|
||||||
|
// box-shadow: inset 13rpx 0rpx 16rpx -9rpx rgba(87, 86, 86, 0.35);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 32rpx 34rpx 0 34rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
padding-bottom: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.val {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding-bottom: 32rpx;
|
||||||
|
border-bottom: 2rpx dashed #e5e5e5;
|
||||||
|
|
||||||
|
view:nth-child(1) {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 42rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
view:nth-child(2) {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.val.column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.productCoupon {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
margin: 0 0 10rpx 0;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
margin: 0 30rpx;
|
||||||
|
line-height: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.favorable {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 26rpx;
|
||||||
|
padding-top: 26rpx;
|
||||||
|
border-bottom: 2rpx solid #E5E5E5;
|
||||||
|
|
||||||
|
.favorable_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 400rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.favorable_right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.favorable_right_text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
font-weight: 400rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.favorable_right {
|
||||||
|
.column {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
.favorable_right_text {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
|
text:nth-child(1) {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #999;
|
||||||
|
margin: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
text:nth-child(3) {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.favorable_right.column {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.favorable.column {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-item.column {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-wrap {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
padding: 0 34rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 64rpx;
|
||||||
|
|
||||||
|
.price {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.order_footer {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 34rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: $uni-spacing-row-base;
|
padding: $uni-spacing-row-base;
|
||||||
|
|||||||
@@ -232,8 +232,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<confirmorder :cartLists_count="cartLists_count" :cartList="matchedProducts" :totalPrices='totalPrices'
|
<confirmorder ref="confirmorderref" :cartLists_count="cartLists_count" :cartList="matchedProducts"
|
||||||
:confirmordershow="confirmordershow" @close="confirmordershow = !confirmordershow"></confirmorder>
|
:totalPrices='totalPrices' :confirmordershow="confirmordershow"
|
||||||
|
@close="confirmordershow = !confirmordershow" @customevent='websocketsendMessage' :orderinfo="orderinfo">
|
||||||
|
</confirmorder>
|
||||||
<!-- 店铺详情 -->
|
<!-- 店铺详情 -->
|
||||||
<shopindex ref="showShopInfoRef"></shopindex>
|
<shopindex ref="showShopInfoRef"></shopindex>
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
@@ -381,6 +383,10 @@
|
|||||||
APIminiAppskuinfo
|
APIminiAppskuinfo
|
||||||
} from "@/common/api/product/product.js";
|
} from "@/common/api/product/product.js";
|
||||||
|
|
||||||
|
import {
|
||||||
|
APIhistoryOrder
|
||||||
|
} from "@/common/api/order/index.js";
|
||||||
|
|
||||||
// websocket
|
// websocket
|
||||||
import useWebSocket from '@/common/js/websocket.js';
|
import useWebSocket from '@/common/js/websocket.js';
|
||||||
|
|
||||||
@@ -871,13 +877,11 @@
|
|||||||
if (Message.type == "ping_interval" || Message.msg_id == "ping_interval") {
|
if (Message.type == "ping_interval" || Message.msg_id == "ping_interval") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
if (Message.operate_type == "shopping_init") {
|
if (Message.operate_type == "shopping_init") {
|
||||||
cartList.value = Message.data
|
cartList.value = Message.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 购物车数据更新从新请求
|
// 购物车数据更新从新请求
|
||||||
if (Message.type == 'product') {
|
if (Message.type == 'product') {
|
||||||
isDataLoaded.value = false;
|
isDataLoaded.value = false;
|
||||||
@@ -908,6 +912,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空购物车
|
||||||
|
if (Message.operate_type == 'shopping_cleanup') {
|
||||||
|
cartList.value = []
|
||||||
|
showCart.value = false
|
||||||
|
}
|
||||||
|
|
||||||
//除去p 每次返回都回执消息
|
//除去p 每次返回都回执消息
|
||||||
await websocketsendMessage({
|
await websocketsendMessage({
|
||||||
type: 'receipt',
|
type: 'receipt',
|
||||||
@@ -972,23 +982,54 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 计算购物车商品费用
|
// 计算购物车商品费用
|
||||||
const totalPrices = ref(0);
|
// const totalPrices = ref(0);
|
||||||
|
|
||||||
watchEffect(() => {
|
// watchEffect(() => {
|
||||||
if (matchedProducts.value.length > 0) {
|
// if (matchedProducts.value.length > 0) {
|
||||||
totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
// totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
// matchedProducts 变化时,更新总打包费用
|
// matchedProducts 变化时,更新总打包费用
|
||||||
watch(() => matchedProducts.value, () => {
|
// watch(() => matchedProducts.value, () => {
|
||||||
if (matchedProducts.value.length > 0) {
|
// if (matchedProducts.value.length > 0) {
|
||||||
totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
// totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
||||||
}
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// 计算购物车商品总价格
|
||||||
|
const totalPrices = computed(() => {
|
||||||
|
// 购物车总数价格
|
||||||
|
let cart = matchedProducts.value.reduce((total, item) => {
|
||||||
|
// 是否启用会员价 0否1是
|
||||||
|
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
|
||||||
|
// memberPrice会员价
|
||||||
|
return total + parseFloat(item.memberPrice) * parseFloat(item.cartNumber);
|
||||||
|
} else {
|
||||||
|
// salePrice销售价
|
||||||
|
return total + parseFloat(item.salePrice) * parseFloat(item.cartNumber);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
// 向上取整并保留两位小数
|
||||||
|
return cart = Math.ceil(cart * 100) / 100;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 储存是否存在多次下单
|
||||||
|
const orderinfo = ref({})
|
||||||
|
const confirmorderref = ref(null)
|
||||||
// 结账
|
// 结账
|
||||||
const orderdetail = async () => {
|
const orderdetail = async () => {
|
||||||
|
try {
|
||||||
|
let res = await APIhistoryOrder({
|
||||||
|
tableCode: uni.cache.get('tableCode'),
|
||||||
|
})
|
||||||
|
orderinfo.value = {
|
||||||
|
id: res.id,
|
||||||
|
detailMap: res.detailMap,
|
||||||
|
placeNum: res.placeNum
|
||||||
|
}
|
||||||
|
} catch (error) {}
|
||||||
confirmordershow.value = true
|
confirmordershow.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1074,13 +1115,20 @@
|
|||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
const options = currentPage.options;
|
const options = currentPage.options;
|
||||||
await productqueryProduct()
|
|
||||||
|
|
||||||
orderId.value = options.orderId
|
// #ifdef MP-WEIXIN
|
||||||
let res = await APIshopUserInfo({
|
if (options.q) {
|
||||||
shopId: uni.cache.get('shopId')
|
const store = productStore();
|
||||||
})
|
await store.scanCodeactions(options.q)
|
||||||
cartStore.shopInfo = uni.cache.get('shopInfo')
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
if (getApp().globalData.tableCode) {
|
||||||
|
await store.scanCodeactions(getApp().globalData.tableCode)
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
await productqueryProduct()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getElementTop()
|
getElementTop()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
<view class="containertopbox">
|
<view class="containertopbox">
|
||||||
<view class="containertopboxitem flex-start" v-for="(item,index) in fromInfo.list" :key="index">
|
<view class="containertopboxitem flex-start" v-for="(item,index) in fromInfo.list" :key="index">
|
||||||
<view class="containertopboxitemleft flex-colum"
|
<view class="containertopboxitemleft flex-colum"
|
||||||
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': fromInfo.status != 1,}">
|
:class="{'containertopboxitemleft_vip': item.type == 2,'containertopboxitemlefts': fromInfo.status == 0}">
|
||||||
<view class="containertopboxitemleft_one"
|
<view class="containertopboxitemleft_one"
|
||||||
:class="fromInfo.status == 1?'':'containertopboxitemleft_ones'">
|
:class="fromInfo.status != 0?'':'containertopboxitemleft_ones'">
|
||||||
<block v-if="item.type == 2">
|
<block v-if="item.type == 2">
|
||||||
<text>{{item.num || 0}}</text>
|
<text>{{item.num || 0}}</text>
|
||||||
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
<text style="font-size: 28rpx;margin-left: 6rpx;">张</text>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemleft_tow" :class="{
|
<view class="containertopboxitemleft_tow" :class="{
|
||||||
'containertopboxitemleft_tows': fromInfo.status != 1,
|
'containertopboxitemleft_tows': fromInfo.status == 0,
|
||||||
'containertopboxitemleft_nameVip': item.type == 2,
|
'containertopboxitemleft_nameVip': item.type == 2,
|
||||||
}">
|
}">
|
||||||
{{ item.type == 2 ? item.name : '优惠券(元)'}}
|
{{ item.type == 2 ? item.name : '优惠券(元)'}}
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
<view class="containertopboxitemright_tow">
|
<view class="containertopboxitemright_tow">
|
||||||
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
|
<view> {{ item.type == 2 ? '会员商品券' : item.name}}</view>
|
||||||
<view @click="navigatorGo(item)"
|
<view @click="navigatorGo(item)"
|
||||||
:class="fromInfo.status == 1?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
:class="fromInfo.status == 0?'containertopboxitemright_four containertopboxitemright_btn':'containertopboxitemright_fours containertopboxitemright_btn'">
|
||||||
{{fromInfo.status == 1 ? '去使用':'已使用'}}
|
{{fromInfo.status == 0 ? '去使用':'已使用'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitemright_there" v-if="item.type == 1 ">
|
<view class="containertopboxitemright_there" v-if="item.type == 1 ">
|
||||||
@@ -66,12 +66,9 @@
|
|||||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<up-loadmore :status="form.status" iconSize='12' fontSize='12' height='20' />
|
<up-loadmore :status="form.status" fontSize="14" color="#999" iconSize="14" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="btnBox" >
|
|
||||||
<view class="btn" @click="cancelCoupon">暂不使用券</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -79,10 +76,18 @@
|
|||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive,
|
reactive,
|
||||||
onMounted
|
onMounted,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
APIcouponfindByUserId
|
onLoad,
|
||||||
|
onReady,
|
||||||
|
onShow,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
import {
|
||||||
|
APIcouponfindByUserId,
|
||||||
|
APIfindCoupon
|
||||||
} from '@/common/api/member.js'
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
const tabList = [{
|
const tabList = [{
|
||||||
@@ -101,8 +106,7 @@
|
|||||||
const fromInfo = reactive({
|
const fromInfo = reactive({
|
||||||
tabIndex: 0,
|
tabIndex: 0,
|
||||||
list: [],
|
list: [],
|
||||||
status: 1,
|
status: 0,
|
||||||
payAmount: 0,
|
|
||||||
shopId: null,
|
shopId: null,
|
||||||
orderId: null,
|
orderId: null,
|
||||||
couopnInfo: null,
|
couopnInfo: null,
|
||||||
@@ -115,6 +119,25 @@
|
|||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 判断是选择优惠卷
|
||||||
|
const Orderinfo = reactive({
|
||||||
|
typeOrder: '',
|
||||||
|
shopUserId: "",
|
||||||
|
payAmount: "",
|
||||||
|
shoppingCart: [],
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
const init_fn = () => {
|
||||||
|
fromInfo.list = []
|
||||||
|
form.page = 1
|
||||||
|
form.size = 10
|
||||||
|
form.status = 'loadmore'
|
||||||
|
// navtabindex.value == '1' ? getorderList() : userorderList()
|
||||||
|
getCouponList()
|
||||||
|
}
|
||||||
|
|
||||||
const towcontentclick = (item) => {
|
const towcontentclick = (item) => {
|
||||||
fromInfo.tabIndex = item.status;
|
fromInfo.tabIndex = item.status;
|
||||||
fromInfo.status = item.status;
|
fromInfo.status = item.status;
|
||||||
@@ -123,9 +146,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 去使用优惠券
|
// 去使用优惠券
|
||||||
const navigatorGo = (item) => {
|
const navigatorGo = (item) => {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const getCouponList = async () => {
|
const getCouponList = async () => {
|
||||||
let res = await APIcouponfindByUserId({
|
let res = await APIcouponfindByUserId({
|
||||||
@@ -140,7 +161,7 @@
|
|||||||
fromInfo.list = []
|
fromInfo.list = []
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (res.totalPage == 1 && res.totalRow <= 10) {
|
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
|
||||||
form.status = 'nomore'
|
form.status = 'nomore'
|
||||||
fromInfo.list = res.records
|
fromInfo.list = res.records
|
||||||
if (form.page == 1 && res.records.length == 0) {
|
if (form.page == 1 && res.records.length == 0) {
|
||||||
@@ -149,7 +170,11 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
form.status = 'loading';
|
form.status = 'loading';
|
||||||
fromInfo.list = [...fromInfo.list, ...res.records];
|
if (form.page == 1) {
|
||||||
|
fromInfo.list = res.records
|
||||||
|
} else {
|
||||||
|
fromInfo.list = [...fromInfo.list, ...res.records];
|
||||||
|
}
|
||||||
form.page = ++form.page;
|
form.page = ++form.page;
|
||||||
if (form.page > res.totalPage) {
|
if (form.page > res.totalPage) {
|
||||||
form.status = 'nomore';
|
form.status = 'nomore';
|
||||||
@@ -157,12 +182,16 @@
|
|||||||
form.status = 'loading';
|
form.status = 'loading';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(fromInfo.list)
|
|
||||||
}
|
}
|
||||||
const cancelCoupon = () => {
|
const cancelCoupon = () => {
|
||||||
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onReachBottom(() => {
|
||||||
|
if (form.status != 'nomore') {
|
||||||
|
getCouponList()
|
||||||
|
}
|
||||||
|
})
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 获取当前页面栈
|
// 获取当前页面栈
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
@@ -174,9 +203,6 @@
|
|||||||
if (options.shopId) {
|
if (options.shopId) {
|
||||||
fromInfo.shopId = options.shopId
|
fromInfo.shopId = options.shopId
|
||||||
}
|
}
|
||||||
if (options.payAmount) {
|
|
||||||
fromInfo.payAmount = options.payAmount
|
|
||||||
}
|
|
||||||
// if (options.orderId) {
|
// if (options.orderId) {
|
||||||
// fromInfo.orderId = options.orderId
|
// fromInfo.orderId = options.orderId
|
||||||
// }
|
// }
|
||||||
@@ -189,7 +215,7 @@
|
|||||||
// if (options.productList) {
|
// if (options.productList) {
|
||||||
// this.productList = JSON.parse(decodeURIComponent(options.productList))
|
// this.productList = JSON.parse(decodeURIComponent(options.productList))
|
||||||
// }
|
// }
|
||||||
getCouponList()
|
init_fn()
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,92 +4,120 @@
|
|||||||
<view class="bild">
|
<view class="bild">
|
||||||
<view class="bildLeft">
|
<view class="bildLeft">
|
||||||
<text>我的余额</text>
|
<text>我的余额</text>
|
||||||
<view>{{info.amount||0}}</view>
|
<view>{{formData.info.amount||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bildRight">
|
<view class="bildRight">
|
||||||
<text>我的积分</text>
|
<text>我的积分</text>
|
||||||
<view>{{info.accountPoints||0}}</view>
|
<view>{{formData.info.accountPoints||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="navTop">
|
<view class="navTop">
|
||||||
<view @click="clickEvent(1)" :class="[active==1?'fonts':'']">
|
<view @click="clickEvent(1)" :class="[formData.active==1?'fonts':'']">
|
||||||
余额明细
|
余额明细
|
||||||
<view :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
|
<view :class="[formData.active==1?'xian':'']" style="left: 36rpx;"> </view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
|
<view @click="clickEvent(2)" :class="[formData.active==2?'fonts':'']">
|
||||||
积分明细
|
积分明细
|
||||||
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
|
<view :class="[formData.active==2?'xian':'']" style="left: 36rpx;"> </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="listStyle " v-for="(item,i) in list" :key="i">
|
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
|
||||||
<!-- <image class="head_img" :src="item.head_img?item.head_img:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
<!-- <image class="head_img" :src="item.head_img?item.head_img:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
||||||
<view class="flex-start">
|
<view class="flex-start">
|
||||||
<view class="listStyle_left">
|
<view class="listStyle_left">
|
||||||
<view class="listrigth">
|
<view class="listrigth">
|
||||||
<view>{{active == 1 ? item.biz_name : item.content}}</view>
|
<view>{{formData.active == 1 ? item.biz_name : item.content}}</view>
|
||||||
<view
|
<view
|
||||||
:class="{colorStyle: (active==1&&item.type == '+') || (active==2&&item.floatType=='add')}">
|
:class="{colorStyle: (formData.active==1&&item.type == '+') || (formData.active==2&&item.floatType=='add')}">
|
||||||
{{ active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
|
{{ formData.active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
|
||||||
{{active == 1 ? item.amount : item.floatPoints}}
|
{{formData.active == 1 ? item.amount : item.floatPoints}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="listrigth2">
|
<view class="listrigth2">
|
||||||
<view>{{$u.timeFormat(active == 1 ? item.create_time : item.createTime, 'yyyy-mm-dd hh:MM:ss')}}
|
<view>{{item.createTime}}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="active == 1">余额:{{item.balance}}</view>
|
<view v-if="formData.active == 1">余额:{{item.balance}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="formData.list.length <= 0" style="text-align: center;">
|
||||||
|
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
|
||||||
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<up-loadmore :status="formData.form.status" fontSize="14" color="#999" iconSize="14" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
reactive
|
reactive,
|
||||||
|
onMounted
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
onReachBottom
|
onReachBottom
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
import {
|
||||||
|
APIshopUsermoneyRecord,
|
||||||
|
APIshopUserpointsRecord
|
||||||
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
active: 1,
|
active: 1,
|
||||||
list: [],
|
list: [],
|
||||||
form: {
|
form: {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
size: 10,
|
||||||
|
status: 'loadmore',
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
amount: '',
|
||||||
|
accountPoints: ''
|
||||||
},
|
},
|
||||||
info: null,
|
|
||||||
shopId: null
|
shopId: null
|
||||||
})
|
})
|
||||||
|
|
||||||
const getlist = () => {
|
const getlist = async () => {
|
||||||
return false;
|
let res = null
|
||||||
|
if (formData.active == 1) {
|
||||||
|
res = await APIshopUsermoneyRecord({
|
||||||
|
page: formData.form.page,
|
||||||
// if (this.active == 1) {
|
size: formData.form.size,
|
||||||
// let res = await this.api.queryMemberAccount({
|
status: formData.status,
|
||||||
// ...this.form
|
shopId: formData.shopId
|
||||||
// })
|
})
|
||||||
// if (res.code == 0 && res.data.list.length > 0) {
|
} else {
|
||||||
// this.list = this.list.concat(res.data.list)
|
res = await APIshopUserpointsRecord({
|
||||||
// this.form.page++
|
page: formData.form.page,
|
||||||
// }
|
size: formData.form.size,
|
||||||
// } else {
|
status: formData.status
|
||||||
// let res = await this.api.queryMemberPointsLog({
|
})
|
||||||
// shopId: formData.info.shopId,
|
}
|
||||||
// ...this.form
|
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
|
||||||
// })
|
formData.form.status = 'nomore'
|
||||||
// if (res.code == 0 && res.data.list.length > 0) {
|
formData.list = res.records
|
||||||
// this.list = this.list.concat(res.data.list)
|
if (formData.form.page == 1 && res.records.length == 0) {
|
||||||
// this.form.page++
|
formData.records = []
|
||||||
// }
|
formData.is_end = true
|
||||||
// }
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
formData.form.status = 'loading';
|
||||||
|
if (formData.form.page == 1) {
|
||||||
|
formData.list = res.records
|
||||||
|
} else {
|
||||||
|
formData.list = [...formData.list, ...res.records];
|
||||||
|
}
|
||||||
|
formData.form.page = ++formData.form.page;
|
||||||
|
if (formData.form.page > res.totalPage) {
|
||||||
|
formData.form.status = 'nomore';
|
||||||
|
} else {
|
||||||
|
formData.form.status = 'loading';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测是否包含In
|
// 检测是否包含In
|
||||||
@@ -101,7 +129,10 @@
|
|||||||
const clickEvent = (i) => {
|
const clickEvent = (i) => {
|
||||||
formData.active = i;
|
formData.active = i;
|
||||||
formData.form.page = 1;
|
formData.form.page = 1;
|
||||||
formData.list = []
|
formData.is_end = false
|
||||||
|
formData.form.page = 1
|
||||||
|
formData.form.size = 10
|
||||||
|
formData.form.status = 'loadmore'
|
||||||
getlist()
|
getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +147,9 @@
|
|||||||
const currentPage = pages[pages.length - 1];
|
const currentPage = pages[pages.length - 1];
|
||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
const options = currentPage.options;
|
const options = currentPage.options;
|
||||||
formData.info = JSON.parse(options.shopUserInfo)
|
formData.info = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||||
|
formData.shopId = options.shopId
|
||||||
|
formData.active = options.type
|
||||||
console.log(formData.info)
|
console.log(formData.info)
|
||||||
getlist()
|
getlist()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -46,14 +46,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="reg-cell">
|
<view class="reg-cell">
|
||||||
<view class="lable">手机号</view>
|
<view class="lable">手机号</view>
|
||||||
<u-input class="value" v-model="formInfo.telephone" fontSize="14px" type="text" input-align="left"
|
<up-input class="value" v-model="formInfo.telephone" fontSize="14px" type="text" input-align="left"
|
||||||
readonly placeholder="获取手机号" :custom-style="{border:'none'}"
|
readonly placeholder="获取手机号" :custom-style="{border:'none'}"
|
||||||
placeholder-style="color:#999;font-size: 28rpx" />
|
placeholder-style="color:#999;font-size: 28rpx" />
|
||||||
<!-- #ifdef MP-WEIXIN || H5 -->
|
<!-- #ifdef MP-WEIXIN || H5 -->
|
||||||
<button class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
<button class="getPhone" size="10" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-ALIPAY -->
|
<!-- #ifdef MP-ALIPAY -->
|
||||||
<button class="getPhone" open-type="getAuthorize" scope='phoneNumber' @getAuthorize="getPhone">
|
<button class="getPhone" size="10" open-type="getAuthorize" scope='phoneNumber'
|
||||||
|
@getAuthorize="getPhone">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="text">{{'获取手机号'}}</view>
|
<view class="text">{{'获取手机号'}}</view>
|
||||||
</button>
|
</button>
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
<view class="agreement_item" @click="isProtocol = !isProtocol">
|
<view class="agreement_item" @click="isProtocol = !isProtocol">
|
||||||
<up-checkbox-group>
|
<up-checkbox-group>
|
||||||
<up-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F"
|
<up-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F"
|
||||||
@change="radioChange" size="35" iconSize="20"></up-checkbox>
|
@change="radioChange" size="15" iconSize="10"></up-checkbox>
|
||||||
</up-checkbox-group>
|
</up-checkbox-group>
|
||||||
<text @click.stop="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
<text @click.stop="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -87,6 +88,11 @@
|
|||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
APIshopUser
|
||||||
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
shopUserInfo: {
|
shopUserInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -241,13 +247,14 @@
|
|||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: async (data) => {
|
success: async (data) => {
|
||||||
let res = await this.api.userwxlogins({
|
console.log(data)
|
||||||
code: data.code,
|
// let res = await APIshopUser({
|
||||||
encryptedData: d.detail.encryptedData,
|
// code: data.code,
|
||||||
iv: d.detail.iv,
|
// encryptedData: d.detail.encryptedData,
|
||||||
source: "wechar"
|
// iv: d.detail.iv,
|
||||||
})
|
// source: "wechar"
|
||||||
this.telephone = res.data
|
// })
|
||||||
|
formInfo.telephone = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -418,8 +425,8 @@
|
|||||||
background-color: none;
|
background-color: none;
|
||||||
border: 2rpx solid #E3AD7F;
|
border: 2rpx solid #E3AD7F;
|
||||||
color: #E3AD7F;
|
color: #E3AD7F;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
padding: 5rpx 10rpx;
|
padding: 5rpx 30rpx;
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
display: initial;
|
display: initial;
|
||||||
|
|||||||
@@ -59,12 +59,12 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="gift" v-if="infoForn.giftList && infoForn.giftList.length > 0">
|
<view class="gift" v-if="infoForn.couponList && infoForn.couponList.length > 0">
|
||||||
<view class="gift_title">您将获得:</view>
|
<view class="gift_title">您将获得:</view>
|
||||||
<view class="gift_list">
|
<view class="gift_list">
|
||||||
<view class="gift_list_item" v-for="(item,index) in infoForn.giftList" :key="index">
|
<view class="gift_list_item" v-for="(item,index) in infoForn.couponList" :key="index">
|
||||||
<text class="icon"></text>
|
<text class="icon"></text>
|
||||||
<text class="text"> {{ item }} </text>
|
<text class="text"> {{ item.title }} </text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
|
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
|
||||||
</view>
|
</view>
|
||||||
<registermember :show="infoForn.shopUserInfo.isVip == 1? false : true" :shopUserInfo="infoForn.shopUserInfo">
|
<registermember :memberOpen="infoForn.show" :shopUserInfo="infoForn.shopUserInfo">
|
||||||
</registermember>
|
</registermember>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -122,12 +122,12 @@
|
|||||||
|
|
||||||
const cardManageList = [{
|
const cardManageList = [{
|
||||||
name: "明细",
|
name: "明细",
|
||||||
url: "member/billDetails",
|
url: "user/member/billDetails",
|
||||||
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/detail.png"
|
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/detail.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "管理",
|
name: "管理",
|
||||||
url: "member/storedManage",
|
url: "user/member/storedManage",
|
||||||
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/manage.png"
|
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/manage.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -141,10 +141,10 @@
|
|||||||
giftAmount: 0,
|
giftAmount: 0,
|
||||||
shopUserInfo: {},
|
shopUserInfo: {},
|
||||||
shopId: '',
|
shopId: '',
|
||||||
giftList: [],
|
couponList: [],
|
||||||
type: "",
|
type: "",
|
||||||
userInfo: ''
|
userInfo: '',
|
||||||
|
show: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
infoForn.listdata = res;
|
infoForn.listdata = res;
|
||||||
infoForn.giftList = infoForn.listdata[0].gives;
|
infoForn.couponList = infoForn.listdata[0].couponList;
|
||||||
infoForn.giftAmount = infoForn.listdata[0].giftAmount
|
infoForn.giftAmount = infoForn.listdata[0].giftAmount
|
||||||
if (infoForn.type == 'topUpActivity') {
|
if (infoForn.type == 'topUpActivity') {
|
||||||
infoForn.amountChange()
|
infoForn.amountChange()
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
infoForn.inputshow = '';
|
infoForn.inputshow = '';
|
||||||
infoForn.giftList = [];
|
infoForn.couponList = [];
|
||||||
infoForn.giftAmount = '';
|
infoForn.giftAmount = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,9 +245,16 @@
|
|||||||
|
|
||||||
// * 进入明细\管理
|
// * 进入明细\管理
|
||||||
const handleClick = (item) => {
|
const handleClick = (item) => {
|
||||||
uni.navigateTo({
|
console.log(item)
|
||||||
url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(infoForn.shopUserInfo)}`
|
uni.pro.navigateTo(item.url, {
|
||||||
|
shopId: infoForn.shopId,
|
||||||
|
type: item.name == '明细' ? 1 : 2,
|
||||||
|
shopInfo: JSON.stringify(infoForn.userInfo.shopInfo)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(infoForn.shopUserInfo)}`
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
// * 是否同意协议
|
// * 是否同意协议
|
||||||
const radioChange = (n) => {
|
const radioChange = (n) => {
|
||||||
@@ -281,8 +288,9 @@
|
|||||||
|
|
||||||
// 充值金额切换
|
// 充值金额切换
|
||||||
const clickinput = (a, b) => {
|
const clickinput = (a, b) => {
|
||||||
|
console.log(a, b)
|
||||||
infoForn.inputshow = b;
|
infoForn.inputshow = b;
|
||||||
infoForn.giftList = a.gives;
|
infoForn.couponList = a.couponList;
|
||||||
infoForn.amount = a.amount;
|
infoForn.amount = a.amount;
|
||||||
infoForn.giftAmount = a.giftAmount;
|
infoForn.giftAmount = a.giftAmount;
|
||||||
}
|
}
|
||||||
@@ -354,8 +362,7 @@
|
|||||||
infoForn.userInfo = await APIshopUserInfo({
|
infoForn.userInfo = await APIshopUserInfo({
|
||||||
shopId: options.shopId
|
shopId: options.shopId
|
||||||
})
|
})
|
||||||
|
infoForn.show == infoForn.userInfo.isVip == 1 ? true : false
|
||||||
// shopUserInfo.shopExtend = res.shopExtend.member_bg
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (options.type) {
|
if (options.type) {
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
||||||
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
||||||
<view class="list-cell-item-content">
|
<view class="list-cell-item-content">
|
||||||
<view class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</view>
|
<view class="list-cell-item-content-text" v-for="(item2,index2) in item1.list"
|
||||||
|
:key="index2">{{item2}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -16,110 +17,107 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
data() {
|
ref
|
||||||
return {
|
} from 'vue'
|
||||||
userInfo: null,
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
title: "充值规则",
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
title: "满赠规则",
|
|
||||||
list: [
|
|
||||||
"充300元送15元+0积分+0元券",
|
|
||||||
"充500元送40元+0积分+0元券",
|
|
||||||
"充1000元送100元+0积分+0元券",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "适用门店",
|
|
||||||
list: [
|
|
||||||
"适用于1家门店",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "使用规则",
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
title: "使用须知",
|
|
||||||
list: [
|
|
||||||
"按比例",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "免密支付",
|
|
||||||
list: [
|
|
||||||
"免密支付已开通",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "适用商品",
|
|
||||||
list: [
|
|
||||||
"全部商品可用",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
this.userInfo = e
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
const list = [{
|
||||||
/**
|
title: "充值规则",
|
||||||
* 跳转
|
list: [{
|
||||||
*/
|
title: "满赠规则",
|
||||||
handleClick ( item ) {
|
list: [
|
||||||
uni.pro.navigateTo(item.url, this.userInfo)
|
"充300元送15元+0积分+0元券",
|
||||||
}
|
"充500元送40元+0积分+0元券",
|
||||||
}
|
"充1000元送100元+0积分+0元券",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "适用门店",
|
||||||
|
list: [
|
||||||
|
"适用于1家门店",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "使用规则",
|
||||||
|
list: [{
|
||||||
|
title: "使用须知",
|
||||||
|
list: [
|
||||||
|
"按比例",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "免密支付",
|
||||||
|
list: [
|
||||||
|
"免密支付已开通",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "适用商品",
|
||||||
|
list: [
|
||||||
|
"全部商品可用",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const userInfo = ref()
|
||||||
|
|
||||||
|
const handleClick = (item) => {
|
||||||
|
// uni.pro.navigateTo(item.url, userInfo.value)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
page{
|
page {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.container{
|
|
||||||
|
.container {
|
||||||
padding: 48rpx 20rpx;
|
padding: 48rpx 20rpx;
|
||||||
.list{
|
|
||||||
|
.list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.list_item{
|
|
||||||
|
.list_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
.list_item_title{
|
|
||||||
|
.list_item_title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
}
|
}
|
||||||
.list-cell{
|
|
||||||
|
.list-cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.list-cell-item{
|
|
||||||
|
.list-cell-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-bottom: 2rpx solid #E5E5E5;
|
border-bottom: 2rpx solid #E5E5E5;
|
||||||
padding-bottom: 32rpx;
|
padding-bottom: 32rpx;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
.list-cell-item-title{
|
|
||||||
|
.list-cell-item-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
margin-bottom: 16rpx;
|
margin-bottom: 16rpx;
|
||||||
}
|
}
|
||||||
.list-cell-item-content{
|
|
||||||
|
.list-cell-item-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.list-cell-item-content-text{
|
|
||||||
|
.list-cell-item-content-text {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
@@ -128,7 +126,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list_item:last-child .list-cell-item:last-child{
|
|
||||||
|
.list_item:last-child .list-cell-item:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<view class="card_bom_item" @click="itemClick(1)">
|
<view class="card_bom_item" @click="itemClick(1)">
|
||||||
<text>{{shopUserInfo.shopInfo.amount || '0.00'}}</text><text>储值</text>
|
<text>{{shopUserInfo.shopInfo.amount || '0.00'}}</text><text>储值</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="card_bom_item">
|
<view class="card_bom_item" @click="itemClick(2)">
|
||||||
<text>{{shopUserInfo.shopInfo.accountPoints || '0'}}</text><text>积分</text>
|
<text>{{shopUserInfo.shopInfo.accountPoints || '0'}}</text><text>积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="card_bom_item" @click="itemClick(3)">
|
<view class="card_bom_item" @click="itemClick(3)">
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<registermember :show="shopUserInfo.shopInfo.isVip == 1? false : true" :shopUserInfo="shopUserInfo.shopInfo">
|
<registermember :memberOpen="form.memberOpen" :shopUserInfo="shopUserInfo.shopInfo">
|
||||||
</registermember>
|
</registermember>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -129,19 +129,27 @@
|
|||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
uni.pro.navigateTo('user/member/index', {
|
uni.pro.navigateTo('user/member/index', {
|
||||||
shopId: shopUserInfo.shopId,
|
shopId: shopUserInfo.shopId,
|
||||||
type: 'index',
|
type: type
|
||||||
|
})
|
||||||
|
} else if (type == 2) {
|
||||||
|
uni.pro.navigateTo('user/member/billDetails', {
|
||||||
|
shopId: shopUserInfo.shopId,
|
||||||
|
type: type,
|
||||||
|
shopInfo: JSON.stringify(shopUserInfo.shopInfo)
|
||||||
})
|
})
|
||||||
} else if (type == 3) {
|
} else if (type == 3) {
|
||||||
uni.pro.navigateTo('user/coupon', {
|
uni.pro.navigateTo('user/coupon', {
|
||||||
shopId: shopUserInfo.shopId,
|
shopId: shopUserInfo.shopId,
|
||||||
|
shopInfo: shopUserInfo.shopInfo
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 注册会员卡
|
// * 注册会员卡
|
||||||
const clickEvent = () => {
|
const clickEvent = () => {
|
||||||
uni.navigateTo({
|
uni.pro.navigateTo('user/member/paycode', {
|
||||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.shopUserInfo)
|
shopId: shopUserInfo.shopId,
|
||||||
|
shopInfo: JSON.stringify(shopUserInfo.shopInfo)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,34 +160,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
// 获取当前页面栈
|
||||||
// 获取当前页面栈
|
const pages = getCurrentPages();
|
||||||
const pages = getCurrentPages();
|
// 检查页面栈是否为空
|
||||||
// 检查页面栈是否为空
|
if (pages.length === 0) {
|
||||||
if (pages.length === 0) {
|
console.error('未获取到页面栈');
|
||||||
console.error('未获取到页面栈');
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 获取当前页面实例
|
|
||||||
const currentPage = pages[pages.length - 1];
|
|
||||||
// 获取页面参数
|
|
||||||
const pageParams = currentPage.options;
|
|
||||||
console.log(pageParams, 169)
|
|
||||||
let res = await APIusershopInfodetail({
|
|
||||||
shopId: pageParams.shopId
|
|
||||||
})
|
|
||||||
// 根据传的shopInfo来返回上面的值
|
|
||||||
shopUserInfo.shopInfo = await APIshopUserInfo({
|
|
||||||
shopId: pageParams.shopId
|
|
||||||
})
|
|
||||||
shopUserInfo.shopExtend = res.shopExtend.member_bg
|
|
||||||
shopUserInfo.shopId = pageParams.shopId
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取页面参数时出错:', error);
|
|
||||||
}
|
}
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const pageParams = currentPage.options;
|
||||||
|
let res = await APIusershopInfodetail({
|
||||||
|
shopId: pageParams.shopId
|
||||||
|
})
|
||||||
|
// 根据传的shopInfo来返回上面的值
|
||||||
|
shopUserInfo.shopInfo = await APIshopUserInfo({
|
||||||
|
shopId: pageParams.shopId
|
||||||
|
})
|
||||||
|
shopUserInfo.shopExtend = res.shopExtend.member_bg
|
||||||
|
shopUserInfo.shopId = pageParams.shopId
|
||||||
|
form.memberOpen = shopUserInfo.shopInfo.isVip == 1 ? false : true
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
179
pages/user/member/paycode.vue
Normal file
179
pages/user/member/paycode.vue
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<view class="header">
|
||||||
|
<text class="t"></text>
|
||||||
|
</view>
|
||||||
|
<view class="code-wrap">
|
||||||
|
<view class="num-wrap">
|
||||||
|
<text class="t">账户余额:</text>
|
||||||
|
<text class="num">{{formInfo.shopInfo.amount || '0'}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="line-code">
|
||||||
|
<canvas id="barcodeCanvas" style="width: 300px; height: 100px;"></canvas>
|
||||||
|
</view>
|
||||||
|
<view class="ewm-wrap">
|
||||||
|
<!-- <tki-qrcode show :size="qrcodeSize"></tki-qrcode> -->
|
||||||
|
<up-qrcode size="200" :val="formInfo.url" background="#fff" foreground="#000"></up-qrcode>
|
||||||
|
</view>
|
||||||
|
<view class="name">
|
||||||
|
<text>使用门店:{{formInfo.shopInfo.shopName || '--'}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="line"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onMounted,
|
||||||
|
reactive,
|
||||||
|
watch,
|
||||||
|
nextTick
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
|
import JsBarcode from "jsbarcode";
|
||||||
|
|
||||||
|
import {
|
||||||
|
APIshopUsercode
|
||||||
|
} from '@/common/api/member.js'
|
||||||
|
|
||||||
|
|
||||||
|
const formInfo = reactive({
|
||||||
|
shopInfo: '',
|
||||||
|
url: '',
|
||||||
|
shopId: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取当前页面栈
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const pageParams = currentPage.options;
|
||||||
|
formInfo.shopInfo = JSON.parse(decodeURIComponent(pageParams.shopInfo))
|
||||||
|
formInfo.shopId = pageParams.shopId
|
||||||
|
let res = await APIshopUsercode({
|
||||||
|
shopId: pageParams.shopId
|
||||||
|
})
|
||||||
|
console.log(formInfo.shopInfo)
|
||||||
|
if (res) {
|
||||||
|
formInfo.url = res;
|
||||||
|
nextTick(() => {
|
||||||
|
const barcodeText = '1234567890';
|
||||||
|
const query = uni.createSelectorQuery();
|
||||||
|
query.select('#barcodeCanvas')
|
||||||
|
.fields({ node: true, size: true })
|
||||||
|
.exec((res) => {
|
||||||
|
if (res[0]) {
|
||||||
|
const canvas = res[0].node;
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
const dpr = uni.getSystemInfoSync().pixelRatio;
|
||||||
|
canvas.width = res[0].width * dpr;
|
||||||
|
canvas.height = res[0].height * dpr;
|
||||||
|
ctx.scale(dpr, dpr);
|
||||||
|
|
||||||
|
JsBarcode(canvas, barcodeText, {
|
||||||
|
width: 2,
|
||||||
|
height: 100,
|
||||||
|
displayValue: true,
|
||||||
|
fontOptions: 'bold',
|
||||||
|
font: 'monospace',
|
||||||
|
textAlign: 'center',
|
||||||
|
textPosition: 'bottom',
|
||||||
|
textMargin: 2,
|
||||||
|
fontSize: 20,
|
||||||
|
background: '#ffffff',
|
||||||
|
lineColor: '#000000'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
page {
|
||||||
|
background-color: #eb6c37;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.container {
|
||||||
|
padding: 40upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
padding-bottom: 40upx;
|
||||||
|
|
||||||
|
.t {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32upx;
|
||||||
|
padding-bottom: 20upx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1upx solid #fff;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-wrap {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20upx;
|
||||||
|
padding: 40upx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
background-color: #eb6c37;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: absolute;
|
||||||
|
top: 42%;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {}
|
||||||
|
|
||||||
|
&::after {}
|
||||||
|
|
||||||
|
.num-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-size: 42upx;
|
||||||
|
position: relative;
|
||||||
|
top: 8upx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-code {
|
||||||
|
padding: 40upx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ewm-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 40upx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px dashed #ececec;
|
||||||
|
position: absolute;
|
||||||
|
top: calc(42% + 20upx);
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,19 +3,21 @@
|
|||||||
<view class="box_box">
|
<view class="box_box">
|
||||||
<view class="box_item flex-between">
|
<view class="box_item flex-between">
|
||||||
<text class="top_box_one_text">当前账号</text>
|
<text class="top_box_one_text">当前账号</text>
|
||||||
<input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
<input type="number" v-model="form.mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
||||||
<button v-if="!mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
<button v-if="!form.mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||||
<view class="text">获取手机号</view>
|
<view class="text">获取手机号</view>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="box_item flex-between" style="position:relative;">
|
<view class="box_item flex-between" style="position:relative;">
|
||||||
<text class="top_box_one_text"></text>
|
<text class="top_box_one_text"></text>
|
||||||
<input type="number" v-model="form.checkCode" placeholder="请输入验证码" style="padding-right: 140rpx;color: #333" />
|
<input type="number" v-model="form.checkCode" placeholder="请输入验证码"
|
||||||
|
style="padding-right: 140rpx;color: #333" />
|
||||||
<view class="top_box_one_texts">
|
<view class="top_box_one_texts">
|
||||||
<view v-if="showText == true" class="yzm" @click="CodeRegister">{{ Recapture }}</view>
|
<view v-if="datalist.showText == true" class="yzm" @click="CodeRegister">{{ datalist.Recapture }}
|
||||||
|
</view>
|
||||||
<view v-else style="color: #ccc; background-color: #f9f9f9; border-radius:16px; padding: 10rpx;">
|
<view v-else style="color: #ccc; background-color: #f9f9f9; border-radius:16px; padding: 10rpx;">
|
||||||
{{ second }}s重新发送
|
{{ datalist.second }}s重新发送
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -32,175 +34,176 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-colum">
|
<view class="flex-colum">
|
||||||
<view class="Box_bottom" :class="(form.checkCode!=''&&form.password!=''&&form.payPassword!='')?'active':''" @click="userInfosavePayPassword">确定</view>
|
<view class="Box_bottom" :class="(form.checkCode!=''&&form.password!=''&&form.payPassword!='')?'active':''"
|
||||||
|
@click="userInfosavePayPassword">确定</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
data() {
|
reactive,
|
||||||
return {
|
onMounted
|
||||||
isPwd: "",
|
} from 'vue';
|
||||||
mobile: "",
|
|
||||||
form: {
|
|
||||||
mobile: '',
|
|
||||||
password: '',
|
|
||||||
payPassword: '',
|
|
||||||
checkCode: ''
|
|
||||||
},
|
|
||||||
passwords: false,
|
|
||||||
payPasswords: false,
|
|
||||||
// 注册定时器 初始值
|
|
||||||
second: 60,
|
|
||||||
showText: true,
|
|
||||||
Recapture: '获取验证码',
|
|
||||||
shopUserInfo: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
console.log(e)
|
|
||||||
if ( e.shopUserInfo ) {
|
|
||||||
this.shopUserInfo = JSON.parse(e.shopUserInfo);
|
|
||||||
console.log(this.shopUserInfo)
|
|
||||||
this.isPwd = this.shopUserInfo.isPwd;
|
|
||||||
this.mobile = this.shopUserInfo.telephone ? ( this.shopUserInfo.telephone.slice(0, 3)+'****'+this.shopUserInfo.telephone.slice(7) ) : '';
|
|
||||||
this.form.mobile = this.shopUserInfo.telephone;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const shopUserInfo = reactive({
|
||||||
|
shopInfo: "",
|
||||||
|
shopId: ''
|
||||||
|
})
|
||||||
|
|
||||||
},
|
const form = reactive({
|
||||||
methods: {
|
mobile: '',
|
||||||
async CodeRegister() {
|
password: '',
|
||||||
const res = await this.api.phoneValidateCode({
|
payPassword: '',
|
||||||
// post 手机验证码
|
checkCode: ''
|
||||||
phone: this.form.mobile
|
})
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '验证码获取成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
// 定时器
|
|
||||||
this.showText = false;
|
|
||||||
this.Recapture = '重新获取';
|
|
||||||
var interval = setInterval(() => {
|
|
||||||
let times = --this.second;
|
|
||||||
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(interval);
|
|
||||||
this.second = 60;
|
|
||||||
this.showText = true;
|
|
||||||
}, 60000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取手机号
|
|
||||||
* @param {Object} d
|
|
||||||
*/
|
|
||||||
async getPhone(d) {
|
|
||||||
if (d.detail.iv) {
|
|
||||||
uni.login({
|
|
||||||
provider: 'weixin',
|
|
||||||
success: async (data) => {
|
|
||||||
console.log(data)
|
|
||||||
let res = await this.api.userwxlogins({
|
|
||||||
code: data.code,
|
|
||||||
encryptedData: d.detail.encryptedData,
|
|
||||||
iv: d.detail.iv,
|
|
||||||
})
|
|
||||||
this.form.mobile = res.data;
|
|
||||||
this.mobile = this.form.mobile ? ( this.form.mobile.slice(0, 3)+'****'+this.form.mobile.slice(7) ) : '';
|
|
||||||
|
|
||||||
|
const datalist = reactive({
|
||||||
|
isPwd: "",
|
||||||
|
passwords: false,
|
||||||
|
payPasswords: false,
|
||||||
|
// 注册定时器 初始值
|
||||||
|
second: 60,
|
||||||
|
showText: true,
|
||||||
|
Recapture: '获取验证码',
|
||||||
|
shopUserInfo: null,
|
||||||
|
})
|
||||||
|
|
||||||
let res2 = await this.api.upVipPhont({
|
const CodeRegister = async () => {
|
||||||
id: this.shopUserInfo.id,
|
const res = await this.api.phoneValidateCode({
|
||||||
telephone: res.data,
|
// post 手机验证码
|
||||||
})
|
phone: form.mobile
|
||||||
}
|
});
|
||||||
})
|
if (res) {
|
||||||
}
|
uni.showToast({
|
||||||
},
|
title: '验证码获取成功',
|
||||||
async loginwxuserInfo() {
|
icon: 'none'
|
||||||
let res = await this.api.loginwxuserInfo({
|
});
|
||||||
userId: uni.cache.get('userInfo').id
|
// 定时器
|
||||||
})
|
datalist.showText = false;
|
||||||
if (res.code == 0) {
|
datalist.Recapture = '重新获取';
|
||||||
uni.cache.set('userInfo', res.data);
|
var interval = setInterval(() => {
|
||||||
}
|
let times = --datalist.second;
|
||||||
},
|
datalist.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
||||||
async userInfosavePayPassword() {
|
}, 1000);
|
||||||
|
setTimeout(() => {
|
||||||
if (this.form.mobile.length != 11 && this.isPwd == 0) {
|
clearInterval(interval);
|
||||||
uni.showToast({
|
datalist.second = 60;
|
||||||
title: '手机号必须是11位',
|
datalist.showText = true;
|
||||||
icon: 'none'
|
}, 60000);
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.password == null || this.form.password == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.payPassword == null || this.form.payPassword == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入确认密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.password.length != 6 || this.form.payPassword.length != 6) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '密码必须是6位',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.payPassword != this.form.password) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '密码和确认密码不一致',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.checkCode == null || this.form.checkCode == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入验证码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let res = await this.api.loginresetPwd({
|
|
||||||
vipId: this.shopUserInfo.id,
|
|
||||||
pwd: this.form.password,
|
|
||||||
code: this.form.checkCode
|
|
||||||
})
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
if (uni.cache.get('userInfo').isPwd != 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '修改成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '设置成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
// 获取用户信息
|
|
||||||
this.loginwxuserInfo()
|
|
||||||
uni.navigateBack();
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取手机号
|
||||||
|
* @param {Object} d
|
||||||
|
*/
|
||||||
|
const getPhone = async (d) => {
|
||||||
|
if (d.detail.iv) {
|
||||||
|
uni.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: async (data) => {
|
||||||
|
console.log(data)
|
||||||
|
let res = await this.api.userwxlogins({
|
||||||
|
code: data.code,
|
||||||
|
encryptedData: d.detail.encryptedData,
|
||||||
|
iv: d.detail.iv,
|
||||||
|
})
|
||||||
|
// form.mobile = res ? (res.slice(0, 3) + '****' + res.slice(7)) : '';
|
||||||
|
form.mobile = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const loginwxuserInfo = async () => {
|
||||||
|
let res = await this.api.loginwxuserInfo({
|
||||||
|
userId: uni.cache.get('userInfo').id
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.cache.set('userInfo', res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const userInfosavePayPassword = async () => {
|
||||||
|
if (form.mobile.length != 11) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '手机号必须是11位',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.password == null || form.password == '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入密码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.payPassword == null || form.payPassword == '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入确认密码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.password.length != 6 || form.payPassword.length != 6) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '密码必须是6位',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.payPassword != form.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '密码和确认密码不一致',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (form.checkCode == null || form.checkCode == '') {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入验证码',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await this.api.loginresetPwd({
|
||||||
|
vipId: this.shopUserInfo.id,
|
||||||
|
pwd: this.form.password,
|
||||||
|
code: this.form.checkCode
|
||||||
|
})
|
||||||
|
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (datalist.isPwd != 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '设置成功',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
// 获取用户信息
|
||||||
|
this.loginwxuserInfo()
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取当前页面栈
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const options = currentPage.options;
|
||||||
|
shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||||
|
console.log(shopUserInfo)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -226,6 +229,7 @@
|
|||||||
.box_item {
|
.box_item {
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
border-bottom: 1rpx solid #E5E5E5;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.top_box_one_text {
|
.top_box_one_text {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -247,7 +251,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #5082fd;
|
color: #5082fd;
|
||||||
@@ -262,10 +266,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.box_item:nth-child(1){
|
|
||||||
|
.box_item:nth-child(1) {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
border-top: 1rpx solid #E5E5E5;
|
border-top: 1rpx solid #E5E5E5;
|
||||||
input{
|
|
||||||
|
input {
|
||||||
border-bottom: 1rpx solid #E5E5E5;
|
border-bottom: 1rpx solid #E5E5E5;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
@@ -289,11 +295,13 @@
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.Box_bottom.active{
|
|
||||||
|
.Box_bottom.active {
|
||||||
background-color: #E3AD7F;
|
background-color: #E3AD7F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.getPhone{
|
|
||||||
|
.getPhone {
|
||||||
line-height: initial;
|
line-height: initial;
|
||||||
background-color: none;
|
background-color: none;
|
||||||
border: 2rpx solid #E3AD7F;
|
border: 2rpx solid #E3AD7F;
|
||||||
|
|||||||
@@ -3,66 +3,89 @@
|
|||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="list_item" @click="handleClick(item)" v-for="(item,index) in list" :key="index">
|
<view class="list_item" @click="handleClick(item)" v-for="(item,index) in list" :key="index">
|
||||||
<view>{{ item.name }}</view>
|
<view>{{ item.name }}</view>
|
||||||
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
|
<u-icon name="arrow-right" color="#575B66" size="16"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup>
|
||||||
export default {
|
import {
|
||||||
data() {
|
ref,
|
||||||
return {
|
onMounted,
|
||||||
shopUserInfo: null,
|
reactive
|
||||||
list: [
|
} from 'vue'
|
||||||
{name: "余额明细", url: "member/billDetails"},
|
|
||||||
{name: "密码设置", url: "member/setPassword"},
|
|
||||||
{name: "使用须知", url: "member/instructions"},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
this.shopUserInfo = JSON.parse(e.shopUserInfo)
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
const list = ref([
|
||||||
/**
|
// {
|
||||||
* 跳转
|
// name: "余额明细",
|
||||||
*/
|
// url: "user/member/billDetails"
|
||||||
handleClick ( item ) {
|
// },
|
||||||
uni.navigateTo({
|
{
|
||||||
url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(this.shopUserInfo)}`
|
name: "密码设置",
|
||||||
})
|
url: "user/member/setPassword"
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
|
name: "使用须知",
|
||||||
|
url: "user/member/instructions"
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
const shopUserInfo = reactive({
|
||||||
|
shopInfo: "",
|
||||||
|
shopId: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
// 跳转
|
||||||
|
const handleClick = (item) => {
|
||||||
|
uni.pro.navigateTo(item.url, {
|
||||||
|
shopInfo: JSON.stringify(shopUserInfo.shopInfo)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
onMounted(async () => {
|
||||||
|
// 获取当前页面栈
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
// 获取当前页面实例
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
// 获取页面参数
|
||||||
|
const options = currentPage.options;
|
||||||
|
shopUserInfo.shopId = options.shopId
|
||||||
|
shopUserInfo.shopInfo = JSON.parse(decodeURIComponent(options.shopInfo))
|
||||||
|
console.log(shopUserInfo)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
page{
|
page {}
|
||||||
|
|
||||||
}
|
.container {
|
||||||
.container{
|
|
||||||
padding: 48rpx 20rpx;
|
padding: 48rpx 20rpx;
|
||||||
.list{
|
|
||||||
|
.list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
padding: 16rpx 24rpx;
|
padding: 16rpx 24rpx;
|
||||||
.list_item{
|
|
||||||
|
.list_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 2rpx solid #E5E5E5;;
|
border-bottom: 2rpx solid #E5E5E5;
|
||||||
|
;
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
view{
|
|
||||||
|
view {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list_item:last-child{
|
|
||||||
|
.list_item:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,223 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view v-if="isPwd == 0">
|
|
||||||
<view class="contenttext flex-center">
|
|
||||||
{{form.password.length == 6?'请再次确认支付密码':"请设置新密码,用于支付验证"}}
|
|
||||||
</view>
|
|
||||||
<view class="contentbox flex-between">
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(0,1)}}
|
|
||||||
</view>
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(1,2)}}
|
|
||||||
</view>
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(2,3)}}
|
|
||||||
</view>
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(3,4)}}
|
|
||||||
</view>
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(4,5)}}
|
|
||||||
</view>
|
|
||||||
<view class="contentboxitem flex-colum">
|
|
||||||
{{consumeFee.slice(5,6)}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="" v-else>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<cwx-keyboard ref="keyboard" v-if="isPwd == 0" @confirmEvent="confirmEvent"
|
|
||||||
:money.sync="consumeFee"></cwx-keyboard>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import cwxKeyboard from '@/components/cwx-keyboard/cwx-keyboard';
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
cwxKeyboard
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isPwd: uni.cache.get('userInfo').isPwd,
|
|
||||||
form: {
|
|
||||||
mobile: uni.cache.get('userInfo').telephone,
|
|
||||||
password: '', //密码
|
|
||||||
payPassword: '', //二次密码
|
|
||||||
checkCode: ''
|
|
||||||
},
|
|
||||||
passwords: false,
|
|
||||||
payPasswords: false,
|
|
||||||
// 注册定时器 初始值
|
|
||||||
second: 60,
|
|
||||||
showText: true,
|
|
||||||
Recapture: '发送验证码',
|
|
||||||
consumeFee: '', //第一遍
|
|
||||||
consumeFees: '', //第二遍
|
|
||||||
money: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
if (uni.cache.get('userInfo').isPwd != 0) {
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: '忘记支付密码', // 标题文本,必须是字符串
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
consumeFee(newVal, oldVal) {
|
|
||||||
if (this.form.password.length == 6) {
|
|
||||||
this.form.payPassword = newVal
|
|
||||||
if (this.form.payPassword.length == 6) {
|
|
||||||
this.userInfosavePayPassword()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.form.password = newVal
|
|
||||||
if (this.form.password.length == 6) {
|
|
||||||
this.$refs.keyboard._handleClearKey() //清空
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
confirmEvent(e) {
|
|
||||||
console.log(e)
|
|
||||||
},
|
|
||||||
async CodeRegister() {
|
|
||||||
const res = await this.api.phoneValidateCode({
|
|
||||||
// post 手机验证码
|
|
||||||
phone: this.form.mobile
|
|
||||||
});
|
|
||||||
if (res) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '验证码获取成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
// 定时器
|
|
||||||
this.showText = false;
|
|
||||||
this.Recapture = '重新获取';
|
|
||||||
var interval = setInterval(() => {
|
|
||||||
let times = --this.second;
|
|
||||||
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
|
||||||
}, 1000);
|
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(interval);
|
|
||||||
this.second = 60;
|
|
||||||
this.showText = true;
|
|
||||||
}, 60000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async loginwxuserInfo() {
|
|
||||||
let res = await this.api.loginwxuserInfo({
|
|
||||||
userId: uni.getStorageSync('userInfo').id,
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.cache.set('userInfo', res.data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async userInfosavePayPassword() {
|
|
||||||
if (this.form.mobile.length != 11 && this.isPwd == 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '手机号必须是11位',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.password == null || this.form.password == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.payPassword == null || this.form.payPassword == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入确认密码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.password.length != 6 || this.form.payPassword.length != 6) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '密码必须是6位',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.payPassword != this.form.password) {
|
|
||||||
this.$refs.keyboard._handleClearKey() //清空
|
|
||||||
this.form.payPassword = ''
|
|
||||||
this.form.password = ''
|
|
||||||
uni.showToast({
|
|
||||||
title: '密码和确认密码不一致',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.form.checkCode == null || this.form.checkCode == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请输入验证码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let res = await this.api.loginresetPwd({
|
|
||||||
pwd: this.form.password,
|
|
||||||
code: this.form.checkCode
|
|
||||||
})
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
if (uni.cache.get('userInfo').isPwd != 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '修改成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '设置成功',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 获取用户信息
|
|
||||||
this.loginwxuserInfo()
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.navigateBack();
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
|
||||||
this.$refs.keyboard._handleClearKey() //清空
|
|
||||||
this.form.payPassword = ''
|
|
||||||
this.form.password = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.content {
|
|
||||||
height: 100%;
|
|
||||||
background: #FFFFFF;
|
|
||||||
|
|
||||||
.contenttext {
|
|
||||||
padding: 48rpx 0;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentbox {
|
|
||||||
margin-top: 48rpx;
|
|
||||||
padding: 0 56rpx;
|
|
||||||
|
|
||||||
.contentboxitem {
|
|
||||||
width: 88rpx;
|
|
||||||
height: 88rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
|
||||||
border: 2rpx solid #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="my_item my_assets">
|
<view class="my_item my_assets">
|
||||||
<view class="my_item_title">我的资产</view>
|
<view class="my_item_title">我的资产</view>
|
||||||
<view class="my_assets_list">
|
<view class="my_assets_list">
|
||||||
@@ -127,7 +126,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const clickTo = (item, index) => {
|
const clickTo = (item, index) => {
|
||||||
console.log(item, index)
|
|
||||||
let shopId = null;
|
let shopId = null;
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'my_order':
|
case 'my_order':
|
||||||
|
|||||||
@@ -10,8 +10,12 @@ import {
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
export const useCartStore = defineStore('cart', () => {
|
export const useCartStore = defineStore('cart', () => {
|
||||||
const shopInfo = null
|
// const dinersNum = uni.cache.get('dinersNum')
|
||||||
const dinersNum = uni.cache.get('dinersNum')
|
// const isVip = uni.cache.get('orderVIP').isVip //此用户是否是会员
|
||||||
|
// const isMemberPrice = uni.cache.get('ordershopUserInfo').isMemberPrice //此店是否可以用会员
|
||||||
|
// const isTableFee = uni.cache.get('ordershopUserInfo').isTableFee //此店是否免桌位费
|
||||||
|
// const tableFee = uni.cache.get('ordershopUserInfo').tableFee //一个餐位费多钱
|
||||||
|
|
||||||
// 计算单个商品的打包费用(向下取整并保留两位小数)
|
// 计算单个商品的打包费用(向下取整并保留两位小数)
|
||||||
const itemSinglePackFee = (item) => {
|
const itemSinglePackFee = (item) => {
|
||||||
const fee = item.packFee * item.cartNumber;
|
const fee = item.packFee * item.cartNumber;
|
||||||
@@ -24,15 +28,39 @@ export const useCartStore = defineStore('cart', () => {
|
|||||||
if (!matchedProducts || !Array.isArray(matchedProducts)) {
|
if (!matchedProducts || !Array.isArray(matchedProducts)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
// console.log(uni.cache.get('orderVIP').isVip, uni.cache.get('ordershopUserInfo').isMemberPrice,
|
||||||
|
// 111)
|
||||||
// 购物车总数价格
|
// 购物车总数价格
|
||||||
let cart = matchedProducts.reduce((total, item) => {
|
let cart = matchedProducts.reduce((total, item) => {
|
||||||
// 是否启用会员价 0否1是
|
// 是否启用会员价 0否1是
|
||||||
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
|
if (uni.cache.get('orderVIP').isVip == 1 && uni.cache.get('ordershopUserInfo')
|
||||||
|
.isMemberPrice == 1) {
|
||||||
// memberPrice会员价
|
// memberPrice会员价
|
||||||
return total + parseFloat(item.memberPrice) * parseFloat(item.cartNumber);
|
return total + parseFloat(item.memberPrice) * parseFloat(item.num);
|
||||||
} else {
|
} else {
|
||||||
// salePrice销售价
|
// salePrice销售价
|
||||||
return total + parseFloat(item.salePrice) * parseFloat(item.cartNumber);
|
return total + parseFloat(item.price) * parseFloat(item.num);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
// 向上取整并保留两位小数
|
||||||
|
return cart = Math.ceil(cart * 100) / 100;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 计算商品卷所选择的总价格
|
||||||
|
const getTotalProductroll = (matchedProducts) => computed(() => {
|
||||||
|
if (!matchedProducts || !Array.isArray(matchedProducts)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// 购物车总数价格
|
||||||
|
let cart = matchedProducts.reduce((total, item) => {
|
||||||
|
// 是否启用会员价 0否1是
|
||||||
|
if (uni.cache.get('orderVIP').isVip == 1 && uni.cache.get('ordershopUserInfo')
|
||||||
|
.isMemberPrice == 1) {
|
||||||
|
// memberPrice会员价
|
||||||
|
return total + parseFloat(item.memberPrice)
|
||||||
|
} else {
|
||||||
|
// salePrice销售价
|
||||||
|
return total + parseFloat(item.price)
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
// 向上取整并保留两位小数
|
// 向上取整并保留两位小数
|
||||||
@@ -40,18 +68,16 @@ export const useCartStore = defineStore('cart', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 桌位置
|
// 桌位置
|
||||||
const getTotalSeatcharge = () => computed(() => {
|
const getTotalSeatcharge = (seatNum) => computed(() => {
|
||||||
// 是否免除桌位费 0 否 1 是
|
// 是否免除桌位费 0 否 1 是
|
||||||
let tableFeeTotals = 0
|
let tableFeeTotals = 0
|
||||||
try {
|
|
||||||
if (shopInfo.isTableFee == 0 && dinersNum) {
|
if (uni.cache.get('ordershopUserInfo').isTableFee == 0 && (seatNum || uni.cache.get('dinersNum'))) {
|
||||||
const tableFeeTotals = Math.ceil(parseFloat(dinersNum) * parseFloat(shopInfo
|
tableFeeTotals = Math.ceil(parseFloat((seatNum || uni.cache.get('dinersNum'))) * parseFloat(
|
||||||
.tableFee) * 100) / 100;
|
uni.cache.get('ordershopUserInfo').tableFee) * 100) / 100;
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
//TODO handle the exception
|
|
||||||
}
|
}
|
||||||
return Math.floor(tableFeeTotals * 100) / 100 ? Math.floor(tableFeeTotals * 100) / 100 : 0;
|
console.log(uni.cache.get('ordershopUserInfo').isTableFee,seatNum,22222)
|
||||||
|
return Math.floor(tableFeeTotals * 100) / 100;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 计算购物车总打包费用(向下取整并保留两位小数)
|
// 计算购物车总打包费用(向下取整并保留两位小数)
|
||||||
@@ -68,6 +94,7 @@ export const useCartStore = defineStore('cart', () => {
|
|||||||
itemSinglePackFee,
|
itemSinglePackFee,
|
||||||
getTotalPackFee,
|
getTotalPackFee,
|
||||||
getTotalSeatcharge,
|
getTotalSeatcharge,
|
||||||
getTotalTotalPrices
|
getTotalTotalPrices,
|
||||||
|
getTotalProductroll
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -62,6 +62,9 @@ export const Memberpay = defineStore('memberpay', {
|
|||||||
title: "支付成功"
|
title: "支付成功"
|
||||||
})
|
})
|
||||||
console.log('支付成功')
|
console.log('支付成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
resolve(res)
|
resolve(res)
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
@@ -69,6 +72,9 @@ export const Memberpay = defineStore('memberpay', {
|
|||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "支付成功"
|
title: "支付成功"
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1000)
|
||||||
resolve(res)
|
resolve(res)
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -110,14 +116,14 @@ export const Memberpay = defineStore('memberpay', {
|
|||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
payType: 'aliPay',
|
payType: 'aliPay',
|
||||||
openId: uni.cache.get('alipayOpenId').wechatOpenId,
|
openId: uni.cache.get('alipayOpenId').alipayOpenId,
|
||||||
// #endif
|
// #endif
|
||||||
returnUrl: data.returnUrl,
|
returnUrl: data.returnUrl,
|
||||||
buyerRemark: data.buyerRemark,
|
buyerRemark: data.buyerRemark,
|
||||||
})
|
})
|
||||||
if (res) {
|
if (res) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '支付吊起中...',
|
title: '加载中...',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
|
|||||||
@@ -95,46 +95,75 @@ export const productStore = defineStore('product', {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
// 扫码请求
|
// 扫码请求
|
||||||
scanCodeactions() {
|
scanCodeactions(q) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
if (q) {
|
||||||
uni.scanCode({
|
// #ifdef MP-WEIXIN
|
||||||
success: async (res) => {
|
let tableCode = this.getQueryString(decodeURIComponent(q), 'code')
|
||||||
let tableCode = this.getQueryString(
|
// #endif
|
||||||
decodeURIComponent(res
|
// #ifdef MP-ALIPAY
|
||||||
.result),
|
let tableCode = q
|
||||||
'code')
|
// #endif
|
||||||
// 储存卓玛
|
|
||||||
uni.cache.set('tableCode', tableCode)
|
|
||||||
if (tableCode) {
|
|
||||||
let data = await this.actionsproductqueryShop()
|
|
||||||
// -4请求登录
|
|
||||||
const store = Storelogin()
|
|
||||||
if (data.code == '-4') {
|
|
||||||
if (await store.actionslogin()) {
|
|
||||||
// 成功 接着在调用
|
|
||||||
await this.actionsproductqueryShop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 是否免除桌位费 0否1是
|
|
||||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
|
||||||
uni.pro.navigateTo('product/choosetable')
|
|
||||||
} else {
|
|
||||||
uni.pro.navigateTo(
|
|
||||||
'product/index', {
|
|
||||||
tableCode: tableCode,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 储存卓玛
|
||||||
|
uni.cache.set('tableCode', tableCode)
|
||||||
|
if (tableCode) {
|
||||||
|
let data = await this.actionsproductqueryShop()
|
||||||
|
// -4请求登录
|
||||||
|
const store = Storelogin()
|
||||||
|
if (data.code == '-4') {
|
||||||
|
if (await store.actionslogin()) {
|
||||||
|
// 成功 接着在调用
|
||||||
|
await this.actionsproductqueryShop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
// 是否免除桌位费 0否1是
|
||||||
fail: (res) => {
|
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||||
console.log(res)
|
uni.pro.navigateTo('product/choosetable')
|
||||||
|
} else {
|
||||||
|
uni.pro.navigateTo(
|
||||||
|
'product/index', {
|
||||||
|
tableCode: tableCode,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
// #endif
|
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||||
|
uni.scanCode({
|
||||||
|
success: async (res) => {
|
||||||
|
let tableCode = this.getQueryString(
|
||||||
|
decodeURIComponent(res.result), 'code')
|
||||||
|
// 储存卓玛
|
||||||
|
uni.cache.set('tableCode', tableCode)
|
||||||
|
if (tableCode) {
|
||||||
|
let data = await this.actionsproductqueryShop()
|
||||||
|
// -4请求登录
|
||||||
|
const store = Storelogin()
|
||||||
|
if (data.code == '-4') {
|
||||||
|
if (await store.actionslogin()) {
|
||||||
|
// 成功 接着在调用
|
||||||
|
await this.actionsproductqueryShop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是否免除桌位费 0否1是
|
||||||
|
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||||
|
uni.pro.navigateTo('product/choosetable')
|
||||||
|
} else {
|
||||||
|
uni.pro.navigateTo(
|
||||||
|
'product/index', {
|
||||||
|
tableCode: tableCode,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (uni.cache.get('tableCode')) {
|
if (uni.cache.get('tableCode')) {
|
||||||
let data = await this.actionsproductqueryShop()
|
let data = await this.actionsproductqueryShop()
|
||||||
|
|||||||
Reference in New Issue
Block a user