1.订阅消息

yj-dev
杨杰 3 years ago
parent 4e8fd74453
commit 52871e23f6
  1. 14
      pages/goods/refuel-confirm/refuel-confirm.vue
  2. 32
      pages/tabBar/home/home.vue
  3. 18
      pages/userLogin/userLogin.vue

@ -219,20 +219,6 @@
// //
orderToPay() { orderToPay() {
let that = this; let that = this;
uni.requestSubscribeMessage({
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
success (res) {
},
fail:(res) => {
// console.log(res)
// uni.showToast({
// title: '',
// duration:2000,
// icon:'none'
// })
}
})
if (that.paytype == '') { if (that.paytype == '') {
uni.showToast({ uni.showToast({
title: '请选择支付方式', title: '请选择支付方式',

@ -299,7 +299,6 @@
}, },
onLoad() { onLoad() {
let that = this; let that = this;
// that.openMsg();
// 1.wxcode // 1.wxcode
// #ifdef MP // #ifdef MP
uni.login({ uni.login({
@ -345,37 +344,6 @@
}, },
methods: { methods: {
//
openMsg() {
uni.requestSubscribeMessage({
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
success (res) {
console.log(res)
},
fail:(res) => {
console.log(res)
}
})
// var that = this
// //
// wx.getSetting({
// withSubscriptions:true, //false
// success(res) {
// if(res.authSetting['scope.subscribeMessage'] || res.authSetting['scope.subscribeMessage'] == undefined) { //
// uni.openSetting({ //
// success(res) {
// console.log(res.authSetting)
// },
// fail(err) {
// console.log(err)
// }
// });
// }else { //
// }
// }
// })
},
// //
getCmsContent() { getCmsContent() {
let params = { let params = {

@ -6,6 +6,8 @@
授权并登录</view> 授权并登录</view>
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user.phone && user" <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user.phone && user"
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button> open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button>
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user"
@click="reqmessage">授权获取消息通知</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5 --> <!-- #ifdef H5 -->
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16"
@ -55,9 +57,7 @@
key: "token", key: "token",
data: res.return_data.uniqueCode data: res.return_data.uniqueCode
}) })
if (res.return_data.object.highUser.phone) { if (res.return_data.object.highUser.phone) {}
uni.navigateBack({})
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.return_msg title: res.return_msg
@ -74,6 +74,18 @@
}) })
that.isShowAuth = false that.isShowAuth = false
}, },
//
reqmessage() {
uni.requestSubscribeMessage({
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
success(res) {
uni.navigateBack({})
},
fail: (res) => {
uni.navigateBack({})
}
})
},
// //
getPhoneNumber(PhoneNumber) { getPhoneNumber(PhoneNumber) {
let params = { let params = {

Loading…
Cancel
Save