From 4e44bc1fd7806a6c1611302120882b91d96640b5 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Mon, 27 Apr 2020 17:50:19 +0800
Subject: [PATCH] bug修复

---
 SunshineLnsMinApp/pages/createSub/createSub.js |   61 +++++++++---------------------
 1 files changed, 19 insertions(+), 42 deletions(-)

diff --git a/SunshineLnsMinApp/pages/createSub/createSub.js b/SunshineLnsMinApp/pages/createSub/createSub.js
index 0d1a906..5df15cc 100644
--- a/SunshineLnsMinApp/pages/createSub/createSub.js
+++ b/SunshineLnsMinApp/pages/createSub/createSub.js
@@ -11,7 +11,8 @@
     confirm: true,
     value1: '',
     answer: [],
-    id: ''
+    id: '',
+    disabled: false
   },
   // 去单选页面
   toRadio(e) {
@@ -132,6 +133,9 @@
     var that = this;
     wx.request({
       url: app.globalData.url + '/api/question/find/' + id,
+      data: {
+        userId: wx.getStorageSync("user").id
+      },
       success: function(res) {
         console.log(res)
         if (res.data.code == 0) {
@@ -141,52 +145,25 @@
             [_m]: {
               "paper": {
                 "title": res.data.data.title,
-                "des": res.data.data.content
+                "des": res.data.data.content || ''
               },
               "psqList": res.data.data.questionDtos
-              // "psqList": [{
-              //   "isMust": 1,
-              //   "type": 1,
-              //   "question": "111",
-              //   "answerslist": [{
-              //     "answer": "11"
-              //   }, {
-              //     "answer": "111"
-              //   }, {
-              //     "answer": "11"
-              //   }, {
-              //     "answer": "111"
-              //   }],
-              //   'value': []
-              // }, {
-              //   "isMust": 1,
-              //   "type": 1,
-              //   "question": "11111",
-              //   "answerslist": [{
-              //     "answer": "111"
-              //   }, {
-              //     "answer": "111"
-              //   }],
-              //   value: []
-              // }, {
-              //   "isMust": 1,
-              //   "type": 0,
-              //   "question": "11111"
-              // }, {
-              //   "isMust": 0,
-              //   "type": 1,
-              //   "question": "wqwqw",
-              //   "answerslist": [{
-              //     "answer": "qw"
-              //   }, {
-              //     "answer": "wqw"
-              //   }, {
-              //     "answer": "wqw"
-              //   }]
-              // }]
             }
 
           });
+        } else if (res.data.code == 3) {
+          that.setData({
+            id: res.data.data.id,
+            [_m]: {
+              "paper": {
+                "title": res.data.data.title,
+                "des": res.data.data.content || ''
+              },
+              "psqList": res.data.data.questionDtos
+            },
+            disabled: true
+
+          });
         } else {
           wx.showModal({
             title: '提示',

--
Gitblit v1.8.0