Compare commits
33 Commits
a4580bdd1c
...
prod
| Author | SHA1 | Date | |
|---|---|---|---|
| 32c60b4f83 | |||
| 373be0527f | |||
| 402f85d61f | |||
| 575e6d22b0 | |||
| dfc67e12c5 | |||
| 42fc09815b | |||
| 3064007137 | |||
| d8c2aef83e | |||
| 362f3cee96 | |||
| ca53618004 | |||
| cbe27a43de | |||
| 5fcbba0cb4 | |||
| 0944635c69 | |||
| 067025f532 | |||
| 8d917d49ed | |||
| bcc44a0886 | |||
| 811abf935c | |||
| bde30fa70c | |||
| ac7af51a92 | |||
| 9b78ee0f48 | |||
| 75ed724fbb | |||
| 113193b142 | |||
| b5ecab0a03 | |||
| f75f90d34f | |||
| edd10edf9f | |||
| cf562b28b0 | |||
| e645aa5516 | |||
| 33453ab961 | |||
| 158a025ba1 | |||
| 65554b043c | |||
| 4d7c388f74 | |||
| b3c1ab3b8b | |||
| e1000c6b40 |
@@ -3,12 +3,15 @@ import request from '@/common/api/request.js'
|
|||||||
const url = '/account'
|
const url = '/account'
|
||||||
//根据经纬度获取信息
|
//根据经纬度获取信息
|
||||||
export const APIgeocodelocation = (data) => {
|
export const APIgeocodelocation = (data) => {
|
||||||
return request({
|
return new Promise((resove, reject) => {
|
||||||
url: url + '/user/geo/geocode',
|
resove(null)
|
||||||
method: 'get',
|
|
||||||
data: data,
|
|
||||||
toast: false
|
|
||||||
})
|
})
|
||||||
|
// return request({
|
||||||
|
// url: url + '/user/geo/geocode',
|
||||||
|
// method: 'get',
|
||||||
|
// data: data,
|
||||||
|
// toast: false
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
//登录
|
//登录
|
||||||
|
|||||||
3
common/api/apiPrve.js
Normal file
3
common/api/apiPrve.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const urlAccount = '/account'
|
||||||
|
export const urlProduct = '/product'
|
||||||
|
export const urlOrder = '/order'
|
||||||
@@ -14,11 +14,11 @@ export const pay = (data) => {
|
|||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
platformType = "WX";
|
platformType = "WX";
|
||||||
platformType = "wechat";
|
platformType = "wechat";
|
||||||
payType = "wechatPay";
|
payType = "WECHAT";
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
platformType = "alipay";
|
platformType = "alipay";
|
||||||
payType = "aliPay";
|
payType = "ALIPAY";
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ let platformType = '';
|
|||||||
let payType = '';
|
let payType = '';
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
platformType = 'wechat'
|
platformType = 'wechat'
|
||||||
payType = 'wechatPay'
|
payType = 'WECHAT'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
platformType = 'alipay'
|
platformType = 'alipay'
|
||||||
payType = 'aliPay'
|
payType = 'ALIPAY'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export const getPackage = (data) => {
|
export const getPackage = (data) => {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ let platformType = '';
|
|||||||
let payType='';
|
let payType='';
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
platformType = 'wechat'
|
platformType = 'wechat'
|
||||||
payType='wechatPay'
|
payType='WECHAT'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
platformType = 'alipay'
|
platformType = 'alipay'
|
||||||
payType='aliPay'
|
payType='ALIPAY'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export const warePage = (data) => {
|
export const warePage = (data) => {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ let platformType = '';
|
|||||||
let payType='';
|
let payType='';
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
platformType = 'wechat'
|
platformType = 'wechat'
|
||||||
payType='wechatPay'
|
payType='WECHAT'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
platformType = 'alipay'
|
platformType = 'alipay'
|
||||||
payType='aliPay'
|
payType='ALIPAY'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
//订单列表
|
//订单列表
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ let platformType = '';
|
|||||||
let payType='';
|
let payType='';
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
platformType = 'wechat'
|
platformType = 'wechat'
|
||||||
payType='wechatPay'
|
payType='WECHAT'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
platformType = 'alipay'
|
platformType = 'alipay'
|
||||||
payType='aliPay'
|
payType='ALIPAY'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export const pointGoodsPage = (data) => {
|
export const pointGoodsPage = (data) => {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// 引入 request 文件
|
// 引入 request 文件
|
||||||
import request from '@/common/api/request.js'
|
import request from '@/common/api/request.js'
|
||||||
const urlAccount = '/account'
|
|
||||||
const urlProduct = '/product'
|
import {urlAccount,urlProduct,urlOrder} from '@/common/api/apiPrve.js'
|
||||||
const urlOrder = '/order'
|
|
||||||
|
|
||||||
//获取商品列表数据
|
//获取商品列表数据
|
||||||
export const APIproductqueryProduct = (data) => {
|
export const APIproductqueryProduct = (data) => {
|
||||||
@@ -46,4 +45,13 @@ export const APIminiAppskuinfo = (data) => {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取相关推荐商品
|
||||||
|
export const productRelated = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlProduct + '/user/product/related/'+data.id,
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -7,33 +7,7 @@ export default async (params) => {
|
|||||||
let token = uni.cache.get("token") || "";
|
let token = uni.cache.get("token") || "";
|
||||||
const shopId = uni.cache.get("shopId") * 1;
|
const shopId = uni.cache.get("shopId") * 1;
|
||||||
const userInfo = uni.cache.get("userInfo") || {};
|
const userInfo = uni.cache.get("userInfo") || {};
|
||||||
// #ifdef H5
|
|
||||||
token = "1b5e8baf0cc1492a858a208f113d0971";
|
|
||||||
uni.cache.set('userInfo', {
|
|
||||||
"acQrcodeValidTime": "2026-01-13 13:35:59",
|
|
||||||
"alipayOpenId": "",
|
|
||||||
"birthDay": "",
|
|
||||||
"createTime": "2024-03-13 10:56:40",
|
|
||||||
"distributionAmount": 0,
|
|
||||||
"headImg": "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132",
|
|
||||||
"id": "36689",
|
|
||||||
"idCard": "",
|
|
||||||
"isAc": 0,
|
|
||||||
"lastLoginTime": "2025-12-24 11:24:12",
|
|
||||||
"nickName": "微信用户",
|
|
||||||
"password": "",
|
|
||||||
"payPwd": "e10adc3949ba59abbe56e057f20f883e",
|
|
||||||
"phone": "",
|
|
||||||
"realName": "",
|
|
||||||
"sex": null,
|
|
||||||
"status": 1,
|
|
||||||
"updateTime": "2025-12-24 11:22:47",
|
|
||||||
"usePayPwd": 0,
|
|
||||||
"wechatAcOpenId": "",
|
|
||||||
"wechatAcQrcode": "http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco",
|
|
||||||
"wechatOpenId": "or1l86yipGvwyfPhrKIAcQuSfAV8"
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
let header = {
|
let header = {
|
||||||
version: uni.conf.version,
|
version: uni.conf.version,
|
||||||
type: uni.getSystemInfoSync().platform,
|
type: uni.getSystemInfoSync().platform,
|
||||||
@@ -60,7 +34,10 @@ export default async (params) => {
|
|||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// #ifdef H5
|
||||||
|
uni.cache.set('token', '1b5e8baf0cc1492a858a208f113d0971')
|
||||||
|
uni.cache.set('userInfo',{"acQrcodeValidTime":"2026-01-13 13:35:59","alipayOpenId":"","birthDay":"2025-12-25","createTime":"2024-03-13 10:56:40","distributionAmount":0,"headImg":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","id":"36689","idCard":"","isAc":0,"lastLoginTime":"2025-12-26 10:01:12","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"","sex":1,"status":1,"updateTime":"2025-12-26 09:59:31","usePayPwd":0,"wechatAcOpenId":"","wechatAcQrcode":"http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"})
|
||||||
|
// #endif
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒
|
const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒
|
||||||
uni.request({
|
uni.request({
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||||
|
// const debug = false; // false线上 true本地
|
||||||
const debug = false; // false线上 true本地
|
const debug = false; // false线上 true本地
|
||||||
let baseUrl = ''
|
let baseUrl = ''
|
||||||
let baseUrlwws = ''
|
let baseUrlwws = ''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const version = "100";
|
const version = "100";
|
||||||
const autoRemoveCache = {
|
const autoRemoveCache = {
|
||||||
count: 100000,
|
count: 100000,
|
||||||
size: 100000,
|
size: 100000,
|
||||||
};
|
};
|
||||||
|
|
||||||
function init(){
|
function init() {
|
||||||
if (debug) {
|
if (debug) {
|
||||||
baseUrl = 'http://192.168.1.42'
|
baseUrl = 'http://192.168.1.42'
|
||||||
baseUrlwws = "ws://192.168.1.42:2348";
|
baseUrlwws = "ws://192.168.1.42:2348";
|
||||||
@@ -20,12 +22,12 @@ function init(){
|
|||||||
baseUrlwws = "wss://czgeatws.sxczgkj.com/wss";
|
baseUrlwws = "wss://czgeatws.sxczgkj.com/wss";
|
||||||
}
|
}
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
baseUrl = "/api";
|
baseUrl = "/testApi";
|
||||||
baseUrlwws = "http://192.168.1.42:2348";
|
baseUrlwws = "http://192.168.1.42:2348";
|
||||||
} else {
|
} else {
|
||||||
baseUrl = "/prodApi";
|
baseUrl = "/prodApi";
|
||||||
baseUrlwws = "https://czgeatws.sxczgkj.com/wss";
|
baseUrlwws = "https://czgeatws.sxczgkj.com/wss";
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@@ -47,7 +49,7 @@ export const changeEnv = (env) => {
|
|||||||
let baseUrl = "http://192.168.1.42"
|
let baseUrl = "http://192.168.1.42"
|
||||||
let baseUrlwws = "ws://192.168.1.42:2348"
|
let baseUrlwws = "ws://192.168.1.42:2348"
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
baseUrl = "/api"
|
baseUrl = "/testApi"
|
||||||
baseUrlwws = "http://192.168.1.42:2348"
|
baseUrlwws = "http://192.168.1.42:2348"
|
||||||
// #endif
|
// #endif
|
||||||
uni.conf = {
|
uni.conf = {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<!-- 优惠券名称与领取按钮 -->
|
<!-- 优惠券名称与领取按钮 -->
|
||||||
<view class="u-flex u-row-between u-m-t-16">
|
<view class="u-flex u-row-between u-m-t-16 u-col-center">
|
||||||
<view>
|
<view>
|
||||||
<text class="title">{{ item.couponInfo.title }}</text>
|
<text class="title">{{ item.couponInfo.title }}</text>
|
||||||
<text class="num">x{{ item.num }}</text>
|
<text class="num">x{{ item.num }}</text>
|
||||||
@@ -507,6 +507,7 @@ function close() {
|
|||||||
outline: none;
|
outline: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
&:active {
|
&:active {
|
||||||
background: #f07080; // 点击深色反馈
|
background: #f07080; // 点击深色反馈
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<block v-if="limitDiscount && limitDiscount.id" class="limit-price">
|
<block v-if="limitDiscount && limitDiscount.id" >
|
||||||
<text>
|
<text class="limit-price">
|
||||||
{{ returnPrice() }}
|
{{ returnPrice() }}
|
||||||
</text>
|
</text>
|
||||||
</block>
|
</block>
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
{{ cart.memberPrice }}
|
{{ cart.memberPrice }}
|
||||||
</text>
|
</text>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<text v-else class="salePrice">{{ cart.salePrice }}</text>
|
<text v-else class="salePrice">{{ cart.salePrice }}</text>
|
||||||
</text>
|
</text>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,260 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 支付方式 -->
|
|
||||||
<view class="paymentMethod">
|
|
||||||
<view class="paymentMethod_content">
|
|
||||||
<view class="paymentMethod_title">支付方式</view>
|
|
||||||
<up-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChanges" :size="28"
|
|
||||||
placement="column">
|
|
||||||
<block v-for="(item,index) in paymentMethodList" :key="index">
|
|
||||||
<view class="method_list" @click="groupChanges(item.type)" :class="{disabled:returnDisabled(item)}"
|
|
||||||
v-if="(index+1) == radiovalue?!changeFreeenable:true">
|
|
||||||
<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">
|
|
||||||
当前余额¥{{orderVIP?(orderVIP.amount||0):0}}</text>
|
|
||||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<up-radio :disabled="returnDisabled(item)" activeColor="#E8AD7B" icon-size="18" size="18" :name="item.type">
|
|
||||||
</up-radio>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</up-radio-group>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {
|
|
||||||
ref,
|
|
||||||
reactive,
|
|
||||||
defineProps,
|
|
||||||
computed,
|
|
||||||
defineEmits,
|
|
||||||
watch,
|
|
||||||
watchEffect,
|
|
||||||
defineExpose
|
|
||||||
} from 'vue'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
rechargeFreeChecked: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
payAmount: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
freeCheck: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
changeFreeenable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
disablePayType: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function returnDisabled(item) {
|
|
||||||
if (props.disablePayType.includes(item.name)) {
|
|
||||||
return true
|
|
||||||
}else{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const orderVIP = ref(null)
|
|
||||||
const emits = defineEmits(['customevent', 'groupChange']);
|
|
||||||
watchEffect(() => {
|
|
||||||
orderVIP.value = uni.cache.get('orderVIP')
|
|
||||||
})
|
|
||||||
|
|
||||||
const orderVIPfun = (data) => {
|
|
||||||
orderVIP.value = data
|
|
||||||
}
|
|
||||||
|
|
||||||
const paymentMethodList = ref([
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
{
|
|
||||||
name: "微信支付",
|
|
||||||
type: 2,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
|
||||||
payType: 'wechatPay'
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY
|
|
||||||
{
|
|
||||||
name: "支付宝支付",
|
|
||||||
type: 3,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png",
|
|
||||||
payType: 'aliPay'
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
{
|
|
||||||
name: "余额支付",
|
|
||||||
type: 1,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png",
|
|
||||||
payType: 'accountPay'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
const paymentMethodName = ref([{
|
|
||||||
name: "余额支付",
|
|
||||||
type: 1,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png",
|
|
||||||
payType: 'accountPay'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "微信支付",
|
|
||||||
type: 2,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
|
||||||
payType: 'wechatPay'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "支付宝支付",
|
|
||||||
type: 3,
|
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png",
|
|
||||||
payType: 'aliPay'
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
const radiovalue = ref(2) // 支付方式
|
|
||||||
|
|
||||||
const ispws = ref(false) // 输入支付密码
|
|
||||||
|
|
||||||
const storeInfo = ref({})
|
|
||||||
|
|
||||||
// * 监听支付方式切换
|
|
||||||
const groupChanges = (type) => {
|
|
||||||
if (props.freeCheck && type == 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const item=paymentMethodList.value.find(v=>v.type==type)
|
|
||||||
if(item&&returnDisabled(item)){
|
|
||||||
uni.showToast({
|
|
||||||
title:"当前支付方式不可用",
|
|
||||||
icon:'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if (props.payAmount <= 0 && type != 1) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
radiovalue.value = type;
|
|
||||||
let name = paymentMethodName.value[type - 1].name;
|
|
||||||
|
|
||||||
emits("groupChange", paymentMethodName.value[type - 1])
|
|
||||||
}
|
|
||||||
|
|
||||||
// 去充值
|
|
||||||
const goRecharge = () => {
|
|
||||||
if (orderVIP.value.isVip) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/user/member/czzx?shopId=' + orderVIP.value.shopId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/user/vip/buy-vip?shopId=' + orderVIP.value.shopId
|
|
||||||
})
|
|
||||||
|
|
||||||
// uni.pro.navigateTo('user/member/index', {
|
|
||||||
// shopId: orderVIP.value.shopId
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
// 将方法暴露给父组件
|
|
||||||
defineExpose({
|
|
||||||
groupChanges,
|
|
||||||
orderVIPfun
|
|
||||||
});
|
|
||||||
</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;
|
|
||||||
&.disabled{
|
|
||||||
opacity: .6;
|
|
||||||
}
|
|
||||||
.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>
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<view class="name"> {{ item.name }} </view>
|
<view class="name"> {{ item.name }} </view>
|
||||||
<view class="method_list_bom" v-if="item.name == '余额支付'">
|
<view class="method_list_bom" v-if="item.name == '余额支付'">
|
||||||
<text class="balance">
|
<text class="balance">
|
||||||
当前余额¥{{ orderVIP ? orderVIP.amount || 0 : 0 }}</text>
|
当前余额¥{{ shopUserInfo ? shopUserInfo.amount || 0 : 0 }}</text>
|
||||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
<text class="topUpNow" @click="goRecharge">去充值</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -66,6 +66,14 @@ const props = defineProps({
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
shopUserInfo:{
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return{
|
||||||
|
amount:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 工具函数 - 深拷贝对象(切断引用)
|
// 工具函数 - 深拷贝对象(切断引用)
|
||||||
@@ -77,15 +85,10 @@ function returnDisabled(item) {
|
|||||||
return props.disablePayType.includes(item.name);
|
return props.disablePayType.includes(item.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderVIP = ref(null);
|
|
||||||
const emits = defineEmits(["customevent", "groupChange"]);
|
const emits = defineEmits(["customevent", "groupChange"]);
|
||||||
watchEffect(() => {
|
|
||||||
orderVIP.value = uni.cache.get("orderVIP");
|
|
||||||
});
|
|
||||||
|
|
||||||
const orderVIPfun = (data) => {
|
|
||||||
orderVIP.value = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 支付方式列表(保持不变)
|
// 支付方式列表(保持不变)
|
||||||
const paymentMethodList = ref([
|
const paymentMethodList = ref([
|
||||||
@@ -94,7 +97,7 @@ const paymentMethodList = ref([
|
|||||||
name: "微信支付",
|
name: "微信支付",
|
||||||
type: 2,
|
type: 2,
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
||||||
payType: "wechatPay",
|
payType: "WECHAT",
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
@@ -207,13 +210,12 @@ const goRecharge = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/member/czzx?shopId=${orderVIP.value?.shopId || ''}`,
|
url: `/pages/user/member/czzx?shopId=${props.shopUserInfo?.shopId || ''}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
groupChanges,
|
groupChanges,
|
||||||
orderVIPfun,
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -45,17 +45,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view
|
<!-- <view
|
||||||
class="u-p-t-16 u-p-b-20 u-flex u-p-l-28 u-p-r-28"
|
class="u-p-t-16 u-p-b-20 u-flex u-p-l-28 u-p-r-28"
|
||||||
style="align-items: baseline; justify-content: flex-end"
|
style="align-items: baseline; justify-content: flex-end"
|
||||||
>
|
>
|
||||||
<text class="color-666 font-12"> 总计:</text>
|
<text class="color-666 font-12"> 总计:</text>
|
||||||
<text class="font-16 color-333 font-700" v-if="centerUserInfo">
|
<text class="font-16 color-333 font-700" >
|
||||||
{{ centerUserInfo.totalIncome }}</text
|
{{ totalIncome }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="list">
|
<view class="list u-m-t-32">
|
||||||
<view v-for="(item, index) in state.records" :key="index" class="item">
|
<view v-for="(item, index) in state.records" :key="index" class="item">
|
||||||
<view class="u-flex justify-between">
|
<view class="u-flex justify-between">
|
||||||
<view>
|
<view>
|
||||||
@@ -113,6 +113,7 @@
|
|||||||
<scroll-view
|
<scroll-view
|
||||||
class="popup-list"
|
class="popup-list"
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
|
:scroll-y="true"
|
||||||
@scrollend="scrollBottom"
|
@scrollend="scrollBottom"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
@@ -301,6 +302,7 @@ async function centerUser() {
|
|||||||
}
|
}
|
||||||
onShow(() => {});
|
onShow(() => {});
|
||||||
|
|
||||||
|
|
||||||
onLoad(async (opt) => {
|
onLoad(async (opt) => {
|
||||||
await getCouponShopsAjax();
|
await getCouponShopsAjax();
|
||||||
|
|
||||||
@@ -314,13 +316,24 @@ onLoad(async (opt) => {
|
|||||||
}
|
}
|
||||||
if (opt.shopId) {
|
if (opt.shopId) {
|
||||||
querForm.value.shopId = opt.shopId;
|
querForm.value.shopId = opt.shopId;
|
||||||
const findItem = couponShops.value.find((item) => item.id == opt.shopId);
|
const findItem = shopList.value.find((item) => item.shopId == opt.shopId);
|
||||||
querForm.value.shopName = findItem.shopName || "";
|
querForm.value.shopName = findItem.shopName || "";
|
||||||
}
|
}
|
||||||
centerUser();
|
centerUser();
|
||||||
getIncomeDetailsAjax();
|
getIncomeDetailsAjax();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const totalIncome=computed(()=>{
|
||||||
|
if(!querForm.value.shopId){
|
||||||
|
return centerUserInfo.value?(centerUserInfo.value.totalIncome||0):0;
|
||||||
|
}
|
||||||
|
const findItem = shopList.value.find((item) => item.shopId == querForm.value.shopId );
|
||||||
|
if(findItem){
|
||||||
|
return findItem.income||0
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => querForm.value.status,
|
() => querForm.value.status,
|
||||||
(newVal, oldVal) => {
|
(newVal, oldVal) => {
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ export function calcSingleGoodsRealPrice(
|
|||||||
>
|
>
|
||||||
) : number {
|
) : number {
|
||||||
const { isMember, memberDiscountRate, limitTimeDiscount: activity } = config;
|
const { isMember, memberDiscountRate, limitTimeDiscount: activity } = config;
|
||||||
|
console.log('isMember',isMember);
|
||||||
//如果是增菜价格为0
|
//如果是增菜价格为0
|
||||||
if (goods.is_gift || goods.isGift) {
|
if (goods.is_gift || goods.isGift) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
"pinia-plugin-unistorage": "^0.1.2",
|
"pinia-plugin-unistorage": "^0.1.2",
|
||||||
"ysk-utils": "^1.0.81"
|
"ysk-utils": "^1.0.83"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"unplugin-auto-import": "^0.16.7"
|
"unplugin-auto-import": "^0.16.7"
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
<view class="content min-page bg-f7">
|
<view class="content min-page bg-f7">
|
||||||
<view class="contentbox">
|
<view class="contentbox">
|
||||||
<template v-if="shopExtend.length">
|
<template v-if="shopExtend.length">
|
||||||
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
|
<image class="bg" :src="shopExtend[0].value" mode="aspectFill" v-if="!isJsonArrayString(shopExtend[0].value)"></image>
|
||||||
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
|
|
||||||
<swiper class="swiper" autoplay circular v-else>
|
<swiper class="swiper" autoplay circular v-else>
|
||||||
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)"
|
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)" :key="index">
|
||||||
:key="index">
|
|
||||||
<image class="swiper-bg" :src="item"></image>
|
<image class="swiper-bg" :src="item"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
@@ -29,7 +27,6 @@
|
|||||||
<image :src="imgs.code" class="code"></image>
|
<image :src="imgs.code" class="code"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="new-menus-box">
|
<view class="new-menus-box">
|
||||||
<view class="new-menus layout2" v-if="allConfig.takeout">
|
<view class="new-menus layout2" v-if="allConfig.takeout">
|
||||||
<view class="diner" @click="scanCodehandle(0)">
|
<view class="diner" @click="scanCodehandle(0)">
|
||||||
@@ -60,7 +57,6 @@
|
|||||||
|
|
||||||
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="points" @click="toIntegralMall">
|
<view class="points" @click="toIntegralMall">
|
||||||
@@ -122,532 +118,516 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import attractPopup from '@/components/attract-popup.vue';
|
import attractPopup from '@/components/attract-popup.vue';
|
||||||
import {
|
import { homeData } from '@/common/api/market/index.js';
|
||||||
homeData
|
import { getMemberConfig, getRechargeConfig } from '@/common/api/index/index.js';
|
||||||
} from '@/common/api/market/index.js';
|
import { ref, reactive, defineProps, defineEmits, onMounted } from 'vue';
|
||||||
import {
|
import { isJsonArrayString } from '@/utils/util.js';
|
||||||
getMemberConfig,
|
|
||||||
getRechargeConfig
|
|
||||||
} from '@/common/api/index/index.js';
|
|
||||||
import {
|
|
||||||
ref,
|
|
||||||
reactive,
|
|
||||||
defineProps,
|
|
||||||
defineEmits,
|
|
||||||
onMounted
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
isJsonArrayString
|
|
||||||
} from '@/utils/util.js';
|
|
||||||
|
|
||||||
const attractPopupRef = ref(null);
|
const attractPopupRef = ref(null);
|
||||||
|
|
||||||
const imgs = {
|
const imgs = {
|
||||||
recharge: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/2f22c0ced494497e8d6f981832b191c9.png',
|
recharge: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/2f22c0ced494497e8d6f981832b191c9.png',
|
||||||
share: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/bcb8d461e96d445ba40256079da775b3.png',
|
share: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/bcb8d461e96d445ba40256079da775b3.png',
|
||||||
vip: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/cfc3bf5ba12747c6ada4d5a388aceca3.png',
|
vip: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/cfc3bf5ba12747c6ada4d5a388aceca3.png',
|
||||||
orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/7c54a22d56f44813bf3f76c1a82a34f3.png',
|
orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/7c54a22d56f44813bf3f76c1a82a34f3.png',
|
||||||
big_orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b3c7f6139eff4a7d81482cf533ec79fa.png',
|
big_orderFood: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b3c7f6139eff4a7d81482cf533ec79fa.png',
|
||||||
takeout: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/3623cbf425d845a993acb4309404a7b9.png',
|
takeout: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/3623cbf425d845a993acb4309404a7b9.png',
|
||||||
groupBuying: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/117745e0f3db48b489f9d4e5c5967043.png',
|
groupBuying: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/117745e0f3db48b489f9d4e5c5967043.png',
|
||||||
points: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/df0758f7b86449f89f882e50226e17c7.png',
|
points: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/df0758f7b86449f89f882e50226e17c7.png',
|
||||||
code: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/044dcaf913054f03a9db7983f048b1e6.png',
|
code: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/044dcaf913054f03a9db7983f048b1e6.png',
|
||||||
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png',
|
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png',
|
||||||
taocan: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/1eb9aa9b865b47b39ab9d7ac404601a9.png'
|
taocan: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/1eb9aa9b865b47b39ab9d7ac404601a9.png'
|
||||||
};
|
};
|
||||||
// 定义接收的属性
|
// 定义接收的属性
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
shopExtend: {
|
shopExtend: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: []
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function toGroupBuying() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/groupBuying/index/index'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function toGroupBuying() {
|
function toFenxiao() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/groupBuying/index/index'
|
url: '/distribution/shop-detail/index?shopId=' + uni.cache.get('shopId')
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toFenxiao() {
|
function toIntegralMall() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/scoreShop/index/index?shopId=' + uni.cache.get('shopId')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
import { productStore } from '@/stores/user.js';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
// 显示弹窗
|
||||||
|
const popupShow = ref(false);
|
||||||
|
const scanCodehandle = (i) => {
|
||||||
|
popupShow.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 预点单
|
||||||
|
function beforehandOrderHandle() {
|
||||||
|
popupShow.value = false;
|
||||||
|
uni.cache.set('dinersNum', 1);
|
||||||
|
uni.cache.set('tableCode', shopUserInfo.id);
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/product/index?type=beforehand'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 扫码点餐
|
||||||
|
async function scanOrderHandle() {
|
||||||
|
popupShow.value = false;
|
||||||
|
const store = productStore();
|
||||||
|
await store.scanCodeactions();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toTaocan() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/userPackage/index/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const memberindex = (url) => {
|
||||||
|
uni.pro.navigateTo(url, {
|
||||||
|
shopId: uni.cache.get('shopId'),
|
||||||
|
type: 'index'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const shopUserInfo = reactive({});
|
||||||
|
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
|
||||||
|
|
||||||
|
function tomember() {
|
||||||
|
if (isMember.value) {
|
||||||
|
const shopId = uni.cache.get('shopId');
|
||||||
|
if (!shopUserInfo.isVip) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/user/vip/buy-vip?shopId=' + shopId
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/distribution/shop-detail/index?shopId=' + uni.cache.get('shopId')
|
url: '/user/vip/vip?shopId=' + shopId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '暂未开放',
|
||||||
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function toIntegralMall() {
|
function toCharge() {
|
||||||
|
if (isCharge.value) {
|
||||||
|
const shopId = uni.cache.get('shopId');
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/scoreShop/index/index?shopId=' + uni.cache.get('shopId')
|
url: '/pages/user/member/czzx?shopId=' + shopId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '暂未开放',
|
||||||
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
const getQueryString = (url, name) => {
|
||||||
|
//解码
|
||||||
|
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i');
|
||||||
|
var r = url.substr(1).match(reg);
|
||||||
|
if (r != null) {
|
||||||
|
return r[2];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
import {
|
// 获取会员配置
|
||||||
productStore
|
const isMember = ref(0);
|
||||||
} from '@/stores/user.js';
|
const isCharge = ref(0);
|
||||||
import {
|
async function getVipConfig() {
|
||||||
onShow
|
try {
|
||||||
} from '@dcloudio/uni-app';
|
const res1 = await getMemberConfig({
|
||||||
|
shopId: uni.cache.get('shopId')
|
||||||
// 显示弹窗
|
|
||||||
const popupShow = ref(false);
|
|
||||||
const scanCodehandle = (i) => {
|
|
||||||
popupShow.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 预点单
|
|
||||||
function beforehandOrderHandle() {
|
|
||||||
popupShow.value = false;
|
|
||||||
uni.cache.set('dinersNum', 1);
|
|
||||||
uni.cache.set('tableCode', shopUserInfo.id);
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/product/index?type=beforehand'
|
|
||||||
});
|
});
|
||||||
}
|
const res2 = await getRechargeConfig({
|
||||||
|
shopId: uni.cache.get('shopId')
|
||||||
// 扫码点餐
|
|
||||||
async function scanOrderHandle() {
|
|
||||||
popupShow.value = false;
|
|
||||||
const store = productStore();
|
|
||||||
await store.scanCodeactions();
|
|
||||||
}
|
|
||||||
|
|
||||||
function toTaocan() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/userPackage/index/index'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const memberindex = (url) => {
|
|
||||||
uni.pro.navigateTo(url, {
|
|
||||||
shopId: uni.cache.get('shopId'),
|
|
||||||
type: 'index'
|
|
||||||
});
|
});
|
||||||
};
|
|
||||||
const shopUserInfo = reactive({});
|
isMember.value = +res1.memberConfig.isOpen;
|
||||||
|
isCharge.value = +res2.isEnable;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const allConfig = reactive({
|
||||||
|
takeout: 0,
|
||||||
|
group: 0,
|
||||||
|
pointsMall: 0,
|
||||||
|
distribution: 0,
|
||||||
|
couponNum: 0,
|
||||||
|
pointNum: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
function getHomeData() {
|
||||||
|
homeData().then((res) => {
|
||||||
|
Object.assign(allConfig, res);
|
||||||
|
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
updateData();
|
||||||
|
});
|
||||||
|
|
||||||
|
function updateData() {
|
||||||
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
|
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
|
||||||
|
getVipConfig();
|
||||||
function tomember() {
|
getHomeData();
|
||||||
if (isMember.value) {
|
}
|
||||||
const shopId = uni.cache.get('shopId');
|
defineExpose({
|
||||||
if (!shopUserInfo.isVip) {
|
updateData
|
||||||
uni.navigateTo({
|
});
|
||||||
url: '/user/vip/buy-vip?shopId=' + shopId
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/user/vip/vip?shopId=' + shopId
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '暂未开放',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toCharge() {
|
|
||||||
if (isCharge.value) {
|
|
||||||
const shopId = uni.cache.get('shopId');
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/user/member/czzx?shopId=' + shopId
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '暂未开放',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const getQueryString = (url, name) => {
|
|
||||||
//解码
|
|
||||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i');
|
|
||||||
var r = url.substr(1).match(reg);
|
|
||||||
if (r != null) {
|
|
||||||
return r[2];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取会员配置
|
|
||||||
const isMember = ref(0);
|
|
||||||
const isCharge = ref(0);
|
|
||||||
async function getVipConfig() {
|
|
||||||
try {
|
|
||||||
const res1 = await getMemberConfig({
|
|
||||||
shopId: uni.cache.get('shopId')
|
|
||||||
});
|
|
||||||
const res2 = await getRechargeConfig({
|
|
||||||
shopId: uni.cache.get('shopId')
|
|
||||||
});
|
|
||||||
|
|
||||||
isMember.value = +res1.memberConfig.isOpen;
|
|
||||||
isCharge.value = +res2.isEnable;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const allConfig = reactive({
|
|
||||||
takeout: 0,
|
|
||||||
group: 0,
|
|
||||||
pointsMall: 0,
|
|
||||||
distribution: 0,
|
|
||||||
couponNum: 0,
|
|
||||||
pointNum: 0
|
|
||||||
});
|
|
||||||
|
|
||||||
function getHomeData() {
|
|
||||||
homeData().then((res) => {
|
|
||||||
Object.assign(allConfig, res);
|
|
||||||
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar
|
|
||||||
});
|
|
||||||
}
|
|
||||||
onMounted(() => {
|
|
||||||
updateData();
|
|
||||||
});
|
|
||||||
|
|
||||||
function updateData() {
|
|
||||||
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
|
|
||||||
getVipConfig();
|
|
||||||
getHomeData();
|
|
||||||
}
|
|
||||||
defineExpose({
|
|
||||||
updateData
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
page {
|
page {
|
||||||
background: #f6f8fa;
|
background: #f6f8fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.swiper-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.swiper-item {
|
.swiper-bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.swiper-bg {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
.contentbox {
|
.contentbox {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 430rpx;
|
||||||
|
|
||||||
|
.bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 430rpx;
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
.bg {
|
.contentboxitem {
|
||||||
width: 100%;
|
position: absolute;
|
||||||
height: 100%;
|
bottom: 0;
|
||||||
position: absolute;
|
width: 90%;
|
||||||
top: 0;
|
left: 50%;
|
||||||
left: 0;
|
transform: translate(-50%, 50%);
|
||||||
z-index: -1;
|
padding: 38rpx 0 26rpx 0;
|
||||||
}
|
background: rgba(255, 255, 255, 0.98);
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
|
|
||||||
.contentboxitem {
|
.contentboxitemleft {
|
||||||
position: absolute;
|
width: 50%;
|
||||||
bottom: 0;
|
border-right: 2rpx solid #623618;
|
||||||
width: 90%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 50%);
|
|
||||||
padding: 38rpx 0 26rpx 0;
|
|
||||||
background: rgba(255, 255, 255, 0.98);
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
||||||
|
|
||||||
.contentboxitemleft {
|
image {
|
||||||
width: 50%;
|
width: 134rpx;
|
||||||
border-right: 2rpx solid #623618;
|
height: 134rpx;
|
||||||
|
|
||||||
image {
|
|
||||||
width: 134rpx;
|
|
||||||
height: 134rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentboxitemlefttextone {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentboxitemlefttexttow {
|
|
||||||
margin-top: 2rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentboxitemright {
|
.contentboxitemlefttextone {
|
||||||
width: 50%;
|
margin-top: 10rpx;
|
||||||
padding: 0 34rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
.contentboxitemright_item:nth-child(2) {
|
.contentboxitemlefttexttow {
|
||||||
margin-top: 30rpx;
|
margin-top: 2rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentboxitemright {
|
||||||
|
width: 50%;
|
||||||
|
padding: 0 34rpx;
|
||||||
|
|
||||||
|
.contentboxitemright_item:nth-child(2) {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentboxitemright_item {
|
||||||
|
image {
|
||||||
|
width: 96rpx;
|
||||||
|
height: 96rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentboxitemright_item {
|
.contentboxitemright_itembox {
|
||||||
image {
|
width: 170rpx;
|
||||||
width: 96rpx;
|
|
||||||
height: 96rpx;
|
text:nth-child(1) {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentboxitemright_itembox {
|
text:nth-child(2) {
|
||||||
width: 170rpx;
|
margin-top: 2rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
text:nth-child(1) {
|
font-weight: 400;
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-size: 24rpx;
|
||||||
font-weight: 400;
|
color: #999999;
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
text:nth-child(2) {
|
|
||||||
margin-top: 2rpx;
|
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.popup-content {
|
.popup-content {
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
.header-wrap {
|
.header-wrap {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid #ececec;
|
border-bottom: 1px solid #ececec;
|
||||||
padding: 0 28upx;
|
padding: 0 28upx;
|
||||||
|
|
||||||
.t {
|
.t {
|
||||||
font-size: 32upx;
|
font-size: 32upx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
|
||||||
|
|
||||||
.close {
|
|
||||||
$size: 60upx;
|
|
||||||
width: $size;
|
|
||||||
height: $size;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-content {
|
.close {
|
||||||
height: 86px;
|
$size: 60upx;
|
||||||
|
width: $size;
|
||||||
|
height: $size;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 60upx;
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 248upx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.menus {
|
.btn-content {
|
||||||
|
height: 86px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 32rpx 40rpx;
|
|
||||||
margin-top: 150rpx;
|
|
||||||
gap: 20rpx;
|
|
||||||
|
|
||||||
.menu-item {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
text-align: center;
|
|
||||||
padding: 32rpx 28rpx;
|
|
||||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.userInfo {
|
|
||||||
display: flex;
|
|
||||||
padding: 22rpx 24rpx;
|
|
||||||
margin: 0 4rpx;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-self: stretch;
|
justify-content: center;
|
||||||
border-radius: 24rpx;
|
gap: 60upx;
|
||||||
background: #fff;
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
margin-top: -36rpx;
|
|
||||||
|
|
||||||
.vip {
|
.btn {
|
||||||
background: #fa720a;
|
width: 248upx;
|
||||||
font-size: 24rpx;
|
|
||||||
color: #ffffff;
|
|
||||||
padding: 6rpx 10rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
border-radius: 20rpx 20rpx 20rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code {
|
|
||||||
width: 33px;
|
|
||||||
height: 33px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.new-menus-box {
|
.menus {
|
||||||
margin: 0 16rpx 0 16rpx;
|
display: flex;
|
||||||
|
padding: 32rpx 40rpx;
|
||||||
|
margin-top: 150rpx;
|
||||||
|
gap: 20rpx;
|
||||||
|
|
||||||
.new-menus {
|
.menu-item {
|
||||||
display: flex;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 79px;
|
|
||||||
height: 79px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.layout2 {
|
|
||||||
padding: 29px 0;
|
|
||||||
|
|
||||||
.diner,
|
|
||||||
.takeout {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
width: 2rpx;
|
|
||||||
height: 156rpx;
|
|
||||||
background: #ededed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.takeout {}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.layout1 {
|
|
||||||
padding: 36rpx 40rpx;
|
|
||||||
justify-content: space-between;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.big_img {
|
|
||||||
width: 330rpx;
|
|
||||||
height: 330rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 48rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
|
||||||
margin-top: 20rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.groupBuying {
|
|
||||||
padding: 16rpx 38rpx;
|
|
||||||
border-top: 2rpx solid #ededed;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.img {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
|
||||||
margin-top: 16rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.points {
|
|
||||||
margin-top: 10px;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 16rpx 68rpx;
|
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.userInfo {
|
||||||
|
display: flex;
|
||||||
|
padding: 22rpx 24rpx;
|
||||||
|
margin: 0 4rpx;
|
||||||
|
align-items: center;
|
||||||
|
align-self: stretch;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
z-index: 99;
|
||||||
|
margin-top: -36rpx;
|
||||||
|
|
||||||
|
.vip {
|
||||||
|
background: #fa720a;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 6rpx 10rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
border-radius: 20rpx 20rpx 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
width: 33px;
|
||||||
|
height: 33px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.new-menus-box {
|
||||||
|
margin: 0 16rpx 0 16rpx;
|
||||||
|
|
||||||
|
.new-menus {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.img {
|
.icon {
|
||||||
width: 98px;
|
width: 79px;
|
||||||
height: 98px;
|
height: 79px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.taocan {
|
&.layout2 {
|
||||||
.img {
|
padding: 29px 0;
|
||||||
width: 117px;
|
|
||||||
height: 117px;
|
.diner,
|
||||||
|
.takeout {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 2rpx;
|
||||||
|
height: 156rpx;
|
||||||
|
background: #ededed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.takeout {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.bottom_menus {
|
&.layout1 {
|
||||||
display: flex;
|
padding: 36rpx 40rpx;
|
||||||
gap: 14rpx;
|
justify-content: space-between;
|
||||||
margin-top: 10px;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20rpx;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 18rpx;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
.img {
|
.big_img {
|
||||||
width: 39px;
|
width: 330rpx;
|
||||||
height: 39px;
|
height: 330rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 32rpx;
|
font-size: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
margin-top: 8rpx;
|
margin-top: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 24rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
}
|
||||||
|
|
||||||
|
.groupBuying {
|
||||||
|
padding: 16rpx 38rpx;
|
||||||
|
border-top: 2rpx solid #ededed;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
margin-top: 16rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 16rpx 68rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 98px;
|
||||||
|
height: 98px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.taocan {
|
||||||
|
.img {
|
||||||
|
width: 117px;
|
||||||
|
height: 117px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom_menus {
|
||||||
|
display: flex;
|
||||||
|
gap: 14rpx;
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 39px;
|
||||||
|
height: 39px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -7,14 +7,21 @@
|
|||||||
<view class="limitDiscount" v-if="showLimitDiscount(item)"
|
<view class="limitDiscount" v-if="showLimitDiscount(item)"
|
||||||
>限时折扣</view
|
>限时折扣</view
|
||||||
>
|
>
|
||||||
|
|
||||||
<up-image
|
<up-image
|
||||||
width="76"
|
width="76"
|
||||||
height="76"
|
height="76"
|
||||||
radius="6"
|
radius="6"
|
||||||
:src="item.productImg"
|
:src="item.productImg"
|
||||||
v-if="item.productId != -999"
|
v-if="item.isTemporary != 1&&item.is_temporary!=1"
|
||||||
></up-image>
|
></up-image>
|
||||||
|
<up-image
|
||||||
|
v-else-if="(item.isTemporary||item.is_temporary) &&(item.product_name=='签子'||item.productName=='签子')"
|
||||||
|
width="76"
|
||||||
|
height="76"
|
||||||
|
radius="6"
|
||||||
|
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
|
||||||
|
mode="heightFix"
|
||||||
|
></up-image>
|
||||||
<up-image
|
<up-image
|
||||||
width="76"
|
width="76"
|
||||||
height="76"
|
height="76"
|
||||||
@@ -25,7 +32,7 @@
|
|||||||
></up-image>
|
></up-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="productName">{{ item.productName }}</text>
|
<text class="productName">{{ item.productName||item.product_name }}</text>
|
||||||
<text class="productSkuName" v-if="item.skuName">{{
|
<text class="productSkuName" v-if="item.skuName">{{
|
||||||
item.skuName
|
item.skuName
|
||||||
}}</text>
|
}}</text>
|
||||||
@@ -55,18 +62,22 @@
|
|||||||
<view class="price">
|
<view class="price">
|
||||||
<view class="priceAmount">
|
<view class="priceAmount">
|
||||||
¥
|
¥
|
||||||
|
|
||||||
<goodsPrice
|
<goodsPrice
|
||||||
|
v-if="!item.is_temporary&&!item.isTemporary"
|
||||||
:cart="item"
|
:cart="item"
|
||||||
:limitDiscount="limitDiscount"
|
:limitDiscount="limitDiscount"
|
||||||
:shopUserInfo="shopUserInfo"
|
:shopUserInfo="shopUserInfo"
|
||||||
:shopInfo="shopInfo"
|
:shopInfo="shopInfo"
|
||||||
idKey="product_id"
|
idKey="product_id"
|
||||||
></goodsPrice>
|
></goodsPrice>
|
||||||
|
<text v-else>{{item.discount_sale_amount}}</text>
|
||||||
<view class="old-price" v-if="showLimitDiscount(item)"
|
<view class="old-price" v-if="showLimitDiscount(item)"
|
||||||
>¥{{ item.salePrice }}</view
|
>¥{{ item.salePrice }}</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="num">x{{ item.num }}</view>
|
<view class="num" v-if="!item.is_temporary&&!item.isTemporary">x{{ item.num }}</view>
|
||||||
|
<view class="num" v-else>x{{ item.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -40,9 +40,19 @@
|
|||||||
:nowCarts="nowCarts"
|
:nowCarts="nowCarts"
|
||||||
:limitDiscount="cartStore.limitTimeDiscount"
|
:limitDiscount="cartStore.limitTimeDiscount"
|
||||||
></orderItemVue> -->
|
></orderItemVue> -->
|
||||||
<orderItemVue :useVipPrice="useVipPrice" v-if="cartStore.allGoods.length" :nowCarts="cartStore.allGoods"
|
<orderItemVue :useVipPrice="useVipPrice" v-if="nowCarts" :nowCarts="nowCarts"
|
||||||
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
|
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
|
||||||
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
|
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
|
||||||
|
|
||||||
|
<view class="u-flex u-row-center u-m-t-16 u-font-28" v-if="cartStore.allGoods.length>4">
|
||||||
|
<view class="u-flex u-col-baseline" @click="showAllGoods=!showAllGoods">
|
||||||
|
<text>{{showAllGoods?'收起':'展开'}}</text>
|
||||||
|
<view class="guodu u-m-l-10 u-m-t-2" :class="{rotate:!showAllGoods}">
|
||||||
|
<up-icon name="arrow-down" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
<template v-if="listinfo.id&&listinfo.status=='done'">
|
<template v-if="listinfo.id&&listinfo.status=='done'">
|
||||||
<view class="cell-item" v-if="is_type != 0">
|
<view class="cell-item" v-if="is_type != 0">
|
||||||
@@ -328,7 +338,9 @@
|
|||||||
import {
|
import {
|
||||||
BigNumber
|
BigNumber
|
||||||
} from "bignumber.js";
|
} from "bignumber.js";
|
||||||
|
|
||||||
|
|
||||||
|
const showAllGoods=ref(false)
|
||||||
let hasCouponCanUse = ref(false);
|
let hasCouponCanUse = ref(false);
|
||||||
|
|
||||||
const usePoints = ref(false);
|
const usePoints = ref(false);
|
||||||
@@ -852,6 +864,16 @@
|
|||||||
await getConsumeDiscount();
|
await getConsumeDiscount();
|
||||||
getDiscountActivity();
|
getDiscountActivity();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const nowCarts=computed(()=>{
|
||||||
|
if(cartStore.allGoods.length<=0){
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
if(showAllGoods.value){
|
||||||
|
return cartStore.allGoods
|
||||||
|
}
|
||||||
|
return cartStore.allGoods.slice(0,4)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -1587,4 +1609,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.guodu{
|
||||||
|
transition:all .3s linear;
|
||||||
|
padding-top: 2rpx;
|
||||||
|
}
|
||||||
|
.rotate{
|
||||||
|
transform: rotate(-90deg);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -70,7 +70,10 @@
|
|||||||
<view class="item" v-for="item in value" :key="item.id">
|
<view class="item" v-for="item in value" :key="item.id">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<up-image width="76" height="76" radius="16" :src="item.productImg"
|
<up-image width="76" height="76" radius="16" :src="item.productImg"
|
||||||
v-if="item.productId!=-999"></up-image>
|
v-if="!item.isTemporary"></up-image>
|
||||||
|
<u-image width="56" height="56" radius="10"
|
||||||
|
v-else-if="item.isTemporary &&item.productName=='签子'"
|
||||||
|
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"></u-image>
|
||||||
<up-image width="76" height="76" radius="16"
|
<up-image width="76" height="76" radius="16"
|
||||||
: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'"
|
||||||
mode="heightFix" v-else></up-image>
|
mode="heightFix" v-else></up-image>
|
||||||
@@ -174,8 +177,8 @@
|
|||||||
<view>{{listinfo.packFeess}}</view>
|
<view>{{listinfo.packFeess}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- isTableFee == 0是不免除 -->
|
<!-- isTableFee == 0是不免除 -->
|
||||||
<view class="cell-item"
|
<view class="cell-item"
|
||||||
v-if="ordershopUserInfo.isTableFee == 0 && is_type == 0 && listinfo.Seatcharge != 0">
|
v-if="ordershopUserInfo.isTableFee == 0 && is_type == 0 && listinfo.Seatcharge != 0">
|
||||||
@@ -198,7 +201,7 @@
|
|||||||
<text class="price"> {{listinfo.payAmount}} </text>
|
<text class="price"> {{listinfo.payAmount}} </text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@
|
|||||||
</rechargeFree>
|
</rechargeFree>
|
||||||
|
|
||||||
<!-- 支付方式 -->
|
<!-- 支付方式 -->
|
||||||
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange"
|
<paymentMethodes ref="paymentMethodref" :shopUserInfo="orderVIP" @groupChange="groupChange"
|
||||||
:disablePayType="disablePayType" :changeFreeenable="isBwc" v-model="paymentmethod"
|
:disablePayType="disablePayType" :changeFreeenable="isBwc" v-model="paymentmethod"
|
||||||
v-if="listinfo.status == 'unpaid' || !listinfo.id">
|
v-if="listinfo.status == 'unpaid' || !listinfo.id">
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
@@ -203,6 +203,7 @@
|
|||||||
useWebSocket
|
useWebSocket
|
||||||
} from "@/stores/carts-websocket.js";
|
} from "@/stores/carts-websocket.js";
|
||||||
import * as chatApi from "@/http/php/chat";
|
import * as chatApi from "@/http/php/chat";
|
||||||
|
import * as rechargeApi from '@/common/api/market/recharge.js'
|
||||||
|
|
||||||
import MsgListItem from '@/components/msg-list-item/msg-list-item.vue'
|
import MsgListItem from '@/components/msg-list-item/msg-list-item.vue'
|
||||||
|
|
||||||
@@ -576,7 +577,7 @@
|
|||||||
name: "微信支付",
|
name: "微信支付",
|
||||||
type: 2,
|
type: 2,
|
||||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
||||||
payType: "wechatPay",
|
payType: "WECHAT",
|
||||||
};
|
};
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
@@ -858,8 +859,6 @@
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
const shopUserInfo = uni.cache.get("shopUserInfo");
|
const shopUserInfo = uni.cache.get("shopUserInfo");
|
||||||
console.log("shopUserInfo", shopUserInfo);
|
|
||||||
console.log("listinfo", listinfo);
|
|
||||||
if (shopUserInfo) {
|
if (shopUserInfo) {
|
||||||
if (shopUserInfo.userId == listinfo.userId) {
|
if (shopUserInfo.userId == listinfo.userId) {
|
||||||
pay_unlock();
|
pay_unlock();
|
||||||
@@ -1011,7 +1010,6 @@
|
|||||||
// 更新数据
|
// 更新数据
|
||||||
if (orderVIP.value) {
|
if (orderVIP.value) {
|
||||||
orderVIP.value = uni.cache.get("orderVIP");
|
orderVIP.value = uni.cache.get("orderVIP");
|
||||||
paymentMethodref.value.orderVIPfun(uni.cache.get("orderVIP"));
|
|
||||||
if (listinfo.id && ordershopUserInfo.value.registerType != "before") {
|
if (listinfo.id && ordershopUserInfo.value.registerType != "before") {
|
||||||
orderorderInfo();
|
orderorderInfo();
|
||||||
}
|
}
|
||||||
@@ -1034,7 +1032,7 @@
|
|||||||
console.log("跳转到加菜页面");
|
console.log("跳转到加菜页面");
|
||||||
const arr= getCurrentPages()
|
const arr= getCurrentPages()
|
||||||
console.log(arr);
|
console.log(arr);
|
||||||
if(arr[arr.length-1]&&arr[arr.length-1].route=='pages/product/index'){
|
if(arr.length>=2&&arr[arr.length-2]&&arr[arr.length-2].route=='pages/product/index'){
|
||||||
back();
|
back();
|
||||||
}else{
|
}else{
|
||||||
uni.cache.set('tableCode',listinfo.tableCode)
|
uni.cache.set('tableCode',listinfo.tableCode)
|
||||||
@@ -1113,10 +1111,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const limitTimeDiscountRes = ref(null)
|
const limitTimeDiscountRes = ref(null)
|
||||||
|
const rechargeConfig=ref(null)
|
||||||
async function init(opt) {
|
async function init(opt) {
|
||||||
await storeuser.actionsproductqueryProduct();
|
const res1= await storeuser.actionsproductqueryProduct();
|
||||||
|
orderVIP.value=res1
|
||||||
console.log("init");
|
console.log('orderVIP',orderVIP.value)
|
||||||
cartStore.clearOrderConfig();
|
cartStore.clearOrderConfig();
|
||||||
Object.assign(options, opt);
|
Object.assign(options, opt);
|
||||||
listinfo.id = options.orderId;
|
listinfo.id = options.orderId;
|
||||||
@@ -1146,10 +1145,23 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取台桌信息
|
||||||
|
let tableRes = await getTableInfo({
|
||||||
|
tableCode: options.tableCode || "",
|
||||||
|
});
|
||||||
|
console.log("tableRes", tableRes);
|
||||||
|
listinfo.tableName = tableRes?tableRes.name:'';
|
||||||
|
|
||||||
//获取店铺信息
|
//获取店铺信息
|
||||||
const shopInfoRes = await APIusershopInfodetail({
|
const shopInfoRes = await APIusershopInfodetail({
|
||||||
shopId: options.shopId,
|
shopId: options.shopId,
|
||||||
});
|
});
|
||||||
|
//智慧充值
|
||||||
|
const rechargeConfigRes=await rechargeApi.config({shopId: options.shopId})
|
||||||
|
if(rechargeConfigRes&&typeof rechargeConfigRes ==='object'){
|
||||||
|
rechargeConfig.value=rechargeConfigRes
|
||||||
|
}
|
||||||
//获取积分配置
|
//获取积分配置
|
||||||
pointsApi.pointsConfig().then(res => {
|
pointsApi.pointsConfig().then(res => {
|
||||||
cartStore.setPointDeductionRule(res);
|
cartStore.setPointDeductionRule(res);
|
||||||
@@ -1274,6 +1286,9 @@
|
|||||||
if (!isCanUseCharge.value) {
|
if (!isCanUseCharge.value) {
|
||||||
arr.add("余额支付");
|
arr.add("余额支付");
|
||||||
}
|
}
|
||||||
|
if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
|
||||||
|
arr.add("余额支付");
|
||||||
|
}
|
||||||
|
|
||||||
return Array.from(arr);
|
return Array.from(arr);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -316,7 +316,7 @@
|
|||||||
const paymentmethod = reactive({
|
const paymentmethod = reactive({
|
||||||
radiovalue: 2,
|
radiovalue: 2,
|
||||||
paymentBtnText: "微信支付",
|
paymentBtnText: "微信支付",
|
||||||
payType: 'wechatPay'
|
payType: 'WECHAT'
|
||||||
})
|
})
|
||||||
|
|
||||||
const groupChange = async (e) => {
|
const groupChange = async (e) => {
|
||||||
@@ -583,7 +583,6 @@
|
|||||||
console.log(uni.cache.get('orderVIP'))
|
console.log(uni.cache.get('orderVIP'))
|
||||||
orderVIP.value = uni.cache.get('orderVIP')
|
orderVIP.value = uni.cache.get('orderVIP')
|
||||||
ordershopUserInfo.value = orderVIP.value.shopInfo
|
ordershopUserInfo.value = orderVIP.value.shopInfo
|
||||||
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
|
|
||||||
if (orderId.value) {
|
if (orderId.value) {
|
||||||
orderorderInfo()
|
orderorderInfo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,8 +62,14 @@
|
|||||||
<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="56" height="56" radius="10" :src='item1.productImg'
|
|
||||||
v-if="item1.productId!=-999"></u-image>
|
<u-image width="56" height="56" radius="10" :src="item1.productImg"
|
||||||
|
v-if="!item1.isTemporary"></u-image>
|
||||||
|
|
||||||
|
<u-image width="56" height="56" radius="10"
|
||||||
|
v-else-if="item1.isTemporary &&item1.productName=='签子'"
|
||||||
|
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
|
||||||
|
></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'"
|
||||||
mode="heightFix" v-else></u-image>
|
mode="heightFix" v-else></u-image>
|
||||||
@@ -130,32 +136,37 @@
|
|||||||
import {
|
import {
|
||||||
useNavbarStore
|
useNavbarStore
|
||||||
} from '@/stores/navbarStore';
|
} from '@/stores/navbarStore';
|
||||||
import {APIshopUserInfo} from '@/common/api/member.js'
|
import {
|
||||||
|
APIshopUserInfo
|
||||||
|
} from '@/common/api/member.js'
|
||||||
const store = useNavbarStore();
|
const store = useNavbarStore();
|
||||||
|
|
||||||
async function agignOrder(item){
|
async function agignOrder(item) {
|
||||||
await APIshopUserInfo({
|
await APIshopUserInfo({
|
||||||
shopId:item.shopId
|
shopId: item.shopId
|
||||||
}).then(shopUserInfo=>{
|
}).then(shopUserInfo => {
|
||||||
if(shopUserInfo){
|
if (shopUserInfo) {
|
||||||
uni.cache.set("dinersNum", 1);
|
uni.cache.set("dinersNum", 1);
|
||||||
uni.cache.set("tableCode", shopUserInfo.id);
|
uni.cache.set("tableCode", shopUserInfo.id);
|
||||||
uni.cache.set("shopId", item.shopId);
|
uni.cache.set("shopId", item.shopId);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/product/index?type=beforehand&order_id="+item.id+'&one_more_order=1',
|
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
|
||||||
|
'&one_more_order=1',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
function totalGoodsNum(arr){
|
|
||||||
if(!arr){
|
function totalGoodsNum(arr) {
|
||||||
|
if (!arr) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
return arr.reduce((prve,cur)=>{
|
return arr.reduce((prve, cur) => {
|
||||||
return prve+cur.num
|
return prve + cur.num
|
||||||
},0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRemoveOrder(item) {
|
function isRemoveOrder(item) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -578,7 +589,8 @@
|
|||||||
.ml-20 {
|
.ml-20 {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
.take_food_number{
|
|
||||||
|
.take_food_number {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
margin-left: 36rpx;
|
margin-left: 36rpx;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -26,17 +26,18 @@
|
|||||||
<view class="limit-discount" v-if="showLimitDiscount(item)">
|
<view class="limit-discount" v-if="showLimitDiscount(item)">
|
||||||
限时折扣
|
限时折扣
|
||||||
</view>
|
</view>
|
||||||
<up-image :src="item.coverImg" width="124rpx" height="124rpx" mode="aspectFill"
|
<up-image v-if="!item.cartListinfo.is_temporary" :src="item.coverImg" width="124rpx" height="124rpx" mode="aspectFill"
|
||||||
radius="10"></up-image>
|
radius="10"></up-image>
|
||||||
|
<up-image v-else-if="item.cartListinfo.is_temporary&&item.cartListinfo.product_name=='签子'" src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png" width="124rpx" height="124rpx" mode="aspectFill"
|
||||||
|
radius="10"></up-image>
|
||||||
|
<up-image v-else width="124rpx" height="124rpx" mode="aspectFill"
|
||||||
|
radius="10"></up-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name">
|
<view class="name" v-if=" item.cartListinfo.is_temporary == 1">
|
||||||
{{
|
{{item.cartListinfo.product_name||item.cartListinfo.name|| item.name}}
|
||||||
item.cartListinfo.is_temporary == 1
|
|
||||||
? "临时菜"
|
|
||||||
: item.name
|
|
||||||
}}
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="name" v-else>{{item.name}}</view>
|
||||||
<view class="select-sku-wrap" v-if="item.type == 'sku'">
|
<view class="select-sku-wrap" v-if="item.type == 'sku'">
|
||||||
<text v-for="i in item.skuList" :key="i.id">
|
<text v-for="i in item.skuList" :key="i.id">
|
||||||
{{ item.cartListinfo.sku_id == i.id ? i.name : "" }}
|
{{ item.cartListinfo.sku_id == i.id ? i.name : "" }}
|
||||||
@@ -206,9 +207,6 @@
|
|||||||
limitDiscount: props.limitDiscount.id ? props.limitDiscount : null,
|
limitDiscount: props.limitDiscount.id ? props.limitDiscount : null,
|
||||||
shopUserInfo: shopUserInfo,
|
shopUserInfo: shopUserInfo,
|
||||||
});
|
});
|
||||||
if (goods.name == "纯生纯生纯生") {
|
|
||||||
console.log("returnRealPrice", price);
|
|
||||||
}
|
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<view class="relative">
|
<view class="relative">
|
||||||
<image @click.stop="getProductImgs(item)" class="panelfiveitemimage" :src="item.coverImg"
|
<image @click.stop="getProductImgs(item)" class="panelfiveitemimage"
|
||||||
mode="aspectFill"></image>
|
:src="item.coverImg" mode="aspectFill"></image>
|
||||||
<view class="limitDiscount" v-if="showLimitDiscount(item)">
|
<view class="limitDiscount" v-if="showLimitDiscount(item)">
|
||||||
限时折扣{{ limitDiscountCountdown }}</view>
|
限时折扣{{ limitDiscountCountdown }}</view>
|
||||||
<!-- <view class="limitDiscount" v-if="item.is_time_discount">
|
<!-- <view class="limitDiscount" v-if="item.is_time_discount">
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
:class="shopInfo.isVip == 0 || shopInfo.isMemberPrice == 0 ? 'lineThrough' : ''">¥</text>
|
:class="shopInfo.isVip == 0 || shopInfo.isMemberPrice == 0 ? 'lineThrough' : ''">¥</text>
|
||||||
<!-- 会员价与价格 -->
|
<!-- 会员价与价格 -->
|
||||||
<text class="price">
|
<text class="price">
|
||||||
{{ shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? item.memberPrice || item.salePrice : item.salePrice }}
|
{{ shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1 ? item.memberPrice || item.salePrice : item.salePrice }}
|
||||||
</text>
|
</text>
|
||||||
<!-- 单位 -->
|
<!-- 单位 -->
|
||||||
<text class="unit" v-if="item.unitName">/{{ item.unitName }}</text>
|
<text class="unit" v-if="item.unitName">/{{ item.unitName }}</text>
|
||||||
@@ -148,8 +148,10 @@
|
|||||||
@click.stop="clickspecifications(item, index, index1)">
|
@click.stop="clickspecifications(item, index, index1)">
|
||||||
<text class="t no-wrap" v-if="item.groupType == '1'">选择套餐</text>
|
<text class="t no-wrap" v-if="item.groupType == '1'">选择套餐</text>
|
||||||
<text class="t" v-else>选规格</text>
|
<text class="t" v-else>选规格</text>
|
||||||
|
<!-- <text class="dot num"
|
||||||
|
v-if="item.cartNumber > 0">{{ ifcartNumber(item) < 99 ? ifcartNumber(item) : '99+' }}</text> -->
|
||||||
<text class="dot num"
|
<text class="dot num"
|
||||||
v-if="item.cartNumber > 0">{{ ifcartNumber(item) < 99 ? ifcartNumber(item) : '99+' }}</text>
|
v-if="returnGoodsImCartNum(item)">{{ returnGoodsImCartNum(item) < 99 ? returnGoodsImCartNum(item) : '99+' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Controls" v-else>
|
<view class="Controls" v-else>
|
||||||
<view class="btn" v-if="item.cartNumber != '0'">
|
<view class="btn" v-if="item.cartNumber != '0'">
|
||||||
@@ -158,7 +160,9 @@
|
|||||||
<!-- <view class="btnClick"
|
<!-- <view class="btnClick"
|
||||||
@tap.stop="$u.throttle(() => singleclick(item, '-'), 500)"></view> -->
|
@tap.stop="$u.throttle(() => singleclick(item, '-'), 500)"></view> -->
|
||||||
</view>
|
</view>
|
||||||
<text class="num">{{ ifcartNumber(item) }}</text>
|
<!-- <text class="num">{{ ifcartNumber(item) }}</text> -->
|
||||||
|
<text class="dot num"
|
||||||
|
v-if="returnGoodsImCartNum(item)">{{ returnGoodsImCartNum(item) < 99 ? returnGoodsImCartNum(item) : '99+' }}</text>
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||||
<!-- <view class="btnClick"
|
<!-- <view class="btnClick"
|
||||||
@@ -197,8 +201,8 @@
|
|||||||
<view class="goods" @click="clickspecifications(item1, index, index1)"
|
<view class="goods" @click="clickspecifications(item1, index, index1)"
|
||||||
v-for="(item1, index1) in item.productList" :key="item1.id">
|
v-for="(item1, index1) in item.productList" :key="item1.id">
|
||||||
<view class="relative">
|
<view class="relative">
|
||||||
<image class="goodsImg" @click.stop="getProductImgs(item1)" v-if="item1.coverImg != null"
|
<image class="goodsImg" @click.stop="getProductImgs(item1)"
|
||||||
:lazy-load="true"
|
v-if="item1.coverImg != null" :lazy-load="true"
|
||||||
:src="`${item1.coverImg}${!item1.imgLoad ? '?x-oss-process=image/resize,m_lfit,w_150,h_150' : ''}`"
|
:src="`${item1.coverImg}${!item1.imgLoad ? '?x-oss-process=image/resize,m_lfit,w_150,h_150' : ''}`"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
<image class="goodsImg"
|
<image class="goodsImg"
|
||||||
@@ -252,7 +256,7 @@
|
|||||||
<view class="money">
|
<view class="money">
|
||||||
<view>¥</view>
|
<view>¥</view>
|
||||||
<text class="money_num" style="margin-right: 10rpx">
|
<text class="money_num" style="margin-right: 10rpx">
|
||||||
{{ shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? item1.memberPrice || item1.salePrice : item1.salePrice }}
|
{{ shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1 ? item1.memberPrice || item1.salePrice : item1.salePrice }}
|
||||||
</text>
|
</text>
|
||||||
<text v-if="item1.unitName">/{{ item1.unitName }}</text>
|
<text v-if="item1.unitName">/{{ item1.unitName }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -288,8 +292,11 @@
|
|||||||
@click.stop="clickspecifications(item1, index, index1)">
|
@click.stop="clickspecifications(item1, index, index1)">
|
||||||
<text class="t no-wrap" v-if="item1.groupType == '1'">选择套餐</text>
|
<text class="t no-wrap" v-if="item1.groupType == '1'">选择套餐</text>
|
||||||
<text class="t" v-else>选规格</text>
|
<text class="t" v-else>选规格</text>
|
||||||
|
<!-- <text class="dot num"
|
||||||
|
v-if="item1.cartNumber > 0">{{ ifcartNumber(item1) < 99 ? ifcartNumber(item1) : '99+' }}</text> -->
|
||||||
|
|
||||||
<text class="dot num"
|
<text class="dot num"
|
||||||
v-if="item1.cartNumber > 0">{{ ifcartNumber(item1) < 99 ? ifcartNumber(item1) : '99+' }}</text>
|
v-if="returnGoodsImCartNum(item1)">{{ returnGoodsImCartNum(item1) < 99 ? returnGoodsImCartNum(item1) : '99+' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="Controls" v-else>
|
<view class="Controls" v-else>
|
||||||
@@ -437,9 +444,39 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 推荐搭配 -->
|
||||||
|
<view class="u-m-t-48 u-p-30">
|
||||||
|
<view class="font-bold u-font-32 ">推荐搭配</view>
|
||||||
|
<view class="u-flex recommand-goods">
|
||||||
|
<view class=" item" v-for="(item,index) in 6" :key="index">
|
||||||
|
<up-image width="210rpx" height="210rpx" radius="12rpx"></up-image>
|
||||||
|
<view class="info">
|
||||||
|
<view class="u-line-2 name u-m-t-10 u-font-32 font-500">
|
||||||
|
商品名
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<view class="font-bold">
|
||||||
|
<text class="u-font-24">¥</text>
|
||||||
|
<text class="u-font-32">40</text>
|
||||||
|
</view>
|
||||||
|
<view class="btn">
|
||||||
|
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- 占位 -->
|
<!-- 占位 -->
|
||||||
<view style="height: 42rpx;"></view>
|
|
||||||
<view class="shop_bottom">
|
<view class="shop_bottom">
|
||||||
<view class="flex-between">
|
<view class="flex-between">
|
||||||
<view class="price price-sku"
|
<view class="price price-sku"
|
||||||
@@ -453,7 +490,7 @@
|
|||||||
|
|
||||||
<text class="num" v-if="false">
|
<text class="num" v-if="false">
|
||||||
{{
|
{{
|
||||||
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
|
||||||
? specifications.item.result.memberPrice || specifications.item.result.salePrice
|
? specifications.item.result.memberPrice || specifications.item.result.salePrice
|
||||||
: specifications.item.result.salePrice
|
: specifications.item.result.salePrice
|
||||||
}}
|
}}
|
||||||
@@ -471,7 +508,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="num" v-if="false">
|
<text class="num" v-if="false">
|
||||||
{{
|
{{
|
||||||
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
|
||||||
? specifications.item.memberPrice || specifications.item.salePrice
|
? specifications.item.memberPrice || specifications.item.salePrice
|
||||||
: specifications.item.salePrice
|
: specifications.item.salePrice
|
||||||
}}
|
}}
|
||||||
@@ -536,7 +573,17 @@
|
|||||||
<Loading :isLoading="!useSocket.isConnected" />
|
<Loading :isLoading="!useSocket.isConnected" />
|
||||||
<ModalList></ModalList>
|
<ModalList></ModalList>
|
||||||
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
||||||
<goodsModal></goodsModal>
|
|
||||||
|
<view
|
||||||
|
v-for="(item,index) in goodsModalList" :key="index"
|
||||||
|
>
|
||||||
|
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs" @close="goodsModalClose(index)"
|
||||||
|
@websocketsendMessage="websocketsendMessage"
|
||||||
|
@modalAdd="modalAdd"
|
||||||
|
:GoodsIDInCartNumMap="GoodsIDInCartNumMap"
|
||||||
|
></goodsModal>
|
||||||
|
</view>
|
||||||
|
|
||||||
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
||||||
</xbSwiperPreview>
|
</xbSwiperPreview>
|
||||||
<!-- 显示选择人数popup -->
|
<!-- 显示选择人数popup -->
|
||||||
@@ -594,7 +641,8 @@
|
|||||||
productminiApphotsquery,
|
productminiApphotsquery,
|
||||||
APIgroupquery,
|
APIgroupquery,
|
||||||
APIminiAppinfo,
|
APIminiAppinfo,
|
||||||
APIminiAppskuinfo
|
APIminiAppskuinfo,
|
||||||
|
productRelated
|
||||||
} from '@/common/api/product/product.js';
|
} from '@/common/api/product/product.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -671,8 +719,8 @@
|
|||||||
import {
|
import {
|
||||||
useNavbarStore
|
useNavbarStore
|
||||||
} from '@/stores/navbarStore';
|
} from '@/stores/navbarStore';
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useWebSocket
|
useWebSocket
|
||||||
} from '@/stores/carts-websocket.js';
|
} from '@/stores/carts-websocket.js';
|
||||||
@@ -700,6 +748,9 @@
|
|||||||
import {
|
import {
|
||||||
useCartStore
|
useCartStore
|
||||||
} from '@/stores/order.js';
|
} from '@/stores/order.js';
|
||||||
|
import {
|
||||||
|
computed, provide
|
||||||
|
} from 'vue';
|
||||||
const cartStore = useCartStore();
|
const cartStore = useCartStore();
|
||||||
/**
|
/**
|
||||||
* store本地存储 end
|
* store本地存储 end
|
||||||
@@ -710,7 +761,6 @@
|
|||||||
proxy
|
proxy
|
||||||
} = getCurrentInstance();
|
} = getCurrentInstance();
|
||||||
|
|
||||||
|
|
||||||
//点单智能推荐
|
//点单智能推荐
|
||||||
function onBuyClick(item) {
|
function onBuyClick(item) {
|
||||||
let index = -1;
|
let index = -1;
|
||||||
@@ -750,6 +800,7 @@
|
|||||||
/**
|
/**
|
||||||
* 通用数据合集 start
|
* 通用数据合集 start
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 门店信息
|
// 门店信息
|
||||||
const shopInfo = reactive({});
|
const shopInfo = reactive({});
|
||||||
Object.assign(shopInfo, uni.cache.get('shopInfo'));
|
Object.assign(shopInfo, uni.cache.get('shopInfo'));
|
||||||
@@ -804,6 +855,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 购物车对应的商品数
|
||||||
|
const GoodsIDInCartNumMap = computed(() => {
|
||||||
|
const map = {}
|
||||||
|
for (let cart of cartStore.carts) {
|
||||||
|
if (map[cart.product_id]) {
|
||||||
|
map[cart.product_id] += cart.number * 1
|
||||||
|
} else {
|
||||||
|
map[cart.product_id] = cart.number * 1
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回购物车对应的商品数量
|
||||||
|
*/
|
||||||
|
function returnGoodsImCartNum(goods) {
|
||||||
|
if(!goods){
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if (GoodsIDInCartNumMap.value.hasOwnProperty(goods.id)) {
|
||||||
|
return GoodsIDInCartNumMap.value[goods.id]
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取商品数据
|
// 获取商品数据
|
||||||
const shopProductList = reactive({
|
const shopProductList = reactive({
|
||||||
hots: [],
|
hots: [],
|
||||||
@@ -1269,9 +1349,9 @@
|
|||||||
//预览图
|
//预览图
|
||||||
const showPrveImg = ref(false);
|
const showPrveImg = ref(false);
|
||||||
const prveImgsList = ref([]);
|
const prveImgsList = ref([]);
|
||||||
|
|
||||||
function updateShowPrveImg(e){
|
function updateShowPrveImg(e) {
|
||||||
showPrveImg.value=e
|
showPrveImg.value = e
|
||||||
}
|
}
|
||||||
|
|
||||||
function prveImgs(images) {
|
function prveImgs(images) {
|
||||||
@@ -1285,14 +1365,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getProductImgs(item) {
|
async function getProductImgs(item) {
|
||||||
console.log('getProductImgs',item)
|
console.log('getProductImgs', item)
|
||||||
let res = await APIminiAppinfo(item.id);
|
let res = await APIminiAppinfo(item.id);
|
||||||
prveImgs(res.images);
|
prveImgs(res.images);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const goodsModalList=ref([])
|
||||||
|
|
||||||
|
function goodsModalClose(index){
|
||||||
|
goodsModalList.value.splice(index,1)
|
||||||
|
}
|
||||||
|
function modalAdd(item){
|
||||||
|
clickspecifications(item)
|
||||||
|
}
|
||||||
|
|
||||||
//获取多规格数据
|
//获取多规格数据
|
||||||
const clickspecifications = async (item, index, indexs, type) => {
|
const clickspecifications = async (item, index, indexs, type) => {
|
||||||
console.log('clickspecifications',item);
|
console.log('clickspecifications', item);
|
||||||
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||||
// if (
|
// if (
|
||||||
// item.isSoldStock == 1 ||
|
// item.isSoldStock == 1 ||
|
||||||
@@ -1305,7 +1394,10 @@
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
||||||
return false;
|
return uni.showToast({
|
||||||
|
title:'商品已下架或不在可售时间内',
|
||||||
|
icon:'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
shopCartNumber.value = 0;
|
shopCartNumber.value = 0;
|
||||||
@@ -1350,7 +1442,11 @@
|
|||||||
.filter(([_, value]) => value.length > 0));
|
.filter(([_, value]) => value.length > 0));
|
||||||
// 给默认数量
|
// 给默认数量
|
||||||
specifications.item.amountcartNumber = 0;
|
specifications.item.amountcartNumber = 0;
|
||||||
showShopsku.value = true;
|
// showShopsku.value = true;
|
||||||
|
goodsModalList.value.push({
|
||||||
|
show:true,
|
||||||
|
goods:specifications.item
|
||||||
|
})
|
||||||
};
|
};
|
||||||
// 判断商品是否在可售时间内
|
// 判断商品是否在可售时间内
|
||||||
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
||||||
@@ -1585,20 +1681,27 @@
|
|||||||
// 返回商品对应sku数据
|
// 返回商品对应sku数据
|
||||||
|
|
||||||
function cartInit(arr) {
|
function cartInit(arr) {
|
||||||
|
|
||||||
const result = []
|
const result = []
|
||||||
console.log('cartInitArr',arr);
|
|
||||||
console.log('allGoodsArr',allGoodsArr);
|
|
||||||
cartStore.carts = arr.map(v => {
|
cartStore.carts = arr.map(v => {
|
||||||
const goods = allGoodsArr.find(g => g.id == v.product_id)
|
const goods = cartStore.allGoodsArr.find(g => g.id == v.product_id)
|
||||||
const goodsSkuList = goods?goods.skuList : []
|
const goodsSkuList = goods ? goods.skuList : []
|
||||||
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
||||||
const memberPrice = findSku ? findSku.memberPrice : 0
|
const memberPrice = findSku ? findSku.memberPrice : 0
|
||||||
|
const is_temporary=v.is_temporary||v.isTemporary
|
||||||
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
||||||
...v,
|
...v,
|
||||||
memberPrice
|
memberPrice
|
||||||
}, cartStore.limitTimeDiscount, shopInfo,
|
}, cartStore.limitTimeDiscount, shopInfo,
|
||||||
shopUserInfo.value, 'product_id');
|
shopUserInfo.value, 'product_id');
|
||||||
if(!goods){
|
if (!goods&&!is_temporary) {
|
||||||
|
console.log('删除未匹配到的商品', {
|
||||||
|
id: v.id,
|
||||||
|
operate_type: "del",
|
||||||
|
table_code: uni.cache.get('tableCode'),
|
||||||
|
shop_id: uni.cache.get('shopId'),
|
||||||
|
type: "shopping",
|
||||||
|
})
|
||||||
useSocket.sendMessage({
|
useSocket.sendMessage({
|
||||||
id: v.id,
|
id: v.id,
|
||||||
operate_type: "del",
|
operate_type: "del",
|
||||||
@@ -1613,7 +1716,7 @@
|
|||||||
is_time_discount: is_time_discount ? 1 : 0,
|
is_time_discount: is_time_discount ? 1 : 0,
|
||||||
memberPrice
|
memberPrice
|
||||||
}
|
}
|
||||||
}).filter(v=>v)
|
}).filter(v => v)
|
||||||
|
|
||||||
for (let cart of arr) {
|
for (let cart of arr) {
|
||||||
const findItem = cartStore.carts.find(v => v.id == cart.id)
|
const findItem = cartStore.carts.find(v => v.id == cart.id)
|
||||||
@@ -1647,7 +1750,7 @@
|
|||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log('product index 收到消息', Message);
|
|
||||||
// 检查消息是否已经处理过
|
// 检查消息是否已经处理过
|
||||||
if (processedMessageIds.has(Message.msg_id)) {
|
if (processedMessageIds.has(Message.msg_id)) {
|
||||||
return;
|
return;
|
||||||
@@ -1790,7 +1893,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//除去p 每次返回都回执消息
|
//除去p 每次返回都回执消息
|
||||||
await websocketsendMessage({
|
await websocketsendMessage({
|
||||||
@@ -2084,11 +2187,11 @@
|
|||||||
}
|
}
|
||||||
return currentTime >= startTime && currentTime <= endTime;
|
return currentTime >= startTime && currentTime <= endTime;
|
||||||
});
|
});
|
||||||
let allGoodsArr=[]
|
const allGoodsArr = ref([])
|
||||||
// 列表请求
|
// 列表请求
|
||||||
const productqueryProduct = async () => {
|
const productqueryProduct = async () => {
|
||||||
cartStore.goodsIsloading = false;
|
cartStore.goodsIsloading = false;
|
||||||
allGoodsArr=[]
|
allGoodsArr.value=[]
|
||||||
try {
|
try {
|
||||||
shopProductList.hots = await productminiApphotsquery();
|
shopProductList.hots = await productminiApphotsquery();
|
||||||
shopProductList.productInfo = await APIgroupquery();
|
shopProductList.productInfo = await APIgroupquery();
|
||||||
@@ -2100,40 +2203,46 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.pro.switchTab('index/index');
|
uni.pro.switchTab('index/index');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
return; // 出错直接返回,避免后续逻辑
|
||||||
}
|
}
|
||||||
if (shopProductList.productInfo.length > 0 || shopProductList.hots.length > 0) {
|
|
||||||
//TODO handle the exception
|
|
||||||
//第一步:将所有商品的 cartNumber 初始化为 0
|
|
||||||
shopProductList.productInfo.forEach((group) => {
|
|
||||||
group.productList.forEach(async (product) => {
|
|
||||||
product.cartNumber = 0;
|
|
||||||
product.isSaleTimeshow = await isProductAvailable(product.days, product
|
|
||||||
.startTime, product.endTime);
|
|
||||||
|
|
||||||
allGoodsArr.push(product)
|
|
||||||
|
|
||||||
|
if (shopProductList.productInfo.length > 0 || shopProductList.hots.length > 0) {
|
||||||
|
// 第一步:处理productInfo(替换forEach为for...of,支持await)
|
||||||
|
for (const group of shopProductList.productInfo) {
|
||||||
|
for (const product of group.productList) {
|
||||||
|
product.cartNumber = 0;
|
||||||
|
// 等待异步函数执行完成后,再push
|
||||||
|
product.isSaleTimeshow = await isProductAvailable(
|
||||||
|
product.days,
|
||||||
|
product.startTime,
|
||||||
|
product.endTime
|
||||||
|
);
|
||||||
|
allGoodsArr.value.push(product);
|
||||||
cartStore.setGoodsMap(product.id, product);
|
cartStore.setGoodsMap(product.id, product);
|
||||||
});
|
}
|
||||||
});
|
}
|
||||||
shopProductList.hots.forEach(async (i) => {
|
|
||||||
|
// 第二步:处理hots(同理替换forEach为for...of)
|
||||||
|
for (const i of shopProductList.hots) {
|
||||||
i.cartNumber = 0;
|
i.cartNumber = 0;
|
||||||
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
|
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
|
||||||
allGoodsArr.push(i)
|
allGoodsArr.value.push(i);
|
||||||
cartStore.setGoodsMap(i.id, i);
|
cartStore.setGoodsMap(i.id, i);
|
||||||
});
|
|
||||||
console.log('shopProductList', shopProductList);
|
|
||||||
|
|
||||||
if(cartStore.carts.length>0){
|
|
||||||
cartInit(cartStore.carts)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 此时所有异步操作完成,allGoodsArr已有数据
|
||||||
|
// console.log('allGoodsArr', allGoodsArr);
|
||||||
|
// console.log('shopProductList', shopProductList);
|
||||||
|
console.log('cartStore.carts', cartStore.carts)
|
||||||
|
cartStore.allGoodsArr=allGoodsArr.value
|
||||||
|
if (cartStore.carts.length > 0) {
|
||||||
|
cartInit(cartStore.carts);
|
||||||
|
}
|
||||||
|
|
||||||
cartStore.goodsIsloading = true;
|
cartStore.goodsIsloading = true;
|
||||||
scrollTopSize.value = 0;
|
scrollTopSize.value = 0;
|
||||||
topArr.value = [];
|
topArr.value = [];
|
||||||
// userStore.actionsAPIuser()
|
|
||||||
// 数据可以更新
|
|
||||||
isDataLoaded.value = true;
|
isDataLoaded.value = true;
|
||||||
// 历史订单
|
|
||||||
Historicalorders();
|
Historicalorders();
|
||||||
updateProductQuantities();
|
updateProductQuantities();
|
||||||
} else {
|
} else {
|
||||||
@@ -2381,7 +2490,7 @@
|
|||||||
tableCode: uni.cache.get('tableCode')
|
tableCode: uni.cache.get('tableCode')
|
||||||
});
|
});
|
||||||
oldOrder.value = res;
|
oldOrder.value = res;
|
||||||
if (res && res.id && shopInfo.registerType == 'after'&&!e.noJump) {
|
if (res && res.id && shopInfo.registerType == 'after' && !e.noJump) {
|
||||||
toHistory();
|
toHistory();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2441,8 +2550,8 @@
|
|||||||
idKey: 'id'
|
idKey: 'id'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function watchEmit(){
|
function watchEmit() {
|
||||||
uni.$off('updateProductIndex')
|
uni.$off('updateProductIndex')
|
||||||
uni.$on('updateProductIndex', function(data) {
|
uni.$on('updateProductIndex', function(data) {
|
||||||
getNewUserDiscount()
|
getNewUserDiscount()
|
||||||
@@ -2496,12 +2605,12 @@
|
|||||||
});
|
});
|
||||||
if (res && typeof res == 'object') {
|
if (res && typeof res == 'object') {
|
||||||
newUserDiscount.value = res;
|
newUserDiscount.value = res;
|
||||||
cartStore.consumeDiscount=res
|
cartStore.consumeDiscount = res
|
||||||
cartStore.newUserDiscount=res.amount
|
cartStore.newUserDiscount = res.amount
|
||||||
}else{
|
} else {
|
||||||
newUserDiscount.value = null;
|
newUserDiscount.value = null;
|
||||||
cartStore.consumeDiscount={}
|
cartStore.consumeDiscount = {}
|
||||||
cartStore.newUserDiscount=0
|
cartStore.newUserDiscount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2561,8 +2670,8 @@
|
|||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
const oldOrder = ref(null);
|
const oldOrder = ref(null);
|
||||||
|
|
||||||
|
|
||||||
// 限时折扣
|
// 限时折扣
|
||||||
async function getLimitDiscount() {
|
async function getLimitDiscount() {
|
||||||
const limitRes = await limitTimeDiscountapi.getConfig({
|
const limitRes = await limitTimeDiscountapi.getConfig({
|
||||||
@@ -3199,7 +3308,6 @@
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-bottom: 200rpx;
|
|
||||||
|
|
||||||
.positionabsolute {
|
.positionabsolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -3234,9 +3342,7 @@
|
|||||||
border-bottom: 2rpx solid #f0f0f0;
|
border-bottom: 2rpx solid #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop_sku_box:last-child {
|
|
||||||
padding-bottom: 140rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_sku_box {
|
.shop_sku_box {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
@@ -3322,9 +3428,6 @@
|
|||||||
padding: 30rpx 28rpx;
|
padding: 30rpx 28rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0, 0, 0, 0.1);
|
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0, 0, 0, 0.1);
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -3700,4 +3803,31 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recommand-goods {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 24rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
width: 210rpx;
|
||||||
|
|
||||||
|
&:nth-child(3n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
height: 84rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -60,6 +60,9 @@
|
|||||||
<text v-if="item.bizCode == 'cashback'">
|
<text v-if="item.bizCode == 'cashback'">
|
||||||
消费返现
|
消费返现
|
||||||
</text>
|
</text>
|
||||||
|
<text v-if="item.bizCode == 'cashback_refund'">
|
||||||
|
消费返现扣减
|
||||||
|
</text>
|
||||||
<text v-if="item.bizCode == 'freeIn'">
|
<text v-if="item.bizCode == 'freeIn'">
|
||||||
霸王餐充值
|
霸王餐充值
|
||||||
</text>
|
</text>
|
||||||
|
|||||||
1117
pages/user/user.vue
1117
pages/user/user.vue
File diff suppressed because it is too large
Load Diff
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -30,8 +30,8 @@ importers:
|
|||||||
specifier: ^0.1.2
|
specifier: ^0.1.2
|
||||||
version: 0.1.2
|
version: 0.1.2
|
||||||
ysk-utils:
|
ysk-utils:
|
||||||
specifier: ^1.0.81
|
specifier: ^1.0.83
|
||||||
version: 1.0.81
|
version: 1.0.83
|
||||||
devDependencies:
|
devDependencies:
|
||||||
unplugin-auto-import:
|
unplugin-auto-import:
|
||||||
specifier: ^0.16.7
|
specifier: ^0.16.7
|
||||||
@@ -357,8 +357,8 @@ packages:
|
|||||||
webpack-virtual-modules@0.6.2:
|
webpack-virtual-modules@0.6.2:
|
||||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||||
|
|
||||||
ysk-utils@1.0.81:
|
ysk-utils@1.0.83:
|
||||||
resolution: {integrity: sha512-c6SOfOaw43aDDuyXgEv24Vo561EfFoa1gfGbY+p1EfXHoGPOE6tQLekbWW9bn37KAse0Gdef7VCbdv0Dr6ltaw==}
|
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
@@ -684,7 +684,7 @@ snapshots:
|
|||||||
|
|
||||||
webpack-virtual-modules@0.6.2: {}
|
webpack-virtual-modules@0.6.2: {}
|
||||||
|
|
||||||
ysk-utils@1.0.81:
|
ysk-utils@1.0.83:
|
||||||
dependencies:
|
dependencies:
|
||||||
bignumber.js: 9.3.1
|
bignumber.js: 9.3.1
|
||||||
loadsh: 0.0.4
|
loadsh: 0.0.4
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ export const useCartsStore = defineStore("cart", () => {
|
|||||||
);
|
);
|
||||||
//用户信息
|
//用户信息
|
||||||
const shopUserInfo = ref(uni.cache.get("shopUserInfo") || {});
|
const shopUserInfo = ref(uni.cache.get("shopUserInfo") || {});
|
||||||
|
|
||||||
|
//全部的商品列表
|
||||||
|
const allGoodsArr=ref([])
|
||||||
|
|
||||||
const consumeDiscount = ref({});
|
const consumeDiscount = ref({});
|
||||||
|
|
||||||
@@ -324,9 +327,13 @@ export const useCartsStore = defineStore("cart", () => {
|
|||||||
}
|
}
|
||||||
carts.value = arr
|
carts.value = arr
|
||||||
.map((v) => {
|
.map((v) => {
|
||||||
|
|
||||||
const item = getProductDetails(v);
|
const item = getProductDetails(v);
|
||||||
if (!item) {
|
const is_temporary=v.is_temporary||v.isTemporary
|
||||||
|
if(is_temporary){
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
if (!item&&!is_temporary) {
|
||||||
socketSendMsg({
|
socketSendMsg({
|
||||||
id: v.id,
|
id: v.id,
|
||||||
operate_type: "del",
|
operate_type: "del",
|
||||||
@@ -496,10 +503,10 @@ export const useCartsStore = defineStore("cart", () => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isUse =
|
const isUse =
|
||||||
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice && shopInfo.value
|
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice ?
|
||||||
.isMemberPrice == 1 ?
|
|
||||||
true :
|
true :
|
||||||
false;
|
false;
|
||||||
|
console.log('useVipPrice',isUse);
|
||||||
return isUse;
|
return isUse;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -754,6 +761,6 @@ export const useCartsStore = defineStore("cart", () => {
|
|||||||
//限时折扣
|
//限时折扣
|
||||||
limitTimeDiscount,
|
limitTimeDiscount,
|
||||||
shopUserInfo,
|
shopUserInfo,
|
||||||
socketSendMsg,
|
socketSendMsg,allGoodsArr
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -25,7 +25,7 @@ export const Memberpay = defineStore('memberpay', {
|
|||||||
let res = await APIpayltPayVip({
|
let res = await APIpayltPayVip({
|
||||||
...data,
|
...data,
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
payType: 'wechatPay',
|
payType: 'WECHAT',
|
||||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
@@ -113,7 +113,7 @@ export const Memberpay = defineStore('memberpay', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
payType: 'wechatPay',
|
payType: 'WECHAT',
|
||||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-ALIPAY
|
// #ifdef MP-ALIPAY
|
||||||
|
|||||||
@@ -716,9 +716,10 @@
|
|||||||
const index = item.packageInfo.tieredDiscount.findIndex(v => v.peopleNum==nowStep.value.peopleNum)
|
const index = item.packageInfo.tieredDiscount.findIndex(v => v.peopleNum==nowStep.value.peopleNum)
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
const percent= (index + 1) / item.packageInfo.tieredDiscount.length * 100
|
const percent= (index + 1) / item.packageInfo.tieredDiscount.length * 100
|
||||||
return percent>=100?100:0;
|
return percent>=100?100:percent;
|
||||||
|
}else{
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return 0
|
|
||||||
})
|
})
|
||||||
const nowPrice = computed(() => {
|
const nowPrice = computed(() => {
|
||||||
if (!item.packageInfo) {
|
if (!item.packageInfo) {
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ module.exports = defineConfig({
|
|||||||
],
|
],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/testApi': {
|
||||||
// target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
// target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||||
target: 'http://192.168.1.42/', // 目标服务器地址
|
target: 'http://192.168.1.42/', // 目标服务器地址
|
||||||
changeOrigin: true, // 是否更改请求源
|
changeOrigin: true, // 是否更改请求源
|
||||||
rewrite: path => path.replace(/^\/api/, '')
|
rewrite: path => path.replace(/^\/testApi/, '')
|
||||||
},
|
},
|
||||||
'/prodApi': {
|
'/prodApi': {
|
||||||
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
|
||||||
|
|||||||
Reference in New Issue
Block a user