This commit is contained in:
曹辉 2023-03-16 10:40:15 +08:00
parent f39395a161
commit fd2926b75d
3 changed files with 55 additions and 30 deletions

View File

@ -296,7 +296,10 @@
},
//
gologin() {
uni.navigateTo({
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
},

View File

@ -192,7 +192,7 @@
},
//
godiseasemanagement() {
// this.openPopup();
this.openPopup();
setTimeout(e => {
uni.navigateTo({
url: '/pages/diseasemanagement/diseasemanagement'
@ -201,12 +201,9 @@
},
//
gomedicine() {
// this.openPopup();
setTimeout(e => {
uni.navigateTo({
url: '/pages/medicine/medicine'
})
}, 0)
uni.navigateTo({
url: '/pages/medicine/medicine'
})
},
//
gocustomerservice() {
@ -216,7 +213,7 @@
},
//
gosite() {
// this.openPopup();
this.openPopup();
setTimeout(e => {
uni.navigateTo({
url: '/pages/site/site'
@ -235,7 +232,7 @@
gomaterialbenefits() {
//
// this.$store.dispatch("openPopup");
// this.openPopup();
this.openPopup();
setTimeout(e => {
uni.navigateTo({
url: '/pages/materialbenefits/materialbenefits'
@ -244,7 +241,7 @@
},
//
goshopping() {
// this.openPopup();
this.openPopup();
setTimeout(e => {
uni.navigateTo({
url: '/pages/shopping/shopping'

View File

@ -12,8 +12,49 @@ const store = new Vuex.Store({
//相当于同步的操作
//点击确认
subscribesuccess(state) {
insertSubscribeMessageRecord().then(res => {
console.log(res)
const openids = uni.getStorageSync('openid');
const patientIds = uni.getStorageSync('patientId');
wx.requestSubscribeMessage({
tmplIds: [
'-IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ',
'e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA',
'nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU'
],
success(res) {
var list = {
"subscribeMessageRecordList": [{
templateId: '-IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ',
subscribeStatus: res[
'-IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ'],
openid: openids,
patientId: patientIds,
},
{
templateId: 'e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA',
subscribeStatus: res[
'e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA'],
openid: openids,
patientId: patientIds,
},
{
templateId: 'nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU',
subscribeStatus: res[
'nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU'],
openid: openids,
patientId: patientIds,
},
]
}
if (openids && patientId) {
insertSubscribeMessageRecord(list).then(ress => {
console.log(ress)
})
}
},
fail(err) {
console.log(err)
},
complete(scc) {}
})
},
},
@ -28,23 +69,7 @@ const store = new Vuex.Store({
console.log('res.authSetting', res.authSetting)
if (res.authSetting['scope.subscribeMessage']) {} else {
//因为没有选择总是保持,所以需要调起授权弹窗再次授权
wx.requestSubscribeMessage({
tmplIds: [
'-IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ',
'e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA',
'nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU'
],
success(res) {
console.log(res)
setTimeout(() => {
contxt.commit('subscribesuccess')
}, 1000)
},
fail(err) {
console.log(err)
},
complete(scc) {}
})
contxt.commit('subscribesuccess')
}
}
})