10 changed files with 375 additions and 44 deletions
-
5src/components/filter/header.vue
-
9src/pages/index/index.vue
-
BINsrc/static/images/icon/index/tab_13.png
-
3src/store/index.js
-
37src/subpackage/device/pages/switch_manage/switch_manage.vue
-
1src/subpackage/shower/components/popup/deduction.vue
-
146src/subpackage/shower/components/popup/device_deduction.vue
-
3src/subpackage/shower/js/api.js
-
125src/subpackage/shower/pages/device/use_detail.vue
-
90src/subpackage/shower/pages/device/use_record.vue
After Width: 138 | Height: 100 | Size: 573 B |
@ -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> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue