From d780880b7a73360c8fc9fead1b429dd8ba3758e3 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期五, 27 九月 2024 14:51:59 +0800
Subject: [PATCH] ts

---
 pages/home/home.js                                      |   76 +++++++++++++++++++++----------------
 pages/cart/paymentPage/index.js                         |   16 ++++---
 packageBookService/pages/bookServices/detail/index.wxss |    4 +-
 packageBookService/pages/bookServices/detail/index.js   |    4 +-
 4 files changed, 56 insertions(+), 44 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index 1b9e298..2d430ee 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -2809,8 +2809,8 @@
     }
     app.MG.ugc.newTopicMessage(query).then((res) => {
       wx.showToast({
-        icon: "error",
-        title: "璇蜂笂浼犺祫婧愭枃浠�",
+        icon: "success",
+        title: "涓婁紶鎴愬姛",
       });
       this.closeDialog()
     })
diff --git a/packageBookService/pages/bookServices/detail/index.wxss b/packageBookService/pages/bookServices/detail/index.wxss
index bba6422..51e7e61 100644
--- a/packageBookService/pages/bookServices/detail/index.wxss
+++ b/packageBookService/pages/bookServices/detail/index.wxss
@@ -537,8 +537,8 @@
   padding: 10rpx !important;
 }
 
-.t-input__content,
-.t-textarea {
+.info-center .t-input__content,
+info-center .t-textarea {
   border: 2rpx solid #D9D9D9 !important;
   border-radius: 15rpx;
   padding: 10rpx !important;
diff --git a/pages/cart/paymentPage/index.js b/pages/cart/paymentPage/index.js
index a9e402d..14d62f8 100644
--- a/pages/cart/paymentPage/index.js
+++ b/pages/cart/paymentPage/index.js
@@ -342,14 +342,16 @@
       orderNum: this.data.orderGoods
     }
     app.MG.store.confirmOrder(query).then(res => {
-      Toast({
-        context: this,
-        selector: '#t-toast',
-        message: '棰嗗彇鎴愬姛',
-        theme: 'success',
-        direction: 'column',
+      wx.showToast({
+        title: '棰嗗彇鎴愬姛',
+        icon: 'success',
+        complete: res => {
+          setTimeout(() => {
+            wx.navigateBack()
+          }, 1000);
+        }
       });
-      wx.navigateBack()
+
     })
   }
 })
\ No newline at end of file
diff --git a/pages/home/home.js b/pages/home/home.js
index b94578d..b48cb9a 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -270,6 +270,7 @@
     app.MG.store.getProductList(obj).then((res) => {
       res.datas.forEach((item) => {
         item.price = item.price ? item.price.toFixed(2) : item.price;
+        item.isbuy = item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1
       });
       this.setData({
         courseList: res.datas
@@ -399,6 +400,7 @@
     app.MG.store.getProductList(obj).then((res) => {
       res.datas.forEach((item) => {
         item.price = item.price ? item.price.toFixed(2) : item.price;
+        item.isbuy = item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1
       });
       this.setData({
         textbookList: res.datas
@@ -520,46 +522,54 @@
       info
     } = e.currentTarget.dataset;
     if (wx.getStorageSync(app.config.tokenKey)) {
-      let query = {
-        start: 0,
-        size: 999,
-        filterList: [],
-        searchList: []
-      }
-      try {
-        if (
-          this.data.shoppingCartGetId.includes(
-            info.defaultSaleMethodId
-          )
-        ) {
-          wx.showToast({
-            title: "璇ュ晢鍝佸凡鍦ㄨ喘鐗╄溅锛岃鍕块噸澶嶆坊鍔�",
-            icon: 'none',
-            duration: 1000
-          })
-        } else {
-          let query = {
-            requests: [{
-              saleMethodId: info.defaultSaleMethodId,
-              storeEventId: null,
-              agentCode: '鐢靛瓙涔�'
-            }]
-          }
-          const addRes = await app.MG.store.addShoppingCart(query)
-          if (addRes) {
+      if (info.isbuy) {
+        wx.showToast({
+          title: "璇ュ晢鍝佸凡璐拱",
+          icon: 'none',
+          duration: 1000
+        })
+      } else {
+        let query = {
+          start: 0,
+          size: 999,
+          filterList: [],
+          searchList: []
+        }
+        try {
+          if (
+            this.data.shoppingCartGetId.includes(
+              info.defaultSaleMethodId
+            )
+          ) {
             wx.showToast({
-              title: "娣诲姞鎴愬姛",
-              icon: 'success',
+              title: "璇ュ晢鍝佸凡鍦ㄨ喘鐗╄溅锛岃鍕块噸澶嶆坊鍔�",
+              icon: 'none',
               duration: 1000
             })
+          } else {
+            let query = {
+              requests: [{
+                saleMethodId: info.defaultSaleMethodId,
+                storeEventId: null,
+                agentCode: '鐢靛瓙涔�'
+              }]
+            }
+            const addRes = await app.MG.store.addShoppingCart(query)
+            if (addRes) {
+              wx.showToast({
+                title: "娣诲姞鎴愬姛",
+                icon: 'success',
+                duration: 1000
+              })
+            }
+            this.getShoppingCartList()
           }
-          this.getShoppingCartList()
+
+        } catch (error) {
+          console.error('鍑洪敊浜嗭細', error)
         }
-      } catch (error) {
-        console.error('鍑洪敊浜嗭細', error)
       }
     }
-
   },
   onMoreGuide(e) {
     let type = e.currentTarget.dataset.info

--
Gitblit v1.9.1