From f8bb35182f9322fba08dc1add9abbc76b23d3d83 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Wed, 6 Sep 2023 11:36:38 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 1 +
manifest.json | 3 ++-
pages/oaHome/oaHome.vue | 4 +++-
subpkg/buyShare/buyShare.vue | 2 +-
subpkg/topUp/topUp.vue | 46 ++++++++++++++++++++----------------
5 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/App.vue b/App.vue
index 77ceb18..3362217 100644
--- a/App.vue
+++ b/App.vue
@@ -37,6 +37,7 @@
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
+ uni.$emit('home_initUserInfo', data);
}catch(e){
console.log(e);
}
diff --git a/manifest.json b/manifest.json
index f67ad1e..4a6d424 100644
--- a/manifest.json
+++ b/manifest.json
@@ -60,7 +60,8 @@
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
- "appid" : "wx4789d9f1b50390ba",
+ // "appid" : "wx4789d9f1b50390ba",
+ "appid" : "wx9d68c92b550ddd1e", // 商城
"UniversalLinks" : "https://worker-task.lihaink.cn/"
}
},
diff --git a/pages/oaHome/oaHome.vue b/pages/oaHome/oaHome.vue
index 1ca1f39..6672e47 100644
--- a/pages/oaHome/oaHome.vue
+++ b/pages/oaHome/oaHome.vue
@@ -262,6 +262,7 @@
this.showToask();
// this.initOaHomeDada();
this.getOrderList();
+ uni.$on('home_initUserInfo',this.initUserInfo);
//#ifdef APP-PLUS
this.noticeFn();
// #endif
@@ -324,7 +325,8 @@
url: "/pages/logistics/index",
});
},
- initUserInfo() {
+ initUserInfo(data=null) {
+ if(data) return this.myOaInfo = data;
this.$store.state.app.userInfo ?
(this.myOaInfo = this.$store.state.app.userInfo) :
(this.myOaInfo.avatar = "");
diff --git a/subpkg/buyShare/buyShare.vue b/subpkg/buyShare/buyShare.vue
index 9d14fc4..624e488 100644
--- a/subpkg/buyShare/buyShare.vue
+++ b/subpkg/buyShare/buyShare.vue
@@ -9,7 +9,7 @@
任务描述
- {{task.content}}
+ {{task.content||'暂无任务描述'}}
事件记录
diff --git a/subpkg/topUp/topUp.vue b/subpkg/topUp/topUp.vue
index da2ac07..a8b9d59 100644
--- a/subpkg/topUp/topUp.vue
+++ b/subpkg/topUp/topUp.vue
@@ -42,6 +42,8 @@
payMoney: {
money: ''
},
+ // 微信支付信息
+ payData: null,
payTimer: null,
timeCount: 5,
task_id: -1, //任务id,当为任务时,不可自选充值金额
@@ -62,7 +64,28 @@
this.loadTask();
}
},
- onShow() {},
+ onShow() {
+ if(this.payData){
+ payStatus({
+ order_id: payData.order_id,
+ from: payData.from,
+ }).then((status)=>{
+ uni.showToast({
+ icon: status.data.pay_status?'success':'none',
+ title: status.data.pay_status?'支付成功':'支付失败'
+ })
+ if(this.task_id>0){
+ uni.$emit('upBuyShare');
+ uni.navigateBack();
+ }
+ else{
+ userInfo().then(user=>{
+ this.$store.commit('setUserInfo', user.data);
+ })
+ }
+ })
+ }
+ },
methods: {
changePrice(index){
if(this.changeMoney == index)this.changeMoney = -1;
@@ -112,6 +135,7 @@
queryData.task_id = this.task_id;
}
let { data } = await recharge(queryData);
+ this.payData = data;
let res = await payWay({
order_id: data.order_id,
from: data.from,
@@ -147,24 +171,6 @@
success: (e) => {
// console.log('成功', e);
uni.hideLoading();
- payStatus({
- order_id: data.order_id,
- from: data.from,
- }).then((status)=>{
- uni.showToast({
- icon: status.data.pay_status?'success':'none',
- title: status.data.pay_status?'支付成功':'支付失败'
- })
- if(this.task_id>0){
- uni.$emit('upBuyShare');
- uni.navigateBack();
- }
- else{
- userInfo().then(user=>{
- this.$store.commit('setUserInfo', user.data);
- })
- }
- })
},
fail: (e) => {
console.log(e);
@@ -175,7 +181,7 @@
})
},
complete: () => {
- this.payMoney.money = '';
+ if(this.task_id<=0)this.payMoney.money = '';
},
});
}