From 0f51940bc899827f84019d2c0c165b23014d8eca Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 08 八月 2022 17:50:09 +0800
Subject: [PATCH] 承诺书和智能咨询模块

---
 pages/promisefile/promisefile.js |   43 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/pages/promisefile/promisefile.js b/pages/promisefile/promisefile.js
index 8340c6d..8b8a565 100644
--- a/pages/promisefile/promisefile.js
+++ b/pages/promisefile/promisefile.js
@@ -74,25 +74,56 @@
   },
 
   onSubmit: function () {
-    wx.setStorage({
-      key: "promise",
-      data: true,
-    })
+    // wx.setStorage({
+    //   key: "promise",
+    //   data: true,
+    // })
     // wx.navigateTo({
     //   url: '/pages/promiseresult/promiseresult',
     // })
+    wx.showLoading({
+      title: '鎵胯涔︾敓鎴愪腑',
+      mask: true,
+      success: (res) => {},
+      fail: (res) => {},
+      complete: (res) => {},
+    })
+    setTimeout(() => {
+      wx.hideLoading()
+    }, 20000);
 
     let signPic = this.data.imgFiles[0]
 
     promiseservice.createCommitment(app.globalData.accessToken.userId, this.commitmentVo, signPic, {
       success(data) {
-        console.log(data);
+        if (data.data.success) {
+          wx.navigateTo({
+            url: '/pages/promiseresult/promiseresult',
+            success: function (res) {
+              // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+              res.eventChannel.emit('acceptDataFromOpenerPage', {
+                promise: {
+                  picPath: data.data[0],
+                  pdfPath: data.data[1],
+                }
+              })
+            }
+          }) 
+        }
       },
       fail(res) {
-        console.log(res);
       },
       complete(res) {
         console.log(res);
+        wx.hideLoading({
+          success: (res) => {
+            wx.showToast({
+              title: '鐢熸垚瀹屾垚',
+              duration: 1500,
+              icon: 'success',
+            })
+          },
+        })
       }
     })
 

--
Gitblit v1.9.3