更改扫码api、添加邮箱绑定功能
diff --git a/pages/sub_tabbar/index.vue b/pages/sub_tabbar/index.vue
index a2f261e..0851a76 100644
--- a/pages/sub_tabbar/index.vue
+++ b/pages/sub_tabbar/index.vue
@@ -14,7 +14,7 @@
<view class="img-box" @click="toPath('/pages/sub_index/qrcode/index')">
<u-image src="/static/images/index/money.png" width="40rpx" height="40rpx" mode="aspectFit"></u-image>
</view>
- <view class="img-box" @click="toPath('')">
+ <view class="img-box" @click="toPath('/pages/sub_medical/appointment')">
<u-image src="/static/images/index/square.png" width="40rpx" height="40rpx" mode="aspectFit"></u-image>
</view>
</view>
@@ -141,8 +141,7 @@
}, ]
}
},
- onShow() {
- },
+ onShow() {},
methods: {
search(e) {
uni.showToast({
@@ -153,12 +152,19 @@
},
scan() {
+ // #ifdef APP-PLUS
let that = this
- // #ifndef H5
- // 只允许通过相机扫码
- uni.scanCode({
- success: function(res) {
- let url = res.result
+ var ali = uni.requireNativePlugin("Mpaas-Scan-Module")
+ ali.mpaasScan({
+ // 扫码 UI 风格,参数可为 qr、bar,默认为 qr
+ 'type': 'qr',
+ // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
+ 'scanType': ['qrCode'],
+ // 是否隐藏相册,默认false不隐藏
+ 'hideAlbum': false
+ },
+ (ret) => {
+ let url = ret.resp_result
uni.showToast({
title: "扫描成功",
icon: "none",
@@ -167,35 +173,59 @@
let param = {
url: url
}
+ //console.log(param.url)
that.$u.get('/v1/qrcode/auth', param).then(ret => {
//console.log(ret.data.url)
if (ret.data.permit) {
if (ret.data.action == 'water') {
- setTimeout(() => {
- uni.navigateTo({
- url: "/pages/sub_index/scanView/index?url=" + ret.data.url
- })
- }, 1500)
- } else if (ret.data.action == 'dlsmkh5') {
- // #ifdef APP-PLUS
- let token = uni.getStorageSync('token')
- let wv = plus.webview.create(ret.data.url, 'webview_pay', {
- backButtonAutoControl:'close',
- additionalHttpHeaders: {
- Authorization: 'Bearer ' + token
- }
- })
- setTimeout(() => {
- wv.show()
- }, 1500)
- // #endif
- // #ifndef APP-PLUS
- uni.showToast({
- icon: "none",
- title: "只支持app端",
- duration: 1500
+ // setTimeout(() => {
+ // uni.navigateTo({
+ // url: "/pages/sub_index/scanView/index?url=" + ret.data.url
+ // })
+ // }, 1500)
+ let userid = uni.getStorageSync("userid")
+ let url = ret.data.url
+ if (url.indexOf("?") > 0) {
+ url = url + "&userid=" + userid
+ } else {
+ url = url + "?userid=" + userid
+ }
+ let wv = plus.webview.create(url, 'webview_water', {
+ backButtonAutoControl: 'close',
+ popGesture: 'close'
})
- // #endif
+ setTimeout(() => {
+ wv.show()
+ }, 1500)
+ wv.drag({
+ direction: 'right',
+ moveMode: 'followFinger'
+ }, {
+ view: 'webview_water',
+ moveMode: 'follow'
+ }, function(e) {
+ wv.close()
+ });
+ wv.drag({
+ direction: 'left',
+ moveMode: 'followFinger'
+ }, {
+ view: 'webview_water',
+ moveMode: 'follow'
+ }, function(e) {
+ wv.close()
+ });
+ } else if (ret.data.action == 'dlsmkh5') {
+ let token = uni.getStorageSync('token')
+ let wv = plus.webview.create(ret.data.url, 'webview_pay', {
+ backButtonAutoControl: 'close',
+ additionalHttpHeaders: {
+ Authorization: 'Bearer ' + token
+ }
+ })
+ setTimeout(() => {
+ wv.show()
+ }, 1500)
}
} else {
uni.showToast({
@@ -207,17 +237,79 @@
})
}
})
- }
- });
+ })
// #endif
- // #ifdef H5
- uni.showToast({
- icon: "none",
- title: "H5不支持此功能",
- duration: 1500
- })
- // #endif
+
},
+
+ // scan() {
+ // let that = this
+ // // #ifndef H5
+ // // 只允许通过相机扫码
+ // uni.scanCode({
+ // success: function(res) {
+ // let url = res.result
+ // console.log(url)
+ // uni.showToast({
+ // title: "扫描成功",
+ // icon: "none",
+ // duration: 800,
+ // complete() {
+ // let param = {
+ // url: url
+ // }
+ // console.log(param.url)
+ // that.$u.get('/v1/qrcode/auth', param).then(ret => {
+ // console.log(ret.data.url)
+ // if (ret.data.permit) {
+ // if (ret.data.action == 'water') {
+ // setTimeout(() => {
+ // uni.navigateTo({
+ // url: "/pages/sub_index/scanView/index?url=" + ret.data.url
+ // })
+ // }, 1500)
+ // } else if (ret.data.action == 'dlsmkh5') {
+ // // #ifdef APP-PLUS
+ // let token = uni.getStorageSync('token')
+ // let wv = plus.webview.create(ret.data.url, 'webview_pay', {
+ // backButtonAutoControl:'close',
+ // additionalHttpHeaders: {
+ // Authorization: 'Bearer ' + token
+ // }
+ // })
+ // setTimeout(() => {
+ // wv.show()
+ // }, 1500)
+ // // #endif
+ // // #ifndef APP-PLUS
+ // uni.showToast({
+ // icon: "none",
+ // title: "只支持app端",
+ // duration: 1500
+ // })
+ // // #endif
+ // }
+ // } else {
+ // uni.showToast({
+ // icon: "none",
+ // title: "暂不支持此二维码",
+ // duration: 1500
+ // })
+ // }
+ // })
+ // }
+ // })
+ // }
+ // });
+ // // #endif
+ // // #ifdef H5
+ // uni.showToast({
+ // icon: "none",
+ // title: "H5不支持此功能",
+ // duration: 1500
+ // })
+ // // #endif
+ // },
getActivityList() {
let that = this
let param = [{
@@ -276,7 +368,7 @@
// #endif
},
- async onPullDownRefresh(){
+ async onPullDownRefresh() {
await this.getActivityList()
uni.stopPullDownRefresh()
}