Browse Source

add order

account
刘嘉炜 3 years ago
parent
commit
bae3ccb029
  1. 86
      src/components/order_list/club_rental/club_rental.vue
  2. 44
      src/components/order_list/spectacular_monent/spectacular_monent.vue
  3. 2
      src/js/api.js
  4. 2
      src/pages/index/index.vue
  5. 52
      src/pages/order_list/order_list.vue
  6. 2
      src/subpackage/order/js/api.js
  7. 102
      src/subpackage/order/pages/spectacular_monent/detail/detail.vue
  8. 39
      src/subpackage/order/pages/value_card/detail/detail.vue
  9. BIN
      src/subpackage/order/static/images/value_card/success_c098.png

86
src/components/order_list/club_rental/club_rental.vue

@ -0,0 +1,86 @@
<template>
<view class="club-rental-container" @click="toInfo">
<a-header :source="orderInfo.source || '-'" :status="123">
<view slot="line" class="crc-line">
<image class="cl-img"></image>
<view class="cl-view">欧轩智能租球机-A</view>
</view>
</a-header>
<view class="vcc-info">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="orderInfo.price_type_text || '-'">
<block slot="name">租借时长</block>
</a-line>
<a-line :value="orderInfo.venue_name || '-'">
<block slot="name">租借时间</block>
</a-line>
</view>
<view class="vcc-total">
<view class="vt-view"><text class="vv-text">合计支付</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: {
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.club-rental-container{
background-color: #fff;
padding: 0 20upx 20upx;
border-radius: 10upx;
}
.crc-line{
margin-top: 10upx;
@include centerFlex(flex-start);
.cl-img{
flex-shrink: 0;
margin-right: 12upx;
height: 28upx;
width: 28upx;
background-color: skyblue;
}
.cl-view{
font-size: 24upx;
line-height: 34upx;
color: #9A9A9D;
}
}
.vcc-total{
padding: 10upx 0;
@include centerFlex(flex-end);
.vt-view{
font-weight: 500;
font-size: 28upx;
color: #333;
@include textHide(1);
.vv-text{
font-weight: 400;
color: #9A9A9D;
}
}
}
</style>

44
src/components/order_list/spectacular_monent/spectacular_monent.vue

@ -1,29 +1,61 @@
<template>
<view class="value-card-container">
<a-header>
<view slot="line" class="hc-line" style="margin-top: 12upx;font-size: 24upx;line-height: 34upx;color: #9A9A9D;">购买时间2021-07-01 15:25:25</view>
<view class="value-card-container" @click="toInfo">
<a-header :source="orderInfo.source || '-'" :status="getStatusTxt(orderInfo.pay_status)">
<view slot="line" class="hc-line" style="margin-top: 12upx;font-size: 24upx;line-height: 34upx;color: #9A9A9D;">购买时间{{ orderInfo.pay_time || '-' }}</view>
</a-header>
<view class="vcc-info">
<a-line :value="'kc20082208156894'">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="'季畅想包'">
<a-line :value="orderInfo.price_type_text || '-'">
<block slot="name">类型</block>
</a-line>
<block v-if="orderInfo.order_type == 0">
<a-line :value="orderInfo.venue_name || '-'">
<block slot="name">场地</block>
</a-line>
<a-line :value="orderInfo.start_time + '至' + orderInfo.end_time">
<block slot="name">时间</block>
</a-line>
</block>
</view>
<view class="vcc-total">
<view class="vt-view"><text class="vv-text">支付金额</text>24</view>
<view class="vt-view"><text class="vv-text">支付金额</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: {
getStatusTxt(status = 0){
let _obj = {
1: '生效中',
3: '已失效',
4: '已退款',
}
return _obj[status] || '-'
},
toInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/spectacular_monent/detail/detail?order_no=${ orderInfo.order_no }`, 'nT');
}
}
}
</script>

2
src/js/api.js

@ -33,6 +33,8 @@ export const API = {
// 20210916 订单列表接口
venueCourseOrderList: `${ORIGIN}/admin/venueCourse/orderList`, // 课程订单 - 列表
userValueCardList: `${ORIGIN}/admin/userValueCard/list`, // 用户储值卡-扣费_copy
momentOrderList: `${ORIGIN}/admin/perfect/moment/order/list`, // 后台-高光时刻订单列表_copy
hardwareOrderList: `${ORIGIN}/admin/stadium/hardware/order/list`, // 硬件管理-订单列表_copy
// 营业额统计

2
src/pages/index/index.vue

@ -92,7 +92,7 @@
{
id: 2,
name: '订单管理',
path: '/subpackage/device/pages/order_manage/order_manage',
path: '/subpackage/order/pages/order_manage/order_manage',
serverKey: 1012 //
},
{

52
src/pages/order_list/order_list.vue

@ -54,6 +54,8 @@
<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>
<spectacular-monent :order-info="e" v-if="orderType == 15"></spectacular-monent>
<club-rental :order-info="e" v-if="orderType == 16"></club-rental>
</view>
<!-- <view class="ool-item">
<spectacular-monent></spectacular-monent>
@ -114,9 +116,10 @@
import timing_order from '../../components/timing_order/timing_order.vue';
import organize_order from '../../components/organize_order/organize_order.vue';
// 20210910
import spectacular_monent from '../../components/order_list/spectacular_monent/spectacular_monent.vue';
import value_card from '../../components/order_list/value_card/value_card.vue';
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';
import util from '../../utils/util';
import { servers } from '../../js/server';
@ -135,6 +138,7 @@
'spectacular-monent': spectacular_monent,
'value-card': value_card,
'curriculum': curriculum,
'club-rental': club_rental,
},
computed:{
isStoreInfo(){
@ -367,11 +371,13 @@
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList;
if(type == 12)return API.venueCourseOrderList;
if(type == 18)return API.userValueCardList;
if(type == 10)return API.organizeOrderList; //
if(type == 12)return API.venueCourseOrderList; //
if(type == 18)return API.userValueCardList; //
if(type == 15)return API.momentOrderList; //
if(type in deviceTypeObj())return API.hardwareOrderList; //
},
//
getQueryForList(){
// status(curTabID)
@ -398,18 +404,38 @@
// , 0430.0507()
if(orderType == "10"){
postData['type'] = selectedOrderType;
postData['filter_start_time'] = periodInfo.start;
postData['filter_end_time'] = periodInfo.end;
postData['pay_status'] = curTabID;
_obj['type'] = selectedOrderType;
_obj['filter_start_time'] = periodInfo.start;
_obj['filter_end_time'] = periodInfo.end;
_obj['pay_status'] = curTabID;
};
// type
if(orderType in deviceTypeObj())_obj['type'] = deviceTypeObj()[orderType];
return _obj
},
},
}
//
function deviceTypeObj(){
/*
VendingOrderType OrderType = "vending_order" 售货柜
WaterValveOrderType OrderType = "water_valve_order" 浴室
LockerOrderType OrderType = "locker_order" 储物柜
LeaseOrderType OrderType = "lease_order" 租售柜
CoffeeOrderType OrderType = "coffee_order" 咖啡机
RentBlllOrderType OrderType = "rent_ball_order" 租球机 16
*/
let _obj = {
16: 'rent_ball_order',
}
return _obj
}
//
function getTitleName({
orderType,
@ -432,6 +458,10 @@
return '课程订单';
case 18:
return '储值卡订单';
case 15:
return '高光时刻订单';
case 16:
return '租球机订单';
default:
return '订单'
}
@ -455,6 +485,10 @@
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: '已退卡'},];
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: '已退款'}];
case 16: // (status 1,2,4 1 2 退 4)
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '寄存中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'}];
default:
return []
}

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

@ -7,6 +7,8 @@ export const ORDER_API = {
consumeTypeList:`${ORIGIN}/valueCard/consumeType/list`, // 用户储值卡消费场景列表
userValueCardDeduct:`${ORIGIN}/admin/userValueCard/deduct`, // 用户储值卡-扣费_copy
userValueCardRecharge:`${ORIGIN}/admin/userValueCard/recharge`, // 用户储值卡-充值_copy
momentOrderInfo:`${ORIGIN}/admin/perfect/moment/order/get`, // 后台-高光时刻订单详情_copy
}
export default ORDER_API;

102
src/subpackage/order/pages/spectacular_monent/detail/detail.vue

@ -1,84 +1,131 @@
<template>
<view class="spectacular-monent-order">
<view class="smo-header smo-box">
<view class="sh-address">
<image></image>
<view>欧轩智能场馆(羽毛球永泰店)</view>
<view class="sh-address" v-if="orderInfo.extension">
<image mode="aspectFit" :src="orderInfo.extension.stadium_logo"></image>
<view>{{ orderInfo.extension.stadium_name || '-' }}</view>
</view>
<view class="sh-line">
<view><text>手机号码</text>18316535486</view>
<view>生效中</view>
<view><text>手机号码</text>{{ orderInfo.mobile || '-' }}</view>
<view>{{ getStatusTxt(orderInfo.pay_status) }}</view>
</view>
<view class="sh-line">
<view><text>用户昵称</text>yiming</view>
<view><text>用户昵称</text>{{ orderInfo.nickname || '-' }}</view>
</view>
</view>
<view class="smo-info smo-box">
<view class="smo-tit">高光时刻信息</view>
<a-line :value="'下载'">
<a-line :value="orderInfo.name || '-'">
<block slot="name">产品名称</block>
</a-line>
<a-line :value="'1号半场'">
<a-line :value="orderInfo.venue_name || '-'">
<block slot="name">场地</block>
</a-line>
<a-line :value="'2021/08/02 16:002021/08/02 18:00'">
<a-line :value="orderInfo.start_time + '至' + orderInfo.end_time">
<block slot="name">时间</block>
</a-line>
<a-line :value="'¥6.8 '">
<a-line :value="'¥'+ (orderInfo.amount || '0')">
<block slot="name">价格</block>
</a-line>
<view class="si-border"></view>
<view class="si-price-info">
<view class="spi-line">
<view>积分抵扣</view>
<view>-¥0.5</view>
<view>-¥{{ orderInfo.deduction_amount || '0' }}</view>
</view>
<view class="spi-line">
<view>折扣金额</view>
<view>-¥0</view>
<view>-¥{{ orderInfo.discount_amount || '0' }}</view>
</view>
<view class="spi-line">
<view>优惠券优惠</view>
<view>-¥0</view>
<view>-¥{{ orderInfo.coupons_amount || '0' }}</view>
</view>
<view class="spi-total">
<text>合计支付</text>3.3
<text>合计支付</text>{{ orderInfo.pay_amount || '0' }}
</view>
</view>
</view>
<view class="smo-box">
<view class="smo-tit">支付详情</view>
<a-line :value="'sc20 0822 0815 6894'">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="'微信支付'">
<a-line :value="getPayType(orderInfo.pay_type)">
<block slot="name">支付方式</block>
</a-line>
<a-line :value="'2020-08-22 10:12:25'">
<a-line :value="orderInfo.pay_time || '-'">
<block slot="name">支付时间</block>
</a-line>
<a-line :value="'202009181255364564612622'">
<a-line :value="orderInfo.trade_no || '-'">
<block slot="name">交易流水号</block>
</a-line>
<a-line :value="'k20201112456556'">
<block slot="name">退款单号</block>
</a-line>
<a-line :value="'2020-08-23 10:12:25'">
<block slot="name">退款时间</block>
</a-line>
<a-line :value="'¥60'">
<block slot="name">退款金额</block>
</a-line>
<block v-if="orderInfo.pay_status == 4">
<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 || '0')">
<block slot="name">退款金额</block>
</a-line>
</block>
</view>
</view>
</template>
<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 {
data(){
return {
orderInfo: {
extension: {}
}
}
},
components: {
'a-line': a_line,
},
onLoad(options){
this.getInfo(options.order_no);
},
methods: {
getPayType(type){
// [012, 3]
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: '会员换卡支付',
3: '商家主动',
}
return _obj[type] || '-'
},
getStatusTxt(status = 0){
let _obj = {
1: '生效中',
3: '已失效',
4: '已退款',
}
return _obj[status] || '-'
},
getInfo(order_no){
util.showLoad();
server.get({
url: ORDER_API.momentOrderInfo,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
})
}
}
}
</script>
@ -102,7 +149,6 @@ export default {
margin-right: 14upx;
width: 40upx;
height: 40upx;
background-color: skyblue;
}
>view{
line-height: 40upx;

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

@ -16,7 +16,12 @@
<view class="orange" @click="isRechargeModal = true">充值</view>
</block>
</view>
<image class="vh-tag"></image>
<!-- 0: '待激活',
1: '使用中',
2: '已失效',
3: '已退卡', -->
<image class="vh-tag" v-if="orderInfo.status == 1" mode="aspectFit" src="/subpackage/order/static/images/value_card/using.png"></image>
<image class="vh-tag" v-if="orderInfo.status == 2" mode="aspectFit" src="/subpackage/order/static/images/value_card/failure.png"></image>
</view>
<view class="i-box vc-info">
<view class="vc-tit">储值卡信息</view>
@ -207,17 +212,19 @@
</view>
</view>
<view class="vc-mask" v-if="false">
<view class="tip-modal">
<image class="tm-close"></image>
<image class="tm-icon"></image>
<view class="tm-tit">扣费成功</view>
<view class="vc-mask" v-if="operateInfo" @click="operateInfo = null">
<view class="tip-modal" @click="_=> false">
<image class="tm-close" @click="operateInfo = null" mode="aspectFit" src="/subpackage/order/static/images/value_card/close.png"></image>
<image class="tm-icon" mode="aspectFit" src="/subpackage/order/static/images/value_card/success_c098.png"></image>
<view class="tm-tit" v-if="operateInfo.modalType == 'deduct'">扣费成功</view>
<view class="tm-tit" v-if="operateInfo.modalType == 'recharge'">充值成功</view>
<view class="tm-info">
<view>
<view>扣费金额<text>-50</text></view>
<view>当前余额25.25 </view>
<view>储值卡号20195171564566</view>
<view>手机号码18316553478</view>
<view v-if="operateInfo.modalType == 'deduct'">扣费金额<text>-{{ operateInfo.decr_amount || '0' }}</text></view>
<view v-if="operateInfo.modalType == 'recharge'">充值金额<text>{{ operateInfo.recharge_amount || '0' }}</text></view>
<view> 当前余额{{ operateInfo.balance || 0 }} </view>
<view> 储值卡号{{ operateInfo.card_no || '-' }} </view>
<view> 手机号码{{ operateInfo.mobile || '-' }} </view>
</view>
</view>
</view>
@ -254,7 +261,7 @@ export default {
records: []
},
operateInfo: null
}
},
@ -286,6 +293,9 @@ export default {
util.hideLoad();
if(res.data.code == 0){
this.refreshThis();
let _data = res.data.data || null;
if(_data&&_data.toString() == '[object Object]')_data['modalType'] = 'recharge';
this.operateInfo = _data;
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');
@ -317,6 +327,7 @@ export default {
},
deductConfirmBtn: util.debounce(function(){
let { deductAmount, deductRemark, curConsumeType, orderInfo } = this;
if(!('consume_type' in curConsumeType))return util.showNone('请选择消费场景!');
if(deductAmount<0)return util.showNone('扣除价格有误');
util.showLoad();
server.post({
@ -333,6 +344,9 @@ export default {
util.hideLoad();
if(res.data.code == 0){
this.refreshThis();
let _data = res.data.data || null;
if(_data&&_data.toString() == '[object Object]')_data['modalType'] = 'deduct';
this.operateInfo = _data;
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');
@ -445,7 +459,6 @@ export default {
top: 0;
width: 132upx;
height: 132upx;
background-color: skyblue;
}
}
.vc-info{
@ -661,14 +674,12 @@ export default {
top: 30upx;
width: 34upx;
height: 34upx;
background-color: skyblue;
}
.tm-icon{
margin: 0 auto 30upx;
display: block;
width: 100upx;
height: 100upx;
background-color: skyblue;
}
.tm-tit{
margin-bottom: 70upx;

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

After

Width: 100  |  Height: 100  |  Size: 985 B

Loading…
Cancel
Save