From a81a1a31ce7ee003e0006168e4d4e57da97c2bb6 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 05 三月 2024 18:46:46 +0800
Subject: [PATCH] 个人中心

---
 pages/personalCenter/feedBackSubmit/index.js |   88 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 81 insertions(+), 7 deletions(-)

diff --git a/pages/personalCenter/feedBackSubmit/index.js b/pages/personalCenter/feedBackSubmit/index.js
index fe4eb7e..0762189 100644
--- a/pages/personalCenter/feedBackSubmit/index.js
+++ b/pages/personalCenter/feedBackSubmit/index.js
@@ -1,11 +1,15 @@
 // pages/personalCenter/feedBackSubmit/index.js
+const app = getApp();
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-
+    userName: "",
+    mannder: "",
+    content: "",
+    lock: true,
   },
 
   /**
@@ -26,7 +30,6 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-
   },
 
   /**
@@ -56,11 +59,82 @@
   onReachBottom() {
 
   },
+  bindTnputBlur: function (e) {
+    this.setData({
+      userName: e.detail.value,
+    });
+  },
+  bindTnputBlur1: function (e) {
+    this.setData({
+      mannder: e.detail.value,
+    });
+  },
+  bindTextAreaBlur: function (e) {
+    this.setData({
+      content: e.detail.value,
+    });
+  },
 
-  /**
-   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
-   */
-  onShareAppMessage() {
-
+  submit() {
+    if (this.data.lock) {
+      this.data.lock = false;
+      if (this.data.userName) {
+        if (this.data.mannder) {
+          if (this.data.content) {
+            let submitData = {
+              content: this.data.content,
+              name: this.data.userName,
+              email: "",
+              phone: this.data.mannder
+            };
+            var data = {
+              topicIdOrRefCode: "feedback",
+              name: "鎰忚鍙嶉",
+              content: JSON.stringify(submitData),
+              type: "opinionFeedback",
+              state: "WaitAudit",
+              cmsTypeRefCode: "",
+              newDataListRequest: []
+            };
+            app.MG.ugc.newTopicMessage(data).then(res => {
+              this.data.lock = true;
+              if (res) {
+                wx.showToast({
+                  title: "鎻愪氦鎴愬姛",
+                  icon: 'success',
+                  duration: 1000,
+                  success: function () {
+                    setTimeout(function () {
+                      wx.navigateBack();
+                    }, 1000) //寤惰繜鏃堕棿
+                  }
+                })
+              }
+            });
+          } else {
+            this.data.lock = true;
+            wx.showToast({
+              title: "鍙嶉鍐呭涓嶈兘涓虹┖",
+              icon: 'none',
+              duration: 1000
+            })
+          }
+        } else {
+          this.data.lock = true;
+          wx.showToast({
+            title: "鑱旂郴鏂瑰紡涓嶈兘涓虹┖",
+            icon: 'none',
+            duration: 1000
+          })
+        }
+      } else {
+        this.data.lock = true;
+        wx.showToast({
+          title: "鑱旂郴浜轰笉鑳戒负绌轰笉鑳戒负绌�",
+          icon: 'none',
+          duration: 1000
+        })
+      }
+    }
   }
 })
\ No newline at end of file

--
Gitblit v1.9.1