From 5dc54a59184b305a85aaad31dd4cce01b31a8a2d Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 13 六月 2024 14:58:06 +0800
Subject: [PATCH] 开关泵定版

---
 pages/openCard/openCard.js |   61 ++++++++++++++++++------------
 1 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/pages/openCard/openCard.js b/pages/openCard/openCard.js
index 0942e8c..532d7e1 100644
--- a/pages/openCard/openCard.js
+++ b/pages/openCard/openCard.js
@@ -20,7 +20,7 @@
     if (item.inUse === 0) {
       // 鍦ㄩ〉闈㈠姞杞芥椂鏄剧ず鍔犺浇鍔ㄧ敾
       wx.showLoading({
-        title: '姝e湪寮�娉佃绋嶅悗...', // 鍔犺浇鎻愮ず鏂囧瓧
+        title: '姝e湪寮�娉佃绋嶅��...', // 鍔犺浇鎻愮ず鏂囧瓧
         mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛岄槻姝㈣Е鎽哥┛閫忥紝榛樿涓� false
       });
       this.postOpenValva(item.vcId);
@@ -32,14 +32,13 @@
     const data = {
       intakeId: this.data.intakeId, //鍙栨按鍙D
       vcId: vcId, //铏氭嫙鍗D
-      userType: 2, //鐢ㄦ埛绫诲瀷1-骞冲彴锛�2-App
       operator: app.globalData.sessionId //鎿嶄綔鍛�
     };
     post({
-      url: "comRes/receive",
+      url: "8087/wx/valve/open_wx",
       data: data
     }).then(response => {
-    
+
       // 澶勭悊鎴愬姛鍝嶅簲
       console.log('璇锋眰鎴愬姛:', response);
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
@@ -48,12 +47,19 @@
       wx.reLaunch({
         url: '/pages/home/home?param=true' // 棣栭〉鐨勮矾寰勶紝鏍规嵁瀹為檯鎯呭喌濉啓
       });
-  
+
     }).catch(error => {
       // 鍔犺浇瀹屾垚鍚庨殣钘忓姞杞藉姩鐢�
       wx.hideLoading();
       // 澶勭悊閿欒鍝嶅簲
       console.error('璇锋眰澶辫触:', error);
+      if (error.code === "1002") {
+        wx.showToast({
+          title: '寮�娉靛け璐�',
+          icon: 'error',
+          duration: 3000 // 鎻愮ず鐨勬寔缁椂闂达紝鍗曚綅姣
+        })
+      }
     });
   },
   /**
@@ -67,7 +73,7 @@
       intakeId
     })
     console.log('intakeId:' + this.data.intakeId);
-    this. getCardList();
+    this.getCardList();
   },
 
   /**
@@ -119,24 +125,29 @@
 
   },
   //鑾峰彇铏氭嫙鍗″垪琛�
-  getCardList(){
-    get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
-      operator: getApp().globalData.sessionId
-    }})
-    .then((data) => {
-      if(data.success&&data.code==="0001"){
-        this.setData({
-          allCardPoints:  data.content
-        });
-      }else{
-        wx.showToast({
-          title: data.msg,
-        })
-      }
-      console.log('Failed to add item:');
-    })
-    .catch((error) => {
-      console.error('Failed to add item:', error);
-    });
+  getCardList() {
+    get({
+        url: '8084/sell/virtual_card/get',
+        data: {
+          clientId: getApp().globalData.sessionId
+        }
+      })
+      .then((data) => {
+        if (data.success && data.code === "0001") {
+          this.setData({
+            allCardPoints: data.content
+          });
+        } else {
+          wx.showToast({
+            title: data.msg,
+          })
+        }
+        console.log('Failed to add item:');
+      })
+      .catch((error) => {
+
+
+        console.error('Failed to add item:', error);
+      });
   }
 })
\ No newline at end of file

--
Gitblit v1.8.0