Browse Source

Merge branch 'retail' into localbranch

organize
刘嘉炜 3 years ago
parent
commit
5d296a4337
  1. 87
      src/components/order_list/retail/retail.vue
  2. 3
      src/js/api.js
  3. 6
      src/pages.json
  4. 8
      src/pages/order_list/order_list.vue
  5. 1
      src/subpackage/order/js/api.js
  6. 3
      src/subpackage/order/pages/order_manage/order_manage.vue
  7. 140
      src/subpackage/order/pages/retail/detail/detail.vue
  8. BIN
      src/subpackage/order/static/images/order_manage/order_18.png

87
src/components/order_list/retail/retail.vue

@ -0,0 +1,87 @@
<template>
<view class="retail-order" @click="toInfo">
<a-header :source="orderInfo.source || '-'" :status="getStatus(orderInfo.pay_status)"></a-header>
<!-- 商品名称: 操作人 购买时间: -->
<view class="ro-info">
<a-line :value="orderInfo.order_no || '-'">
<block slot="name">订单编号</block>
</a-line>
<a-line :value="getGoodsName || '-'">
<block slot="name">商品名称</block>
</a-line>
<a-line :value="orderInfo.sys_optuname || '-'">
<block slot="name">操作人</block>
</a-line>
<a-line :value="orderInfo.pay_time || '-'">
<block slot="name">购买时间</block>
</a-line>
</view>
<view class="ro-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</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 {
computed: {
getGoodsName(){
let { orderInfo } = this;
let _ls = orderInfo&&orderInfo.retail_order_goods || [];
let _str = _ls.map(e=>e.name).join(';');
if(_ls.length)_str += ';'
return _str
}
},
components: {
'a-header': a_header,
'a-line': a_line,
},
props: {
orderInfo: {
default: {},
type: Object
}
},
methods: {
getStatus(status){
let _obj = {
1: '交易成功'
}
return _obj[status] || '-'
},
toInfo(){
let { orderInfo } = this;
util.routeTo(`/subpackage/order/pages/retail/detail/detail?order_no=${orderInfo.order_no}`, 'nT');
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.retail-order{
background-color: #fff;
padding: 0 20upx 20upx;
border-radius: 10upx;
}
.ro-info{
}
.ro-total{
line-height: 96upx;
font-size: 28upx;
color: #1a1a1a;
font-weight: 500;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
>text{
color: #9a9a9d;
font-weight: 400;
}
}
</style>

3
src/js/api.js

@ -42,7 +42,8 @@ export const API = {
// hardwareOrderList: `${ORIGIN}/admin/stadium/hardware/order/list`, // 硬件管理-订单列表_copy
hardwareOrderList: `${ORIGIN}/admin/assistant/hardware/order/list`, // 硬件管理-订单列表_copy
appointmentOrderList: `${ORIGIN}/admin/gameAppointment/orderList`, // 赛事订单列表_copy
shop2OrderList: `${ORIGIN}/admin/shop2/orderList`, // 商城订单 - 列表_copy
shop2OrderList: `${ORIGIN}/admin/shop2/orderList`, // 商城订单 - 列表_copy交易成功
retailOrderList: `${ORIGIN}/admin/erp/retailOrder/list`, // 订单管理-零售订单列表
// 营业额统计
turnoverBrand: `${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌

6
src/pages.json

@ -396,6 +396,12 @@
"root": "subpackage/order",
"pages": [
{
"path": "pages/retail/detail/detail",
"style" : {
"navigationBarTitleText": "零售订单详情"
}
},
{
"path": "pages/mall/refund_list/refund_list",
"style" : {
"navigationBarTitleText": "退款"

8
src/pages/order_list/order_list.vue

@ -62,6 +62,7 @@
<competition :order-info="e" v-if="orderType == 14"></competition>
<mall v-if="orderType == 2" :order-info="e"></mall>
<rent-and-sale v-if="orderType == 8" :order-info="e"></rent-and-sale>
<retail v-if="orderType == 19" :order-info="e"></retail>
</view>
<!-- <view class="ool-item">
<mall></mall>
@ -136,6 +137,7 @@
import mall from '../../components/order_list/mall/mall.vue';
import device from '../../components/order_list/device/device.vue'; // //
import competition from '../../components/order_list/competition/competition.vue'; //
import retail from '../../components/order_list/retail/retail.vue'; //
import util from '../../utils/util';
import { servers } from '../../js/server';
@ -160,6 +162,7 @@
'mall': mall,
'device': device,
'competition': competition,
'retail': retail,
},
computed:{
isStoreInfo(){
@ -419,6 +422,7 @@
if(this.isDevice())return API.hardwareOrderList; //
if(type == 14)return API.appointmentOrderList; //
if(type == 2)return API.shop2OrderList; //
if(type == 19)return API.retailOrderList; //
},
//
isDevice(){
@ -539,6 +543,8 @@
return '商城订单列表';
case 8:
return '租售柜订单列表';
case 19:
return '零售订单';
default:
return '订单'
}
@ -578,6 +584,8 @@
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
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '租用中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'},{id: 5, name: '已购买'}];
case 19: // status status = 1
return [ {id: 1, name: '交易成功'} ];
default:
return []
}

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

@ -23,6 +23,7 @@ export const ORDER_API = {
orderGoodsRefund:`${ORIGIN}/admin/shop2/orderGoodsRefund`, // 商城-商品退款_copy
rentballOrderEnd:`${ORIGIN}/admin/assistant/rentball/order/end`, // 租球机-结束计费
leaseOrderEnd:`${ORIGIN}/admin/stadium/leaseOrder/endBill`, // 租售柜-结束计费
retailOrderInfo:`${ORIGIN}/admin/erp/retailOrder/info`, // 订单管理-零售订单详情
}

3
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, 14, 16, 15, 13, 6, 8, 11, 12 ];
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11, 12, 18 ];
return _endKeyArr.includes(key);
}
}
@ -64,6 +64,7 @@ function getTabList(){
{ id: 7, name: '约玩订单', key: 7, iconName: 'order_15', orderType: 10 },
{ id: 8, name: '商城订单', key: 8, iconName: 'order_4', orderType: 2 },
{ id: 9, name: '积分兑换订单', key: 9, iconName: 'order_5', orderType: 5 },
{ id: 9, name: '零售订单', key: 18, iconName: 'order_18', orderType: 19 },
]
}

140
src/subpackage/order/pages/retail/detail/detail.vue

@ -0,0 +1,140 @@
<template>
<view class="retail-container">
<view class="rc-header">
<a-header :source="orderInfo.source || '-'" :status="getStatus(orderInfo.pay_status)"></a-header>
<view class="rh-name">
<a-line :value="orderInfo.sys_optuname || '-'">
<block slot="name">操作人</block>
</a-line>
</view>
</view>
<view class="rc-goods-info" v-if="orderInfo.retail_order_goods&&orderInfo.retail_order_goods.length">
<view class="rgi-tit">商品详情</view>
<view class="rgi-goods-ls">
<view class="rgl-item" v-for="(e, i) in orderInfo.retail_order_goods" :key="i">
<!-- 商品名称 咖啡 数量1 价格3 -->
<a-line :value="e.name || '-'">
<block slot="name">商品名称</block>
</a-line>
<a-line :value="e.nums || '0'">
<block slot="name">数量</block>
</a-line>
<a-line :value="'¥' + (e.price || '0')">
<block slot="name">价格</block>
</a-line>
</view>
</view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
</view>
<view class="rc-pay-info">
<!-- 订单编号 -->
<view class="rpi-tit">支付详情</view>
<p-line :keyname="'订单编号'" :value="orderInfo.order_no || '-'" isbtn></p-line>
<p-line :keyname="'支付方式'" :value="payTypeTxt(orderInfo.pay_type)"></p-line>
<p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line>
</view>
</view>
</template>
<script>
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
import a_header from '../../../../../components/order_list/a_header/a_header.vue';
import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue';
export default {
components: {
'a-line': a_line,
'a-header': a_header,
's-line': s_line,
'p-line': p_line,
},
data(){
return {
orderInfo: {}
}
},
onLoad(options){
this.getOrderInfo(options.order_no);
},
methods: {
payTypeTxt: util.order_pay_type_txt,
getStatus(status){
let _obj = {
1: '交易成功'
}
return _obj[status] || '-'
},
getOrderInfo(order_no){
util.showLoad();
server.get({
url: ORDER_API.retailOrderInfo,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.retail-container{
}
.rc-header{
margin-bottom: 26upx;
padding: 0 24upx;
background-color: #fff;
.rh-name{
padding: 30upx 0;
}
}
.rc-goods-info{
margin-bottom: 24upx;
padding: 0 24upx;
background-color: #fff;
.rgi-tit{
padding-top: 20upx;
font-size: 32upx;
color: #1a1a1a;
}
.rgi-goods-ls{
.rgl-item{
padding: 30upx 0;
border-bottom: 2upx solid #D8D8D8;
}
}
.rgi-total{
text-align: right;
line-height: 106upx;
font-weight: 500;
font-size: 28upx;
color: #1a1a1a;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
>text{
color: #9a9a9d;
font-weight: 400;
}
}
}
.rc-pay-info{
padding: 30upx;
background-color: #fff;
.rpi-tit{
margin-bottom: 16upx;
line-height: 44upx;
font-size: 32upx;
color: #333;
}
}
</style>

BIN
src/subpackage/order/static/images/order_manage/order_18.png

After

Width: 60  |  Height: 60  |  Size: 537 B

Loading…
Cancel
Save