Browse Source

add value card order

account
刘嘉炜 3 years ago
parent
commit
8cd8f2b32a
  1. 15
      src/components/order_list/a_line/a_line.vue
  2. 39
      src/components/order_list/value_card/value_card.vue
  3. 1
      src/js/api.js
  4. 22
      src/pages/order_list/order_list.vue
  5. 2
      src/subpackage/order/js/api.js
  6. 51
      src/subpackage/order/pages/curriculum/detail/detail.vue
  7. 2
      src/subpackage/order/pages/order_manage/order_manage.vue
  8. 110
      src/subpackage/order/pages/value_card/detail/detail.vue
  9. 69
      src/subpackage/order/pages/value_card/xpense_tracker/xpense_tracker.vue
  10. BIN
      src/subpackage/order/static/images/value_card/arrow.png
  11. BIN
      src/subpackage/order/static/images/value_card/failure.png
  12. BIN
      src/subpackage/order/static/images/value_card/filtrate.png
  13. BIN
      src/subpackage/order/static/images/value_card/personal_icon.png
  14. BIN
      src/subpackage/order/static/images/value_card/using.png

15
src/components/order_list/a_line/a_line.vue

@ -3,9 +3,9 @@
<view class="al-name"><slot name="name"></slot></view>
<view class="al-value">
<block v-if="isArrayValue">
<view class="al-p" v-for="(e, i) in value" :key="i">{{ e || '-' }}</view>
<view class="al-p" :style="valueStyle" v-for="(e, i) in value" :key="i">{{ e || '-' }}</view>
</block>
<view class="al-p" v-else> {{ value || '-' }} </view>
<view class="al-p" :style="valueStyle" v-else> {{ value || '-' }} </view>
</view>
</view>
@ -13,15 +13,24 @@
<script>
export default {
computed: {
isArrayValue(){
let { value } = this;
return typeof value === 'object'&&value.length
return value !== null&&typeof value === 'object'&&value.length
},
valueStyle(){
let { valueColor } = this;
return `color: ${valueColor};`
}
},
props: {
value: {
default: ''
},
valueColor: {
default: '#1A1A1A',
type: String,
}
},
created(){

39
src/components/order_list/value_card/value_card.vue

@ -1,21 +1,52 @@
<template>
<view class="value-card-container">
<a-header></a-header>
<view class="value-card-container" @click="toInfo">
<a-header :source="orderInfo.buy_stadium_name || '-'" :status="getStatus(orderInfo.status)"></a-header>
<view class="vcc-info">
<a-line :value="['白金卡', '白银卡']">
<block slot="name">123</block>
<a-line :value="orderInfo.name || '-'">
<block slot="name">卡名称</block>
</a-line>
<a-line :value="orderInfo.card_no || '-'">
<block slot="name">储值卡号</block>
</a-line>
<a-line :value="orderInfo.mobile || '-'">
<block slot="name">手机号码</block>
</a-line>
<a-line :value="'¥' + orderInfo.balance || '-'" value-color="#ff873d">
<block slot="name">余额</block>
</a-line>
</view>
</view>
</template>
<script>
import util from '../../../utils/util';
import a_header from '../a_header/a_header.vue';
import a_line from '../a_line/a_line.vue';
export default {
components: {
'a-header': a_header,
'a-line': a_line,
},
props: {
orderInfo: {
default: {},
type: Object,
}
},
methods: {
getStatus(status){
let _obj = {
0: '待激活',
1: '使用中',
2: '已失效',
3: '已退卡',
}
return _obj[status] || '-'
},
toInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/value_card/detail/detail?card_no=${orderInfo.card_no}`, 'nT');
}
}
}
</script>

1
src/js/api.js

@ -32,6 +32,7 @@ export const API = {
// 20210916 订单列表接口
venueCourseOrderList: `${ORIGIN}/admin/venueCourse/orderList`, // 课程订单 - 列表
userValueCardList: `${ORIGIN}/admin/userValueCard/list`, // 用户储值卡-扣费_copy
// 营业额统计

22
src/pages/order_list/order_list.vue

@ -52,6 +52,7 @@
<timing-order :order-info="e" v-if="orderType == 1"></timing-order>
<organize-order :order-info="e" v-if="orderType == 10" @refreshList="refreshList"></organize-order>
<curriculum :order-info="e" v-if="orderType == 12"></curriculum>
<value-card :order-info="e" v-if="orderType == 18"></value-card>
</view>
<!-- <view class="ool-item">
<spectacular-monent></spectacular-monent>
@ -201,7 +202,10 @@
},
onLoad(options){
let _type = options.order_type || '';
let _classifyArr = getClassifyList(+_type);
this.orderType = _type;
this.curTabID = _classifyArr[0].id || ''
//
if(options.order_type == 3&&options.type!=undefined)this.appointOrderType = options.type;
@ -209,7 +213,6 @@
this.periodInfo = this.getDefaultTimeLimit(_type);
this.getStoreList();
this.$nextTick(this.refreshList);
this.$nextTick(_=> uni.setNavigationBarTitle({ title: this.titleName }));
@ -334,7 +337,7 @@
}){
let { orderType } = this;
util.showLoad();
servers.get({
servers.post({
url: this.getApiUrl(orderType),
data: { ...this.getQueryForList(), page, page_size },
failMsg: '加载失败!'
@ -365,6 +368,7 @@
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList;
if(type == 12)return API.venueCourseOrderList;
if(type == 18)return API.userValueCardList;
},
//
@ -379,11 +383,15 @@
let _obj = {
begin: periodInfo.start || '',
end: periodInfo.end || '',
status: curTabID || '',
status: curTabID,
brand_id: brandInfo.brand.id,
stadium_id: _curSelectedStore.id || ''
};
// 0,1,2,3
if(orderType == 12){
delete _obj['status'];
_obj['order_status_in'] = +curTabID === -1 ? '0,1,2,3' : curTabID + ''
}
// :0,1; :/[1/2]
if(orderType == 3)_obj['order_type'] = appointOrderType;
@ -421,6 +429,8 @@
return '约玩订单';
case 12:
return '课程订单';
case 18:
return '储值卡订单';
default:
return '订单'
}
@ -441,7 +451,9 @@
case 10: // tab ///退 [/0/1/4]
return [ {id: '', name: '全部'}, {id: 1, name: '已付款'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'}, ];
case 12: // tab ///退 [/0/1/4]
return [ {id: '', name: '全部'}, {id: 0, name: '待付款'}, {id: 1, name: '进行中'}, {id: 2, name: '已结束'}, {id: 4, name: '已退款'}, ];
return [ {id: -1, name: '全部'}, {id: 0, name: '待付款'}, {id: 1, name: '进行中'}, {id: 2, name: '已结束'}, {id: 3, name: '已退款'}, ];
case 18: // 01使23退
return [ {id: '', name: '全部'}, {id: 0, name: '待激活'}, {id: 1, name: '使用中'}, {id: 2, name: '已失效'}, {id: 3, name: '已退卡'},];
default:
return []
}

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

@ -2,6 +2,8 @@ import { ORIGIN } from '../../../js/api';
export const ORDER_API = {
venueCourse_orderInfo:`${ORIGIN}/admin/venueCourse/orderInfo`, // 课程订单 - 详情
userValueCardInfo:`${ORIGIN}/admin/userValueCard/get`, // 用户储值卡详情_copy
userValueCardConsumes:`${ORIGIN}/admin/userValueCard/consumes`, // 用户储值卡消费记录_copy
}

51
src/subpackage/order/pages/curriculum/detail/detail.vue

@ -19,7 +19,7 @@
<a-line :value="'¥' + orderInfo.price || '-'">
<block slot="name">课程价格</block>
</a-line>
<a-line :value="orderInfo.course_period || '-'">
<a-line :value="orderInfo.course_period_nums || '-'">
<block slot="name">总课时</block>
</a-line>
<a-line :value="orderInfo.number || '-'">
@ -28,22 +28,24 @@
<a-line :value="orderInfo.course_period_nums_give || '-'">
<block slot="name">赠送课时</block>
</a-line>
<a-line :value="orderInfo.course_name || '-'">
<block slot="name">课时时长</block>
<a-line :value="orderInfo.expired_at || '-'">
<block slot="name">有效期至</block>
</a-line>
<a-line :value="orderInfo.course_name || '-'">
<block slot="name">程价格</block>
<a-line :value="orderInfo.course_period">
<block slot="name">时时长</block>
</a-line>
<a-line :value="orderInfo.course_coach_type_text || '-'">
<block slot="name">上课教练</block>
</a-line>
<a-line :value="orderInfo.desc || '-'">
<a-line :value="orderInfo.course_content || '-'">
<block slot="name">课程内容</block>
</a-line>
<a-line :value="orderInfo.is_include_venue_price || '-'">
<a-line :value="orderInfo.is_include_venue_price?'是(不含场地费用)':'否'">
<block slot="name">上课是否需要场地</block>
</a-line>
</view>
<view class="ci-box pay-info">
<view class="pi-line">
@ -76,21 +78,25 @@
<a-line :value="orderInfo.pay_time || '-'">
<block slot="name">支付时间</block>
</a-line>
<a-line :value="orderInfo.pay_type || '-'">
<a-line :value="getPayType(orderInfo.pay_type)">
<block slot="name">支付方式</block>
</a-line>
<a-line :value="orderInfo.trade_no || '-'">
<block slot="name">交易流水</block>
</a-line>
<a-line :value="orderInfo.refund_no || '-'">
<block slot="name">退款单号</block>
</a-line>
<a-line :value="orderInfo.refund_time || '-'">
<block slot="name">退款时间</block>
</a-line>
<a-line :value="orderInfo.refund_amount || '-'">
<block slot="name">退款金额</block>
</a-line>
<block v-if="orderInfo.order_status == 3">
<a-line :value="orderInfo.refund_no || '-'">
<block slot="name">退款单号</block>
</a-line>
<a-line :value="orderInfo.refund_time || '-'">
<block slot="name">退款时间</block>
</a-line>
<a-line :value="orderInfo.refund_amount || '-'">
<block slot="name">退款金额</block>
</a-line>
</block>
</view>
</view>
@ -101,6 +107,7 @@ import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
export default {
// (' 0- 1- 2- 3-退 4-')
components: {
'a-line': a_line,
},
@ -124,6 +131,16 @@ export default {
.then(res=>{
this.orderInfo = res || {};
})
},
getPayType(type){
// [012, 3]
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: '会员换卡支付',
3: '商家主动',
}
return _obj[type] || '-'
}
}
}

2
src/subpackage/order/pages/order_manage/order_manage.vue

@ -58,7 +58,7 @@ function getTabList(){
{ id: 1, name: '订场订单', key: 1, iconName: 'order_14', orderType: 3 },
{ id: 2, name: '次卡订单', key: 2, iconName: 'order_2', orderType: 3 },
{ id: 3, name: '计时订单', key: 3, iconName: 'order_6', orderType: 1 },
{ id: 4, name: '储值卡订单', key: 4, iconName: 'order_1', orderType: 4 },
{ id: 4, name: '储值卡订单', key: 4, iconName: 'order_1', orderType: 18 },
{ id: 5, name: '课程订单', key: 5, iconName: 'order_8', orderType: 12 },
{ id: 6, name: '赛事订单', key: 6, iconName: 'order_9', orderType: 14 },
{ id: 7, name: '约玩订单', key: 7, iconName: 'order_15', orderType: 10 },

110
src/subpackage/order/pages/value_card/detail/detail.vue

@ -2,60 +2,63 @@
<view class="value-card-order-info">
<view class="i-box vc-header">
<view class="vh-name">
<view>欧轩智能场馆(羽毛球永泰店)</view>
<view>{{ orderInfo.buy_stadium_name || '-' }}</view>
</view>
<view class="vh-info">
<view class="vi-line">储值卡卡号124646</view>
<view class="vi-line">手机号码18316466456</view>
<view class="vi-line">储值卡余额1000</view>
<view class="vi-line">储值卡卡号{{ orderInfo.card_no || '-' }}</view>
<view class="vi-line">手机号码{{ orderInfo.mobile || '-' }}</view>
<view class="vi-line">储值卡余额{{ orderInfo.balance || '0' }}</view>
</view>
<view class="vh-btns">
<view>消费记录</view>
<view class="red">扣费</view>
<view class="orange">充值</view>
<view @click="toRecord">消费记录</view>
<block v-if="orderInfo.status == 1">
<view class="red">扣费</view>
<view class="orange">充值</view>
</block>
</view>
<image class="vh-tag"></image>
</view>
<view class="i-box vc-info">
<view class="vc-tit">储值卡信息</view>
<a-line :value="'yiming'">
<a-line :value="orderInfo.nickname || '-'">
<block slot="name">微信昵称</block>
</a-line>
<a-line :value="'白金储值卡'">
<a-line :value="orderInfo.name || '-'">
<block slot="name">储值卡名称</block>
</a-line>
<a-line :value="'个人卡(1/1 )'">
<a-line :value="orderInfo.kind || '-'">
<block slot="name">卡类型</block>
</a-line>
<a-line :value="'至2022.08.28'">
<a-line :value="'至' + orderInfo.expired_at || '-'">
<block slot="name">有效期</block>
</a-line>
</view>
<view class="i-box vc-record">
<view class="vc-tit">购卡记录</view>
<view class="vr-tit">升级 2020-05-23 13:25</view>
<a-line :value="'黄金储值卡'">
<block slot="name">名称</block>
</a-line>
<a-line :value="'1000元'">
<block slot="name">面值</block>
</a-line>
<a-line :value="'¥1999'">
<block slot="name">售价</block>
</a-line>
<a-line :value="'¥1000'">
<block slot="name">支付金额</block>
</a-line>
<a-line :value="'¥10(30天内有效)'">
<block slot="name">赠送金额</block>
</a-line>
<a-line :value="'小程序'">
<block slot="name">途径</block>
</a-line>
<view class="vr-border"></view>
<block v-for="(e, i) in orderInfo.records" :key="i">
<view class="vr-tit">{{getWayTxt(e.order_way)}} {{e.pay_time || ''}}</view>
<a-line :value="e.card_name || '-'">
<block slot="name">名称</block>
</a-line>
<a-line :value="e.par_value || 0">
<block slot="name">面值</block>
</a-line>
<a-line :value="e.price || 0">
<block slot="name">售价</block>
</a-line>
<a-line :value="e.pay_amount || 0">
<block slot="name">支付金额</block>
</a-line>
<a-line :value="e.give_money_text || 0">
<block slot="name">赠送金额</block>
</a-line>
<a-line :value="e.create_type_text || '-'">
<block slot="name">途径</block>
</a-line>
<view class="vr-border" v-if="i<orderInfo.records.length-1"></view>
</block>
<view class="vr-tit">升级 2020-05-23 13:25</view>
<!-- <view class="vr-tit">升级 2020-05-23 13:25</view>
<a-line :value="'黄金储值卡'">
<block slot="name">名称</block>
</a-line>
@ -73,7 +76,7 @@
</a-line>
<a-line :value="'小程序'">
<block slot="name">途径</block>
</a-line>
</a-line> -->
</view>
<view class="vc-mask" v-if="false">
@ -201,7 +204,7 @@
</view>
</view>
<view class="vc-mask">
<view class="vc-mask" v-if="false">
<view class="tip-modal">
<image class="tm-close"></image>
<image class="tm-icon"></image>
@ -221,9 +224,46 @@
<script>
import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
export default {
components: {
'a-line': a_line,
},
data(){
return{
orderInfo: {
records: []
}
}
},
onLoad(options){
this.getInfo(options.card_no);
},
methods: {
toRecord(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/value_card/xpense_tracker/xpense_tracker?card_no=${orderInfo.card_no}`, 'nT');
},
getInfo(card_no){
server.get({
url: ORDER_API.userValueCardInfo,
data: { card_no },
failMsg: '加载失败!'
})
.then(res=>{
this.orderInfo = res || {};
})
},
getWayTxt(order_way){
let _obj = {
0: '购买',
1: '升级',
2: '充值',
}
return _obj[order_way] || '-'
}
}
}
</script>

69
src/subpackage/order/pages/value_card/xpense_tracker/xpense_tracker.vue

@ -2,35 +2,35 @@
<view class="xpense-tracker">
<view class="xt-header">
<view>日期</view>
<picker>
<picker mode="date">
<view class="xh-picker">
<input />
<view></view>
</view>
</picker>
<image></image>
<image mode="aspectFit" @click="filtrateBtn" src="/subpackage/order/static/images/value_card/filtrate.png"></image>
</view>
<view class="xt-list">
<view class="xl-item" v-for="i in 20" :key="i">
<view class="xl-item" v-for="(e, i) in recordList" :key="i">
<view class="xi-header">
<view class="xh-addr">
<image class="xa-logo"></image>
<view>广州欧轩智能羽毛球馆(永泰店)</view>
<image class="xa-icon"></image>
<image class="xa-logo" mode="aspectFit" :src="e.brand_or_stadium.logo"></image>
<view>{{ e.brand_or_stadium.name || '-' }}</view>
<image class="xa-icon" mode="aspectFit" src="/subpackage/order/static/images/value_card/arrow.png"></image>
</view>
<view class="xh-time">12月7日 13:25 </view>
<view class="xh-time">{{ e.created_at || '-' }} </view>
</view>
<view class="xi-info">
<view class="xi-price">
<view>消费-预订场地</view>
<view>-100</view>
<view>{{ e.desc || '-' }}</view>
<view>{{ e.amount || '-' }}</view>
</view>
<view class="xi-amount">
<view>
<image></image>
<text>yiming</text>
<image mode="aspectFit" src="/subpackage/order/static/images/value_card/personal_icon.png"></image>
<text>{{ e.operator || '-' }}</text>
</view>
<view>余额 10000.09</view>
<view>余额 {{ e.balance || '-' }}</view>
</view>
</view>
</view>
@ -40,8 +40,47 @@
</template>
<script>
import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
export default {
data(){
return {
recordList: [],
card_no: ''
}
},
onLoad(options){
let _card_no = options.card_no || '';
this.card_no = _card_no;
this.getList({ card_no: _card_no })
},
methods: {
getList({ card_no, consume_type = '', date = '' }){
util.showLoad();
server.get({
url: ORDER_API.userValueCardConsumes,
data: { card_no, consume_type, date },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
let _list = res.consumes || [];
this.recordList = _list;
})
},
filtrateBtn(){
uni.showActionSheet({
itemList: ['支出', '收入'],
success: aRes=>{
let _type = aRes.tapIndex + 1;
let { card_no } = this;
this.getList({ card_no, consume_type: _type })
console.warn(aRes)
}
})
}
}
}
</script>
@ -87,7 +126,6 @@ export default {
>image{
width: 52upx;
height: 52upx;
background-color: skyblue;
}
}
.xt-list{
@ -108,7 +146,6 @@ export default {
margin-right: 24upx;
width: 60upx;
height: 60upx;
background-color: skyblue;
}
>view{
flex-grow: 1;
@ -121,7 +158,6 @@ export default {
flex-shrink: 0;
width: 32upx;
height: 32upx;
background-color: skyblue;
}
}
.xh-time{
@ -161,7 +197,6 @@ export default {
margin-right: 8upx;
width: 28upx;
height: 28upx;
background-color: skyblue;
}
}
&+view{

BIN
src/subpackage/order/static/images/value_card/arrow.png

After

Width: 64  |  Height: 64  |  Size: 475 B

BIN
src/subpackage/order/static/images/value_card/failure.png

After

Width: 264  |  Height: 264  |  Size: 6.0 KiB

BIN
src/subpackage/order/static/images/value_card/filtrate.png

After

Width: 104  |  Height: 104  |  Size: 829 B

BIN
src/subpackage/order/static/images/value_card/personal_icon.png

After

Width: 56  |  Height: 56  |  Size: 602 B

BIN
src/subpackage/order/static/images/value_card/using.png

After

Width: 264  |  Height: 264  |  Size: 5.6 KiB

Loading…
Cancel
Save