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() {
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 == '') {
uni.showToast({
title: '请选择支付方式',

@ -299,7 +299,6 @@
},
onLoad() {
let that = this;
// that.openMsg();
// 1.wxcode
// #ifdef MP
uni.login({
@ -345,37 +344,6 @@
},
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() {
let params = {

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

Loading…
Cancel
Save