Compare commits
37 Commits
75ed724fbb
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 2afc2f9fab | |||
| 46105da573 | |||
| 20a54c3bd9 | |||
| a0cc43e118 | |||
| 8f1b21bf00 | |||
| 654ed39854 | |||
| 67ae138033 | |||
| c60a2115ea | |||
| 1ed28e2913 | |||
| a125995808 | |||
| 0444b68cb2 | |||
| 32c60b4f83 | |||
| 373be0527f | |||
| 402f85d61f | |||
| 575e6d22b0 | |||
| dfc67e12c5 | |||
| 42fc09815b | |||
| 3064007137 | |||
| d8c2aef83e | |||
| 7c143efe30 | |||
| 362f3cee96 | |||
| ca53618004 | |||
| cbe27a43de | |||
| 5fcbba0cb4 | |||
| 0944635c69 | |||
| 067025f532 | |||
| 8d917d49ed | |||
| bcc44a0886 | |||
| 811abf935c | |||
| bde30fa70c | |||
| ac7af51a92 | |||
| 9b78ee0f48 | |||
| 113193b142 | |||
| edd10edf9f | |||
| e645aa5516 | |||
| 158a025ba1 | |||
| 4d7c388f74 |
@@ -3,12 +3,15 @@ import request from '@/common/api/request.js'
|
||||
const url = '/account'
|
||||
//根据经纬度获取信息
|
||||
export const APIgeocodelocation = (data) => {
|
||||
return request({
|
||||
url: url + '/user/geo/geocode',
|
||||
method: 'get',
|
||||
data: data,
|
||||
toast: false
|
||||
return new Promise((resove, reject) => {
|
||||
resove(null)
|
||||
})
|
||||
// return request({
|
||||
// url: url + '/user/geo/geocode',
|
||||
// method: 'get',
|
||||
// data: data,
|
||||
// toast: false
|
||||
// })
|
||||
}
|
||||
|
||||
//登录
|
||||
|
||||
@@ -14,11 +14,11 @@ export const pay = (data) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = "WX";
|
||||
platformType = "wechat";
|
||||
payType = "wechatPay";
|
||||
payType = "WECHAT";
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = "alipay";
|
||||
payType = "aliPay";
|
||||
payType = "ALIPAY";
|
||||
// #endif
|
||||
|
||||
|
||||
@@ -136,6 +136,15 @@ export const getInviteCode = (data) => {
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
export const autoGetInviteCode = (data) => {
|
||||
return request({
|
||||
url: prveUrl + "/user/distribution/autoGetInviteCode",
|
||||
method: "get",
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 获取配置
|
||||
export const getConfig = (data) => {
|
||||
@@ -147,3 +156,11 @@ export const getConfig = (data) => {
|
||||
};
|
||||
|
||||
|
||||
// 分销员中心-无感-绑定邀请人
|
||||
export const autoBindInviteUser = (data) => {
|
||||
return request({
|
||||
url: prveUrl + "/user/distribution/autoBindInviteUser",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
@@ -10,11 +10,11 @@ let platformType = '';
|
||||
let payType = '';
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = 'wechat'
|
||||
payType = 'wechatPay'
|
||||
payType = 'WECHAT'
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = 'alipay'
|
||||
payType = 'aliPay'
|
||||
payType = 'ALIPAY'
|
||||
// #endif
|
||||
|
||||
export const getPackage = (data) => {
|
||||
|
||||
@@ -6,11 +6,11 @@ let platformType = '';
|
||||
let payType='';
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = 'wechat'
|
||||
payType='wechatPay'
|
||||
payType='WECHAT'
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = 'alipay'
|
||||
payType='aliPay'
|
||||
payType='ALIPAY'
|
||||
// #endif
|
||||
|
||||
export const warePage = (data) => {
|
||||
|
||||
@@ -6,11 +6,11 @@ let platformType = '';
|
||||
let payType='';
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = 'wechat'
|
||||
payType='wechatPay'
|
||||
payType='WECHAT'
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = 'alipay'
|
||||
payType='aliPay'
|
||||
payType='ALIPAY'
|
||||
// #endif
|
||||
|
||||
//订单列表
|
||||
|
||||
@@ -6,11 +6,11 @@ let platformType = '';
|
||||
let payType='';
|
||||
// #ifdef MP-WEIXIN
|
||||
platformType = 'wechat'
|
||||
payType='wechatPay'
|
||||
payType='WECHAT'
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
platformType = 'alipay'
|
||||
payType='aliPay'
|
||||
payType='ALIPAY'
|
||||
// #endif
|
||||
|
||||
export const pointGoodsPage = (data) => {
|
||||
@@ -20,6 +20,12 @@ export const pointGoodsPage = (data) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export const pointsGoods = (data) => {
|
||||
return request({
|
||||
url: url + '/user/pointGoods/'+data.id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export const exchange = (data) => {
|
||||
|
||||
@@ -35,8 +35,8 @@ export default async (params) => {
|
||||
});
|
||||
}
|
||||
// #ifdef H5
|
||||
uni.cache.set('token', 'b61c8b0f1c9d47ad924e33c48b496ce6')
|
||||
uni.cache.set('userInfo',{"acQrcodeValidTime":"2025-11-17 17:57:16","alipayOpenId":"","birthDay":"2025-10-17","createTime":"2024-07-06 11:30:16","distributionAmount":0,"headImg":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","id":"36434","idCard":"612401199810058031","isAc":0,"lastLoginTime":"2025-12-25 11:41:15","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"叶明飞","sex":1,"status":1,"updateTime":"2025-12-25 09:41:58","usePayPwd":0,"wechatAcOpenId":"1111","wechatAcQrcode":"","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"})
|
||||
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) => {
|
||||
const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||
// const debug = false; // false线上 true本地
|
||||
const debug = true; // false线上 true本地
|
||||
let baseUrl = ''
|
||||
let baseUrlwws = ''
|
||||
|
||||
|
||||
|
||||
|
||||
const version = "100";
|
||||
const autoRemoveCache = {
|
||||
count: 100000,
|
||||
|
||||
@@ -44,6 +44,9 @@ page,
|
||||
image {
|
||||
display: block;
|
||||
}
|
||||
.relative{
|
||||
position: relative;
|
||||
}
|
||||
.absolute{
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</template>
|
||||
</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>
|
||||
<text class="title">{{ item.couponInfo.title }}</text>
|
||||
<text class="num">x{{ item.num }}</text>
|
||||
@@ -507,6 +507,7 @@ function close() {
|
||||
outline: none;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
&:active {
|
||||
background: #f07080; // 点击深色反馈
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<block v-if="limitDiscount && limitDiscount.id" class="limit-price">
|
||||
<text>
|
||||
<block v-if="limitDiscount && limitDiscount.id" >
|
||||
<text class="limit-price">
|
||||
{{ returnPrice() }}
|
||||
</text>
|
||||
</block>
|
||||
@@ -15,7 +15,6 @@
|
||||
{{ cart.memberPrice }}
|
||||
</text>
|
||||
</block>
|
||||
|
||||
<text v-else class="salePrice">{{ cart.salePrice }}</text>
|
||||
</text>
|
||||
</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="method_list_bom" v-if="item.name == '余额支付'">
|
||||
<text class="balance">
|
||||
当前余额¥{{ orderVIP ? orderVIP.amount || 0 : 0 }}</text>
|
||||
当前余额¥{{ shopUserInfo ? shopUserInfo.amount || 0 : 0 }}</text>
|
||||
<text class="topUpNow" @click="goRecharge">去充值</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -66,6 +66,14 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
shopUserInfo:{
|
||||
type: Object,
|
||||
default: () => {
|
||||
return{
|
||||
amount:0
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// 工具函数 - 深拷贝对象(切断引用)
|
||||
@@ -77,15 +85,10 @@ function returnDisabled(item) {
|
||||
return props.disablePayType.includes(item.name);
|
||||
}
|
||||
|
||||
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([
|
||||
@@ -94,7 +97,7 @@ const paymentMethodList = ref([
|
||||
name: "微信支付",
|
||||
type: 2,
|
||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
||||
payType: "wechatPay",
|
||||
payType: "WECHAT",
|
||||
},
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
@@ -207,13 +210,12 @@ const goRecharge = () => {
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/user/member/czzx?shopId=${orderVIP.value?.shopId || ''}`,
|
||||
url: `/pages/user/member/czzx?shopId=${props.shopUserInfo?.shopId || ''}`,
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
groupChanges,
|
||||
orderVIPfun,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
38
components/ymf-components/ymf-share.vue
Normal file
38
components/ymf-components/ymf-share.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<view class="relative">
|
||||
<slot v-if="$slots.default" name="default"></slot>
|
||||
<up-icon v-else name="share-square" bold :color="color" :size="size"></up-icon>
|
||||
<view class="absolute share-box">
|
||||
<button open-type="share" @click="shareClick">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const emits = defineEmits(['shareClick'])
|
||||
const props = defineProps({
|
||||
size: {
|
||||
type: String,
|
||||
default: '36rpx'
|
||||
},
|
||||
color:{
|
||||
type: String,
|
||||
default: '#333'
|
||||
}
|
||||
})
|
||||
|
||||
function shareClick() {
|
||||
emits('shareClick')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.share-box {
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
@@ -45,17 +45,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view
|
||||
<!-- <view
|
||||
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"
|
||||
>
|
||||
<text class="color-666 font-12"> 总计:</text>
|
||||
<text class="font-16 color-333 font-700" v-if="centerUserInfo">
|
||||
{{ centerUserInfo.totalIncome }}</text
|
||||
<text class="font-16 color-333 font-700" >
|
||||
{{ 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 class="u-flex justify-between">
|
||||
<view>
|
||||
@@ -113,6 +113,7 @@
|
||||
<scroll-view
|
||||
class="popup-list"
|
||||
direction="vertical"
|
||||
:scroll-y="true"
|
||||
@scrollend="scrollBottom"
|
||||
>
|
||||
<view
|
||||
@@ -301,6 +302,7 @@ async function centerUser() {
|
||||
}
|
||||
onShow(() => {});
|
||||
|
||||
|
||||
onLoad(async (opt) => {
|
||||
await getCouponShopsAjax();
|
||||
|
||||
@@ -314,13 +316,24 @@ onLoad(async (opt) => {
|
||||
}
|
||||
if (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 || "";
|
||||
}
|
||||
centerUser();
|
||||
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(
|
||||
() => querForm.value.status,
|
||||
(newVal, oldVal) => {
|
||||
|
||||
@@ -1,228 +1,228 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="w-qrcode">
|
||||
<w-qrcode
|
||||
:options="codeOptions"
|
||||
:opacity="0"
|
||||
ref="wQrcode"
|
||||
@generate="(e) => qrcodeResult(e)"
|
||||
></w-qrcode>
|
||||
</view>
|
||||
|
||||
<up-popup
|
||||
:show="show"
|
||||
bgColor="transparent"
|
||||
:safeAreaInsetBottom="false"
|
||||
:closeOnClickOverlay="true"
|
||||
@close="close"
|
||||
mode="center"
|
||||
>
|
||||
<view class="box">
|
||||
<view class="info">
|
||||
<view class="u-flex justify-center">
|
||||
<up-avatar size="214rpx" :src="shopUserInfo.headImg"></up-avatar>
|
||||
</view>
|
||||
<view
|
||||
class="u-m-t-48 font-14 font-700 color-333 text-center line-height-54"
|
||||
>
|
||||
<view>{{ shopUserInfo.nickName }} </view>
|
||||
<view>{{ desensitizePhone(shopUserInfo.phone) }}</view>
|
||||
</view>
|
||||
<view class="u-m-t-16 font-14 line-height-54 text-center">
|
||||
<text class="color-666">邀请码</text>
|
||||
<text class="u-m-l-16 u-m-r-16 color-333 font-16 font-700">{{
|
||||
inviteCode
|
||||
}}</text>
|
||||
<text class="" style="color: #fe6d11" @click="copyCode">复制</text>
|
||||
</view>
|
||||
<view class="u-flex justify-center" style="margin-top: 90rpx">
|
||||
<!-- <w-qrcode
|
||||
<view class="">
|
||||
<view class="w-qrcode">
|
||||
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
|
||||
</view>
|
||||
<up-popup :show="show" bgColor="transparent" :safeAreaInsetBottom="false" :closeOnClickOverlay="true" @close="close" mode="center">
|
||||
<view class="box">
|
||||
<view class="info">
|
||||
<view class="u-flex justify-center">
|
||||
<up-avatar size="214rpx" :src="shopUserInfo.headImg"></up-avatar>
|
||||
</view>
|
||||
<view class="u-m-t-48 font-14 font-700 color-333 text-center line-height-54">
|
||||
<view>{{ shopUserInfo.nickName }}</view>
|
||||
<view>{{ desensitizePhone(shopUserInfo.phone) }}</view>
|
||||
</view>
|
||||
<view class="u-m-t-16 font-14 line-height-54 text-center">
|
||||
<text class="color-666">邀请码</text>
|
||||
<text class="u-m-l-16 u-m-r-16 color-333 font-16 font-700">{{ inviteCode }}</text>
|
||||
<text class="" style="color: #fe6d11" @click="copyCode">复制</text>
|
||||
</view>
|
||||
<view class="u-flex justify-center" style="margin-top: 90rpx">
|
||||
<!-- <w-qrcode
|
||||
:options="codeOptions"
|
||||
:opacity="1"
|
||||
ref="wQrcode"
|
||||
@generate="(e) => qrcodeResult(e)"
|
||||
></w-qrcode> -->
|
||||
<up-image width="322rpx" height="322rpx" :src="code"></up-image>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-60 u-flex u-col-center justify-center">
|
||||
<view class="confirm" @click="save">保存图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
<up-image width="322rpx" height="322rpx" :src="code"></up-image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-wrap">
|
||||
<view class="confirm line" @click="save">保存图片</view>
|
||||
<ymf-share><view class="confirm">微信分享</view></ymf-share>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import wQrcode from "@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue";
|
||||
import {desensitizePhone} from "@/utils/util.js";
|
||||
import { ref } from "vue";
|
||||
<script setup>
|
||||
import ymfShare from '@/components/ymf-components/ymf-share.vue';
|
||||
import wQrcode from '@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue';
|
||||
import { desensitizePhone } from '@/utils/util.js';
|
||||
import { ref } from 'vue';
|
||||
const props = defineProps({
|
||||
inviteCode: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
inviteCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
});
|
||||
const codeOptions = ref({
|
||||
size: 200,
|
||||
code: props.inviteCode,
|
||||
size: 200,
|
||||
code: props.inviteCode
|
||||
});
|
||||
function copyCode() {
|
||||
uni.setClipboardData({
|
||||
data: props.inviteCode,
|
||||
success: function () {
|
||||
console.log("success");
|
||||
},
|
||||
});
|
||||
uni.setClipboardData({
|
||||
data: props.inviteCode,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
}
|
||||
const code = ref("");
|
||||
const code = ref('');
|
||||
|
||||
function qrcodeResult(e) {
|
||||
console.log("qrcodeResult", e);
|
||||
code.value = e.img.tempFilePath;
|
||||
console.log("code", code.value);
|
||||
console.log('qrcodeResult', e);
|
||||
code.value = e.img.tempFilePath;
|
||||
console.log('code', code.value);
|
||||
}
|
||||
|
||||
const show = defineModel({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
type: Boolean,
|
||||
default: false
|
||||
});
|
||||
const emits = defineEmits(["cancel", "confirm"]);
|
||||
const emits = defineEmits(['cancel', 'confirm']);
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits("cancel");
|
||||
show.value = false;
|
||||
emits('cancel');
|
||||
}
|
||||
function save() {
|
||||
show.value = false;
|
||||
show.value = false;
|
||||
|
||||
// 保存图片到相册
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: code.value,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('保存失败原因:', err);
|
||||
// 判断是否为授权拒绝(微信小程序授权拒绝的特征)
|
||||
if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
|
||||
// 弹出提示引导用户去设置页开启授权
|
||||
uni.showModal({
|
||||
title: '授权提示',
|
||||
content: '保存图片需要授权访问相册,请前往设置开启授权',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '去设置',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
// 跳转到微信小程序的授权设置页
|
||||
uni.openSetting({
|
||||
success: function (settingRes) {
|
||||
// 检查用户是否开启了相册授权
|
||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.showToast({
|
||||
title: '授权成功,可重新保存',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未开启授权,保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function () {
|
||||
uni.showToast({
|
||||
title: '打开设置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
// 保存图片到相册
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: code.value,
|
||||
success: function () {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('保存失败原因:', err);
|
||||
// 判断是否为授权拒绝(微信小程序授权拒绝的特征)
|
||||
if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
|
||||
// 弹出提示引导用户去设置页开启授权
|
||||
uni.showModal({
|
||||
title: '授权提示',
|
||||
content: '保存图片需要授权访问相册,请前往设置开启授权',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '去设置',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
// 跳转到微信小程序的授权设置页
|
||||
uni.openSetting({
|
||||
success: function (settingRes) {
|
||||
// 检查用户是否开启了相册授权
|
||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.showToast({
|
||||
title: '授权成功,可重新保存',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未开启授权,保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function () {
|
||||
uni.showToast({
|
||||
title: '打开设置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
||||
uni.showToast({
|
||||
title: '保存失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
emits("confirm", code.value);
|
||||
emits('confirm', code.value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.info .canvas) {
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
.border {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
padding: 18rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
padding: 18rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.box {
|
||||
width: 638rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.top {
|
||||
border-bottom: 2rpx solid #ededed;
|
||||
}
|
||||
.info {
|
||||
padding: 96rpx 40rpx 96rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.small-title {
|
||||
min-width: 84rpx;
|
||||
text-align: right;
|
||||
}
|
||||
width: 638rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
// overflow: hidden;
|
||||
position: relative;
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
.top {
|
||||
border-bottom: 2rpx solid #ededed;
|
||||
}
|
||||
.info {
|
||||
padding: 96rpx 40rpx 96rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.small-title {
|
||||
min-width: 84rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.footer-wrap {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -100upx;
|
||||
display: flex;
|
||||
gap: 28upx;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel {
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #e8ad7b;
|
||||
color: #e8ad7b;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
white-space: nowrap;
|
||||
line-height: 48rpx;
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #e8ad7b;
|
||||
color: #e8ad7b;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
white-space: nowrap;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
.confirm {
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #e8ad7b;
|
||||
border: 2rpx solid #e8ad7b;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
line-height: 48rpx;
|
||||
white-space: nowrap;
|
||||
$color: #e8ad7b;
|
||||
flex: 1;
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: $color;
|
||||
border: 2rpx solid $color;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
&.line {
|
||||
background-color: #fff;
|
||||
color: $color;
|
||||
}
|
||||
}
|
||||
.line-height-54 {
|
||||
line-height: 54rpx;
|
||||
line-height: 54rpx;
|
||||
}
|
||||
.w-qrcode {
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
z-index: -1;
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
z-index: -1;
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -566,7 +566,7 @@ export function calcSingleGoodsRealPrice(
|
||||
>
|
||||
) : number {
|
||||
const { isMember, memberDiscountRate, limitTimeDiscount: activity } = config;
|
||||
|
||||
console.log('isMember',isMember);
|
||||
//如果是增菜价格为0
|
||||
if (goods.is_gift || goods.isGift) {
|
||||
return 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"pinia": "^2.3.1",
|
||||
"pinia-plugin-unistorage": "^0.1.2",
|
||||
"ysk-utils": "^1.0.81"
|
||||
"ysk-utils": "^1.0.83"
|
||||
},
|
||||
"devDependencies": {
|
||||
"unplugin-auto-import": "^0.16.7"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^my-(.*)": "@/components/ymf-components/ymf-$1.vue",
|
||||
"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
|
||||
"^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
|
||||
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,6 @@
|
||||
<image :src="imgs.code" class="code"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="new-menus-box">
|
||||
<view class="new-menus layout2" v-if="allConfig.takeout">
|
||||
<view class="diner" @click="scanCodehandle(0)">
|
||||
@@ -60,7 +59,6 @@
|
||||
|
||||
<view class="u-font-28 color-999">一键分享,快速拼单</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="points" @click="toIntegralMall">
|
||||
@@ -167,7 +165,7 @@
|
||||
function toGroupBuying() {
|
||||
uni.navigateTo({
|
||||
url: '/groupBuying/index/index'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function toFenxiao() {
|
||||
@@ -215,7 +213,7 @@
|
||||
function toTaocan() {
|
||||
uni.navigateTo({
|
||||
url: '/userPackage/index/index'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
const memberindex = (url) => {
|
||||
@@ -301,7 +299,7 @@
|
||||
function getHomeData() {
|
||||
homeData().then((res) => {
|
||||
Object.assign(allConfig, res);
|
||||
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar
|
||||
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar;
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
@@ -316,6 +314,9 @@
|
||||
defineExpose({
|
||||
updateData
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -7,14 +7,21 @@
|
||||
<view class="limitDiscount" v-if="showLimitDiscount(item)"
|
||||
>限时折扣</view
|
||||
>
|
||||
|
||||
<up-image
|
||||
width="76"
|
||||
height="76"
|
||||
radius="6"
|
||||
:src="item.productImg"
|
||||
v-if="item.productId != -999"
|
||||
v-if="item.isTemporary != 1&&item.is_temporary!=1"
|
||||
></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
|
||||
width="76"
|
||||
height="76"
|
||||
@@ -25,7 +32,7 @@
|
||||
></up-image>
|
||||
</view>
|
||||
<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">{{
|
||||
item.skuName
|
||||
}}</text>
|
||||
@@ -55,18 +62,22 @@
|
||||
<view class="price">
|
||||
<view class="priceAmount">
|
||||
¥
|
||||
|
||||
<goodsPrice
|
||||
v-if="!item.is_temporary&&!item.isTemporary"
|
||||
:cart="item"
|
||||
:limitDiscount="limitDiscount"
|
||||
:shopUserInfo="shopUserInfo"
|
||||
:shopInfo="shopInfo"
|
||||
idKey="product_id"
|
||||
></goodsPrice>
|
||||
<text v-else>{{item.discount_sale_amount}}</text>
|
||||
<view class="old-price" v-if="showLimitDiscount(item)"
|
||||
>¥{{ item.salePrice }}</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>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
|
||||
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
|
||||
|
||||
<view class="u-flex u-row-center u-m-t-16 u-font-28">
|
||||
<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}">
|
||||
|
||||
@@ -70,7 +70,10 @@
|
||||
<view class="item" v-for="item in value" :key="item.id">
|
||||
<view class="cover">
|
||||
<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"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix" v-else></up-image>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@
|
||||
</rechargeFree>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange"
|
||||
<paymentMethodes ref="paymentMethodref" :shopUserInfo="orderVIP" @groupChange="groupChange"
|
||||
:disablePayType="disablePayType" :changeFreeenable="isBwc" v-model="paymentmethod"
|
||||
v-if="listinfo.status == 'unpaid' || !listinfo.id">
|
||||
<template #bottom>
|
||||
@@ -203,6 +203,7 @@
|
||||
useWebSocket
|
||||
} from "@/stores/carts-websocket.js";
|
||||
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'
|
||||
|
||||
@@ -576,7 +577,7 @@
|
||||
name: "微信支付",
|
||||
type: 2,
|
||||
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
|
||||
payType: "wechatPay",
|
||||
payType: "WECHAT",
|
||||
};
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
@@ -858,8 +859,6 @@
|
||||
icon: "none",
|
||||
});
|
||||
const shopUserInfo = uni.cache.get("shopUserInfo");
|
||||
console.log("shopUserInfo", shopUserInfo);
|
||||
console.log("listinfo", listinfo);
|
||||
if (shopUserInfo) {
|
||||
if (shopUserInfo.userId == listinfo.userId) {
|
||||
pay_unlock();
|
||||
@@ -1011,7 +1010,6 @@
|
||||
// 更新数据
|
||||
if (orderVIP.value) {
|
||||
orderVIP.value = uni.cache.get("orderVIP");
|
||||
paymentMethodref.value.orderVIPfun(uni.cache.get("orderVIP"));
|
||||
if (listinfo.id && ordershopUserInfo.value.registerType != "before") {
|
||||
orderorderInfo();
|
||||
}
|
||||
@@ -1034,7 +1032,7 @@
|
||||
console.log("跳转到加菜页面");
|
||||
const arr= getCurrentPages()
|
||||
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();
|
||||
}else{
|
||||
uni.cache.set('tableCode',listinfo.tableCode)
|
||||
@@ -1113,10 +1111,11 @@
|
||||
}
|
||||
|
||||
const limitTimeDiscountRes = ref(null)
|
||||
const rechargeConfig=ref(null)
|
||||
async function init(opt) {
|
||||
await storeuser.actionsproductqueryProduct();
|
||||
|
||||
console.log("init");
|
||||
const res1= await storeuser.actionsproductqueryProduct();
|
||||
orderVIP.value=res1
|
||||
console.log('orderVIP',orderVIP.value)
|
||||
cartStore.clearOrderConfig();
|
||||
Object.assign(options, opt);
|
||||
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({
|
||||
shopId: options.shopId,
|
||||
});
|
||||
//智慧充值
|
||||
const rechargeConfigRes=await rechargeApi.config({shopId: options.shopId})
|
||||
if(rechargeConfigRes&&typeof rechargeConfigRes ==='object'){
|
||||
rechargeConfig.value=rechargeConfigRes
|
||||
}
|
||||
//获取积分配置
|
||||
pointsApi.pointsConfig().then(res => {
|
||||
cartStore.setPointDeductionRule(res);
|
||||
@@ -1274,6 +1286,9 @@
|
||||
if (!isCanUseCharge.value) {
|
||||
arr.add("余额支付");
|
||||
}
|
||||
if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
|
||||
arr.add("余额支付");
|
||||
}
|
||||
|
||||
return Array.from(arr);
|
||||
});
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
const paymentmethod = reactive({
|
||||
radiovalue: 2,
|
||||
paymentBtnText: "微信支付",
|
||||
payType: 'wechatPay'
|
||||
payType: 'WECHAT'
|
||||
})
|
||||
|
||||
const groupChange = async (e) => {
|
||||
@@ -583,7 +583,6 @@
|
||||
console.log(uni.cache.get('orderVIP'))
|
||||
orderVIP.value = uni.cache.get('orderVIP')
|
||||
ordershopUserInfo.value = orderVIP.value.shopInfo
|
||||
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
|
||||
if (orderId.value) {
|
||||
orderorderInfo()
|
||||
}
|
||||
|
||||
@@ -62,8 +62,14 @@
|
||||
<view class="shop-info">
|
||||
<view class="shop-item">
|
||||
<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"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix" v-else></u-image>
|
||||
@@ -130,32 +136,37 @@
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
import {APIshopUserInfo} from '@/common/api/member.js'
|
||||
import {
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
const store = useNavbarStore();
|
||||
|
||||
async function agignOrder(item){
|
||||
async function agignOrder(item) {
|
||||
await APIshopUserInfo({
|
||||
shopId:item.shopId
|
||||
}).then(shopUserInfo=>{
|
||||
if(shopUserInfo){
|
||||
shopId: item.shopId
|
||||
}).then(shopUserInfo => {
|
||||
if (shopUserInfo) {
|
||||
uni.cache.set("dinersNum", 1);
|
||||
uni.cache.set("tableCode", shopUserInfo.id);
|
||||
uni.cache.set("shopId", item.shopId);
|
||||
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 arr.reduce((prve,cur)=>{
|
||||
return prve+cur.num
|
||||
},0)
|
||||
return arr.reduce((prve, cur) => {
|
||||
return prve + cur.num
|
||||
}, 0)
|
||||
}
|
||||
|
||||
function isRemoveOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -578,7 +589,8 @@
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.take_food_number{
|
||||
|
||||
.take_food_number {
|
||||
padding: 20rpx;
|
||||
background-color: #F8F8F8;
|
||||
margin-left: 36rpx;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<up-popup :show="visible" :round="20" mode="bottom" @close="close" :close-on-click-overlay="true">
|
||||
<view class="" style="height: calc(100vh - 70px);">
|
||||
<view class="shop_sku" >
|
||||
<view class="u-flex u-flex-col box" :style="{maxHeight:boxHeight+'px'}">
|
||||
<view class="shop_sku">
|
||||
|
||||
<scroll-view scroll-y style="height: calc(100vh - 240px); width: 100%">
|
||||
<scroll-view scroll-y class="scroll-view" :style="{maxHeight:boxHeight +'px'}">
|
||||
<!-- <view class="positionabsolute">
|
||||
<up-icon name="arrow-down" @click="close" color="#333" size="22"></up-icon>
|
||||
</view> -->
|
||||
@@ -13,13 +13,16 @@
|
||||
<up-swiper :list="goods.images" @change="swiperChange" :current="swiperCurrent" radius="6px"
|
||||
height="250" @click="prveImgs(goods.images, goods.images[swiperCurrent])">
|
||||
</up-swiper>
|
||||
|
||||
<view class="shop_sku_name">{{ goods.name }}</view>
|
||||
<view class="shop_sku_name u-flex u-row-between">
|
||||
<view class="u-line-1" style="max-width: 600rpx;">{{ goods.name }}</view>
|
||||
<ymfShare @shareClick="shareClick" />
|
||||
</view>
|
||||
<view class="shop_sku_description" v-if="isSkuGoods">
|
||||
{{ goods.shortTitle ? goods.shortTitle : '' }}
|
||||
</view>
|
||||
<view v-if="goods.type != 'package'">
|
||||
<view class="shop_sku_box" v-for="(specOptions, specType) in goods.selectSpecInfo" :key="specType">
|
||||
<view class="shop_sku_box" v-for="(specOptions, specType) in goods.selectSpecInfo"
|
||||
:key="specType">
|
||||
<view class="shop_sku_box_name">
|
||||
{{ specType }}
|
||||
</view>
|
||||
@@ -45,11 +48,15 @@
|
||||
<view v-else>
|
||||
<view class="shop_sku_box">
|
||||
<view v-for="(setmenu, setmenuindex) in goods.groupSnap" :key="setmenuindex">
|
||||
<view class="shop_sku_box_name">{{ setmenu.title }} {{ setmenu.count }}
|
||||
选{{ setmenu.number }}</view>
|
||||
<view class="shop_sku_box_name" v-if="goods.groupType!=0">{{ setmenu.title }}
|
||||
{{ setmenu.count }}
|
||||
选{{ setmenu.number }}
|
||||
</view>
|
||||
<view class="shop_sku_box_name" v-else>{{ setmenu.title }} {{ setmenu.count }}件商品</view>
|
||||
<view class="flex-start">
|
||||
<view class="shop_sku_box_item" v-for="(option, goodsid) in setmenu.goods"
|
||||
:key="goodsid" @click="goodsidClick(setmenuindex, option, goodsid)" :class="{
|
||||
:key="goodsid" @click="goodsidClick(setmenuindex, option, goodsid,setmenu)"
|
||||
:class="{
|
||||
shop_sku_box_item_selected: isOptionSelected(setmenuindex, option)
|
||||
}" :disabled="isMaxSelected(setmenuindex) && !isOptionSelected(setmenuindex, option)">
|
||||
{{ option.proName }}
|
||||
@@ -120,8 +127,72 @@
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 占位不用管下面代码也不要删除 -->
|
||||
<view class="shop_bottom" style="opacity: 0;">
|
||||
<view class="flex-between">
|
||||
<view class="price price-sku" v-if="goods.type != 'package' && goods.result">
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="selSku"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
|
||||
<text class="num" v-if="false">
|
||||
{{
|
||||
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
||||
? goods.result.memberPrice || goods.result.salePrice
|
||||
: goods.result.salePrice
|
||||
}}
|
||||
</text>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text
|
||||
v-if="goods.result.suitNum > 1">「{{ goods.result.suitNum }}{{ goods.result.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price price-package" v-else>
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="goods"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="num" v-if="false">
|
||||
{{
|
||||
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
||||
? goods.memberPrice || goods.salePrice
|
||||
: goods.salePrice
|
||||
}}
|
||||
</text>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text v-if="goods.suitNum > 1">「{{ goods.suitNum }}{{ goods.unitName }}起点」</text>
|
||||
</view>
|
||||
|
||||
<view class="operation-wrap" v-if="goods.type != 'package'&&stockNumberIsFull(goods)">
|
||||
<view class="btn">
|
||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
||||
v-if="shopCartNumber > 0"></up-icon>
|
||||
<view class="btnClick"></view>
|
||||
</view>
|
||||
<text class="num">{{ shopCartNumber }}</text>
|
||||
<view class="btn">
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
<view class="btnClick"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
|
||||
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
|
||||
</view>
|
||||
<view class="addShopping">
|
||||
库存不足
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="width: 100%;height: 123px;"></view> -->
|
||||
</scroll-view>
|
||||
<view class="shop_bottom">
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="shop_bottom" style="position: absolute;bottom: 0;z-index:100;">
|
||||
<view class="flex-between">
|
||||
<view class="price price-sku" v-if="goods.type != 'package' && goods.result">
|
||||
<text class="i">¥</text>
|
||||
@@ -141,24 +212,52 @@
|
||||
<text
|
||||
v-if="goods.result.suitNum > 1">「{{ goods.result.suitNum }}{{ goods.result.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price price-package" v-else>
|
||||
<view class="price single-and-staticPackage "
|
||||
v-else-if="goods.type=='single'||(goods.type=='package'&&goods.groupType==0)">
|
||||
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="goods"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="num" v-if="false">
|
||||
{{
|
||||
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
|
||||
? goods.memberPrice || goods.salePrice
|
||||
: goods.salePrice
|
||||
}}
|
||||
</text>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text v-if="goods.suitNum > 1">「{{ goods.suitNum }}{{ goods.unitName }}起点」</text>
|
||||
<text v-if="selSku&&selSku.suitNum > 1">「{{ selSku.suitNum }}{{ selSku.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price choosePackage "
|
||||
v-else-if="goods.type=='package'&&goods.groupType==1">
|
||||
|
||||
<view class="operation-wrap" v-if="goods.type != 'package'&&stockNumberIsFull(goods)">
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="goods"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text v-if="selSku&&selSku.suitNum > 1">「{{ selSku.suitNum }}{{ selSku.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price sku" v-else-if="goods.type=='sku'">
|
||||
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="selSku"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text v-if="selSku&&selSku.suitNum > 1">「{{ selSku.suitNum }}{{ selSku.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price price-package " v-else>
|
||||
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="selSku"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
|
||||
<text v-if="selSku&&selSku.suitNum > 1">「{{ selSku.suitNum }}{{ selSku.unitName }}起点」</text>
|
||||
</view>
|
||||
<view v-if="goods.type == 'package'&&goods.groupType==1">
|
||||
|
||||
</view>
|
||||
<view class="operation-wrap" v-else-if="stockNumberIsFull(goods)">
|
||||
<view class="btn">
|
||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
||||
v-if="shopCartNumber > 0"></up-icon>
|
||||
@@ -181,11 +280,13 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="isSkuGoods">
|
||||
<view v-if="goods.type == 'package'" class="addShopping package"
|
||||
<view v-if="goods.type == 'package' && goods.groupType!=0" class="addShopping package"
|
||||
:class=" allConditionsSatisfied ? 'active' : ''" @click="submitSelection(goods)">
|
||||
添加到购物车
|
||||
</view>
|
||||
<view v-else class="sku addShopping" :class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
||||
|
||||
<view v-else class="sku addShopping"
|
||||
:class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
||||
@click="submitSelection(goods)">
|
||||
添加到购物车
|
||||
</view>
|
||||
@@ -197,8 +298,6 @@
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -211,6 +310,7 @@
|
||||
import {
|
||||
useNavbarStore
|
||||
} from '@/stores/navbarStore';
|
||||
import ymfShare from '@/components/ymf-components/ymf-share.vue'
|
||||
const store = useNavbarStore();
|
||||
const {
|
||||
showBack,
|
||||
@@ -236,6 +336,7 @@
|
||||
import {
|
||||
computed,
|
||||
inject,
|
||||
onMounted,
|
||||
ref,
|
||||
watch
|
||||
} from "vue";
|
||||
@@ -266,7 +367,10 @@
|
||||
});
|
||||
|
||||
// / 选择规格的方法
|
||||
const goodsidClick = (setmenuindex, option, goodsid) => {
|
||||
const goodsidClick = (setmenuindex, option, goodsid, setmenu) => {
|
||||
if (props.goods.groupType == 0) {
|
||||
return
|
||||
}
|
||||
if (!selectedOptions.value[setmenuindex]) {
|
||||
// 如果 selectedOptions.value[setmenuindex] 不存在,初始化一个空数组
|
||||
selectedOptions.value[setmenuindex] = [];
|
||||
@@ -278,11 +382,14 @@
|
||||
} else if (!isMaxSelected(setmenuindex)) {
|
||||
// 如果未达到最大选择数量,添加到选中列表
|
||||
selectedOptions.value[setmenuindex].push(option);
|
||||
} else if (isMaxSelected(setmenuindex) && setmenu.number == 1) {
|
||||
selectedOptions.value[setmenuindex] = [option]
|
||||
}
|
||||
};
|
||||
|
||||
// 计算所有选中条件是否都符合
|
||||
const allConditionsSatisfied = computed(() => {
|
||||
console.log('props.goods', props.goods);
|
||||
// 检查 specifications.item.groupSnap 是否存在
|
||||
if (!props.goods?.groupSnap) {
|
||||
return false;
|
||||
@@ -306,6 +413,8 @@
|
||||
const selSku = ref(null)
|
||||
// 处理规格选择的方法
|
||||
const selectSpec = async (specType, option) => {
|
||||
console.log('specType', specType)
|
||||
console.log('option', option)
|
||||
// 规格清零
|
||||
shopCartNumber.value = 0;
|
||||
|
||||
@@ -373,7 +482,12 @@
|
||||
const swiperCurrent = ref(0);
|
||||
|
||||
function returnFirstSku(product) {
|
||||
return product.skuList[0]
|
||||
console.log('returnFirstSku', product);
|
||||
return {
|
||||
...product.skuList[0]||'',
|
||||
sku_id: product.skuList[0].id||'',
|
||||
id: product.id||'',
|
||||
}
|
||||
}
|
||||
//返回是否是多规格商品
|
||||
function returnIsSkuGoods(item) {
|
||||
@@ -392,8 +506,10 @@
|
||||
swiperCurrent.value = e.current;
|
||||
}
|
||||
|
||||
const emits = defineEmits(['prveImgs', 'websocketsendMessage', 'close', 'modalAdd'])
|
||||
|
||||
const emits = defineEmits(['prveImgs', 'websocketsendMessage', 'close', 'modalAdd','shareClick'])
|
||||
function shareClick(){
|
||||
emits('shareClick',props.goods)
|
||||
}
|
||||
function prveImgs(images, currentUrl) {
|
||||
emits('prveImgs', images, currentUrl)
|
||||
}
|
||||
@@ -407,6 +523,9 @@
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function stockNumberIsFull(item) {
|
||||
if (item.isStock && item.stockNumber < item.suitNum) {
|
||||
return false
|
||||
@@ -542,13 +661,18 @@
|
||||
if (goods.type != 'package' && shopCartNumber.value <= 0) {
|
||||
return;
|
||||
}
|
||||
if (goods.type == 'package' && !allConditionsSatisfied.value) {
|
||||
if (goods.type == 'package' && goods.groupType != 0 && !allConditionsSatisfied.value) {
|
||||
return
|
||||
}
|
||||
|
||||
if ((goods.type == 'package' && allConditionsSatisfied.value) || (goods.type ==
|
||||
'sku' && canSubmit.value)) {
|
||||
let res = cartStore.carts.find(cart => cart.product_id == goods.id && cart.sku_id == selSku.value.id)
|
||||
let res = null;
|
||||
if (goods.type == 'package') {
|
||||
res = null
|
||||
} else {
|
||||
res = cartStore.carts.find(cart => cart.product_id == goods.id && cart.sku_id == selSku.value.id)
|
||||
}
|
||||
let suitNum = 1;
|
||||
let sku_id = ''
|
||||
// 是否是套餐 有就传
|
||||
@@ -649,16 +773,30 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const boxHeight = ref(500)
|
||||
|
||||
onMounted(async () => {
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
// 计算标题的垂直偏移量
|
||||
const verticalOffset = menuButtonInfo.top;
|
||||
|
||||
const titleHeight = menuButtonInfo.height;
|
||||
console.log('systemInfo', systemInfo);
|
||||
boxHeight.value = systemInfo.windowHeight - verticalOffset - menuButtonInfo.height - systemInfo
|
||||
.safeAreaInsets.bottom - 4
|
||||
|
||||
// #endif
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: transparent;
|
||||
|
||||
.top {
|
||||
width: 750rpx;
|
||||
}
|
||||
.scroll-view {}
|
||||
}
|
||||
|
||||
.shop_sku {
|
||||
@@ -668,7 +806,11 @@
|
||||
border-radius: 20rpx;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
|
||||
.positionabsolute {
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
@@ -694,7 +836,7 @@
|
||||
padding: 0 28rpx;
|
||||
margin-top: 20rpx;
|
||||
font-weight: bold;
|
||||
font-size: 32upx;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
@@ -803,6 +945,7 @@
|
||||
background-color: #fff;
|
||||
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
@@ -26,17 +26,18 @@
|
||||
<view class="limit-discount" v-if="showLimitDiscount(item)">
|
||||
限时折扣
|
||||
</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>
|
||||
<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 class="info">
|
||||
<view class="name">
|
||||
{{
|
||||
item.cartListinfo.is_temporary == 1
|
||||
? "临时菜"
|
||||
: item.name
|
||||
}}
|
||||
<view class="name" v-if=" item.cartListinfo.is_temporary == 1">
|
||||
{{item.cartListinfo.product_name||item.cartListinfo.name|| item.name}}
|
||||
</view>
|
||||
<view class="name" v-else>{{item.name}}</view>
|
||||
<view class="select-sku-wrap" v-if="item.type == 'sku'">
|
||||
<text v-for="i in item.skuList" :key="i.id">
|
||||
{{ item.cartListinfo.sku_id == i.id ? i.name : "" }}
|
||||
@@ -206,9 +207,6 @@
|
||||
limitDiscount: props.limitDiscount.id ? props.limitDiscount : null,
|
||||
shopUserInfo: shopUserInfo,
|
||||
});
|
||||
if (goods.name == "纯生纯生纯生") {
|
||||
console.log("returnRealPrice", price);
|
||||
}
|
||||
return price;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
:class="shopInfo.isVip == 0 || shopInfo.isMemberPrice == 0 ? 'lineThrough' : ''">¥</text>
|
||||
<!-- 会员价与价格 -->
|
||||
<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 class="unit" v-if="item.unitName">/{{ item.unitName }}</text>
|
||||
@@ -161,9 +161,8 @@
|
||||
@tap.stop="$u.throttle(() => singleclick(item, '-'), 500)"></view> -->
|
||||
</view>
|
||||
<!-- <text class="num">{{ ifcartNumber(item) }}</text> -->
|
||||
|
||||
<text class="dot num"
|
||||
v-if="returnGoodsImCartNum(item1)">{{ returnGoodsImCartNum(item1) < 99 ? returnGoodsImCartNum(item1) : '99+' }}</text>
|
||||
v-if="returnGoodsImCartNum(item)">{{ returnGoodsImCartNum(item) < 99 ? returnGoodsImCartNum(item) : '99+' }}</text>
|
||||
<view class="btn">
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
<!-- <view class="btnClick"
|
||||
@@ -257,7 +256,7 @@
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<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 v-if="item1.unitName">/{{ item1.unitName }}</text>
|
||||
</view>
|
||||
@@ -491,7 +490,7 @@
|
||||
|
||||
<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.salePrice
|
||||
}}
|
||||
@@ -509,7 +508,7 @@
|
||||
</view>
|
||||
<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.salePrice
|
||||
}}
|
||||
@@ -575,14 +574,10 @@
|
||||
<ModalList></ModalList>
|
||||
<recommendGoodsModal v-if="isDataLoaded" @onBuyClick="onBuyClick"></recommendGoodsModal>
|
||||
|
||||
<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 v-for="(item,index) in goodsModalList" :key="index">
|
||||
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs"
|
||||
@shareClick="shareClick" @close="goodsModalClose(index)" @websocketsendMessage="websocketsendMessage"
|
||||
@modalAdd="modalAdd" :GoodsIDInCartNumMap="GoodsIDInCartNumMap"></goodsModal>
|
||||
</view>
|
||||
|
||||
<xbSwiperPreview :visable="showPrveImg" :imgs="prveImgsList" @update:visable="updateShowPrveImg">
|
||||
@@ -750,7 +745,9 @@
|
||||
useCartStore
|
||||
} from '@/stores/order.js';
|
||||
import {
|
||||
computed
|
||||
computed,
|
||||
provide,
|
||||
reactive
|
||||
} from 'vue';
|
||||
const cartStore = useCartStore();
|
||||
/**
|
||||
@@ -762,7 +759,6 @@
|
||||
proxy
|
||||
} = getCurrentInstance();
|
||||
|
||||
|
||||
//点单智能推荐
|
||||
function onBuyClick(item) {
|
||||
let index = -1;
|
||||
@@ -802,7 +798,6 @@
|
||||
/**
|
||||
* 通用数据合集 start
|
||||
*/
|
||||
const showGoodsModal = ref(false)
|
||||
|
||||
// 门店信息
|
||||
const shopInfo = reactive({});
|
||||
@@ -877,11 +872,11 @@
|
||||
* 返回购物车对应的商品数量
|
||||
*/
|
||||
function returnGoodsImCartNum(goods) {
|
||||
if(!goods){
|
||||
if (!goods) {
|
||||
return 0
|
||||
}
|
||||
if (GoodsIDInCartNumMap.value.hasOwnProperty(goods.id)) {
|
||||
GoodsIDInCartNumMap.value[goods.id]
|
||||
return GoodsIDInCartNumMap.value[goods.id]
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1373,12 +1368,13 @@
|
||||
prveImgs(res.images);
|
||||
}
|
||||
|
||||
const goodsModalList=ref([])
|
||||
const goodsModalList = ref([])
|
||||
|
||||
function goodsModalClose(index){
|
||||
goodsModalList.value.splice(index,1)
|
||||
function goodsModalClose(index) {
|
||||
goodsModalList.value.splice(index, 1)
|
||||
}
|
||||
function modalAdd(item){
|
||||
|
||||
function modalAdd(item) {
|
||||
clickspecifications(item)
|
||||
}
|
||||
|
||||
@@ -1398,8 +1394,8 @@
|
||||
|
||||
if (item.isSoldStock == 1 || (item.isSaleTime == 0 && !item.isSaleTimeshow)) {
|
||||
return uni.showToast({
|
||||
title:'商品已下架或不在可售时间内',
|
||||
icon:'none'
|
||||
title: '商品已下架或不在可售时间内',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1447,10 +1443,14 @@
|
||||
specifications.item.amountcartNumber = 0;
|
||||
// showShopsku.value = true;
|
||||
goodsModalList.value.push({
|
||||
show:true,
|
||||
goods:specifications.item
|
||||
show: true,
|
||||
goods: {
|
||||
...specifications.item,
|
||||
/*过滤掉只有一个规格且下架的商品或者skuList为空的商品*/
|
||||
relatedRecommendJson: (specifications.item.relatedRecommendJson || []).filter(v => v
|
||||
.skuList && v.skuList.length)
|
||||
}
|
||||
})
|
||||
// showGoodsModal.value=true
|
||||
};
|
||||
// 判断商品是否在可售时间内
|
||||
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
||||
@@ -1685,20 +1685,27 @@
|
||||
// 返回商品对应sku数据
|
||||
|
||||
function cartInit(arr) {
|
||||
|
||||
const result = []
|
||||
console.log('cartInitArr', arr);
|
||||
console.log('allGoodsArr', allGoodsArr);
|
||||
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 findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
|
||||
const memberPrice = findSku ? findSku.memberPrice : 0
|
||||
const is_temporary = v.is_temporary || v.isTemporary
|
||||
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
|
||||
...v,
|
||||
memberPrice
|
||||
}, cartStore.limitTimeDiscount, shopInfo,
|
||||
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({
|
||||
id: v.id,
|
||||
operate_type: "del",
|
||||
@@ -1747,7 +1754,7 @@
|
||||
isLoading.value = false;
|
||||
return false;
|
||||
}
|
||||
console.log('product index 收到消息', Message);
|
||||
|
||||
// 检查消息是否已经处理过
|
||||
if (processedMessageIds.has(Message.msg_id)) {
|
||||
return;
|
||||
@@ -2184,11 +2191,11 @@
|
||||
}
|
||||
return currentTime >= startTime && currentTime <= endTime;
|
||||
});
|
||||
let allGoodsArr = []
|
||||
const allGoodsArr = ref([])
|
||||
// 列表请求
|
||||
const productqueryProduct = async () => {
|
||||
cartStore.goodsIsloading = false;
|
||||
allGoodsArr = []
|
||||
allGoodsArr.value = []
|
||||
try {
|
||||
shopProductList.hots = await productminiApphotsquery();
|
||||
shopProductList.productInfo = await APIgroupquery();
|
||||
@@ -2200,38 +2207,46 @@
|
||||
setTimeout(() => {
|
||||
uni.pro.switchTab('index/index');
|
||||
}, 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.isSaleTimeshow = await isProductAvailable(product.days, product
|
||||
.startTime, product.endTime);
|
||||
|
||||
allGoodsArr.push(product)
|
||||
|
||||
// 第一步:处理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);
|
||||
});
|
||||
});
|
||||
shopProductList.hots.forEach(async (i) => {
|
||||
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
|
||||
allGoodsArr.push(i)
|
||||
cartStore.setGoodsMap(i.id, i);
|
||||
});
|
||||
console.log('shopProductList', shopProductList);
|
||||
}
|
||||
}
|
||||
|
||||
// 第二步:处理hots(同理替换forEach为for...of)
|
||||
for (const i of shopProductList.hots) {
|
||||
i.cartNumber = 0;
|
||||
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
|
||||
allGoodsArr.value.push(i);
|
||||
cartStore.setGoodsMap(i.id, i);
|
||||
}
|
||||
|
||||
// 此时所有异步操作完成,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)
|
||||
cartInit(cartStore.carts);
|
||||
}
|
||||
|
||||
cartStore.goodsIsloading = true;
|
||||
scrollTopSize.value = 0;
|
||||
topArr.value = [];
|
||||
// userStore.actionsAPIuser()
|
||||
// 数据可以更新
|
||||
isDataLoaded.value = true;
|
||||
// 历史订单
|
||||
Historicalorders();
|
||||
updateProductQuantities();
|
||||
} else {
|
||||
@@ -2245,6 +2260,16 @@
|
||||
}, 1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pageOptions.showGoodsId) {
|
||||
const item = allGoodsArr.value.find(v => v.id == pageOptions.showGoodsId)
|
||||
if (item) {
|
||||
clickspecifications(item)
|
||||
}
|
||||
pageOptions.showGoodsId = null
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
provide('cartStore', cartStore);
|
||||
@@ -2426,27 +2451,84 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad,
|
||||
returnQuery,
|
||||
jsonToUrl,wxShare,
|
||||
returnCommonQuery
|
||||
} from '@/utils/share.js'
|
||||
import { onShareTimeline } from '@dcloudio/uni-app';
|
||||
// defineOptions({
|
||||
// mixins: [shareMixin],
|
||||
// });
|
||||
|
||||
|
||||
let isGoodsShare = ref(false)
|
||||
|
||||
function shareClick() {
|
||||
isGoodsShare.value = true
|
||||
}
|
||||
|
||||
async function onShare(){
|
||||
const queryJson = await returnCommonQuery()
|
||||
let query = jsonToUrl(queryJson)
|
||||
query += '&type=beforehand'
|
||||
let json={}
|
||||
if (goodsModalList.value.length && isGoodsShare.value) {
|
||||
const goods = goodsModalList.value[goodsModalList.value.length - 1].goods
|
||||
query += '&showGoodsId=' + goods.id
|
||||
json.title = goods.name
|
||||
json.imageUrl = goods.coverImg
|
||||
json.showGoodsId = goods.id
|
||||
}else{
|
||||
json.title=uni.cache.get('shopInfo').shopName||''
|
||||
json.imageUrl=uni.cache.get('shopInfo').logo||''
|
||||
}
|
||||
console.log('onShareAppMessage', {
|
||||
query,
|
||||
...json,
|
||||
path: '/pages/product/index' + '?' + query
|
||||
});
|
||||
return wxShare({
|
||||
query,
|
||||
...json,
|
||||
path: '/pages/product/index' + '?' + query
|
||||
})
|
||||
}
|
||||
|
||||
onShareAppMessage(onShare)
|
||||
|
||||
onShareTimeline(onShare)
|
||||
|
||||
const pageOptions = reactive({})
|
||||
onLoad(async (e) => {
|
||||
Object.assign(pageOptions, e)
|
||||
if (e.type) {
|
||||
orderType.value = e.type;
|
||||
}
|
||||
//获取用户信息
|
||||
const userInfo = await APIshopUserInfo({
|
||||
shopId: uni.cache.get('shopId')
|
||||
await handleMixinOnLoad({
|
||||
...e,
|
||||
shopId: e.shopId || uni.cache.get('shopId')
|
||||
})
|
||||
//获取店铺信息
|
||||
const shopInfoRes = await APIusershopInfodetail({
|
||||
shopId: uni.cache.get('shopId')
|
||||
});
|
||||
const userInfo = userStore.userInfo
|
||||
const shopInfoRes = userStore.shopInfo
|
||||
// //获取用户信息
|
||||
// const userInfo = await APIshopUserInfo({
|
||||
// shopId: uni.cache.get('shopId')
|
||||
// })
|
||||
// //获取店铺信息
|
||||
// const shopInfoRes = await APIusershopInfodetail({
|
||||
// shopId: uni.cache.get('shopId')
|
||||
// });
|
||||
if (shopInfoRes && shopInfoRes.shopInfo) {
|
||||
Object.assign(shopInfo, shopInfoRes.shopInfo);
|
||||
uni.cache.set('shopInfo', shopInfoRes.shopInfo)
|
||||
}
|
||||
|
||||
|
||||
if (userInfo && typeof userInfo === 'object') {
|
||||
shopUserInfo.value = userInfo
|
||||
uni.cache.set('shopUserInfo', userInfo)
|
||||
}
|
||||
await productqueryProduct();
|
||||
|
||||
@@ -2579,6 +2661,7 @@
|
||||
useSocket.setOnMessage(() => {});
|
||||
}
|
||||
onHide(() => {
|
||||
isGoodsShare.value=false
|
||||
closeSocket();
|
||||
});
|
||||
onUnload(() => {
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
<text v-if="item.bizCode == 'cashback'">
|
||||
消费返现
|
||||
</text>
|
||||
<text v-if="item.bizCode == 'cashback_refund'">
|
||||
消费返现扣减
|
||||
</text>
|
||||
<text v-if="item.bizCode == 'freeIn'">
|
||||
霸王餐充值
|
||||
</text>
|
||||
|
||||
@@ -1,461 +1,427 @@
|
||||
<!-- 充值中心 -->
|
||||
<template>
|
||||
<view class="container">
|
||||
<up-navbar
|
||||
bgColor="transparent"
|
||||
title="充值中心"
|
||||
@leftClick="back"
|
||||
></up-navbar>
|
||||
<view class="header-wrap">
|
||||
<image
|
||||
class="bg"
|
||||
src="/static/czzx_header_bg.png"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="select-shop">
|
||||
<view class="select-btn">
|
||||
<up-icon name="map" color="#333"></up-icon>
|
||||
<text class="t">{{ shopInfo.shopName }}</text>
|
||||
<up-icon name="arrow-right" color="#333"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="balance-wrap">
|
||||
<view class="left">
|
||||
<text class="i t">余额</text>
|
||||
<text class="n t">{{ shopUserInfo.amount || 0 }}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="t" @click="toduihuan">兑换码</text>
|
||||
<text class="t" @click="toDetail">明细</text>
|
||||
<text class="t" @click="toPwd">密码设置</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btm-wrap">
|
||||
<view class=""> </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="u-flex u-flex-between">
|
||||
<view class="u-flex">
|
||||
<image
|
||||
src="/static/vip/money.png"
|
||||
style="width: 44rpx; height: 44rpx"
|
||||
mode=""
|
||||
></image>
|
||||
<text class="u-m-l-24 color-333 font-16 font-700">立即充值</text>
|
||||
</view>
|
||||
<view class="font-12 color-999">
|
||||
<text>充值代表接受</text>
|
||||
<text style="color: #ecb592">《用户隐私协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list u-m-t-40">
|
||||
<view
|
||||
class="item color1"
|
||||
@click="sel = index"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
:class="{ active: sel == index }"
|
||||
>
|
||||
<view class="">
|
||||
<text>¥</text>
|
||||
<text
|
||||
class="font-700"
|
||||
style="font-size: 48 u-flex-1rpx"
|
||||
:class="{ color2: sel == index }"
|
||||
>{{ item.amount }}</text
|
||||
>
|
||||
</view>
|
||||
<view
|
||||
class="font-12"
|
||||
v-if="item.rewardAmount"
|
||||
:class="{ color2: sel == index }"
|
||||
>
|
||||
<text>赠</text>
|
||||
<text>¥</text>
|
||||
<text class="font-14">{{ item.rewardAmount }}</text>
|
||||
</view>
|
||||
<view class="font-12" v-if="item.rewardPoints" style="color: #5f2e0f">
|
||||
<text>送</text>
|
||||
<text class="font-14">{{ item.rewardPoints }}</text>
|
||||
<text class="">积分</text>
|
||||
</view>
|
||||
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
||||
<text>送</text>
|
||||
<text>{{ couponNum(item.couponInfoList) }}</text>
|
||||
<text>张券</text>
|
||||
<text
|
||||
class="color2 u-m-l-8"
|
||||
v-if="sel == index"
|
||||
@click="lookCoupon(item)"
|
||||
>查看</text
|
||||
>
|
||||
</view>
|
||||
<view class="container">
|
||||
<up-navbar bgColor="transparent" title="充值中心" @leftClick="back"></up-navbar>
|
||||
<view class="header-wrap">
|
||||
<image class="bg" src="/static/czzx_header_bg.png" mode="aspectFill"></image>
|
||||
<view class="select-shop">
|
||||
<view class="select-btn">
|
||||
<up-icon name="map" color="#333"></up-icon>
|
||||
<text class="t">{{ shopInfo.shopName }}</text>
|
||||
<up-icon name="arrow-right" color="#333"></up-icon>
|
||||
</view>
|
||||
<ymf-share></ymf-share>
|
||||
</view>
|
||||
<view class="balance-wrap">
|
||||
<view class="left">
|
||||
<text class="i t">余额</text>
|
||||
<text class="n t">{{ shopUserInfo.amount || 0 }}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="t" @click="toduihuan">兑换码</text>
|
||||
<text class="t" @click="toDetail">明细</text>
|
||||
<text class="t" @click="toPwd">密码设置</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btm-wrap">
|
||||
<view class=""></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="u-flex u-flex-between">
|
||||
<view class="u-flex">
|
||||
<image src="/static/vip/money.png" style="width: 44rpx; height: 44rpx" mode=""></image>
|
||||
<text class="u-m-l-24 color-333 font-16 font-700">立即充值</text>
|
||||
</view>
|
||||
<view class="font-12 color-999">
|
||||
<text>充值代表接受</text>
|
||||
<text style="color: #ecb592">《用户隐私协议》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list u-m-t-40">
|
||||
<view class="item color1" @click="sel = index" v-for="(item, index) in list" :key="index" :class="{ active: sel == index }">
|
||||
<view class="">
|
||||
<text>¥</text>
|
||||
<text class="font-700" style="font-size: 48 u-flex-1rpx" :class="{ color2: sel == index }">{{ item.amount }}</text>
|
||||
</view>
|
||||
<view class="font-12" v-if="item.rewardAmount" :class="{ color2: sel == index }">
|
||||
<text>赠</text>
|
||||
<text>¥</text>
|
||||
<text class="font-14">{{ item.rewardAmount }}</text>
|
||||
</view>
|
||||
<view class="font-12" v-if="item.rewardPoints" style="color: #5f2e0f">
|
||||
<text>送</text>
|
||||
<text class="font-14">{{ item.rewardPoints }}</text>
|
||||
<text class="">积分</text>
|
||||
</view>
|
||||
<view class="font-12 color-666" v-if="item.couponInfoList.length">
|
||||
<text>送</text>
|
||||
<text>{{ couponNum(item.couponInfoList) }}</text>
|
||||
<text>张券</text>
|
||||
<text class="color2 u-m-l-8" v-if="sel == index" @click="lookCoupon(item)">查看</text>
|
||||
</view>
|
||||
|
||||
<view class="sel u-flex" v-if="sel == index">
|
||||
<image class="image" src="/static/vip/sel.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="state.isCustom">
|
||||
<view class="u-flex other flex-center">
|
||||
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
|
||||
<up-input
|
||||
v-model="money"
|
||||
type="number"
|
||||
placeholder="请输入充值金额"
|
||||
border="none"
|
||||
placeholder-style="font-size:14px;"
|
||||
></up-input>
|
||||
</view>
|
||||
<view class="color-999 font-12 u-m-t-4"
|
||||
>自定义金额充值时,不享受任何优惠赠送</view
|
||||
>
|
||||
</template>
|
||||
<view class="sel u-flex" v-if="sel == index">
|
||||
<image class="image" src="/static/vip/sel.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="state.isCustom">
|
||||
<view class="u-flex other flex-center">
|
||||
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
|
||||
<up-input v-model="money" type="number" placeholder="请输入充值金额" border="none" placeholder-style="font-size:14px;"></up-input>
|
||||
</view>
|
||||
<view class="color-999 font-12 u-m-t-4">自定义金额充值时,不享受任何优惠赠送</view>
|
||||
</template>
|
||||
|
||||
<button
|
||||
class="buy-btn"
|
||||
@click="buy"
|
||||
:class="{ disabled: !state.isEnable }"
|
||||
>
|
||||
<text class="font-16">¥{{ charge_money }}</text>
|
||||
<text class="font-14 u-m-l-24">立即充值</text>
|
||||
</button>
|
||||
<view class="u-m-t-36 color-999 font-12">
|
||||
<view>充值说明</view>
|
||||
<view class="u-m-t-16">
|
||||
<text>适用门店</text>
|
||||
<text class="color2 u-m-l-28" @click="toShopList"
|
||||
>全国门店通用 {{ ">" }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<text>有效期限</text>
|
||||
<text class="u-m-l-28">永久有效 </text>
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-flex-y-center">
|
||||
<text class="no-wrap">注意事项</text>
|
||||
<view class="u-m-l-28">
|
||||
<view>1.储值完成后不支持自助退款,可联系商家处理</view>
|
||||
<view> 2.余额不支持转赠,不可提现,长期有效</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-flex-y-center">
|
||||
<text class="no-wrap">充值说明</text>
|
||||
<text class="u-m-l-28" style="word-break: break-all">
|
||||
{{ state.remark || "" }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<CouponList
|
||||
v-model="couponModel.show"
|
||||
:list="couponModel.couponInfoList"
|
||||
></CouponList>
|
||||
</view>
|
||||
<button class="buy-btn" @click="buy" :class="{ disabled: !state.isEnable }">
|
||||
<text class="font-16">¥{{ charge_money }}</text>
|
||||
<text class="font-14 u-m-l-24">立即充值</text>
|
||||
</button>
|
||||
<view class="u-m-t-36 color-999 font-12">
|
||||
<view>充值说明</view>
|
||||
<view class="u-m-t-16">
|
||||
<text>适用门店</text>
|
||||
<text class="color2 u-m-l-28" @click="toShopList">全国门店通用 {{ '>' }}</text>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<text>有效期限</text>
|
||||
<text class="u-m-l-28">永久有效</text>
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-flex-y-center">
|
||||
<text class="no-wrap">注意事项</text>
|
||||
<view class="u-m-l-28">
|
||||
<view>1.储值完成后不支持自助退款,可联系商家处理</view>
|
||||
<view>2.余额不支持转赠,不可提现,长期有效</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-16 u-flex u-flex-y-center">
|
||||
<text class="no-wrap">充值说明</text>
|
||||
<text class="u-m-l-28" style="word-break: break-all">
|
||||
{{ state.remark || '' }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<CouponList v-model="couponModel.show" :list="couponModel.couponInfoList"></CouponList>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { APIusershopInfodetail, APIshopUserInfo } from "@/common/api/member.js";
|
||||
import CouponList from "@/components/coupon/list.vue";
|
||||
import * as rechargeApi from "@/common/api/market/recharge.js";
|
||||
import { recharge } from "@/common/api/order/index.js";
|
||||
import { joinMember } from "@/common/api/order/index.js";
|
||||
import { ref, onMounted, computed, reactive, watch } from "vue";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { pay } from "@/utils/pay.js";
|
||||
import ymfShare from '@/components/ymf-components/ymf-share.vue';
|
||||
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
|
||||
import { APIusershopInfodetail, APIshopUserInfo } from '@/common/api/member.js';
|
||||
import CouponList from '@/components/coupon/list.vue';
|
||||
import * as rechargeApi from '@/common/api/market/recharge.js';
|
||||
import { recharge } from '@/common/api/order/index.js';
|
||||
import { joinMember } from '@/common/api/order/index.js';
|
||||
import { ref, onMounted, computed, reactive, watch } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { pay } from '@/utils/pay.js';
|
||||
|
||||
function toShopList() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/user/member/czzx-shop-list?shopId=" + option.shopId,
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/member/czzx-shop-list?shopId=' + option.shopId
|
||||
});
|
||||
}
|
||||
|
||||
function toduihuan() {
|
||||
uni.navigateTo({
|
||||
url: "/user/exchange/index",
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/user/exchange/index'
|
||||
});
|
||||
}
|
||||
|
||||
function couponNum(list) {
|
||||
return list.reduce((prve, cur) => {
|
||||
return prve + cur.num;
|
||||
}, 0);
|
||||
return list.reduce((prve, cur) => {
|
||||
return prve + cur.num;
|
||||
}, 0);
|
||||
}
|
||||
const couponModel = reactive({
|
||||
show: false,
|
||||
couponInfoList: [],
|
||||
show: false,
|
||||
couponInfoList: []
|
||||
});
|
||||
|
||||
function lookCoupon(item) {
|
||||
couponModel.show = true;
|
||||
couponModel.couponInfoList = item.couponInfoList;
|
||||
couponModel.show = true;
|
||||
couponModel.couponInfoList = item.couponInfoList;
|
||||
}
|
||||
async function buy() {
|
||||
if (!state.isEnable) {
|
||||
return uni.showToast({
|
||||
title: "充值未开启,暂不能充值",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
if (!charge_money.value) {
|
||||
return uni.showToast({
|
||||
title: "请选择或者输入充值金额",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
const json = {
|
||||
shopId: option.shopId,
|
||||
shopUserId: shopUserInfo.id,
|
||||
};
|
||||
if (sel.value < 0) {
|
||||
json.amount = `${money.value}`.trim() * 1;
|
||||
} else {
|
||||
json.rechargeDetailId = list.value[sel.value].id;
|
||||
json.amount = list.value[sel.value].amount;
|
||||
}
|
||||
const res = await recharge(json);
|
||||
if (!res) {
|
||||
return uni.showToast({
|
||||
title: "充值失败",
|
||||
icon: "error",
|
||||
});
|
||||
}
|
||||
const payRes = await pay(res);
|
||||
console.log(payRes);
|
||||
if (payRes) {
|
||||
uni.showToast({
|
||||
title: "充值成功",
|
||||
icon: "none",
|
||||
});
|
||||
init();
|
||||
}
|
||||
if (!state.isEnable) {
|
||||
return uni.showToast({
|
||||
title: '充值未开启,暂不能充值',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
if (!charge_money.value) {
|
||||
return uni.showToast({
|
||||
title: '请选择或者输入充值金额',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
const json = {
|
||||
shopId: option.shopId,
|
||||
shopUserId: shopUserInfo.id
|
||||
};
|
||||
if (sel.value < 0) {
|
||||
json.amount = `${money.value}`.trim() * 1;
|
||||
} else {
|
||||
json.rechargeDetailId = list.value[sel.value].id;
|
||||
json.amount = list.value[sel.value].amount;
|
||||
}
|
||||
const res = await recharge(json);
|
||||
if (!res) {
|
||||
return uni.showToast({
|
||||
title: '充值失败',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
const payRes = await pay(res);
|
||||
console.log(payRes);
|
||||
if (payRes) {
|
||||
uni.showToast({
|
||||
title: '充值成功',
|
||||
icon: 'none'
|
||||
});
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
function toDetail() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/user/member/billDetails?type=1&shopId=" + option.shopId,
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/member/billDetails?type=1&shopId=' + option.shopId
|
||||
});
|
||||
}
|
||||
|
||||
function toPwd() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/user/member/setPassword?type=1&shopId=" + option.shopId,
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/member/setPassword?type=1&shopId=' + option.shopId
|
||||
});
|
||||
}
|
||||
|
||||
function back() {
|
||||
uni.navigateBack();
|
||||
uni.navigateBack();
|
||||
}
|
||||
const list = ref([]);
|
||||
const sel = ref(0);
|
||||
const money = ref(null);
|
||||
const option = reactive({
|
||||
shopId: "",
|
||||
shopId: ''
|
||||
});
|
||||
const shopInfo = reactive({});
|
||||
const shopUserInfo = reactive({});
|
||||
const state = reactive({});
|
||||
async function init() {
|
||||
const shopInfoRes = await APIusershopInfodetail({
|
||||
shopId: option.shopId,
|
||||
});
|
||||
if (shopInfoRes) {
|
||||
Object.assign(shopInfo, shopInfoRes.shopInfo);
|
||||
}
|
||||
const shopUserInfoRes = await APIshopUserInfo({
|
||||
shopId: option.shopId,
|
||||
});
|
||||
if (shopUserInfoRes) {
|
||||
Object.assign(shopUserInfo, shopUserInfoRes);
|
||||
}
|
||||
const res = await rechargeApi.config({
|
||||
shopId: option.shopId,
|
||||
});
|
||||
if (res) {
|
||||
Object.assign(state, res);
|
||||
list.value = res.rechargeDetailList;
|
||||
}
|
||||
const shopInfoRes = await APIusershopInfodetail({
|
||||
shopId: option.shopId
|
||||
});
|
||||
if (shopInfoRes) {
|
||||
Object.assign(shopInfo, shopInfoRes.shopInfo);
|
||||
}
|
||||
const shopUserInfoRes = await APIshopUserInfo({
|
||||
shopId: option.shopId
|
||||
});
|
||||
if (shopUserInfoRes) {
|
||||
Object.assign(shopUserInfo, shopUserInfoRes);
|
||||
}
|
||||
const res = await rechargeApi.config({
|
||||
shopId: option.shopId
|
||||
});
|
||||
if (res) {
|
||||
Object.assign(state, res);
|
||||
list.value = res.rechargeDetailList;
|
||||
}
|
||||
}
|
||||
const charge_money = computed(() => {
|
||||
if (sel.value < 0) {
|
||||
if (money.value > 0) {
|
||||
return money.value;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
const item = list.value[sel.value];
|
||||
if (item) {
|
||||
return item.amount;
|
||||
}
|
||||
return "";
|
||||
if (sel.value < 0) {
|
||||
if (money.value > 0) {
|
||||
return money.value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
const item = list.value[sel.value];
|
||||
if (item) {
|
||||
return item.amount;
|
||||
}
|
||||
return '';
|
||||
});
|
||||
onLoad((opt) => {
|
||||
Object.assign(option, opt);
|
||||
// init();
|
||||
|
||||
onShareAppMessage(async (res) => {
|
||||
let query = await returnQuery();
|
||||
return {
|
||||
title: `充值-${shopInfo.shopName}`,
|
||||
path: `/pages/user/member/czzx?${query}`,
|
||||
imageUrl: shopInfo.logo,
|
||||
query
|
||||
};
|
||||
});
|
||||
|
||||
onLoad(async (opt) => {
|
||||
Object.assign(option, opt);
|
||||
await handleMixinOnLoad(opt);
|
||||
// init();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => money.value,
|
||||
(newval) => {
|
||||
if (newval && newval > 0) {
|
||||
sel.value = -1;
|
||||
}
|
||||
}
|
||||
() => money.value,
|
||||
(newval) => {
|
||||
if (newval && newval > 0) {
|
||||
sel.value = -1;
|
||||
}
|
||||
}
|
||||
);
|
||||
onShow(() => {
|
||||
init();
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.color1 {
|
||||
color: #5f2e0f;
|
||||
color: #5f2e0f;
|
||||
}
|
||||
|
||||
.color2 {
|
||||
color: #ff6300;
|
||||
color: #ff6300;
|
||||
}
|
||||
|
||||
.buy-btn {
|
||||
margin-top: 28rpx;
|
||||
padding: 32rpx 32rpx;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
border-radius: 80rpx;
|
||||
line-height: 1;
|
||||
background: linear-gradient(98deg, #fe6d1100 40.64%, #ffd1b4 105.2%),
|
||||
linear-gradient(259deg, #fe6d11 50.14%, #ffd1b4 114.93%);
|
||||
box-shadow: 0 14rpx 30.4rpx 0 #fe8b435e;
|
||||
&.disabled {
|
||||
background: #eee;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
color: #999;
|
||||
}
|
||||
margin-top: 28rpx;
|
||||
padding: 32rpx 32rpx;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
border-radius: 80rpx;
|
||||
line-height: 1;
|
||||
background: linear-gradient(98deg, #fe6d1100 40.64%, #ffd1b4 105.2%), linear-gradient(259deg, #fe6d11 50.14%, #ffd1b4 114.93%);
|
||||
box-shadow: 0 14rpx 30.4rpx 0 #fe8b435e;
|
||||
&.disabled {
|
||||
background: #eee;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.other {
|
||||
background: #f6f6f6;
|
||||
padding: 24rpx 16rpx;
|
||||
margin-top: 40rpx;
|
||||
background: #f6f6f6;
|
||||
padding: 24rpx 16rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
width: 100%;
|
||||
height: 530rpx;
|
||||
box-sizing: border-box;
|
||||
padding: calc(var(--status-bar-height) + 140rpx) 28rpx 28rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 530rpx;
|
||||
box-sizing: border-box;
|
||||
padding: calc(var(--status-bar-height) + 140rpx) 28rpx 28rpx;
|
||||
position: relative;
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.select-shop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
.select-shop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.select-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12upx;
|
||||
.select-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12upx;
|
||||
|
||||
.t {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
.t {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balance-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
padding-top: 20rpx;
|
||||
.balance-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.t {
|
||||
color: #5e3110;
|
||||
.t {
|
||||
color: #5e3110;
|
||||
|
||||
&.i {
|
||||
position: relative;
|
||||
top: 10upx;
|
||||
font-size: 28upx;
|
||||
}
|
||||
&.i {
|
||||
position: relative;
|
||||
top: 10upx;
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
&.n {
|
||||
font-size: 64upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.n {
|
||||
font-size: 64upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12upx;
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12upx;
|
||||
|
||||
.t {
|
||||
color: #86491d;
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.t {
|
||||
color: #86491d;
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
padding: 40rpx 28rpx 0 28rpx;
|
||||
transform: translateY(-140rpx);
|
||||
border-radius: 74rpx 74rpx 0 0;
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
padding: 40rpx 28rpx 0 28rpx;
|
||||
transform: translateY(-140rpx);
|
||||
border-radius: 74rpx 74rpx 0 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
column-gap: 20rpx;
|
||||
row-gap: 22rpx;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
column-gap: 20rpx;
|
||||
row-gap: 22rpx;
|
||||
|
||||
.item {
|
||||
padding: 36rpx 22rpx;
|
||||
border-radius: 42rpx;
|
||||
background: linear-gradient(180deg, #f5f5f5 58.54%, #fff 140.47%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border: 6rpx solid transparent;
|
||||
transition: all 0.3s ease-in-out;
|
||||
.item {
|
||||
padding: 36rpx 22rpx;
|
||||
border-radius: 42rpx;
|
||||
background: linear-gradient(180deg, #f5f5f5 58.54%, #fff 140.47%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
border: 6rpx solid transparent;
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(180deg, #ffc29a -26.17%, #fff 64.06%);
|
||||
border: 6rpx solid #fe6c0e;
|
||||
box-shadow: 0 0 31rpx 2rpx #fe8b435e;
|
||||
}
|
||||
&.active {
|
||||
background: linear-gradient(180deg, #ffc29a -26.17%, #fff 64.06%);
|
||||
border: 6rpx solid #fe6c0e;
|
||||
box-shadow: 0 0 31rpx 2rpx #fe8b435e;
|
||||
}
|
||||
|
||||
.sel {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
.sel {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
|
||||
transform: translateX(-50%) translateY(21rpx);
|
||||
transform: translateX(-50%) translateY(21rpx);
|
||||
|
||||
.image {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.image {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1115
pages/user/user.vue
1115
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
|
||||
version: 0.1.2
|
||||
ysk-utils:
|
||||
specifier: ^1.0.81
|
||||
version: 1.0.81
|
||||
specifier: ^1.0.83
|
||||
version: 1.0.83
|
||||
devDependencies:
|
||||
unplugin-auto-import:
|
||||
specifier: ^0.16.7
|
||||
@@ -357,8 +357,8 @@ packages:
|
||||
webpack-virtual-modules@0.6.2:
|
||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||
|
||||
ysk-utils@1.0.81:
|
||||
resolution: {integrity: sha512-c6SOfOaw43aDDuyXgEv24Vo561EfFoa1gfGbY+p1EfXHoGPOE6tQLekbWW9bn37KAse0Gdef7VCbdv0Dr6ltaw==}
|
||||
ysk-utils@1.0.83:
|
||||
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
|
||||
|
||||
snapshots:
|
||||
|
||||
@@ -684,7 +684,7 @@ snapshots:
|
||||
|
||||
webpack-virtual-modules@0.6.2: {}
|
||||
|
||||
ysk-utils@1.0.81:
|
||||
ysk-utils@1.0.83:
|
||||
dependencies:
|
||||
bignumber.js: 9.3.1
|
||||
loadsh: 0.0.4
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<view @click="prveImg(item.goodsImageUrl)">
|
||||
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFill" ></image>
|
||||
<image class="top-img" :src="item.goodsImageUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
</template>
|
||||
<view class="sku">
|
||||
@@ -55,10 +55,10 @@
|
||||
|
||||
<view style="height: 140px"></view>
|
||||
<view class="fixed-bottom u-flex u-row-center">
|
||||
<view v-if="isCanExchange" class="btn" @click="exchangeClick" >
|
||||
<view v-if="isCanExchange" class="btn" @click="exchangeClick">
|
||||
{{returnBtmText}}
|
||||
</view>
|
||||
<view class="btn gray" v-else >
|
||||
<view class="btn gray" v-else>
|
||||
{{returnBtmText}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -125,6 +125,11 @@
|
||||
} from '@/utils/uniapp.js'
|
||||
import modal from "@/scoreShop/components/modal.vue";
|
||||
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
||||
import {
|
||||
userPoints
|
||||
} from "@/common/api/market/points.js";
|
||||
|
||||
|
||||
import couponIcon from "@/components/coupon-icon/index";
|
||||
import {
|
||||
pay
|
||||
@@ -136,9 +141,9 @@
|
||||
show: false,
|
||||
});
|
||||
|
||||
function prveImg(url){
|
||||
function prveImg(url) {
|
||||
uni.previewImage({
|
||||
urls:[url]
|
||||
urls: [url]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -304,16 +309,63 @@
|
||||
return `单人兑换已达上限`
|
||||
}
|
||||
})
|
||||
onLoad((opt) => {
|
||||
const exchange_goods = uni.getStorageSync('exchange_goods')
|
||||
if (exchange_goods.goodsDescription) {
|
||||
exchange_goods.goodsDescription = JSON.parse(exchange_goods.goodsDescription)
|
||||
async function getGoods() {
|
||||
const res = await pointGoodsApi.pointsGoods({
|
||||
id: options.id
|
||||
})
|
||||
if (res.goodsDescription) {
|
||||
res.goodsDescription = JSON.parse(res.goodsDescription)
|
||||
} else {
|
||||
exchange_goods.goodsDescription = []
|
||||
res.goodsDescription = []
|
||||
}
|
||||
const pointsUserData = uni.getStorageSync('pointsUser')
|
||||
Object.assign(item, exchange_goods)
|
||||
Object.assign(pointsUser, pointsUserData)
|
||||
res.couponInfo=res.couponInfo||{}
|
||||
|
||||
Object.assign(item, res)
|
||||
}
|
||||
async function getPointUser() {
|
||||
const res = await userPoints({
|
||||
shopUserId: uni.cache.get('shopUserInfo').id || ''
|
||||
})
|
||||
Object.assign(pointsUser, res.pointsUser)
|
||||
}
|
||||
async function init() {
|
||||
await getGoods()
|
||||
await getPointUser()
|
||||
}
|
||||
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad,wxShare,returnQuery
|
||||
} from '@/utils/share.js'
|
||||
// defineOptions({
|
||||
// mixins: [shareMixin],
|
||||
// });
|
||||
|
||||
onShareAppMessage(async(res)=>{
|
||||
const query=await returnQuery()
|
||||
return wxShare({
|
||||
...res,
|
||||
title:item.goodsName,
|
||||
path:'/scoreShop/detail/index'+'?'+query,
|
||||
query,
|
||||
imageUrl:item.goodsImageUrl||''
|
||||
})
|
||||
})
|
||||
|
||||
const options = reactive({})
|
||||
onLoad(async (opt) => {
|
||||
Object.assign(options, opt)
|
||||
await handleMixinOnLoad(opt)
|
||||
await init()
|
||||
// const exchange_goods = uni.getStorageSync('exchange_goods')
|
||||
// if (exchange_goods.goodsDescription) {
|
||||
// exchange_goods.goodsDescription = JSON.parse(exchange_goods.goodsDescription)
|
||||
// } else {
|
||||
// exchange_goods.goodsDescription = []
|
||||
// }
|
||||
// const pointsUserData = uni.getStorageSync('pointsUser')
|
||||
// Object.assign(item, exchange_goods)
|
||||
// Object.assign(pointsUser, pointsUserData)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -463,7 +515,8 @@
|
||||
height: 184rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #d9d9d9;
|
||||
&.bg-fff{
|
||||
|
||||
&.bg-fff {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
@@ -487,7 +540,8 @@
|
||||
font-size: 700;
|
||||
}
|
||||
}
|
||||
.w-full{
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -74,7 +74,7 @@
|
||||
function toDetail(item) {
|
||||
uni.setStorageSync('exchange_goods', item)
|
||||
uni.navigateTo({
|
||||
url: '/scoreShop/detail/index?id=' + item.id,
|
||||
url: '/scoreShop/detail/index?id=' + item.id+'&shopId='+item.shopId,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
<view class="tab-item" :class="tabActive === 0 ? 'active' : ''" @click="tabActive = 0">优惠券</view>
|
||||
<view class="tab-item" :class="tabActive === 1 ? 'active' : ''" @click="tabActive = 1">其它商品</view>
|
||||
</view>
|
||||
<view class="u-flex" @click="toggleLayout">
|
||||
<view class="u-flex gap-20" @click="toggleLayout">
|
||||
<image :src="layout === 'block' ? imgs.layout_block : imgs.layout" class="layout" />
|
||||
<ymfShare size="40rpx" color="#9C571F"></ymfShare>
|
||||
</view>
|
||||
</view>
|
||||
<goodsList :pointsUser="pointsUser" :layout="layout" :list="list" @exchange="exchange"></goodsList>
|
||||
@@ -44,6 +45,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import ymfShare from '@/components/ymf-components/ymf-share.vue'
|
||||
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
|
||||
import goodsList from "./components/goods-list.vue";
|
||||
import {
|
||||
@@ -70,9 +72,18 @@
|
||||
}
|
||||
|
||||
function back() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
const pages = getCurrentPages();
|
||||
if(pages.length<2){
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// function exchange(item) {
|
||||
@@ -87,12 +98,13 @@
|
||||
// }
|
||||
|
||||
function toDetail() {
|
||||
if(!pointsUser.value||!pointsUser.value.id){
|
||||
if (!pointsUser.value || !pointsUser.value.id) {
|
||||
return
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value?pointsUser.value.id :
|
||||
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value ?
|
||||
pointsUser.value.id :
|
||||
'')
|
||||
})
|
||||
}
|
||||
@@ -132,7 +144,21 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
onLoad((opt) => {
|
||||
|
||||
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad
|
||||
} from '@/utils/share.js'
|
||||
defineOptions({
|
||||
mixins: [shareMixin],
|
||||
});
|
||||
|
||||
const options = reactive({
|
||||
|
||||
})
|
||||
onLoad(async (opt) => {
|
||||
Object.assign(options, opt)
|
||||
query.shopId = opt.shopId || ''
|
||||
})
|
||||
watch(() => tabActive.value, (newval, oldval) => {
|
||||
@@ -151,8 +177,19 @@
|
||||
query.page++
|
||||
getList();
|
||||
})
|
||||
onShow(() => {
|
||||
refresh()
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
const storeuser = productStore();
|
||||
|
||||
|
||||
onShow(async () => {
|
||||
if (!storeuser.isHasLogin) {
|
||||
await handleMixinOnLoad(options)
|
||||
refresh()
|
||||
} else {
|
||||
refresh()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@@ -163,7 +200,9 @@
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.gap-20{
|
||||
gap: 20rpx;
|
||||
}
|
||||
.top {
|
||||
padding: 138rpx 26rpx 48rpx 42rpx;
|
||||
display: flex;
|
||||
|
||||
@@ -1,124 +1,130 @@
|
||||
<template>
|
||||
<view class="min-page bg-f7 u-font-28 color-333">
|
||||
<up-navbar
|
||||
title="兑换成功"
|
||||
bgColor="transparent"
|
||||
leftIconColor="#333"
|
||||
@leftClick="back()"
|
||||
titleStyle="color:#333"
|
||||
></up-navbar>
|
||||
<view class="content">
|
||||
<view class="bg" :style="{ backgroundImage: `url(${imgs.bg})` }">
|
||||
<image :src="imgs.success" class="success"></image>
|
||||
<view class="u-font-40 font-700">兑换成功</view>
|
||||
<view class="u-font-32 font-700">{{item.pointsGoodsName}}</view>
|
||||
<view class="u-m-t-14" v-if="item.goodsCategory!='优惠券'">需前往店铺自行兑换领取</view>
|
||||
<view class="u-m-t-14" v-else>优惠券直接到账您的账户中</view>
|
||||
</view>
|
||||
<view class="info u-flex u-flex-col">
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">兑换商品:</text>
|
||||
<text>{{item.pointsGoodsName}}</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">兑换数量:</text>
|
||||
<text>{{item.number}}份</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">消耗积分:</text>
|
||||
<text>{{item.spendPoints}}</text>
|
||||
</view>
|
||||
<view class="u-p-22" v-if="item.extraPaymentAmount">
|
||||
<text class="color-666">支付金额:</text>
|
||||
<text>{{item.extraPaymentAmount}}</text>
|
||||
<view class="min-page bg-f7 u-font-28 color-333">
|
||||
<up-navbar title="兑换成功" bgColor="transparent" leftIconColor="#333" @leftClick="back()"
|
||||
titleStyle="color:#333"></up-navbar>
|
||||
<view class="content">
|
||||
<view class="bg" :style="{ backgroundImage: `url(${imgs.bg})` }">
|
||||
<image :src="imgs.success" class="success"></image>
|
||||
<view class="u-font-40 font-700">兑换成功</view>
|
||||
<view class="u-font-32 font-700">{{item.pointsGoodsName}}</view>
|
||||
<view class="u-m-t-14" v-if="item.goodsCategory!='优惠券'">需前往店铺自行兑换领取</view>
|
||||
<view class="u-m-t-14" v-else>优惠券直接到账您的账户中</view>
|
||||
</view>
|
||||
<view class="info u-flex u-flex-col">
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">兑换商品:</text>
|
||||
<text>{{item.pointsGoodsName}}</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">兑换数量:</text>
|
||||
<text>{{item.number}}份</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">消耗积分:</text>
|
||||
<text>{{item.spendPoints}}</text>
|
||||
</view>
|
||||
<view class="u-p-22" v-if="item.extraPaymentAmount">
|
||||
<text class="color-666">支付金额:</text>
|
||||
<text>{{item.extraPaymentAmount}}</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">下单时间:</text>
|
||||
<text>{{item.createTime}}</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">订单号:</text>
|
||||
<text>:{{item.orderNo}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex bottom u-row-center">
|
||||
<view class="back btn" @click="back">继续兑换</view>
|
||||
<view class="look btn" @click="lookOrder">查看订单</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">下单时间:</text>
|
||||
<text>{{item.createTime}}</text>
|
||||
</view>
|
||||
<view class="u-p-22">
|
||||
<text class="color-666">订单号:</text>
|
||||
<text>:{{item.orderNo}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex bottom u-row-center">
|
||||
<view class="back btn" @click="back">继续兑换</view>
|
||||
<view class="look btn" @click="lookOrder">查看订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const imgs = {
|
||||
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/b625560a5b75418c9e643841f8674a0c.png",
|
||||
success: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/c2f0865efb444de58ff0d8bb3a51d300.png",
|
||||
};
|
||||
|
||||
function back() {
|
||||
const pages = getCurrentPages();
|
||||
if(pages.length<2){
|
||||
uni.redirectTo({
|
||||
url: '/scoreShop/index/index?shopId=' + item.shopId
|
||||
})
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
|
||||
const imgs = {
|
||||
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/b625560a5b75418c9e643841f8674a0c.png",
|
||||
success:
|
||||
"https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/c2f0865efb444de58ff0d8bb3a51d300.png",
|
||||
};
|
||||
function back() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
function lookOrder() {
|
||||
uni.redirectTo({
|
||||
url:'/scoreShop/order/index?shopId='+item.shopId
|
||||
})
|
||||
}
|
||||
const item=reactive({
|
||||
function lookOrder() {
|
||||
uni.redirectTo({
|
||||
url: '/scoreShop/order/index?shopId=' + item.shopId
|
||||
})
|
||||
}
|
||||
const item = reactive({
|
||||
|
||||
})
|
||||
onLoad(opt=>{
|
||||
const exchange_goods_success_data=uni.getStorageSync('exchange_goods_success')
|
||||
Object.assign(item,exchange_goods_success_data)
|
||||
})
|
||||
onLoad(opt => {
|
||||
const exchange_goods_success_data = uni.getStorageSync('exchange_goods_success')
|
||||
Object.assign(item, exchange_goods_success_data)
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background: linear-gradient(180deg, #f5cd82 0%, rgba(247, 219, 165, 0) 100%);
|
||||
height: 670rpx;
|
||||
$color: #9c571f;
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 586rpx;
|
||||
background-size: cover;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-bottom: 26rpx;
|
||||
color: $color;
|
||||
.content {
|
||||
background: linear-gradient(180deg, #f5cd82 0%, rgba(247, 219, 165, 0) 100%);
|
||||
height: 670rpx;
|
||||
$color: #9c571f;
|
||||
|
||||
.success {
|
||||
width: 310rpx;
|
||||
height: 206rpx;
|
||||
}
|
||||
}
|
||||
.info {
|
||||
padding-left: 174rpx;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
gap: 48rpx;
|
||||
margin-top: 44rpx;
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 586rpx;
|
||||
background-size: cover;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-bottom: 26rpx;
|
||||
color: $color;
|
||||
|
||||
.btn {
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 100rpx;
|
||||
font-size: 32rpx;
|
||||
border: 1px solid transparent;
|
||||
&.back {
|
||||
border-color: $my-main-color;
|
||||
color: $my-main-color;
|
||||
}
|
||||
&.look {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.success {
|
||||
width: 310rpx;
|
||||
height: 206rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-left: 174rpx;
|
||||
padding-right: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
gap: 48rpx;
|
||||
margin-top: 44rpx;
|
||||
|
||||
.btn {
|
||||
padding: 14rpx 76rpx;
|
||||
border-radius: 100rpx;
|
||||
font-size: 32rpx;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&.back {
|
||||
border-color: $my-main-color;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
&.look {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -40,6 +40,9 @@ export const useCartsStore = defineStore("cart", () => {
|
||||
//用户信息
|
||||
const shopUserInfo = ref(uni.cache.get("shopUserInfo") || {});
|
||||
|
||||
//全部的商品列表
|
||||
const allGoodsArr=ref([])
|
||||
|
||||
const consumeDiscount = ref({});
|
||||
|
||||
// 适配工具库 BaseCartItem 接口的商品数据转换函数
|
||||
@@ -326,7 +329,11 @@ export const useCartsStore = defineStore("cart", () => {
|
||||
.map((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({
|
||||
id: v.id,
|
||||
operate_type: "del",
|
||||
@@ -496,10 +503,10 @@ export const useCartsStore = defineStore("cart", () => {
|
||||
return false;
|
||||
}
|
||||
const isUse =
|
||||
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice && shopInfo.value
|
||||
.isMemberPrice == 1 ?
|
||||
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice ?
|
||||
true :
|
||||
false;
|
||||
console.log('useVipPrice',isUse);
|
||||
return isUse;
|
||||
});
|
||||
|
||||
@@ -754,6 +761,6 @@ export const useCartsStore = defineStore("cart", () => {
|
||||
//限时折扣
|
||||
limitTimeDiscount,
|
||||
shopUserInfo,
|
||||
socketSendMsg,
|
||||
socketSendMsg,allGoodsArr
|
||||
};
|
||||
});
|
||||
@@ -25,7 +25,7 @@ export const Memberpay = defineStore('memberpay', {
|
||||
let res = await APIpayltPayVip({
|
||||
...data,
|
||||
// #ifdef MP-WEIXIN
|
||||
payType: 'wechatPay',
|
||||
payType: 'WECHAT',
|
||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
@@ -113,7 +113,7 @@ export const Memberpay = defineStore('memberpay', {
|
||||
}
|
||||
},
|
||||
// #ifdef MP-WEIXIN
|
||||
payType: 'wechatPay',
|
||||
payType: 'WECHAT',
|
||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
|
||||
114
stores/user.js
114
stores/user.js
@@ -49,7 +49,7 @@ export const Storelogin = defineStore("login", {
|
||||
rawData: infoRes.rawData,
|
||||
source: "wechat",
|
||||
});
|
||||
console.log('APIuserlogin',res);
|
||||
console.log('APIuserlogin', res);
|
||||
if (res) {
|
||||
this.token = res.token;
|
||||
this.miniAppOpenId = res.userInfo
|
||||
@@ -110,12 +110,90 @@ export const productStore = defineStore("product", {
|
||||
latitude: "",
|
||||
longitude: "",
|
||||
},
|
||||
token: "",
|
||||
miniAppOpenId: "",
|
||||
userInfo: "",
|
||||
shopId: uni.cache.get('shopId') || '',
|
||||
shopInfo: {
|
||||
shopId: "",
|
||||
isOrderFence: 0,
|
||||
id: '',
|
||||
},
|
||||
shopUserInfo:{
|
||||
|
||||
},
|
||||
isHasLogin:false
|
||||
}),
|
||||
actions: {
|
||||
actionslogin() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
success: (data) => {
|
||||
// 微信小程序环境
|
||||
uni.getUserInfo({
|
||||
provider: "weixin",
|
||||
success: async (infoRes) => {
|
||||
let res = await APIuserlogin({
|
||||
code: data.code, //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
source: "wechat",
|
||||
});
|
||||
console.log('APIuserlogin', res);
|
||||
if (res) {
|
||||
this.token = res.token;
|
||||
this.isHasLogin=true
|
||||
this.miniAppOpenId = res.userInfo
|
||||
.miniAppOpenId;
|
||||
this.userInfo = res.userInfo;
|
||||
uni.cache.set("token", res.token);
|
||||
uni.cache.set("userInfo", res.userInfo);
|
||||
uni.cache.set("followIndex", res
|
||||
.followIndex || "");
|
||||
}
|
||||
resolve(true);
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(false);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.getAuthCode({
|
||||
scopes: "auth_base",
|
||||
success: async (data) => {
|
||||
// 支付宝小程序环境
|
||||
// my.getAuthUserInfo({
|
||||
// success: async (infoRes) => {
|
||||
let res = await APIuserlogin({
|
||||
code: data.authCode, //临时登录凭证
|
||||
// rawData: JSON.stringify(infoRes),
|
||||
source: "alipay",
|
||||
});
|
||||
if (res) {
|
||||
this.isHasLogin=true
|
||||
this.token = res.token;
|
||||
this.miniAppOpenId = res.userInfo.miniAppOpenId;
|
||||
this.userInfo = res.userInfo;
|
||||
uni.cache.set("token", res.token);
|
||||
uni.cache.set("openId", res.userInfo.alipayOpenId);
|
||||
uni.cache.set("userInfo", res.userInfo);
|
||||
resolve(true);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
reject(false);
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
resolve(true)
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
getLocation() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("获取经纬度");
|
||||
@@ -185,7 +263,7 @@ export const productStore = defineStore("product", {
|
||||
console.log("扫码内容", q);
|
||||
// #ifdef H5
|
||||
uni.navigateTo({
|
||||
url:'/pages/product/index'
|
||||
url: '/pages/product/index'
|
||||
})
|
||||
return
|
||||
// #endif
|
||||
@@ -448,19 +526,43 @@ export const productStore = defineStore("product", {
|
||||
|
||||
// 通过shopId 获取店铺会员信息
|
||||
actionsproductqueryProduct() {
|
||||
console.log('actionsproductqueryProduct:token',uni.cache.get('token'));
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
let res = await APIshopUserInfo();
|
||||
uni.cache.set("shopUserInfo", res);
|
||||
uni.cache.set("orderVIP", res);
|
||||
uni.cache.set("ordershopUserInfo", res.shopInfo);
|
||||
resolve(res);
|
||||
if(res&& typeof res === 'object'){
|
||||
this.shopUserInfo=res;
|
||||
uni.cache.set("shopUserInfo", res);
|
||||
uni.cache.set("orderVIP", res);
|
||||
uni.cache.set("ordershopUserInfo", res.shopInfo);
|
||||
resolve(res);
|
||||
}else{
|
||||
reject(false);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
reject(false);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async pageOnload() {
|
||||
console.log('开始加载必须数据')
|
||||
//登录
|
||||
await this.actionslogin()
|
||||
//获取会员信息
|
||||
await this.actionsproductqueryProduct()
|
||||
//获取店铺信息
|
||||
await this.getShopInfo()
|
||||
console.log('必须数据加载完毕')
|
||||
},
|
||||
async getShopInfo(shopId) {
|
||||
const shopRes = await APIusershopInfodetail({
|
||||
shopId: this.shopId || shopId,
|
||||
});
|
||||
this.shopInfo = shopRes.shopInfo;
|
||||
uni.cache.set("shopInfo", shopRes.shopInfo);
|
||||
},
|
||||
// 用户信息获取
|
||||
actionsAPIuser() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
315
utils/share.js
315
utils/share.js
@@ -1,3 +1,15 @@
|
||||
import {
|
||||
autoBindInviteUser,
|
||||
autoGetInviteCode
|
||||
} from '@/common/api/market/distribution.js'
|
||||
import {
|
||||
APIshopUserInfo,
|
||||
APIusershopInfodetail
|
||||
} from '@/common/api/member.js'
|
||||
import {
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
const accountStore = productStore();
|
||||
const accountInfo = wx.getAccountInfoSync();
|
||||
export const envVersion = accountInfo.miniProgram.envVersion;
|
||||
let type = 3;
|
||||
@@ -13,9 +25,312 @@ if (envVersion === 'trial') {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 绑定用户邀请关系(核心函数)
|
||||
* 功能说明:校验邀请码有效性,有效则调用自动绑定接口完成邀请关系绑定
|
||||
* @param {Object} args - 绑定邀请关系的入参对象
|
||||
* @param {number} [args.shopUserId] - 需要绑定邀请人的用户ID(integer <int64>,可选)
|
||||
* @param {number} [args.shopId] - 店铺ID(integer <int64>,可选)
|
||||
* @param {string} args.inviteCode - 邀请人的邀请码(必填,非空校验通过后才会执行绑定逻辑)
|
||||
* @returns {void} 无返回值
|
||||
*/
|
||||
export function bindInvite(args) {
|
||||
// 解构入参对象,获取需要的核心参数
|
||||
const {
|
||||
shopUserId,
|
||||
shopId,
|
||||
inviteCode
|
||||
} = args;
|
||||
|
||||
// 校验邀请码有效性:若邀请码为空、null、undefined,则直接返回,不执行后续绑定逻辑
|
||||
if (!inviteCode || inviteCode === null || inviteCode === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 邀请码有效,调用自动绑定邀请人接口,传递绑定所需参数
|
||||
autoBindInviteUser({
|
||||
id: shopUserId,
|
||||
shopId,
|
||||
inviteCode
|
||||
});
|
||||
}
|
||||
|
||||
export function wxShare(par) {
|
||||
return {
|
||||
...par,
|
||||
type
|
||||
}
|
||||
}
|
||||
|
||||
export async function returnCommonQuery() {
|
||||
const shopId = uni.cache.get('shopId')
|
||||
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
const inviteCode = await autoGetInviteCode({
|
||||
shopId: shopId,
|
||||
shopUserId: shopUserInfo.id
|
||||
})
|
||||
|
||||
const queryJson = {
|
||||
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||
shopId,
|
||||
shopUserId: shopUserInfo.id,
|
||||
}
|
||||
return Promise.resolve(queryJson)
|
||||
}
|
||||
|
||||
export function jsonToUrl(json) {
|
||||
let result = ''
|
||||
for (let key in json) {
|
||||
if (json[key]) {
|
||||
if (result === '') {
|
||||
result += `${key}=${json[key]}`
|
||||
} else {
|
||||
result += `&${key}=${json[key]}`
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} query 参数对象
|
||||
* @param {Array} showkeys 需要显示的key不包括公共参数
|
||||
*/
|
||||
export async function returnQuery(query, showkeys) {
|
||||
|
||||
|
||||
const shopId = uni.cache.get('shopId')
|
||||
const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
const inviteCode = await autoGetInviteCode({
|
||||
shopId: shopId,
|
||||
shopUserId: shopUserInfo.id
|
||||
})
|
||||
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = currentPage.route;
|
||||
const currentOptions = currentPage.options;
|
||||
|
||||
|
||||
let sharePath = `/${currentPath}`;
|
||||
const queryJson = {
|
||||
inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||
shopId,
|
||||
shopUserId: shopUserInfo.id,
|
||||
...query
|
||||
}
|
||||
for (const key in currentOptions) {
|
||||
if (currentOptions.hasOwnProperty(key)) {
|
||||
if (showkeys && Array.isArray(showkeys) && showkeys.includes(key)) {
|
||||
queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||
} else {
|
||||
queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||
}
|
||||
}
|
||||
}
|
||||
queryJson.shopId = shopId
|
||||
queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||
queryJson.shopUserId = shopUserInfo.id
|
||||
|
||||
let result = ''
|
||||
for (let key in queryJson) {
|
||||
if (queryJson[key]) {
|
||||
if (result === '') {
|
||||
result += `${key}=${queryJson[key]}`
|
||||
} else {
|
||||
result += `&${key}=${queryJson[key]}`
|
||||
}
|
||||
}
|
||||
}
|
||||
return Promise.resolve(result)
|
||||
}
|
||||
|
||||
function parseQueryString(queryString) {
|
||||
const queryParams = queryString.split("&").map((param) => param.split("="));
|
||||
const params = {};
|
||||
for (const [key, value] of queryParams) {
|
||||
params[key] = value;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
/**
|
||||
* 混入的 onLoad 核心逻辑(抽成独立函数)
|
||||
* @param {Object} opt - 页面 onLoad 接收的参数
|
||||
* @param {Object} vm - 组件实例(this)
|
||||
*/
|
||||
export async function handleMixinOnLoad(opt, vm) {
|
||||
console.log('onLoad');
|
||||
const options = {}
|
||||
if (opt.q) {
|
||||
const q = decodeURIComponent(opt.q);
|
||||
const params = parseQueryString(q.split("?")[1]);
|
||||
Object.assign(options, params);
|
||||
} else {
|
||||
Object.assign(options, opt);
|
||||
}
|
||||
console.log('options', options);
|
||||
if (options.shopId) {
|
||||
uni.cache.set('shopId', options.shopId)
|
||||
accountStore.shopId = options.shopId
|
||||
await accountStore.pageOnload()
|
||||
}
|
||||
uni.setStorageSync('loadFinsh', true)
|
||||
// const shopId = uni.cache.get('shopId')
|
||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
// const shopInfo = uni.cache.get('shopInfo')
|
||||
// const inviteCode = await autoGetInviteCode({
|
||||
// shopId: shopId,
|
||||
// shopUserId: shopUserInfo.id
|
||||
// })
|
||||
|
||||
if (options.inviteCode) {
|
||||
bindInvite(options)
|
||||
}
|
||||
}
|
||||
// utils/share.js
|
||||
export const shareMixin = {
|
||||
|
||||
// async onLoad(opt) {
|
||||
// console.log('onLoad');
|
||||
// const options = {}
|
||||
// if (opt.q) {
|
||||
// const q = decodeURIComponent(opt.q);
|
||||
// const params = parseQueryString(q.split("?")[1]);
|
||||
// Object.assign(options, params);
|
||||
// } else {
|
||||
// Object.assign(options, opt);
|
||||
// }
|
||||
// console.log('options', options);
|
||||
// if (options.shopId) {
|
||||
// uni.cache.set('shopId', options.shopId)
|
||||
// }
|
||||
|
||||
// const shopId = uni.cache.get('shopId')
|
||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
// const shopInfo = uni.cache.get('shopInfo')
|
||||
// const inviteCode = await autoGetInviteCode({
|
||||
// shopId: shopId,
|
||||
// shopUserId: shopUserInfo.id
|
||||
// })
|
||||
|
||||
// uni.setStorageSync('loadFinsh',true)
|
||||
|
||||
|
||||
// if (options.inviteCode) {
|
||||
// bindInvite(options)
|
||||
// }
|
||||
// },
|
||||
async onShareAppMessage(res) {
|
||||
// const shopId = uni.cache.get('shopId')
|
||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
// const inviteCode = await autoGetInviteCode({
|
||||
// shopId: shopId,
|
||||
// shopUserId: shopUserInfo.id
|
||||
// })
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = currentPage.route;
|
||||
const currentOptions = currentPage.options;
|
||||
|
||||
let sharePath = `/${currentPath}`;
|
||||
// const queryJson = {
|
||||
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||
// shopId,
|
||||
// shopUserId: shopUserInfo.id,
|
||||
// }
|
||||
// for (const key in currentOptions) {
|
||||
// if (currentOptions.hasOwnProperty(key)) {
|
||||
// queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||
// }
|
||||
// }
|
||||
// queryJson.shopId = shopId
|
||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||
// queryJson.shopUserId = shopUserInfo.id
|
||||
|
||||
const query =await returnQuery()
|
||||
|
||||
|
||||
// 全局默认配置(可被页面覆盖)
|
||||
const defaultShareConfig = {
|
||||
title: shopInfo.shopName,
|
||||
path: sharePath + '?' + query,
|
||||
imageUrl: shopInfo.logo,
|
||||
query,
|
||||
// desc: '描述',
|
||||
success: (res) => {
|
||||
console.log('分享好友成功', res);
|
||||
// 可加埋点等统一逻辑
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('分享好友失败', err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 页面自定义配置覆盖全局
|
||||
const pageShareConfig = this.$options.shareConfig || {};
|
||||
console.log('mixIn onShareAppMessage', {
|
||||
...defaultShareConfig,
|
||||
...pageShareConfig
|
||||
})
|
||||
return wxShare({
|
||||
...defaultShareConfig,
|
||||
...pageShareConfig
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
async onShareTimeline() {
|
||||
|
||||
|
||||
// const shopId = uni.cache.get('shopId')
|
||||
// const shopUserInfo = uni.cache.get('shopUserInfo')
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
// const inviteCode = await autoGetInviteCode({
|
||||
// shopId: shopId,
|
||||
// shopUserId: shopUserInfo.id
|
||||
// })
|
||||
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const currentPath = currentPage.route;
|
||||
const currentOptions = currentPage.options;
|
||||
|
||||
|
||||
let sharePath = `/${currentPath}`;
|
||||
// const queryJson = {
|
||||
// inviteCode: (inviteCode && inviteCode !== true) ? inviteCode : null,
|
||||
// shopId,
|
||||
// shopUserId: shopUserInfo.id,
|
||||
// }
|
||||
// for (const key in currentOptions) {
|
||||
// if (currentOptions.hasOwnProperty(key)) {
|
||||
// queryJson[key] = encodeURIComponent(currentOptions[key])
|
||||
// }
|
||||
// }
|
||||
// queryJson.shopId = shopId
|
||||
// queryJson.inviteCode = (inviteCode && inviteCode !== true) ? inviteCode : null
|
||||
// queryJson.shopUserId = shopUserInfo.id
|
||||
|
||||
const query = await returnQuery()
|
||||
|
||||
const defaultTimelineConfig = {
|
||||
title: shopInfo.shopName,
|
||||
path: sharePath + '?' + query,
|
||||
imageUrl: shopInfo.logo,
|
||||
query,
|
||||
};
|
||||
|
||||
const pageTimelineConfig = this.$options.shareTimelineConfig || {};
|
||||
return wxShare({
|
||||
...defaultTimelineConfig,
|
||||
...pageTimelineConfig
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user