From 7dfdd2b122356a6610d7d1a994d04cc5670003ad Mon Sep 17 00:00:00 2001 From: "1054425342@qq.com" <1054425342@qq.com> Date: Fri, 19 Sep 2025 11:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DynamicIsland.vue | 15 +++++++------- static/js/request.js | 4 ++-- subPackages/points/index.vue | 1 + subPackages/techan/order.vue | 39 ++++++++++++++++++++++++++++++++---- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/components/DynamicIsland.vue b/components/DynamicIsland.vue index ea474c4..1fcce26 100644 --- a/components/DynamicIsland.vue +++ b/components/DynamicIsland.vue @@ -88,7 +88,7 @@ 时间奖励 {{ - userInfo && userInfo.token ? userInfo.hourValue||0:0 + userInfo && userInfo.token ? (userInfo.hourValue||0):0 }} @@ -112,7 +112,7 @@ style="display: flex;align-items: center;font-size: 26rpx;font-weight: bold;display: flex;align-items: center;margin-top: 20rpx;"> 时长:{{ - userInfo && userInfo.token ? userInfo.hour: 0 + userInfo && userInfo.token ? userInfo.hour||0: 0 }}h @@ -360,12 +360,13 @@ // 更新标题显示用户昵称 if (this.userInfo && this.userInfo.nickname) { this.currentTitle = `Hi!${this.userInfo.nickname},欢迎回来~`; + this.Post({}, '/framework/points/getLastBalance', 'DES').then(res => { + if (res.code === 200) { + this.totalPoints = res.data.balance || 0; + } + }) } - this.Post({}, '/framework/points/getLastBalance', 'DES').then(res => { - if (res.code === 200) { - this.totalPoints = res.data.balance || 0; - } - }) + } catch (e) { console.warn("获取用户信息失败:", e); this.userInfo = {}; diff --git a/static/js/request.js b/static/js/request.js index dc5df2c..662f684 100644 --- a/static/js/request.js +++ b/static/js/request.js @@ -8,11 +8,11 @@ const DEV_API_URL = 'http://1.13.193.49'; // const PROD_API_URL = 'https://epic.js-dyyj.com'; const PROD_API_URL = 'http://1.13.193.49'; const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL; -const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx'; +const DEV_API_URL_DES = 'https://des.dayunyuanjian.cn/xcx'; // const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx'; // const DEV_API_URL_DES = 'http://1.13.193.49:8083/xcx'; // const PROD_API_URL_DES = 'https://des.js-dyyj.com/xcx'; -const PROD_API_URL_DES = 'http://1.13.193.49:8083/xcx'; +const PROD_API_URL_DES = 'https://des.dayunyuanjian.cn/xcx'; const NEWAPIURL_DES = process.env.NODE_ENV === 'development' ? DEV_API_URL_DES : PROD_API_URL_DES; const getToken = () => { const userInfoFromStorage = uni.getStorageSync('userInfo'); diff --git a/subPackages/points/index.vue b/subPackages/points/index.vue index 37daba0..0a8af3d 100644 --- a/subPackages/points/index.vue +++ b/subPackages/points/index.vue @@ -211,6 +211,7 @@ export default { // 获取总积分 async getTotalPoints() { try { + if(!uni.getStorageSync("userInfo") )return this.Post({}, "/framework/points/getLastBalance", "DES").then((res) => { if (res.code === 200) { this.pointInfo = res.data; diff --git a/subPackages/techan/order.vue b/subPackages/techan/order.vue index e503d26..73b9337 100644 --- a/subPackages/techan/order.vue +++ b/subPackages/techan/order.vue @@ -474,6 +474,7 @@ export default { // 获取总积分 async getTotalPoints() { try { + if(!uni.getStorageSync("userInfo") )return this.Post({}, "/framework/points/getLastBalance", "DES").then((res) => { if (res.code === 200) { this.userPoints = res.data.balance || 0; @@ -964,10 +965,11 @@ export default { onSuccess: (data) => { this.isOrderLoading = false; // 结束加载 // 处理成功逻辑 - uni.showToast({ - title: "订单创建成功", - icon: "success", - }); + // uni.showToast({ + // title: "订单创建成功", + // icon: "success", + // }); + this.orderPay(res.msg) }, onFailure: (data) => { this.isOrderLoading = false; // 结束加载 @@ -1002,6 +1004,35 @@ export default { }); }); }, + orderPay(token){ + this.Post( + { + method: "POST", + orderNo:token, + fromType:1, + payAmount:this.allprice, + userId:124 + }, + "/framework/wxPay/submitShopPurOrder", + "DES" + ).then(res =>{ + uni.requestPayment({ + nonceStr: res.data.nonceStr, + package: res.data.package, + paySign: res.data.paySign, + signType: res.data.signType, + timeStamp: res.data.timeStamp, + success: () => { + this.getSubscribeMessage() + }, + fail() { + uni.navigateTo({ + url: '/subPackages/order/trades' + }) + } + }); + }) + }, // ---------------自提----------------------- changPopShow(e) {