Commit a867a070 authored by Facius's avatar Facius

feat: 维修订单

parent 54d297cb
Pipeline #2774 canceled with stages
<template>
<u-navbar
:back-text="title"
:back-text-style="backTextStyle"
:background="background"
:border-bottom="false"
>
<view
class="slot-wrap"
slot="right"
hover-class="u-hover-class"
@click="$u.throttle(handleClickRight, 500)"
>
<view v-if="image" class="image-view"><image :src="image"></image></iamge></view>
<view>{{ text }}</view>
</view>
</u-navbar>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '',
},
text: {
type: String,
default: '导出账单',
},
image: {
type: String,
default: '',
},
background: {
type: Object,
default() {
return { 'background-color': 'transparent' }
},
},
backTextStyle: {
type: Object,
default() {
return { color: '#191C27', 'font-size': 'weight', 'font-size': '32rpx', 'margin-left': '8rpx' }
},
},
},
data() {
return {}
},
computed: {},
methods: {
handleClickRight() {
this.$emit('click')
},
},
}
</script>
<style scoped lang="scss">
.slot-wrap {
display: flex;
align-items: center;
justify-content: center;
width: 160rpx;
height: 48rpx;
border-radius: 24rpx;
background-color: #ffffff;
color: #333333;
font-size: 24rpx;
margin-right: 8rpx;
.image-view {
width: 20rpx;
height: 24rpx;
margin-right: 8rpx;
}
}
</style>
...@@ -59,6 +59,19 @@ ...@@ -59,6 +59,19 @@
} }
] ]
},
{
"root": "pages/maintain-bill",
"pages": [{
"path": "index",
"name": "maintain-bill",
"style": {
"navigationBarTitleText": "维修记账",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
}]
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<view class="left-view">本月结余(元)</view> <view class="left-view">本月结余(元)</view>
<view <view
class="right-view" class="right-view"
hover-class="u-hover-class"
@click="$u.throttle(handleSelectDate, 500)" @click="$u.throttle(handleSelectDate, 500)"
> >
<view class="date-view">{{ date }}</view> <view class="date-view">{{ date }}</view>
...@@ -134,6 +135,7 @@ ...@@ -134,6 +135,7 @@
><view>领取3天体验资格</view></view ><view>领取3天体验资格</view></view
> >
</PopNormal> </PopNormal>
<u-toast ref="uToast" />
<mid-popup ref="midPopup"></mid-popup> <mid-popup ref="midPopup"></mid-popup>
<u-tabbar <u-tabbar
:list="tabbar" :list="tabbar"
...@@ -230,7 +232,7 @@ export default { ...@@ -230,7 +232,7 @@ export default {
return [ return [
{ {
image: this.baseUrl + 'beijing@3x.png', image: this.baseUrl + 'beijing@3x.png',
path: '', path: 'pages/maintain-bill/index',
name: '维修记账', name: '维修记账',
}, },
{ {
...@@ -309,6 +311,9 @@ export default { ...@@ -309,6 +311,9 @@ export default {
}, },
handleClickTool(path) { handleClickTool(path) {
if (!this.checkVip()) return if (!this.checkVip()) return
uni.navigateTo({
url: path
});
}, },
handleClickOperate(path) { handleClickOperate(path) {
if (!this.checkVip()) return if (!this.checkVip()) return
...@@ -327,6 +332,34 @@ export default { ...@@ -327,6 +332,34 @@ export default {
formatCount(count) { formatCount(count) {
return (Math.trunc(count * 100) / 100).toFixed(2) return (Math.trunc(count * 100) / 100).toFixed(2)
}, },
toLogin() {
this.$refs.uToast.show({
duration: 1500,
title: '请先登录',
type: 'error',
callback: ()=> {
this.$u.route({
url: 'pages/login/index'
});
}
});
},
// 朋友圈
onShareTimeline(res) {
return {
title: '咖营-你喜欢的“大咖”都在这里',
path: '/pages/index/find'
// imageUrl: ''
};
},
// 好友
onShareAppMessage(res) {
return {
title: '咖营-你喜欢的“大咖”都在这里',
path: '/pages/index/find'
// imageUrl: ''
};
}
}, },
} }
</script> </script>
......
<template>
<view class="maintain-bill">
<NavbarRight
title="维修记账"
text="导出账单"
:image="outImage"
@click="handlClickOut"
/>
<view class="search-bar">
<u-search
:clearabled="true"
:show-action="false"
bg-color="#FFFFFF"
v-model="keyword"
height="80"
search-icon-color="#bdbdbd"
color="#333333"
placeholder="搜索维修单号、客户姓名/手机、维修备注"
placeholder-color="#CCCCCC"
:search-icon="searchImage"
@custom="search"
@search="search"
:input-style="{ 'font-size': '26rpx', color: '#333333' }"
></u-search>
</view>
<view class="content-view">
<view class="title-view">
<view
class="left-view"
hover-class="u-hover-class"
@click="$u.throttle(handleSelectDate, 500)"
>
<view class="date-view">{{ date || '全部时段' }}</view>
<u-icon name="arrow-down-fill" color="#8D8D8D" size="24"></u-icon>
</view>
<view
class="right-view"
hover-class="u-hover-class"
@click="$u.throttle(handleSelectFilter, 500)"
>
<view :class="['icon-view', { filter: filter }]">
<u-icon
name="checkbox-mark"
v-if="filter"
color="#02a074"
size="24"
></u-icon>
</view>
<view class="date-view">只看欠款</view>
</view>
</view>
</view>
</view>
</template>
<script>
import NavbarRight from '@/components/navbar-right'
export default {
components: {
NavbarRight,
},
data() {
return {
keyword: '',
date: '',
filter: false,
lists: [],
}
},
computed: {
baseUrl() {
return process.uniEnv.qn_base_url
},
outImage() {
return this.baseUrl + 'daochuzhangdan@3x.png'
},
searchImage() {
return this.baseUrl + 'sousuo@3x.png'
},
},
onLoad() {
uni.$on('maintain-bill', (res) => {
this.updateItem(res.id, true)
})
},
onUnload() {
uni.$off('maintain-bill')
},
onShow() {},
methods: {
toDetail(item) {
this.$u.route({
url: 'pages/maintain-bill/detail',
type: 'navigateTo',
params: {
billId: item.id,
},
})
},
init() {},
updateItem(id, state) {
for (var item of this.lists) {
if (item.id == id) {
item.echoMap.joinState = state
}
}
},
handleClickOut() {},
handleSelectFilter() {
this.filter = !this.filter
},
search() {
this.$u.route({
url: 'pages/maintain-bill/search',
params: {
keyword: this.keyword,
},
})
},
},
}
</script>
<style scoped lang="scss">
.maintain-bill {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fa;
.search-bar {
margin: 0rpx 24rpx 16rpx 24rpx;
padding: 0rpx 16rpx;
background-color: #ffffff;
border-radius: 40rpx;
height: 80rpx;
/deep/.u-icon__icon {
color: #bdbdbd !important;
font-size: 34rpx !important;
}
}
.content-view {
height: 100%;
overflow: auto;
padding: 0 24rpx 44rpx 24rpx;
.title-view {
color: #333333;
display: flex;
align-items: center;
justify-content: space-between;
margin: 24rpx 0;
.left-view {
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
.date-view {
margin-right: 16rpx;
}
}
.right-view {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 28rpx;
.icon-view {
width: 32rpx;
height: 32rpx;
border-radius: 8rpx;
border: 2rpx solid #333333;
margin-right: 16rpx;
display: flex;
align-items: center;
justify-content: center;
&.filter {
border: 2rpx solid #02a074;
}
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment