Compare commits
9 Commits
189459845c
...
a6174a036c
| Author | SHA1 | Date | |
|---|---|---|---|
| a6174a036c | |||
| 1264286269 | |||
| 6e2161fc5e | |||
| a95d7ebf01 | |||
| 0f640bdf9e | |||
| ea3fb0fe0f | |||
| 8b5d81c6c8 | |||
| 4b1be95bc0 | |||
| 13ae818fd4 |
@@ -28,7 +28,7 @@ import { ref, onMounted } from 'vue';
|
|||||||
import { centerConfig,distributionEditIn } from '@/common/api/market/distribution.js';
|
import { centerConfig,distributionEditIn } from '@/common/api/market/distribution.js';
|
||||||
import { checkArrayElementsExist } from '@/utils/util.js';
|
import { checkArrayElementsExist } from '@/utils/util.js';
|
||||||
|
|
||||||
const shopInfo = ref('');
|
const shopInfo = defineModel('shopInfo');
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
|
|||||||
514
components/registermember.vue
Normal file
514
components/registermember.vue
Normal file
@@ -0,0 +1,514 @@
|
|||||||
|
<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 {
|
||||||
|
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']);
|
||||||
|
|
||||||
|
// 定义要触发的事件
|
||||||
|
|
||||||
|
const formInfo = reactive({
|
||||||
|
nickName: "",
|
||||||
|
telephone: "",
|
||||||
|
birthDay: "",
|
||||||
|
sex:1,
|
||||||
|
})
|
||||||
|
const userHeadImg = ref('')
|
||||||
|
|
||||||
|
watchEffect(()=>{
|
||||||
|
formInfo.nickName= `${props.shopUserInfo.nickName}`.trim() ==='微信用户' ? '' :''
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
await APIshopUser(submitForm)
|
||||||
|
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'
|
||||||
|
})
|
||||||
|
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 => {
|
}).then(res => {
|
||||||
// console.log('分享组件挂载完毕:shareConfig',res);
|
// console.log('分享组件挂载完毕:shareConfig',res);
|
||||||
// console.log('分享组件挂载完毕:currentOptions',currentOptions);
|
// console.log('分享组件挂载完毕:currentOptions',currentOptions);
|
||||||
if(res){
|
if(res&& typeof res==='object'){
|
||||||
Object.assign(config,res)
|
Object.assign(config,res)
|
||||||
const rewardSharePages=res.rewardSharePages.split(',')
|
const rewardSharePages=res.rewardSharePages.split(',')
|
||||||
const pTag = returnPageTags(path)
|
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
|
show.value=true
|
||||||
}
|
}
|
||||||
// if(res.sharedUserCouponId&&res.sharedUserCouponNum){
|
// if(res.sharedUserCouponId&&res.sharedUserCouponNum){
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<up-navbar
|
<up-navbar
|
||||||
bg-color="transparent"
|
bg-color="transparent"
|
||||||
title="分销中心"
|
title="全民股东"
|
||||||
@leftClick="back"
|
@leftClick="back"
|
||||||
:fixed="true"
|
:fixed="true"
|
||||||
></up-navbar>
|
></up-navbar>
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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"
|
class="u-flex justify-center font-12 color-666"
|
||||||
style="align-items: baseline"
|
style="align-items: baseline"
|
||||||
@click="toShopList('activates')"
|
@click="toShopList('activates')"
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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"
|
class="u-flex justify-center font-12 color-666"
|
||||||
style="align-items: baseline"
|
style="align-items: baseline"
|
||||||
@click="toShopList('unActivates')"
|
@click="toShopList('unActivates')"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<view class="u-m-l-32 u-flex-1 border">
|
<view class="u-m-l-32 u-flex-1 border">
|
||||||
<input placeholder="请输入上级邀请码" v-model="code" />
|
<input placeholder="请输入上级邀请码" v-model="code" />
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
|
<view class="u-m-t-32 u-flex u-col-center" style="gap: 54rpx">
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="w-qrcode">
|
<view class="w-qrcode">
|
||||||
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
|
<w-qrcode :options="codeOptions" :opacity="0" ref="wQrcode" @generate="(e) => qrcodeResult(e)"></w-qrcode>
|
||||||
</view>
|
</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="box">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="u-flex justify-center">
|
<view class="u-flex justify-center">
|
||||||
@@ -25,12 +26,15 @@
|
|||||||
ref="wQrcode"
|
ref="wQrcode"
|
||||||
@generate="(e) => qrcodeResult(e)"
|
@generate="(e) => qrcodeResult(e)"
|
||||||
></w-qrcode> -->
|
></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>
|
</view>
|
||||||
<view class="footer-wrap">
|
<view class="footer-wrap">
|
||||||
<view class="confirm line" @click="save">保存图片</view>
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</up-popup>
|
</up-popup>
|
||||||
@@ -38,223 +42,252 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { shareMixin, handleMixinOnLoad, returnQuery } from '@/utils/share.js';
|
import {
|
||||||
import ymfShare from '@/components/ymf-components/ymf-share.vue';
|
shareMixin,
|
||||||
import wQrcode from '@/uni_modules/wmf-code/components/w-qrcode/w-qrcode.vue';
|
handleMixinOnLoad,
|
||||||
import { desensitizePhone } from '@/utils/util.js';
|
returnQuery
|
||||||
import { ref, onMounted, nextTick } from 'vue';
|
} 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 () => {
|
onMounted(async () => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
const query = await returnQuery();
|
const query = await returnQuery();
|
||||||
codeOptions.value.code = `https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
|
codeOptions.value.code =
|
||||||
console.log('codeOptions.value', codeOptions.value);
|
`https://cashier.sxczgkj.com/invite?${removeQAndAfter(query)}`;
|
||||||
}, 500);
|
console.log('codeOptions.value', codeOptions.value);
|
||||||
});
|
}, 500);
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 截取字符串,移除 &q 及后面的所有内容
|
* 截取字符串,移除 &q 及后面的所有内容
|
||||||
* @param {string} str - 原始字符串
|
* @param {string} str - 原始字符串
|
||||||
* @returns {string} 处理后的字符串
|
* @returns {string} 处理后的字符串
|
||||||
*/
|
*/
|
||||||
function removeQAndAfter(str) {
|
function removeQAndAfter(str) {
|
||||||
// 检查是否为空字符串
|
// 检查是否为空字符串
|
||||||
if (!str || typeof str !== 'string') {
|
if (!str || typeof str !== 'string') {
|
||||||
return str || '';
|
return str || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 找到 &q 的起始位置
|
||||||
|
const qIndex = str.indexOf('&q');
|
||||||
|
|
||||||
|
// 如果找到 &q,截取前面的部分;否则返回原字符串
|
||||||
|
return qIndex !== -1 ? str.slice(0, qIndex) : str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 找到 &q 的起始位置
|
const props = defineProps({
|
||||||
const qIndex = str.indexOf('&q');
|
inviteCode: {
|
||||||
|
type: String,
|
||||||
// 如果找到 &q,截取前面的部分;否则返回原字符串
|
default: ''
|
||||||
return qIndex !== -1 ? str.slice(0, qIndex) : str;
|
},
|
||||||
}
|
shopUserInfo: {
|
||||||
|
type: Object,
|
||||||
const props = defineProps({
|
default: () => {}
|
||||||
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 code = ref('');
|
|
||||||
|
|
||||||
function qrcodeResult(e) {
|
const codeOptions = ref({
|
||||||
console.log('qrcodeResult', e);
|
padding: 10,
|
||||||
code.value = e.img.tempFilePath;
|
size: 200,
|
||||||
console.log('code', code.value);
|
code: ''
|
||||||
}
|
});
|
||||||
|
|
||||||
const show = defineModel({
|
function copyCode() {
|
||||||
type: Boolean,
|
uni.setClipboardData({
|
||||||
default: false
|
data: props.inviteCode,
|
||||||
});
|
success: function() {
|
||||||
const emits = defineEmits(['cancel', 'confirm']);
|
console.log('success');
|
||||||
function close() {
|
}
|
||||||
show.value = false;
|
});
|
||||||
emits('cancel');
|
}
|
||||||
}
|
const code = ref('');
|
||||||
function save() {
|
|
||||||
show.value = false;
|
|
||||||
|
|
||||||
// 保存图片到相册
|
function qrcodeResult(e) {
|
||||||
uni.saveImageToPhotosAlbum({
|
console.log('qrcodeResult', e);
|
||||||
filePath: code.value,
|
code.value = e.img.tempFilePath;
|
||||||
success: function () {
|
console.log('code', code.value);
|
||||||
uni.showToast({
|
}
|
||||||
title: '保存成功',
|
|
||||||
icon: 'none'
|
const show = defineModel({
|
||||||
});
|
type: Boolean,
|
||||||
},
|
default: false
|
||||||
fail: function (err) {
|
});
|
||||||
console.log('保存失败原因:', err);
|
const emits = defineEmits(['cancel', 'confirm']);
|
||||||
// 判断是否为授权拒绝(微信小程序授权拒绝的特征)
|
|
||||||
if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
|
function close() {
|
||||||
// 弹出提示引导用户去设置页开启授权
|
show.value = false;
|
||||||
uni.showModal({
|
emits('cancel');
|
||||||
title: '授权提示',
|
}
|
||||||
content: '保存图片需要授权访问相册,请前往设置开启授权',
|
|
||||||
showCancel: true,
|
function save() {
|
||||||
cancelText: '取消',
|
show.value = false;
|
||||||
confirmText: '去设置',
|
|
||||||
success: function (res) {
|
// 保存图片到相册
|
||||||
if (res.confirm) {
|
uni.saveImageToPhotosAlbum({
|
||||||
// 跳转到微信小程序的授权设置页
|
filePath: code.value,
|
||||||
uni.openSetting({
|
success: function() {
|
||||||
success: function (settingRes) {
|
uni.showToast({
|
||||||
// 检查用户是否开启了相册授权
|
title: '保存成功',
|
||||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
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({
|
uni.showToast({
|
||||||
title: '授权成功,可重新保存',
|
title: '打开设置失败',
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '未开启授权,保存失败',
|
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
fail: function () {
|
}
|
||||||
uni.showToast({
|
|
||||||
title: '打开设置失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
||||||
// 非授权问题的保存失败(如文件路径错误、系统问题等)
|
uni.showToast({
|
||||||
uni.showToast({
|
title: '保存失败',
|
||||||
title: '保存失败',
|
icon: 'none'
|
||||||
icon: 'none'
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
emits('confirm', code.value);
|
emits('confirm', code.value);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.info .canvas) {
|
:deep(.info .canvas) {
|
||||||
opacity: 1;
|
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;
|
|
||||||
}
|
}
|
||||||
.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 {
|
.border {
|
||||||
padding: 14rpx 76rpx;
|
border: 2rpx solid #d9d9d9;
|
||||||
border-radius: 36rpx;
|
padding: 18rpx;
|
||||||
border: 2rpx solid #e8ad7b;
|
border-radius: 4rpx;
|
||||||
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 {
|
.box {
|
||||||
line-height: 54rpx;
|
width: 638rpx;
|
||||||
}
|
background-color: #fff;
|
||||||
.w-qrcode {
|
border-radius: 16rpx;
|
||||||
position: fixed;
|
// overflow: hidden;
|
||||||
left: -9999px;
|
position: relative;
|
||||||
top: -9999px;
|
|
||||||
z-index: -1;
|
.title {
|
||||||
}
|
color: #000000;
|
||||||
</style>
|
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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="min-h-100vh bg-gray">
|
<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">
|
<view class="top">
|
||||||
<image class="top_bg" src="/distribution/static/top_bg.png" :style="imageStyle"></image>
|
<image class="top_bg" src="/distribution/static/top_bg.png" :style="imageStyle"></image>
|
||||||
<view class="box" :class="{ type1: isActivated }">
|
<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>
|
<text class="u-m-l-14 font-14 color-333 font-700">{{ state.shopName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<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>
|
<view class="font-12 color-666">上级:{{ state.parentName }}{{ state.parentPhone }}</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="!state.parentPhone">
|
<template v-else>
|
||||||
<view class="bind" @click="showBindShangji = true">绑定上级</view>
|
<view class="bind" @click="showBindShangji = true">绑定上级</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
@@ -202,8 +202,8 @@
|
|||||||
<view class="share" @click="showSharePopup = true">分享邀请</view>
|
<view class="share" @click="showSharePopup = true">分享邀请</view>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
</view>
|
</view>
|
||||||
@@ -222,22 +222,31 @@
|
|||||||
:levelConfigList="config.levelConfigList || []"></commissionPopup>
|
:levelConfigList="config.levelConfigList || []"></commissionPopup>
|
||||||
<rulePopup v-model="showRule" :config="config" :distributionUser="state.distributionUser"></rulePopup>
|
<rulePopup v-model="showRule" :config="config" :distributionUser="state.distributionUser"></rulePopup>
|
||||||
<popupDistributionGroupCode :group="state.group" v-model="showGroup"></popupDistributionGroupCode>
|
<popupDistributionGroupCode :group="state.group" v-model="showGroup"></popupDistributionGroupCode>
|
||||||
<ymf-share-popup ></ymf-share-popup>
|
<ymf-share-popup></ymf-share-popup>
|
||||||
|
<registermember v-model="memberOpen" @close="memberPopupClose" :shopUserInfo="shopUserInfo"
|
||||||
|
:shopId="options.shopId"></registermember>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import popupDistributionGroupCode from '@/components/popup-distribution-group-code.vue';
|
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 {
|
import {
|
||||||
distributionClear
|
distributionClear
|
||||||
} from '@/common/api/market';
|
} from '@/common/api/market';
|
||||||
import {
|
import {
|
||||||
shareMixin,
|
shareMixin,
|
||||||
handleMixinOnLoad,wxShare,
|
handleMixinOnLoad,
|
||||||
|
wxShare,
|
||||||
returnQuery
|
returnQuery
|
||||||
} from '@/utils/share.js';
|
} from '@/utils/share.js';
|
||||||
import bindShangji from './components/bind-shangji.vue';
|
import bindShangji from './components/bind-shangji.vue';
|
||||||
@@ -400,7 +409,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const shopUserInfo = ref();
|
const shopUserInfo = ref({shopInfo:{}});
|
||||||
const config = reactive({});
|
const config = reactive({});
|
||||||
//邀请码
|
//邀请码
|
||||||
const inviteCode = ref('');
|
const inviteCode = ref('');
|
||||||
@@ -434,8 +443,8 @@
|
|||||||
if (res.distributionId) {
|
if (res.distributionId) {
|
||||||
options.type = 'activates';
|
options.type = 'activates';
|
||||||
}
|
}
|
||||||
if(res.distributionUser&&!res.distributionUser.firstIn&&res.group&&res.group.isEnable){
|
if (res.distributionUser && !res.distributionUser.firstIn && res.group && res.group.isEnable) {
|
||||||
showGroup.value=true
|
showGroup.value = true
|
||||||
}
|
}
|
||||||
Object.assign(state, res);
|
Object.assign(state, res);
|
||||||
if (res.distributionUser) {
|
if (res.distributionUser) {
|
||||||
@@ -482,7 +491,7 @@
|
|||||||
parentPhone: '',
|
parentPhone: '',
|
||||||
parentName: '',
|
parentName: '',
|
||||||
shopName: '',
|
shopName: '',
|
||||||
group:{}
|
group: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
@@ -499,7 +508,7 @@
|
|||||||
totalPage: 0
|
totalPage: 0
|
||||||
});
|
});
|
||||||
async function getRecoders() {
|
async function getRecoders() {
|
||||||
if (state.config) return;
|
// if (state.config) return;
|
||||||
const ajaxQuery = {
|
const ajaxQuery = {
|
||||||
...query,
|
...query,
|
||||||
shopId: options.shopId
|
shopId: options.shopId
|
||||||
@@ -562,6 +571,9 @@
|
|||||||
|
|
||||||
const showInviteCode = computed(() => {
|
const showInviteCode = computed(() => {
|
||||||
if (config.upgradeType == 'invite') {
|
if (config.upgradeType == 'invite') {
|
||||||
|
if(config.openType=='pay'&&!isActivated.value){
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (config.openType == 'manual' && (!state.distributionUser || !state.distributionUser.level)) {
|
if (config.openType == 'manual' && (!state.distributionUser || !state.distributionUser.level)) {
|
||||||
@@ -576,12 +588,13 @@
|
|||||||
if (!state.distributionUser && config.openType == 'manual') {
|
if (!state.distributionUser && config.openType == 'manual') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//是否已成为分销员
|
//是否已成为分销员
|
||||||
const isActivated = computed(() => {
|
const isActivated = computed(() => {
|
||||||
return state.distributionUser && state.distributionUser.level;
|
return (state.distributionUser && state.distributionUser.level)?true:false;
|
||||||
});
|
});
|
||||||
watch(
|
watch(
|
||||||
() => activeTab.value,
|
() => activeTab.value,
|
||||||
@@ -630,6 +643,12 @@
|
|||||||
console.log(options);
|
console.log(options);
|
||||||
await init();
|
await init();
|
||||||
getRecoders();
|
getRecoders();
|
||||||
|
|
||||||
|
if (!shopUserInfo.value || (shopUserInfo.value.nickName === '微信用户' || !shopUserInfo.value
|
||||||
|
.nickName) || !shopUserInfo.value.phone) {
|
||||||
|
memberOpen.value = true
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
@@ -871,6 +890,10 @@
|
|||||||
color: #e8ad7b;
|
color: #e8ad7b;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-btn {
|
.bottom-btn {
|
||||||
@@ -919,7 +942,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.join-text{
|
|
||||||
|
.join-text {
|
||||||
color: #02bbf3;
|
color: #02bbf3;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
"pinia-plugin-unistorage": "^0.1.2",
|
"pinia-plugin-unistorage": "^0.1.2",
|
||||||
"ysk-utils": "^1.0.83"
|
"ysk-utils": "^1.0.85"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"unplugin-auto-import": "^0.16.7"
|
"unplugin-auto-import": "^0.16.7"
|
||||||
|
|||||||
@@ -258,7 +258,7 @@
|
|||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "index",
|
"path": "index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销中心",
|
"navigationBarTitleText": "全民股东",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
{
|
{
|
||||||
"path": "shop-detail/index",
|
"path": "shop-detail/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销中心",
|
"navigationBarTitleText": "全民股东",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -379,6 +379,7 @@
|
|||||||
async function onPageShow() {
|
async function onPageShow() {
|
||||||
try {
|
try {
|
||||||
await storeuser.getLocation();
|
await storeuser.getLocation();
|
||||||
|
console.log('shopId.value',shopId.value);
|
||||||
proxy.$isResolve();
|
proxy.$isResolve();
|
||||||
shopId.value = uni.cache.get('shopId');
|
shopId.value = uni.cache.get('shopId');
|
||||||
if (shopId.value) {
|
if (shopId.value) {
|
||||||
@@ -386,6 +387,7 @@
|
|||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
await proxy.$onLaunched;
|
await proxy.$onLaunched;
|
||||||
|
console.log('shopId.value',shopId.value);
|
||||||
if (shopId.value) {
|
if (shopId.value) {
|
||||||
showindex.value = 'shopIndex';
|
showindex.value = 'shopIndex';
|
||||||
await storeuser.actionsproductqueryProduct();
|
await storeuser.actionsproductqueryProduct();
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<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"
|
<up-swiper indicator indicatorMode="line" height="188rpx" :list="carouselList"
|
||||||
keyName="imageUrl">
|
keyName="imageUrl">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -2504,7 +2504,7 @@
|
|||||||
|
|
||||||
console.log('options.initMessage', options.initMessage)
|
console.log('options.initMessage', options.initMessage)
|
||||||
const newTableCode = userStore.getQueryString(res.result, 'code');
|
const newTableCode = userStore.getQueryString(res.result, 'code');
|
||||||
|
console.log('newTableCode',newTableCode);
|
||||||
const shopInfoRes = await APIproductqueryShop({
|
const shopInfoRes = await APIproductqueryShop({
|
||||||
tableCode: newTableCode
|
tableCode: newTableCode
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ const myFunList = ref([
|
|||||||
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
|
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '分销',
|
name: '全民股东',
|
||||||
type: 'fenxiao',
|
type: 'fenxiao',
|
||||||
icon: '/static/icon/fenxiao.svg'
|
icon: '/static/icon/fenxiao.svg'
|
||||||
},
|
},
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -30,8 +30,8 @@ importers:
|
|||||||
specifier: ^0.1.2
|
specifier: ^0.1.2
|
||||||
version: 0.1.2
|
version: 0.1.2
|
||||||
ysk-utils:
|
ysk-utils:
|
||||||
specifier: ^1.0.83
|
specifier: ^1.0.85
|
||||||
version: 1.0.83
|
version: 1.0.85
|
||||||
devDependencies:
|
devDependencies:
|
||||||
unplugin-auto-import:
|
unplugin-auto-import:
|
||||||
specifier: ^0.16.7
|
specifier: ^0.16.7
|
||||||
@@ -50,13 +50,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
|
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/parser@7.28.5':
|
'@babel/parser@7.28.6':
|
||||||
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
|
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
|
||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
'@babel/types@7.28.5':
|
'@babel/types@7.28.6':
|
||||||
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
|
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@dcloudio/types@3.4.21':
|
'@dcloudio/types@3.4.21':
|
||||||
@@ -357,8 +357,8 @@ packages:
|
|||||||
webpack-virtual-modules@0.6.2:
|
webpack-virtual-modules@0.6.2:
|
||||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||||
|
|
||||||
ysk-utils@1.0.83:
|
ysk-utils@1.0.85:
|
||||||
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
|
resolution: {integrity: sha512-HkbV4Jidi3G6DAuGAN972tClUYtC2zVoxo4crrxexfn0rZa8HjXatUfEbawHOeEzyl6G1CdC+160I2bKfxEBlA==}
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
@@ -368,11 +368,11 @@ snapshots:
|
|||||||
|
|
||||||
'@babel/helper-validator-identifier@7.28.5': {}
|
'@babel/helper-validator-identifier@7.28.5': {}
|
||||||
|
|
||||||
'@babel/parser@7.28.5':
|
'@babel/parser@7.28.6':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/types': 7.28.5
|
'@babel/types': 7.28.6
|
||||||
|
|
||||||
'@babel/types@7.28.5':
|
'@babel/types@7.28.6':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/helper-string-parser': 7.27.1
|
'@babel/helper-string-parser': 7.27.1
|
||||||
'@babel/helper-validator-identifier': 7.28.5
|
'@babel/helper-validator-identifier': 7.28.5
|
||||||
@@ -408,7 +408,7 @@ snapshots:
|
|||||||
|
|
||||||
'@vue/compiler-core@3.5.22':
|
'@vue/compiler-core@3.5.22':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.28.5
|
'@babel/parser': 7.28.6
|
||||||
'@vue/shared': 3.5.22
|
'@vue/shared': 3.5.22
|
||||||
entities: 4.5.0
|
entities: 4.5.0
|
||||||
estree-walker: 2.0.2
|
estree-walker: 2.0.2
|
||||||
@@ -421,7 +421,7 @@ snapshots:
|
|||||||
|
|
||||||
'@vue/compiler-sfc@3.5.22':
|
'@vue/compiler-sfc@3.5.22':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.28.5
|
'@babel/parser': 7.28.6
|
||||||
'@vue/compiler-core': 3.5.22
|
'@vue/compiler-core': 3.5.22
|
||||||
'@vue/compiler-dom': 3.5.22
|
'@vue/compiler-dom': 3.5.22
|
||||||
'@vue/compiler-ssr': 3.5.22
|
'@vue/compiler-ssr': 3.5.22
|
||||||
@@ -684,7 +684,7 @@ snapshots:
|
|||||||
|
|
||||||
webpack-virtual-modules@0.6.2: {}
|
webpack-virtual-modules@0.6.2: {}
|
||||||
|
|
||||||
ysk-utils@1.0.83:
|
ysk-utils@1.0.85:
|
||||||
dependencies:
|
dependencies:
|
||||||
bignumber.js: 9.3.1
|
bignumber.js: 9.3.1
|
||||||
loadsh: 0.0.4
|
loadsh: 0.0.4
|
||||||
|
|||||||
Reference in New Issue
Block a user