Browse Source

add stored value card

tags/v1.1.30
刘嘉炜 3 years ago
parent
commit
88f873152d
  1. 84
      src/components/order_list/stored_value_card/stored_value_card.vue
  2. 3
      src/components/order_list/value_card/value_card.vue
  3. 3
      src/js/api.js
  4. 6
      src/pages.json
  5. 8
      src/pages/index/index.vue
  6. 20
      src/pages/order_list/order_list.vue
  7. 1
      src/store/index.js
  8. 2
      src/subpackage/order/js/api.js
  9. 215
      src/subpackage/order/pages/stored_value_card/detail/detail.vue
  10. 7
      src/subpackage/order/pages/value_card/detail/detail.vue

84
src/components/order_list/stored_value_card/stored_value_card.vue

@ -0,0 +1,84 @@
<template>
<view class="value-card-container" @click="toInfo">
<a-header :source="orderInfo.stadium_name || '-'" :status="getStatus(orderInfo.pay_status)"></a-header>
<view class="vcc-info">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单号</block>
</a-line>
<a-line :value="orderInfo.card_name || '-'">
<block slot="name">储值卡名称</block>
</a-line>
<a-line :value="orderInfo.mobile || '-'">
<block slot="name">手机号码</block>
</a-line>
<a-line :value="orderInfo.pay_time || '-'">
<block slot="name">支付时间</block>
</a-line>
<a-line :value="orderWay(orderInfo.order_way)">
<block slot="name">途径</block>
</a-line>
<view class="svc-total"><text class="st-txt">支付金额</text>{{ orderInfo.pay_amount || 0 }}</view>
</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: {
orderWay(wayType){
if(wayType == 0)return '购买';
if(wayType == 1)return '升级';
if(wayType == 2)return '充值';
return '-';
},
getStatus(status){
let _obj = {
1: '已付款',
4: '已退款',
}
return _obj[status] || '-'
},
toInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/stored_value_card/detail/detail?order_no=${orderInfo.order_no}`, 'nT');
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.value-card-container{
background-color: #fff;
padding: 0 20upx;
border-radius: 10upx;
.vcc-info{
padding: 20upx 0;
}
}
.svc-total{
line-height: 40upx;
text-align: right;
font-size: 28upx;
font-weight: 500;
color: #1a1a1a;
@include textHide(1);
.st-txt{
font-weight: 400;
color: #9A9A9D;
}
}
</style>

3
src/components/order_list/value_card/value_card.vue

@ -11,6 +11,9 @@
<a-line :value="orderInfo.mobile || '-'">
<block slot="name">手机号码</block>
</a-line>
<a-line :value="orderInfo.mark || '-'">
<block slot="name">备注</block>
</a-line>
<a-line :value="'¥' + orderInfo.balance || '-'" value-color="#ff873d">
<block slot="name">余额</block>
</a-line>

3
src/js/api.js

@ -69,6 +69,9 @@ export const API = {
messageList:`${ORIGIN}/admin/brand/message/list`, // 系统消息列表
messageRead:`${ORIGIN}/brand/message/read`, // 查看系统消息
// 20220725
userValueOrderLs:`${ORIGIN}/admin/userValueOrder/list`, // 用户储值卡订单
}
// 员工管理

6
src/pages.json

@ -450,6 +450,12 @@
"root": "subpackage/order",
"pages": [
{
"path": "pages/stored_value_card/detail/detail",
"style" : {
"navigationBarTitleText": "储值卡订单详情"
}
},
{
"path": "pages/retail/detail/detail",
"style" : {
"navigationBarTitleText": "零售订单详情"

8
src/pages/index/index.vue

@ -131,7 +131,13 @@
name: '课程管理',
path: '/subpackage/course/pages/index/index',
serverKey: 1013 // 1013
}
},
{
id: 9,
name: '储值卡管理',
path: '/pages/order_list/order_list?order_type=18',
serverKey: 1014 // 1014
},
];
const app = getApp();

20
src/pages/order_list/order_list.vue

@ -64,6 +64,7 @@
<rent-and-sale v-if="orderType == 8" :order-info="e"></rent-and-sale>
<retail v-if="orderType == 19" :order-info="e"></retail>
<ym-card v-if="orderType == 20" :order-info="e"></ym-card>
<stored-value-card v-if="orderType == 21" :order-info="e"></stored-value-card>
</view>
</view>
@ -123,7 +124,7 @@
import timing_order from '../../components/timing_order/timing_order.vue';
import organize_order from '../../components/organize_order/organize_order.vue';
// 20210910
import value_card from '../../components/order_list/value_card/value_card.vue';
import value_card from '../../components/order_list/value_card/value_card.vue'; // 20220725
import curriculum from '../../components/order_list/curriculum/curriculum.vue';
import spectacular_monent from '../../components/order_list/spectacular_monent/spectacular_monent.vue';
import club_rental from '../../components/order_list/club_rental/club_rental.vue';
@ -134,6 +135,7 @@
import competition from '../../components/order_list/competition/competition.vue'; //
import retail from '../../components/order_list/retail/retail.vue'; //
import ym_card from '../../components/order_list/ym_card/ym_card.vue'; //
import stored_value_card from '../../components/order_list/stored_value_card/stored_value_card.vue'; //
import util from '../../utils/util';
import { servers } from '../../js/server';
@ -160,6 +162,7 @@
'competition': competition,
'retail': retail,
'ym-card': ym_card,
'stored-value-card': stored_value_card,
},
computed:{
isStoreInfo(){
@ -174,7 +177,7 @@
orderType == 8 || orderType == 7 ||
orderType == 11 || orderType == 6 ||
orderType == 9 || orderType == 19 ||
orderType == 20
orderType == 20 || orderType == 21
)
},
//
@ -384,9 +387,11 @@
page_size=15,
}){
let { orderType } = this;
let _url = this.getApiUrl(orderType);
if(!_url)return;
util.showLoad();
return servers.post({
url: this.getApiUrl(orderType),
url: _url,
data: { ...this.getQueryForList(), page, page_size },
failMsg: '加载失败!'
})
@ -423,6 +428,7 @@
if(type == 2)return API.shop2OrderList; //
if(type == 19)return API.retailOrderList; //
if(type == 20)return API.userMonthlyCardLs; // -
if(type == 21)return API.userValueOrderLs; // -
},
//
isDevice(){
@ -524,7 +530,7 @@
case 12:
return '课程订单';
case 18:
return '储值卡订单';
return '储值卡管理';
case 15:
return '高光时刻订单';
case 16:
@ -547,6 +553,8 @@
return '零售订单';
case 20:
return '年月卡订单';
case 21:
return '储值卡订单';
default:
return '订单'
}
@ -568,7 +576,7 @@
return [ {id: '', name: '全部'}, {id: 1, name: '已付款'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'}, ];
case 12: // tab ///退 [/0/1/4]
return [ {id: -1, name: '全部'}, {id: 0, name: '待付款'}, {id: 1, name: '进行中'}, {id: 2, name: '已结束'}, {id: 3, name: '已退款'}, ];
case 18: // 01使23退
case 18: // 01使23退 ---> 20220725
return [ {id: '', name: '全部'}, {id: 0, name: '待激活'}, {id: 1, name: '使用中'}, {id: 2, name: '已失效'}, {id: 3, name: '已退卡'},];
case 15: // ( 1,2,4 1 3 退 4 pay_status)
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '生效中'}, {id: 3, name: '已失效'}, {id: 4, name: '已退款'}];
@ -590,6 +598,8 @@
return [ {id: 1, name: '交易成功'} ];
case 20: // status 0,1,2,3 0 使 1 2 退 3
return [ {id: '', name: '全部'}, {id: 0, name: '待激活'}, {id: 1, name: '使用中'}, {id: 2, name: '已失效'},{id: 3, name: '已退卡'}];
case 21: // status -> '' -> 1 退-> 4
return [ {id: '', name: '全部'}, {id: 1, name: '已付款'}, {id: 4, name: '已退款'} ];
default:
return []
}

1
src/store/index.js

@ -41,6 +41,7 @@ export default new Vuex.Store({
'1010': '设备管理',
'1011': '商品零售',
'1013': '课程管理',
'1014': '储值卡管理',
},
// 场地占用提交页面信息
occupyInfo: {

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

@ -28,6 +28,8 @@ export const ORDER_API = {
ymCardInfoFace:`${ORIGIN}/upload/file/ym_card_face`, // 年月卡用户头像上传
ymCardInfoFaceSave:`${ORIGIN}/admin/userMonthlyCard/updateFace`, // 年月卡用户头像保存
ymCardUsage:`${ORIGIN}/admin/userMonthlyCard/usages`, // 用户年月卡使用记录-后台
// 20220725
userValueOrderGet:`${ORIGIN}/admin/userValueOrder/get`, // 储值卡订单详情
}

215
src/subpackage/order/pages/stored_value_card/detail/detail.vue

@ -0,0 +1,215 @@
<template>
<view class="stored-value-card">
<view class="svc-box svc-header">
<view class="sh-stadium">
<image mode="aspectFit" :src="stadiumInfo.stadium_logo"></image>
<view>{{ stadiumInfo.stadium_name || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>订单编号</text>{{ orderInfo.order_no || '-' }}</view>
<view class="sl-status">{{ payStatus(orderInfo.pay_status) }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>创建时间</text>{{ orderInfo.created_at || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>手机号码</text>{{ orderInfo.mobile || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>用户昵称</text>{{ orderInfo.nickname || '-' }}</view>
</view>
</view>
<view class="svc-box svc-card-info">
<view class="sci-tit">储值卡信息</view>
<view class="svc-line">
<view class="sl-txt"><text>储值卡名称</text>{{ cardInfo.card_name || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>储值卡卡号</text>{{ cardInfo.card_no || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>储值卡类型</text>{{ cardType(cardInfo.card_kind) }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>赠金金额</text>{{ cardInfo.gift_amount.amount || '0' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>途径</text>{{ orderWay(orderInfo.order_way) }}</view>
</view>
<view class="sci-pay-info">
<s-line :keyname="'金额小计'" :value="'¥' + (orderInfo.amount || '0')"></s-line>
<s-line :keyname="'积分抵扣'" :value="'¥' + (orderInfo.deduction_amount|| '0')"></s-line>
<s-line :keyname="'折扣金额'" :value="'¥' + (orderInfo.discount_amount || '0')"></s-line>
<s-line :keyname="'优惠券优惠'" :value="'¥' + (orderInfo.coupons_amount || '0')"></s-line>
<view class="spi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
</view>
</view>
<view class="svc-box">
<view class="svc-line">
<view class="sl-txt" style="margin-bottom: 20rpx;"><text>支付信息</text></view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>支付方式</text>{{ payType(orderInfo.pay_type) }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>支付时间</text>{{ orderInfo.pay_time || '-' }}</view>
</view>
<view class="svc-line">
<view class="sl-txt"><text>微信交易号</text>{{ orderInfo.trade_no || '-' }}</view>
</view>
</view>
</view>
</template>
<script>
import s_line from '../../../components/s_line/s_line.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
export default {
components: {
's-line': s_line,
},
computed: {
cardInfo(){
let { orderInfo } = this;
if(orderInfo.card_info)return orderInfo.card_info || {};
return {};
},
stadiumInfo(){
let { orderInfo } = this;
if(orderInfo.stadium)return orderInfo.stadium || {};
return {};
}
},
data(){
return {
orderInfo: {},
}
},
onLoad(options){
this.getOrderInfo({ order_no: options.order_no });
},
methods: {
payStatus(status){
if(status == 1)return '已付款';
if(status == 4)return '已退款';
return '-';
},
orderWay(wayType){
if(wayType == 0)return '购买';
if(wayType == 1)return '升级';
if(wayType == 2)return '充值';
return '-';
},
cardType(type){
if(type == 1)return '个人卡';
if(type == 2 || type == 3)return '团体卡';
return '-'
},
payType: util.order_pay_type_txt,
getOrderInfo({ order_no }){
util.showLoad();
server.get({
url: ORDER_API.userValueOrderGet,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.stored-value-card{
}
.svc-box{
margin-bottom: 24upx;
padding: 30upx 24upx;
background-color: #fff;
}
.svc-line{
@include centerFlex(space-between);
.sl-txt{
flex-grow: 1;
line-height: 48upx;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
>text{
color: #9C9C9F;
}
}
.sl-status{
margin-left: 24upx;
flex-shrink: 0;
line-height: 40upx;
font-size: 28upx;
color: $themeColor;
}
}
.svc-header{
.sh-stadium{
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 23upx;
padding-bottom: 24upx;
border-bottom: 2upx solid #D8D8D8;
>image {
margin-right: 14upx;
flex-shrink: 0;
width: 40upx;
height: 40upx;
}
>view{
flex-grow: 1;
line-height: 40upx;
font-size: 28upx;
font-weight: 500;
color: #1a1a1a;
@include textHide(1);
}
}
}
.svc-card-info{
.sci-tit{
margin-bottom: 14upx;
line-height: 44upx;
font-size: 32upx;
color: #333;
}
.sci-pay-info{
margin-top: 32upx;
padding-top: 29upx;
border-top: 2upx solid #D8D8D8;
.spi-total{
text-align: right;
font-size: 36upx;
font-weight: 500;
color: #1a1a1a;
@include textHide(1);
>text{
font-weight: 400;
font-size: 28upx;
color: #9A9A9D;
}
}
}
}
</style>

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

@ -34,9 +34,12 @@
<a-line :value="orderInfo.kind || '-'">
<block slot="name">卡类型</block>
</a-line>
<a-line :value="'至' + orderInfo.expired_at || '-'">
<a-line :value="'至' + (orderInfo.expired_at || '-')">
<block slot="name">有效期</block>
</a-line>
<a-line :value="orderInfo.mark || '-'">
<block slot="name">备注</block>
</a-line>
</view>
<view class="i-box vc-record">
<view class="vc-tit">购卡记录</view>
@ -360,12 +363,14 @@ export default {
util.routeTo(`/subpackage/order/pages/value_card/xpense_tracker/xpense_tracker?card_no=${orderInfo.card_no}`, 'nT');
},
getInfo(card_no){
util.showLoad();
server.get({
url: ORDER_API.userValueCardInfo,
data: { card_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
})
},

Loading…
Cancel
Save