Browse Source

'最后的一点优化'

main
hflllll 1 day ago
parent
commit
2003b9928b
17 changed files with 65 additions and 17 deletions
  1. +9
    -2
      pages/index/home.vue
  2. +15
    -9
      subPages/home/RAArecord.vue
  3. +5
    -1
      subPages/home/maintainanceSubmit.vue
  4. +2
    -2
      subPages/login/login.vue
  5. +1
    -1
      subPages/repair/maintainSubmit.vue
  6. BIN
      subPages/static/first.png
  7. BIN
      subPages/static/rank_bg.png
  8. BIN
      subPages/static/second.png
  9. BIN
      subPages/static/third.png
  10. BIN
      subPages/static/volunteer_bg@2x.png
  11. BIN
      subPages/static/商品_积分@2x.png
  12. BIN
      subPages/static/活动日历_图标@2x.png
  13. BIN
      subPages/static/登录_标题.png
  14. BIN
      subPages/static/登录_背景图.png
  15. BIN
      subPages/static/登录背景.png
  16. +30
    -1
      utils/common.js
  17. +3
    -1
      utils/index.js

+ 9
- 2
pages/index/home.vue View File

@ -50,8 +50,14 @@
<view class="content-row"> <view class="content-row">
<text class="label">下次保养日期</text> <text class="label">下次保养日期</text>
<text class="value">{{ item.maintenanceDate }}</text> <text class="value">{{ item.maintenanceDate }}</text>
<view v-if="item.maintenanceProject" class="project">
{{ item.maintenanceProject }}
<view v-if="$utils.calculateDateDifference(item.maintenanceDate) > 0 && $utils.calculateDateDifference(item.maintenanceDate) <= 3" class="project">
{{ $utils.calculateDateDifference(item.maintenanceDate) + '天后维保' }}
</view>
<view v-else-if="$utils.calculateDateDifference(item.maintenanceDate) === -1" class="project">
已超出维保时间
</view>
<view v-else-if="!$utils.calculateDateDifference(item.maintenanceDate)" class="project">
当天维修
</view> </view>
</view> </view>
</view> </view>
@ -194,6 +200,7 @@ export default {
}, },
onLoad(){ onLoad(){
this.getBannerList() this.getBannerList()
}, },
} }
</script> </script>


+ 15
- 9
subPages/home/RAArecord.vue View File

@ -92,7 +92,7 @@
<text class="label">上传图片</text> <text class="label">上传图片</text>
</view> </view>
<view class="image-container" v-if="!collapsedStates[index]">
<view class="image-container" v-if="!collapsedStates[index] && record.image">
<image class="uploaded-image" v-for="(value, index) in record.image.split(',')" :key="index" :src="value" mode="aspectFill"></image> <image class="uploaded-image" v-for="(value, index) in record.image.split(',')" :key="index" :src="value" mode="aspectFill"></image>
</view> </view>
@ -126,7 +126,7 @@
</view> </view>
<!-- 保养前图片 --> <!-- 保养前图片 -->
<view class="image-container" v-if="!collapsedStates[index]">
<view class="image-container" v-if="!collapsedStates[index] && record.stateFrontImage">
<image <image
class="uploaded-image" class="uploaded-image"
v-for="(img, imgIndex) in record.stateFrontImage.split(',')" v-for="(img, imgIndex) in record.stateFrontImage.split(',')"
@ -146,7 +146,7 @@
</view> </view>
<!-- 保养后图片 --> <!-- 保养后图片 -->
<view class="image-container" v-if="!collapsedStates[index]">
<view class="image-container" v-if="!collapsedStates[index] && record.stateBackImage">
<image <image
class="uploaded-image" class="uploaded-image"
v-for="(img, imgIndex) in record.stateBackImage.split(',')" v-for="(img, imgIndex) in record.stateBackImage.split(',')"
@ -170,7 +170,7 @@
</view> </view>
<!-- 费用详情表格 --> <!-- 费用详情表格 -->
<view class="cost-table" v-if="!collapsedStates[index]">
<view class="cost-table" v-if="!collapsedStates[index] && record.exhibitMaintenanceExpenses.length">
<view class="table-header"> <view class="table-header">
<text class="header-cell">费用名称</text> <text class="header-cell">费用名称</text>
<text class="header-cell">数量</text> <text class="header-cell">数量</text>
@ -221,7 +221,7 @@
</view> </view>
<!-- 附件图片 --> <!-- 附件图片 -->
<view class="image-container" v-if="!collapsedStates[index]">
<view class="image-container" v-if="!collapsedStates[index] && record.remarkImage">
<image class="uploaded-image" v-for="(value, index) in record.remarkImage.split(',')" :src="value" :key="index" mode="aspectFill"></image> <image class="uploaded-image" v-for="(value, index) in record.remarkImage.split(',')" :src="value" :key="index" mode="aspectFill"></image>
</view> </view>
@ -242,12 +242,16 @@
<text class="collapse-icon">{{ collapsedStates[index] ? '▼' : '▲' }}</text> <text class="collapse-icon">{{ collapsedStates[index] ? '▼' : '▲' }}</text>
</view> </view>
</view> </view>
<uv-loading-icon v-if="loading"></uv-loading-icon>
<view v-if="isLoading" style="padding:400rpx 0; ">
<uv-loading-icon text="正在加载中 先喝杯茶吧"></uv-loading-icon>
</view>
</view> </view>
<view v-else-if="!loading && !records.length ">
<view v-else-if="!isLoading && !list.length ">
<uv-empty icon="/static/暂无搜索结果.png" /> <uv-empty icon="/static/暂无搜索结果.png" />
</view> </view>
<uv-loading-icon v-else></uv-loading-icon>
<view v-else style="padding:400rpx 0; ">
<uv-loading-icon text="正在加载中 先喝杯茶吧"></uv-loading-icon>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -265,7 +269,8 @@ export default {
activeFilter: 0, // activeFilter: 0, //
collapsedStates: [], // / collapsedStates: [], // /
afterUpdateDataFn(list) { afterUpdateDataFn(list) {
this.collapsedStates = new Array(list.length).fill(true)
// true
this.collapsedStates.push(...new Array(8).fill(true))
}, },
filterOptions: [ filterOptions: [
{ name: '时间' }, { name: '时间' },
@ -315,6 +320,7 @@ export default {
this.mixinListApi = this.activeMainTab === 'repair' ? 'exhibit.queryRepairList' : 'exhibit.queryMaintenanceList' this.mixinListApi = this.activeMainTab === 'repair' ? 'exhibit.queryRepairList' : 'exhibit.queryMaintenanceList'
this.onFilterChange() this.onFilterChange()
this.initPage() this.initPage()
this.list = []
this.getList(true) this.getList(true)
// this.initCollapsedStates() // this.initCollapsedStates()
}, },


+ 5
- 1
subPages/home/maintainanceSubmit.vue View File

@ -458,7 +458,9 @@ export default {
remark: this.remark, remark: this.remark,
showpieceId: this.showpieceId showpieceId: this.showpieceId
} }
if (formData.isExpend === '0'){
delete formData.expenseList
}
this.submiting = true this.submiting = true
try{ try{
@ -481,6 +483,8 @@ export default {
}, },
onLoad(options) { onLoad(options) {
this.showpieceId = options.id this.showpieceId = options.id
} }
} }
</script> </script>


+ 2
- 2
subPages/login/login.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="login-container"> <view class="login-container">
<!-- 背景图 --> <!-- 背景图 -->
<image class="bg-image" src="@/subPages/static/登录_背景.png" mode="aspectFill"></image>
<image class="bg-image" src="@/subPages/static/登录背景.png" mode="aspectFill"></image>
<!-- 主要内容 --> <!-- 主要内容 -->
<view class="content"> <view class="content">
@ -152,7 +152,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%;
height: 33%;
z-index: 1; z-index: 1;
} }


+ 1
- 1
subPages/repair/maintainSubmit.vue View File

@ -540,7 +540,7 @@ export default {
delete tempData.expenseList delete tempData.expenseList
} }
const submitRes = await this.$api.exhibit.addRepair({ const submitRes = await this.$api.exhibit.addRepair({
id: this.showpieceId,
showpieceId: this.showpieceId,
...tempData, ...tempData,
amount: this.amount amount: this.amount
}) })


BIN
subPages/static/first.png View File

Before After
Width: 40  |  Height: 49  |  Size: 2.0 KiB

BIN
subPages/static/rank_bg.png View File

Before After
Width: 750  |  Height: 571  |  Size: 35 KiB

BIN
subPages/static/second.png View File

Before After
Width: 41  |  Height: 49  |  Size: 2.3 KiB

BIN
subPages/static/third.png View File

Before After
Width: 40  |  Height: 49  |  Size: 2.3 KiB

BIN
subPages/static/volunteer_bg@2x.png View File

Before After
Width: 714  |  Height: 290  |  Size: 53 KiB

BIN
subPages/static/商品_积分@2x.png View File

Before After
Width: 56  |  Height: 56  |  Size: 3.7 KiB

BIN
subPages/static/活动日历_图标@2x.png View File

Before After
Width: 69  |  Height: 69  |  Size: 3.0 KiB

BIN
subPages/static/登录_标题.png View File

Before After
Width: 316  |  Height: 104  |  Size: 22 KiB

BIN
subPages/static/登录_背景图.png View File

Before After
Width: 750  |  Height: 549  |  Size: 138 KiB

BIN
subPages/static/登录背景.png View File

Before After
Width: 750  |  Height: 563  |  Size: 23 KiB

+ 30
- 1
utils/common.js View File

@ -54,6 +54,8 @@ const checkPhone = (phone) => {
} }
// 转换时间戳为yyyy-mm-dd // 转换时间戳为yyyy-mm-dd
// params: 时间戳
// return yyyy-mmm-dd
const formatTime = (time) => { const formatTime = (time) => {
if (!time) { if (!time) {
return '时间格式错误,需要传入时间戳' return '时间格式错误,需要传入时间戳'
@ -65,9 +67,36 @@ const formatTime = (time) => {
return `${year}-${month}-${day}` return `${year}-${month}-${day}`
} }
// 计算yyyy-mm-dd与当前时间的差值
// params: yyyy-mm-dd格式的字符串
// return: 差值(天)
const calculateDateDifference = (dateString) => {
if (!dateString) {
return '时间格式错误,需要传入yyyy-mm-dd格式的字符串'
}
// 传入值为yyyy-mm-dd格式的字符串
const inputDate = new Date(dateString)
// 化为时间戳
// const inputTime = inputDate.getTime()
const currentDate = new Date()
const timeDifference = inputDate - currentDate
if (!(currentDate.setHours(0, 0, 0, 0) - inputDate.setHours(0, 0, 0, 0))) {
return 0
}
// 如果为负 返回-1
if (timeDifference < 0) {
return -1
}
// 计算天数
const dayDifference = Math.ceil(timeDifference / (1000 * 60 * 60 * 24))
return dayDifference
}
export { export {
authorize, authorize,
checkPhone, checkPhone,
formatTime
formatTime,
calculateDateDifference
} }

+ 3
- 1
utils/index.js View File

@ -1,7 +1,8 @@
import { import {
authorize, authorize,
checkPhone, checkPhone,
formatTime
formatTime,
calculateDateDifference
} from '@/utils/common' } from '@/utils/common'
import { import {
@ -14,6 +15,7 @@ export default {
authorize, authorize,
checkPhone, checkPhone,
formatTime, formatTime,
calculateDateDifference,
uploadImage, uploadImage,
chooseAndUpload, chooseAndUpload,
getFileExtension getFileExtension


Loading…
Cancel
Save