Commit 167041f8 by 李伟康

修复BUG

1 parent 83964cbe
......@@ -151,4 +151,12 @@ module.exports = {
requestSubscribeMessage() {
return api.fetch('scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds')
},
/** 确认收货 */
confirmReceipt(orderCode) {
return api.post({
method: `scrm.api.shopmall.weapp.order.confirmReceipt`,
orderCode
})
},
}
\ No newline at end of file
......@@ -52,10 +52,15 @@ Component({
/**
* 禁止滑动
*/
noScroll(){},
noScroll() {},
cancel(e) {
let { confirm } = e.currentTarget.dataset
let { buttonType, title } = this.data
let {
confirm
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this
if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({
......@@ -73,10 +78,25 @@ Component({
})
this.triggerEvent('cancel')
},
openSetting() {
let _this = this
wx.openSetting({
success() {
_this.setData({
init: true,
openSet: false
})
}
})
},
/**检验是否已授权位置 */
check() {
const _this = this
let { buttonType, scopeType, autoOpen } = this.properties
let {
buttonType,
scopeType,
autoOpen
} = this.properties
if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}`
buttonType = 'openSetting'
......@@ -115,15 +135,17 @@ Component({
}
},
/**授权手机号 */
getPhoneNumber({ detail }) {
getPhoneNumber({
detail
}) {
console.log(detail)
this.triggerEvent('getphonenumber', detail)
}
},
pageLifetimes: {
show: function () {
if (this.data.isShowCheck || this.data.init) this.check()
if (this.data.isShowCheck) this.check()
},
hide: function () {}
}
})
})
\ No newline at end of file
......@@ -9,7 +9,7 @@
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-style"></button>
</block>
<block wx:else>
<button open-type="{{buttonType}}" class="button-style" catchtap="cancel" data-confirm></button>
<button class="button-style" catchtap="openSetting" ></button>
</block>
</view>
</view>
......
......@@ -180,6 +180,7 @@ page {}
.login-item .input {
flex: 1;
color: #fff;
}
.placeholderClass {
......@@ -188,15 +189,17 @@ page {}
.code-btn {
font-size: 24rpx;
color: #5092FF;
color: #fff;
flex-shrink: 0;
margin-left: auto;
padding: 0 !important;
padding: 8rpx 16rpx !important;
width: fit-content !important;
background-color: #AA656B;
}
.code-btn[disabled]:not([type]) {
background-color: transparent;
background-color: #8A8C90;
color: #fff;
}
.code-btn::after {
......
......@@ -28,31 +28,41 @@ Component({
saveClick() {
const [item] = this.data.customerlist
if (!item || !item.qrCode) return
wx.getSetting({
success(res) {
wx.downloadFile({
url: item.qrCode,
success: function (res) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (data) {
wx.showToast({
title: "保存成功",
icon: "success",
duration: 2000
});
},
fail: function (err) {
console.log(err);
},
complete(res) {
console.log(res);
}
let _this = this
wx.downloadFile({
url: item.qrCode,
success: function (res) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (data) {
wx.showToast({
title: "保存成功",
icon: "success",
duration: 2000
});
},
fail: function (err) {
console.log(err);
if(err.errMsg.includes('deny')) _this.setData({
showAuth:true
})
},
complete(res) {
console.log(res);
}
});
}
});
}
},
/**授权失败 */
authFail() {
this.setData({
unauthorized: true
})
},
/**授权成功 */
authSuccess() {
this.saveClick()
},
}
})
\ No newline at end of file
......@@ -37,3 +37,5 @@
</view>
</view>
</block>
<authorize scopeType="writePhotosAlbum" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
......@@ -7,7 +7,7 @@
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
z-index: 100;
}
.close-icon{
width:48rpx;
......@@ -29,7 +29,6 @@
top: 0;
bottom: 0;
margin: auto;
z-index: 99999;
}
......@@ -117,7 +116,7 @@
height:140rpx;
position: absolute;
bottom: 0;
z-index: 999998;
z-index: 2;
display: flex;
background: #F9F7F7;
border-radius: 0 0 10px 10px;
......
......@@ -8,11 +8,6 @@ Component({
* 组件的初始数据
*/
data: {},
lifetimes: {
ready() {
this.getMerchantDetail()
}
},
/**
* 组件的方法列表
*/
......@@ -25,17 +20,17 @@ Component({
merchantId
}).then(data => {
this.setData({
merchantDetail: data
merchantDetail: data,
})
this.toCheckMember()
})
},
// 获取用户会员信息
toCheckMember() {
wx.p.router.intercept(false).then(res => {
if (res) {
return this.setData({
memberInfo: undefined
this.setData({
memberInfo: {},
flag: true
})
} else {
wx.p.api.equityApi.checkOpenMember().then(res => {
......@@ -59,7 +54,8 @@ Component({
merchantId
}).then(res => {
this.setData({
memberInfo: res
memberInfo: res,
flag: true
})
})
},
......@@ -71,6 +67,28 @@ Component({
},
toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open')
},
jump() {
const {
memberInfo
} = this.data
if (memberInfo.equityName) wx.p.router.switchTab('/pages/tab/equity/index')
}
}
},
lifetimes: {
ready() {
this.getMerchantDetail()
this.toCheckMember()
}
},
pageLifetimes: {
show() {
this.toCheckMember()
},
hide() {
if (!this.data.memberInfo) this.setData({
flag: false
})
}
},
})
\ No newline at end of file
......@@ -5,19 +5,21 @@
</view>
<view class="store-name">{{merchantDetail.merchantName}}</view>
<view class="store-phone" bindtap="callPhone">
<glsx-image src="home/store-phone.png" ></glsx-image>
<glsx-image src="home/store-phone.png"></glsx-image>
</view>
</view>
<view class="equity-box">
<view class="bg">
<glsx-image src="home/store-bg.png"></glsx-image>
<block wx:if="{{flag}}">
<view class="equity-box" bindtap="jump">
<view class="bg">
<glsx-image src="home/store-bg.png"></glsx-image>
</view>
<view class="content">
<glsx-image class="equity-icon" src="home/vip-icon.png"></glsx-image>
<text class="text">生活权益|专享超百种生活权益</text>
<block wx:if="{{!memberInfo.equityName}}">
<view class="content-view equity-btn" bindtap="toBuyMember">立即开通</view>
</block>
</view>
</view>
<view class="content">
<glsx-image class="equity-icon" src="home/vip-icon.png"></glsx-image>
<text class="text">生活权益|专享超百种生活权益</text>
<block wx:if="{{!memberInfo.equityName}}">
<view class="content-view equity-btn" bindtap="toBuyMember">立即开通</view>
</block>
</view>
</view>
</block>
</view>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!