Browse Source

add ymcard

organize
刘嘉炜 4 years ago
parent
commit
2826bf1b75
  1. 30
      src/components/order_list/ym_card/ym_card.vue
  2. 3
      src/js/api.js
  3. 10
      src/pages/order_list/order_list.vue
  4. 2
      src/subpackage/order/js/api.js
  5. 21
      src/subpackage/order/pages/ym_card/detail/detail.vue

30
src/components/order_list/ym_card/ym_card.vue

@ -1,17 +1,17 @@
<template> <template>
<view class="ym-card-container" @click="toInfo"> <view class="ym-card-container" @click="toInfo">
<a-header :source="'nnnnaaaaammmmeeee' || '-'" :status="'ssttaattuuss'"></a-header>
<a-header :source="orderInfo.extension.name || '-'" :status="statusTxt(orderInfo.status)"></a-header>
<view class="ycc-info"> <view class="ycc-info">
<a-line :value="'年卡' || '-'">
<a-line :value="orderInfo.card_info.name || '-'">
<block slot="name">卡名称</block> <block slot="name">卡名称</block>
</a-line> </a-line>
<a-line :value="'20195171564566' || '-'">
<a-line :value="orderInfo.card_no || '-'">
<block slot="name">年月卡号</block> <block slot="name">年月卡号</block>
</a-line> </a-line>
<a-line :value="'18316553478' || '-'">
<a-line :value="orderInfo.mobile || '-'">
<block slot="name">手机号码</block> <block slot="name">手机号码</block>
</a-line> </a-line>
<a-line :value="'至2022.08.28' || '-'">
<a-line :value="'至' + (orderInfo.expired_at || '-')">
<block slot="name">有效期</block> <block slot="name">有效期</block>
</a-line> </a-line>
</view> </view>
@ -27,9 +27,27 @@ export default {
'a-header': a_header, 'a-header': a_header,
'a-line': a_line, 'a-line': a_line,
}, },
props: {
orderInfo: {
default: {
card_info: {},
extension: {}
},
}
},
methods: { methods: {
toInfo(){ toInfo(){
util.routeTo(`/subpackage/order/pages/ym_card/detail/detail`, 'nT');
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/ym_card/detail/detail?id=${orderInfo.id}&card_no=${orderInfo.card_no}`, 'nT');
},
statusTxt(status){
let _obj = {
0: '待激活',
1: '使用中',
2: '已失效',
3: '已退卡',
}
return _obj[status] || '-'
} }
} }
} }

3
src/js/api.js

@ -44,6 +44,9 @@ export const API = {
appointmentOrderList: `${ORIGIN}/admin/gameAppointment/orderList`, // 赛事订单列表_copy appointmentOrderList: `${ORIGIN}/admin/gameAppointment/orderList`, // 赛事订单列表_copy
shop2OrderList: `${ORIGIN}/admin/shop2/orderList`, // 商城订单 - 列表_copy shop2OrderList: `${ORIGIN}/admin/shop2/orderList`, // 商城订单 - 列表_copy
// 20211112
userMonthlyCardLs: `${ORIGIN}/admin/userMonthlyCard/list`, // 列表用户年月卡-后台
// 营业额统计 // 营业额统计
turnoverBrand: `${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌 turnoverBrand: `${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌
turnoverStadium: `${ORIGIN}/admin/assistant/turnover/brand/stadium/calc`, // 营业额记录-门店 turnoverStadium: `${ORIGIN}/admin/assistant/turnover/brand/stadium/calc`, // 营业额记录-门店

10
src/pages/order_list/order_list.vue

@ -62,10 +62,7 @@
<competition :order-info="e" v-if="orderType == 14"></competition> <competition :order-info="e" v-if="orderType == 14"></competition>
<mall v-if="orderType == 2" :order-info="e"></mall> <mall v-if="orderType == 2" :order-info="e"></mall>
<rent-and-sale v-if="orderType == 8" :order-info="e"></rent-and-sale> <rent-and-sale v-if="orderType == 8" :order-info="e"></rent-and-sale>
</view>
<view class="ool-item">
<ym-card></ym-card>
<ym-card v-if="orderType == 19" :order-info="e"></ym-card>
</view> </view>
</view> </view>
@ -419,6 +416,7 @@
if(this.isDevice())return API.hardwareOrderList; // if(this.isDevice())return API.hardwareOrderList; //
if(type == 14)return API.appointmentOrderList; // if(type == 14)return API.appointmentOrderList; //
if(type == 2)return API.shop2OrderList; // if(type == 2)return API.shop2OrderList; //
if(type == 19)return API.userMonthlyCardLs; // -
}, },
// //
isDevice(){ isDevice(){
@ -539,6 +537,8 @@
return '商城订单列表'; return '商城订单列表';
case 8: case 8:
return '租售柜订单列表'; return '租售柜订单列表';
case 19:
return '年月卡订单';
default: default:
return '订单' return '订单'
} }
@ -578,6 +578,8 @@
return [ {id: 'assistant_all', name: '全部'}, {id: 1, name: '待发货'}, {id: 2, name: '已发货'}, {id: 3, name: '交易完成'}, {id: 'after_sale', name: '申请售后中'}, {id: 6, name: '退款完成'}]; return [ {id: 'assistant_all', name: '全部'}, {id: 1, name: '待发货'}, {id: 2, name: '已发货'}, {id: 3, name: '交易完成'}, {id: 'after_sale', name: '申请售后中'}, {id: 6, name: '退款完成'}];
case 8: // status 1,2,4 1 2 退4 5 case 8: // status 1,2,4 1 2 退4 5
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '租用中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'},{id: 5, name: '已购买'}]; return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '租用中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'},{id: 5, name: '已购买'}];
case 19: // status 0,1,2,3 0 使 1 2 退 3
return [ {id: '0,1,2,3', name: '全部'}, {id: 0, name: '待激活'}, {id: 1, name: '使用中'}, {id: 2, name: '已失效'},{id: 3, name: '已退卡'}];
default: default:
return [] return []
} }

2
src/subpackage/order/js/api.js

@ -23,7 +23,7 @@ export const ORDER_API = {
orderGoodsRefund:`${ORIGIN}/admin/shop2/orderGoodsRefund`, // 商城-商品退款_copy orderGoodsRefund:`${ORIGIN}/admin/shop2/orderGoodsRefund`, // 商城-商品退款_copy
rentballOrderEnd:`${ORIGIN}/admin/assistant/rentball/order/end`, // 租球机-结束计费 rentballOrderEnd:`${ORIGIN}/admin/assistant/rentball/order/end`, // 租球机-结束计费
leaseOrderEnd:`${ORIGIN}/admin/stadium/leaseOrder/endBill`, // 租售柜-结束计费 leaseOrderEnd:`${ORIGIN}/admin/stadium/leaseOrder/endBill`, // 租售柜-结束计费
userMonthlyCardInfo:`${ORIGIN}/admin/userMonthlyCard/get`, // 详情用户年月卡-后台
} }
export default ORDER_API; export default ORDER_API;

21
src/subpackage/order/pages/ym_card/detail/detail.vue

@ -53,6 +53,9 @@
import a_line from '../../../../../components/order_list/a_line/a_line.vue'; import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import s_line from '../../../components/s_line/s_line.vue'; import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue'; import p_line from '../../../components/p_line/p_line.vue';
import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
export default { export default {
components: { components: {
'a-line': a_line, 'a-line': a_line,
@ -64,6 +67,24 @@ export default {
return { return {
orderInfo: {} orderInfo: {}
} }
},
onLoad(options){
this.getCardInfo({
id: options.id,
card_no: options.card_no
})
},
methods: {
getCardInfo({id, card_no}){
server.get({
url: ORDER_API.userMonthlyCardInfo,
data: { id, card_no },
failMsg: '加载失败!'
})
.then(res=>{
this.orderInfo = res || {};
})
}
} }
} }
</script> </script>

Loading…
Cancel
Save