From b77e8e776af4d81e748e9e21d51b64a11085a195 Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期四, 19 十二月 2024 10:49:11 +0800
Subject: [PATCH] 未提交退出提示

---
 pages/scanResult/index.js |   53 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/pages/scanResult/index.js b/pages/scanResult/index.js
index 1164b30..21cd7d6 100644
--- a/pages/scanResult/index.js
+++ b/pages/scanResult/index.js
@@ -1,6 +1,5 @@
 // pages/index/scanResult/index.js
 const app = getApp()
-
 Page({
 
   /**
@@ -15,7 +14,9 @@
     isOther: false,
     activeCodeAndStoreChannelLinks: [],
     activeInfo: null,
-    description: ""
+    description: "",
+    itemType: '',
+    goodsData: ''
   },
 
   /**
@@ -29,7 +30,10 @@
           result,
           textValue: result.type == "PromoteCode" ? '棰嗗彇' : '婵�娲�'
         })
-        this.getRules();
+        wx.setNavigationBarTitle({
+          title: result.type == "PromoteCode" ? '棰嗗彇浼樻儬鍗�' : '婵�娲诲晢鍝�',
+        })
+        // this.getRules();
         this.getProductByCode();
       } else {
         this.setData({
@@ -37,6 +41,7 @@
         })
       }
     } catch (error) {
+      console.log(error);
       this.setData({
         isOther: true
       })
@@ -93,13 +98,14 @@
           wx.showModal({
             title: '娓╅Θ鎻愮ず',
             content: res,
-            showCancel: false
+            showCancel: false,
+            success(res) {
+              if (res.confirm)
+                wx.switchTab({
+                  url: '/pages/home/home',
+                })
+            }
           })
-          setTimeout(() => {
-            wx.navigateTo({
-              url: '/pages/codeRecord/index',
-            })
-          }, 2500);
         });
     } else {
       let that = this;
@@ -139,9 +145,9 @@
           showCancel: false,
           success(res) {
             if (res.confirm) {
-              setTimeout(() => {
-                wx.navigateBack()
-              }, 2500);
+              wx.switchTab({
+                url: '/pages/home/home',
+              })
             }
           }
         })
@@ -161,7 +167,12 @@
         .then(res => {
           try {
             const list = JSON.parse(res.config);
+            console.log('code', res, list);
             if (this.data.result) {
+              const type = res.saleMethodList[0].type
+              this.setData({
+                goodsData: res,
+              })
               this.getProductListById(list);
             }
             if (res?.activeCodeAndStoreChannelLinks) {
@@ -206,19 +217,15 @@
     app.MG.store
       .getProductList({
         queryType: "*",
-        subAccess: [{
-          StoreRefCode: app.config.learnPlatformGoodsStore, // 榛樿鍟嗗搧搴�
-          Path: "",
-          Type: "*",
-        }, ],
+        // subAccess: [{
+        // StoreRefCode: app.config.learnPlatformGoodsStore, // 榛樿鍟嗗搧搴�
+        //   Path: "",
+        //   Type: "*",
+        // }, ],
         sort: {
           CreateDate: "Desc",
         },
         fields: {
-          tourism_author: [],
-          tourism_paperPrice: [],
-          tourism_publicationDate: [],
-          tourism_ISBN: [],
           "Id=": ids.map(item => item.id + ""),
         },
         paging: {
@@ -231,9 +238,13 @@
       })
       .then(res => {
         res.datas.map(item => {
+          item.name = item.name + '-' + this.data.goodsData.saleMethodList[0].name
           item.price ? item.price = (item.price).toFixed(2) : "";
           item.oldPrice ? item.oldPrice = (item.oldPrice).toFixed(2) : "";
+          item.icon ? item.icon = item.icon : item.icon = "/static/images/default-book-img.png",
+            item.itemType = this.data.goodsData.saleMethodList[0].type == 'createProductFolderSaleMethod' ? '鐩綍' : this.data.goodsData.saleMethodList[0].type == 'createProductItemSaleMethod' ? '璧勬簮' : '鐢靛瓙涔�'
         })
+        console.log(1, res.datas[0]);
         that.setData({
           productInfo: res.datas
         })

--
Gitblit v1.9.1