1 files added
3 files modified
| | |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <u-tabs :list="list" :scrollable="scrollable" lineWidth="60" @change="changeTap" /> |
| | | <u-tabs :list="list" :scrollable="scrollable" lineWidth="60" :current='current' @change="changeTap" /> |
| | | </view> |
| | | <view class="" v-if="userName"> |
| | | <view class="dataRangeSerch" v-if="current===3"> |
| | |
| | | value: 3, |
| | | }, ], |
| | | showeEscalationTime: false, |
| | | current: 0, |
| | | current: 1, |
| | | startTime: '', |
| | | endTime: '', |
| | | workOderList: [], |
| | |
| | | userId: this.userInfor.userId |
| | | } |
| | | this.$http.httpGet('/allocationApp/authority', params).then(res => { |
| | | res.data = false |
| | | if (!res.data) { |
| | | uni.showModal({ |
| | | content: '您暂无操作权限,请联系管理员!', |
| | |
| | | httpGet |
| | | } from '@/utils/http.js' |
| | | import store from '@/store/index.js' |
| | | import { |
| | | subScribeMsg |
| | | } from '@/utils/subscribe.js' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | uni.hideHomeButton() |
| | | }, |
| | | methods: { |
| | | // 点击时触发订阅信息 |
| | | async aClick() { |
| | | let data = await subScribeMsg() |
| | | console.log('data', data) |
| | | if (data['YNqUZ1MgMvwY3G-NENVbcmIBR5dUotSdnwcz96CWrho'] === 'accept') { // 用户点击确定后 |
| | | } else { |
| | | console.log('拒绝') |
| | | } |
| | | }, |
| | | doRequire() { |
| | | uni.requirePrivacyAuthorize({ |
| | | success: () => { |
| | |
| | | const value = uni.getStorageSync('openId') |
| | | console.log('openId', value) |
| | | if (value) { |
| | | this.aClick() |
| | | this.logining(value) |
| | | } |
| | | }, |
New file |
| | |
| | | function subScribeMsg() { |
| | | return new Promise((resolve, reject) => { |
| | | let that = this |
| | | uni.getSetting({ |
| | | withSubscriptions: true, |
| | | success(res) { |
| | | console.log('1', res, '订阅信息', res.subscriptionsSetting) |
| | | if (!res.subscriptionsSetting.mainSwitch) { |
| | | uni.showModal({ |
| | | title: '是否重新授权消息订阅功能', |
| | | success(res) { |
| | | if (res.confirm) { |
| | | uni.openSetting({ |
| | | success(res) { |
| | | if (res.subscriptionsSetting) { |
| | | uni.showToast({ |
| | | title: '开启权限成功', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }, |
| | | fail() { |
| | | uni.showToast({ |
| | | title: '开启权限失败', |
| | | icon: 'none', |
| | | }) |
| | | }, |
| | | }) |
| | | } else if (res.cancel) { |
| | | uni.showToast({ |
| | | title: '拒绝开启开启权限', |
| | | icon: 'none', |
| | | }) |
| | | } |
| | | }, |
| | | }) |
| | | } else { |
| | | uni.requestSubscribeMessage({ |
| | | tmplIds: ['YNqUZ1MgMvwY3G-NENVbcmIBR5dUotSdnwcz96CWrho'], |
| | | success(res) { |
| | | console.log('requestSubscribeMessage 订阅信息', res) |
| | | resolve(res) |
| | | }, |
| | | fail(errMessage) { |
| | | reject(errMessage) |
| | | console.log('订阅消息 失败 ', errMessage) |
| | | }, |
| | | complete() {} |
| | | }) |
| | | } |
| | | }, |
| | | }) |
| | | }) |
| | | } |
| | | module.exports = { subScribeMsg } |