Browse Source

Merge branch 'dev'

voice^2
zmt 4 years ago
parent
commit
42bf4c1ce2
  1. 11
      .hbuilderx/launch.json
  2. 69
      package-lock.json
  3. 218
      src/components/organize_order/organize_order.vue
  4. 134
      src/components/reservation_order/reservation_order.vue
  5. 151
      src/components/timing_order/timing_order.vue
  6. 8
      src/js/api.js
  7. 33
      src/pages.json
  8. 7
      src/pages/employee/manage/manage.vue
  9. 94
      src/pages/index/index.vue
  10. 73
      src/pages/order_list/order_list.vue
  11. 8
      src/pages/order_search/order_search.vue
  12. BIN
      src/static/images/icon/index/tab_10.png
  13. BIN
      src/static/images/icon/index/tab_2.png
  14. BIN
      src/static/images/icon/index/tab_3.png
  15. BIN
      src/static/images/icon/index/tab_4.png
  16. BIN
      src/static/images/icon/index/tab_5.png
  17. BIN
      src/static/images/icon/index/tab_6.png
  18. BIN
      src/static/images/icon/index/tab_7.png
  19. BIN
      src/static/images/icon/index/tab_8.png
  20. BIN
      src/static/images/icon/index/tab_9.png
  21. BIN
      src/static/images/icon/retail/add.png
  22. BIN
      src/static/images/icon/retail/back.png
  23. BIN
      src/static/images/icon/retail/cart.png
  24. BIN
      src/static/images/icon/retail/dropDown.png
  25. BIN
      src/static/images/icon/retail/historySearchDelete.png
  26. BIN
      src/static/images/icon/retail/home.png
  27. BIN
      src/static/images/icon/retail/search.png
  28. BIN
      src/static/images/icon/retail/searchClear.png
  29. BIN
      src/static/images/icon/retail/sub.png
  30. BIN
      src/static/images/icon/x_close.png
  31. 3
      src/store/index.js
  32. 0
      src/subpackage/device/components/order/organize_detail/organize_detail.vue
  33. 837
      src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue
  34. 312
      src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue
  35. 341
      src/subpackage/device/components/order/timing_detail/timing_detail.vue
  36. 12
      src/subpackage/device/js/device_api.js
  37. 99
      src/subpackage/device/pages/order_details/order_details.vue
  38. 112
      src/subpackage/device/pages/order_manage/order_manage.vue
  39. BIN
      src/subpackage/device/static/images/order/tab_0_0.png
  40. BIN
      src/subpackage/device/static/images/order/tab_0_1.png
  41. BIN
      src/subpackage/device/static/images/order/tab_0_10.png
  42. BIN
      src/subpackage/device/static/images/order/tab_0_11.png
  43. BIN
      src/subpackage/device/static/images/order/tab_0_2.png
  44. BIN
      src/subpackage/device/static/images/order/tab_0_3.png
  45. BIN
      src/subpackage/device/static/images/order/tab_0_4.png
  46. BIN
      src/subpackage/device/static/images/order/tab_0_5.png
  47. BIN
      src/subpackage/device/static/images/order/tab_0_6.png
  48. BIN
      src/subpackage/device/static/images/order/tab_0_7.png
  49. BIN
      src/subpackage/device/static/images/order/tab_0_8.png
  50. BIN
      src/subpackage/device/static/images/order/tab_0_9.png
  51. BIN
      src/subpackage/device/static/images/order/tab_1_0.png
  52. BIN
      src/subpackage/device/static/images/scan_code.png
  53. 243
      src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue
  54. 11
      src/subpackage/retail/js/retail_api.js
  55. 10
      src/subpackage/retail/js/retail_server.js
  56. 20
      src/subpackage/retail/js/tools.js
  57. 502
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  58. 1026
      src/subpackage/retail/pages/index/index.vue
  59. 295
      src/subpackage/retail/pages/search/search.vue
  60. BIN
      src/subpackage/retail/static/images/add.png
  61. BIN
      src/subpackage/retail/static/images/back.png
  62. BIN
      src/subpackage/retail/static/images/cart.png
  63. BIN
      src/subpackage/retail/static/images/dropDown.png
  64. BIN
      src/subpackage/retail/static/images/historySearchDelete.png
  65. BIN
      src/subpackage/retail/static/images/home.png
  66. BIN
      src/subpackage/retail/static/images/search.png
  67. BIN
      src/subpackage/retail/static/images/searchClear.png

11
.hbuilderx/launch.json

@ -0,0 +1,11 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}

69
package-lock.json

@ -2403,16 +2403,6 @@
"integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==",
"dev": true
},
"@types/mini-css-extract-plugin": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.1.tgz",
"integrity": "sha512-+mN04Oszdz9tGjUP/c1ReVwJXxSniLd7lF++sv+8dkABxVNthg6uccei+4ssKxRHGoMmPxdn7uBdJWONSJGTGQ==",
"dev": true,
"optional": true,
"requires": {
"@types/webpack": "*"
}
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@ -2788,21 +2778,6 @@
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
"integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
"dev": true
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-beta.5",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.5.tgz",
"integrity": "sha512-ciWfzNefqWlmzKznCWY9hl+fPP4KlQ0A9MtHbJ/8DpyY+dAM8gDrjufIdxwTgC4szE4EZC3A6ip/BbrqM84GqA==",
"dev": true,
"optional": true,
"requires": {
"@types/mini-css-extract-plugin": "^0.9.1",
"chalk": "^3.0.0",
"hash-sum": "^2.0.0",
"loader-utils": "^1.2.3",
"merge-source-map": "^1.1.0",
"source-map": "^0.6.1"
}
}
}
},
@ -14096,6 +14071,50 @@
"vue-style-loader": "^4.1.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz",
"integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"hash-sum": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
"integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
}
}
},
"vue-style-loader": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",

218
src/components/organize_order/organize_order.vue

@ -0,0 +1,218 @@
<template>
<view class="timing-order" >
<view class="ro-header">
<view class="rh-view">{{orderInfo.original_order.extension.stadium_name || '-'}}</view>
<text :class="[ 'rh-text', orderInfo.original_order.pay_status == 0?'rh-active':'' ]">{{zh_order_status(orderInfo.original_order.pay_status)}}</text>
</view>
<view class="ro-section">
<view class="rs-line">
<view class="rl-view">订单编号</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.order_no || '-'}}</view>
</view>
<!-- <image src="/static/images/icon/arrow_b2.png"></image> -->
</view>
<view class="rs-line">
<view class="rl-view">约玩主题</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.theme || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">约玩人数</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.person_applicants || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">约玩时间</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.label.Date+" "+ orderInfo.label.StartTime+" "+orderInfo.label.EndTime || '-'}}</view>
</view>
</view>
<view class="rs-line" v-if="orderInfo.status=='End'">
<view class="rl-view">未发放</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.un_amount_already_amount || '-'}}</view>
</view>
</view>
</view>
<view class="ro-bot" v-if="orderInfo.original_order.pay_status != 0">
<!-- status == End 可发放金额-->
<view v-if="orderInfo.status=='End'" class="ro-btn" @click="clickSendAmount">发放金额</view>
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.original_order.pay_amount || 0}}</text></view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import { servers } from '../../js/server';
import { API } from '../../js/api';
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
zh_order_status(){
// 01使2使34退5退6退
return status =>{
const _obj = {
'0': '未支付',
'1': '已支付',
'2': '已使用',
'3': '已失效',
'4': '已退款',
'5': '申请退款',
'6': '同意退款',
}
return _obj[`${status}`] || '-'
}
}
},
data() {
return {
}
},
methods:{
toOrderDetails(){
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 10
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
// this.$emit('orderDetailChange');
},
clickSendAmount(){
let that = this
console.log(999,this.orderInfo)
uni.showModal({
title: '发放金额',
content: `确定要将未发放金额${that.orderInfo.un_amount_already_amount}全部转给约玩发起人?`,
confirmColor:"#469576",
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
servers.get({
url: API.amountIssued,
data: {
order_no: that.orderInfo.order_no,
},
failMsg: '加载失败!'
})
.then(res=>{
console.log(888,res);
that.$emit('refreshList');//
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.timing-order{
padding: 0 24upx;
border-radius: 10upx;
background-color: #fff;
.ro-header{
margin-bottom: 18upx;
height: 98upx;
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
.rh-view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
.rh-text{
margin-left: 20upx;
flex-shrink: 0;
font-size: 28upx;
color: #9C9C9F;
}
.rh-active{
color: $themeColor;
}
}
.ro-section{
padding-bottom: 20upx;
.rs-line{
display: flex;
.rl-view,.rv-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
}
.rl-view{
&:first-child{
flex-shrink: 0;
}
&+.rl-view{
flex-grow: 1;
.rv-view{
@include textHide(1);
}
}
}
.rv-active{
color: $themeColor;
}
>image{
width: 32rpx;
height: 32rpx;
}
}
}
.ro-bot{
// padding-top: 20rpx;
// padding-bottom: 30upx;
border-top: 2upx solid #D8D8D8;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
.rb-total{
// display: flex;
// flex-direction: row;
// justify-content: center;
line-height: 70rpx;
// text-align: right;
font-size: 24upx;
color: #9c9c9f;
.rt-txt{
color: #1A1A1A;
margin-left: 10rpx;
}
}
.ro-btn{
width: 120rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
font-size: 24upx;
color: #469576;
position: absolute;
left: 32rpx;
}
}
}
</style>

134
src/components/reservation_order/reservation_order.vue

@ -1,8 +1,8 @@
<template>
<view class="reservation-order">
<view class="reservation-order" @click="detailChange">
<view class="ro-header">
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text :class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'' ]">{{zh_order_status(orderInfo.pay_status)}}</text>
<text :class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'', orderInfo.pay_status == 4?'rh-red':'' ]">{{zh_order_status(orderInfo.pay_status)}}</text>
</view>
<view class="ro-section">
<view class="rs-line">
@ -12,49 +12,72 @@
</view>
</view>
<view class="rs-line">
<view class="rl-view">用户昵称</view>
<view class="rl-view">预订项目</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.nickname || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">支付时间</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.pay_time || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">预定日期</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.date || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">预定场次</view>
<view class="rl-view">
<view class="rv-view" v-for="(e,i) in orderInfo.sessions" :key="i">{{e.venue_name}} {{e.duration}}</view>
<view class="rv-view"><text>{{ zh_type_name(orderInfo.order_type) }}</text></view>
</view>
</view>
<!-- 场次 -->
<block v-if="orderInfo.order_type == 0">
<view class="rs-line" >
<view class="rl-view">预订场数</view>
<view class="rl-view">
<view class="rv-view">{{ orderInfo.number || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">预订时间</view>
<view class="rl-view">
<view class="rv-view" v-for="(e,i) in orderInfo.sessions" :key="i">{{e.date}} {{e.duration}}{{orderInfo.sessions.length>1?'等':''}}</view>
</view>
</view>
</block>
<!-- 人次 -->
<block v-if="orderInfo.order_type == 1">
<view class="rs-line">
<view class="rl-view">数量</view>
<view class="rl-view">
<view class="rv-view">{{ orderInfo.number || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">类型</view>
<view class="rl-view">
<!-- <view class="rv-view" v-for="(e, i) in orderInfo.person_number_spec_names" :key="i"><text>{{ e || '-'}}</text></view> -->
<view class="rv-view" >{{ zh_spec_names || '-'}}</view>
</view>
</view>
<!-- 人次+随时用 -->
<view class="rs-line" v-if="orderInfo.person_number_rule.order_method==1">
<view class="rl-view">有效期至</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.end_time || '-'}}</view>
</view>
</view>
<!-- 人次+指定日期 -->
<view class="rs-line" v-if="orderInfo.person_number_rule.order_method==2">
<view class="rl-view">使用日期</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.date || '-'}}</view>
</view>
</view>
</block>
</view>
<view class="ro-bot">
<view class="rb-line">
<!-- 0微信支付1支付宝支付2会员卡支付 -->
<view class="rl-view">支付方式{{zh_pay_type(orderInfo.pay_type)}}</view>
<view class="rl-view">{{orderInfo.sessions.length || '-'}}场次 合计¥{{orderInfo.amount || '0'}}</view>
</view>
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.pay_amount || '0'}}</text>(折扣{{orderInfo.discount_amount || '0'}})</view>
</view>
<view class="ro-bot-line" v-if="orderInfo.verify_type!=0">核销方式{{zh_verify_type(orderInfo.verify_type)}} {{orderInfo.verify_time || '-'}}</view>
<view class="ro-bot-line" v-if="orderInfo.pay_status == 4">退款时间{{orderInfo.refund_time || '-'}}</view>
</view>
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.pay_amount || '0'}}</text></view>
</view>
<!-- <view class="ro-bot-line" v-if="orderInfo.verify_type!=0">核销方式{{zh_verify_type(orderInfo.verify_type)}} {{orderInfo.verify_time || '-'}}</view>
<view class="ro-bot-line" v-if="orderInfo.pay_status == 4">退款时间{{orderInfo.refund_time || '-'}}</view> -->
</view>
</template>
<script>
import util from '@/utils/util';
export default {
props: {
orderInfo: {
type: Object,
default: {},
default: ()=>({})
}
},
computed: {
@ -72,12 +95,12 @@ export default {
}
},
zh_pay_type(){
// 012
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '会员卡支付',
'2': '储值卡支付',
}
return _obj[`${status}`] || '-'
}
@ -95,8 +118,38 @@ export default {
}
return _obj[`${status}`] || '-'
}
}
}
},
zh_type_name(){
// 0 1
let { orderInfo } = this
return status =>{
const _obj = {
'0': orderInfo.venue_type_name,
'1': orderInfo.person_number_rule_name,
}
return _obj[`${status}`] || '-'
}
},
zh_spec_names(){
let { orderInfo } = this
if(!orderInfo.person_number_spec_names)return '';
let spec = orderInfo.person_number_spec_names.join('+')
return spec || '';
},
},
methods:{
detailChange(){
console.log("点击了吗")
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 3
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
console.log("点击了吗444")
}
}
}
</script>
@ -127,6 +180,9 @@ export default {
.rh-active{
color: $themeColor;
}
.rh-red{
color: #EA5061;
}
}
.ro-section{
padding-bottom: 20upx;
@ -136,6 +192,9 @@ export default {
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
>text{
color: #333;
}
}
.rl-view{
&:first-child{
@ -179,6 +238,7 @@ export default {
color: #9c9c9f;
.rt-txt{
color: #1A1A1A;
margin-left: 10rpx;
}
}
}

151
src/components/timing_order/timing_order.vue

@ -0,0 +1,151 @@
<template>
<view class="timing-order" @click="toOrderDetails">
<view class="ro-header">
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text :class="[ 'rh-text', orderInfo.pay_status == 0?'rh-active':'' ]">{{zh_order_status(orderInfo.pay_status)}}</text>
</view>
<view class="ro-section">
<view class="rs-line">
<view class="rl-view">订单编号</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.order_no || '-'}}</view>
</view>
<image src="/static/images/icon/arrow_b2.png"></image>
</view>
<!-- 场次有 人次没有 order_type: 1场次 2人次 -->
<view class="rs-line" v-if="orderInfo.order_type == 1">
<view class="rl-view">项目</view>
<view class="rl-view">
<view class="rv-view">{{orderInfo.project_name || '-'}}</view>
</view>
</view>
<view class="rs-line">
<view class="rl-view">时长</view>
<view class="rl-view">
<view :class="[ 'rv-view', orderInfo.pay_status == 0?'rv-active':'' ]">{{ orderInfo.extension.duration || '-'}}</view>
</view>
</view>
</view>
<view class="ro-bot" v-if="orderInfo.pay_status != 0">
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.pay_amount || 0}}</text></view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
zh_order_status(){
// 01
return status =>{
const _obj = {
'0': '计费中',
'1': '已完成',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
}
},
data() {
return {
}
},
methods:{
toOrderDetails(){
console.log("点击了吗")
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 1
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
// this.$emit('orderDetailChange');
}
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.timing-order{
padding: 0 24upx;
border-radius: 10upx;
background-color: #fff;
.ro-header{
margin-bottom: 18upx;
height: 98upx;
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
.rh-view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
.rh-text{
margin-left: 20upx;
flex-shrink: 0;
font-size: 28upx;
color: #9C9C9F;
}
.rh-active{
color: $themeColor;
}
}
.ro-section{
padding-bottom: 20upx;
.rs-line{
display: flex;
.rl-view,.rv-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
}
.rl-view{
&:first-child{
flex-shrink: 0;
}
&+.rl-view{
flex-grow: 1;
.rv-view{
@include textHide(1);
}
}
}
.rv-active{
color: $themeColor;
}
>image{
width: 32rpx;
height: 32rpx;
}
}
}
.ro-bot{
padding-top: 20upx;
padding-bottom: 30upx;
border-top: 2upx solid #D8D8D8;
.rb-total{
line-height: 40upx;
text-align: right;
font-size: 24upx;
color: #9c9c9f;
.rt-txt{
color: #1A1A1A;
margin-left: 10rpx;
}
}
}
}
</style>

8
src/js/api.js

@ -19,11 +19,17 @@ export const API = {
collectionDetails: `${ORIGIN}/admin/assistant/collection/details`, // 收款记录-收款明细
reservationOrder: `${ORIGIN}/admin/stadium/order/list`, // 预约订单
// reservationOrder: `${ORIGIN}/admin/stadium/order/list`, // 预约订单
reservationOrder:`${ORIGIN}/admin/assistant/stadiumOrder/list`, //k-订单管理-预约订单列表 PM:2021/4/19
timeOrder:`${ORIGIN}/admin/assistant/timeOrder/list`, //k-订单管理-计时订单列表 PM:2021/4/19
membershipOrder: `${ORIGIN}/admin/member_card/order/list`, // 会员卡订单
integralOrder: `${ORIGIN}/admin/shop/order/list`, // 积分商城订单
integralOrderSend: `${ORIGIN}/admin/shop/order/ship`, // 积分商城订单-发货
organizeOrderList: `${ORIGIN}/assistant/gaPlayTogetherOrder/list`, // 约玩订单列表
amountIssued: `${ORIGIN}/assistant/gaPlayTogetherOrder/amountIssued`, // 发放金额
// 营业额统计
turnoverBrand: `${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌

33
src/pages.json

@ -184,7 +184,7 @@
}
}
],
],
"subpackages": [
{
"root": "subpackage/device",
@ -248,9 +248,38 @@
"style" : {
"navigationBarTitleText": "售货柜管理"
}
},
{
"path": "pages/order_details/order_details",
"style": {
"navigationBarTitleText": ""
}
}
]
}
},
{
"root": "subpackage/retail",
"pages": [
{
"path": "pages/index/index",
"style" : {
"navigationBarTitleText": "商品零售"
}
},
{
"path": "pages/confirm_goods/confirm_goods",
"style" : {
"navigationBarTitleText": "确定商品"
}
},
{
"path": "pages/search/search",
"style" : {
"navigationBarTitleText": "搜索"
}
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

7
src/pages/employee/manage/manage.vue

@ -59,7 +59,7 @@
<view class="ei-author">
<view>权限</view>
<view>
<view class="tag-active" v-if="k.extension.permission.menu.length == 10">全部权限</view>
<view class="tag-active" v-if="k.extension.permission.menu.length == permissionArr.length">全部权限</view>
<view v-else v-for="e in k.extension.permission.menu" :key="e">{{permissionObj[e] || ''}}</view>
</view>
</view>
@ -83,10 +83,11 @@
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import util from '../../../utils/util'
import { mapState } from 'vuex';
import { mapState, mapGetters } from 'vuex';
export default {
computed: {
...mapState([ 'permissionObj', 'brandInfo' ]),
...mapGetters([ 'permissionArr' ]),
...mapState([ 'permissionObj', 'brandInfo', ]),
isFilter(){
let { filterInfo } = this;
return !!filterInfo.meun || !!filterInfo.store

94
src/pages/index/index.vue

@ -33,11 +33,14 @@
<image src="/static/images/icon/arrow_b2.png" mode="aspectFit"></image>
</view>
</view>
<view class="ic-tabs">
<view class="it-item" v-for="e in tabList" :key="e.id" @click="toPageInfo(e)">
</view>
<view class="ic-tabs">
<view class="it-item" v-for="e in tabList" :key="e.id" @click="toPageInfo(e)">
<view>
<image mode="aspectFit" :src="'/static/images/icon/index/tab_'+ e.id + '.png'"></image>
<view>{{e.name}}</view>
</view>
</view>
</view>
<view class="ox-dark-mask" v-if="isShowAuthorModal">
@ -80,53 +83,40 @@
},
{
id: 2,
name: '经营分析',
path: '',
serverKey: 1003 //
name: '订单管理',
path: '/subpackage/device/pages/order_manage/order_manage',
serverKey: 1012 //
},
{
id: 3,
name: '场馆订单',
path: '/pages/order_list/order_list',
serverKey: 1004 //
},
{
id: 4,
name: '会员卡订单',
path: '/pages/order_list/order_list',
serverKey: 1005 //
},
{
id: 5,
name: '积分订单',
// path: '/pages/order_list/order_list',
path: '',
serverKey: 1006 //
},
{
id: 6,
name: '员工管理',
path: '/pages/employee/manage/manage',
serverKey: 1007 //
},
{
id: 7,
id: 4,
name: '核销查询',
path: '/pages/write_off/list/list',
serverKey: 1008 //
},
{
id: 8,
id: 5,
name: '场地管理',
path: '/pages/site/order_list/order_list',
serverKey: 1009 //
},
{
id: 9,
id: 6,
name: '设备管理',
path: '/subpackage/device/pages/index/index',
serverKey: 1010 //
},
{
id: 7,
name: '商品零售',
path: '/subpackage/retail/pages/index/index',
serverKey: 1011 //
}
];
const app = getApp();
@ -185,13 +175,11 @@
let _permission = indexData.permission || {};
if(!app.isLogin())return this.showAuthor();
if(!tabInfo.path)return util.showNone('暂未开放!');
//if(tabInfo.id == 2)return util.routeTo(tabInfo.path,'nT'); //
if(!_permission[tabInfo.serverKey])return util.showNone('暂无权限,请联系管理员开启!')
if(this.isOrderTab(tabInfo.id))return util.routeTo(tabInfo.path + `?order_type=${tabInfo.id}`,'nT');
util.routeTo(tabInfo.path,'nT');
},
isOrderTab(ID){
return ID == 3 || ID == 4 || ID == 5
},
getIndexInfo(){
servers.get({
url: API.calc,
@ -335,7 +323,7 @@
.ic-header{
position: relative;
height: 476upx;
margin-bottom: 48upx;
margin-bottom: 24upx;
padding: 38upx 24upx 0;
border-radius: 14upx;
background-color: $themeColor;
@ -423,7 +411,6 @@
}
}
.ic-notice{
margin-bottom: 24upx;
padding: 0 24upx;
height: 108upx;
border-radius: 10upx;
@ -468,29 +455,34 @@
}
.ic-tabs{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 0upx 14upx 12upx;
margin-top: -12upx;
.it-item{
padding-top: 54upx;
margin-bottom: 24upx;
flex-shrink: 0;
flex-grow: 0;
width: 218upx;
height: 218upx;
border-radius: 10upx;
background-color: #fff;
>image{
display: block;
margin: 0 auto 20upx;
width: 52upx;
height: 52upx;
}
width: 33.33%;
padding: 12upx;
>view{
text-align: center;
line-height: 40upx;
font-size: 28upx;
color: #1a1a1a;
padding: 40upx 10upx 0;
height: 218upx;
border-radius: 10upx;
background-color: #fff;
>image{
display: block;
margin: 0 auto 20upx;
width: 52upx;
height: 52upx;
}
>view{
text-align: center;
line-height: 40upx;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
}
}
}
.ic-author-modal{

73
src/pages/order_list/order_list.vue

@ -1,7 +1,7 @@
<template>
<view class="order-list">
<view class="ol-header">
<view class="oh-cur-store" v-if="orderType == 3 || orderType == 4">
<view class="oh-cur-store" v-if="orderType == 3 || orderType == 4 || orderType == 1">
<text>当前门店</text>
<picker mode="selector" :range="storeList" range-key="name" @change="storeChange">
<view class="ocs-store">
@ -35,6 +35,8 @@
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
<timing-order :order-info="e" v-if="orderType == 1"></timing-order>
<organize-order :order-info="e" v-if="orderType == 10" @refreshList="refreshList"></organize-order>
</view>
</view>
<!-- 分类tab -->
@ -86,6 +88,9 @@
import reservation_order from '../../components/reservation_order/reservation_order';
import integral_order from '../../components/integral_order/integral_order';
import membership_order from '../../components/membership_order/membership_order';
import timing_order from '../../components/timing_order/timing_order.vue'
import organize_order from '../../components/organize_order/organize_order.vue'
import util from '../../utils/util';
import { servers } from '../../js/server';
import { API } from '../../js/api';
@ -108,12 +113,27 @@
{id:2, name:'已发货'},
{id:3, name:'已完成'},
]
const timClassify = [ // tab ///退 [/0/1/4]
{id:'', name:'全部'},
{id:0, name:'计费中'},
{id:1, name:'已完成'},
{id:4, name:'已退款'},
]
const orgClassify = [ // tab ///退 [/0/1/4]
{id:'', name:'全部'},
// {id:0, name:'使'},
// {id:1, name:'使'},
// {id:2, name:''},
// {id:3, name:'退'},
]
export default {
components: {
// 'reservation-order': order.reservation,
'reservation-order': reservation_order,
'membership-order': membership_order,
'integral-order': integral_order,
'timing-order': timing_order,
'organize-order': organize_order,
},
computed:{
classifyArr(){
@ -121,6 +141,8 @@
if(orderType == 3)return resClassify;
if(orderType == 4)return memClassify;
if(orderType == 5)return intClassify;
if(orderType == 1)return timClassify;
if(orderType == 10)return orgClassify;
return [];
},
titleName(){
@ -128,6 +150,8 @@
if(orderType == 3)return '预约订单';
if(orderType == 4)return '会员卡订单';
if(orderType == 5)return '积分商城订单';
if(orderType == 1)return '计时订单';
if(orderType == 10)return '约玩订单';
return '订单'
},
...mapState(['brandInfo']),
@ -145,7 +169,7 @@
start: '',
end: ''
},
orderType: 3, // 3->,4->,5->
orderType: 3, // 3->,4->,5->,1
storeList: [ //
{ id: '', name: '全部' }
@ -191,10 +215,13 @@
end: defaultTime.end,
orderType: _type
})
},
onUnload() {
},
methods: {
//
// 3->,4->,5->
// 3->,4->,5->,1->
getDefaultTimeLimit(type){
let _date = new Date();
let _sevenTimeStemp = 7*24*60*60*1000;
@ -205,8 +232,8 @@
start: '',
end: ''
}
if(type == 3)_obj['start']=util.formatDate({}),_obj['end'] = util.formatDate({date: _afterSeven});
if(type == 4)_obj['start']=util.formatDate({date: _beforeSeven}),_obj['end'] = util.formatDate({});
if(type == 3 )_obj['start']=util.formatDate({}),_obj['end'] = util.formatDate({date: _afterSeven});
if(type == 4 || type == 1)_obj['start']=util.formatDate({date: _beforeSeven}),_obj['end'] = util.formatDate({});
console.log(_obj)
return _obj;
},
@ -298,7 +325,10 @@
if(type == 3)return API.reservationOrder;
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList;
},
getOrderList({
begin='',
end='',
@ -310,21 +340,25 @@
stadium_id='',
page=1,
page_size=15,
orderType = this.orderType
orderType = this.orderType,
order_type='', //:0,1; :/[1/2]
}){
let { brandInfo } = this;
util.showLoad();
let postData = {
begin,
end,
status,
brand_id: brandInfo.brand.id,
stadium_id,
page,
page_size,
order_type,
}
if(this.orderType == "10")postData['type'] = "Main"
servers.get({
url: this.getApiUrl(orderType),
data: {
begin,
end,
status,
brand_id: brandInfo.brand.id,
stadium_id,
page,
page_size,
},
data: postData,
failMsg: '加载失败!'
})
.then(res=>{
@ -342,6 +376,15 @@
},
detailChange(){
console.log("点击了吗66")
// let _query = {}
// _query["stadium_id"] = e.stadium_id
// _query["order_no"] = e.order_no
// _query["order_type"] = this.orderType
// util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
},
}
</script>

8
src/pages/order_search/order_search.vue

@ -17,6 +17,8 @@
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
<timing-order :order-info="e" v-if="orderType == 1"></timing-order>
<organize-order :order-info="e" v-if="orderType == 10"></organize-order>
</view>
</view>
</view>
@ -27,6 +29,8 @@
import reservation_order from '../../components/reservation_order/reservation_order';
import integral_order from '../../components/integral_order/integral_order';
import membership_order from '../../components/membership_order/membership_order';
import timing_order from '../../components/timing_order/timing_order.vue'
import organize_order from '../../components/organize_order/organize_order.vue'
import { API } from '../../js/api';
import { servers } from '../../js/server';
@ -38,6 +42,8 @@ export default {
'reservation-order': reservation_order,
'membership-order': membership_order,
'integral-order': integral_order,
'timing-order': timing_order,
'organize-order': organize_order,
},
computed: {
...mapState(['brandInfo']),
@ -88,6 +94,8 @@ export default {
if(type == 3)return API.reservationOrder;
if(type == 4)return API.membershipOrder;
if(type == 5)return API.integralOrder;
if(type == 1)return API.timeOrder;
if(type == 10)return API.organizeOrderList;
},
getOrderList({
key = "",

BIN
src/static/images/icon/index/tab_10.png

After

Width: 52  |  Height: 52  |  Size: 402 B

BIN
src/static/images/icon/index/tab_2.png

Before

Width: 52  |  Height: 52  |  Size: 477 B

After

Width: 52  |  Height: 52  |  Size: 177 B

BIN
src/static/images/icon/index/tab_3.png

Before

Width: 52  |  Height: 52  |  Size: 177 B

After

Width: 52  |  Height: 52  |  Size: 698 B

BIN
src/static/images/icon/index/tab_4.png

Before

Width: 52  |  Height: 52  |  Size: 696 B

After

Width: 52  |  Height: 52  |  Size: 683 B

BIN
src/static/images/icon/index/tab_5.png

Before

Width: 52  |  Height: 52  |  Size: 402 B

After

Width: 52  |  Height: 52  |  Size: 740 B

BIN
src/static/images/icon/index/tab_6.png

Before

Width: 52  |  Height: 52  |  Size: 698 B

After

Width: 52  |  Height: 52  |  Size: 396 B

BIN
src/static/images/icon/index/tab_7.png

Before

Width: 52  |  Height: 52  |  Size: 683 B

After

Width: 52  |  Height: 52  |  Size: 470 B

BIN
src/static/images/icon/index/tab_8.png

Before

Width: 52  |  Height: 52  |  Size: 740 B

After

Width: 52  |  Height: 52  |  Size: 477 B

BIN
src/static/images/icon/index/tab_9.png

Before

Width: 52  |  Height: 52  |  Size: 396 B

After

Width: 52  |  Height: 52  |  Size: 696 B

BIN
src/static/images/icon/retail/add.png

After

Width: 36  |  Height: 36  |  Size: 314 B

BIN
src/static/images/icon/retail/back.png

After

Width: 32  |  Height: 32  |  Size: 241 B

BIN
src/static/images/icon/retail/cart.png

After

Width: 84  |  Height: 84  |  Size: 2.0 KiB

BIN
src/static/images/icon/retail/dropDown.png

After

Width: 18  |  Height: 18  |  Size: 185 B

BIN
src/static/images/icon/retail/historySearchDelete.png

After

Width: 36  |  Height: 36  |  Size: 365 B

BIN
src/static/images/icon/retail/home.png

After

Width: 36  |  Height: 36  |  Size: 364 B

BIN
src/static/images/icon/retail/search.png

After

Width: 40  |  Height: 40  |  Size: 372 B

BIN
src/static/images/icon/retail/searchClear.png

After

Width: 32  |  Height: 32  |  Size: 356 B

BIN
src/static/images/icon/retail/sub.png

After

Width: 40  |  Height: 40  |  Size: 380 B

BIN
src/static/images/icon/x_close.png

After

Width: 34  |  Height: 34  |  Size: 425 B

3
src/store/index.js

@ -27,6 +27,8 @@ export default new Vuex.Store({
'1008': '查询核销',
'1009': '场地管理',
'1010': '设备管理',
'1011': '商品零售',
'1012': '订单管理',
},
// 场地占用提交页面信息
@ -48,6 +50,7 @@ export default new Vuex.Store({
name: _obj[key],
})
}
console.warn(_arr.length)
return _arr;
}
}

0
src/subpackage/device/components/order/organize_detail/organize_detail.vue

837
src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue

@ -0,0 +1,837 @@
<template>
<view class="reservation-people">
<view class="rp-head">
<view class="rh-store">
<image :src="orderInfo.stadium_logo || '' "></image>
<view>{{orderInfo.stadium_name || '-'}}</view>
</view>
<view class="rh-line">
<view>订单编号<text>{{orderInfo.order_no || ''}}</text></view>
<view><text :class="[orderInfo.pay_status==1?'rl-active':'']">{{zh_pay_status(orderInfo.pay_status)}}</text></view>
</view>
<view class="rh-line">
<view>创建时间<text>{{orderInfo.created_at || '-'}}</text></view>
</view>
<view class="rh-line">
<view>用户昵称<text>{{orderInfo.nickname || '-'}}</text></view>
</view>
<!-- 门店是否开启ic卡 -->
<block v-if="orderInfo.stadium_has_iccard && orderInfo.pay_status==1">
<!-- 待使用 已绑定ic卡 卡id>0就是绑定了-->
<block v-if="orderInfo.bind_iccard_info.id > 0">
<view class="rh-line">
<view>已绑定IC卡<text>{{orderInfo.bind_iccard_info.erp_iccard_no || '-'}}</text></view>
</view>
<view class="rh-line">
<view>绑定时间<text>{{orderInfo.bind_iccard_info.bind_order_at || '-'}}</text></view>
</view>
</block>
<!-- 待使用 未绑定ic卡 -->
<view :class="['rh-ic', orderInfo.bind_iccard_info.id > 0?'rh-ic-untie':'']" @click="orderInfo.bind_iccard_info.id > 0?bindICCardChange(1):bindICCardChange(2)">{{ orderInfo.bind_iccard_info.id > 0?'解绑IC卡':'绑定IC卡' }}</view>
</block>
</view>
<view class="rp-box">
<view class="rb-title">验证信息<text>({{orderInfo.available_num || 0}}张可用)</text></view>
<!-- 人次+随时用 -->
<view class="rb-time" v-if="orderInfo.person_number_rule.order_method==1">
<view>有效期至</view>
<text>{{orderInfo.end_time || '-'}}</text>
</view>
<!-- 人次+指定日期 -->
<view class="rb-time" v-if="orderInfo.person_number_rule.order_method==2">
<view>使用日期</view>
<text>{{orderInfo.date || '-'}}</text>
</view>
<view class="rb-code">
<view class="rc-item" v-for="(e,i) in orderInfo.sessions" :key="i">
<view class="ri-tit">验证码{{i+1}}</view>
<view class="ri-section">
<view :class="['rs-view',e.status==1?'rs-active':'']">{{e.verify_code || '-'}} ({{zh_verify_status(e.status)}})</view>
<block v-if="e.status==2">
<view class="rs-view">核销方式{{zh_verify_type(e.verify_type)}}</view>
<view class="rs-view">核销时间{{e.verify_time || '-'}}</view>
</block>
</view>
</view>
</view>
</view>
<view class="rp-box">
<view class="rb-title">预订信息</view>
<view class="rb-name">
<view>{{orderInfo.person_number_rule_name || ''}} <text> {{orderInfo.person_number_rule.order_method==1?'(可随时使用)':'(固定日期)'}}</text></view>
</view>
<view class="rb-line">
<view>数量<text>{{orderInfo.number || 0}}</text></view>
</view>
<view class="rb-line">
<view>类型{{ zh_spec_names || '-'}}</view>
</view>
<view class="rb-section">
<view class="rs-line">
<view>金额小计</view>
<view>¥{{orderInfo.amount || 0}}</view>
</view>
<view class="rs-line">
<view>积分抵扣</view>
<view>-¥{{orderInfo.deduction_amount || 0}}</view>
</view>
<view class="rs-line">
<view>折扣金额</view>
<view>-¥{{orderInfo.discount_amount || 0}}</view>
</view>
<view class="rs-line">
<view>优惠券优惠</view>
<view>-¥{{orderInfo.coupons_amount || 0}}</view>
</view>
</view>
<view class="rb-total">
<view>合计支付<text></text><text>{{orderInfo.pay_amount || 0}}</text></view>
</view>
</view>
<view class="rp-box">
<view class="rb-title">支付信息</view>
<view class="rb-line">
<view>支付方式<text>{{zh_pay_type(orderInfo.pay_type)}}</text></view>
</view>
<view class="rb-line">
<view>支付时间<text>{{orderInfo.pay_time || '-'}}</text></view>
</view>
<view class="rb-line">
<view>微信交易号<text>{{orderInfo.trade_no || ''}}</text></view>
</view>
</view>
<!-- 弹框 绑定ic卡 -->
<view class="ox-dark-mask" v-if="isShowBindIC" @touchmove.stop.prevent="moveHandle">
<view class="odm-ic-modal">
<view class="oim-close">
<image src="/static/images/icon/x_close.png" @click="isShowBindIC = !isShowBindIC"></image>
</view>
<view class="oim-tit">绑定IC卡</view>
<view class="oim-card">
<view class="oc-sign">*</view>
<view class="oc-depot" @click="depotChange"></view>
<input type="number" placeholder="请输入卡号" v-model=" bindInfo.iccard_no" />
<image class="oc-icon" src="/subpackage/device/static/images/scan_code.png" @click="scanChange"></image>
</view>
<view class="oim-tips">可直接输入卡号扫描条码或在已选择仓库下选择卡号</view>
<view class="oim-ipt">
<input type="digit" placeholder="单价" v-model="bindInfo.iccard_price" />
</view>
<view class="oim-ipt">
<input type="text" placeholder="其他费用(选填)" v-model="bindInfo.iccard_otherfee" />
</view>
<view class="oim-ipt">
<input type="text" placeholder="备注说明(选填)" v-model="bindInfo.iccard_remarks" />
</view>
<view class="oim-btn" hover-class="hover-active" @click="modalBtn(1)">确认</view>
</view>
</view>
<!-- 弹框 仓库选择ic卡 -->
<view class="ox-dark-mask" v-if="isShowSelectIC" @touchmove.stop.prevent="moveHandle">
<view class="odm-select-modal">
<view class="osm-close">
<image src="/static/images/icon/x_close.png" @click="isShowSelectIC = !isShowSelectIC"></image>
</view>
<view class="osm-tit">筛选卡号</view>
<picker class="osm-picker" :range="depotList" @change="pickerChange">
<view class="osm-ipt">
<input type="text" placeholder="请选择仓库" v-model="depotInfo.ic_name" disabled="true" />
<image src="/subpackage/device/static/images/arrow_b2.png"></image>
</view>
</picker>
<view class="osm-ipt">
<input type="number" placeholder="请输入卡号" v-model="depotInfo.ic_no" @change="inputChange"/>
</view>
<view class="osm-btn-box">
<picker class="osm-check" :range="iccardList" @change="checkPickerChange">
<view class="oc-btn" hover-class="hover-active">查询卡号</view>
</picker>
<view class="osm-btn" hover-class="hover-active" @click="modalBtn(2)">确认</view>
</view>
</view>
</view>
<!-- 弹框 ic卡绑定成功 -->
<view class="ox-dark-mask" v-if="isShowSuccessIC" @touchmove.stop.prevent="moveHandle">
<view class="odm-select-modal">
<view class="osm-title">绑定成功</view>
<view class="osm-line">
<view>卡号{{sucInfo.iccard.erp_iccard_no || '-'}}</view>
<view>关联订单号{{sucInfo.order_no || ''}}</view>
<view>门店名称{{sucInfo.stadium_name || '-'}}</view>
</view>
<view class="osm-line">
<view>订单类型{{zh_order_type(sucInfo.order_type)}}</view>
<view>项目名称{{sucInfo.project || '-'}}</view>
<view>购买者昵称{{sucInfo.nickname || '-'}}</view>
</view>
<view class="osm-btn" hover-class="hover-active" @click="okChange">好的</view>
</view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api';
import { mapState } from 'vuex';
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
...mapState(['brandInfo']),
zh_pay_status(){
// 1使2使34退
return status =>{
const _obj = {
'0': '未付款',
'1': '待使用',
'2': '已使用',
'3': '已失效',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
zh_verify_type(){
// 1/2/3/4 ///
return status =>{
const _obj = {
'0': '未核销',
'1': '核销码核销',
'2': '人脸核销',
'3': '扫码核销',
'4': '商家扫码',
}
return _obj[`${status}`] || '-'
}
},
zh_verify_status(){
// -1/0/1/2/3/4 //使///退
return status =>{
const _obj = {
'-1': '已分享',
'0': '无效',
'1': '待使用',
'2': '已使用',
'3': '已失效',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
}
return _obj[`${status}`] || '-'
}
},
zh_spec_names(){
let { orderInfo } = this
if(!orderInfo.person_number_spec_names)return '';
let spec = orderInfo.person_number_spec_names.join('+')
return spec || '';
},
zh_order_type(){
// 0 1
return status =>{
const _obj = {
'0': '预约订单',
'1': '课程订单',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isShowBindIC: false, //ic
isShowSelectIC: false, //ic
isShowSuccessIC: false,//ic
bindInfo: { //ic
iccard_no: '', //
iccard_price: '', //
iccard_otherfee: '', //
iccard_remarks: '', //
},
depotInfo: {
ic_name: '', //
ic_no: '', //
},
depotList: [], //picker
curIdx: -1,
storehouseList: [], //
iccardList: [], //ic
sucInfo: {}, //IC
};
},
methods:{
moveHandle(){},
modalBtn(type){
// type: 1ic 2ic
let { bindInfo, depotInfo } = this
if(type == 1){
if(bindInfo.iccard_no == '')return util.showNone('请输入ic卡卡号');
if(bindInfo.iccard_price == '')return util.showNone('请输入单价');
return this.getCheckIccard();
}
if(type == 2){
if(depotInfo.ic_name == '')return util.showNone('请选择仓库');
if(depotInfo.ic_no == '')return util.showNone('请输入ic卡卡号');
this.isShowModal()
this.bindInfo.iccard_no = depotInfo.ic_no
return;
}
},
isShowModal(){
this.isShowBindIC = !this.isShowBindIC;
this.isShowSelectIC = !this.isShowSelectIC;
},
//
depotChange(){
this.isShowModal();
this.getStoreHouseList()
},
//
pickerChange(e){
console.log(e);
this.curIdx = e.detail.value
let _list = this.depotList || [];
this.depotInfo.ic_name = _list[e.detail.value] || ''
},
//
getStoreHouseList(){
let { brandInfo } = this
util.showLoad();
deviceServer.get({
url: deviceApi.storeHouseList,
data: {
brand_id: brandInfo.brand.id,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
// setTimeout(()=>uni.navigateBack(),1200);
let _list = res.list || []
this.storehouseList = _list
for(var i in _list){
this.depotList.push(_list[i].storehouse_name)
}
})
},
inputChange(e){
if(this.depotInfo.ic_name == '')return;
this.getICCardList({
key: e.detail.value,
})
},
// ic
checkPickerChange(e){
console.log(e);
let _list = this.iccardList || [];
this.depotInfo.ic_no = _list[e.detail.value] || ''
},
// ic
getICCardList({key=''}){
let { brandInfo, curIdx, storehouseList } = this
this.iccardList.splice(0)
util.showLoad();
deviceServer.get({
url: deviceApi.iccardList,
data: {
brand_id: brandInfo.brand.id,
store_house_id: storehouseList[curIdx].id,
store_house_type: storehouseList[curIdx].store_house_type,
key,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
let _list = res.list || []
for(var i in _list){
this.iccardList.push(_list[i].erp_iccard_no)
}
})
},
// ic
getCheckIccard(){
let { brandInfo, bindInfo } = this
util.showLoad();
deviceServer.get({
url: deviceApi.checkIccard,
data: {
brand_id: brandInfo.brand.id,
erp_iccard_no: bindInfo.iccard_no,
},
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad()
this.getBindIcCard()
})
},
// ic
getBindIcCard(){
let { brandInfo, bindInfo, orderInfo } = this
util.showLoad();
deviceServer.get({
url: deviceApi.bindIcCard,
data: {
brand_id: brandInfo.brand.id,
price: bindInfo.iccard_price, //
iccard_no: bindInfo.iccard_no, //IC
delivery_expenses: bindInfo.iccard_otherfee, //
delivery_order_number: orderInfo.order_no, //
delivery_desc: bindInfo.iccard_otherfee, //
},
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad()
this.sucInfo = res || {};
this.isShowBindIC = false;
this.isShowSuccessIC = true;
})
},
bindICCardChange: util.debounce(function(type){
// type: 1ic 2ic
let { brandInfo, orderInfo } = this
if(type == 1){
util.showModal({
title: '提示',
content: '确认解绑ic卡吗?',
showCancel: true,
success: modalRes => {
if (modalRes.confirm) {
util.showLoad();
deviceServer.get({
url: deviceApi.unbindIccard,
data: {
brand_id: brandInfo.brand.id,
order_no: orderInfo.order_no,
iccard_no: orderInfo.bind_iccard_info.erp_iccard_no,
},
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad()
util.showNone('操作成功!');
this.$emit('okChange');
})
}
}
});
return;
}
if(type == 2){
this.isShowBindIC = !this.isShowBindIC
}
},300,300),
//
scanChange(){
let that = this;
//
uni.scanCode({
success: function(res) {
that.bindInfo.iccard_no = res.result;
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
},
okChange(){
this.isShowSuccessIC = !this.isShowSuccessIC
this.$emit('okChange');
},
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.reservation-people{
margin-bottom: 24rpx;
.rp-head{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx 10rpx 0px 0px;
.rh-store{
padding-bottom: 26rpx;
margin-bottom: 18rpx;
border-bottom: 2rpx solid #D8D8D8;
display: flex;
justify-content: flex-start;
>image{
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
background-color: skyblue;
}
>view{
flex-grow: 1;
margin-left: 14rpx;
color: #333333;
font-size: 28rpx;
}
}
.rh-line{
margin-top: 8rpx;
@include centerFlex(space-between);
>view{
line-height: 40rpx;
font-size: 28rpx;
&:first-child{
color: #9A9A9D;
>text{
color: #333333;
}
}
&:nth-child(2){
>text{
color: #9A9A9D;
}
.rl-active{
color: #009874;
}
}
}
}
.rh-ic{
margin-top: 40rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
width: 500rpx;
// height: 112rpx;
// line-height: 112rpx;
padding: 34rpx 0rpx;
margin-left: 71rpx;
}
.rh-ic-untie{
padding: 32rpx 0rpx;
color: #009874;
border: 2rpx solid #009874;
background-color: #fff;
}
}
.rp-box{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx;
.rb-title{
color: #9A9A9D;
font-size: 28rpx;
margin-bottom: 20rpx;
>text{
color: #333333;
font-size: 28rpx;
margin-left: 28rpx;
}
}
.rb-time{
line-height: 48rpx;
display: flex;
justify-content: flex-start;
>view{
color: #9A9A9D;
font-size: 28rpx;
}
>text{
color: #333333;
font-size: 28rpx;
}
}
.rb-code{
.rc-item{
display: flex;
justify-content: flex-start;
margin-top: 24rpx;
.ri-tit{
color: #9A9A9D;
font-size: 28rpx;
line-height: 46rpx;
}
.ri-section{
.rs-view{
color: #333333;
font-size: 28rpx;
line-height: 46rpx;
}
.rs-active{
color: #009874;
}
}
}
}
.rb-name{
margin-bottom: 8rpx;
color: #333333;
>view{
font-size: 28rpx;
}
>text{
font-size: 24rpx;
}
}
.rb-line{
>view{
line-height: 52rpx;
font-size: 28rpx;
color: #9A9A9D;
>text{
color: #333333;
}
}
}
.rb-section{
margin: 30rpx 0rpx 24rpx;
border-top: 2rpx solid #D8D8D8;
.rs-line{
margin-top: 26rpx;
@include centerFlex(space-between);
>view{
color: #333333;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 24rpx;
}
}
}
}
.rb-total{
@include centerFlex(flex-end);
>view{
color: #333333;
font-size: 28rpx;
>text{
color: #FF873D;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 36rpx;
}
}
}
}
}
.odm-ic-modal {
position: absolute;
left: 65rpx;
top: 10%;
background-color: #fff;
width: 620rpx;
padding: 30rpx 0rpx 80rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.oim-close{
width: 100%;
@include centerFlex(flex-end);
>image{
width: 32rpx;
height: 32rpx;
margin-right: 30rpx;
}
}
.oim-tit {
color: #333;
font-size: 32rpx;
font-weight: 700;
margin-top: 16rpx;
}
.oim-card{
width: 538rpx;
position: relative;
padding: 20rpx 0rpx;
margin-top: 38rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
@include centerFlex(flex-start);
.oc-sign{
position: absolute;
color: #EA5061;
font-size: 28rpx;
margin-left: -20rpx;
}
.oc-depot{
width: 40rpx;
height: 40rpx;
color: #fff;
font-size: 28rpx;
text-align: center;
border-radius: 6rpx;
background-color: #333333;
margin: 0rpx 20rpx;
}
& input {
height: 48rpx;
padding: 0rpx 20rpx;
font-size: 28rpx;
color: #333;
flex-grow: 1;
border-left: 2rpx solid #D8D8D8;
}
.oc-icon{
flex-shrink: 0;
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
}
}
.oim-tips{
width: 518rpx;
color: #9A9A9D;
font-size: 24rpx;
margin: 12rpx 0rpx 20rpx;
}
.oim-ipt{
width: 538rpx;
padding: 20rpx 0rpx;
border: 2rpx solid #D8D8D8;
border-radius: 10rpx;
margin-bottom: 36rpx;
& input {
flex-grow: 1;
height: 48rpx;
color: #333;
font-size: 28rpx;
padding: 0rpx 20rpx;
}
}
.oim-btn{
width: 240rpx;
height: 88rpx;
margin-top: 44rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFFFFF;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
}
}
.odm-select-modal{
position: absolute;
left: 65rpx;
top: 16%;
background-color: #fff;
width: 620rpx;
padding: 30rpx 0rpx 80rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.osm-close{
width: 100%;
@include centerFlex(flex-end);
>image{
width: 32rpx;
height: 32rpx;
margin-right: 30rpx;
}
}
.osm-tit {
color: #333;
font-size: 32rpx;
font-weight: 700;
margin: 16rpx 0rpx 38rpx;
}
.osm-picker{
width: 538rpx;
}
.osm-ipt{
width: 538rpx;
padding: 20rpx 0rpx;
border: 2rpx solid #D8D8D8;
border-radius: 10rpx;
margin-bottom: 36rpx;
@include centerFlex(flex-start);
& input {
flex-grow: 1;
height: 48rpx;
color: #333;
font-size: 28rpx;
padding: 0rpx 20rpx;
}
>image{
flex-shrink: 0;
width: 32rpx;
height: 32rpx;
margin-right: 22rpx;
}
}
.osm-btn-box{
width: 100%;
padding: 0rpx 40rpx;
@include centerFlex(space-between);
}
.osm-btn{
width: 240rpx;
height: 88rpx;
margin-top: 44rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFFFFF;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
}
.osm-check{
width: 240rpx;
.oc-btn{
width: 240rpx;
height: 88rpx;
margin-top: 44rpx;
border-radius: 10rpx;
border: 2rpx solid #009874;
color: #009874;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
}
}
.osm-title{
margin: 48rpx 0rpx 34rpx;
color: #333;
font-size: 32rpx;
font-weight: 700;
}
.osm-line{
width: 504rpx;
margin-bottom: 26rpx;
>view{
color: #333333;
font-size: 28rpx;
line-height: 48rpx;
}
}
}
}
</style>

312
src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue

@ -0,0 +1,312 @@
<template>
<view class="reservation-site">
<view class="rs-head">
<view class="rh-store">
<image :src="orderInfo.stadium_logo || '' "></image>
<view>{{orderInfo.stadium_name || '-'}}</view>
</view>
<view class="rh-line">
<view>订单编号<text>{{orderInfo.order_no || ''}}</text></view>
<view><text :class="[orderInfo.pay_status==1?'rl-active':'']">{{zh_pay_status(orderInfo.pay_status)}}</text></view>
</view>
<view class="rh-line">
<view>创建时间<text>{{orderInfo.created_at || '-'}}</text></view>
</view>
<view class="rh-line">
<view>用户昵称<text>{{orderInfo.nickname || '-'}}</text></view>
</view>
</view>
<view class="rs-box">
<view class="rb-title">验证信息</view>
<view class="rb-line">
<view class="rl-view">验证码</view>
<view :class="['rl-code1', orderInfo.pay_status==2?'rl-code2':'', orderInfo.pay_status==3?'rl-code3':'', orderInfo.pay_status==4?'rl-code4':'']" >{{orderInfo.verify_code || '-'}}<text>({{zh_pay_status(orderInfo.pay_status)}})</text></view>
</view>
<!-- 已使用 -->
<block v-if="orderInfo.pay_status==2">
<view class="rb-line">
<view class="rl-view">核销方式</view>
<text class="rl-text">{{zh_verify_type(orderInfo.verify_type)}}</text>
</view>
<view class="rb-line">
<view class="rl-view">核销时间</view>
<text class="rl-text">{{orderInfo.verify_time || '-'}}</text>
</view>
</block>
</view>
<view class="rs-box">
<view class="rb-title">预订信息</view>
<view class="rb-line">
<view class="rl-view">预订项目</view>
<text class="rl-text">{{orderInfo.venue_type_name || '-'}}</text>
</view>
<view class="rb-line">
<view class="rl-view">预订日期</view>
<text class="rl-text">{{orderInfo.date || '-'}}</text>
</view>
<view class="rb-line">
<view class="rl-view">预订场次</view>
<view>
<block v-for="(e,i) in orderInfo.sessions" :key="i">
<view class="rl-text">{{e.venue_name||'-'}} {{e.duration||'-'}}¥{{e.price||0}}</view>
</block>
</view>
</view>
<view class="rb-section">
<view class="rs-line">
<view>金额小计</view>
<view>¥{{orderInfo.amount || 0}}</view>
</view>
<view class="rs-line">
<view>积分抵扣</view>
<view>-¥{{orderInfo.deduction_amount || 0}}</view>
</view>
<view class="rs-line">
<view>折扣金额</view>
<view>-¥{{orderInfo.discount_amount || 0}}</view>
</view>
<view class="rs-line">
<view>优惠券优惠</view>
<view>-¥{{orderInfo.coupons_amount || 0}}</view>
</view>
</view>
<view class="rb-total">
<view>合计支付<text></text><text>{{orderInfo.pay_amount || 0}}</text></view>
</view>
</view>
<view class="rs-box">
<view class="rb-title">支付信息</view>
<view class="rb-line">
<view class="rl-view">支付方式</view>
<text class="rl-text">{{zh_pay_type(orderInfo.pay_type)}}</text>
</view>
<view class="rb-line">
<view class="rl-view">支付时间</view>
<text class="rl-text">{{orderInfo.pay_time || '-'}}</text>
</view>
<view class="rb-line">
<view class="rl-view">微信交易号</view>
<text class="rl-text">{{orderInfo.trade_no || ''}}</text>
</view>
<!-- 已退款 -->
<block v-if="orderInfo.pay_status == 4">
<view class="rb-line">
<view class="rl-view">退款时间</view>
<text class="rl-text">{{orderInfo.refund_time || '-'}}</text>
</view>
<view class="rb-line">
<view class="rl-view">退款单号</view>
<text class="rl-text">{{orderInfo.refund_no || '-'}}</text>
</view>
</block>
<!-- 已失效 -->
<view class="rb-line" v-if="orderInfo.pay_status == 3">
<view class="rl-view">失效时间</view>
<text class="rl-text">{{orderInfo.end_time || '-'}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
zh_pay_status(){
// 1使2使34退
return status =>{
const _obj = {
'0': '未付款',
'1': '待使用',
'2': '已使用',
'3': '已失效',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
zh_verify_type(){
// 1/2/3/4 ///
return status =>{
const _obj = {
'0': '未核销',
'1': '核销码核销',
'2': '人脸核销',
'3': '扫码核销',
'4': '商家扫码',
}
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
}
},
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.reservation-site{
margin-bottom: 24rpx;
.rs-head{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx 10rpx 0px 0px;
.rh-store{
padding-bottom: 26rpx;
margin-bottom: 18rpx;
border-bottom: 2rpx solid #D8D8D8;
// @include centerFlex(flex-start);
display: flex;
// align-items: center;
justify-content: flex-start;
>image{
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
background-color: skyblue;
}
>view{
flex-grow: 1;
margin-left: 14rpx;
color: #333333;
font-size: 28rpx;
}
}
.rh-line{
margin-top: 8rpx;
@include centerFlex(space-between);
>view{
line-height: 40rpx;
font-size: 28rpx;
&:first-child{
color: #9A9A9D;
>text{
color: #333333;
}
}
&:nth-child(2){
>text{
color: #9A9A9D;
}
.rl-active{
color: #009874;
}
}
}
}
}
.rs-box{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx;
.rb-title{
color: #9A9A9D;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.rb-line{
line-height: 48rpx;
display: flex;
// align-items: center;
justify-content: flex-start;
.rl-view{
color: #9A9A9D;
font-size: 28rpx;
flex-shrink: 0;
}
.rl-text{
color: #333333;
font-size: 28rpx;
}
.rl-code1{
color: #009874;
font-size: 28rpx;
>text{
color: #009874;
margin-left: 20rpx;
}
}
.rl-code2{
color: #333;
font-size: 28rpx;
>text{
color: #333;
}
}
.rl-code3{
color: #9A9A9D;
font-size: 28rpx;
>text{
color: #9A9A9D;
}
}
.rl-code4{
color: #9A9A9D;
font-size: 28rpx;
>text{
color: #EA5061;
}
}
}
.rb-section{
margin: 30rpx 0rpx 24rpx;
border-top: 2rpx solid #D8D8D8;
.rs-line{
margin-top: 26rpx;
@include centerFlex(space-between);
>view{
color: #333333;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 24rpx;
}
}
}
}
.rb-total{
@include centerFlex(flex-end);
>view{
color: #333333;
font-size: 28rpx;
>text{
color: #FF873D;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 36rpx;
}
}
}
}
}
}
</style>

341
src/subpackage/device/components/order/timing_detail/timing_detail.vue

@ -0,0 +1,341 @@
<template>
<view class="timing-details">
<view class="td-head">
<view class="th-store">
<image :src="orderInfo.stadium_logo || ''"></image>
<view>{{orderInfo.stadium_name || '-'}}</view>
</view>
<view class="th-line">
<view>订单编号<text>{{orderInfo.order_no || '-'}}</text></view>
<view><text :class="[orderInfo.pay_status == 0?'tl-active':'']">{{zh_order_status(orderInfo.pay_status)}}</text></view>
</view>
<view class="th-line">
<view>创建时间<text>{{orderInfo.model.created_at || '-'}}</text></view>
</view>
<view class="th-line">
<view>用户昵称<text>{{orderInfo.nickname || '-'}}</text></view>
</view>
</view>
<view class="td-box">
<view class="tb-title">计时信息</view>
<view class="tb-line">
<!-- 项目 场时有 人时没有 order_type: 1场时 2人时 -->
<view v-if="orderInfo.order_type==1">项目<text>{{orderInfo.project_name || '-'}}({{orderInfo.venue_name || '-'}})</text></view>
<view>进场时间<text>{{orderInfo.start_time || '-'}}</text></view>
<!-- 离场时间 已完成显示 -->
<view v-if="orderInfo.pay_status != 0">离场时间<text>{{orderInfo.end_time || '-'}}</text></view>
<view>时长合计<text>{{orderInfo.extension.duration || '-'}}</text></view>
</view>
<view class="tb-section" v-if="orderInfo.pay_status!= 0">
<view class="ts-line">
<view>金额小计</view>
<view>¥{{orderInfo.amount || 0}}</view>
</view>
<view class="ts-line">
<view>积分抵扣</view>
<view>-¥{{orderInfo.deduction_amount ||0}}</view>
</view>
<view class="ts-line">
<view>折扣金额</view>
<view>-¥{{orderInfo.discount_amount||0}}</view>
</view>
<view class="ts-line">
<view>优惠券优惠</view>
<view>-¥{{orderInfo.coupons_amount || 0}}</view>
</view>
<view class="ts-total">
<view>合计支付<text></text><text>{{orderInfo.pay_amount ||0}}</text></view>
</view>
</view>
</view>
<view class="td-box" v-if="orderInfo.pay_status != 0">
<view class="tb-title">支付信息</view>
<view class="tb-line">
<view>支付方式<text>{{zh_pay_type(orderInfo.pay_type)}}</text></view>
<view>支付时间<text>{{orderInfo.pay_time || '-'}}</text></view>
<view>微信交易号<text>{{orderInfo.trade_no || ''}}</text></view>
</view>
</view>
<view class="td-btn" @click="isShowEnd = !isShowEnd" v-if="orderInfo.pay_status == 0">结束计费</view>
<!-- 弹框 结束计费 -->
<view class="ox-dark-mask" v-if="isShowEnd" @touchmove.stop.prevent="moveHandle">
<view class="odm-end-modal">
<view class="oem-close">
<image src="/static/images/icon/x_close.png" @click="isShowEnd = false"></image>
</view>
<view class="oem-tit">结束计费</view>
<view class="oem-line">操作人{{orderInfo.end_bill_operator_name || '-'}}</view>
<view class="oem-line">时长合计<text class="ol-txt1">{{orderInfo.extension.duration || '-'}}</text></view>
<view class="oem-line">金额合计<text class="ol-txt2">¥{{orderInfo.amount || '-'}}</text></view>
<view class="oem-tips">*<text>请输入金额</text></view>
<view class="oem-ipt"><input type="digit" v-model="input_amount"/></view>
<view class="oem-btn" hover-class="hover-active" @click="confirmChange" >确认</view>
</view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api';
import { mapState } from 'vuex';
export default {
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
},
computed: {
...mapState(['brandInfo']),
zh_order_status(){
// 01
return status =>{
const _obj = {
'0': '计费中',
'1': '已完成',
'4': '已退款',
}
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
'3': '商家主动结束计费',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isShowEnd: false,
input_amount: "",
}
},
methods: {
confirmChange(){
let { brandInfo, orderInfo, input_amount } = this
if(input_amount == '')return util.showNone('请输入金额!');
util.showLoad();
deviceServer.get({
url: deviceApi.timeOrderEnd,
data: {
brand_id: brandInfo.brand.id,
order_no: orderInfo.order_no,
pay_amount: parseFloat(input_amount),
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
util.showNone('操作成功!');
this.isShowEnd = false
setTimeout(()=>uni.navigateBack(),1200);
})
},
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.timing-details{
margin-bottom: 24rpx;
.td-head{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx 10rpx 0px 0px;
.th-store{
padding-bottom: 26rpx;
margin-bottom: 18rpx;
border-bottom: 2rpx solid #D8D8D8;
display: flex;
justify-content: flex-start;
>image{
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
background-color: skyblue;
}
>view{
flex-grow: 1;
margin-left: 14rpx;
color: #333333;
font-size: 28rpx;
}
}
.th-line{
margin-top: 8rpx;
@include centerFlex(space-between);
>view{
line-height: 40rpx;
font-size: 28rpx;
&:first-child{
color: #9A9A9D;
>text{
color: #333333;
}
}
&:nth-child(2){
>text{
color: #9A9A9D;
}
.tl-active{
color: #009874;
}
}
}
}
}
.td-box{
margin: 24rpx 24rpx 0rpx;
padding: 30rpx;
background-color: #FFF;
border-radius: 10rpx;
.tb-title{
color: #9A9A9D;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.tb-line{
>view{
line-height: 52rpx;
font-size: 28rpx;
color: #9A9A9D;
>text{
color: #333333;
}
}
}
.tb-section{
margin-top: 30rpx;
border-top: 2rpx solid #D8D8D8;
.ts-line{
margin-top: 26rpx;
@include centerFlex(space-between);
>view{
color: #333333;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 24rpx;
margin-right: 8rpx;
}
}
}
.ts-total{
margin-top: 22rpx;
@include centerFlex(flex-end);
>view{
color: #333333;
font-size: 28rpx;
>text{
color: #FF873D;
&:first-child{
font-size: 28rpx;
}
&:nth-child(2){
font-size: 36rpx;
margin-right: 8rpx;
}
}
}
}
}
}
.td-btn{
height: 112rpx;
margin: 80rpx 24rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFF;
font-size: 32rpx;
line-height: 112rpx;
text-align: center;
}
.odm-end-modal{
position: absolute;
left: 65rpx;
top: 12%;
background-color: #fff;
width: 620rpx;
padding: 30rpx 0rpx 80rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.oem-close{
width: 100%;
@include centerFlex(flex-end);
>image{
width: 32rpx;
height: 32rpx;
margin-right: 30rpx;
}
}
.oem-tit {
color: #333;
font-size: 32rpx;
font-weight: 700;
margin: 16rpx 0rpx 34rpx;
}
.oem-line{
width: 456rpx;
color: #333;
font-size: 28rpx;
line-height: 48rpx;
.ol-txt1{
color: #009874;
}
.ol-txt2{
color: #FF873D;
}
}
.oem-tips{
width: 456rpx;
margin: 34rpx 0rpx 8rpx;
color: #EA5061;
font-size: 28rpx;
>text{
color: #333333;
}
}
.oem-ipt{
width: 456rpx;
border: 2rpx solid #D8D8D8;
border-radius: 10rpx;
& input {
flex-grow: 1;
height: 88rpx;
color: #333;
font-size: 28rpx;
padding: 0rpx 20rpx;
}
}
.oem-btn{
width: 240rpx;
height: 88rpx;
margin-top: 60rpx;
border-radius: 10rpx;
background-color: #009874;
color: #FFF;
font-size: 32rpx;
line-height: 88rpx;
text-align: center;
}
}
}
</style>

12
src/subpackage/device/js/device_api.js

@ -19,15 +19,21 @@ export const DEVICE_API = {
hardwareInfo:`${ORIGIN}/admin/stadium/hardware/get/`, // 设备信息
hardwareList:`${ORIGIN}/admin/stadium/hardware/list`, // 设备列表
ouxuanac:`${ORIGIN}/ouxuanac/sendPacket`, // 中控控制
// ouxuanac--> http://api.ouxuan.net/project/233/interface/api/10012 接口文档
// ouxuanac--> http://git.ouxuan.net/ouxuanac/ouxuanac-common/src/branch/master/cmd.ts // 接口参数结构 || ouxuanac.md
// PM:2021/4/19
reservationDetail:`${ORIGIN}/admin/assistant/stadiumOrder/detail`, //k-订单管理-场馆预约订单-预约场馆订单详情
unbindIccard:`${ORIGIN}/admin/assistant/unbindIccard`, //k-订单管理-解绑订单的ic卡
bindIcCard:`${ORIGIN}/admin/assiatant/bindIcCard`, //k-订单管理-绑定ic卡
checkIccard:`${ORIGIN}/admin/assistant/checkIccard`, //k-订单管理-校验ic卡
storeHouseList:`${ORIGIN}/admin/assistant/storeHouse/list`, //k-仓库列表
iccardList:`${ORIGIN}/admin/assistant/iccard/list`, //k-ic卡列表
timeOrderDetail:`${ORIGIN}/admin/assistant/timeOrder/detail`, //k-订单管理-计时订单详情
timeOrderEnd:`${ORIGIN}/admin/assistant/timeOrder/end`, //k-订单管理-订单计时结束
}
export default DEVICE_API;

99
src/subpackage/device/pages/order_details/order_details.vue

@ -0,0 +1,99 @@
<template>
<view class="order-details">
<block v-if="optionsQuery.order_type==3">
<reservation-site-detail :orderInfo="pageInfo" v-if="pageInfo.order_type == 0"></reservation-site-detail>
<reservation-people-detail :orderInfo="pageInfo" v-if="pageInfo.order_type == 1" @okChange="okChange"></reservation-people-detail>
</block>
<timing-detail :orderInfo="pageInfo" v-if="optionsQuery.order_type==1"></timing-detail>
</view>
</template>
<script>
import timingDetail from '../../components/order/timing_detail/timing_detail.vue'
import reservationSiteDetail from '../../components/order/reservation_site_detail/reservation_site_detail.vue';
import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue';
import util from '@/utils/util';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
import { mapState } from 'vuex';
export default {
components: {
'timing-detail': timingDetail,
'reservation-site-detail': reservationSiteDetail,
'reservation-people-detail': reservationPeopleDetail,
},
computed:{
titleName(){
let { optionsQuery } = this;
if(optionsQuery.order_type == 1)return '计时订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 3)return '预约订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 4)return '储值卡订单详情';
if(optionsQuery.order_type == 5)return '积分商城订单详情';
if(optionsQuery.order_type == 10)return '约玩订单详情';
return '订单详情'
},
...mapState(['brandInfo']),
},
data() {
return {
optionsQuery: {
stadium_id: '',
order_type: -1,
},
pageInfo: {},
}
},
onLoad(options) {
let _query = util.jsonPar(options.query);
this.optionsQuery = _query
this.$nextTick(_=>{
uni.setNavigationBarTitle({
title: this.titleName
})
})
this.getPageInfo({
orderType: _query.order_type,
stadium_id: _query.stadium_id,
order_no: _query.order_no,
})
},
methods: {
getApiUrl(type){
if(type == 1)return deviceApi.timeOrderDetail;
if(type == 3)return deviceApi.reservationDetail;
},
getPageInfo({orderType, stadium_id, order_no}){
util.showLoad();
deviceServer.get({
url: this.getApiUrl(orderType),
data: {
stadium_id,
order_no,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
this.pageInfo = res
})
.catch(util.hideLoad)
},
okChange(){
console.log("有了吗")
let { optionsQuery } = this
this.getPageInfo({
orderType: optionsQuery.order_type,
stadium_id: optionsQuery.stadium_id,
order_no: optionsQuery.order_no,
})
},
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.order-details{
}
</style>

112
src/subpackage/device/pages/order_manage/order_manage.vue

@ -1,11 +1,11 @@
<template>
<view class="order-manage">
<view class="om-section" v-for="k in 2" :key="k">
<view class="os-tit">订单管理</view>
<view class="om-section" v-for="(e, i) in tabList" :key="e.id">
<view class="os-tit">{{e.name}}</view>
<view class="os-tabs">
<view class="ot-item" v-for="i in 9" :key="i">
<image></image>
<view>预约订单</view>
<view class="ot-item" v-for="(j, k) in e.itemList" :key="k" @click="toPageInfo(j)">
<image mode="aspectFit" :src="'/subpackage/device/static/images/order/tab_'+ e.id + '_' + k + '.png'"></image>
<view>{{j.name}}</view>
</view>
</view>
</view>
@ -15,10 +15,107 @@
<script>
import store_name from '../../components/store_name/store_name';
import util from '@/utils/util';
const tabList = [
{
id: 0,
name: "订单管理",
itemList:[
{
id: 3,
name: "预约订单",
path: '/pages/order_list/order_list',
},
{
id: 1,
name: "计时订单",
path: '/pages/order_list/order_list',
},
{
id: 2,
name: "商城订单",
path: '',
},
{
id: 0,
name: "课程订单",
path: '',
},
{
id: 10,
name: "约玩订单",
path: '/pages/order_list/order_list',
// path: '',
},
{
id: 4,
name: "储值卡订单",
// path: '/pages/order_list/order_list',
path: '',
},
{
id: 6,
name: "售货柜订单",
path: '',
},
{
id: 7,
name: "储物柜订单",
path: '',
},
{
id: 8,
name: "租售柜订单",
path: '',
},
{
id: 9,
name: "咖啡机订单",
path: '',
},
{
id: 5,
name: "积分兑换订单",
path: '/pages/order_list/order_list',
},
{
id: 11,
name: "浴室订单",
path: '',
}
],
},
{
id: 1,
name: "售后维权订单",
itemList:[
{
id: 0,
name: "售后维权",
path: '',
},
],
},
];
export default {
components: {
'store-name': store_name
}
},
data(){
return{
tabList,
}
},
methods:{
toPageInfo(tabInfo){
if(!tabInfo.path)return util.showNone('待开放中!');
if(this.isOrderTab(tabInfo.id))return util.routeTo(tabInfo.path + `?order_type=${tabInfo.id}`,'nT');
util.routeTo(tabInfo.path,'nT');
},
isOrderTab(ID){
return ID == 3 || ID == 4 || ID == 5 || ID == 1 || ID == 10
},
}
}
</script>
@ -33,7 +130,7 @@ export default {
margin-bottom: 54upx;
padding: 0 40upx;
font-size: 32upx;
font-weight: 500;
font-weight: 700;
line-height: 44upx;
color: #333;
}
@ -50,7 +147,6 @@ export default {
display: block;
width: 60upx;
height: 60upx;
background-color: skyblue;
}
>view{
padding: 0 20upx;

BIN
src/subpackage/device/static/images/order/tab_0_0.png

After

Width: 60  |  Height: 60  |  Size: 878 B

BIN
src/subpackage/device/static/images/order/tab_0_1.png

After

Width: 60  |  Height: 60  |  Size: 1.4 KiB

BIN
src/subpackage/device/static/images/order/tab_0_10.png

After

Width: 60  |  Height: 60  |  Size: 1.7 KiB

BIN
src/subpackage/device/static/images/order/tab_0_11.png

After

Width: 60  |  Height: 60  |  Size: 1.4 KiB

BIN
src/subpackage/device/static/images/order/tab_0_2.png

After

Width: 60  |  Height: 60  |  Size: 1.8 KiB

BIN
src/subpackage/device/static/images/order/tab_0_3.png

After

Width: 60  |  Height: 60  |  Size: 1.4 KiB

BIN
src/subpackage/device/static/images/order/tab_0_4.png

After

Width: 60  |  Height: 60  |  Size: 2.7 KiB

BIN
src/subpackage/device/static/images/order/tab_0_5.png

After

Width: 60  |  Height: 60  |  Size: 856 B

BIN
src/subpackage/device/static/images/order/tab_0_6.png

After

Width: 60  |  Height: 60  |  Size: 1.5 KiB

BIN
src/subpackage/device/static/images/order/tab_0_7.png

After

Width: 60  |  Height: 60  |  Size: 709 B

BIN
src/subpackage/device/static/images/order/tab_0_8.png

After

Width: 60  |  Height: 60  |  Size: 2.3 KiB

BIN
src/subpackage/device/static/images/order/tab_0_9.png

After

Width: 60  |  Height: 60  |  Size: 1.6 KiB

BIN
src/subpackage/device/static/images/order/tab_1_0.png

After

Width: 60  |  Height: 60  |  Size: 2.2 KiB

BIN
src/subpackage/device/static/images/scan_code.png

After

Width: 48  |  Height: 48  |  Size: 553 B

243
src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue

@ -0,0 +1,243 @@
<template>
<view v-if="isShowCartList" class="hover-cart-list">
<view @click="maskClick"></view>
<view class="hover-cart-list-dialog" :style="{ height:cartListDialogHeight }">
<view class="hover-cart-list-dialog-title">
<view>商品名称</view>
<view>售价</view>
<view>数量</view>
</view>
<scroll-view class="hover-cart-list-dialog-content" :style="{ height:cartListHeight }" :scroll-top="0" :scroll-y="cartListScroll">
<view class="hover-cart-list-dialog-content-for" :style="{ borderBottom:cartListItemBorderBottom }" v-for="item in cartList" :key="item.id">
<view class="hover-cart-list-dialog-content-col1">
<view>{{ item.erp_goods_name }}</view>
<view>{{ item.erp_goods_specs }}</view>
</view>
<view class="hover-cart-list-dialog-content-col2">
<input type="digit" :value="item.erp_goods_price" @confirm="cartInputConfirm($event, item.id)" @blur="cartInputConfirm($event, item.id)" />
<view></view>
</view>
<view class="hover-cart-list-dialog-content-col3">
<image mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="cartCountClick('sub', item.id)"></image>
<view>{{ item.count }}</view>
<image mode="aspectFit" src="/static/images/icon/retail/add.png" @click="cartCountClick('add', item.id)"></image>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
props: [
"isShowCartList", "cartList", "cartListScroll",
"cartListHeight", "cartListDialogHeight", "cartListItemBorderBottom"
],
data() {
return {
}
},
onLoad() {
},
methods: {
//
maskClick() {
this.$emit("update:maskClick");
},
//
cartInputConfirm(event, id) {
//
// console.log(event.detail.value.match(/(([0-9]+\.[0-9]+)|([0-9]+))/g)); //
let value = parseFloat(event.detail.value ? event.detail.value : 0).toFixed(2);
for (let i = 0; i < this.cartList.length; ++i) {
if (this.cartList[i].id == id) {
this.$emit("update:cartInputConfirm", value, i);
}
}
},
//
cartCountClick(type, id) {
//
let item = null;
for (let i = 0; i < this.cartList.length; ++i) {
if (this.cartList[i].id == id) {
// item = this.cartList[i];
this.$emit("update:cartCountClick", type, i);
break;
}
}
},
}
}
</script>
<style lang="scss">
.hover-cart-list {
width: 100vw;
height: 100vh;
position: absolute;
left: 0rpx;
top: 0rpx;
>view {
&:first-child {
width: 100%;
height: 100%;
position: absolute;
left: 0rpx;
bottom: 0rpx;
bottom: calc( 108rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
bottom: calc( 108rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
background-color: rgba(0,0,0,0.5);
}
}
.hover-cart-list-dialog {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: fixed;
bottom: 0rpx;
bottom: calc( 108rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
bottom: calc( 108rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
width: 100%;
height: 878rpx;
background-color: rgb(255,255,255);
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
.hover-cart-list-dialog-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
height: 120rpx;
text-align: center;
padding-left: 34rpx;
padding-right: 36rpx;
>view {
font-size: 32rpx;
color: rgb(51,51,51);
&:first-child {
width: 258rpx;
}
&:nth-child(2) {
width: 166rpx;
}
&:nth-child(3) {
width: 126rpx;
}
}
}
.hover-cart-list-dialog-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-grow: 1;
height: 758rpx;
padding-left: 34rpx;
padding-right: 36rpx;
.hover-cart-list-dialog-content-for {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
flex-grow: 1;
height: 114rpx;
border-bottom: 1rpx solid rgb(216,216,216);
margin-top: 30rpx;
.hover-cart-list-dialog-content-col1 {
// display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 258rpx;
>view {
overflow: hidden;
word-break: nowrap;
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1; /** 显示的行数 **/
&:first-child {
font-size: 28rpx;
color: rgb(51,51,51);
margin-bottom: 8rpx;
}
&:nth-child(2) {
font-size: 24rpx;
color: rgb(154,154,157);
}
}
}
.hover-cart-list-dialog-content-col2 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: rgb(51,51,51);
font-size: 28rpx;
text-align: center;
width: 166rpx;
>input {
width: 132rpx;
height: 48rpx;
border: 2rpx solid rgb(216,216,216);
border-radius: 4rpx;
}
>view {
margin-left: 6rpx;
}
}
.hover-cart-list-dialog-content-col3 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 126rpx;
>image {
width: 36rpx;
height: 36rpx;
&:first-child {
}
&:nth-child(3) {
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
}
}
}
</style>

11
src/subpackage/retail/js/retail_api.js

@ -0,0 +1,11 @@
import { ORIGIN } from '../../../js/api';
export const RETAIL_API = {
assistantRetail:`${ORIGIN}/admin/assistant/retail`, // 收款出库
assistantListErpGoods:`${ORIGIN}/admin/assistant/listErpGoods`, // 物品管理
assistantListErpGoodsCate:`${ORIGIN}/admin/assistant/listErpGoodsCate`, // 物品分类管理
assistantGetAssistantStadiums:`${ORIGIN}/admin/assistant/getAssistantStadiums`, // 店铺列表
assistantListErpGoodsCateAndGoods:`${ORIGIN}/admin/assistant/listErpGoodsCateAndGoods`, // 物品分类物品列表
}
export default RETAIL_API;

10
src/subpackage/retail/js/retail_server.js

@ -0,0 +1,10 @@
import { Server } from '../../../js/server';
class RetailServer extends Server {
constructor(props){
super(props)
}
}
export default new RetailServer();

20
src/subpackage/retail/js/tools.js

@ -0,0 +1,20 @@
export const tools = {
// px转rpx
px2rpx: function(px) {
return (px / (uni.upx2px(px) / px));
},
// 获取新的数据对象
getNewObj: function(old) {
let newObj = {};
for (let key in old) {
newObj[key] = old[key];
}
return newObj;
},
}
export default tools;

502
src/subpackage/retail/pages/confirm_goods/confirm_goods.vue

@ -0,0 +1,502 @@
<template>
<view class="cg-container">
<view class="final-cart-list">
<view class="final-cart-list-dialog-title">
<view>商品名称</view>
<view>售价</view>
<view>数量</view>
</view>
<scroll-view class="final-cart-list-dialog-content" :scroll-top="0" :scroll-y="cartListScroll" :style="{ height:cartListFinalHeight, paddingBottom:cartListFinalPaddingBottom }">
<view class="final-cart-list-dialog-content-for" :style="{ borderBottom:item.borderBottom }" v-for="item in cartListFinal" :key="item.id">
<view class="final-cart-list-dialog-content-col1">
<view>{{ item.erp_goods_name }}</view>
<view>{{ item.erp_goods_specs }}</view>
</view>
<view class="final-cart-list-dialog-content-col2">
<input v-if="isEdited" type="digit" :value="item.erp_goods_price" @confirm="cartInputConfirm($event, item.id)" @blur="cartInputConfirm($event, item.id)" />
<view v-if="!isEdited">{{item.erp_goods_price}}</view>
<view></view>
</view>
<view class="final-cart-list-dialog-content-col3">
<image v-if="isEdited" mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="cartCountClick('sub', item.id)"></image>
<view>{{ item.count }}</view>
<image v-if="isEdited" mode="aspectFit" src="/static/images/icon/retail/add.png" @click="cartCountClick('add', item.id)"></image>
</view>
</view>
</scroll-view>
</view>
<view class="cg-footer">
<view>
<view class="cg-footer-price">
<view>合计</view>
<view><text></text>{{ totalPrice }}</view>
</view>
<view class="cg-footer-btn">
<view class="cg-footer-btn-reedit" v-if="!isEdited" @click="cartReedit"><button hover-class="hover-active">重新编辑</button></view>
<view class="cg-footer-btn-confirm" @click="cartConfirm"><button hover-class="hover-active">{{cartConfirmText}}</button></view>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util.js';
import tools from '../../js/tools';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
export default {
data() {
return {
isEdited: false, //
curStore: {}, //
cartListFinal: [], //
totalPrice: 0, //
cartConfirmText: "收款出库", // ||
cartListScroll: false, //
cartListFinalHeight: "0rpx", //
cartListFinalPaddingBottom: "0rpx", //
}
},
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.cartListFinal = [];
for (let i = 0; i < data.cartListFinal.length; ++i) {
this.cartListFinal.push(tools.getNewObj(data.cartListFinal[i]));
this.cartListFinal[i]["borderBottom"] = "1rpx solid rgb(216,216,216)";
}
//
this.cartListFinal[this.cartListFinal.length - 1]["borderBottom"] = "0rpx solid rgb(216,216,216)";
this.fixMainHeight(); //
this.calcTotalPrice(); //
util.showLoad();
setTimeout(util.hideLoad, 1000);
},
methods: {
//
cartReedit() {
this.isEdited = true;
this.cartConfirmText = "确认";
},
// ||
cartConfirm() {
if (this.cartConfirmText == "确认") {
this.isEdited = false;
this.cartConfirmText = "收款出库";
return;
}
let _this = this;
let data = [];
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].count) {
data.push({
id: this.cartListFinal[i].id,
name: this.cartListFinal[i].erp_goods_name,
price: this.cartListFinal[i].erp_goods_price,
nums: this.cartListFinal[i].count,
unit: this.cartListFinal[i].erp_goods_unit,
});
}
}
if (!data.length) {
util.showNone("暂无商品数量!");
return;
}
util.showLoad();
retailServer.post({
url: retailApi.assistantRetail,
data: {
store_id: _this.curStore.id,
goods_data: data,
},
isDefaultGet: false,
failMsg: '出库失败!'
}).then(res => {
if (res.data.code == 0) {
uni.setStorage({
key: "retailStatus",
data: "true",
success: function() {
util.hideLoad();
uni.navigateBack({
delta: 1
});;
},
fail: function(err) {
util.hideLoad();
uni.navigateBack({
delta: 1
});
},
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
cartInputConfirm(event, id) {
//
let value = parseFloat(event.detail.value ? event.detail.value : 0).toFixed(2);
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].id == id) {
this.cartListFinal[i].erp_goods_price = value;
}
}
this.calcTotalPrice(); //
},
//
cartCountClick(type, id) {
//
let item = null;
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].id == id) {
item = this.cartListFinal[i];
break;
}
}
if (item) {
switch (type) {
case "add": {
//
if (item.count + 1 > item.stock_num) {
util.showNone("库存就这么多了!");
return;
}
item.count += 1;
} break;
case "sub": {
if (item.count <= 0) {
return;
}
item.count -= 1;
} break;
}
this.calcTotalPrice(); //
}
},
//
calcTotalPrice() {
let price = 0.0;
for (let i = 0; i < this.cartListFinal.length; ++i) {
price += (this.cartListFinal[i].count * this.cartListFinal[i].erp_goods_price);
}
this.totalPrice = price.toFixed(2);
},
//
fixMainHeight() {
let _this = this;
uni.getSystemInfo({
success: res => {
console.log(res);
let sumHeight = res.windowHeight; //
// //
let query = uni.createSelectorQuery().select(".cg-footer");
query.boundingClientRect(data => {
sumHeight = sumHeight - data.height - uni.upx2px(90); // footer
let contentHeight = sumHeight;
query = uni.createSelectorQuery().select(".final-cart-list-dialog-content-for");
query.boundingClientRect(data => {
let itemSize = (data.height + uni.upx2px(30)); // 30margin
let limitCount = Math.floor(contentHeight / itemSize);
let height = _this.cartListFinal.length >= limitCount ? contentHeight : _this.cartListFinal.length * itemSize;
_this.cartListFinalHeight = `${tools.px2rpx(height)}rpx`;
// safeArea,44iphoneX
if (height >= contentHeight) {
_this.cartListScroll = true;
_this.cartListFinalPaddingBottom = `${res.safeArea.top >= 44 ? tools.px2rpx(res.safeArea.top) : 0}rpx`;
}
}).exec();
}).exec();
}
});
},
}
}
</script>
<style lang="scss">
page {
// background-color: rgb(237,237,245);
background-color: rgb(255,255,255);
}
.cg-container {
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
// border: 1px solid red;
.final-cart-list {
display: flex;
flex-direction: column;
// width: 100%;
// height: 100%;
flex-grow: 1;
background-color: rgb(237,237,245);
.final-cart-list-dialog-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
height: 90rpx;
text-align: center;
padding-left: 34rpx;
padding-right: 36rpx;
background-color: rgb(255,255,255);
>view {
font-size: 32rpx;
color: rgb(51,51,51);
&:first-child {
width: 258rpx;
}
&:nth-child(2) {
width: 166rpx;
}
&:nth-child(3) {
width: 126rpx;
}
}
}
.final-cart-list-dialog-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// flex-grow: 1;
// height: 428rpx;
padding-left: 34rpx;
padding-right: 36rpx;
background-color: rgb(255,255,255);
// padding-bottom: 0rpx;
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
.final-cart-list-dialog-content-for {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
// flex-grow: 1;
height: 114rpx;
border-bottom: 1rpx solid rgb(216,216,216);
background-color: rgb(255,255,255);
margin-top: 30rpx;
.final-cart-list-dialog-content-col1 {
// display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 258rpx;
>view {
overflow: hidden;
word-break: nowrap;
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1; /** 显示的行数 **/
&:first-child {
font-size: 28rpx;
color: rgb(51,51,51);
margin-bottom: 8rpx;
}
&:nth-child(2) {
font-size: 24rpx;
color: rgb(154,154,157);
}
}
}
.final-cart-list-dialog-content-col2 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: rgb(51,51,51);
font-size: 28rpx;
text-align: center;
width: 166rpx;
>input {
width: 132rpx;
height: 48rpx;
border: 2rpx solid rgb(216,216,216);
border-radius: 4rpx;
}
>view {
&:first-child {
}
&:nth-child(2) {
margin-left: 6rpx;
}
}
}
.final-cart-list-dialog-content-col3 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 126rpx;
>image {
width: 36rpx;
height: 36rpx;
&:first-child {
}
&:nth-child(3) {
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
}
}
.cg-footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// flex-grow: 1;
// opacity: 0.3;
position: fixed;
// bottom: 0rpx;
bottom: calc( 0rpx + constant(safe-area-inset-bottom));
bottom: calc( 0rpx + env(safe-area-inset-bottom));
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
width: 100%;
height: 188rpx;
// border: 1rpx solid blue;
background-color: rgb(255,255,255);
>view {
display: flex;
flex-direction: column;
// justify-content: flex-end;
align-items: flex-start;
width: 100%;
height: 100%;
.cg-footer-price {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 88rpx;
width: 100%;
padding-right: 40rpx;
>view {
&:first-child {
font-size: 24rpx;
}
&:nth-child(2) {
color: rgb(255,135,61);
font-size: 32rpx;
>text {
font-size: 24rpx;
}
}
}
}
.cg-footer-btn {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 88rpx;
width: 100%;
padding-right: 24rpx;
font-size: 32rpx;
> view {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.cg-footer-btn-reedit {
>button {
width: 242rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
padding: 0 0;
color: rgb(0,152,116);
background-color: rgb(255,255,255);
border: 2rpx solid rgb(0,152,116);
margin-right: 20rpx;
}
}
.cg-footer-btn-confirm {
>button {
width: 242rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
padding: 0 0;
color: rgb(255,255,255);
background-color: rgb(0,152,116);
border: 2rpx solid rgb(0,152,116);
}
}
}
}
}
}
</style>

1026
src/subpackage/retail/pages/index/index.vue
File diff suppressed because it is too large
View File

295
src/subpackage/retail/pages/search/search.vue

@ -0,0 +1,295 @@
<template>
<view class="search-container">
<view class="search-row">
<view>
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称、sku"
v-model="searchText"
focus="true"
/>
<image @click="searchClear" mode="aspectFit" src="/static/images/icon/retail/searchClear.png"></image>
</view>
<button hover-class="hover-active" @click="searchTrigger(searchText, 'search')">搜索</button>
</view>
<view class="history-search">
<view>
<view>历史搜索</view>
<image @click="searchHistoryDelete" mode="aspectFit" src="/static/images/icon/retail/historySearchDelete.png"></image>
</view>
<view>
<view v-for="(item, index) in historyList" :key="index" @click="searchTrigger(item, 'text')">{{ item }}</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util.js';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
export default {
data() {
return {
searchText: "", //
historyList: [], //
curStore: {}, //
}
},
onLoad(option) {
this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
},
methods: {
//
searchHistoryDelete() {
if (this.historyList.length <= 0) {
util.showNone("暂无历史数据!");
return;
}
let _this = this;
uni.showModal({
content: '确人删除全部历史记录?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
_this.historyList = [];
uni.removeStorage({
key: 'searchHistoryData',
success: function (res) {
console.log('success');
}
});
}
else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
searchClear() {
this.searchText = "";
},
//
searchTrigger(text, type) {
if (!text) {
util.showNone("请输入商品名称、sku");
return;
}
let _this = this;
if (type == "search") {
//
_this.historyList.push(text);
uni.setStorage({
key: 'searchHistoryData',
data: _this.historyList,
success: function() {
console.log('success');
},
fail: function(err) {
console.log(err);
},
});
}
util.showLoad();
retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods,
data: {
assistant_key: text,
stadium_id: _this.curStore.id,
},
isDefaultGet: false,
failMsg: '搜索失败!'
}).then(res => {
if (res.data.code == 0) {
let mark = false;
for (let i = 0; i < res.data.data.list.length; ++i) {
if (res.data.data.list[i].goods_list && res.data.data.list[i].goods_list.length) {
mark = true;
}
}
//
if (!mark) {
util.showNone("暂无数据");
return;
}
uni.setStorage({
key: "searchData",
data: res.data.data.list,
success: function() {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
util.showNone("搜索失败");
},
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
getSearchHistory() {
let _this = this;
uni.getStorage({
key: 'searchHistoryData',
success: function (res) {
console.log(res.data);
for (let i = 0; i < res.data.length; ++i) {
_this.historyList.push(res.data[i]);
}
},
fail: function(err) {
console.log(err);
_this.historyList = [];
},
});
},
}
}
</script>
<style lang="scss">
.search-container {
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.search-row {
display: flex;
align-items: center;
justify-content: center;
height: 152rpx;
background-color: rgb(255,255,255);
>view {
display: flex;
align-items: center;
justify-content: space-between;
flex-grow: 1;
height: 92rpx;
border-radius: 10rpx;
background-color: rgb(242,242,247);
margin-left: 24rpx;
padding-left: 20rpx;
padding-right: 20rpx;
>input {
flex-grow: 1;
height: 100%;
font-size: 32rpx;
}
>image{
flex-shrink: 0;
&:first-child {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
&:nth-child(3) {
width: 32rpx;
height: 32rpx;
margin-left: 20rpx;
}
}
}
>button {
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
width: 100rpx;
height: 62rpx;
line-height: 62rpx;
font-size: 32rpx;
color: rgb(255,255,255);
background-color: rgb(6,147,137);
border-radius: 10rpx;
white-space: nowrap;
padding: 0 0;
}
}
.history-search {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: white;
padding-top: 26rpx;
padding-left: 26rpx;
>view {
width: 100%;
&:first-child {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 26rpx;
>view {
font-size: 32rpx;
font-weight: bold;
}
>image {
width: 36rpx;
height: 36rpx;
margin-right: 26rpx;
}
}
&:nth-child(2) {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
>view {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 66rpx;
font-size: 28rpx;
color: rgb(193,193,199);
background-color: rgb(242,242,247);
border-radius: 32rpx;
padding-left: 30rpx;
padding-right: 30rpx;
margin-right: 26rpx;
margin-bottom: 26rpx;
}
}
}
}
}
</style>

BIN
src/subpackage/retail/static/images/add.png

After

Width: 36  |  Height: 36  |  Size: 314 B

BIN
src/subpackage/retail/static/images/back.png

After

Width: 32  |  Height: 32  |  Size: 241 B

BIN
src/subpackage/retail/static/images/cart.png

After

Width: 84  |  Height: 84  |  Size: 2.0 KiB

BIN
src/subpackage/retail/static/images/dropDown.png

After

Width: 18  |  Height: 18  |  Size: 185 B

BIN
src/subpackage/retail/static/images/historySearchDelete.png

After

Width: 36  |  Height: 36  |  Size: 365 B

BIN
src/subpackage/retail/static/images/home.png

After

Width: 36  |  Height: 36  |  Size: 364 B

BIN
src/subpackage/retail/static/images/search.png

After

Width: 40  |  Height: 40  |  Size: 372 B

BIN
src/subpackage/retail/static/images/searchClear.png

After

Width: 32  |  Height: 32  |  Size: 356 B

Loading…
Cancel
Save