|
|
|
|
@ -58,9 +58,9 @@
|
|
|
|
|
<!--<view class="infoCol"><view class="address"><image mode="heightFix" src="../../static/icon_dizhi.png"></image>苏州·园区星海街188号苏州万怡大酒店南栋大酒店南栋</view></view>-->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<text v-if="item.statusName=='待参加'" @click.stop="cancelActive(item.apply)"> 申请取消 </text>
|
|
|
|
|
<text v-if="item.statusName=='待参加'" @click.stop="showCode(item,item.apply)"> 核销码 </text>
|
|
|
|
|
<text @click.stop="goDetail(item.id)"> 查看 </text>
|
|
|
|
|
<!-- <text v-if="item.state=='unpaid'" class="pay" @click.stop="goPay(item.id)"> 支付 </text> -->
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
@ -149,18 +149,27 @@
|
|
|
|
|
txt: "全部",
|
|
|
|
|
is_used:""
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// state: "unpaid",
|
|
|
|
|
// txt: "待支付"
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
state: "ongoing",
|
|
|
|
|
txt: "待参加",
|
|
|
|
|
is_used:0
|
|
|
|
|
is_used:1
|
|
|
|
|
}, {
|
|
|
|
|
state: "finished",
|
|
|
|
|
txt: "已参加",
|
|
|
|
|
is_used:1
|
|
|
|
|
is_used:3
|
|
|
|
|
}],
|
|
|
|
|
statusNames:[{
|
|
|
|
|
id:0,
|
|
|
|
|
name:'申请取消'
|
|
|
|
|
},{
|
|
|
|
|
id:1,
|
|
|
|
|
name:'待参加'
|
|
|
|
|
},{
|
|
|
|
|
id:2,
|
|
|
|
|
name:'已取消'
|
|
|
|
|
},{
|
|
|
|
|
id:3,
|
|
|
|
|
name:'已参加'
|
|
|
|
|
}],
|
|
|
|
|
user_info: {},
|
|
|
|
|
openid: ""
|
|
|
|
|
@ -207,6 +216,41 @@
|
|
|
|
|
url: "/pages/active/detail?id=" + id
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancelActive(apply){
|
|
|
|
|
var that = this;
|
|
|
|
|
var id = apply[0]['id']
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title:'是否确认取消活动?',
|
|
|
|
|
success:(res)=>{
|
|
|
|
|
if(res.confirm){
|
|
|
|
|
weixin.request({
|
|
|
|
|
api: '/api/member/active-member-canceled',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
id:id
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "申请取消成功"
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
that.list = []
|
|
|
|
|
that.getOrderList(1)
|
|
|
|
|
},
|
|
|
|
|
utilFail: res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else if(res.cancel){
|
|
|
|
|
console.log("dianjiquxiao")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
showCode(item,apply){
|
|
|
|
|
if(apply.length<1){
|
|
|
|
|
return
|
|
|
|
|
@ -251,48 +295,6 @@
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
goPay(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
weixin.request({
|
|
|
|
|
api: '/api/member/order-payment',
|
|
|
|
|
method: 'GET',
|
|
|
|
|
data: {
|
|
|
|
|
order_id: id,
|
|
|
|
|
openid: this.openid
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: res => {
|
|
|
|
|
|
|
|
|
|
weixin.getOpenidInfo(() => {}, true);
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
that.showPop = false;
|
|
|
|
|
}, 100);
|
|
|
|
|
try {
|
|
|
|
|
let payParams = JSON.parse(res.jsApiParameters)
|
|
|
|
|
payParams.provider = 'wxpay'
|
|
|
|
|
payParams.success = result => {
|
|
|
|
|
that.status = "ongoing";
|
|
|
|
|
that.loadData(that.currentPage);
|
|
|
|
|
}
|
|
|
|
|
payParams.fail = result => {
|
|
|
|
|
console.log(result);
|
|
|
|
|
}
|
|
|
|
|
wx.requestPayment(payParams);
|
|
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.log(err)
|
|
|
|
|
} finally {
|
|
|
|
|
// finallyCode - 无论 try / catch 结果如何都会执行的代码块
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
utilFail: res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res
|
|
|
|
|
})
|
|
|
|
|
console.log(res);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getOrderList(page) {
|
|
|
|
|
const userInfo = uni.getStorageSync('userInfo')
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
@ -304,12 +306,12 @@
|
|
|
|
|
page_size: 6,
|
|
|
|
|
token: userInfo.access_token,
|
|
|
|
|
myself:1,
|
|
|
|
|
is_used:this.is_used,
|
|
|
|
|
state:this.is_used,
|
|
|
|
|
}
|
|
|
|
|
if (this.status != "") {
|
|
|
|
|
data = {
|
|
|
|
|
...data,
|
|
|
|
|
state: this.status
|
|
|
|
|
// state: this.status
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -334,7 +336,12 @@
|
|
|
|
|
|
|
|
|
|
for (var m of r.data.data) {
|
|
|
|
|
if(m.apply){
|
|
|
|
|
m.statusName = m.apply[0]['used_time']?'已参加':"待参加"
|
|
|
|
|
for(var s of that.statusNames){
|
|
|
|
|
if(m.apply[0]['state']==s.id){
|
|
|
|
|
m.statusName = s.name
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// m.statusName = m.apply[0]['used_time']?'已参加':"待参加"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -450,7 +457,9 @@
|
|
|
|
|
.status {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #666666;
|
|
|
|
|
color: #666666;
|
|
|
|
|
width: 160rpx;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|