Browse Source

add ym write off

organize
刘嘉炜 4 years ago
parent
commit
274762d323
  1. 1
      src/js/api.js
  2. 6
      src/pages.json
  3. 6
      src/pages/write_off/operate/operate.vue
  4. 87
      src/pages/write_off/ym_card_gated/ym_card_gated.vue
  5. 73
      src/pages/write_off/ym_confirm/ym_confirm.vue

1
src/js/api.js

@ -101,6 +101,7 @@ API['writeOff'] = {
listVerifyRecord: `${ORIGIN}/admin/stadium/order/listVerifyRecord`, // 核销记录
enterVerifyOrder: `${ORIGIN}/admin/stadium/order/enterVerifyOrder`, // 商家助手-核销查询-输入验证码
assistantVerify: `${ORIGIN}/admin/stadium/order/assistantVerify`, // 商家助手-核销查询-核销
userMonthlyCardVerify: `${ORIGIN}/admin/userMonthlyCard/verify`, // 年月卡核销-后台
}
export default { ORIGIN, API };

6
src/pages.json

@ -134,6 +134,12 @@
}
},
{
"path": "pages/write_off/ym_card_gated/ym_card_gated",
"style": {
"navigationBarTitleText": "核销订单"
}
},
{
"path": "pages/write_off/ym_confirm/ym_confirm",
"style": {
"navigationBarTitleText": "核销订单"

6
src/pages/write_off/operate/operate.vue

@ -101,7 +101,11 @@ export default {
util.hideLoad();
if(res.data.code == 0){
let _data = res.data.data || {}
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data})
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data});
if(_data.extension&&_data.extension.verify_order_type === 'monthly_card'){
util.routeTo(`/pages/write_off/ym_confirm/ym_confirm?type=${type}`, 'nT');
return
}
util.routeTo(`/pages/write_off/confirm_order/confirm_order?type=${type}`, 'nT');
}else{
util.routeTo(`/pages/write_off/null/null?type=${type}`, 'nT');

87
src/pages/write_off/ym_card_gated/ym_card_gated.vue

@ -0,0 +1,87 @@
<template>
<view class="ym-card-gated">
<view class="ycg-stadium">场馆</view>
<view class="ycg-suc-tip">核销成功</view>
<view class="ycg-back-btn">返回继续核销</view>
<view class="ycg-open-tip">如需开门请点击</view>
<view class="ycg-btn-ls">
<view class="ybl-item">
<view class="yi-name">name</view>
<view class="yi-btn">开门</view>
</view>
</view>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
@import '~style/public.scss';
page{
background-color: #fff;
}
.ym-card-gated{
padding: 0 30upx;
.ycg-stadium{
padding: 30upx 0;
font-size: 32upx;
color: #1a1a1a;
border-bottom: 2upx solid #E5E5E5;
}
.ycg-suc-tip{
padding: 100upx 0 200upx;
text-align: center;
line-height: 60upx;
font-size: 50upx;
color: #333;
}
.ycg-back-btn{
margin: 0 auto 50upx;
width: 250upx;
height: 88upx;
line-height: 88upx;
text-align: center;
font-size: 32upx;
color: $themeColor;
border: 2upx solid $themeColor;
border-radius: 6upx;
}
.ycg-open-tip{
margin-bottom: 50upx;
font-size: 24upx;
line-height: 32upx;
color: #9a9a9d;
}
.ycg-btn-ls{
padding: 0 24upx;
.ybl-item{
border-bottom: 2upx solid #f2f2f7;
padding: 30upx 0;
@include centerFlex(space-between);
.yi-name{
flex-grow: 1;
font-size: 28upx;
line-height: 32upx;
color: #333;
@include textHide(1);
}
.yi-btn{
flex-shrink: 0;
margin-left: 20upx;
width: 128upx;
height: 66upx;
line-height: 66upx;
font-size: 32upx;
text-align: center;
border-radius: 10upx;
background-color: $themeColor;
color: #fff;
}
}
}
}
</style>

73
src/pages/write_off/ym_confirm/ym_confirm.vue

@ -1,41 +1,83 @@
<template>
<view class="ym-confirm">
<view class="yc-header">
<view class="yh-stadium">欧轩智能羽毛球馆(永泰店)</view>
<view class="yh-stadium">{{ orderInfo.extension.stadium_name || '-' }}</view>
<view class="yh-info">
<view>今天剩余可使用2</view>
<view>进场状态<text>进场</text></view>
<view>进场状态<text>{{ orderInfo.enter_status == 0?'离场':orderInfo.enter_status == 1?'进场':'' }}</text></view>
<view>进场时间2021-09-24 15:06:45</view>
</view>
</view>
<view class="yc-user-info">
<view class="yui-tit">持卡人信息</view>
<view class="yui-line">手机号码18316567789</view>
<view class="yui-line">用户昵称yiming</view>
<view class="yui-line">手机号码{{ orderInfo.mobile || '-' }}</view>
<view class="yui-line">用户昵称{{ orderInfo.nickname || '-' }}</view>
</view>
<view class="yc-photo">
<view class="yc-photo" v-if="!!orderInfo.user_face">
<view>照片</view>
<image></image>
<image mode="aspectFit" :src="orderInfo.user_face"></image>
</view>
<view class="yc-card-mes">
<view class="ycm-tit">年月卡信息</view>
<view class="ycm-line">年月卡名称年卡</view>
<view class="ycm-line">年月卡卡号564566</view>
<view class="ycm-line">验证码12235 51234</view>
<view class="ycm-line">生成时间2021-09-24 15:06:45</view>
<view class="ycm-line">失效时间2021-09-25 00:00:00</view>
<view class="ycm-line">年月卡名称{{ orderInfo.card_info.name || '-' }}</view>
<view class="ycm-line">年月卡卡号{{ orderInfo.card_no || '-' }}</view>
<view class="ycm-line">验证码{{ orderInfo.verify_code || '-' }}</view>
<view class="ycm-line">生成时间{{ orderInfo.created_at || '-' }}</view>
<view class="ycm-line">失效时间{{ orderInfo.expired_at || '-' }}</view>
</view>
<view class="yc-btns">
<view class="green">确认核销且开门</view>
<view>仅核销</view>
<view class="green" @click="confirmBtn">确认核销</view>
<!-- <view>仅核销</view> -->
</view>
</view>
</template>
<script>
import util from '../../../utils/util';
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import { WRITE_OFF_ORDER_INFO } from '../../../js/once_name';
export default {
data(){
return {
type: '', // verify_code -> 5: () | decrypt_text -> 6: ()
orderInfo: {
extension: {},
card_info: {}
}
}
},
onLoad(options){
if(options.type)this.type = options.type || '';
util.$_once(WRITE_OFF_ORDER_INFO, data => {
console.warn(data)
this.orderInfo = data;
})
},
methods: {
confirmBtn: util.debounce(function(){
let { orderInfo, type } = this;
servers.post({
url: API.writeOff.userMonthlyCardVerify,
data: {
brand_id: orderInfo.brand_id,
card_no: orderInfo.card_no,
stadium_id: orderInfo.stadium_id,
type: type == 'verify_code'? 5 : 6,
},
isDefaultGet: false,
})
.then(res=>{
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(_=>util.routeTo(`/pages/write_off/ym_card_gated/ym_card_gated`, 'nT'), 1200);
}else{
util.showNone(res.data.message || '操作失败!');
}
})
}, 300, true)
}
}
</script>
@ -53,6 +95,8 @@ export default {
border-bottom: 2upx solid #f2f2f7;
.yh-stadium{
padding: 30upx 0;
font-size: 32upx;
color: #1a1a1a;
border-bottom: 2upx solid #E5E5E5;
}
.yh-info{
@ -99,7 +143,6 @@ export default {
flex-shrink: 0;
width: 218upx;
height: 218upx;
background-color: skyblue;
border-radius: 10upx;
}
}

Loading…
Cancel
Save