|
|
|
|
@ -8,41 +8,83 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="end-cont" :class="{dis:btnnum == 0}">
|
|
|
|
|
<view class="statusBox">
|
|
|
|
|
<text v-for="(item,index) in statusLabels" :key="index" @click="changeStatus(item.state)"
|
|
|
|
|
<text v-for="(item,index) in statusLabels" :key="index" @click="changeStatus(item.state,item.is_used)"
|
|
|
|
|
:class="{cur: item.state == status}">{{item.txt}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="height:120rpx;"></view>
|
|
|
|
|
<view v-if="list.length>0">
|
|
|
|
|
<view class="orderCol" v-for="(item, index) in list" :key="item.id" @click="goDetail(item.id)">
|
|
|
|
|
<view class="orderNo">
|
|
|
|
|
<!-- <view class="orderNo">
|
|
|
|
|
<text>订单编号:</text><text>{{item.serial}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
<view class="title">
|
|
|
|
|
<view>{{item.order_name || '暂无'}}<!-- <text class="free">免费</text> -->
|
|
|
|
|
<view>{{item.active_name || '暂无'}}<!-- <text class="free">免费</text> -->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="status">{{item.statusName}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="infoList">
|
|
|
|
|
<view class="infoCol">
|
|
|
|
|
<view class="date">
|
|
|
|
|
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
|
|
|
|
|
{{timeFormat(item.created_at, 'yyyy年mm月dd日')}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="price"><text>¥</text>{{item.total}}</view>
|
|
|
|
|
<view class="status">
|
|
|
|
|
{{item.statusName}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="infoList">
|
|
|
|
|
<u-row gutter="16" class="infoCol">
|
|
|
|
|
<u-col span="4">
|
|
|
|
|
<view class="date">
|
|
|
|
|
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
|
|
|
|
|
开始时间:
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col span="8" v-if="item.start_date">
|
|
|
|
|
<view>{{item.start_date}} {{item.start_time}}</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col span="4">
|
|
|
|
|
<view class="date">
|
|
|
|
|
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
|
|
|
|
|
结束时间:
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col span="8" v-if="item.start_date">
|
|
|
|
|
<view>{{item.end_date}} {{item.end_time}}</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col span="4">
|
|
|
|
|
<view class="date">
|
|
|
|
|
<image mode="heightFix" src="../../static/icon_dizhi.png"></image>
|
|
|
|
|
活动地点:
|
|
|
|
|
</view>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col span="8" v-if="item.address">
|
|
|
|
|
{{item.address}}
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
|
|
|
|
|
<!--<view class="infoCol"><view class="address"><image mode="heightFix" src="../../static/icon_dizhi.png"></image>苏州·园区星海街188号苏州万怡大酒店南栋大酒店南栋</view></view>-->
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<text v-if="item.statusName=='待参加'" @click.stop="showCode(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>
|
|
|
|
|
<!-- <text v-if="item.state=='unpaid'" class="pay" @click.stop="goPay(item.id)"> 支付 </text> -->
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else>
|
|
|
|
|
<view class="info-none"> {{list.length>0?"":"暂无数据"}} </view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<u-popup class="codepop" v-model="showCodes" mode="center" closeable="true">
|
|
|
|
|
<view class="userBox" style="padding:0 120rpx 60rpx 120rpx;">
|
|
|
|
|
<view class="userInfoContent" style="padding: 40rpx;font-size: 28rpx;">
|
|
|
|
|
<text class="">核销码:{{codetext}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="qrcode">
|
|
|
|
|
<canvas canvas-id='qrcode' style="width: 170px;height:170px;margin: 0 auto;">
|
|
|
|
|
|
|
|
|
|
</canvas>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
<view class="end-cont" :class="{dis:btnnum == 1}">
|
|
|
|
|
<view class="statusBox">
|
|
|
|
|
<text>待付款</text>
|
|
|
|
|
@ -77,7 +119,8 @@
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
weixin
|
|
|
|
|
} from '../../utils/weixin.js';
|
|
|
|
|
} from '../../utils/weixin.js';
|
|
|
|
|
import uQRCode from "@/utils/qrcode.js"
|
|
|
|
|
//{"0":"待确认","10":"待支付","20":"进行中","100":"已完成"}
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
@ -91,10 +134,15 @@
|
|
|
|
|
token: '',
|
|
|
|
|
page: 1,
|
|
|
|
|
list: [],
|
|
|
|
|
status: "",
|
|
|
|
|
status: "",
|
|
|
|
|
is_used:"",
|
|
|
|
|
showview:false,
|
|
|
|
|
showCodes:false,
|
|
|
|
|
codetext:"",
|
|
|
|
|
statusLabels: [{
|
|
|
|
|
state: "",
|
|
|
|
|
txt: "全部"
|
|
|
|
|
txt: "全部",
|
|
|
|
|
is_used:""
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// state: "unpaid",
|
|
|
|
|
@ -102,10 +150,12 @@
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
state: "ongoing",
|
|
|
|
|
txt: "待参加"
|
|
|
|
|
txt: "待参加",
|
|
|
|
|
is_used:0
|
|
|
|
|
}, {
|
|
|
|
|
state: "finished",
|
|
|
|
|
txt: "已参加"
|
|
|
|
|
txt: "已参加",
|
|
|
|
|
is_used:1
|
|
|
|
|
}],
|
|
|
|
|
user_info: {},
|
|
|
|
|
openid: ""
|
|
|
|
|
@ -117,7 +167,12 @@
|
|
|
|
|
this.token = userInfo.access_token;
|
|
|
|
|
var that = this;
|
|
|
|
|
if (!weixin.isNull(options.status))
|
|
|
|
|
this.status = options.status
|
|
|
|
|
this.status = options.status
|
|
|
|
|
for(var k of this.statusLabels){
|
|
|
|
|
if(k.state==options.status){
|
|
|
|
|
this.is_used = k.is_used
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
weixin.getOpenidInfo(info => {
|
|
|
|
|
that.user_info = info.user_info
|
|
|
|
|
}, false)
|
|
|
|
|
@ -130,12 +185,10 @@
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
this.getOrderList(this.page + 1)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
timeFormat(time,format){
|
|
|
|
|
//this.util.
|
|
|
|
|
},
|
|
|
|
|
changeStatus(status) {
|
|
|
|
|
this.status = status
|
|
|
|
|
methods: {
|
|
|
|
|
changeStatus(status,used) {
|
|
|
|
|
this.status = status
|
|
|
|
|
this.is_used = used
|
|
|
|
|
this.list = []
|
|
|
|
|
this.getOrderList(1)
|
|
|
|
|
},
|
|
|
|
|
@ -146,8 +199,47 @@
|
|
|
|
|
},
|
|
|
|
|
goDetail(id) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: "../orderPackageDetail/orderPackageDetail?id=" + id
|
|
|
|
|
url: "/pages/active/detail?id=" + id
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
showCode(apply){
|
|
|
|
|
if(apply.length<1){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let text = "1234"
|
|
|
|
|
for(var k of apply){
|
|
|
|
|
text = k.code
|
|
|
|
|
}
|
|
|
|
|
if(!text){
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '',
|
|
|
|
|
content: "暂无核销码",
|
|
|
|
|
showCancel: false
|
|
|
|
|
});
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.codetext = text
|
|
|
|
|
console.log("text",text)
|
|
|
|
|
var id = "qrcode";
|
|
|
|
|
// if (qrcode) {
|
|
|
|
|
// id = qrcode
|
|
|
|
|
// }
|
|
|
|
|
this.showCodes = true
|
|
|
|
|
uQRCode.make({
|
|
|
|
|
canvasId: id,
|
|
|
|
|
componentInstance: this,
|
|
|
|
|
text: text,
|
|
|
|
|
size: 170,
|
|
|
|
|
// margin: 10,
|
|
|
|
|
backgroundColor: '#ffffff',
|
|
|
|
|
foregroundColor: '#000000',
|
|
|
|
|
fileType: 'jpg',
|
|
|
|
|
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
|
|
|
|
|
success: res => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
goPay(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
@ -200,7 +292,9 @@
|
|
|
|
|
var data = {
|
|
|
|
|
page: page,
|
|
|
|
|
page_size: 6,
|
|
|
|
|
token: userInfo.access_token
|
|
|
|
|
token: userInfo.access_token,
|
|
|
|
|
myself:1,
|
|
|
|
|
is_used:this.is_used,
|
|
|
|
|
}
|
|
|
|
|
if (this.status != "") {
|
|
|
|
|
data = {
|
|
|
|
|
@ -210,7 +304,7 @@
|
|
|
|
|
}
|
|
|
|
|
var that = this;
|
|
|
|
|
uni.request({
|
|
|
|
|
url: this.baseUrl + '/api/member/get-orders',
|
|
|
|
|
url: this.baseUrl + '/api/member/active-list',
|
|
|
|
|
method: 'GET',
|
|
|
|
|
data: data,
|
|
|
|
|
success: r => {
|
|
|
|
|
@ -227,13 +321,12 @@
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var m of r.data.data) {
|
|
|
|
|
var mod = this.statusLabels.filter((p) => {
|
|
|
|
|
return p.state == m.state;
|
|
|
|
|
})[0];
|
|
|
|
|
if (mod)
|
|
|
|
|
m.statusName = mod.txt;
|
|
|
|
|
if(m.apply){
|
|
|
|
|
m.statusName = m.apply[0]['used_time']?'已参加':"待参加"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.list = this.list.concat(r.data.data);
|
|
|
|
|
this.page = page;
|
|
|
|
|
|