Browse Source

add order api

account
刘嘉炜 4 years ago
parent
commit
9b387e0a5a
  1. 117
      src/components/order_list/device/device.vue
  2. 39
      src/components/order_list/locker/locker.vue
  3. 56
      src/pages/order_list/order_list.vue
  4. 1
      src/subpackage/order/js/api.js
  5. 90
      src/subpackage/order/pages/devices/detail/detail.vue
  6. 2
      src/subpackage/order/pages/order_manage/order_manage.vue

117
src/components/order_list/device/device.vue

@ -0,0 +1,117 @@
<template>
<!-- 售货柜/浴室/咖啡/储物柜订单 -->
<view class="device-container" @click="toInfo">
<a-header :source="orderInfo.source" :status="status_txt(orderInfo.pay_status)">
<view slot="line" class="dc-line">
<image class="dl-img" mode="aspectFit" src="/static/images/icon/location.png"></image>
<view class="dl-view">{{ orderInfo.extension.hardware_name || '-' }}</view>
</view>
</a-header>
<view class="dc-info">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="showname">
<block slot="name">商品名称</block>
</a-line>
<a-line :value="orderInfo.duration_minute || '-'" v-if="orderType == 11">
<block slot="name">时长</block>
</a-line>
<a-line :value="buyTime">
<block slot="name">购买时间</block>
</a-line>
<view class="di-total"><text class="dt-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 {
props: {
orderInfo: {
default: {
extension: {}
},
type: Object,
},
orderType: { // -> 6/ -> 11 / -> 9
default: -1,
}
},
computed: {
buyTime(){
let { orderInfo, orderType } = this;
if(orderType == 11)return orderInfo.created_at || '-'
return orderInfo.pay_time || '-';
},
showname(){
let { orderInfo, orderType } = this;
if(orderType == 6)return orderInfo.goods_name || '-'
if(orderType == 11)return orderInfo.water_valve_name || '-'
if(orderType == 9&&orderInfo.coffee_drink)return orderInfo.coffee_drink.name || '-'
},
},
components: {
'a-header': a_header,
'a-line': a_line,
},
methods: {
status_txt(status){
let _obj = { // -> 6/ -> 11 / -> 9
1: '交易成功',
4: '退款完成'
};
return _obj[status] || '-'
},
toInfo(){
let { orderInfo, orderType } = this;
util.routeTo(`/subpackage/order/pages/devices/detail/detail?order_no=${orderInfo.order_no}&type=${orderType}`, 'nT');
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.device-container{
background-color: #fff;
padding: 0 20upx 20upx;
border-radius: 10upx;
}
.dc-info{
padding-top: 20upx;
.di-total{
text-align: right;
line-height: 40upx;
font-weight: 500;
font-size: 28upx;
color: #9A9A9D;
@include textHide(1);
.dt-txt{
color: #333;
font-weight: 400;
}
}
}
.dc-line{
margin-top: 10upx;
@include centerFlex(flex-start);
.dl-img{
flex-shrink: 0;
margin-right: 12upx;
height: 28upx;
width: 28upx;
}
.dl-view{
font-size: 24upx;
line-height: 34upx;
color: #9A9A9D;
}
}
</style>

39
src/components/order_list/locker/locker.vue

@ -1,20 +1,19 @@
<template>
<view class="locker-container">
<a-header :source="'地址'" :status="'状态'">
<a-header :source="orderInfo.source" :status="status_txt(orderInfo.pay_status)">
<view slot="line" class="lc-line">
<image class="ll-img" mode="aspectFit" src="/static/images/icon/location.png"></image>
<view class="ll-view">储物柜-B柜</view>
<view class="ll-view">{{ orderInfo.extension.hardware_name || '-' }}</view>
</view>
</a-header>
<view class="lc-info">
<a-line :value="'sc20 0822 0815 6894'">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="'1小时58分46秒'">
<a-line :value="orderInfo.end_time">
<block slot="name">寄存时长</block>
</a-line>
<view class="li-total"><text class="lt-txt">合计支付</text>¥6</view>
<view class="li-total" v-if="isTotalAmount"><text class="lt-txt">合计支付</text>¥{{orderInfo.pay_amount || 0}}</view>
</view>
</view>
@ -29,6 +28,34 @@ export default {
'a-header': a_header,
'a-line': a_line,
},
props: {
orderInfo: {
default: {
extension: {}
},
type: Object,
},
},
computed: {
isTotalAmount(){
let { orderInfo } = this;
return orderInfo.pay_status == 4 || orderInfo.pay_status == 2;
},
},
methods: {
status_txt(status){
let _obj2 = {
1: '寄存中',
2: '已完成',
4: '退款完成'
}
return _obj2[status] || '-'
},
toInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/locker/detail/detail?order_no=${orderInfo.order_no}`, 'nT');
}
}
}
</script>

56
src/pages/order_list/order_list.vue

@ -57,10 +57,11 @@
<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>
<device :order-info="e" v-if="isDevice()&&!isNotDeviceTemp()" :order-type="orderType"></device>
<locker :order-info="e" v-if="orderType == 7"></locker>
</view>
<view class="ool-item">
<!-- <view class="ool-item">
<mall></mall>
</view>
<view class="ool-item">
@ -69,6 +70,9 @@
<view class="ool-item">
<rent-and-sale></rent-and-sale>
</view>
<view class="ool-item">
<device></device>
</view> -->
<!-- <view class="ool-item">
<spectacular-monent></spectacular-monent>
@ -135,7 +139,8 @@
import club_rental from '../../components/order_list/club_rental/club_rental.vue';
import locker from '../../components/order_list/locker/locker.vue';
import rent_and_sale from '../../components/order_list/rent_and_sale/rent_and_sale.vue';
import mall from '../../components/order_list/mall/mall.vue';
import mall from '../../components/order_list/mall/mall.vue';
import device from '../../components/order_list/device/device.vue'; // //
import util from '../../utils/util';
import { servers } from '../../js/server';
@ -158,6 +163,7 @@
'locker': locker,
'rent-and-sale': rent_and_sale,
'mall': mall,
'device': device,
},
computed:{
isStoreInfo(){
@ -196,7 +202,7 @@
end: ''
},
orderType: 0, // 3->,4->,5->,1 , 10->
orderType: 0, // 3->,4->,5->,1 , 10->...
storeList: [ //
{ id: '', name: '全部' }
@ -400,9 +406,18 @@
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; //
if(this.isDevice())return API.hardwareOrderList; //
},
//
isDevice(){
let { orderType } = this;
return orderType in deviceTypeObj()
},
// /
isNotDeviceTemp(){
let { orderType } = this;
return orderType == 7
},
//
getQueryForList(){
// status(curTabID)
@ -436,7 +451,12 @@
};
// type
if(orderType in deviceTypeObj())_obj['type'] = deviceTypeObj()[orderType];
if(this.isDevice()){
delete _obj['status']; // ( status assistant_status)
_obj['type'] = deviceTypeObj()[orderType];
_obj['assistant_status'] = curTabID;
}
return _obj
},
@ -457,6 +477,10 @@
*/
let _obj = {
16: 'rent_ball_order',
6: 'vending_order',
11: 'water_valve_order',
9: 'coffee_order',
7: 'locker_order',
}
return _obj
}
@ -487,6 +511,14 @@
return '高光时刻订单';
case 16:
return '租球机订单';
case 6:
return '售货柜订单';
case 11:
return '浴室订单列表';
case 9:
return '咖啡机订单列表';
case 7:
return '储物柜订单列表';
default:
return '订单'
}
@ -512,8 +544,14 @@
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: '已退款'}];
case 16: // (status 1,2,4 1 2 退 4)
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '租用中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'}];
case 6: // status 1,4 1 退 4
case 11: // status 1,4 1 退 4
case 9: // status 1,4 1 退 4
return [ {id: '1,4', name: '全部'}, {id: 1, name: '交易成功'}, {id: 4, name: '退款完成 '}];
case 7: // status 1,2,4 1 2 退 4
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '寄存中'}, {id: 2, name: '已完成'}, {id: 4, name: '退款完成 '}];
default:
return []
}

1
src/subpackage/order/js/api.js

@ -10,6 +10,7 @@ export const ORDER_API = {
momentOrderInfo:`${ORIGIN}/admin/perfect/moment/order/get`, // 后台-高光时刻订单详情_copy
hardwareOrderInfo:`${ORIGIN}/admin/stadium/hardware/order/details`, // 硬件管理-订单详情_copy
rentballRefundDeposit:`${ORIGIN}/admin/stadium/rentball/order/refundDeposit`, // 退押金-后台
hardwareOrderGet:`${ORIGIN}/admin/assistant/hardware/order/get`, // 硬件订单详情 储物柜/售货柜/水阀/咖啡机/租售柜
}
export default ORDER_API;

90
src/subpackage/order/pages/devices/detail/detail.vue

@ -1,37 +1,49 @@
<template>
<!-- 售货柜/浴室/咖啡订单详情 -->
<view class="display_cabinets_detail">
<o-header></o-header>
<o-header
:logo='orderInfo.stadium_logo'
:source='orderInfo.stadium_name'
:phone='orderInfo.phone'
:name='orderInfo.name'
:status='pay_txt(orderInfo.pay_status)'
></o-header>
<view class="rent-info dcd-box">
<view class="dc-tit">商品详情</view>
<a-line :value="'豆奶' || '-'">
<a-line :value="showname || '-'">
<block slot="name">产品名称</block>
</a-line>
<a-line :value="'250ml' || '-'">
<a-line :value="orderInfo.goods_specification || '-'" v-if="optionsQuery.type == 6">
<block slot="name">规格</block>
</a-line>
<a-line :value="'1' || '-'">
<a-line :value="orderInfo.duration_minute || '0'" v-if="optionsQuery.type == 11">
<block slot="name">时长</block>
</a-line>
<a-line :value="orderInfo.amount || '0'" v-if="optionsQuery.type == 6 || optionsQuery.type == 9">
<block slot="name">数量</block>
</a-line>
<a-line :value="'¥2' || '-'">
<a-line :value="`¥${orderInfo.pay_amount || '0'}`">
<block slot="name">价格</block>
</a-line>
<view class="ri-line"></view>
<view class="ri-price">
<s-line :keyname="'积分抵扣'" :value="'¥6'"></s-line>
<s-line :keyname="'折扣金额'" :value="'¥6'"></s-line>
<s-line :keyname="'优惠券优惠'" :value="'¥6'"></s-line>
<view class="rp-total"><text>合计支付</text>5</view>
<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="rp-total"><text>合计支付</text>{{orderInfo.pay_amount || '0'}}</view>
</view>
</view>
<view class="dcd-box">
<view class="dc-tit">支付详情</view>
<p-line :keyname="'订单编号'" :value="'sc20 0822 0815 6894'" isbtn></p-line>
<p-line :keyname="'支付方式'" :value="'会员卡支付'"></p-line>
<p-line :keyname="'支付时间'" :value="'2020-08-22 10:12:25'"></p-line>
<p-line :keyname="'交易流水号'" :value="'202009181255364564612622'"></p-line>
<p-line :keyname="'退款单号'" :value="'tk20201112456556'"></p-line>
<p-line :keyname="'退款时间'" :value="'2020-08-22 08:12:25'"></p-line>
<p-line :keyname="'订单编号'" :value="orderInfo.order_no || '-'" isbtn></p-line>
<p-line :keyname="'支付方式'" :value="status_txt(orderInfo.pay_type)"></p-line>
<p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line>
<p-line :keyname="'交易流水号'" :value="orderInfo.trade_no || '-'"></p-line>
<block v-if="orderInfo.pay_status == 4">
<p-line :keyname="'退款单号'" :value="orderInfo.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间'" :value="orderInfo.refund_time || '-'"></p-line>
</block>
</view>
</view>
</template>
@ -51,6 +63,54 @@ export default {
's-line': s_line,
'p-line': p_line,
},
computed: {
showname(){
let { orderInfo, optionsQuery } = this;
if(optionsQuery.type == 6)return orderInfo.goods_name || '-'
if(optionsQuery.type == 11)return orderInfo.water_valve_name || '-'
if(optionsQuery.type == 9&&orderInfo.coffee_drink)return orderInfo.coffee_drink.name || '-'
}
},
data(){
return {
orderInfo: {},
optionsQuery: {
type: -1, // // -> 6 / -> 11 / -> 9
order_no: ''
}
}
},
onLoad(options){
this.optionsQuery = options || {};
if(options.order_no)this.getInfo(options.order_no);
},
methods: {
pay_txt(status){
let _obj = {
1: '交易成功',
4: '退款完成'
};
return _obj[status] || '-'
},
status_txt(status){
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: '会员卡支付',
};
return _obj[status] || '-'
},
getInfo(order_no){
server.get({
url: ORDER_API.hardwareOrderGet,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
this.orderInfo = res || {};
})
},
}
}
</script>

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

@ -38,7 +38,7 @@ export default {
util.routeTo(getTabRoutePath() + `?order_type=${ele.orderType}`,'nT');
},
isFinish(key){
let _endKeyArr = [1, 2, 3, 4, 5, 7, 9, 10, 11, ]
let _endKeyArr = [1, 2, 3, 4, 5, 7, 9, 10, 11, 14, 16, 15, 13 ]
return _endKeyArr.includes(key);
}
}

Loading…
Cancel
Save