更新功能

This commit is contained in:
weipengfei 2023-09-04 19:50:47 +08:00
parent 6c3a13ede2
commit 0f928298e5
14 changed files with 84 additions and 59 deletions

133
App.vue
View File

@ -1,66 +1,85 @@
<script> <script>
//#ifdef APP-PLUS //#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush"); const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
export default { import { loginShopAccount } from "@/api/oaUser.js"
onLaunch: async function(info) { export default {
// let noticeArr = [] onLaunch: async function(info) {
// jpushModule.addNotificationListener(res => { // let noticeArr = []
// if (!noticeArr.includes(res.messageID)) { // jpushModule.addNotificationListener(res => {
// const audioContext = uni.createInnerAudioContext() // if (!noticeArr.includes(res.messageID)) {
// // // const audioContext = uni.createInnerAudioContext()
// audioContext.src = `/static/audio/order.mp3`; // //
// // console.log(res.messageID) // audioContext.src = `/static/audio/order.mp3`;
// audioContext.play() // // console.log(res.messageID)
// noticeArr.push(res.messageID) // audioContext.play()
// console.log("app") // noticeArr.push(res.messageID)
// } // console.log("app")
// }) // }
// })
// uni.showModal({ // uni.showModal({
// content: info.referrerInfo.extraData // content: info.referrerInfo.extraData
// }) // })
if(info.referrerInfo?.extraData?.uniMP) uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
if(info.referrerInfo?.extraData?.token) uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token); if (info.referrerInfo?.extraData?.uniMP) {
console.log('App Launch') uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
this.$store.dispatch('initConfig'); uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
try { try{
if (!this.$store.state.app.token) uni.reLaunch({ let res = await loginShopAccount({
url: '/pages/oaLogin/oaLogin' shop_token: info.referrerInfo?.extraData?.token
}) });
} catch (e) { this.$store.commit('SET_USERINFO', {
uni.reLaunch({ user: data,
url: '/pages/oaLogin/oaLogin' token: res.data.token
}) })
} let {
}, data
onShow: function() { } = await userInfo();
const audioContext = uni.createInnerAudioContext() this.$store.commit('setUserInfo', data);
// }catch(e){
audioContext.src = '/static/mp3/order.mp3' console.log(e);
// }
//#ifdef APP-PLUS }
jpushModule.addNotificationListener(res => { console.log('App Launch')
if (res.notificationEventType == 'notificationOpened') return this.$store.dispatch('initConfig');
audioContext.play() try {
uni.vibrateLong(); if (!this.$store.state.app.token) uni.reLaunch({
console.log("app的监听") url: '/pages/oaLogin/oaLogin'
}) })
// #endif } catch (e) {
console.log('App Show') uni.reLaunch({
}, url: '/pages/oaLogin/oaLogin'
onHide: function() { })
console.log('App Hide') }
} },
} onShow: function() {
const audioContext = uni.createInnerAudioContext()
//
audioContext.src = '/static/mp3/order.mp3'
//
//#ifdef APP-PLUS
jpushModule.addNotificationListener(res => {
if (res.notificationEventType == 'notificationOpened') return
audioContext.play()
uni.vibrateLong();
console.log("app的监听")
})
// #endif
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script> </script>
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
@import "static/css/base.css"; @import "static/css/base.css";
@import "static/css/style.scss"; @import "static/css/style.scss";
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>

View File

@ -60,3 +60,8 @@ export const userPostsms = (data) => oahttp.post('/user/postsms', data)
* 注销账号 * 注销账号
*/ */
export const destroyAccount = (data) => oahttp.post('/user/destroy_account', data) export const destroyAccount = (data) => oahttp.post('/user/destroy_account', data)
/**
* 商城登录
*/
export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data)

View File

@ -10,7 +10,6 @@
<!-- #endif --> <!-- #endif -->
<view class="body"> <view class="body">
<view class="title">欢迎进入里海供销平台</view> <view class="title">欢迎进入里海供销平台</view>
<view>{{APP_token}}</view>
<view class="login-card"> <view class="login-card">
<view class="top"> <view class="top">
<view class="text item"> <view class="text item">
@ -74,7 +73,8 @@
code: '', code: '',
terminal: 6, //6APP terminal: 6, //6APP
scene: 1, scene: 1,
register_id: "" register_id: "",
shop_token: ""
}, },
tips: '获取验证码', tips: '获取验证码',
// refCode: null, // refCode: null,
@ -118,6 +118,7 @@
if (!this.formData.account) return Toast('账号不能为空'); if (!this.formData.account) return Toast('账号不能为空');
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空'); if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空'); if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
this.formData.shop_token = uni.getStorageSync('APP_token');
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: '正在登录中' title: '正在登录中'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B