体温上报功能完成;小程序更新npm依赖版本
This commit is contained in:
@@ -173,7 +173,60 @@ export default {
|
||||
})
|
||||
Taro.hideLoading()
|
||||
},
|
||||
report() {
|
||||
console.log("点击提交", "this.formData", this.formData)
|
||||
|
||||
Taro.showLoading({ title: '加载中' })
|
||||
var that = this;
|
||||
Taro.request({
|
||||
url: `${this.baseUrl}/access/report/submit`,
|
||||
method: "POST",
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||
},
|
||||
data: {
|
||||
...this.formData,
|
||||
},
|
||||
success: function (d) {
|
||||
that.debugMode && console.log("begin success")
|
||||
Taro.hideLoading()
|
||||
let result = d.data;
|
||||
if (result.success) {
|
||||
console.log("result.data", result.data);
|
||||
Taro.showToast({
|
||||
title: "填报成功",
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: result.msg,
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
that.isShow = ''
|
||||
that.debugMode && console.log("end success")
|
||||
},
|
||||
fail: function () {
|
||||
that.debugMode && console.log("begin fail")
|
||||
Taro.hideLoading()
|
||||
Taro.showToast({
|
||||
title: "请求失败",
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
that.debugMode && console.log("end fail")
|
||||
},
|
||||
complete: function () {
|
||||
that.debugMode && console.log("begin complete")
|
||||
if (typeof (callback) === "function")
|
||||
callback();
|
||||
Taro.hideNavigationBarLoading();
|
||||
that.debugMode && console.log("end complete")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user