Compare commits
16 Commits
189459845c
...
prod
| Author | SHA1 | Date | |
|---|---|---|---|
| b637a6dea9 | |||
| d5c42f2092 | |||
| 129bc1276a | |||
| 5c2aa2b617 | |||
| 3f6b39f413 | |||
| 036f557c9a | |||
| 427f32ded7 | |||
| a6174a036c | |||
| 1264286269 | |||
| 6e2161fc5e | |||
| a95d7ebf01 | |||
| 0f640bdf9e | |||
| ea3fb0fe0f | |||
| 8b5d81c6c8 | |||
| 4b1be95bc0 | |||
| 13ae818fd4 |
11
common/api/account/index.js
Normal file
11
common/api/account/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// 引入 request 文件
|
||||
import request from '@/common/api/request.js'
|
||||
import {prveUrl} from './config.js'
|
||||
|
||||
export const shopUserConfirm = (data) => {
|
||||
return request({
|
||||
url: prveUrl + '/user/shopUser/confirm',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -123,3 +123,5 @@ export const cancelRefund = (data) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const exchange=()=>{}
|
||||
@@ -55,3 +55,13 @@ export const productRelated = (data) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//获取相关推荐商品
|
||||
export const getConsStock = (data) => {
|
||||
return request({
|
||||
url: urlProduct + '/user/product/consStock',
|
||||
method: 'get',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { ref, onMounted } from 'vue';
|
||||
import { centerConfig,distributionEditIn } from '@/common/api/market/distribution.js';
|
||||
import { checkArrayElementsExist } from '@/utils/util.js';
|
||||
|
||||
const shopInfo = ref('');
|
||||
const shopInfo = defineModel('shopInfo');
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
|
||||
540
components/registermember.vue
Normal file
540
components/registermember.vue
Normal file
@@ -0,0 +1,540 @@
|
||||
<template>
|
||||
<!-- 店铺详情 -->
|
||||
<u-popup :show="show" :round="20" overlayOpacity="0.8" mode="bottom" @close="showClose" height="500">
|
||||
<view class="register-member-wrap">
|
||||
<view class="register-title">欢迎加入{{shopUserInfo.shopName?shopUserInfo.shopName:'本店'}}</view>
|
||||
<!-- <view class="register-tip">请完善个人信息完成会员注册</view> -->
|
||||
<view class="register-tip">请先完成股东信息提交</view>
|
||||
|
||||
|
||||
<view class="register-content">
|
||||
<view class="reg-head">
|
||||
<view class="reg-head-img">
|
||||
<!-- #ifdef MP-WEIXIN || H5 -->
|
||||
<button class="reg-head-img" type="default" open-type="chooseAvatar"
|
||||
@chooseavatar="onChooseAvatar">
|
||||
<image class="reg-head-img"
|
||||
:src="userHeadImg || 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'"
|
||||
mode="aspectFill"></image>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button class="reg-head-img" @click="onChooseAvatar">
|
||||
<image class="reg-head-img"
|
||||
:src="userHeadImg || 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'"
|
||||
mode="aspectFill"></image>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="lable">昵称<text style="color: #CD1A1A;">*</text></view>
|
||||
<u-input class="value" v-model="formInfo.nickName" fontSize="14px" type="text" input-align="left"
|
||||
placeholder="请输入昵称" :custom-style="{border:'none'}"
|
||||
placeholderStyle="color:#999;font-size: 28rpx" />
|
||||
</view>
|
||||
<view class="reg-cell" @click="calendarShow = true">
|
||||
<view class="lable">生日</view>
|
||||
<view class="value" :style="{color: formInfo.birthDay ? '#333' : '#999'}">
|
||||
{{ formInfo.birthDay || '请选择日期'}}
|
||||
</view>
|
||||
<!-- <u-calendar @close="calendarShow = false" monthNum="99" minDate="1945-01-01" maxDate="2055-12-12" :show="calendarShow" mode="single" @confirm="confirmCalendar"></u-calendar> -->
|
||||
<!-- <u-picker :show="calendarShow" ref="uPicker" :columns="columns" @confirm="confirm" @change="changeHandler"></u-picker> -->
|
||||
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
||||
<up-datetime-picker mode="date" @cancel="calendarShow = false" :show="calendarShow"
|
||||
:minDate="-2208988800000" v-model="value1" itemHeight="66" visibleItemCount="5"
|
||||
@confirm="confirmTime"></up-datetime-picker>
|
||||
<up-icon name="arrow-down-fill" color="#000" size="10"></up-icon>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="lable">性别<text style="color: #CD1A1A;">*</text></view>
|
||||
<up-radio-group v-model="formInfo.sex" active-color="#E3AD7F">
|
||||
<up-radio :name="1" label="男"></up-radio>
|
||||
<up-radio :name="0" label="女"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="lable">手机号</view>
|
||||
<up-input class="value" v-model="formInfo.telephone" fontSize="14px" type="text" input-align="left"
|
||||
readonly placeholder="获取手机号" :custom-style="{border:'none'}"
|
||||
placeholder-style="color:#999;font-size: 28rpx" />
|
||||
<!-- #ifdef MP-WEIXIN || H5 -->
|
||||
<button class="getPhone" size="10" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button class="getPhone" size="10" open-type="getAuthorize" scope='phoneNumber'
|
||||
@getAuthorize="getPhone">
|
||||
<!-- #endif -->
|
||||
<view class="text">{{'获取手机号'}}</view>
|
||||
</button>
|
||||
</view>
|
||||
<view class="agreement">
|
||||
<view class="agreement_tip">我已阅读并同意以下内容</view>
|
||||
<view class="agreement_item" @click="isProtocol = !isProtocol">
|
||||
<up-checkbox-group>
|
||||
<up-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F"
|
||||
@change="radioChange" size="15" iconSize="10"></up-checkbox>
|
||||
</up-checkbox-group>
|
||||
<text @click.stop="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
||||
</view>
|
||||
<!-- <view class="agreement_item">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text class="agreement_item_text">隐私条款</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="register_btn" @tap="$u.debounce(registerMember, 500)">确认提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
defineProps,
|
||||
reactive,
|
||||
ref,
|
||||
defineEmits,
|
||||
watch,
|
||||
watchEffect
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
APIshopUser,
|
||||
APIshopUserInfo
|
||||
} from '@/common/api/member.js'
|
||||
import {
|
||||
shopUserConfirm
|
||||
} from '@/common/api/account/index.js'
|
||||
import {
|
||||
APIuserphone
|
||||
} from '@/common/api/api.js'
|
||||
|
||||
const props = defineProps({
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
detailtype: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shopId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
});
|
||||
const show=defineModel(false)
|
||||
// 定义事件发射器
|
||||
const emits = defineEmits(['emitsmemberOpen','update']);
|
||||
|
||||
// 定义要触发的事件
|
||||
|
||||
const formInfo = reactive({
|
||||
nickName: "",
|
||||
telephone: "",
|
||||
birthDay: "",
|
||||
sex:1,
|
||||
})
|
||||
const userHeadImg = ref('')
|
||||
|
||||
watchEffect(()=>{
|
||||
formInfo.nickName= `${props.shopUserInfo.nickName}`.trim() ==='微信用户' ? '' :(props.shopUserInfo.nickName||'')
|
||||
formInfo.telephone=props.shopUserInfo.phone||''
|
||||
formInfo.birthDay=props.shopUserInfo.birthDay||''
|
||||
formInfo.sex=props.shopUserInfo.sex||1
|
||||
userHeadImg.value=props.shopUserInfo.headImg||''
|
||||
})
|
||||
const value1 = Number(new Date())
|
||||
|
||||
const calendarShow = ref(false)
|
||||
|
||||
// 用户图片
|
||||
|
||||
|
||||
//显示隐藏
|
||||
const isProtocol = ref(false)
|
||||
|
||||
const init = async () => {
|
||||
|
||||
// if (uni.cache.get('shopUserInfo') && props.shopId||uni.cache.get('shopId') == uni.cache.get('shopUserInfo').id) {
|
||||
// shopUserInfo = uni.cache.get('shopUserInfo');
|
||||
// } else {
|
||||
// let res = await this.api.shopUserInfo({
|
||||
// "shopId": props.shopId||uni.cache.get('shopId'),
|
||||
// "userId": uni.cache.get('userInfo').id,
|
||||
// })
|
||||
// if (res.code == 0) {
|
||||
// shopUserInfo = res.data;
|
||||
// }
|
||||
// }
|
||||
// memberOpen.value = shopUserInfo.isVip == 0 ? true : false;
|
||||
// userHeadImg.value = shopUserInfo.headImg;
|
||||
// formInfo.nickName = shopUserInfo.nickName && shopUserInfo.nickName != '微信用户' ? shopUserInfo
|
||||
// .nickName : '';
|
||||
// formInfo.telephone = shopUserInfo.telephone;
|
||||
// formInfo.birthDay = shopUserInfo.birthDay
|
||||
|
||||
}
|
||||
|
||||
// 返回
|
||||
const showClose = () => {
|
||||
// uni.navigateBack()
|
||||
show.value=false
|
||||
}
|
||||
|
||||
//
|
||||
const radioChange = (n) => {
|
||||
isProtocol.value = n;
|
||||
}
|
||||
|
||||
// 查看协议
|
||||
const viewProtocol = () => {
|
||||
wx.openPrivacyContract({
|
||||
success: () => {}, // 打开成功
|
||||
fail: () => {}, // 打开失败
|
||||
complete: () => {}
|
||||
})
|
||||
}
|
||||
|
||||
//上传头像
|
||||
const onChooseAvatar = (e) => {
|
||||
//#ifdef MP-WEIXIN
|
||||
let avatarUrl = e.detail.avatarUrl
|
||||
uni.uploadFile({
|
||||
url: uni.conf.baseUrl + '/account/user/common/upload',
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
shopId: props.shopId||uni.cache.get('shopId'),
|
||||
token: uni.cache.get('token') || '',
|
||||
'content-type': 'multipart/form-data'
|
||||
},
|
||||
fileType: 'image',
|
||||
name: "file",
|
||||
formData: {
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let {
|
||||
data
|
||||
} = JSON.parse(uploadFileRes.data)
|
||||
userHeadImg.value = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
//#ifdef MP-ALIPAY
|
||||
uni.chooseImage({
|
||||
count: 1, // 默认9,设置图片的数量
|
||||
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||
success: function(res) {
|
||||
// 成功选择图片后
|
||||
let avatarUrl = res.tempFilePaths[0]; // 获取文件路径
|
||||
|
||||
my.uploadFile({
|
||||
url: uni.conf.baseUrl + '/account/user/common/upload',
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
environment: 'app',
|
||||
type: 'android',
|
||||
version: '1.7.3',
|
||||
'content-type': 'multipart/form-data'
|
||||
},
|
||||
fileType: 'image',
|
||||
name: "file",
|
||||
formData: {
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let {
|
||||
data
|
||||
} = JSON.parse(uploadFileRes.data)
|
||||
userHeadImg.value = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
// 确定生日
|
||||
const confirmTime = (e) => {
|
||||
calendarShow.value = false;
|
||||
formInfo.birthDay = getDate(e.value);
|
||||
}
|
||||
|
||||
// 获取手机号
|
||||
const getPhone = (d) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (d.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await APIuserphone({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
source: "wechar"
|
||||
})
|
||||
formInfo.telephone = res
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序环境
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_user',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
my.getPhoneNumber({
|
||||
success: async (data) => {
|
||||
let res = await APIuserphone({
|
||||
encryptedData: JSON.parse(data.response).response,
|
||||
source: "alipay"
|
||||
})
|
||||
formInfo.telephone = res
|
||||
// console.log(this.phonetitle)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
// 格式化时间戳
|
||||
const getDate = (time) => {
|
||||
const date = new Date(time);
|
||||
// const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
|
||||
const registerMember = async () => {
|
||||
if (formInfo.nickName == "" || formInfo.nickName == null) {
|
||||
uni.showToast({
|
||||
title: '请输入会员昵称',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (formInfo.telephone == "" || formInfo.telephone == null) {
|
||||
uni.showToast({
|
||||
title: '请获取手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!isProtocol.value) {
|
||||
uni.showToast({
|
||||
title: '请勾选协议',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let idSet = new Set(
|
||||
props.shopUserInfo.shopConfirm
|
||||
? props.shopUserInfo.shopConfirm.split(',')
|
||||
: []
|
||||
);
|
||||
|
||||
const shopIdToAdd = props.shopId || uni.cache.get('shopId');
|
||||
if (shopIdToAdd) {
|
||||
idSet.add(shopIdToAdd);
|
||||
}
|
||||
let idArr = Array.from(idSet).filter(v=>v!=='');
|
||||
const submitForm={
|
||||
// id: uni.cache.get('userInfo').id,
|
||||
shopId: props.shopId||uni.cache.get('shopId'),
|
||||
nickName: formInfo.nickName,
|
||||
headImg: userHeadImg.value,
|
||||
phone: formInfo.telephone,
|
||||
birthDay: formInfo.birthDay,
|
||||
sex:formInfo.sex,
|
||||
shopConfirm:idArr.join(',')
|
||||
}
|
||||
// await APIshopUser(submitForm)
|
||||
await shopUserConfirm({
|
||||
id:props.shopUserInfo.id,
|
||||
shopId: props.shopId||uni.cache.get('shopId'),
|
||||
nickName: formInfo.nickName,
|
||||
headImg: userHeadImg.value,
|
||||
phone: formInfo.telephone,
|
||||
birthDay: formInfo.birthDay,
|
||||
sex:formInfo.sex,
|
||||
shopConfirm:idArr.join(',')
|
||||
})
|
||||
let APIshopUserInfores = await APIshopUserInfo({
|
||||
shopId: props.shopId||uni.cache.get('shopId')
|
||||
})
|
||||
uni.cache.set('orderVIP', APIshopUserInfores)
|
||||
uni.cache.set('ordershopUserInfo', APIshopUserInfores.shopInfo)
|
||||
|
||||
uni.showToast({
|
||||
title:props.shopUserInfo.phone? '修改成功': '注册成功',
|
||||
icon: 'none'
|
||||
})
|
||||
emits('update',APIshopUserInfores)
|
||||
show.value=false
|
||||
// 定义自定义事件
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack()
|
||||
// }, 1500)
|
||||
emits('emitsmemberOpen',submitForm);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-datetime-picker {
|
||||
height: 300px !important;
|
||||
}
|
||||
|
||||
.register-member-wrap {
|
||||
padding: 64rpx 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.register-title {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.register-tip {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.register-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.reg-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 64rpx;
|
||||
|
||||
.reg-head-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.reg-head-edit {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.reg-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.lable {
|
||||
width: 120rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
padding: 12rpx 0 12rpx 18rpx;
|
||||
}
|
||||
|
||||
.u-input {
|
||||
input {
|
||||
font-size: 28rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.getPhone {
|
||||
background-color: none;
|
||||
border: 2rpx solid #E3AD7F;
|
||||
color: #E3AD7F;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 30rpx;
|
||||
// #ifdef MP-ALIPAY
|
||||
padding-top: 0;
|
||||
display: initial;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 5rpx;
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
|
||||
.agreement {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 48rpx;
|
||||
|
||||
.agreement_tip {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.agreement_item {
|
||||
display: flex;
|
||||
padding-top: 32rpx;
|
||||
padding-bottom: 16rpx;
|
||||
align-items: center;
|
||||
|
||||
.agreement_item_text {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E3AD7F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.register_btn {
|
||||
width: 572rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
background: #E3AD7F;
|
||||
border-radius: 48rpx 48rpx 48rpx 48rpx;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
margin: 30rpx auto 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -110,11 +110,11 @@
|
||||
}).then(res => {
|
||||
// console.log('分享组件挂载完毕:shareConfig',res);
|
||||
// console.log('分享组件挂载完毕:currentOptions',currentOptions);
|
||||
if(res){
|
||||
if(res&& typeof res==='object'){
|
||||
Object.assign(config,res)
|
||||
const rewardSharePages=res.rewardSharePages.split(',')
|
||||
const pTag = returnPageTags(path)
|
||||
if( pTag&&rewardSharePages.includes(pTag)&¤tOptions.fromUserId&&res.isSharedUserPopup){
|
||||
if( pTag&&rewardSharePages.includes(pTag)&¤tOptions.fromUserId&&res.isSharedUserPopup&&res.isEnabled){
|
||||
show.value=true
|
||||
}
|
||||
// if(res.sharedUserCouponId&&res.sharedUserCouponNum){
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<up-navbar
|
||||
bg-color="transparent"
|
||||
title="分销中心"
|
||||
title="全民股东"
|
||||
@leftClick="back"
|
||||
:fixed="true"
|
||||
></up-navbar>
|
||||
@@ -102,7 +102,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="state.activates.totalRow > 0"
|
||||
v-if="state.activates.totalRow*1 > 0"
|
||||
class="u-flex justify-center font-12 color-666"
|
||||
style="align-items: baseline"
|
||||
@click="toShopList('activates')"
|
||||
@@ -159,7 +159,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="state.activates.totalRow > 0"
|
||||
v-if="state.unActivates.totalRow*1 > 0"
|
||||
class="u-flex justify-center font-12 color-666"
|
||||
style="align-items: baseline"
|
||||
@click="toShopList('unActivates')"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<view class="u-m-l-32 u-flex-1 border">
|
||||
<input placeholder="请输入上级邀请码" v-model="code" />
|
||||
</view>
|
||||
<image src="/distribution/static/scan.svg" class="u-m-l-10" style="width: 60rpx; height: 60rpx;" @click="saoma"></image>
|
||||
<!-- <image src="/distribution/static/scan.svg" class="u-m-l-10" style="width: 60rpx; height: 60rpx;" @click="saoma"></image> -->
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<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">
|
||||
<up-popup :duration="0" :show="show" bgColor="transparent" :safeAreaInsetBottom="false"
|
||||
:closeOnClickOverlay="true" @close="close" mode="center">
|
||||
<view class="box">
|
||||
<view class="info">
|
||||
<view class="u-flex justify-center">
|
||||
@@ -25,12 +26,15 @@
|
||||
ref="wQrcode"
|
||||
@generate="(e) => qrcodeResult(e)"
|
||||
></w-qrcode> -->
|
||||
<up-image width="322rpx" height="322rpx" :src="code"></up-image>
|
||||
<image :src="code" class="code"></image>
|
||||
<!-- <up-image width="322rpx" mode="scaleToFill" 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>
|
||||
<ymf-share>
|
||||
<view class="confirm">微信分享</view>
|
||||
</ymf-share>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
@@ -38,223 +42,252 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
|
||||
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, onMounted, nextTick } from 'vue';
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad,
|
||||
returnQuery
|
||||
} from '@/utils/share.js';
|
||||
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,
|
||||
onMounted,
|
||||
nextTick
|
||||
} from 'vue';
|
||||
|
||||
onMounted(async () => {
|
||||
setTimeout(async () => {
|
||||
await nextTick();
|
||||
const query = await returnQuery();
|
||||
codeOptions.value.code = `https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
|
||||
console.log('codeOptions.value', codeOptions.value);
|
||||
}, 500);
|
||||
});
|
||||
onMounted(async () => {
|
||||
setTimeout(async () => {
|
||||
await nextTick();
|
||||
const query = await returnQuery();
|
||||
codeOptions.value.code =
|
||||
`https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
|
||||
console.log('codeOptions.value', codeOptions.value);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
/**
|
||||
* 截取字符串,移除 &q 及后面的所有内容
|
||||
* @param {string} str - 原始字符串
|
||||
* @returns {string} 处理后的字符串
|
||||
*/
|
||||
function removeQAndAfter(str) {
|
||||
// 检查是否为空字符串
|
||||
if (!str || typeof str !== 'string') {
|
||||
return str || '';
|
||||
/**
|
||||
* 截取字符串,移除 &q 及后面的所有内容
|
||||
* @param {string} str - 原始字符串
|
||||
* @returns {string} 处理后的字符串
|
||||
*/
|
||||
function removeQAndAfter(str) {
|
||||
// 检查是否为空字符串
|
||||
if (!str || typeof str !== 'string') {
|
||||
return str || '';
|
||||
}
|
||||
|
||||
// 找到 &q 的起始位置
|
||||
const qIndex = str.indexOf('&q');
|
||||
|
||||
// 如果找到 &q,截取前面的部分;否则返回原字符串
|
||||
return qIndex !== -1 ? str.slice(0, qIndex) : str;
|
||||
}
|
||||
|
||||
// 找到 &q 的起始位置
|
||||
const qIndex = str.indexOf('&q');
|
||||
|
||||
// 如果找到 &q,截取前面的部分;否则返回原字符串
|
||||
return qIndex !== -1 ? str.slice(0, qIndex) : str;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
inviteCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
});
|
||||
|
||||
const codeOptions = ref({
|
||||
padding: 10,
|
||||
size: 200,
|
||||
code: ''
|
||||
});
|
||||
|
||||
function copyCode() {
|
||||
uni.setClipboardData({
|
||||
data: props.inviteCode,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
const props = defineProps({
|
||||
inviteCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
});
|
||||
}
|
||||
const code = ref('');
|
||||
|
||||
function qrcodeResult(e) {
|
||||
console.log('qrcodeResult', e);
|
||||
code.value = e.img.tempFilePath;
|
||||
console.log('code', code.value);
|
||||
}
|
||||
const codeOptions = ref({
|
||||
padding: 10,
|
||||
size: 200,
|
||||
code: ''
|
||||
});
|
||||
|
||||
const show = defineModel({
|
||||
type: Boolean,
|
||||
default: false
|
||||
});
|
||||
const emits = defineEmits(['cancel', 'confirm']);
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits('cancel');
|
||||
}
|
||||
function save() {
|
||||
show.value = false;
|
||||
function copyCode() {
|
||||
uni.setClipboardData({
|
||||
data: props.inviteCode,
|
||||
success: function() {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
}
|
||||
const code = ref('');
|
||||
|
||||
// 保存图片到相册
|
||||
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']) {
|
||||
function qrcodeResult(e) {
|
||||
console.log('qrcodeResult', e);
|
||||
code.value = e.img.tempFilePath;
|
||||
console.log('code', code.value);
|
||||
}
|
||||
|
||||
const show = defineModel({
|
||||
type: Boolean,
|
||||
default: false
|
||||
});
|
||||
const emits = defineEmits(['cancel', 'confirm']);
|
||||
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits('cancel');
|
||||
}
|
||||
|
||||
function save() {
|
||||
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: '未开启授权,保存失败',
|
||||
title: '打开设置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function () {
|
||||
uni.showToast({
|
||||
title: '打开设置失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
||||
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;
|
||||
}
|
||||
.border {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
padding: 18rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.box {
|
||||
width: 638rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
// overflow: hidden;
|
||||
position: relative;
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
:deep(.info .canvas) {
|
||||
opacity: 1;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.confirm {
|
||||
$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;
|
||||
.border {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
padding: 18rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.box {
|
||||
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;
|
||||
}
|
||||
|
||||
.confirm {
|
||||
$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;
|
||||
}
|
||||
|
||||
.w-qrcode {
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
z-index: -1;
|
||||
}
|
||||
.code{
|
||||
width: 322rpx;
|
||||
height: 322rpx;
|
||||
}
|
||||
}
|
||||
.line-height-54 {
|
||||
line-height: 54rpx;
|
||||
}
|
||||
.w-qrcode {
|
||||
position: fixed;
|
||||
left: -9999px;
|
||||
top: -9999px;
|
||||
z-index: -1;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="min-h-100vh bg-gray">
|
||||
<up-navbar bg-color="transparent" title="分销中心" @leftClick="back" :fixed="true"></up-navbar>
|
||||
<up-navbar bg-color="transparent" title="全民股东" @leftClick="back" :fixed="true"></up-navbar>
|
||||
<view class="top">
|
||||
<image class="top_bg" src="/distribution/static/top_bg.png" :style="imageStyle"></image>
|
||||
<view class="box" :class="{ type1: isActivated }">
|
||||
@@ -10,10 +10,10 @@
|
||||
<text class="u-m-l-14 font-14 color-333 font-700">{{ state.shopName }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<template v-if="state.parentPhone">
|
||||
<template v-if="state.parentPhone||state.parentName ">
|
||||
<view class="font-12 color-666">上级:{{ state.parentName }}{{ state.parentPhone }}</view>
|
||||
</template>
|
||||
<template v-if="!state.parentPhone">
|
||||
<template v-else>
|
||||
<view class="bind" @click="showBindShangji = true">绑定上级</view>
|
||||
</template>
|
||||
</view>
|
||||
@@ -203,7 +203,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 join-text u-font-28" v-if="state.group&&state.group.isEnable" @click="showGroup=true" >
|
||||
<view class="u-m-t-32 join-text u-font-28" v-if="state.group&&state.group.isEnable" @click="showGroup=true">
|
||||
加入股东群,优惠、活动多多{{'>>'}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -222,14 +222,24 @@
|
||||
:levelConfigList="config.levelConfigList || []"></commissionPopup>
|
||||
<rulePopup v-model="showRule" :config="config" :distributionUser="state.distributionUser"></rulePopup>
|
||||
<popupDistributionGroupCode :group="state.group" v-model="showGroup"></popupDistributionGroupCode>
|
||||
<ymf-share-popup ></ymf-share-popup>
|
||||
<ymf-share-popup></ymf-share-popup>
|
||||
<view class="screen_mask" v-if="screen_mask_show" @click="memberOpen=true"></view>
|
||||
<registermember v-model="memberOpen" @close="memberPopupClose" :shopUserInfo="shopUserInfo"
|
||||
@update="shopUserInfoUpdate"
|
||||
:shopId="options.shopId"></registermember>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import popupDistributionGroupCode from '@/components/popup-distribution-group-code.vue';
|
||||
const showGroup=ref(false)
|
||||
import registermember from '@/components/registermember.vue';
|
||||
|
||||
const showGroup = ref(false)
|
||||
const memberOpen = ref(false)
|
||||
|
||||
function memberPopupClose() {
|
||||
memberOpen.value = false
|
||||
}
|
||||
|
||||
|
||||
import {
|
||||
@@ -237,7 +247,8 @@
|
||||
} from '@/common/api/market';
|
||||
import {
|
||||
shareMixin,
|
||||
handleMixinOnLoad,wxShare,
|
||||
handleMixinOnLoad,
|
||||
wxShare,
|
||||
returnQuery
|
||||
} from '@/utils/share.js';
|
||||
import bindShangji from './components/bind-shangji.vue';
|
||||
@@ -284,6 +295,10 @@
|
||||
});
|
||||
}
|
||||
|
||||
function shopUserInfoUpdate(e){
|
||||
shopUserInfo.value=e
|
||||
}
|
||||
|
||||
function questionClick(title) {
|
||||
if (title == '总收益') {
|
||||
tipsType.value = '总收益';
|
||||
@@ -400,7 +415,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
const shopUserInfo = ref();
|
||||
const shopUserInfo = ref({shopInfo:{}});
|
||||
const config = reactive({});
|
||||
//邀请码
|
||||
const inviteCode = ref('');
|
||||
@@ -434,8 +449,8 @@
|
||||
if (res.distributionId) {
|
||||
options.type = 'activates';
|
||||
}
|
||||
if(res.distributionUser&&!res.distributionUser.firstIn&&res.group&&res.group.isEnable){
|
||||
showGroup.value=true
|
||||
if (res.distributionUser && !res.distributionUser.firstIn && res.group && res.group.isEnable) {
|
||||
showGroup.value = true
|
||||
}
|
||||
Object.assign(state, res);
|
||||
if (res.distributionUser) {
|
||||
@@ -482,7 +497,7 @@
|
||||
parentPhone: '',
|
||||
parentName: '',
|
||||
shopName: '',
|
||||
group:{}
|
||||
group: {}
|
||||
});
|
||||
|
||||
const query = reactive({
|
||||
@@ -499,7 +514,7 @@
|
||||
totalPage: 0
|
||||
});
|
||||
async function getRecoders() {
|
||||
if (state.config) return;
|
||||
// if (state.config) return;
|
||||
const ajaxQuery = {
|
||||
...query,
|
||||
shopId: options.shopId
|
||||
@@ -562,6 +577,9 @@
|
||||
|
||||
const showInviteCode = computed(() => {
|
||||
if (config.upgradeType == 'invite') {
|
||||
if(config.openType=='pay'&&!isActivated.value){
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (config.openType == 'manual' && (!state.distributionUser || !state.distributionUser.level)) {
|
||||
@@ -576,12 +594,13 @@
|
||||
if (!state.distributionUser && config.openType == 'manual') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
//是否已成为分销员
|
||||
const isActivated = computed(() => {
|
||||
return state.distributionUser && state.distributionUser.level;
|
||||
return (state.distributionUser && state.distributionUser.level)?true:false;
|
||||
});
|
||||
watch(
|
||||
() => activeTab.value,
|
||||
@@ -630,11 +649,24 @@
|
||||
console.log(options);
|
||||
await init();
|
||||
getRecoders();
|
||||
const arr=shopUserInfo.value.shopConfirm.split(',')
|
||||
if (!arr.includes(options.shopId)) {
|
||||
memberOpen.value = true
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
const screen_mask_show=computed(()=>{
|
||||
const arr=shopUserInfo.value.shopConfirm.split(',')
|
||||
if (!arr.includes(options.shopId)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
onReachBottom(async () => {
|
||||
if (!isEnd.value) {
|
||||
query.page++;
|
||||
@@ -871,6 +903,10 @@
|
||||
color: #e8ad7b;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bottom-btn {
|
||||
@@ -919,8 +955,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.join-text{
|
||||
|
||||
.join-text {
|
||||
color: #02bbf3;
|
||||
text-align: center;
|
||||
}
|
||||
.screen_mask{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right:0;
|
||||
top:0;
|
||||
bottom: 0;
|
||||
z-index: 9;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
@@ -7,7 +7,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"pinia": "^2.3.1",
|
||||
"pinia-plugin-unistorage": "^0.1.2",
|
||||
"ysk-utils": "^1.0.83"
|
||||
"ysk-utils": "^1.0.85"
|
||||
},
|
||||
"devDependencies": {
|
||||
"unplugin-auto-import": "^0.16.7"
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
"pages": [{
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分销中心",
|
||||
"navigationBarTitleText": "全民股东",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
@@ -278,7 +278,7 @@
|
||||
{
|
||||
"path": "shop-detail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分销中心",
|
||||
"navigationBarTitleText": "全民股东",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -379,6 +379,7 @@
|
||||
async function onPageShow() {
|
||||
try {
|
||||
await storeuser.getLocation();
|
||||
console.log('shopId.value',shopId.value);
|
||||
proxy.$isResolve();
|
||||
shopId.value = uni.cache.get('shopId');
|
||||
if (shopId.value) {
|
||||
@@ -386,6 +387,7 @@
|
||||
}
|
||||
} catch (error) {}
|
||||
await proxy.$onLaunched;
|
||||
console.log('shopId.value',shopId.value);
|
||||
if (shopId.value) {
|
||||
showindex.value = 'shopIndex';
|
||||
await storeuser.actionsproductqueryProduct();
|
||||
|
||||
@@ -130,9 +130,19 @@
|
||||
</up-button>
|
||||
</template>
|
||||
</view>
|
||||
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders, 1000)">
|
||||
{{ paymentmethod ? paymentmethod.name : "" }}
|
||||
</view>
|
||||
<template v-if="!loading">
|
||||
<template v-if="cartStore.shopInfo.isUserPay">
|
||||
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders, 1000)">
|
||||
{{ paymentmethod ? paymentmethod.name : "" }}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="fixedview_tow disabled">
|
||||
请前往吧台支付
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
|
||||
取消订单
|
||||
</view> -->
|
||||
@@ -1030,15 +1040,15 @@
|
||||
// 跳转到加菜页面
|
||||
function toJiacai() {
|
||||
console.log("跳转到加菜页面");
|
||||
const arr= getCurrentPages()
|
||||
const arr = getCurrentPages()
|
||||
console.log(arr);
|
||||
if(arr.length>=2&&arr[arr.length-2]&&arr[arr.length-2].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)
|
||||
uni.cache.set('shopId',listinfo.shopId)
|
||||
} else {
|
||||
uni.cache.set('tableCode', listinfo.tableCode)
|
||||
uni.cache.set('shopId', listinfo.shopId)
|
||||
uni.redirectTo({
|
||||
url:'/pages/product/index?noJump=1'
|
||||
url: '/pages/product/index?noJump=1'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1111,11 +1121,13 @@
|
||||
}
|
||||
|
||||
const limitTimeDiscountRes = ref(null)
|
||||
const rechargeConfig=ref(null)
|
||||
const rechargeConfig = ref(null)
|
||||
|
||||
const loading=ref(true)
|
||||
async function init(opt) {
|
||||
const res1= await storeuser.actionsproductqueryProduct();
|
||||
orderVIP.value=res1
|
||||
console.log('orderVIP',orderVIP.value)
|
||||
const res1 = await storeuser.actionsproductqueryProduct();
|
||||
orderVIP.value = res1
|
||||
console.log('orderVIP', orderVIP.value)
|
||||
cartStore.clearOrderConfig();
|
||||
Object.assign(options, opt);
|
||||
listinfo.id = options.orderId;
|
||||
@@ -1151,16 +1163,18 @@
|
||||
tableCode: options.tableCode || "",
|
||||
});
|
||||
console.log("tableRes", tableRes);
|
||||
listinfo.tableName = tableRes?tableRes.name:'';
|
||||
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
|
||||
const rechargeConfigRes = await rechargeApi.config({
|
||||
shopId: options.shopId
|
||||
})
|
||||
if (rechargeConfigRes && typeof rechargeConfigRes === 'object') {
|
||||
rechargeConfig.value = rechargeConfigRes
|
||||
}
|
||||
//获取积分配置
|
||||
pointsApi.pointsConfig().then(res => {
|
||||
@@ -1179,6 +1193,7 @@
|
||||
if (shopInfoRes) {
|
||||
cartStore.shopInfo = shopInfoRes.shopInfo;
|
||||
}
|
||||
loading.value=false
|
||||
await cartStore.goodsInit();
|
||||
// * 获取会员信息
|
||||
await nextTick();
|
||||
@@ -1286,7 +1301,7 @@
|
||||
if (!isCanUseCharge.value) {
|
||||
arr.add("余额支付");
|
||||
}
|
||||
if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
|
||||
if (rechargeConfig.value && !rechargeConfig.value.isEnable) {
|
||||
arr.add("余额支付");
|
||||
}
|
||||
|
||||
@@ -1297,11 +1312,11 @@
|
||||
|
||||
})
|
||||
|
||||
watch(()=>cartStore.limitTimeDiscount,(newval)=>{
|
||||
socketInitPar.time_dis_info=newval
|
||||
},{
|
||||
deep:true,
|
||||
immediate:true
|
||||
watch(() => cartStore.limitTimeDiscount, (newval) => {
|
||||
socketInitPar.time_dis_info = newval
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -1813,7 +1828,16 @@
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
padding: 14rpx 44rpx;
|
||||
padding: 0 44rpx;
|
||||
min-height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
box-sizing: border-box;
|
||||
&.disabled {
|
||||
background-color: #eee;
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.fixedview_tows {
|
||||
|
||||
@@ -68,8 +68,7 @@
|
||||
|
||||
<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>
|
||||
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"></u-image>
|
||||
<u-image width="56" height="56" radius="10"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
|
||||
mode="heightFix" v-else></u-image>
|
||||
@@ -91,8 +90,27 @@
|
||||
<view class="footer-wrap">
|
||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)"
|
||||
v-if="item.status == 'done' || item.status == 'cancelled'"> 删除订单 </view>
|
||||
<view class="btn s" @click.stop="$u.debounce(orderinfo(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
<template v-if="shopInfo&&shopInfo.id">
|
||||
<template v-if="shopInfo.id==item.shopId">
|
||||
<template v-if="shopInfo.isUserPay">
|
||||
<view class="btn s" @click.stop="$u.debounce(orderinfo(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="btn s disabled" @click.stop="()=>{}"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 请前往吧台支付 </view>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="btn s" @click.stop="$u.debounce(orderinfo(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="btn s" @click.stop="$u.debounce(orderinfo(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</template>
|
||||
|
||||
<view class="btn s" @click.stop="agignOrder(item)" v-if="item.status != 'unpaid'"> 再来一单 </view>
|
||||
</view>
|
||||
@@ -151,7 +169,7 @@
|
||||
uni.cache.set("shopId", item.shopId);
|
||||
uni.navigateTo({
|
||||
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
|
||||
'&one_more_order=1&shopId='+item.shopId,
|
||||
'&one_more_order=1&shopId=' + item.shopId,
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -167,6 +185,8 @@
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const shopInfo = uni.cache.get('shopInfo')
|
||||
|
||||
function isRemoveOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
@@ -523,6 +543,12 @@
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
margin-left: 32rpx;
|
||||
|
||||
&.disabled {
|
||||
background-color: #eee;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.s {
|
||||
|
||||
@@ -647,7 +647,34 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 封装成 Promise 的确认弹窗
|
||||
const showConfirmModal = (title, content) => {
|
||||
return new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: content,
|
||||
showCancel: true,
|
||||
cancelText: '取消添加',
|
||||
confirmText: '继续',
|
||||
success(res) {
|
||||
// 确认返回 true,取消/关闭返回 false
|
||||
resolve(res.confirm === true);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// 提取合并 orderinfo.detailMap 数组的逻辑
|
||||
function combineOrderInfoDetailMap(orderinfo) {
|
||||
if (!orderinfo) return [];
|
||||
let combinedArray = [];
|
||||
for (const key in orderinfo.detailMap) {
|
||||
if (orderinfo.detailMap.hasOwnProperty(key)) {
|
||||
let subArray = orderinfo.detailMap[key];
|
||||
combinedArray = [...combinedArray, ...subArray];
|
||||
}
|
||||
}
|
||||
return combinedArray;
|
||||
}
|
||||
// 提交选择并执行下一步操作的方法
|
||||
const submitSelection = async (goods) => {
|
||||
if (!isProductAvailable(goods.days, goods.startTime,
|
||||
@@ -664,7 +691,7 @@
|
||||
if (goods.type == 'package' && goods.groupType != 0 && !allConditionsSatisfied.value) {
|
||||
return
|
||||
}
|
||||
|
||||
const oldGoodsArr = combineOrderInfoDetailMap(props.orderinfo)
|
||||
if ((goods.type == 'package' && allConditionsSatisfied.value) || (goods.type ==
|
||||
'sku' && canSubmit.value)) {
|
||||
let res = null;
|
||||
@@ -688,6 +715,30 @@
|
||||
sku_id = selSku.value.id
|
||||
}
|
||||
console.log('goods', goods);
|
||||
console.log('res',res);
|
||||
const number=await calculateValue(res?res.number:0, '+', shopCartNumber.value)
|
||||
console.log('number',number);
|
||||
console.log('shopCartNumber',shopCartNumber.value);
|
||||
if(res && number*1===2){
|
||||
const isConfirm = await showConfirmModal(
|
||||
'购物车已有该商品,请确认是否重复',
|
||||
'菜品名称:《' + goods.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (oldGoodsArr.find(v => v.productId == goods.id)) {
|
||||
// 等待用户点击
|
||||
const isConfirm = await showConfirmModal(
|
||||
'该商品已下单过,请确认是否重复',
|
||||
'菜品名称:《' + goods.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
emits('websocketsendMessage', {
|
||||
id: res ? res.id : '',
|
||||
type: 'shopping',
|
||||
@@ -697,7 +748,7 @@
|
||||
operate_type: res ? 'edit' : 'add',
|
||||
product_id: goods.id,
|
||||
sku_id,
|
||||
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) :
|
||||
number: res ? number:
|
||||
shopCartNumber.value,
|
||||
pro_group_info: returnSelectedGroupSnap(),
|
||||
goods_type: goods.type == 'package' ? 'package' : '',
|
||||
@@ -708,6 +759,27 @@
|
||||
})
|
||||
} else {
|
||||
let res = cartStore.carts.find(cart => cart.product_id == goods.id && goods.skuList[0].id)
|
||||
const number=await calculateValue(res?res.number:0, '+', shopCartNumber.value)
|
||||
console.log('number',number);
|
||||
if(res && number*1===2){
|
||||
const isConfirm = await showConfirmModal(
|
||||
'购物车已有该商品,请确认是否重复',
|
||||
'菜品名称:《' + goods.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (oldGoodsArr.find(v => v.productId == goods.id)) {
|
||||
// 等待用户点击
|
||||
const isConfirm = await showConfirmModal(
|
||||
'该商品已下单过,请确认是否重复',
|
||||
'菜品名称:《' + goods.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
emits('websocketsendMessage', {
|
||||
id: res ? res.id : '',
|
||||
type: 'shopping',
|
||||
@@ -717,7 +789,7 @@
|
||||
operate_type: res ? 'edit' : 'add',
|
||||
product_id: goods.id,
|
||||
sku_id: goods.skuList[0].id,
|
||||
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) :
|
||||
number: res ? number:
|
||||
shopCartNumber.value,
|
||||
memberPrice: goods.memberPrice,
|
||||
is_print: 1,
|
||||
|
||||
@@ -58,13 +58,11 @@
|
||||
限时折扣{{ limitDiscountCountdown }}</view>
|
||||
<!-- <view class="limitDiscount" v-if="item.is_time_discount">
|
||||
限时折扣{{ limitDiscountCountdown }}</view> -->
|
||||
<view class="stock_warning"
|
||||
v-if="item.isStock&&item.stockNumber<=10&&item.stockNumber>0">
|
||||
仅剩{{item.stockNumber}}份</view>
|
||||
<view class="stock_warning" v-if="showStockNumber(item)&& !showNoBuy(item)">
|
||||
仅剩{{returnStockNumber(item)}}份</view>
|
||||
</view>
|
||||
|
||||
<view class="vifgoodsImg flex-center"
|
||||
v-if="item.isSale == 0 || (item.isSaleTime == 0 && !item.isSaleTimeshow) || item.isSoldStock == 1 || (item.isStock == 1 && item.stockNumber <= 0)">
|
||||
<view class="vifgoodsImg flex-center" v-if="showNoBuy(item)">
|
||||
<image v-if="item.isSale == 0" src="@/static/ztt/icon_goods_yxj.svg"
|
||||
style="width: 200rpx; height: 100%" mode=""></image>
|
||||
<image v-else-if="item.isSaleTime == 0 && !item.isSaleTimeshow"
|
||||
@@ -72,8 +70,8 @@
|
||||
</image>
|
||||
<image v-else-if="item.isSoldStock == 1" src="@/static/ztt/icon_goods_sq.svg"
|
||||
style="width: 200rpx; height: 100%" mode=""></image>
|
||||
<image v-else-if="item.isStock == 1 && item.stockNumber <= 0"
|
||||
src="@/static/ztt/icon_goods_kcbz.svg" style="width: 200rpx; height: 100%" mode="">
|
||||
<image v-else src="@/static/ztt/icon_goods_kcbz.svg" style="width: 200rpx; height: 100%"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32 u-row-between">
|
||||
@@ -192,7 +190,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="main">
|
||||
<view class="u-p-r-32">
|
||||
<view class="u-p-r-32" v-if="carouselList.length">
|
||||
<up-swiper indicator indicatorMode="line" height="188rpx" :list="carouselList"
|
||||
keyName="imageUrl">
|
||||
<template #default="scope">
|
||||
@@ -201,9 +199,7 @@
|
||||
style="width:600rpx;height: 188rpx;"></image>
|
||||
<view class="absolute swiper-mask" @click.stop="swiperClick(scope.item)">
|
||||
<view class="share-btn-box" v-if="showShare(scope.item)">
|
||||
<ymf-share
|
||||
@shareClick="shareBtnClick(scope.item)"
|
||||
>
|
||||
<ymf-share @shareClick="shareBtnClick(scope.item)">
|
||||
<view class="share-btn">分享</view>
|
||||
</ymf-share>
|
||||
</view>
|
||||
@@ -236,17 +232,11 @@
|
||||
|
||||
<!-- <view class="limitDiscount" v-if="item1.is_time_discount">
|
||||
限时折扣{{ limitDiscountCountdown }}</view> -->
|
||||
<view class="stock_warning"
|
||||
v-if="item1.isStock&&item1.stockNumber<=10&&item.stockNumber>0">
|
||||
仅剩{{item1.stockNumber}}份</view>
|
||||
<view class="stock_warning" v-if="showStockNumber(item1)&&!showNoBuy(item1)">
|
||||
仅剩{{returnStockNumber(item1)}}份</view>
|
||||
</view>
|
||||
|
||||
<view class="vifgoodsImg" v-if="
|
||||
item1.isSale == 0 ||
|
||||
(item1.isSaleTime == 0 && !item1.isSaleTimeshow) ||
|
||||
item1.isSoldStock == 1 ||
|
||||
(item1.isStock == 1 && item1.stockNumber <= 0)
|
||||
">
|
||||
<view class="vifgoodsImg" v-if="showNoBuy(item1)">
|
||||
<image v-if="item1.isSale == 0" src="@/static/ztt/icon_goods_yxj.svg"
|
||||
style="width: 200rpx; height: 100%" mode=""></image>
|
||||
<image v-else-if="item1.isSaleTime == 0 && !item1.isSaleTimeshow"
|
||||
@@ -254,9 +244,8 @@
|
||||
mode=""></image>
|
||||
<image v-else-if="item1.isSoldStock == 1" src="@/static/ztt/icon_goods_sq.svg"
|
||||
style="width: 200rpx; height: 100%" mode=""></image>
|
||||
<image v-else-if="item1.isStock == 1 && item1.stockNumber <= 0"
|
||||
src="@/static/ztt/icon_goods_kcbz.svg" style="width: 200rpx; height: 100%"
|
||||
mode=""></image>
|
||||
<image v-else src="@/static/ztt/icon_goods_kcbz.svg"
|
||||
style="width: 200rpx; height: 100%" mode=""></image>
|
||||
</view>
|
||||
|
||||
<view v-if="index == '0'" class="topSort" :class="'c' + (index1 + 1)">
|
||||
@@ -378,7 +367,7 @@
|
||||
<text class="allDiscountMoney" v-if="allDiscountMoney * 1 > 0">共减¥{{ allDiscountMoney }}</text>
|
||||
</view>
|
||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)" v-if="orderType == 'scan'">
|
||||
<text class="t">结算</text>
|
||||
<text class="t">去下单</text>
|
||||
</view>
|
||||
<view class="btn" v-else>
|
||||
<u-button type="primary" shape="circle" plain @click="beforehandHandle">扫码下单</u-button>
|
||||
@@ -401,193 +390,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 规格 -->
|
||||
<up-popup :show="showShopsku" :round="20" mode="bottom" @close="(showShopsku = false), (pagemetashow = false)">
|
||||
<view class="shop_sku">
|
||||
<scroll-view scroll-y style="max-height: 60vh; width: 100%">
|
||||
<view class="positionabsolute">
|
||||
<up-icon name="close-circle" @click="
|
||||
showShopsku = false;
|
||||
pagemetashow = false;
|
||||
" color="#000" size="25"></up-icon>
|
||||
</view>
|
||||
<up-swiper :list="specifications.item.images" @change="swiperChange" :current="swiperCurrent"
|
||||
radius="6px" height="250"
|
||||
@click="prveImgs(specifications.item.images, specifications.item.images[swiperCurrent])">
|
||||
<!-- <template v-slot:default="{item}">
|
||||
<image :src=item></image>
|
||||
</templte> -->
|
||||
</up-swiper>
|
||||
|
||||
<view class="shop_sku_name">{{ specifications.item.name }}</view>
|
||||
<view class="shop_sku_description" v-if="isSkuGoods">
|
||||
{{ specifications.item.shortTitle ? specifications.item.shortTitle : '' }}
|
||||
</view>
|
||||
<view v-if="specifications.item.type != 'package'">
|
||||
<view class="shop_sku_box" v-for="(specOptions, specType) in specifications.item.selectSpecInfo"
|
||||
:key="specType">
|
||||
<view class="shop_sku_box_name">
|
||||
{{ specType }}
|
||||
</view>
|
||||
<view class="flex-start">
|
||||
<view class="shop_sku_box_item" v-for="option in specOptions" :key="option"
|
||||
@click="selectSpec(specType, option)" :class="{
|
||||
shop_sku_box_item_selected: isSkuSelected(specType, option)
|
||||
}">
|
||||
{{ option }}
|
||||
<view class="shop_sku_box_item_tip"
|
||||
v-if="specifications.item.result && specifications.item.result.isSoldStock == 1 && selectedSpecs[specType] === option">
|
||||
<view>售罄</view>
|
||||
</view>
|
||||
<view class="shop_sku_box_item_tip"
|
||||
v-if="specifications.item.result == 'kong' && canSubmit == false && selectedSpecs[specType] === option">
|
||||
<view>已下架</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 套餐 -->
|
||||
<view v-else>
|
||||
<view class="shop_sku_box">
|
||||
<view v-for="(setmenu, setmenuindex) in specifications.item.groupSnap" :key="setmenuindex">
|
||||
<view class="shop_sku_box_name">{{ setmenu.title }} {{ setmenu.count }}
|
||||
选{{ setmenu.number }}</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="{
|
||||
shop_sku_box_item_selected: isOptionSelected(setmenuindex, option)
|
||||
}" :disabled="isMaxSelected(setmenuindex) && !isOptionSelected(setmenuindex, option)">
|
||||
{{ option.proName }}
|
||||
<text v-if="option.unitName">/{{ option.unitName }}</text>
|
||||
<view class="shop_sku_box_item_tip" v-if="specifications.item.isSoldStock == 1">
|
||||
<view>售罄</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 推荐搭配 -->
|
||||
<view class="u-m-t-48 u-p-30">
|
||||
<view class="font-bold u-font-32 ">推荐搭配</view>
|
||||
<view class="u-flex recommand-goods">
|
||||
<view class=" item" v-for="(item,index) in 6" :key="index">
|
||||
<up-image width="210rpx" height="210rpx" radius="12rpx"></up-image>
|
||||
<view class="info">
|
||||
<view class="u-line-2 name u-m-t-10 u-font-32 font-500">
|
||||
商品名
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold">
|
||||
<text class="u-font-24">¥</text>
|
||||
<text class="u-font-32">40</text>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 占位 -->
|
||||
<view class="shop_bottom">
|
||||
<view class="flex-between">
|
||||
<view class="price price-sku"
|
||||
v-if="specifications.item.type != 'package' && specifications.item.result">
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount"
|
||||
:cart="specifications.item.result" :shopUserInfo="shopUserInfo"
|
||||
:shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
|
||||
<text class="num" v-if="false">
|
||||
{{
|
||||
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
|
||||
? specifications.item.result.memberPrice || specifications.item.result.salePrice
|
||||
: specifications.item.result.salePrice
|
||||
}}
|
||||
</text>
|
||||
<text class="i"
|
||||
v-if="specifications.item.unitName">/{{ specifications.item.unitName }}</text>
|
||||
<text
|
||||
v-if="specifications.item.result.suitNum > 1">「{{ specifications.item.result.suitNum }}{{ specifications.item.result.unitName }}起点」</text>
|
||||
</view>
|
||||
<view class="price price-package" v-else>
|
||||
<text class="i">¥</text>
|
||||
<view class="num">
|
||||
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="specifications.item"
|
||||
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
|
||||
</view>
|
||||
<text class="num" v-if="false">
|
||||
{{
|
||||
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
|
||||
? specifications.item.memberPrice || specifications.item.salePrice
|
||||
: specifications.item.salePrice
|
||||
}}
|
||||
</text>
|
||||
<text class="i"
|
||||
v-if="specifications.item.unitName">/{{ specifications.item.unitName }}</text>
|
||||
<text
|
||||
v-if="specifications.item.suitNum > 1">「{{ specifications.item.suitNum }}{{ specifications.item.unitName }}起点」</text>
|
||||
</view>
|
||||
|
||||
<view class="operation-wrap"
|
||||
v-if="specifications.item.type != 'package'&&stockNumberIsFull(specifications.item)">
|
||||
<view class="btn">
|
||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
||||
v-if="shopCartNumber > 0"></up-icon>
|
||||
<view class="btnClick" @click="shopCart('-')"></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" @click="shopCart('+')"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
|
||||
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
|
||||
</view>
|
||||
<template v-if="!stockNumberIsFull(specifications.item)">
|
||||
<view class="addShopping">
|
||||
库存不足
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="isSkuGoods">
|
||||
<view v-if="specifications.item.type == 'package'" class="addShopping"
|
||||
:class="shopCartNumber > 0 && allConditionsSatisfied ? 'active' : ''"
|
||||
@click="submitSelection()">
|
||||
{{ skuBtnText }}
|
||||
</view>
|
||||
<view v-else class="addShopping" :class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
|
||||
@click="submitSelection()">
|
||||
{{ skuBtnText }}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="addShopping" :class="shopCartNumber > 0 ? 'active' : ''"
|
||||
@click="submitSelection()">
|
||||
{{ skuBtnText }}
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<view class="history_order" @click="toHistory"
|
||||
v-if="shopInfo && shopInfo.registerType == 'after' && orderinfo.id">
|
||||
<image class="img" src="@/static/history.png" mode=""></image>
|
||||
@@ -598,7 +401,7 @@
|
||||
<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"
|
||||
<goodsModal :key="index" v-model="item.show" :goods="item.goods" @prveImgs="prveImgs" :orderinfo="orderinfo"
|
||||
@shareClick="shareClick" @close="goodsModalClose(index)" @websocketsendMessage="websocketsendMessage"
|
||||
@modalAdd="modalAdd" :GoodsIDInCartNumMap="GoodsIDInCartNumMap"></goodsModal>
|
||||
</view>
|
||||
@@ -640,7 +443,7 @@
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<ymf-share-popup ></ymf-share-popup>
|
||||
<ymf-share-popup></ymf-share-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -663,6 +466,7 @@
|
||||
APIgroupquery,
|
||||
APIminiAppinfo,
|
||||
APIminiAppskuinfo,
|
||||
getConsStock,
|
||||
productRelated
|
||||
} from '@/common/api/product/product.js';
|
||||
|
||||
@@ -758,6 +562,32 @@
|
||||
productStore
|
||||
} from '@/stores/user.js';
|
||||
|
||||
// 是否显示禁止购买
|
||||
function showNoBuy(item) {
|
||||
if (item.isSale == 0) {
|
||||
return true
|
||||
}
|
||||
if (item.isSaleTime == 0 && !item.isSaleTimeshow) {
|
||||
return true
|
||||
}
|
||||
if (item.isSoldStock == 1) {
|
||||
return true
|
||||
}
|
||||
if(item.type==="single"){
|
||||
const sku=item.skuList[0]
|
||||
if(!sku){
|
||||
return true
|
||||
}
|
||||
if(sku&&returnStockNumber(item)<sku.suitNum){
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (returnStockNumber(item) <= 0) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const storeMemberpay = Memberpay();
|
||||
const store = useNavbarStore();
|
||||
// 动态更新导航栏配置
|
||||
@@ -776,6 +606,7 @@
|
||||
} from '@/stores/order.js';
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
provide,
|
||||
reactive
|
||||
} from 'vue';
|
||||
@@ -933,6 +764,9 @@
|
||||
|
||||
//左侧导航点击
|
||||
const leftTap = (index) => {
|
||||
console.log('topArr.value[index] ', topArr.value[index]);
|
||||
console.log('store.height', store.height);
|
||||
console.log('scrollTop', topArr.value[index] - store.height);
|
||||
uni.pageScrollTo({
|
||||
scrollTop: topArr.value[index] - store.height,
|
||||
duration: 0
|
||||
@@ -947,6 +781,7 @@
|
||||
|
||||
/* 获取元素顶部信息 */
|
||||
const getElementTop = () => {
|
||||
console.log('getElementTop');
|
||||
new Promise((resolve, reject) => {
|
||||
let view = uni.createSelectorQuery().selectAll('.main-item');
|
||||
view.boundingClientRect(async (data) => {
|
||||
@@ -1025,48 +860,49 @@
|
||||
|
||||
/*商品区域轮播图 start*/
|
||||
|
||||
const shareSwiperItem=ref(null)
|
||||
const shareSwiperItem = ref(null)
|
||||
|
||||
function swiperClick(item) {
|
||||
console.log('swiperClick',item);
|
||||
shareSwiperItem.value=item
|
||||
const pTag=returnPageTags(item.jumpPagePath)
|
||||
console.log('swiperClick', item);
|
||||
shareSwiperItem.value = item
|
||||
const pTag = returnPageTags(item.jumpPagePath)
|
||||
|
||||
if(pTag==='pp-list'){
|
||||
if (pTag === 'pp-list') {
|
||||
return uni.navigateTo({
|
||||
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
|
||||
url: item.jumpPagePath + '&shopId=' + uni.cache.get('shopId')
|
||||
})
|
||||
}
|
||||
if(pTag==='pp-detail'){
|
||||
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
|
||||
if (pTag === 'pp-detail') {
|
||||
const url = item.jumpPagePath + '&shopId=' + uni.cache.get('shopId') + '&' + item.extendParam
|
||||
return uni.navigateTo({
|
||||
url:url.replace('goodsId','id')
|
||||
url: url.replace('goodsId', 'id')
|
||||
})
|
||||
}
|
||||
if(pTag==='gb-list'){
|
||||
if (pTag === 'gb-list') {
|
||||
return uni.navigateTo({
|
||||
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
|
||||
url: item.jumpPagePath + '&shopId=' + uni.cache.get('shopId')
|
||||
})
|
||||
}
|
||||
if(pTag==='gb-detail'){
|
||||
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
|
||||
if (pTag === 'gb-detail') {
|
||||
const url = item.jumpPagePath + '&shopId=' + uni.cache.get('shopId') + '&' + item.extendParam
|
||||
return uni.navigateTo({
|
||||
url:url.replace('goodsId','wareId')
|
||||
url: url.replace('goodsId', 'wareId')
|
||||
})
|
||||
}
|
||||
if(pTag==='dis'){
|
||||
if (pTag === 'dis') {
|
||||
return uni.navigateTo({
|
||||
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
|
||||
url: item.jumpPagePath + '&shopId=' + uni.cache.get('shopId')
|
||||
})
|
||||
}
|
||||
if(pTag==='index'){
|
||||
if (pTag === 'index') {
|
||||
return uni.switchTab({
|
||||
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
|
||||
url: item.jumpPagePath + '&shopId=' + uni.cache.get('shopId')
|
||||
})
|
||||
}
|
||||
|
||||
if(pTag==='eat'){
|
||||
if (pTag === 'eat') {
|
||||
if (item.extendParam) {
|
||||
const id=item.extendParam.split('=')[1]
|
||||
const id = item.extendParam.split('=')[1]
|
||||
const item = allGoodsArr.value.find(v => v.id == id)
|
||||
if (item) {
|
||||
clickspecifications(item)
|
||||
@@ -1074,27 +910,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
if(pTag==='point'){
|
||||
if (pTag === 'point') {
|
||||
return uni.navigateTo({
|
||||
url:item.jumpPagePath+'&shopId='+uni.cache.get('shopId')
|
||||
url: item.jumpPagePath + '&shopId=' + uni.cache.get('shopId')
|
||||
})
|
||||
}
|
||||
if(pTag==='point-detail'){
|
||||
const url=item.jumpPagePath+'&shopId='+uni.cache.get('shopId')+'&'+item.extendParam
|
||||
if (pTag === 'point-detail') {
|
||||
const url = item.jumpPagePath + '&shopId=' + uni.cache.get('shopId') + '&' + item.extendParam
|
||||
return uni.navigateTo({
|
||||
url:url.replace('goodsId','id')
|
||||
url: url.replace('goodsId', 'id')
|
||||
})
|
||||
}
|
||||
}
|
||||
function showShare(item){
|
||||
if(item.isShareable&&item.isEnabled){
|
||||
|
||||
function showShare(item) {
|
||||
if (item.isShareable && item.isEnabled) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
/*商品区域轮播图 end*/
|
||||
// 点击详情
|
||||
const showShopsku = ref(false);
|
||||
|
||||
// 规格信息
|
||||
const specifications = reactive({
|
||||
@@ -1363,6 +1198,7 @@
|
||||
|
||||
// 提交选择并执行下一步操作的方法
|
||||
const submitSelection = async () => {
|
||||
console.log('submitSelection', submitSelection)
|
||||
if (!isProductAvailable(specifications.productListitem.days, specifications.productListitem.startTime,
|
||||
specifications.productListitem.endTime)) {
|
||||
uni.showToast({
|
||||
@@ -1387,6 +1223,33 @@
|
||||
selectedGroupSnap.value = [];
|
||||
}
|
||||
console.log('specifications.item', specifications.item);
|
||||
const number = await calculateValue(res.cartNumber, '+', shopCartNumber.value)
|
||||
|
||||
const oldGoodsArr = combineOrderInfoDetailMap(orderinfo.value)
|
||||
if (oldGoodsArr.find(v => v.productId == specifications.item.id)) {
|
||||
// 等待用户点击
|
||||
const isConfirm = await showConfirmModal(
|
||||
'该商品已下单过,请确认是否重复',
|
||||
'菜品名称:《' + specifications.item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (res && number * 1 === 2) {
|
||||
const isConfirm = await showConfirmModal(
|
||||
'购物车已有该商品,请确认是否重复',
|
||||
'菜品名称:《' + specifications.item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
websocketsendMessage({
|
||||
id: res ? res.cartListId : '',
|
||||
type: 'shopping',
|
||||
@@ -1396,8 +1259,7 @@
|
||||
operate_type: res ? 'edit' : 'add',
|
||||
product_id: specifications.product_id,
|
||||
sku_id: specifications.sku_id,
|
||||
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) :
|
||||
shopCartNumber.value,
|
||||
number: res ? number : shopCartNumber.value,
|
||||
pro_group_info: selectedGroupSnap.value,
|
||||
goods_type: specifications.item.type == 'package' ? 'package' : '',
|
||||
memberPrice: specifications.item.memberPrice,
|
||||
@@ -1407,8 +1269,31 @@
|
||||
});
|
||||
// 清空套餐选中
|
||||
selectedGroupSnap.value = [];
|
||||
showShopsku.value = false;
|
||||
} else {
|
||||
const number = await calculateValue(res.cartNumber, '+', shopCartNumber.value)
|
||||
const oldGoodsArr = combineOrderInfoDetailMap(orderinfo.value)
|
||||
if (oldGoodsArr.find(v => v.productId == specifications.item.id)) {
|
||||
// 等待用户点击
|
||||
const isConfirm = await showConfirmModal(
|
||||
'该商品已下单过,请确认是否重复',
|
||||
'菜品名称:《' + specifications.item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (res && number * 1 === 2) {
|
||||
const isConfirm = await showConfirmModal(
|
||||
'购物车已有该商品,请确认是否重复',
|
||||
'菜品名称:《' + specifications.item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
websocketsendMessage({
|
||||
id: res ? res.cartListId : '',
|
||||
type: 'shopping',
|
||||
@@ -1418,14 +1303,12 @@
|
||||
operate_type: res ? 'edit' : 'add',
|
||||
product_id: specifications.product_id,
|
||||
sku_id: specifications.sku_id,
|
||||
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) :
|
||||
shopCartNumber.value,
|
||||
number: res ? number : shopCartNumber.value,
|
||||
memberPrice: specifications.item.memberPrice,
|
||||
is_print: 1,
|
||||
product_type: specifications.item.type,
|
||||
is_time_discount: showLimitDiscount(specifications.item)
|
||||
});
|
||||
showShopsku.value = false;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1540,7 +1423,6 @@
|
||||
.filter(([_, value]) => value.length > 0));
|
||||
// 给默认数量
|
||||
specifications.item.amountcartNumber = 0;
|
||||
// showShopsku.value = true;
|
||||
goodsModalList.value.push({
|
||||
show: true,
|
||||
goods: {
|
||||
@@ -1553,7 +1435,7 @@
|
||||
};
|
||||
// 判断商品是否在可售时间内
|
||||
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
|
||||
if(!sellDaysStr){
|
||||
if (!sellDaysStr) {
|
||||
return false
|
||||
}
|
||||
// 将后端返回的字符串转换为数组
|
||||
@@ -1618,6 +1500,23 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 封装成 Promise 的确认弹窗
|
||||
const showConfirmModal = (title, content) => {
|
||||
return new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title: title,
|
||||
content: content,
|
||||
showCancel: true,
|
||||
cancelText: '取消添加',
|
||||
confirmText: '继续',
|
||||
success(res) {
|
||||
// 确认返回 true,取消/关闭返回 false
|
||||
resolve(res.confirm === true);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
// 单规格
|
||||
const singleclick = async (item, i) => {
|
||||
console.log('单规格商品点击事件:', item, i);
|
||||
@@ -1645,17 +1544,53 @@
|
||||
} else if (item.suitNum >= cartNumberFloat && i === '-') {
|
||||
suitNum = item.cartNumber;
|
||||
}
|
||||
|
||||
const number = await calculateValue(item.cartNumber, i, suitNum)
|
||||
const goodsStockNumber = returnStockNumber(item)
|
||||
|
||||
console.log('number', number);
|
||||
if (i === '+') {
|
||||
if (goodsStockNumber < suitNum) {
|
||||
return uni.showToast({
|
||||
title: '库存不足',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
const oldGoodsArr = combineOrderInfoDetailMap(orderinfo.value)
|
||||
if (oldGoodsArr.find(v => v.productId == item.id)) {
|
||||
// 等待用户点击
|
||||
const isConfirm = await showConfirmModal(
|
||||
'该商品已下单过,请确认是否重复',
|
||||
'菜品名称:《' + item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (number * 1 == 2) {
|
||||
const isConfirm = await showConfirmModal(
|
||||
'购物车已有该商品,请确认是否重复',
|
||||
'菜品名称:《' + item.name + '》'
|
||||
);
|
||||
if (!isConfirm) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const sendMsg = {
|
||||
type: 'shopping',
|
||||
suitNum: item.suitNum,
|
||||
table_code: uni.cache.get('tableCode'),
|
||||
shop_id: uni.cache.get('shopId'),
|
||||
operate_type: (await calculateValue(item.cartNumber, i, suitNum)) == 'del' ? 'del' : res ? 'edit' :
|
||||
'add',
|
||||
operate_type: number == 'del' ? 'del' : res ? 'edit' : 'add',
|
||||
product_id: item.id,
|
||||
sku_id: item.skuId,
|
||||
memberPrice: item.memberPrice,
|
||||
number: await calculateValue(item.cartNumber, i, suitNum),
|
||||
number: number,
|
||||
is_print: 1,
|
||||
product_type: item.type,
|
||||
is_time_discount: showLimitDiscount(item)
|
||||
@@ -2089,6 +2024,7 @@
|
||||
const orderinfo = ref({});
|
||||
const confirmorderref = ref(null);
|
||||
|
||||
|
||||
// 结账
|
||||
const orderdetail = async () => {
|
||||
isAutoClose = false;
|
||||
@@ -2504,7 +2440,7 @@
|
||||
|
||||
console.log('options.initMessage', options.initMessage)
|
||||
const newTableCode = userStore.getQueryString(res.result, 'code');
|
||||
|
||||
console.log('newTableCode', newTableCode);
|
||||
const shopInfoRes = await APIproductqueryShop({
|
||||
tableCode: newTableCode
|
||||
});
|
||||
@@ -2562,7 +2498,8 @@
|
||||
handleMixinOnLoad,
|
||||
returnQuery,
|
||||
jsonToUrl,
|
||||
wxShare,returnPageTags,
|
||||
wxShare,
|
||||
returnPageTags,
|
||||
returnCommonQuery
|
||||
} from '@/utils/share.js'
|
||||
// defineOptions({
|
||||
@@ -2576,38 +2513,41 @@
|
||||
isGoodsShare.value = true
|
||||
}
|
||||
|
||||
function getPage(pageStr){
|
||||
function getPage(pageStr) {
|
||||
|
||||
}
|
||||
function shareBtnClick(item){
|
||||
console.log('shareBtnClick',item);
|
||||
shareSwiperItem.value=item
|
||||
|
||||
function shareBtnClick(item) {
|
||||
console.log('shareBtnClick', item);
|
||||
shareSwiperItem.value = item
|
||||
}
|
||||
function swiperShare(queryJson){
|
||||
console.log('shareSwiperItem',shareSwiperItem.value);
|
||||
const pTag=returnPageTags(shareSwiperItem.value.jumpPagePath)
|
||||
|
||||
function swiperShare(queryJson) {
|
||||
console.log('shareSwiperItem', shareSwiperItem.value);
|
||||
const pTag = returnPageTags(shareSwiperItem.value.jumpPagePath)
|
||||
let query = jsonToUrl(queryJson)
|
||||
query +=('&'+shareSwiperItem.value.extendParam)
|
||||
query += ('&' + shareSwiperItem.value.extendParam)
|
||||
const shopName = uni.cache.get('shopInfo').shopName || ''
|
||||
const path=shareSwiperItem.value.jumpPagePath?shareSwiperItem.value.jumpPagePath:'/pages/product/index?type=beforehand'
|
||||
console.log('path',path);
|
||||
const json={
|
||||
imageUrl:shareSwiperItem.value.imageUrl,
|
||||
path: path+'&'+query,
|
||||
title:shareSwiperItem.value.name+ (shopName ? `-${shopName}` : ''),
|
||||
const path = shareSwiperItem.value.jumpPagePath ? shareSwiperItem.value.jumpPagePath :
|
||||
'/pages/product/index?type=beforehand'
|
||||
console.log('path', path);
|
||||
const json = {
|
||||
imageUrl: shareSwiperItem.value.imageUrl,
|
||||
path: path + '&' + query,
|
||||
title: shareSwiperItem.value.name + (shopName ? `-${shopName}` : ''),
|
||||
}
|
||||
if(pTag==='pp-detail'){
|
||||
json.path=json.path.replace('goodsId','id')
|
||||
if (pTag === 'pp-detail') {
|
||||
json.path = json.path.replace('goodsId', 'id')
|
||||
}
|
||||
if(pTag==='gb-detail'){
|
||||
json.path=json.path.replace('goodsId','wareId')
|
||||
if (pTag === 'gb-detail') {
|
||||
json.path = json.path.replace('goodsId', 'wareId')
|
||||
}
|
||||
if(pTag==='point-detail'){
|
||||
json.path=json.path.replace('goodsId','id')
|
||||
if (pTag === 'point-detail') {
|
||||
json.path = json.path.replace('goodsId', 'id')
|
||||
}
|
||||
if(pTag.includes('eat')){
|
||||
if(shareSwiperItem.value.extendParam){
|
||||
json.path=json.path.replace('goodsId','showGoodsId')
|
||||
if (pTag.includes('eat')) {
|
||||
if (shareSwiperItem.value.extendParam) {
|
||||
json.path = json.path.replace('goodsId', 'showGoodsId')
|
||||
}
|
||||
}
|
||||
return wxShare(json)
|
||||
@@ -2616,7 +2556,7 @@
|
||||
|
||||
async function onShare() {
|
||||
const queryJson = await returnCommonQuery()
|
||||
if(shareSwiperItem.value){
|
||||
if (shareSwiperItem.value) {
|
||||
return swiperShare(queryJson)
|
||||
}
|
||||
let query = jsonToUrl(queryJson)
|
||||
@@ -2648,6 +2588,42 @@
|
||||
const pageOptions = reactive({})
|
||||
|
||||
const carouselList = ref([])
|
||||
|
||||
async function getConsStocks() {
|
||||
const res = await getConsStock({
|
||||
shopId: userStore.shopInfo.id
|
||||
})
|
||||
consStockList.value = res || []
|
||||
}
|
||||
const consStockList = ref([])
|
||||
|
||||
|
||||
// 是否显示剩余库存数量
|
||||
function showStockNumber(item) {
|
||||
return !item.isSoldStock && returnStockNumber(item) <= 10 && returnStockNumber(item) > 0
|
||||
}
|
||||
|
||||
function returnStockNumber(item) {
|
||||
if (!item.isAutoSoldStock) {
|
||||
return 9999
|
||||
}
|
||||
const consList = item.consList
|
||||
const matchStockList = consStockList.value.filter(v => {
|
||||
return consList.find(c => c.consInfoId == v.consId)
|
||||
}).map(v => {
|
||||
const cItem = item.consList.find(c => c.consInfoId == v.consId)
|
||||
const goodsNumber = Math.floor(v.stockNumber / cItem.surplusStock)
|
||||
return {
|
||||
...v,
|
||||
goodsNumber
|
||||
}
|
||||
}).sort((a, b) => {
|
||||
return a.goodsNumber - b.goodsNumber
|
||||
})
|
||||
|
||||
const minConsStockNumber = matchStockList[0] ? matchStockList[0].goodsNumber : 9999
|
||||
return minConsStockNumber
|
||||
}
|
||||
onLoad(async (e) => {
|
||||
Object.assign(pageOptions, e)
|
||||
if (e.type) {
|
||||
@@ -2723,14 +2699,17 @@
|
||||
tableCode: uni.cache.get('tableCode')
|
||||
});
|
||||
oldOrder.value = res;
|
||||
nextTick(() => {
|
||||
getElementTop();
|
||||
})
|
||||
if (res && res.id && shopInfo.registerType == 'after' && !e.noJump) {
|
||||
toHistory();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
// 启动网络监听
|
||||
useSocket.initNetworkListener();
|
||||
getElementTop();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
@@ -2811,6 +2790,12 @@
|
||||
id: ''
|
||||
};
|
||||
}
|
||||
// if(!topArr.value.length){
|
||||
// getElementTop()
|
||||
// }
|
||||
|
||||
//耗材列表
|
||||
await getConsStocks()
|
||||
});
|
||||
|
||||
//是否自动关闭socket
|
||||
@@ -2824,7 +2809,7 @@
|
||||
}
|
||||
onHide(() => {
|
||||
isGoodsShare.value = false
|
||||
shareSwiperItem.value=null
|
||||
shareSwiperItem.value = null
|
||||
closeSocket();
|
||||
});
|
||||
onUnload(() => {
|
||||
@@ -4074,11 +4059,12 @@
|
||||
padding: 32rpx 28rpx;
|
||||
}
|
||||
|
||||
.share-btn-box{
|
||||
.share-btn-box {
|
||||
position: absolute;
|
||||
right: 8rpx;
|
||||
bottom: 14rpx;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
|
||||
padding: 10rpx 32rpx;
|
||||
|
||||
@@ -118,7 +118,6 @@
|
||||
onMounted,
|
||||
getCurrentInstance,
|
||||
nextTick,
|
||||
onShow
|
||||
} from 'vue';
|
||||
|
||||
//接口引入
|
||||
|
||||
@@ -232,7 +232,7 @@ const myFunList = ref([
|
||||
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
|
||||
},
|
||||
{
|
||||
name: '分销',
|
||||
name: '全民股东',
|
||||
type: 'fenxiao',
|
||||
icon: '/static/icon/fenxiao.svg'
|
||||
},
|
||||
|
||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -30,8 +30,8 @@ importers:
|
||||
specifier: ^0.1.2
|
||||
version: 0.1.2
|
||||
ysk-utils:
|
||||
specifier: ^1.0.83
|
||||
version: 1.0.83
|
||||
specifier: ^1.0.85
|
||||
version: 1.0.85
|
||||
devDependencies:
|
||||
unplugin-auto-import:
|
||||
specifier: ^0.16.7
|
||||
@@ -50,13 +50,13 @@ packages:
|
||||
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
'@babel/parser@7.28.5':
|
||||
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
|
||||
'@babel/parser@7.28.6':
|
||||
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
'@babel/types@7.28.5':
|
||||
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
|
||||
'@babel/types@7.28.6':
|
||||
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
'@dcloudio/types@3.4.21':
|
||||
@@ -357,8 +357,8 @@ packages:
|
||||
webpack-virtual-modules@0.6.2:
|
||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||
|
||||
ysk-utils@1.0.83:
|
||||
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
|
||||
ysk-utils@1.0.85:
|
||||
resolution: {integrity: sha512-HkbV4Jidi3G6DAuGAN972tClUYtC2zVoxo4crrxexfn0rZa8HjXatUfEbawHOeEzyl6G1CdC+160I2bKfxEBlA==}
|
||||
|
||||
snapshots:
|
||||
|
||||
@@ -368,11 +368,11 @@ snapshots:
|
||||
|
||||
'@babel/helper-validator-identifier@7.28.5': {}
|
||||
|
||||
'@babel/parser@7.28.5':
|
||||
'@babel/parser@7.28.6':
|
||||
dependencies:
|
||||
'@babel/types': 7.28.5
|
||||
'@babel/types': 7.28.6
|
||||
|
||||
'@babel/types@7.28.5':
|
||||
'@babel/types@7.28.6':
|
||||
dependencies:
|
||||
'@babel/helper-string-parser': 7.27.1
|
||||
'@babel/helper-validator-identifier': 7.28.5
|
||||
@@ -408,7 +408,7 @@ snapshots:
|
||||
|
||||
'@vue/compiler-core@3.5.22':
|
||||
dependencies:
|
||||
'@babel/parser': 7.28.5
|
||||
'@babel/parser': 7.28.6
|
||||
'@vue/shared': 3.5.22
|
||||
entities: 4.5.0
|
||||
estree-walker: 2.0.2
|
||||
@@ -421,7 +421,7 @@ snapshots:
|
||||
|
||||
'@vue/compiler-sfc@3.5.22':
|
||||
dependencies:
|
||||
'@babel/parser': 7.28.5
|
||||
'@babel/parser': 7.28.6
|
||||
'@vue/compiler-core': 3.5.22
|
||||
'@vue/compiler-dom': 3.5.22
|
||||
'@vue/compiler-ssr': 3.5.22
|
||||
@@ -684,7 +684,7 @@ snapshots:
|
||||
|
||||
webpack-virtual-modules@0.6.2: {}
|
||||
|
||||
ysk-utils@1.0.83:
|
||||
ysk-utils@1.0.85:
|
||||
dependencies:
|
||||
bignumber.js: 9.3.1
|
||||
loadsh: 0.0.4
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
}
|
||||
if (res.memberConfig.isSubmitInfo && (shopUserInfo.value.sex === null || shopUserInfo.value.sex ===
|
||||
undefined || !shopUserInfo.value.nickName || !shopUserInfo.value.birthDay || !shopUserInfo.value
|
||||
.phone)) {
|
||||
.phone||shopUserInfo.value.nickName==='微信用户')) {
|
||||
memberOpen.value = true;
|
||||
}
|
||||
conditionList.value = res.memberConfig.conditionList.map(v => {
|
||||
|
||||
Reference in New Issue
Block a user