Commit 3e33dd96 by 高淑倩

modify: 我的会员条形码

parent e0b489a6
......@@ -22,14 +22,19 @@ wxService.page({
this.setData({
cardno
})
this.getCouponDetail(cardno)
// 条形码
if(cardno){
wxbarcode.barcode('barcode', cardno, 600, 180);
this.getCouponDetail(cardno)
}
},
onLoad() {
const {cardno} = this.data
// 条形码
if(cardno){
wxbarcode.barcode('barcode', cardno, 600, 180);
}
// const {cardno} = this.data
// // 条形码
// if(cardno){
// wxbarcode.barcode('barcode', cardno, 600, 180);
// }
},
canvasIdErrorCallback (e) {
console.log('code', e.detail.errMsg)
......@@ -42,12 +47,11 @@ wxService.page({
wxService.post(`/coupon/coupon/get?cardNo=${cardno}`).then(res => {
const {result,data} = res.data
if(result == 0){
wx.hideLoading()
this.setData({
codeDetail: data
},()=> {
wx.hideLoading()
})
// // 条形码
wxbarcode.barcode('barcode', cardno, 600, 180);
} else {
wx.hideLoading()
wx.showToast({
......
......@@ -49,13 +49,17 @@ wxService.page({
onShow () {
// 取会员卡号
const {memberCardNo, memberId} = wx.getStorageSync('_baseUserInfo')
this.setData({
memberCardNo,
memberId
})
this.getMemberFind()
// 条形码
wxbarcode.barcode('barcode', memberCardNo, 500, 60);
if(memberCardNo && memberId){
this.setData({
memberCardNo,
memberId
},()=>{
// 获取会员信息
this.getMemberFind()
// 条形码
wxbarcode.barcode('barcode', memberCardNo, 500, 120);
})
}
},
bindDateChange (e) {
this.setData({
......@@ -96,10 +100,10 @@ wxService.page({
cardNoOnline: this.data.memberCardNo
}
wxService.post(`/member/find`,params).then(res => {
const { result, data } = res.data
const { result, data } = res && res.data || res && res.result
if (result == 0) {
wx.hideLoading()
data.member.birthday = data.member.birthday && data.member.birthday.substring(0,10)
data.member.birthday = data.member.birthday && data.member.birthday.substring(0,10) || ''
// 性别
const {sex} = data.member
if(sex == '男'){
......
......@@ -11,9 +11,9 @@
</view>
<view class='user-id'>{{memberCardNo}}</view>
</view>
<view class='qr-code pr'>
<!-- <view class='qr-code pr'>
<image src='/assets/imgs/711_11.png' bindtap='handleGoWxCard' />
</view>
</view>-->
</view>
<view class='user-qr-code'>
<canvas canvas-id="barcode" />
......@@ -41,14 +41,19 @@
<input
class='form-input'
name="mobile"
disabled
disabled
value="{{memberInfo.mobile}}"
placeholder="请输入手机号"
/>
</view>
</view>
<picker bindchange="bindPickerChange" name="sex" value="{{index}}" range="{{array}}">
<picker
bindchange="bindPickerChange"
name="sex"
value="{{index}}"
range="{{array}}"
>
<view class="picker">
<view class='form-label'>性别</view>
<view class="right-input form-input">{{array[index]}}</view>
......@@ -97,7 +102,7 @@
name="address"
auto-height
maxlength='30'
value="{{memberInfo.address}}"
value="{{memberInfo.address}}"
/>
</view>
</view>
......
......@@ -12,6 +12,7 @@ page{
color: #FFF;
}
.user-info{
display: flex;
width: 650rpx;
height: 280rpx;
box-shadow: 0 0 40rpx 1rpx #ccc;
......@@ -40,12 +41,7 @@ page{
margin-right: 18rpx;
margin-left: 30rpx;
}
.user-name-content{
display: inline-block;
}
.user-name{
margin-bottom: 10rpx;
}
.user-id{
color: #FFF;
font-size: 24rpx;
......@@ -56,18 +52,23 @@ page{
margin-right: 31rpx;
margin-top:15rpx;
}
.user-name {
padding: 5rpx;
}
.user-qr-code{
background-color: #ffffff;
border-radius: 7rpx;
width:650rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
}
canvas {
top: 20rpx;
left: 70rpx;
height: 100% !important;
display: flex;
height: 200rpx;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.user-qr-code > canvas {
width: 500rpx;
height: 120rpx;
}
.picker, .picker-address {
......
......@@ -85,7 +85,7 @@ wxService.page({
title: '加载中'
})
wxService.post(`/coupon/coupon/memberCouponCount`).then(res => {
const { result, data } = res.data
const { result, data } = res && res.data
if (result == 0) {
wx.hideLoading()
this.setData({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment