推送功能修复

This commit is contained in:
THK3121 2023-08-29 16:45:34 +08:00
parent 7f23c975c5
commit eac42fd42c
5 changed files with 780 additions and 766 deletions

70
App.vue
View File

@ -1,51 +1,55 @@
<script>
//#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush");
import Updater from '@/uni_modules/guyue-updater/index';
import Updater from '@/uni_modules/guyue-updater/index';
// #endif
export default {
onLaunch: async function() {
// let noticeArr = []
// jpushModule.addNotificationListener(res => {
// if (!noticeArr.includes(res.messageID)) {
// const audioContext = uni.createInnerAudioContext()
// //
// audioContext.src = `/static/audio/order.mp3`;
// // console.log(res.messageID)
// audioContext.play()
// noticeArr.push(res.messageID)
// console.log("app")
// }
// })
console.log('App Launch')
this.$store.dispatch('initConfig');
try {
if (!this.$store.state.app.token) uni.reLaunch({
url: '/pages/oaLogin/oaLogin'
})
} catch (e) {
uni.reLaunch({
url: '/pages/oaLogin/oaLogin'
})
}
this.$store.dispatch('initConfig');
try {
if (!this.$store.state.app.token) uni.reLaunch({
url: '/pages/oaLogin/oaLogin'
})
} catch (e) {
uni.reLaunch({
url: '/pages/oaLogin/oaLogin'
})
}
},
onShow: function() {
const audioContext = uni.createInnerAudioContext()
//
audioContext.src = './static/mp3/order.mp3'
let noticeArr = []
audioContext.src = '/static/mp3/order.mp3'
//
//#ifdef APP-PLUS
jpushModule.addNotificationListener(res => {
if (!noticeArr.includes(res.messageID)) {
console.log(res.messageID)
audioContext.play()
noticeArr.push(res.messageID)
console.log("app的")
uni.vibrateLong({
success: function() {
console.log('success');
}
});
}
if (res.notificationEventType == 'notificationOpened') return
audioContext.play()
uni.vibrateLong();
console.log("app的监听")
})
//
// Updater.update({
// title: '',
// content: '1. UI\n2. UI\n3. UI\n4. UI\n',
// versionName: '1.3.6',
// downUrl: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/__UNI__B5B1EDD__20230816174515.apk',
// force: false, //
// quiet: false //
// })
//
// Updater.update({
// title: '',
// content: '1. UI\n2. UI\n3. UI\n4. UI\n',
// versionName: '1.3.6',
// downUrl: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/__UNI__B5B1EDD__20230816174515.apk',
// force: false, //
// quiet: false //
// })
// #endif
console.log('App Show')
},

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@
<view class="btns">
<u-button type="primary" @click="showPop=true" style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32"
text="申请驳回"></u-button>
<u-button type="primary" text="生成合同" color="#0122C7"></u-button>
<u-button type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button>
</view>
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
@ -86,6 +86,9 @@
contractApi,
overruleApi
} from "@/api/property.js"
import {
Toast
} from "../../libs/uniApi"
export default {
data() {
return {
@ -98,7 +101,15 @@
methods: {
confirm() {
console.log(this.overruleValue)
this.showPop = false
overruleApi().then(res => {
Toast("操作成功")
this.showPop = false
})
},
contractFn() {
contractApi().then(res => {
Toast("操作成功")
})
},
navTo(url) {
uni.navigateTo({
@ -113,11 +124,9 @@
<style lang="scss" scoped>
.date {
padding: 10rpx 28rpx 0;
}
.cards {
margin: 28rpx;
width: 694rpx;
background: #ffffff;

View File

@ -201,7 +201,7 @@
data() {
return {
applicationList: [1, 1],
isNewCheck: true,
// isNewCheck: true,
showPop: false,
dataList: [1, 2, 3],
tabLists: [{
@ -241,7 +241,8 @@
if (!this.newCarNum) return
// leaseApi().then(res=>{})
this.showPop = false
this.isNewCheck = true
Toast("操作成功")
// this.isNewCheck = true
},

View File

@ -22,7 +22,7 @@
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="cards">
<view class="cards_head">
<text><!-- <!-- {{datas.}} --> --></text>
<text><!-- <!-- {{datas.}} --></text>
</view>
<view class="cards_content">
<view class="right">