|
@@ -140,11 +140,9 @@ Page({
|
|
|
},
|
|
|
|
|
|
onSubmit: function () {
|
|
|
- console.log(this.data.form);
|
|
|
- console.log(app.globalData.userInfo)
|
|
|
const data = JSON.parse(JSON.stringify(this.data.form))
|
|
|
- if (app.globalData.userInfo.openid) data.openid =app.globalData.userInfo.openid;
|
|
|
- if (this.data.today) data.date = this.data.today
|
|
|
+ if (app.globalData.wxInfo) data.openid = app.globalData.wxInfo.openid;
|
|
|
+ if (this.data.today) data.date = this.data.today;
|
|
|
wx.request({
|
|
|
url: `${app.globalData.publicUrl}/api/st/dining/order`,
|
|
|
method: "post",
|
|
@@ -153,7 +151,12 @@ Page({
|
|
|
},
|
|
|
data,
|
|
|
success: res => {
|
|
|
- console.log(res)
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '完成点餐',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
error: err => {
|
|
|
wx.showToast({
|
|
@@ -162,9 +165,7 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- wx.showToast({
|
|
|
- title: '完成点餐',
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
* 生命周期函数--监听页面加载
|