Răsfoiți Sursa

feat:订单增加站点信息;主页显示版本号、更换背景图;

Zhenghanjv 8 luni în urmă
părinte
comite
161ec36e02

+ 2 - 1
components/orderItemInfo/orderItemInfo.js

@@ -18,7 +18,8 @@ Component({
         discount:15.3,
         orderId:'20251111111111',
         time:'2025-01-20 18:33',
-        price:''
+        price:'',
+        station:'油站名'
       }
     },
     bottonText1:{

+ 2 - 2
components/orderItemInfo/orderItemInfo.wxml

@@ -66,8 +66,8 @@
         <text>{{order.orderId}}</text>
       </view>
       <view>
-        <text>时间</text>
-        <text>{{order.time}}</text>
+        <text>油站与时间</text>
+        <text>{{order.station}}_{{order.time}}</text>
       </view>
     </view>
   </view>

+ 2 - 1
components/prepayOrderItemInfo/prepayOrderItemInfo.js

@@ -18,7 +18,8 @@ Component({
         discount:15.3,
         refund:0,
         orderId:'20251111111111',
-        time:'2025-01-20 18:33'
+        time:'2025-01-20 18:33',
+        station:'油站名'
       }
     },
     buttonText1:{

+ 2 - 2
components/prepayOrderItemInfo/prepayOrderItemInfo.wxml

@@ -32,8 +32,8 @@
           <text>{{order.orderId}}</text>
         </view>
         <view>
-          <text>时间</text>
-          <text>{{order.time}}</text>
+          <text>站点与时间</text>
+          <text>{{order.station}}_{{order.time}}</text>
         </view>
       </view>
 

+ 13 - 2
pages/historyOrder/historyOrder.js

@@ -14,6 +14,7 @@ Page({
     date: '',
     latitude: 0, //用户当前经度
     longitude: 0, //用户当前纬度
+    stationName:'',//油站名
     stationLatitude: 0, //站点经度
     stationLongitude: 0, //站点纬度
     startDate: '',
@@ -156,6 +157,7 @@ Page({
       endDate: lastMouthDay
     });
     console.log("历史页当前data", this.data)
+    this.getStationInfo();
     // this.startCountdow();
   },
 
@@ -174,12 +176,19 @@ Page({
       }
       console.log("站点信息", res)
       const stationLocation = res.data.data.site.gpsCoordinates.split(",");
+      const name = res.data.data.site.name;
+      
+      that.setData({
+        stationName:name,
+      })
+      
       if (stationLocation.length == 2) {
         that.setData({
           stationLatitude: stationLocation[0],
           stationLongitude: stationLocation[1]
         })
       }
+
       this.getLocation();
     })
   },
@@ -414,7 +423,8 @@ Page({
             discount: order.originalAmount - order.actualPaymentAmount,
             orderId: order.id,
             time: time,
-            price: order.price
+            price: order.price,
+            station:that.data.stationName
           },
           bottonText2: bt2,
           orderType:order.orderType
@@ -441,7 +451,8 @@ Page({
             discount: order.originalAmount - order.actualPaymentAmount,
             refund: order.refundAmount,
             orderId: order.id,
-            time: time
+            time: time,
+            station:that.data.stationName
           },
           bottonText1: bt1,
           bottonText2: bt2,

+ 1 - 1
pages/historyOrder/historyOrder.wxss

@@ -42,7 +42,7 @@ picker{
 }
 
 .orderItem {
-  width: 100%;
+  width: 90%;
   box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
   border-radius: 1%;
   margin-top: 5%;

+ 2 - 2
pages/login/login.js

@@ -204,8 +204,8 @@ Page({
         success(res) {
           console.log('用户信息:', res.userInfo);
           var user = {
-            // UserName: res.userInfo.nickName,
-            UserName: "测试",
+            UserName: res.userInfo.nickName,
+            // UserName: "测试",
             UserAvatarUrl: res.userInfo.avatarUrl,
             UserPhoneNumber: '',
             Address: '',

+ 7 - 7
pages/quantify/quantify.js

@@ -155,13 +155,13 @@ Page({
   
     console.log('进入 toAuthorization 方法');
     console.log(this.data)
-    // const distance = utils.haversine(this.data.stationLatitude,this.data.stationLongitude,this.data.latitude,this.data.longitude);
-    // if(distance > 500) {
-    //   wx.showToast({
-    //     title: '您不在油站范围内,请到油站时进行下单',
-    //   })
-    //   return
-    // }
+    const distance = utils.haversine(this.data.stationLatitude,this.data.stationLongitude,this.data.latitude,this.data.longitude);
+    if(distance > 500) {
+      wx.showToast({
+        title: '您不在油站范围内,请到油站时进行下单',
+      })
+      return
+    }
     this.createOrder();
   },
 

+ 4 - 0
pages/scan/scan.wxml

@@ -46,7 +46,11 @@
       </view>
 
       <text class="scan-tip-text" style="position: relative; left: 0rpx; top: 0rpx; width: 327rpx; height: 45rpx; display: block; box-sizing: border-box">{{scanTip}}</text>
+
     </view>
+
+    <text class="version">V2025.02.06</text>
   </view>
 
+  
 </view>

+ 6 - 0
pages/scan/scan.wxss

@@ -36,6 +36,7 @@
   display: flex;
   flex-direction: column;
   justify-content: center;
+  align-items: center;
   width: 90%;
   border-radius: 5%;
   position: absolute;
@@ -180,4 +181,9 @@
 .scan-tip-text{
   font-size: small;
   color: #808080;
+}
+
+.version{
+  display: flex;
+
 }