推送功能修复

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -201,7 +201,7 @@
data() { data() {
return { return {
applicationList: [1, 1], applicationList: [1, 1],
isNewCheck: true, // isNewCheck: true,
showPop: false, showPop: false,
dataList: [1, 2, 3], dataList: [1, 2, 3],
tabLists: [{ tabLists: [{
@ -241,7 +241,8 @@
if (!this.newCarNum) return if (!this.newCarNum) return
// leaseApi().then(res=>{}) // leaseApi().then(res=>{})
this.showPop = false 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="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="cards"> <view class="cards">
<view class="cards_head"> <view class="cards_head">
<text><!-- <!-- {{datas.}} --> --></text> <text><!-- <!-- {{datas.}} --></text>
</view> </view>
<view class="cards_content"> <view class="cards_content">
<view class="right"> <view class="right">