|
@@ -20,10 +20,22 @@ Page({
|
|
|
]
|
|
|
},
|
|
|
onChange(event) {
|
|
|
- console.log(event);
|
|
|
- console.log(event.detail);
|
|
|
this.setData({ activeName: Number(event.detail) });
|
|
|
},
|
|
|
+ detail: function (data) {
|
|
|
+ const { id, label, isuse } = data.currentTarget.dataset;
|
|
|
+ if (isuse == '0') {
|
|
|
+ wx.showToast({ title: '待使用' })
|
|
|
+ } else if (isuse == '1') {
|
|
|
+ wx.showToast({ title: '待评价', })
|
|
|
+ } else if (isuse == '2') {
|
|
|
+ wx.showToast({ title: '已完成' })
|
|
|
+ } else if (isuse == '3') {
|
|
|
+ wx.showToast({ title: '已失效' })
|
|
|
+ } else {
|
|
|
+ wx.showToast({ title: '未订餐' })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 返回
|
|
|
back: function () {
|
|
|
wx.switchTab({
|
|
@@ -34,18 +46,15 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- if (!options.openid) {
|
|
|
+ if (options.openid) {
|
|
|
wx.request({
|
|
|
url: `${app.globalData.publicUrl}/api/st/dining/order?openid=${'oDiAy5JAhb2ReM-LwmqbTCx5OteA'}`,
|
|
|
method: "get",
|
|
|
header: { 'x-tenant': app.globalData.tenant },
|
|
|
data: {},
|
|
|
success: res => {
|
|
|
- console.log(res);
|
|
|
const { data } = res.data;
|
|
|
- this.setData({
|
|
|
- list: data
|
|
|
- })
|
|
|
+ this.setData({ list: data })
|
|
|
},
|
|
|
error: err => {
|
|
|
wx.showToast({
|