liyongli пре 1 година
родитељ
комит
7700d2bed6
5 измењених фајлова са 27 додато и 42 уклоњено
  1. 24 1
      pages/expert/index.js
  2. 1 2
      pages/expert/index.json
  3. 2 9
      pages/expert/index.wxml
  4. 0 28
      pages/expert/index.wxss
  5. 0 2
      pages/userData/index.json

+ 24 - 1
pages/expert/index.js

@@ -19,7 +19,30 @@ Page({
       urls: [e.currentTarget.dataset.url],
     })
   },
-
+  onChange(e) {
+    const {
+      list
+    } = this.data;
+    const item = list[e.currentTarget.dataset.index];
+    ajax({
+      urlType: "apiurl",
+      api: "/article/audit",
+      method: "post",
+      data: {
+        articleId: e.currentTarget.dataset.id,
+        ok: e.detail
+      }
+    }).then(res => {
+      if (res.code !== 0) return wx.showToast({
+        title: res.message || '网络波动',
+        icon: "none"
+      })
+      item.auditType = e.detail ? "ExpertReview" : "ExpertReject";
+      this.setData({
+        list
+      })
+    })
+  },
   getData() {
     ajax({
       urlType: "apiurl",

+ 1 - 2
pages/expert/index.json

@@ -2,7 +2,6 @@
   "navigationBarTitleText": "专家评审",
   "usingComponents": {
     "Container": "../../component/container/index",
-    "van-row": "@vant/weapp/row/index",
-    "van-col": "@vant/weapp/col/index"
+    "van-checkbox": "@vant/weapp/checkbox/index"
   }
 }

+ 2 - 9
pages/expert/index.wxml

@@ -10,15 +10,8 @@
           <view>指导老师:{{item.teacher}}</view>
           <view>组别:{{item.articleGroup}}</view>
           <view>作品名称:{{item.articleName}}</view>
-          <view>作品简介:{{item.articleDescribe}}</view>
-          <view class="zuopin_gongju_tool">
-            <view class="zuopin_gongju_item">
-              <view class="zuopin_gongju_btn zuopin_gongju_btn_err">晋级</view>
-            </view>
-            <view class="zuopin_gongju_item">
-              <view class="zuopin_gongju_btn">未晋级</view>
-            </view>
-          </view>
+          <view style="margin-bottom: 15rpx;">作品简介:{{item.articleDescribe}}</view>
+          <van-checkbox shape="square" checked-color="#91725D" bind:change="onChange" value="{{item.auditType === 'ExpertReview'}}" data-index="{{index}}" data-id="{{item.id}}">晋级</van-checkbox>
         </view>
       </view>
     </Container>

+ 0 - 28
pages/expert/index.wxss

@@ -18,32 +18,4 @@
 .col {
   flex: 1;
   padding: 0 10rpx;
-}
-
-
-.zuopin_gongju_tool {
-  display: flex;
-}
-
-.zuopin_gongju_item {
-  flex: 1;
-  text-align: center;
-  padding: 1em 0 0 0;
-}
-
-.zuopin_gongju_btn {
-  color: #000;
-  height: 64rpx;
-  line-height: 64rpx;
-  width: 6em;
-  margin: 0 auto;
-  border: 1px solid #eee;
-  border-radius: 2em;
-  background-color: #eee;
-}
-
-.zuopin_gongju_btn_err {
-  background-color: #ee0a24;
-  border-color: #ee0a24;
-  color: #fff;
 }

+ 0 - 2
pages/userData/index.json

@@ -2,10 +2,8 @@
   "navigationBarTitleText": "报名信息",
   "usingComponents": {
     "Container": "../../component/container/index",
-    "van-row": "@vant/weapp/row/index",
     "van-icon": "@vant/weapp/icon/index",
     "van-search": "@vant/weapp/search/index",
-    "van-col": "@vant/weapp/col/index",
     "van-empty": "@vant/weapp/empty/index"
   }
 }