Forráskód Böngészése

feat:修改云端地址,消息模板类型改为支付,支付完成页跳转至历史订单

Zhenghanjv 2 hónapja
szülő
commit
62114906c9

+ 2 - 1
js/api.js

@@ -3,7 +3,8 @@ const SM4Exten = require('../js/SM4Exten');
 const miniprogramsm4 = require("../miniprogram_npm/miniprogram-sm-crypto/index").sm4;
 const secretId = "D2BCF8DE-AA24-4BF6-9C34-C8DD325E412B"; //小程序应用ID
 const Secret = "6C680A47B87740138DFB299FC69A64E1"; //小程序应用密钥
-const api_root = 'http://192.168.0.202:5006/'
+const api_root = 'http://47.97.120.160:5006/'
+// const api_root = 'http://192.168.0.202:5006/'
 const CurrentBuId = '12345678-9abc-def0-1234-56789abcdef0';
 
 function request(path, method = 'GET', data = null) {

+ 7 - 1
pages/TransactionPage/TransactionPage.js

@@ -219,7 +219,7 @@ Page({
   sendMessage() {
     const message = {
       trxid:this.data.order.orderId,
-      orderType:'支付成功'
+      orderType:'支付'
     }
     api.request_sendMessage(message).then(res => {
       console.log("发送消息模板结果",res)
@@ -230,6 +230,12 @@ Page({
 
   /** 跳转到支付结果页 */
   toPayResult(){
+    wx.redirectTo({
+      url: '../payResult/payResult',
+    })
+  },
+  /** 跳转到支付结果页(不用这个) */
+  toPayResult_back(){
     const that = this;
     setTimeout(function () {
       wx.navigateTo({

+ 2 - 2
pages/historyOrder/historyOrder.js

@@ -197,7 +197,6 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    console.log("chudi")
     if(!this.data.isHaveOrder) return;
     var page = this.data.pageNum + 1;
     this.setData({
@@ -216,7 +215,8 @@ Page({
   /** 日期选择器选择时间 */
   bindDateChange(date) {
     this.setData({
-      date: date.detail.value
+      date: date.detail.value,
+      orders:[]
     });
     console.log(date)
     this.getOrder()

+ 2 - 2
pages/login/login.wxml

@@ -5,10 +5,10 @@
   <view class="action-text">立码加油</view>
   <button class="auth-button" open-type="getPhoneNumber" style="width: 547rpx; height: 94rpx; display: block; box-sizing: border-box; left: 0rpx; top: 0rpx"  bindtap="handleAuthLogin" bindgetphonenumber="handleAuthLogin">一键授权登录</button>
   <view class="agreement">
-    <button class="auth-button"   bindtap="subMessage">支付</button>
+    <!-- <button class="auth-button"   bindtap="subMessage">支付</button>
     <button class="auth-button"   bindtap="RefundTrx">退款</button>
     <button open-type="getPhoneNumber" bindgetphonenumber="handleGetPhoneNumber">获取手机号</button>
-    <checkbox checked="{{true}}" disabled="{{true}}" />
+    <checkbox checked="{{true}}" disabled="{{true}}" /> -->
     <text>我已阅读并同意</text>
     <text class="link">《用户协议》</text>
     <text>和</text>

+ 1 - 12
pages/moreOrder/moreOrder.js

@@ -8,18 +8,7 @@ Page({
    */
   data: {
     buttonMessage2:'去支付',
-    orders:[
-      {
-        nozzle:5,
-        oilName:"92#",
-        volume:20.0,
-        amount:46.8,
-        payAmount:46.8,
-        discount:0.00,
-        orderId:'1',
-        time:'2024-11-24 09:08'
-      }
-    ]
+    orders:[]
   },
 
   /**

+ 7 - 1
pages/payResult/payResult.js

@@ -66,7 +66,7 @@ Page({
 
   },
 
-  /** 查看订单 */
+  /** 查看更多订单 */
   toMoreOrder(){
     const that = this;
     wx.navigateTo({
@@ -85,6 +85,12 @@ Page({
     })
   },
 
+  /** 查看订单 */
+  toHistoryOrder() {
+    wx.redirectTo({
+      url: '../historyOrder/historyOrder',
+    })
+  },
   /** 完成 */
   finish() {
     wx.redirectTo({

+ 1 - 1
pages/payResult/payResult.wxml

@@ -6,7 +6,7 @@
   </view>
 
   <view class="buttonBox">
-    <text class="checkOrderBtn" bind:tap="toMoreOrder">查看订单</text>
+    <text class="checkOrderBtn" bind:tap="toHistoryOrder">查看订单</text>
     <text class="finishBtn" bind:tap="finish">完成</text>
   </view>