|
@@ -24,7 +24,7 @@ Page({
|
|
group_class: '幼儿组',
|
|
group_class: '幼儿组',
|
|
works_class: '中国画',
|
|
works_class: '中国画',
|
|
author: "",
|
|
author: "",
|
|
- phone: "",
|
|
|
|
|
|
+ phone: wx.getStorageSync('phone') || "",
|
|
schoolClass: "",
|
|
schoolClass: "",
|
|
teacher: "",
|
|
teacher: "",
|
|
teacherPhone: "",
|
|
teacherPhone: "",
|
|
@@ -133,18 +133,10 @@ Page({
|
|
} = this.data;
|
|
} = this.data;
|
|
let baseArea = this.data.multiArray[0][this.data.multiIndex[0]] + this.data.multiArray[1][this.data.multiIndex[1]];
|
|
let baseArea = this.data.multiArray[0][this.data.multiIndex[0]] + this.data.multiArray[1][this.data.multiIndex[1]];
|
|
if (this.data.multiArray[2] && this.data.multiArray[2][this.data.multiIndex[2]]) baseArea += this.data.multiArray[2][this.data.multiIndex[2]]
|
|
if (this.data.multiArray[2] && this.data.multiArray[2][this.data.multiIndex[2]]) baseArea += this.data.multiArray[2][this.data.multiIndex[2]]
|
|
- if (isNaN(teacherPhone) || isNaN(phone)) return wx.showToast({
|
|
|
|
|
|
+ if (isNaN(phone)) return wx.showToast({
|
|
title: '手机号需填入数字',
|
|
title: '手机号需填入数字',
|
|
icon: "none"
|
|
icon: "none"
|
|
})
|
|
})
|
|
- console.log("group_class:", !group_class);
|
|
|
|
- console.log("works_class:", !works_class);
|
|
|
|
- console.log("author:", !author);
|
|
|
|
- console.log("schoolClass:", !schoolClass);
|
|
|
|
- console.log("area:", !area);
|
|
|
|
- console.log("local_image_url:", !local_image_url);
|
|
|
|
- console.log("article:", !article);
|
|
|
|
- console.log("brief:", !brief);
|
|
|
|
if (!group_class || !works_class || !author || !schoolClass || !area || !local_image_url || !article || !brief) return wx.showToast({
|
|
if (!group_class || !works_class || !author || !schoolClass || !area || !local_image_url || !article || !brief) return wx.showToast({
|
|
title: '请输入完整信息',
|
|
title: '请输入完整信息',
|
|
icon: "none"
|
|
icon: "none"
|
|
@@ -167,21 +159,26 @@ Page({
|
|
articleGroup: works_class,
|
|
articleGroup: works_class,
|
|
birthday: group_class,
|
|
birthday: group_class,
|
|
articleName: article,
|
|
articleName: article,
|
|
- articleDescribe: brief
|
|
|
|
|
|
+ articleDescribe: brief,
|
|
|
|
+ phone
|
|
},
|
|
},
|
|
url: base.apiurl + '/article/save',
|
|
url: base.apiurl + '/article/save',
|
|
complete: () => {
|
|
complete: () => {
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
},
|
|
},
|
|
success: res => {
|
|
success: res => {
|
|
- if (res.code === 0) return wx.showToast({
|
|
|
|
- title: '上传成功',
|
|
|
|
|
|
+ if(res.statusCode !== 200) {
|
|
|
|
+ const data = JSON.parse(res.data || "{}")
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: data.message || "保存失败",
|
|
|
|
+ icon: "error"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '报名成功',
|
|
icon: "none"
|
|
icon: "none"
|
|
});
|
|
});
|
|
- else return wx.showToast({
|
|
|
|
- title: res.message || "上传失败",
|
|
|
|
- icon: "error"
|
|
|
|
- });
|
|
|
|
},
|
|
},
|
|
fail() {
|
|
fail() {
|
|
wx.showToast({
|
|
wx.showToast({
|