...
|
...
|
@@ -11,12 +11,13 @@ Page({ |
|
|
tabcurrent: {tab: 3, bubble: ''},
|
|
|
is_showAnswer: false,
|
|
|
is_showUserInfo: false,
|
|
|
is_showResult:false,
|
|
|
is_answer: true,
|
|
|
is_write: 0,//1:已填写,2:未填写
|
|
|
},
|
|
|
//关闭金火柴勋章弹框
|
|
|
close() {
|
|
|
this.setData({show_gold_modal:false,show_normal_modal:false});
|
|
|
this.setData({show_gold_modal:false,show_normal_modal:false,is_showResult:false});
|
|
|
try {
|
|
|
wx.removeStorageSync('score');
|
|
|
console.log('删除后score',wx.getStorageSync('score'));
|
...
|
...
|
@@ -24,10 +25,75 @@ Page({ |
|
|
// Do something when catch error
|
|
|
}
|
|
|
},
|
|
|
delete(e) {
|
|
|
const self = this;
|
|
|
const id = e.currentTarget.dataset.id;
|
|
|
const type = +e.currentTarget.dataset.type;
|
|
|
const status = +e.currentTarget.dataset.status;
|
|
|
if(type === 1 && (status === 5 || status === 6 || status === 7 || status === 10 || status === 11)) { //发起人
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除吗?',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
console.log('用户点击确定');
|
|
|
let url = '/portal/Order/del';
|
|
|
let params = {
|
|
|
token: wx.getStorageSync('token'),
|
|
|
orderId: id,
|
|
|
};
|
|
|
let header = {
|
|
|
"token": wx.getStorageSync('token')
|
|
|
};
|
|
|
app.post(url, params, {}).then((res) => {
|
|
|
console.log('删除', res);
|
|
|
if (+res.code === 1) {
|
|
|
wx.showToast({title:res.message,icon:'none'});
|
|
|
self.getOrderList();
|
|
|
}else {
|
|
|
wx.showToast({title:res.message,icon:'none'})
|
|
|
}
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}else if(type === 2 && (status === 5 || status === 6 || status === 7 || status === 10 || status === 11)) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除吗?',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
console.log('用户点击确定');
|
|
|
let url = '/portal/Order/del';
|
|
|
let params = {
|
|
|
token: wx.getStorageSync('token'),
|
|
|
orderId: id,
|
|
|
};
|
|
|
let header = {
|
|
|
"token": wx.getStorageSync('token')
|
|
|
};
|
|
|
app.post(url, params, {}).then((res) => {
|
|
|
console.log('删除', res);
|
|
|
if (+res.code === 1) {
|
|
|
wx.showToast({title:res.message,icon:'none'});
|
|
|
self.getOrderList();
|
|
|
}else {
|
|
|
wx.showToast({title:res.message,icon:'none'})
|
|
|
}
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
//删除
|
|
|
del(e) {
|
|
|
const self = this;
|
|
|
const id = e.currentTarget.dataset.id;
|
|
|
const id = +e.currentTarget.dataset.id;
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除吗?',
|
...
|
...
|
@@ -147,7 +213,7 @@ Page({ |
|
|
},
|
|
|
handleBackground() {
|
|
|
console.log('dianji');
|
|
|
this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,})
|
|
|
this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,is_showResult:false})
|
|
|
},
|
|
|
//首页-导航
|
|
|
service(e) {
|
...
|
...
|
@@ -212,7 +278,10 @@ Page({ |
|
|
is_showRelease: true //弹出 去答题弹框
|
|
|
});
|
|
|
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
|
|
|
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
|
|
|
// wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'});
|
|
|
self.setData({
|
|
|
is_showResult: true //弹出 提示框
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
},
|
...
|
...
|
|