1、修改密码手机号未拿到处理
2、首页/商品列表增加了广告弹窗 3、会员充值新增赠送菜品, 4、会员菜品增加最大添加数量限制 5、首页/我的/会员卡/菜品页面的图片设置 6、小程序余额支付,会员卡充值成功后增加 会员余额变动订阅(后端还未做处理,目前可以订阅不会推送) 7、多规格商品部分规格售罄/下架增加角标提示
This commit is contained in:
@@ -57,8 +57,9 @@
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.info = e
|
||||
this.form.memberId = e.memberId
|
||||
console.log(JSON.parse(e.shopUserInfo))
|
||||
this.info = JSON.parse(e.shopUserInfo)
|
||||
this.form.memberId = this.info.id;
|
||||
this.getlist()
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -73,20 +74,19 @@
|
||||
async getlist() {
|
||||
if (this.active == 1) {
|
||||
let res = await this.api.queryMemberAccount(this.form)
|
||||
if (res.code == 0) {
|
||||
if (this.form.page == 1) {
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
this.form.page++
|
||||
this.list.push(res.data.list)
|
||||
}
|
||||
if (res.code == 0 && res.data.list.length > 0) {
|
||||
console.log(this.list.length)
|
||||
this.list = this.list.concat(res.data.list)
|
||||
this.form.page++
|
||||
console.log(this.list)
|
||||
}
|
||||
} else {
|
||||
this.list = []
|
||||
}
|
||||
},
|
||||
clickEvent(i) {
|
||||
this.active = i
|
||||
this.active = i;
|
||||
this.form.page = 1;
|
||||
this.getlist()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- 店铺详情 -->
|
||||
<u-popup :show="show" :round="20" overlayOpacity="0.8" mode="bottom" @close="showClose" height="500">
|
||||
<view class="register-member-wrap">
|
||||
<view class="register-title">欢迎加入双屿</view>
|
||||
<view class="register-title">欢迎加入{{shopUserInfo.shopName?shopUserInfo.shopName:'本店'}}</view>
|
||||
<view class="register-tip">请完善个人信息完成会员注册</view>
|
||||
<view class="register-content">
|
||||
<view class="reg-head">
|
||||
@@ -16,9 +16,9 @@
|
||||
<view class="lable">昵称<text style="color: #CD1A1A;">*</text></view>
|
||||
<u-input class="value" v-model="nickName" fontSize="14px" type="text" input-align="left" placeholder="请输入昵称" :custom-style="{border:'none'}" placeholderStyle="color:#999;font-size: 28rpx"/>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="reg-cell" @click="calendarShow = true">
|
||||
<view class="lable">生日</view>
|
||||
<view class="value" :style="{color: birthDay ? '#333' : '#999'}" @click="calendarShow = true">{{ birthDay || '请选择日期'}}</view>
|
||||
<view class="value" :style="{color: birthDay ? '#333' : '#999'}">{{ 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> -->
|
||||
@@ -28,6 +28,8 @@
|
||||
:show="calendarShow"
|
||||
:minDate="-2208988800000"
|
||||
v-model="value1"
|
||||
itemHeight="66"
|
||||
visibleItemCount="5"
|
||||
@confirm="confirmTime"
|
||||
></u-datetime-picker>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="23"></u-icon>
|
||||
@@ -41,11 +43,11 @@
|
||||
</view>
|
||||
<view class="agreement">
|
||||
<view class="agreement_tip">我已阅读并同意以下内容</view>
|
||||
<view class="agreement_item">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30"></u-checkbox>
|
||||
<view class="agreement_item" @click="isProtocol = !isProtocol">
|
||||
<u-checkbox-group >
|
||||
<u-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F" @change="radioChange" size="35" iconSize="20"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text @click="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
||||
<text @click.stop="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
||||
</view>
|
||||
<!-- <view class="agreement_item">
|
||||
<u-checkbox-group>
|
||||
@@ -62,7 +64,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['userInfo','show',"shopId"],
|
||||
props: ['show',"shopId"],
|
||||
data() {
|
||||
return {
|
||||
value1: Number(new Date()),
|
||||
@@ -73,18 +75,33 @@
|
||||
telephone: "",
|
||||
birthDay: "",
|
||||
isProtocol: false,
|
||||
shopUserInfo: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = uni.cache.get('userInfo')
|
||||
this.userId = this.userInfo.id;
|
||||
this.userHeadImg = this.userInfo.headImg;
|
||||
this.nickName = this.userInfo.nickName && this.userInfo.nickName != '微信用户' ? this.userInfo.nickName : '';
|
||||
this.telephone = this.userInfo.telephone;
|
||||
this.birthDay = this.userInfo.birthDay
|
||||
console.log(this.userInfo, '调试1113');
|
||||
console.log(13)
|
||||
this.init()
|
||||
// console.log(this.userInfo)
|
||||
// this.userId = this.userInfo.id;
|
||||
// console.log(this.userInfo, '调试1113');
|
||||
},
|
||||
|
||||
methods: {
|
||||
async init() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.shopUserInfo = res.data;
|
||||
}
|
||||
this.userHeadImg = this.shopUserInfo.headImg;
|
||||
this.nickName = this.shopUserInfo.nickName && this.shopUserInfo.nickName != '微信用户' ? this.shopUserInfo.nickName : '';
|
||||
this.telephone = this.shopUserInfo.telephone;
|
||||
this.birthDay = this.shopUserInfo.birthDay
|
||||
},
|
||||
|
||||
showClose (){
|
||||
console.log(2)
|
||||
uni.navigateBack()
|
||||
@@ -188,7 +205,35 @@
|
||||
* 注册会员
|
||||
*/
|
||||
async registerMember () {
|
||||
console.log(this.userInfo)
|
||||
console.log(this.birthDay)
|
||||
// if ( this.userHeadImg == "" || this.userHeadImg == null ) {
|
||||
// uni.showToast({
|
||||
// title: '请选择会员头像',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if ( this.nickName == "" || this.nickName == null ) {
|
||||
uni.showToast({
|
||||
title: '请输入会员昵称',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if ( this.birthDay == "" || this.birthDay == null ) {
|
||||
// uni.showToast({
|
||||
// title: '请选择日期',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if ( this.telephone == "" || this.telephone == null ) {
|
||||
uni.showToast({
|
||||
title: '请获取手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if ( !this.isProtocol ) {
|
||||
uni.showToast({
|
||||
title: '请勾选协议',
|
||||
@@ -197,7 +242,7 @@
|
||||
return;
|
||||
}
|
||||
let res = await this.api.openMember({
|
||||
id: this.userId,
|
||||
id: uni.cache.get('userInfo').id,
|
||||
shopId: this.shopId,
|
||||
nickName: this.nickName,
|
||||
headImg: this.userHeadImg,
|
||||
@@ -221,6 +266,9 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-datetime-picker {
|
||||
height: 300px !important;
|
||||
}
|
||||
.register-member-wrap{
|
||||
padding: 64rpx 24rpx;
|
||||
display: flex;
|
||||
@@ -298,11 +346,11 @@
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.agreement_item{
|
||||
display: flex;
|
||||
margin-bottom: 16rpx;
|
||||
padding-top: 32rpx;
|
||||
padding-bottom: 16rpx;
|
||||
.agreement_item_text{
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
|
||||
<view class="location" @click="openLocation">
|
||||
<image class="location_icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/location.png" mode="aspectFill"></image>
|
||||
<view>{{ userInfo.shopName }}</view>
|
||||
<view>{{ shopUserInfo.shopName }}</view>
|
||||
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
|
||||
</view>
|
||||
|
||||
<view class="card_info flex-colum">
|
||||
<view class="title">账户余额(元)</view>
|
||||
<view class="card_info_con flex-between">
|
||||
<view class="balance">{{userInfo.amount || '0.00'}}</view>
|
||||
<view class="balance">{{shopUserInfo.amount || '0.00'}}</view>
|
||||
<view class="card_info_con_right flex-end">
|
||||
<view class="card_info_con_right_item flex-colum" @click="handleClick(item)" v-for="(item,index) in cardManageList" :key="index">
|
||||
<view class ="card_info_con_right_item flex-colum" @click="handleClick(item)" v-for="(item,index) in cardManageList" :key="index">
|
||||
<image class="card_info_con_right_item_icon" :src="item.icon" mode="aspectFill"></image>
|
||||
<text class="card_info_con_right_item_text">{{item.name}}</text>
|
||||
</view>
|
||||
@@ -20,9 +20,19 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="therecontent">
|
||||
<input type="number" v-model="amount" placeholder="自定义金额">
|
||||
</view> -->
|
||||
<view class="customAmount" v-if="shopUserInfo.isUser == 1">
|
||||
<view class="customAmount_left">
|
||||
<text class="customAmount_left_tip">¥</text>
|
||||
<u-input
|
||||
type="number"
|
||||
v-model="amount"
|
||||
inputAlign="left"
|
||||
:placeholder="`充${minNum}送${handselNum}`"
|
||||
:customStyle="{border: '0'}"
|
||||
></u-input>
|
||||
</view>
|
||||
<text class="customAmount_right">自定义金额</text>
|
||||
</view>
|
||||
<view class="rechargeList">
|
||||
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
||||
<viwe class="rechargeList_item flex-colum " :class="index == inputshow?'active':''">
|
||||
@@ -57,7 +67,7 @@
|
||||
<view class="explain">
|
||||
<view class="explain-top flex-between">
|
||||
<text class="explain-top_title">适用门店</text>
|
||||
<text class="shopName">{{ userInfo.shopName }}</text>
|
||||
<text class="shopName">{{ shopUserInfo.shopName }}</text>
|
||||
</view>
|
||||
<view class="explain_content">
|
||||
<text class="explain_content_title">充值说明</text>
|
||||
@@ -68,20 +78,19 @@
|
||||
</view>
|
||||
|
||||
<view class="rechargeBox">
|
||||
<view class="agreement">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30">
|
||||
<view style="width: 100rpx;height: 100rpx;"></view>
|
||||
<view class="agreement" @click="isProtocol = !isProtocol">
|
||||
<u-checkbox-group >
|
||||
<u-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F" @change="radioChange" size="35" iconSize="20">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text>已同意</text>
|
||||
<text class="agreement_text" @click="viewProtocol">《用户隐私协议》</text>
|
||||
<text class="agreement_text" @click.stop="viewProtocol">《用户隐私协议》</text>
|
||||
<!-- <text class="agreement_text" @click="viewProtocol">《用户储值协议》</text> -->
|
||||
<!-- <text class="agreement_text" @click="viewProtocol">《用户授权协议》</text> -->
|
||||
</view>
|
||||
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
|
||||
</view>
|
||||
<registermember :show="memberOpen" :shopId="shopId" :userInfo="userInfo" @getRegisterMember="getRegisterMember"></registermember>
|
||||
<registermember :show="memberOpen" :shopUserInfo="shopUserInfo" :shopId="shopId" @getRegisterMember="getRegisterMember"></registermember>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
@@ -98,8 +107,11 @@
|
||||
memberOpen: false,
|
||||
isProtocol: false,
|
||||
listdata: [],
|
||||
amount: '',
|
||||
amount: 0,
|
||||
minNum: 0,
|
||||
handselNum: 0,
|
||||
userInfo: {},
|
||||
shopUserInfo: null,
|
||||
shopId: '',
|
||||
giftList: [],
|
||||
cardManageList: [
|
||||
@@ -110,7 +122,6 @@
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
console.log(e)
|
||||
// if ( e.type == 'list' || e.type == 'index') {
|
||||
// this.shopId = e.shopId;
|
||||
// this.init();
|
||||
@@ -122,10 +133,12 @@
|
||||
// if (!uni.cache.get('token')) {
|
||||
// await this.$onLaunched;
|
||||
// }
|
||||
this.init();
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
} else{
|
||||
this.shopId = e.shopId;
|
||||
this.init();
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
}
|
||||
console.log(this.shopId)
|
||||
},
|
||||
@@ -133,20 +146,20 @@
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
async init() {
|
||||
async shopInfo() {
|
||||
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.usershopUserinfo = res.data
|
||||
this.shopUserInfo = res.data
|
||||
}
|
||||
if ( this.usershopUserinfo.isVip == 0 ) {
|
||||
|
||||
if ( this.shopUserInfo.isVip == 0 ) {
|
||||
this.memberOpen = true;
|
||||
return;
|
||||
}
|
||||
this.paygetShopByMember(this.shopId)
|
||||
this.paygetActive()
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -161,8 +174,10 @@
|
||||
|
||||
try {
|
||||
this.listdata = res.data.list;
|
||||
this.giftList = this.listdata[0].giftList;
|
||||
this.amount = res.data.list[0].minNum
|
||||
this.giftList = this.listdata[0].gives;
|
||||
this.amount = this.listdata[0].minNum;
|
||||
this.minNum = this.listdata[0].minNum;
|
||||
this.handselNum = this.listdata[0].handselNum
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
@@ -173,7 +188,9 @@
|
||||
* @param {Object} e
|
||||
*/
|
||||
handleClick (item) {
|
||||
uni.pro.navigateTo(item.url, this.userInfo)
|
||||
uni.navigateTo({
|
||||
url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(this.shopUserInfo)}`
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -202,7 +219,7 @@
|
||||
*/
|
||||
getRegisterMember (e) {
|
||||
this.memberOpen = e;
|
||||
this.paygetShopByMember()
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
},
|
||||
|
||||
@@ -212,11 +229,11 @@
|
||||
openLocation () {
|
||||
console.log('123');
|
||||
uni.openLocation({
|
||||
latitude: Number(this.usershopUserinfo.lat), // 目的地的纬度,浮点数,范围为-90~90
|
||||
longitude: Number(this.usershopUserinfo.lng), // 目的地的经度,浮点数,范围为-180~180
|
||||
latitude: Number(this.shopUserInfo.lat), // 目的地的纬度,浮点数,范围为-90~90
|
||||
longitude: Number(this.shopUserInfo.lng), // 目的地的经度,浮点数,范围为-180~180
|
||||
scale: 18, // 缩放比例,范围5~18
|
||||
name: this.usershopUserinfo.shopName, // 位置名
|
||||
address: this.usershopUserinfo.address, // 地址的详细说明
|
||||
name: this.shopUserInfo.shopName, // 位置名
|
||||
address: this.shopUserInfo.address, // 地址的详细说明
|
||||
success() {
|
||||
console.log('导航启动成功');
|
||||
|
||||
@@ -248,22 +265,6 @@
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取门店会员信息
|
||||
* @param {Object} w
|
||||
*/
|
||||
async paygetShopByMember(w) {
|
||||
let res = await this.api.paygetShopByMember({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
shopId: this.shopId
|
||||
})
|
||||
this.userInfo = res.data.list[0]
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 充值金额切换
|
||||
* @param {Object} a
|
||||
@@ -272,14 +273,17 @@
|
||||
clickinput(a, b) {
|
||||
console.log(a, b)
|
||||
this.inputshow = b;
|
||||
this.giftList = a.gives;
|
||||
this.amount = a.minNum;
|
||||
this.giftList = a.giftList;
|
||||
this.minNum = a.minNum;
|
||||
this.handselNum = a.handselNum;
|
||||
},
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
async userbalancerechangesub() {
|
||||
let _this = this;
|
||||
if (!this.isProtocol) {
|
||||
uni.showToast({
|
||||
title: '请勾选协议',
|
||||
@@ -325,15 +329,22 @@
|
||||
})
|
||||
uni.hideLoading()
|
||||
let pages = getCurrentPages()
|
||||
if ( pages.length > 1) {
|
||||
this.paygetShopByMember()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||
complete() {
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
@@ -356,7 +367,7 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 16rpx 20rpx 0 20rpx;
|
||||
padding: 16rpx 20rpx 245rpx 20rpx;
|
||||
|
||||
.location{
|
||||
display: flex;
|
||||
@@ -413,6 +424,39 @@
|
||||
}
|
||||
}
|
||||
|
||||
.customAmount{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 14rpx 16rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
.customAmount_left{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.customAmount_left_tip{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
input{
|
||||
width: 100%;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
}
|
||||
.customAmount_right{
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.rechargeList{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@@ -533,6 +577,7 @@
|
||||
border-radius: 50%;
|
||||
background-color: #F7853D;
|
||||
margin-right: 8rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.text{
|
||||
font-weight: 400;
|
||||
@@ -549,6 +594,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 22rpx 24rpx;
|
||||
margin-bottom: 30rpx;
|
||||
.explain-top{
|
||||
// align-items: center;
|
||||
margin-bottom: 18rpx;
|
||||
@@ -583,7 +629,7 @@
|
||||
|
||||
.rechargeBox{
|
||||
width: 100%;
|
||||
padding: 16rpx 28rpx 84rpx 28rpx;
|
||||
padding: 0 28rpx 84rpx 28rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
@@ -592,7 +638,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 20rpx;
|
||||
padding-top: 16rpx;
|
||||
padding-bottom: 20rpx;
|
||||
text{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
@@ -3,28 +3,29 @@
|
||||
<view class="content">
|
||||
<!-- <card :userInfo="userInfo"></card> -->
|
||||
<view class="card_info">
|
||||
<image class="card_info_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_bg.png" mode="aspectFill"></image>
|
||||
<image class="card_info_bg" :src="shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_bg.png'" mode="aspectFill"></image>
|
||||
<view class="card_info_bg_box"></view>
|
||||
<view class="card_content">
|
||||
<view class="card_head">
|
||||
<view class="card_head_left">
|
||||
<image class="card_head_left_head" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_head.png" mode="aspectFill"></image>
|
||||
<text class="card_head_left_name">{{userInfo.shopName}}会员卡</text>
|
||||
<view class="card_head_left_icon_box" v-if="userInfo.isVip != 0">
|
||||
<text class="card_head_left_name">{{shopUserInfo.shopName}}会员卡</text>
|
||||
<view class="card_head_left_icon_box" v-if="shopUserInfo.isVip != 0">
|
||||
<image class="card_head_left_icon1" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_icon1.png" mode="aspectFill"></image>
|
||||
<text class="card_head_left_iconText">VL1</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card_head_right" @click="clickEvent" v-if="userInfo.isVip != 0">
|
||||
<view class="card_head_right" @click="clickEvent" v-if="shopUserInfo.isVip != 0">
|
||||
<image class="card_head_left_qrCode" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_qrCode.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card_cen">
|
||||
<view class="card_cen_left">{{ userInfo.isVip == 0 ? '尚未开通会员暂无法享受会员权益' : '欢迎加入本店会员~'}}</view>
|
||||
<view class="card_cen_right" v-if="userInfo.isVip != 0">查看特权</view>
|
||||
<view class="card_cen_left">{{ shopUserInfo.isVip == 0 ? '尚未开通会员暂无法享受会员权益' : '欢迎加入本店会员~'}}</view>
|
||||
<view class="card_cen_right" v-if="shopUserInfo.isVip != 0">查看特权</view>
|
||||
</view>
|
||||
<view class="card_bom" v-if="userInfo.isVip != 0">
|
||||
<view class="card_bom" v-if="shopUserInfo.isVip != 0">
|
||||
<view class="card_bom_item" @click="itemClick(1)">
|
||||
<text>{{userInfo.amount || '0.00'}}</text><text>储值</text>
|
||||
<text>{{shopUserInfo.amount || '0.00'}}</text><text>储值</text>
|
||||
</view>
|
||||
<view class="card_bom_item">
|
||||
<text>0</text><text>积分</text>
|
||||
@@ -40,8 +41,8 @@
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card_bottom" :class="userInfo.isVip == 0 ? 'n' : ''">
|
||||
<view class="card_bottom_Box" v-if="userInfo.isVip != 0">
|
||||
<view class="card_bottom" :class="shopUserInfo.isVip == 0 ? 'n' : ''">
|
||||
<view class="card_bottom_Box" v-if="shopUserInfo.isVip != 0">
|
||||
<view class="card_bottom_left flex-start">
|
||||
<image class="card_bottom_head" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_head2.png" mode="aspectFill"></image>
|
||||
<view class="">
|
||||
@@ -72,7 +73,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<registermember :show="memberOpen" :shopId="shopId_id" :userInfo="userInfo" @getRegisterMember="getRegisterMember"></registermember>
|
||||
<registermember :show="memberOpen" :shopUserInfo="shopUserInfo" :shopId="shopId_id" @getRegisterMember="getRegisterMember"></registermember>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -88,13 +89,13 @@
|
||||
shopId_id: null,
|
||||
memberOpen: false,
|
||||
amount: '',
|
||||
userInfo: {},
|
||||
shopUserInfo: null,
|
||||
lucky: {
|
||||
list: ['鸿运当头',"财运亨通","时来运转","否极泰来","花逢时发"],
|
||||
index: 0,
|
||||
text: ""
|
||||
},
|
||||
usershopUserinfo:{},
|
||||
shopExtend: null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
@@ -102,30 +103,42 @@
|
||||
},
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
this.getShopExtend();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取店铺信息
|
||||
*/
|
||||
async init() {
|
||||
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": this.shopId_id,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.userInfo = res.data
|
||||
this.shopUserInfo = res.data
|
||||
uni.cache.set('shopUserInfo',res.data)
|
||||
}
|
||||
if ( this.userInfo.isVip == 0 ) {
|
||||
if ( this.shopUserInfo.isVip == 0 ) {
|
||||
this.memberOpen = true;
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取背景图
|
||||
*/
|
||||
async getShopExtend () {
|
||||
let res = await this.api.getShopExtend({
|
||||
shopId: this.shopId_id,
|
||||
autokey: "member_bg" //index_bg my_bg member_bg shopInfo_bg
|
||||
})
|
||||
if ( res.code == 0) {
|
||||
this.shopExtend = res.data;
|
||||
}
|
||||
},
|
||||
itemClick ( type ) {
|
||||
if ( type == 1) {
|
||||
uni.pro.navigateTo('member/index', {
|
||||
shopId: this.userInfo.shopId,
|
||||
shopId: this.shopUserInfo.shopId,
|
||||
type: 'index',
|
||||
})
|
||||
} else if ( type == 3 ) {
|
||||
@@ -144,7 +157,7 @@
|
||||
|
||||
clickEvent() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.userInfo)
|
||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.shopUserInfo)
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -166,12 +179,21 @@
|
||||
margin: auto;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
padding-top: 20rpx;
|
||||
.card_info_bg{
|
||||
width: 630rpx;
|
||||
height: 304rpx;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
.card_info_bg_box{
|
||||
width: 630rpx;
|
||||
height: 304rpx;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
border-radius: 24rpx;
|
||||
background-color: rgba(51,51,51,0.5);
|
||||
}
|
||||
.card_content{
|
||||
position: relative;
|
||||
left: 0;
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
<view class="box_item flex-between">
|
||||
<text class="top_box_one_text">当前账号</text>
|
||||
<input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11" disabled="disabled" />
|
||||
<button v-if="!mobile" class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
<view class="text">获取微信手机号</view>
|
||||
</button>
|
||||
|
||||
</view>
|
||||
<view class="box_item flex-between" style="position:relative;">
|
||||
<text class="top_box_one_text"></text>
|
||||
@@ -36,10 +40,10 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPwd: uni.cache.get('userInfo').isPwd,
|
||||
mobile: uni.cache.get('userInfo').telephone.slice(0, 3)+'****'+uni.cache.get('userInfo').telephone.slice(7),
|
||||
isPwd: "",
|
||||
mobile: "",
|
||||
form: {
|
||||
mobile: uni.cache.get('userInfo').telephone,
|
||||
mobile: '',
|
||||
password: '',
|
||||
payPassword: '',
|
||||
checkCode: ''
|
||||
@@ -49,16 +53,20 @@
|
||||
// 注册定时器 初始值
|
||||
second: 60,
|
||||
showText: true,
|
||||
Recapture: '获取验证码'
|
||||
Recapture: '获取验证码',
|
||||
shopUserInfo: null,
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
// if ( e.shopUserInfo ) {
|
||||
// this.shopUserInfo = JSON.parse(e.shopUserInfo);
|
||||
// this.isPwd = this.shopUserInfo.isPwd;
|
||||
// this.mobile = this.shopUserInfo.telephone.slice(0, 3)+'****'+this.shopUserInfo.telephone.slice(7);
|
||||
// this.form.mobile = this.shopUserInfo.telephone;
|
||||
// }
|
||||
console.log(e)
|
||||
if ( e.shopUserInfo ) {
|
||||
this.shopUserInfo = JSON.parse(e.shopUserInfo);
|
||||
console.log(this.shopUserInfo)
|
||||
this.isPwd = this.shopUserInfo.isPwd;
|
||||
this.mobile = this.shopUserInfo.telephone ? ( this.shopUserInfo.telephone.slice(0, 3)+'****'+this.shopUserInfo.telephone.slice(7) ) : '';
|
||||
this.form.mobile = this.shopUserInfo.telephone;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
@@ -86,6 +94,33 @@
|
||||
}, 60000);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取手机号
|
||||
* @param {Object} d
|
||||
*/
|
||||
async getPhone(d) {
|
||||
if (d.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
})
|
||||
this.form.mobile = res.data;
|
||||
this.mobile = this.form.mobile ? ( this.form.mobile.slice(0, 3)+'****'+this.form.mobile.slice(7) ) : '';
|
||||
|
||||
|
||||
let res2 = await this.api.upVipPhont({
|
||||
id: this.shopUserInfo.id,
|
||||
telephone: res.data,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async loginwxuserInfo() {
|
||||
let res = await this.api.loginwxuserInfo({
|
||||
userId: uni.cache.get('userInfo').id
|
||||
@@ -139,6 +174,7 @@
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.loginresetPwd({
|
||||
vipId: this.shopUserInfo.id,
|
||||
pwd: this.form.password,
|
||||
code: this.form.checkCode
|
||||
})
|
||||
@@ -189,6 +225,7 @@
|
||||
|
||||
.box_item {
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
position: relative;
|
||||
.top_box_one_text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
@@ -256,5 +293,16 @@
|
||||
background-color: #E3AD7F;
|
||||
}
|
||||
}
|
||||
.getPhone{
|
||||
line-height: initial;
|
||||
background-color: none;
|
||||
border: 2rpx solid #E3AD7F;
|
||||
color: #E3AD7F;
|
||||
font-size: 28rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: null,
|
||||
shopUserInfo: null,
|
||||
list: [
|
||||
{name: "余额明细", url: "member/billDetails"},
|
||||
{name: "密码设置", url: "member/setPassword"},
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.userInfo = e
|
||||
this.shopUserInfo = JSON.parse(e.shopUserInfo)
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -30,7 +30,9 @@
|
||||
* 跳转
|
||||
*/
|
||||
handleClick ( item ) {
|
||||
uni.pro.navigateTo(item.url, this.userInfo)
|
||||
uni.navigateTo({
|
||||
url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(this.shopUserInfo)}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user