Browse Source

fix md0726

md0726
刘嘉炜 4 months ago
parent
commit
59a7a87534
  1. 5
      src/components/filter/header.vue
  2. 9
      src/pages/index/index.vue
  3. BIN
      src/static/images/icon/index/tab_13.png
  4. 3
      src/store/index.js
  5. 37
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  6. 1
      src/subpackage/shower/components/popup/deduction.vue
  7. 146
      src/subpackage/shower/components/popup/device_deduction.vue
  8. 3
      src/subpackage/shower/js/api.js
  9. 125
      src/subpackage/shower/pages/device/use_detail.vue
  10. 90
      src/subpackage/shower/pages/device/use_record.vue

5
src/components/filter/header.vue

@ -17,7 +17,7 @@
<text v-if="isCount">成功交易{{ successCount || 0 }}退款{{ refundCount || 0 }}</text>
</view>
<view class="ob-btns">
<image @click="$emit('click:search')" class="ob-icon" src="/static/images/icon/search.png"></image>
<image v-if="isSearch" @click="$emit('click:search')" class="ob-icon" src="/static/images/icon/search.png"></image>
<image @click="$emit('click:filter')" class="ob-icon" src="/static/images/icon/filter.png"></image>
</view>
</view>
@ -43,7 +43,8 @@ export default {
refundCount: {
default: 0
},
isCount: Boolean
isCount: Boolean,
isSearch: Boolean
},
data(){
return {

9
src/pages/index/index.vue

@ -151,6 +151,12 @@
serverKey: 1014 // 1014
},
{
id: 13,
name: '水阀卡管理',
path: '/subpackage/shower/pages/card/manage',
serverKey: 1019 // 1019
},
{
id: 10,
name: '进场人数异常',
path: '/subpackage/blacklist/pages/abnormal_list/abnormal_list',
@ -251,12 +257,11 @@
});
}
if([ 10, 11, 4 ].includes(tabInfo.id))return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if([ 10, 11, 4, 13 ].includes(tabInfo.id))return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if(tabInfo.id === 12){
// if(!indexData.brand.mini_wechat_appid)return util.showNone('appid')
let url = tabInfo.path + `?appid=${indexData.brand.mini_wechat_appid}`
console.log(222,url)
return util.routeTo(url,'nT');
}

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

After

Width: 138  |  Height: 100  |  Size: 573 B

3
src/store/index.js

@ -45,7 +45,8 @@ export default new Vuex.Store({
'1015': '进场人数异常',
'1016': '系统工具',
'1017': '钱包提现',
'1018': '退款权限'
'1018': '退款权限',
'19': '水阀卡管理',
},
// 场地占用提交页面信息
occupyInfo: {

37
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -5,7 +5,6 @@
<view class="sm-tip" v-if="pageInfo.longOpenName"><text>*</text>长开表示不再被系统智能控制只有手动关闭后才会被智能控制请谨慎操作</view>
<view class="sm-list">
<view v-for="(e, i) in deviceList" :key="i" :class="[ 'sl-item', pageInfo.iconNum<=2?'sl-limit':'' ]">
<view class="si-top" >
<image mode="aspectFit" :src="getIcon()" ></image>
<view class="st-right">
@ -60,6 +59,13 @@
</view>
</view>
</view>
<!-- md0726 新增水阀使用记录按钮 -->
<block v-if="pageInfo.id === 11">
<view class="sm-fixed-space"></view>
<view class="sm-fixed">
<view class="sf-btn" @click="toWaterRecord">水阀使用记录</view>
</view>
</block>
</view>
</template>
@ -72,7 +78,7 @@ import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
import { mapState } from 'vuex';
import util from '../../../../utils/util';
import util, { routeTo } from '../../../../utils/util';
import DEVICE_FUN from '../../js/device_fun.js';
export default {
@ -139,6 +145,11 @@ export default {
}, 1000)
},
methods: {
// 使
toWaterRecord(){
let { curStoreInfo } = this;
routeTo(`/subpackage/shower/pages/device/use_record?brand_id=${curStoreInfo?.brand_id || ''}`, 'nT')
},
isDetailBtn(e){
if(e&&e.toString() === "[object Object]"){
return e.hardware_model == 'XiaoHuiXiong' && e.hardware_type === 'Air';
@ -552,12 +563,11 @@ function getShowArr(key){
openName: '开', closeName: '关', hardware_type: 'Router4G',iconNum:1
},
's11': {
id: 11, name: '水阀管理', isOpen: true, isClose: true,isLongOpen:true, isTiming:true,
id: 11, name: '水阀管理', isOpen: true, isClose: true, isTiming:true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
longOpenIcon: '/subpackage/device/static/images/longOpen.png',
timingIcon: '/subpackage/device/static/images/timing.png',
openName: '开', closeName: '关', hardware_type: 'WaterValve',longOpenName: '长开', timingName: '定时',iconNum:4,
openName: '开', closeName: '关', hardware_type: 'WaterValve', timingName: '定时',iconNum:4,
},
's12': {
id: 12, name: '互动设备管理', isOpen: true, isClose: true,
@ -768,4 +778,21 @@ function getShowArr(key){
}
}
}
.sm-fixed-space{
padding-bottom: 132upx;
@include isPd(132upx);
}
.sm-fixed{
position: fixed;
bottom: 0;
padding: 10upx 24upx;
width: 100%;
@include isPd(10upx);
.sf-btn{
text-align: center;
border-radius: 10upx;
background: $mColor;
@include flcw(32upx, 112upx, #fff, 500);
}
}
</style>

1
src/subpackage/shower/components/popup/deduction.vue

@ -99,6 +99,7 @@ export default {
water_card_no: initData?.water_card_no || '',
brand_id: initData?.brand_id || '',
stadium_id: initData?.stadium_id || '',
resource_type: 2 // 02
}
// console.log('', _queryObj);
// initData?.success?.();

146
src/subpackage/shower/components/popup/device_deduction.vue

@ -0,0 +1,146 @@
<template>
<view class="recharge-popup">
<popup-template
title="结束计时"
:show="isShow"
@click:close="hide"
>
<view class="rp-container">
<kv-line label="时长合计:">{{ initData.settle_duration || '-' }}</kv-line>
<view class="rc-space"></view>
<number-edit label="扣减时长" unit="分钟" v-model="editData.minute"></number-edit>
<view class="rc-btn" @click="confirm">确认</view>
</view>
</popup-template>
</view>
</template>
<script>
import popup_template from "./template.vue";
import kv_line from "@/components/kv_line.vue";
import number_edit from "../number_edit.vue";
import { SHOWER_API } from "../../js/api";
import server from "../../js/server";
import { formatDate, formatNumber, formatTime, showNone, debounce, showLoad, hideLoad, showModal } from "@/utils/util";
export default {
components: {
'popup-template': popup_template,
'kv-line': kv_line,
'number-edit': number_edit
},
data(){
return {
isShow: false,
initData: {},
editData: {
minute: 10
}
}
},
methods: {
confirm: debounce(function(){
let { initData, editData } = this;
// initData?.success?.({
// deductionMinute: +editData?.minute
// });
let _query = {
duration: +editData?.minute,
id: initData?.id,
stadium_id: initData?.stadium_id,
brand_id: initData?.brand_id,
}
this.deductionReq(_query);
this.hide();
}, 300, true),
init(data){
this.initData = data;
this.editData.minute = data?.settle_duration || 10;
this.show();
},
show(){
this.isShow = true;
},
hide(){
this.isShow = false;
},
deductionReq(data){
showLoad();
return server.post({
url: SHOWER_API.endOfUseWaterWave,
data,
isDefaultGet: false,
})
.then(res => {
hideLoad();
let _data = res?.data || {};
if(_data.code === 0){
showModal({
title: '提示',
content: _data.message || '操作成功!'
})
this.initData?.success?.('SUCCESS');
}else{
return Promise.reject(_data);
}
})
.catch(err => {
hideLoad();
showModal({
title: '提示',
content: err.message || '操作失败!'
})
console.warn('deduction deductionReq err --->', err);
})
},
}
}
</script>
<style lang="scss">
.rp-container{
padding: 0 60upx;
.rc-space{
padding-top: 40upx;
}
.rc-orange{
color: #FF873D;
}
.rc-time-select{
margin-top: 40upx;
@include ctf(space-between);
.rts-name{
flex-shrink: 0;
@include flcw(28upx, 40upx, #1A1A1A);
}
.rts-ipt{
display: block;
box-sizing: border-box;
padding: 10upx 30upx;
width: 358upx;
height: 56upx;
border-radius: 10upx;
background: #F2F2F7;
@include flcw(24upx, 34upx, #333333);
}
}
.rc-remark{
width: auto;
margin-top: 40upx;
padding: 20upx 24upx;
height: 144upx;
background: #F2F2F7;
@include flcw(24upx, 34upx, #333333);
}
.rc-btn{
margin: 64upx auto 0upx;
width: 240upx;
height: 88upx;
text-align: center;
border-radius: 10upx;
background: $mColor;
@include flcw(28upx, 88upx, #fff);
}
}
</style>

3
src/subpackage/shower/js/api.js

@ -7,7 +7,8 @@ export const SHOWER_API = {
CardRecharge:`${ORIGIN}/admin/stadiumWaterCard/recharge`, // 后台-水卡-充值
CardFeeDeduction:`${ORIGIN}/admin/stadiumWaterCard/feeDeduction`, // 后台-水卡-扣费
waterOrderList:`${ORIGIN}/admin/stadiumWaterCardUseRecord/list`, // 后台-水阀订单-列表
waterOrderDetail:`${ORIGIN}/admin/stadiumWaterCardOrder/details`, // 后台-水阀订单-详情
waterOrderDetails:`${ORIGIN}/admin/stadiumWaterCardUseRecord/details`, // 后台-水阀订单-详情
endOfUseWaterWave:`${ORIGIN}/admin/stadiumWaterCardUseRecord/endOfUseWaterWave`, // 后台-水卡使用记录-详情
// CardList:`${ORIGIN}/admin/stadiumWaterCardUseRecord/list`, // 后台-水卡使用记录-列表
// CardListOfCard:`${ORIGIN}/admin/stadiumWaterCardUseRecord/listOfCard`, // 后台-水卡使用记录-(某张水卡的)列表
}

125
src/subpackage/shower/pages/device/use_detail.vue

@ -2,44 +2,141 @@
<view class="use-detail">
<view class="ud-box">
<view class="ub-stadium">
<image class="us-logo"></image>
<view class="us-name">欧轩智能羽毛球馆(永泰店)</view>
<image class="us-logo" mode="aspectFit" :src="orderInfo.logo"></image>
<view class="us-name">{{ orderInfo.stadium_name || '-' }}</view>
</view>
<view class="ub-lines">
<kv-line label="创建时间:">
<template slot="default">2019-05-17 11:12:58</template>
<template slot="default">{{ orderInfo.created_at || '-' }}</template>
<template slot="right">
<view class="ul-status">已完成</view>
<view class="ul-status">{{ statusTxt || '' }}</view>
</template>
</kv-line>
<kv-line label="手机号码:">18656456895</kv-line>
<kv-line label="用户昵称:">yiming</kv-line>
<kv-line label="手机号码:">{{ orderInfo.mobile || '-' }}</kv-line>
<kv-line label="用户昵称:">{{ orderInfo.nick_name || '-' }}</kv-line>
<kv-line label="结束计时方式:">小程序(欧轩智能场馆)</kv-line>
</view>
</view>
<view class="ud-box">
<kv-line label="计时信息"></kv-line>
<view class="ub-lines">
<kv-line label="设备名称:">1号水阀</kv-line>
<kv-line label="开始时间:">2020-01-10 15:02:24</kv-line>
<kv-line label="结束时间:">2020-01-10 17:20:24</kv-line>
<kv-line label="时长合计:">35分9秒(免费时长:15分00秒)</kv-line>
<kv-line label="免费时长:">15分00秒</kv-line>
<kv-line label="设备名称:">{{ orderInfo.hardware_name || '-' }}</kv-line>
<kv-line label="开始时间:">{{ orderInfo.start_time || '-' }}</kv-line>
<kv-line label="结束时间:" v-if="orderInfo.status === 1">{{ orderInfo.end_time || '-' }}</kv-line>
<kv-line label="时长合计:">{{ orderInfo.settle_duration || '-' }}</kv-line>
<kv-line label="免费时长:" v-if="orderInfo.status === 1">{{ orderInfo.free_duration || '-' }}</kv-line>
</view>
<view class="ui-deduction">
<text class="ud-txt">扣减时长</text>20分钟00秒
<view class="ui-deduction" v-if="orderInfo.status === 1">
<text class="ud-txt">扣减时长</text>{{ orderInfo.deduction_duration || '-' }}
</view>
<view class="ui-btn">结束计时</view>
<view class="ui-btn" v-if="orderInfo.status === 0" @click="endTimekeeping">结束计时</view>
</view>
<!-- 结束计时弹窗 -->
<device-deduction ref="deviceDeduction"></device-deduction>
</view>
</template>
<script>
import kv_line from "@/components/kv_line.vue";
import deviceDeduction from "../../components/popup/device_deduction.vue";
import { SHOWER_API } from "../../js/api";
import server from "../../js/server";
import { routeTo, showLoad, hideLoad } from "@/utils/util";
export default {
components: {
'kv-line': kv_line,
'device-deduction': deviceDeduction
},
computed: {
statusTxt(){
let { orderInfo } = this;
switch(+orderInfo.status){
case 0:
return '正在计时';
case 1:
return '已完成';
default:
return '-';
}
},
/**
* SettleType = 0 //3
SettleType = 1 // 2
SettleType = 2 // 2
SettleType = 3 //
* */
settleTypeTxt(){
let { orderInfo } = this;
switch(+orderInfo.settle_type){
case 0:
return '小程序结束';
case 1:
return '后台结束';
case 2:
return '硬件结束';
case 3:
return '商家助手结束';
default:
return '-';
}
}
},
data(){
return {
orderInfo: {},
}
},
onLoad(options){
this.getUseDetail({
id: options?.id || '',
brand_id: options?.brand_id || ''
})
.then(res=>{
if(res?.status === 0&&options?.isRefund === '1')this.endTimekeeping();
})
},
methods: {
endTimekeeping(){
let { orderInfo } = this;
this.$refs.deviceDeduction.init({
settle_duration: orderInfo?.settle_duration || 0,
id: orderInfo?.id || '',
stadium_id: orderInfo?.stadium_id || '',
brand_id: orderInfo?.brand_id || '',
success: res=>{
this.getUseDetail({
id: orderInfo?.id || '',
brand_id: orderInfo?.brand_id || ''
});
}
});
},
getUseDetail({
id = '', brand_id = ''
}){
showLoad();
return server.get({
url: SHOWER_API.waterOrderDetails,
data: { brand_id, id },
failMsg: '获取信息失败'
})
.then(res => {
hideLoad();
return this.orderInfo = res || {};
})
.catch(err => {
hideLoad();
console.warn('use_detail getUseDetail err --->', err);
// return Promise.reject(err);
})
},
}
}
</script>

90
src/subpackage/shower/pages/device/use_record.vue

@ -2,6 +2,7 @@
<view class="use-record">
<order-filter
ref="orderFilter"
@change:stadium="condition.stadium_id = $event.id"
@click:time="showPeriodModal"
@click:filter="showFilterModal"
:start-time="condition.start_time"
@ -9,7 +10,7 @@
></order-filter>
<view class="ur-list">
<!-- status 0进行中1已完成 -->
<view class="ul-item" v-for="(e, i) in orderList" :key="i">
<view class="ul-item" v-for="(e, i) in orderList" :key="i" @click="toDetail(e)">
<view class="ui-bar">
<view class="ub-name">{{ e.stadium_name || '-' }}</view>
<image class="ub-icon" mode="aspectFit" src="/subpackage/shower/static/images/arrow.png"></image>
@ -28,13 +29,15 @@
<view class="ui-deduction" v-if="e.status === 1">
<text class="ud-txt">扣减时长</text>{{ e.deduction_duration || '0' }}
</view>
<view class="ui-btn" v-if="e.status === 0">结束计时</view>
<view class="ui-btn" v-if="e.status === 0" @click.stop="endTimekeeping(e)">结束计时</view>
</view>
</view>
<!-- 时间段选择 -->
<period-modal ref="periodModal"></period-modal>
<!-- status窗口 -->
<filter-modal ref="filterModal"></filter-modal>
<!-- 结束计时弹窗 -->
<device-deduction ref="deviceDeduction"></device-deduction>
</view>
</template>
@ -43,6 +46,7 @@ import orderFilter from "@/components/filter/header.vue";
import periodModal from "@/components/filter/period_modal.vue";
import filterModal from "@/components/filter/filter_modal.vue";
import kv_line from "@/components/kv_line.vue";
import deviceDeduction from "../../components/popup/device_deduction.vue";
import { SHOWER_API } from "../../js/api";
import server from "../../js/server";
@ -52,19 +56,22 @@ export default {
'order-filter': orderFilter,
'period-modal': periodModal,
'filter-modal': filterModal,
'kv-line': kv_line
'kv-line': kv_line,
'device-deduction': deviceDeduction
},
condition: {
handler(nVal, oVal){
this.orderList = [];
this.page = 1;
let { brand_id } = this;
// this.getOrderList({
// brand_id: brand_id || '',
// ...nVal,
// })
watch: {
condition: {
handler(nVal, oVal){
this.orderList = [];
this.page = 1;
let { brand_id } = this;
this.getOrderList({
brand_id: brand_id || '',
...nVal,
})
},
deep: true
},
deep: true
},
data(){
return {
@ -75,22 +82,59 @@ export default {
status: '' // 01
},
orderList: [],
page: 1
page: 1,
brand_id: ''
}
},
onLoad(options){
onReachBottom(){
let { condition, page, brand_id } = this;
this.getOrderList({
...condition,
page: ++page,
brand_id
})
},
async onLoad(options){
this.$refs.orderFilter.initStadiumSelect(options?.brand_id);
this.getOrderList({ brand_id: options?.brand_id });
this.brand_id = options?.brand_id || '';
// this.getOrderList({ brand_id: options?.brand_id });
this.initDate();
console.log(this.condition)
},
methods: {
endTimekeeping(e){
let _qryStr = `id=${e?.id || ''}&brand_id=${e?.brand_id || ''}&isRefund=1`;
routeTo(`/subpackage/shower/pages/device/use_detail?${_qryStr}`, 'nT');
return
this.$refs.deviceDeduction.init({
settle_duration: e?.settle_duration || 0,
id: e?.id || '',
stadium_id: e?.stadium_id || '',
brand_id: e?.brand_id || '',
success: res=>{
let { condition, brand_id } = this;
this.orderList = [];
this.page = 1;
this.getOrderList({
brand_id: brand_id || '',
...condition
})
}
});
},
toDetail(e){
let _qryStr = `id=${e?.id || ''}&brand_id=${e?.brand_id || ''}`;
routeTo(`/subpackage/shower/pages/device/use_detail?${_qryStr}`, 'nT');
},
//
initDate(){
let _Date = new Date();
let _timeStamp = _Date.getTime();
let _start = _timeStamp - 90 * 24 * 60 * 60 * 1000;
this.condition.start_time = formatDate({ date: _start });
this.condition.end_time = formatDate({ date: _timeStamp });
Object.assign(this.condition, {
start_time: formatDate({ date: _start }),
end_time: formatDate({ date: _timeStamp })
})
},
showPeriodModal(){
let { start_time, end_time } = this.condition;
@ -130,7 +174,15 @@ export default {
showLoad();
return server.get({
url: SHOWER_API.waterOrderList,
data: { brand_id, stadium_id, start_time, end_time, status, page, page_size },
data: {
brand_id,
stadium_id,
start_time: `${start_time} 00:00:00`,
end_time: `${end_time} 23:59:59`,
status,
page,
page_size
},
failMsg: '获取水阀订单失败'
})
.then(res => {

Loading…
Cancel
Save