梁沛聪 6 роки тому
джерело
коміт
b1c43255ee

+ 6
- 4
miniapp/app/pages/addComment/index.js Переглянути файл

@@ -6,8 +6,10 @@ new $.Page({
6 6
     },
7 7
     onLoad(e) {
8 8
         const id = e.id || '';
9
+        const type = e.type || '';
9 10
         this.setData({
10
-            id
11
+            id,
12
+            type
11 13
         });
12 14
     },
13 15
     inputComment(e) {
@@ -18,6 +20,7 @@ new $.Page({
18 20
     submit() {
19 21
         const {
20 22
             id,
23
+            type,
21 24
             comment
22 25
         } = this.data;
23 26
         if (!id) return;
@@ -29,9 +32,8 @@ new $.Page({
29 32
         $.wx.showToast({
30 33
             title: '加载中'
31 34
         }, 'loading');
32
-        $.request('systemController/feedback', 'POST', {
33
-            comment,
34
-            id
35
+        $.request(`${type}/${id}/comment`, 'POST', {
36
+            content: comment
35 37
         }).then(res => {
36 38
             $.wx.showToast({
37 39
                 title: '提交成功'

+ 1
- 1
miniapp/app/pages/introduce/index.js Переглянути файл

@@ -7,7 +7,7 @@ new $.Page({
7 7
         const name = options.name || '';
8 8
         if (id) {
9 9
             $.request(`server_info/${id}`, 'GET', {}, true).then((res) => {
10
-                var article = res.data.content || '';
10
+                var article = res.data && res.data.content || '';
11 11
                 /**
12 12
                  * WxParse.wxParse(bindName , type, data, target,imagePadding)
13 13
                  * 1.bindName绑定的数据名(必填)

+ 7
- 2
miniapp/app/pages/order/index.js Переглянути файл

@@ -77,11 +77,16 @@ new $.Page({
77 77
     },
78 78
     addComment(e) {
79 79
         const {
80
-            id
80
+            id,
81
+            type
81 82
         } = e.target.dataset;
82 83
         if (id) {
83 84
             $.router.goto({
84
-                path: '/pages/addComment/index'
85
+                path: '/pages/addComment/index',
86
+                query: {
87
+                    id,
88
+                    type
89
+                }
85 90
             });
86 91
         }
87 92
     }

+ 6
- 3
miniapp/app/pages/order/index.wxml Переглянути файл

@@ -15,8 +15,10 @@
15 15
                     <view class="right">
16 16
                         <view class="text-top">{{item.orderText}}</view>
17 17
                         <view class="text-bottom" wx:if="{{item.status != 0}}">¥{{item.price}}</view>
18
-                        <view class="btn-blue" bindtap="toPay" data-id="{{item.id}}" data-type="{{item.order_type}}" wx:if="{{item.status == 1}}">立即付款</view>
19
-                        <view class="btn-blue" bindtap="addComment" data-id="{{item.id}}" wx:if="{{item.status == 2 && !item.comment}}">添加评价</view>
18
+                        <view class="btn-blue" bindtap="toPay" data-id="{{item.id}}" data-type="{{item.order_type}}"
19
+                            wx:if="{{item.status == 1}}">立即付款</view>
20
+                        <view class="btn-blue" bindtap="addComment" data-id="{{item.id}}" data-type="{{item.order_type}}"
21
+                            wx:if="{{item.status == 2 && !item.comment}}">添加评价</view>
20 22
                     </view>
21 23
                 </view>
22 24
                 <!-- <view class="cell">
@@ -49,7 +51,8 @@
49 51
                     <view class="right">
50 52
                         <view class="text-top">{{item.orderText}}</view>
51 53
                         <view class="text-bottom">¥{{item.price}}</view>
52
-                        <view class="btn-blue" bindtap="toPay" data-id="{{item.id}}" data-type="{{item.order_type}}" wx:if="{{item.status == 0}}">立即付款</view>
54
+                        <view class="btn-blue" bindtap="toPay" data-id="{{item.id}}" data-type="{{item.order_type}}"
55
+                            wx:if="{{item.status == 0}}">立即付款</view>
53 56
                     </view>
54 57
                 </view>
55 58
             </view>

Loading…
Відмінити
Зберегти