liyongli 1 year ago
parent
commit
a78e9f6e5e
2 changed files with 15 additions and 3 deletions
  1. 13 1
      pages/application/index.js
  2. 2 2
      pages/application/index.wxml

+ 13 - 1
pages/application/index.js

@@ -117,6 +117,16 @@ Page({
       multiArray: [multiArray0, multiArray1, multiArray2]
     })
   },
+  onChange(e) {
+    this.setData({
+      group_class: e.detail
+    })
+  },
+  onChangeWorks(e) {
+    this.setData({
+      works_class: e.detail
+    })
+  },
   updata() {
     const {
       group_class,
@@ -148,6 +158,7 @@ Page({
     })
     wx.showLoading({
       title: '加载中',
+      mask: true
     })
     wx.uploadFile({
       filePath: local_image_url,
@@ -168,10 +179,11 @@ Page({
         phone
       },
       url: base.apiurl + '/article/save',
-      complete: () => {
+      fail: () => {
         wx.hideLoading()
       },
       success: res => {
+        wx.hideLoading()
         if (res.statusCode !== 200) {
           const data = JSON.parse(res.data || "{}")
           wx.showToast({

+ 2 - 2
pages/application/index.wxml

@@ -28,7 +28,7 @@
         <textarea class="top_input" style="height: 5em;" value="{{area}}" bindinput="change" data-key="area" placeholder="请输入地址" />
         <view class="top_label">组别*</view>
         <view class="top_input" style="background-color: #ffffff00;height: auto;">
-          <van-radio-group value="{{ group_class }}">
+          <van-radio-group value="{{ group_class }}" bind:change="onChange">
             <van-radio name="幼儿组" checked-color="#91725D">幼儿组(6岁以下)</van-radio>
             <van-radio name="儿童组" checked-color="#91725D">儿童组(7-10岁)</van-radio>
             <van-radio name="少儿组" checked-color="#91725D">少儿组(11-14岁)</van-radio>
@@ -38,7 +38,7 @@
         </view>
         <view class="top_label">作品类别*</view>
         <view class="top_input" style="background-color: #ffffff00;height: auto;">
-          <van-radio-group value="{{ works_class }}">
+          <van-radio-group value="{{ works_class }}" bind:change="onChangeWorks">
             <van-radio name="中国画" checked-color="#91725D">中国画</van-radio>
             <van-radio name="西洋画" checked-color="#91725D">西洋画</van-radio>
             <van-radio name="书法" checked-color="#91725D">书法</van-radio>