From 60a5b586a74dc6c39a2f129c3e0f9d276e2716f4 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 16 Jun 2023 15:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=BB=91=E5=AE=9A=E6=97=B6=20-=20?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E8=A7=A3=E7=A0=81=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +- app.json | 6 + host.js | 3 +- packageA/member/editmobile/editmobile.js | 102 +++++++++- packageI/pay_back/pay_back.js | 236 +++++++++++++++++++++++ packageI/pay_back/pay_back.json | 3 + packageI/pay_back/pay_back.wxml | 23 +++ packageI/pay_back/pay_back.wxss | 81 ++++++++ project.config.json | 2 +- 9 files changed, 448 insertions(+), 12 deletions(-) create mode 100644 packageI/pay_back/pay_back.js create mode 100644 packageI/pay_back/pay_back.json create mode 100644 packageI/pay_back/pay_back.wxml create mode 100644 packageI/pay_back/pay_back.wxss diff --git a/app.js b/app.js index ea6b092..eb4ec23 100644 --- a/app.js +++ b/app.js @@ -522,7 +522,7 @@ App({ }, getFrogproNetAddresss: function (action) { let wx_token = this.getWxToken(); - var url = this.data.host + "/yhmobile/yun_shop/api.php?i=" + this.data.uniacid + "&session_id=" + wx_token + "&type=12&route=" + action; + var url = this.data.host + "/api/api.php?i=" + this.data.uniacid + "&session_id=" + wx_token + "&type=12&route=" + action; if(this.globalData.STORE_ID){ url += "&store_id=" + this.globalData.STORE_ID; } @@ -709,7 +709,7 @@ App({ getNetAddresss: function (action) { // let wx_token = this.getWxToken(); this.getExtJson(); - var url = this.data.host + "/yhmobile/yun_shop/api.php?i=" + this.data.uniacid + "&type=2&route=" + action; + var url = this.data.host + "/api/api.php?i=" + this.data.uniacid + "&type=2&route=" + action; if (this.globalData.STORE_ID) { url += "&store_id=" + this.globalData.STORE_ID; } diff --git a/app.json b/app.json index 3b6f3a0..6d48818 100644 --- a/app.json +++ b/app.json @@ -283,6 +283,12 @@ "independent_store/store_album/store_album", "independent_store/search/search" ] + }, + { + "root": "packageI", + "pages": [ + "pay_back/pay_back" + ] } ], "permission": { diff --git a/host.js b/host.js index 4233272..e52ae14 100644 --- a/host.js +++ b/host.js @@ -1,3 +1,4 @@ // var host = 'https://ht.cdwwzc.com/', uniacid = '1'; module.exports = {host, uniacid}; -var host = 'https://mp.yhzbkj.com', uniacid = '1',store_id = '14'; +//var host = 'https://tsgjx.cdlfjy.com', uniacid = '104',store_id = '258'; +var host = 'https://gjx.cdlfjy.com', uniacid = '104',store_id = '258';// 生产环境 module.exports = {host, uniacid,store_id}; \ No newline at end of file diff --git a/packageA/member/editmobile/editmobile.js b/packageA/member/editmobile/editmobile.js index 22bb671..d3adb4b 100644 --- a/packageA/member/editmobile/editmobile.js +++ b/packageA/member/editmobile/editmobile.js @@ -128,8 +128,7 @@ Page({ } else { this.getCurrentOrderLocation(); } - - + console.log('进入页面获取参数信息:',options); if (options.editType) { this.setData({ editType: options.editType @@ -185,8 +184,9 @@ Page({ }, getPhoneNumber(e) { let info = e.detail; + console.log("手机信息获取",info); if(info.errMsg == 'getPhoneNumber:ok') { - this.getPhoneM(info.code); + this.getPhoneM(info); } }, back() { @@ -201,13 +201,21 @@ Page({ 'form.address': val }); }, - getPhoneM(info) { - let urlStr = app.getNetAddresss('member.member.miniMemberMobile'); + async getPhoneM(info) { + let keys = await this.getSessionKey(info); + let mobile = await this.getPhone_index(info, keys); + this.setData({ + 'form.mobile': mobile + },function () { + wx.hideLoading(); + }); +/* return false; let that = this; app._postNetWork({ - url: urlStr, + url: app.getNetAddresss('member.member.mobileDecode'),//miniMemberMobile data: { - code: info, + encryptedData: info.encryptedData, + iv: info.iv, not_validate_page: '0' }, showToastIn: false, @@ -225,9 +233,87 @@ Page({ }); } }, - fail: function (res) { } + fail: function (res) { + console.log('手机号解码失败',res); + } + });*/ + }, + getSessionKey() { + let key = wx.getStorageSync('session'); + console.log(key, '缓存的session'); + let urlStr = app.getNetAddresss('member.mini-decrypt.getSessionKey'); + return new Promise((resolve,reject) => { + app._postNetWork({ + url: urlStr, + data: { + session_key_id: key, + not_validate_page: '0' + }, + showToastIn: false, + success: function (resdata) { + var res = resdata.data; + if (res.result == 1) { + console.log(res, '获取session_key'); + if (res.result == 1) { + let keys = res.data.session_key_data.session_key; + resolve(keys); + } + } else { + wx.showToast({ + icon: 'none', + title: res.msg, + duration: 1500 + }); + reject(); + } + }, + fail: function (res) { + reject(res); + } + }); }); }, + getPhone_index(info, keys) { + wx.showLoading({ + title: '加载中', + }); + let arr = { + info: info, + session_key: keys + }; + let urlStr = app.getNetAddresss('member.mini-decrypt.index'); + return new Promise((resolve,reject) => { + app._postNetWork({ + url: urlStr, + showToastIn: false, + data: { + para_arr: arr, + not_validate_page: '0' + }, + success: function (resdata) { + var res = resdata.data; + if (res.result == 1) { + resolve(res.data.purePhoneNumber); + } else { + wx.hideLoading({ + success: (res) => { }, + }); + wx.showToast({ + icon: 'none', + title: res.msg, + duration: 1500 + }); + reject(); + } + }, + fail: function (res) { + reject(res); + } + }); + }); + }, + + sexSelectBtn(e) { let val = e.detail.name; console.log(val); diff --git a/packageI/pay_back/pay_back.js b/packageI/pay_back/pay_back.js new file mode 100644 index 0000000..adf4d82 --- /dev/null +++ b/packageI/pay_back/pay_back.js @@ -0,0 +1,236 @@ +// packageI/pay_back/pay_back.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + Interval: null, + showPacket: false, + name: '', + is_cps: '', + order_id: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.setNavigationBarTitle({ + title: '跳转中', + }); + console.log(options); + if (options.is_cps) { + this.setData({ + is_cps: options.is_cps + }); + } + if (options.name) { + this.setData({ + name: options.name + }); + } + if (options.ids) { + this.setData({ + order_id: options.ids + }); + } + if (options.sn) { + this.setData({ + order_sn: options.sn + }); + } + + }, + toPacket() { + wx.navigateTo({ + url: "/packageE/ConsumePacket/ConsumePacketSuccess/ConsumePacketSuccess?order_id=" + this.data.order_id.toString(), + }); + }, + onClickHide() { + this.setData({ + showPacket: false, + }); + this.toRedirect(this.data.redirect); + }, + getData() { + let urlStr = app.getNetAddresss('order.merge-pay.check-order-pay'); + app._postNetWork({ + url: urlStr, + data: { + order_pay_id: this.data.order_id + }, + success: (resdata) => { + let res = resdata.data; + if (res.result == 1) { + if (res.data.status == 1) { + this.setData({ + redirect: res.data.redirect + }); + this.checkoutConsumePacket(res.data.redirect); + clearInterval(this.data.Interval); + this.data.Interval = null; + } else { + if (!this.data.Interval) { + this.data.Interval = setInterval(() => { + this.getData(); + }, 1000); + } + } + } else { + app.tips(res.msg); + } + }, + fail: function (res) {} + }); + }, + checkoutConsumePacket(redirect) { + let basicinfo = wx.getStorageSync("yz_basic_info"); + if (basicinfo && basicinfo.globalParameter.consume_red_packet_status == 1) { + let urlStr = app.getNetAddresss("plugin.consume-red-packet.Frontend.Modules.Packet.Controllers.has.index"); + app._postNetWork({ + url: urlStr, + data: { + order_id: this.data.order_id.split(","), + }, + success: (resdata) => { + var res = resdata.data; + if (res.result == 1) { + this.setData({ + showPacket: true, + }); + } else { + this.toRedirect(redirect); + } + }, + fail: (res) => { + this.toRedirect(redirect); + }, + }); + } else { + this.toRedirect(redirect); + } + }, + toRedirect(redirect) { + if (this.data.is_cps) { + wx.navigateTo({ + url: "/packageH/cpsPwd/cpsPwd?id=" + this.data.order_id, + }); + return; + } + if (this.data.name == "Myshaky") { + wx.navigateTo({ + url: "/packageC/Myshaky/activityHome/activityHome", + }); + return; + } + // if (this.data.name == "blindBox") { + // // 跳转去订单详情 this.data.orderDetail_id + // // wx.redirectTo({ + // // url: "/packageA/member/orderdetail/orderdetail?order_id=" + this.data.orderDetail_id + "&orderType=shop", + // // }); + // return; + // } + if (this.data.order_sn) { + this.payCallBack(redirect); + } + }, + payCallBack(redirect) { + if (app.globalData.store_alone_temp == 1) { + // 开启了门店独立直接跳首页 + wx.reLaunch({ + url: '/packageG/independent_store/index/index?store_id=' + app.globalData.STORE_ID, + }); + return; + } + if (app._isTextEmpty(redirect)) { + wx.reLaunch({ + url: "/packageG/index/index", + }); + } else { + try { + if (this.data.name == "groups" && redirect.indexOf("group_detail") != -1) { + // 拼团 + let str = redirect.match(/group_detail\/(\S*)\?i/)[1]; + str = str.split("/"); + let id = str[0]; + if (str[1]) { + wx.navigateTo({ + url: "/packageB/member/group/GroupDetail/GroupDetail?id=" + id + "&store_id=" + str[1], + }); + } else { + wx.navigateTo({ + url: "/packageB/member/group/GroupDetail/GroupDetail?id=" + id, + }); + } + } else { + wx.redirectTo({ + url: redirect, + fail: (err) => { + console.log(err); + wx.reLaunch({ + url: "/packageG/index/index", + }); + }, + }); + } + } catch (e) { + wx.reLaunch({ + url: "/packageG/index/index", + }); + } + } + + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.getData(); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + clearInterval(this.data.Interval); + this.data.Interval = null; + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + clearInterval(this.data.Interval); + this.data.Interval = null; + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}); \ No newline at end of file diff --git a/packageI/pay_back/pay_back.json b/packageI/pay_back/pay_back.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/packageI/pay_back/pay_back.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/packageI/pay_back/pay_back.wxml b/packageI/pay_back/pay_back.wxml new file mode 100644 index 0000000..f3aee51 --- /dev/null +++ b/packageI/pay_back/pay_back.wxml @@ -0,0 +1,23 @@ + + + + +

订单已支付

+ + 等待处理中 + + + + + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/packageI/pay_back/pay_back.wxss b/packageI/pay_back/pay_back.wxss new file mode 100644 index 0000000..87c20ff --- /dev/null +++ b/packageI/pay_back/pay_back.wxss @@ -0,0 +1,81 @@ +/* packageI/pay_back/pay_back.wxss */ +.wrapper { + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +.wrapper .block { + width: 448rpx; + height: 576rpx; +} + +.wrapper .block image { + width: 100%; + height: 100%; +} + +.pay_back { + min-height: 100vh; + background-color: #fff; + display: flex; + flex-direction: column; + align-items: center; +} + +.loadingStyle { + display: flex; + justify-content: center; + align-items: center; + margin-top: 25.92rpx; +} + +.pay_succee { + margin: 40rpx; + width: 250.88rpx; + height: 198.08rpx; +} + +.loadingEx { + display: flex; + align-items: center; + justify-content: flex-start; + margin-left: 14.08rpx; +} + +.loadingEx .span { + display: inline-block; + width: 10rpx; + height: 10rpx; + margin-right: 10rpx; + border-radius: 50%; + background: #ff4c4c; + -webkit-animation: load 1.04s ease infinite; +} + +.loadingEx .span:last-child { + margin-right: 0; +} + +@-webkit-keyframes load { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +.loadingEx .span:nth-child(1) { + -webkit-animation-delay: 0.13s; +} + +.loadingEx .span:nth-child(2) { + -webkit-animation-delay: 0.26s; +} + +.loadingEx .span:nth-child(3) { + -webkit-animation-delay: 0.39s; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index 05a4beb..9a48fd5 100644 --- a/project.config.json +++ b/project.config.json @@ -45,7 +45,7 @@ "condition": false }, "compileType": "miniprogram", - "appid": "wx886b46d12e1a234d", + "appid": "wx0d4eb4bf8fb79811", "libVersion": "2.21.1", "projectname": "yunzmall", "cloudfunctionTemplateRoot": "",