Commit f17ca3b4 by 杨北旺

Merge branch 'v1.0.0' of 192.168.3.233:saas/mini-program/hmd into v1.0.0

2 parents 14790cab 20df6b7c
...@@ -151,4 +151,12 @@ module.exports = { ...@@ -151,4 +151,12 @@ module.exports = {
requestSubscribeMessage() { requestSubscribeMessage() {
return api.fetch('scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds') 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 \ No newline at end of file
...@@ -52,10 +52,15 @@ Component({ ...@@ -52,10 +52,15 @@ Component({
/** /**
* 禁止滑动 * 禁止滑动
*/ */
noScroll(){}, noScroll() {},
cancel(e) { cancel(e) {
let { confirm } = e.currentTarget.dataset let {
let { buttonType, title } = this.data confirm
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this let _this = this
if (buttonType == 'getUserInfo' && confirm) { if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({ wx.getUserProfile({
...@@ -73,10 +78,25 @@ Component({ ...@@ -73,10 +78,25 @@ Component({
}) })
this.triggerEvent('cancel') this.triggerEvent('cancel')
}, },
openSetting() {
let _this = this
wx.openSetting({
success() {
_this.setData({
init: true,
openSet: false
})
}
})
},
/**检验是否已授权位置 */ /**检验是否已授权位置 */
check() { check() {
const _this = this const _this = this
let { buttonType, scopeType, autoOpen } = this.properties let {
buttonType,
scopeType,
autoOpen
} = this.properties
if (buttonType != 'getPhoneNumber') { if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}` let type = `scope.${scopeType}`
buttonType = 'openSetting' buttonType = 'openSetting'
...@@ -115,15 +135,17 @@ Component({ ...@@ -115,15 +135,17 @@ Component({
} }
}, },
/**授权手机号 */ /**授权手机号 */
getPhoneNumber({ detail }) { getPhoneNumber({
detail
}) {
console.log(detail) console.log(detail)
this.triggerEvent('getphonenumber', detail) this.triggerEvent('getphonenumber', detail)
} }
}, },
pageLifetimes: { pageLifetimes: {
show: function () { show: function () {
if (this.data.isShowCheck || this.data.init) this.check() if (this.data.isShowCheck) this.check()
}, },
hide: function () {} hide: function () {}
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-style"></button> <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-style"></button>
</block> </block>
<block wx:else> <block wx:else>
<button open-type="{{buttonType}}" class="button-style" catchtap="cancel" data-confirm></button> <button class="button-style" catchtap="openSetting" ></button>
</block> </block>
</view> </view>
</view> </view>
......
<view class="layout isFullSucreen"> <view class="layout">
<block wx:for="{{addressList}}" wx:key="index"> <block wx:for="{{addressList}}" wx:key="index">
<view class="address-item" catchtap="chooseThis" data-item="{{item}}"> <view class="address-item" catchtap="chooseThis" data-item="{{item}}">
<view class="top"> <view class="top">
......
...@@ -156,9 +156,6 @@ ...@@ -156,9 +156,6 @@
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 8rpx; border-radius: 8rpx;
overflow: hidden; overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
} }
.background-X { .background-X {
background-color: rgb(244, 244, 244); background-color: rgb(244, 244, 244);
......
...@@ -180,6 +180,7 @@ page {} ...@@ -180,6 +180,7 @@ page {}
.login-item .input { .login-item .input {
flex: 1; flex: 1;
color: #fff;
} }
.placeholderClass { .placeholderClass {
...@@ -188,15 +189,17 @@ page {} ...@@ -188,15 +189,17 @@ page {}
.code-btn { .code-btn {
font-size: 24rpx; font-size: 24rpx;
color: #5092FF; color: #fff;
flex-shrink: 0; flex-shrink: 0;
margin-left: auto; margin-left: auto;
padding: 0 !important; padding: 8rpx 16rpx !important;
width: fit-content !important; width: fit-content !important;
background-color: #AA656B;
} }
.code-btn[disabled]:not([type]) { .code-btn[disabled]:not([type]) {
background-color: transparent; background-color: #8A8C90;
color: #fff;
} }
.code-btn::after { .code-btn::after {
......
...@@ -28,31 +28,41 @@ Component({ ...@@ -28,31 +28,41 @@ Component({
saveClick() { saveClick() {
const [item] = this.data.customerlist const [item] = this.data.customerlist
if (!item || !item.qrCode) return if (!item || !item.qrCode) return
wx.getSetting({ let _this = this
success(res) { wx.downloadFile({
wx.downloadFile({ url: item.qrCode,
url: item.qrCode, success: function (res) {
success: function (res) { wx.saveImageToPhotosAlbum({
wx.saveImageToPhotosAlbum({ filePath: res.tempFilePath,
filePath: res.tempFilePath, success: function (data) {
success: function (data) { wx.showToast({
wx.showToast({ title: "保存成功",
title: "保存成功", icon: "success",
icon: "success", duration: 2000
duration: 2000
});
},
fail: function (err) {
console.log(err);
},
complete(res) {
console.log(res);
}
}); });
},
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 \ No newline at end of file
...@@ -37,3 +37,5 @@ ...@@ -37,3 +37,5 @@
</view> </view>
</view> </view>
</block> </block>
<authorize scopeType="writePhotosAlbum" isShowCheck="{{false}}" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 999999; z-index: 100;
} }
.close-icon{ .close-icon{
width:48rpx; width:48rpx;
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
top: 0; top: 0;
bottom: 0; bottom: 0;
margin: auto; margin: auto;
z-index: 99999;
} }
...@@ -117,7 +116,7 @@ ...@@ -117,7 +116,7 @@
height:140rpx; height:140rpx;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
z-index: 999998; z-index: 2;
display: flex; display: flex;
background: #F9F7F7; background: #F9F7F7;
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
......
...@@ -8,11 +8,6 @@ Component({ ...@@ -8,11 +8,6 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: {}, data: {},
lifetimes: {
ready() {
this.getMerchantDetail()
}
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
...@@ -25,17 +20,17 @@ Component({ ...@@ -25,17 +20,17 @@ Component({
merchantId merchantId
}).then(data => { }).then(data => {
this.setData({ this.setData({
merchantDetail: data merchantDetail: data,
}) })
this.toCheckMember()
}) })
}, },
// 获取用户会员信息 // 获取用户会员信息
toCheckMember() { toCheckMember() {
wx.p.router.intercept(false).then(res => { wx.p.router.intercept(false).then(res => {
if (res) { if (res) {
return this.setData({ this.setData({
memberInfo: undefined memberInfo: {},
flag: true
}) })
} else { } else {
wx.p.api.equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
...@@ -59,7 +54,8 @@ Component({ ...@@ -59,7 +54,8 @@ Component({
merchantId merchantId
}).then(res => { }).then(res => {
this.setData({ this.setData({
memberInfo: res memberInfo: res,
flag: true
}) })
}) })
}, },
...@@ -71,6 +67,28 @@ Component({ ...@@ -71,6 +67,28 @@ Component({
}, },
toBuyMember() { toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open') 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 \ No newline at end of file
...@@ -5,19 +5,21 @@ ...@@ -5,19 +5,21 @@
</view> </view>
<view class="store-name">{{merchantDetail.merchantName}}</view> <view class="store-name">{{merchantDetail.merchantName}}</view>
<view class="store-phone" bindtap="callPhone"> <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> </view>
<view class="equity-box"> <block wx:if="{{flag}}">
<view class="bg"> <view class="equity-box" bindtap="jump">
<glsx-image src="home/store-bg.png"></glsx-image> <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>
<view class="content"> </block>
<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> </view>
\ No newline at end of file \ 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!