You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhishifufei_uniapp/pages/my/sign_order.vue

145 lines
3.3 KiB

10 months ago
<template>
<BaseContainer class="sign-list">
<NavBar title="报名核销" />
<view class="activity-verify" v-if="order.id">
<view class="two" @click="activityDetails(activity.id)">
<view>
<image :src="activity.image" />
</view>
<view>
<view v-text="activity.title"></view>
<view>
<span>{{ activity.price }}</span>
</view>
</view>
</view>
<view class="four">
<view>订单信息</view>
<view>
<view v-for="item in userInfo" :key="item.id">
<view>{{ item.event_name }}</view>
<view>{{ item.event_value }}</view>
</view>
<view>
<view>人数</view>
<view>{{ order.number }}</view>
</view>
<view>
<view>订单编号</view>
<view>{{ order_id }}</view>
</view>
<view>
<view>支付时间</view>
<view>{{ order.pay_time }}</view>
</view>
<view>
<view>支付金额</view>
<view>{{ order.pay_price }}</view>
</view>
</view>
</view>
<view class="five">
<button class="flex flex-center" type="button" @click="verify">
确认核销
</button>
</view>
</view>
</BaseContainer>
</template>
<script>
import {
getOrderStatus,
getWriteOffSignin,
scanCodeSignin,
} from "@/api/activity";
export default {
data() {
return {
order: {},
activity: {},
order_id: "",
type: 2,
status: 0,
userInfo: [],
writestatus:0
};
},
onLoad({ type, order_id ,scene}) {
const parmData = this.$util.parseScene(scene)
this.order_id = order_id ?? parmData.oid;
if(this.order_id.indexOf('su') != -1){
this.writestatus = 1
}else{
this.writestatus = 2
}
this.type = type ?? parmData.type;
this.getActivitySign();
this.flag = setInterval(this.orderStatus, 60000);
},
onUnload() {
clearInterval(this.flag);
},
methods: {
orderStatus() {
getOrderStatus(this.order_id).then(({ data }) => {
if (data == 1) {
uni.navigateTo({
url: "/pages/my/sign_list",
});
}
});
},
async getActivitySign() {
uni.showLoading({ mask: true });
try {
const { data } = await getWriteOffSignin(this.order_id,this.writestatus);
uni.hideLoading();
this.order = data;
this.activity = data.activity;
this.userInfo = JSON.parse(data.user_info);
} catch (err) {
uni.hideLoading();
this.$util.showMsg(err.msg);
}
},
activityDetails(id) {
uni.navigateTo({
url: "/pages/activity/index?id=" + id,
});
},
async verify() {
uni.showLoading({ mask: true });
try {
const { msg } = await scanCodeSignin(this.order_id);
uni.hideLoading();
this.$util.showMsg(msg);
setTimeout(() => {
uni.redirectTo({
url: "/pages/my/verify_activity",
});
}, 500);
} catch (err) {
uni.hideLoading();
this.$util.showMsg(err.msg);
}
},
},
};
</script>
<style>
page {
background: #f5f5f5;
}
</style>
<style scoped lang="scss">
.activity-verify {
padding-top: 70rpx;
}
</style>