Bläddra i källkod

根据小程序码跳转逻辑修复确认订单页面bug

suixueyan 8 månader sedan
förälder
incheckning
fe137912a1
2 ändrade filer med 12 tillägg och 15 borttagningar
  1. 1 12
      pages/mine/index.vue
  2. 11 3
      subPages/storeConsumption/storeConsumption.vue

+ 1 - 12
pages/mine/index.vue

@@ -290,7 +290,7 @@ export default {
         // {
         //   name: "线下消费记录",
         //   url: require("@/static/ic-other-i.png"),
-        //   path: "/subPages/storeConsumption/storeConsumption?orderNo=SP20250509562476",
+        //   path: "/subPages/storeConsumption/storeConsumption?orderNo=SP20250509680265",
         //   isVip: true
         // },
         {
@@ -447,17 +447,6 @@ export default {
           JSON.parse(userInfo).headimg != ""
       ) {
         this.userInfo = JSON.parse(userInfo);
-        const {
-          headimg,
-          nickname,
-          base_sex,
-          realname,
-          region_area,
-          region_city,
-          region_province,
-          phone
-        } =
-            this.userInfo
         this.avatarUrl = this.userInfo.headimg;
         this.userName = this.userInfo.nickname;
         this.isUserRegister = true;

+ 11 - 3
subPages/storeConsumption/storeConsumption.vue

@@ -2,7 +2,7 @@
 import {expenseDetail,expensePay} from "../../common/api";
 import UCodeInput from "../../components/uview-ui/components/u-code-input/u-code-input.vue";
 import {
-  getCustomerInfo,
+  getCustomerInfo, getUserInfo,
 } from "../../common/api/user.js";
 export default {
   name: "storeConsumption",
@@ -36,9 +36,8 @@ export default {
     const topData = uni.getMenuButtonBoundingClientRect()
     this.topData.top = topData.top
     this.topData.height = topData.height
-    const userInfo = uni.getStorageSync("userInfo");
-    this.userInfo = JSON.parse(userInfo);
     this.expenseDetail()
+    this.getUserInfo()
   },
   methods: {
     splitStr(str) {
@@ -46,6 +45,15 @@ export default {
       var split = str.split(';;');
       return split[split.length - 1]
     },
+    async getUserInfo() {
+      const data = {};
+      await getUserInfo(data)
+          .then((res) => {
+            if (res.data) {
+              this.userInfo = res.data;
+            }
+          });
+    },
     toPay() {
       this.show = true
     },