Commit 20a08b68 authored by 刘文虎's avatar 刘文虎
parents 05e03c93 a867a070
Pipeline #2775 canceled with stages
...@@ -56,7 +56,6 @@ export default { ...@@ -56,7 +56,6 @@ export default {
}, },
watch: { watch: {
list() { list() {
console.log('----------')
this.loading = false this.loading = false
} }
}, },
......
<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>
<template>
<u-popup
v-model="show"
safe-area-inset-bottom
border-radius="24"
mode="center"
width="86%"
:closeable="false"
@close="handleClose"
>
<view class="pop-normal-view">
<view class="title-view">{{ title }}</view>
<view class="content-view">
<slot />
</view>
<view class="buttons-view">
<view class="left-view">
<u-button
open-type="share"
v-if="isShare"
:custom-style="customCancel"
@click="handleClickCancel"
>
<view class="cancel-view">
<view class="cancel-image"
><image :src="cancelImage"></image
></view>
<view>{{ cancelText }}</view>
</view></u-button
>
<u-button
v-else
:custom-style="customCancel"
@click="handleClickCancel"
>
<view class="cancel-view">{{ cancelText }}</view>
</u-button>
</view>
<view class="right-view">
<u-button :custom-style="customConFirm" @click="handleClickConfirm">
<view class="confirm-view">{{ confirmText }}</view>
</u-button>
</view>
</view>
<view class="bottom-tip">{{ bottomTip }}</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '温馨提示',
},
visible: {
type: Boolean,
default: false,
},
cancelText: {
type: String,
default: '分享领体验',
},
confirmText: {
type: String,
default: '开通会员',
},
bottomTip: {
type: String,
default: '※ 体验会员,仅非会员用户领取,每个ID限领1次',
},
isShare: {
type: Boolean,
default: false,
},
},
data() {
return {
show: false,
}
},
watch: {
visible(val) {
this.show = val
},
},
computed: {
cancelImage() {
return process.uniEnv.qn_base_url + 'fenxiang@3x.png'
},
customCancel() {
return {
color: 'transparent',
height: '96rpx',
width: '264rpx',
border: '2rpx solid #02A074',
'border-radius': '16rpx',
}
},
customConFirm() {
return {
color: 'transparent',
'background-color': '#02A074',
height: '96rpx',
width: '264rpx',
}
},
},
methods: {
changeVisibleValue(val) {
this.show = val
this.$emit('update:visible', val)
},
handleClickConfirm() {
this.changeVisibleValue(false)
this.$emit('confirm', this.type)
},
handleClose() {
this.changeVisibleValue(false)
},
handleClickCancel() {
this.changeVisibleValue(false)
this.$emit('cancel', this.type)
},
},
}
</script>
<style lang="scss" scoped>
.pop-normal-view {
text-align: center;
padding: 24rpx 32rpx;
background-image: linear-gradient(to bottom, #f4fffc 0%, #ffffff 50%);
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
margin: 32rpx 0 24rpx 0;
}
.content-view {
padding: 20rpx 32rpx;
color: #191c27;
font-size: 32rpx;
min-height: 240rpx;
line-height: 54rpx;
}
.buttons-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
.left-view {
.cancel-view {
color: #02a074;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
.cancel-image {
width: 32rpx;
height: 32rpx;
margin-right: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
.right-view {
margin-left: 30rpx;
.confirm-view {
color: #ffffff;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
}
}
}
.bottom-tip {
text-align: left;
color: #8d8d8d;
font-size: 24rpx;
}
}
</style>
...@@ -133,6 +133,19 @@ ...@@ -133,6 +133,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",
......
<template> <template>
<view class="index-view"> <view class="index-view">
<u-navbar <!-- <u-navbar
:is-back="false" :is-back="false"
:border-bottom="false" :border-bottom="false"
:background="background" :background="background"
></u-navbar> ></u-navbar> -->
<view class="content-view"> <view class="content-view" :style="'padding-top: ' + paddingTop + 'px'">
<view class="head-view"> <view class="head-view">
<view class="left-view"> <view class="left-view">
<view class="logo-image"></view> <view class="logo-image"></view>
...@@ -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>
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
<view class="title-view">收支明细</view> <view class="title-view">收支明细</view>
<view class="tip-view">展示近3天数据</view> <view class="tip-view">展示近3天数据</view>
</view> </view>
<BillList :list="list" @select="handleSelectCell"/> <BillList :list="list" @select="handleSelectCell" />
<!-- <view class="list-view" v-if="list.length > 0"> <!-- <view class="list-view" v-if="list.length > 0">
<view <view
class="list-day-view" class="list-day-view"
...@@ -120,6 +121,21 @@ ...@@ -120,6 +121,21 @@
<NoData v-else imageWidth="374" text="当前暂无收支明细"/> --> <NoData v-else imageWidth="374" text="当前暂无收支明细"/> -->
</view> </view>
</view> </view>
<u-picker
:default-time="date"
mode="time"
v-model="showDatePicker"
:params="params"
@confirm="handleComfirmDate"
></u-picker>
<PopNormal :visible.sync="visible" :isShare="true">
<view
><view>非常抱歉,<text class="red-text">您没有体验权限</text></view
><view>请您“<text class="red-text">开通会员</text>”或“<text class="red-text">分享同行好友群”</text></view
><view>领取3天体验资格</view></view
>
</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"
...@@ -131,59 +147,70 @@ ...@@ -131,59 +147,70 @@
</template> </template>
<script> <script>
let systemInfo = uni.getSystemInfoSync()
import MidPopup from '@/components/mid-popup/mid-popup.vue' import MidPopup from '@/components/mid-popup/mid-popup.vue'
// import CellBill from '@/components/cell-bill-list/index.vue' // import CellBill from '@/components/cell-bill-list/index.vue'
// import NoData from '@/components/no-data' // import NoData from '@/components/no-data'
import BillList from '@/components/bill-list' import BillList from '@/components/bill-list'
import PopNormal from '@/components/pop-normal'
import { tabbar } from '@/utils/settings.js' import { tabbar } from '@/utils/settings.js'
import { addBind } from '@/api/login/index.js' import { addBind } from '@/api/login/index.js'
export default { export default {
components: { components: {
MidPopup, MidPopup,
BillList, BillList,
PopNormal,
// CellBill, // CellBill,
// NoData // NoData
}, },
data() { data() {
return { return {
tabbar, tabbar,
showDatePicker: false,
visible: false,
weather: { temperature: '29℃' }, weather: { temperature: '29℃' },
location: '深圳', location: '深圳',
date: this.$u.timeFormat(new Date().getTime(), 'yyyy年mm月'), date: this.$u.timeFormat(new Date().getTime(), 'yyyy-mm'),
info: { info: {
money: 45, money: 45,
in: 23, in: 23,
out: 89, out: 89,
isVip: true,
}, },
list: [ list: [
{ {
week: "今天", week: '今天',
day: "2022-09-08", day: '2022-09-08',
list: [ list: [
{type: '1', {
type: '1',
name: '餐饮', name: '餐饮',
detail: '吃了一碗拉面', detail: '吃了一碗拉面',
time: '11:02', time: '11:02',
count: '24.9' count: '24.9',
}, },
{type: '1', {
type: '1',
name: '旅游', name: '旅游',
detail: '国庆十日游,住宿、吃饭,范德萨发撒的范德萨范大师范德萨范范德萨范德萨发撒发范德萨发大水东方大厦', detail:
'国庆十日游,住宿、吃饭,范德萨发撒的范德萨范大师范德萨范范德萨范德萨发撒发范德萨发大水东方大厦',
time: '11:02', time: '11:02',
count: '3000' count: '3000',
} },
], ],
}, },
{ {
weak: "昨天", weak: '昨天',
day: "2022-09-07", day: '2022-09-07',
list: [ list: [
{type: '1', {
type: '1',
name: '餐饮', name: '餐饮',
detail: '吃了一碗拉面', detail: '吃了一碗拉面',
time: '11:02', time: '11:02',
count: '24.9' count: '24.9',
} },
], ],
}, },
], ],
...@@ -205,7 +232,7 @@ export default { ...@@ -205,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: '维修记账',
}, },
{ {
...@@ -239,7 +266,31 @@ export default { ...@@ -239,7 +266,31 @@ export default {
}, },
] ]
}, },
paddingTop() {
var top = systemInfo.safeAreaInsets.top
// #ifdef APP-PLUS || H5
return 44 + top
// #endif
// #ifdef MP
return (systemInfo.platform == 'ios' ? 44 : 48) + top
// #endif
},
params() {
return {
year: true,
month: true,
day: false,
hour: false,
minute: false,
second: false,
}
},
dateString() {
var string = this.date.replace(/-/g, '/')
return this.$u.timeFormat(new Date(string).getTime(), 'yyyy年mm月')
}, },
},
onLoad() {},
onReady() { onReady() {
addBind({}) addBind({})
}, },
...@@ -251,13 +302,64 @@ export default { ...@@ -251,13 +302,64 @@ export default {
} }
return true return true
}, },
handleSelectDate() {}, handleSelectDate() {
handleClickTool(path) {}, this.showDatePicker = true
handleClickOperate(path) {}, },
handleSelectCell(id) {}, handleComfirmDate(date) {
console.log(date)
this.date = `${date.year}-${date.month}`
},
handleClickTool(path) {
if (!this.checkVip()) return
uni.navigateTo({
url: path
});
},
handleClickOperate(path) {
if (!this.checkVip()) return
},
handleSelectCell(id) {
console.log('-----------', id)
},
checkVip() {
if (this.info.isVip) {
return true
} else {
this.visible = true
return false
}
},
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>
...@@ -496,5 +598,8 @@ export default { ...@@ -496,5 +598,8 @@ export default {
// } // }
} }
} }
.red-text {
color: #FC524D;
}
} }
</style> </style>
<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>
...@@ -75,6 +75,13 @@ $uni-font-size-subtitle:26px; ...@@ -75,6 +75,13 @@ $uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px; $uni-font-size-paragraph:15px;
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
/* uni.scss */ /* uni.scss */
@import 'uview-ui/theme.scss'; @import 'uview-ui/theme.scss';
// 引入自定义全局scss变量 // 引入自定义全局scss变量
......
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