From 0e555ff7887e46c5bdd9d8ca237f7ed1e1634c0f Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 24 九月 2025 13:53:55 +0800
Subject: [PATCH] 优化
---
h5/pages/staff/snapshot.vue | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 102 insertions(+), 16 deletions(-)
diff --git a/h5/pages/staff/snapshot.vue b/h5/pages/staff/snapshot.vue
index a7050b6..99c17cd 100644
--- a/h5/pages/staff/snapshot.vue
+++ b/h5/pages/staff/snapshot.vue
@@ -13,12 +13,25 @@
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
</view>
</view>
+
+ <view class="line">
+ <view class="label">
+ <text>*</text>
+ <text>妫�鏌ョ被鍨�</text>
+ </view>
+ <view class="value" @click="isShow = true">
+ <text class="mr6"
+ :style="{ color: param.checkTypeName ? '#000000' : '#999999' }">{{ param.checkTypeName ? param.checkTypeName : "璇烽�夋嫨" }}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+
<view class="line">
<view class="label">
<text>*</text>
<text>闅愭偅鍖哄煙</text>
</view>
- <view class="value" @click="isShowArea = true">
+ <view class="value" @click="openArea">
<text class="mr6"
:style="{ color: param.areaName ? '#000000' : '#999999' }">{{ param.areaName ? param.areaName : "璇烽�夋嫨" }}</text>
<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
@@ -56,8 +69,14 @@
</view>
<view class="adduser_list_item_ipt1_upload" v-for="(item, i) in submitFileList" :key="i">
<u-icon class="close" size="20" name="close-circle-fill" color="red" @click="fileDel(i)"></u-icon>
- <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image><video v-if="item.type == 1"
- :src="item.fileurlFull"></video>
+ <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
+ <!-- <video v-if="item.type == 1"
+ :src="item.fileurlFull" :controls="false" :show-center-play-btn="false"></video> -->
+ <view v-if="item.type == 1" class="video_wrap">
+ <video :src="item.fileurlFull" :initial-time="0.01" :show-center-play-btn="false" :controls="false"
+ class="video" :enable-progress-gesture="false" muted />
+ <image src="@/static/play.png" class="play" mode=""></image>
+ </view>
</view>
</view>
</view>
@@ -68,7 +87,7 @@
<text>鎯呭喌璇存槑</text>
</view>
<view class="value">
- <textarea placeholder="璇疯缁嗘弿杩扮幇鍦烘儏鍐碉紝涓嶅皯浜�10涓瓧" minlength="10" v-model="param.content"
+ <textarea placeholder="璇疯缁嗘弿杩扮幇鍦烘儏鍐�" v-model="param.content"
placeholder-style="color: #999999;" />
</view>
</view>
@@ -86,7 +105,7 @@
<text></text>
<text>鑱旂郴鐢佃瘽</text>
</view>
- <view class="value"><input type="text" disabled placeholder="璇疯緭鍏ヨ仈绯荤數璇�" v-model="param.memberPhone"
+ <view class="value"><input type="tel" disabled placeholder="璇疯緭鍏ヨ仈绯荤數璇�" v-model="param.memberPhone"
placeholder-style="color: #999999;" /></view>
</view>
<view class="line">
@@ -113,8 +132,11 @@
@close="isShowArea = false" @cancel="isShowArea = false"></u-picker>
<u-picker keyName="name" :show="isShowType" closeOnClickOverlay :columns="areaType" @confirm="seletedType"
@close="isShowType = false" @cancel="isShowType = false"></u-picker>
+ <!-- 妫�鏌ョ被鍨� -->
+ <u-picker keyName="name" :show="isShow" closeOnClickOverlay :columns="checkTypeList" @confirm="seletedTypeVal"
+ @close="isShow = false" @cancel="isShow = false"></u-picker>
<!-- -->
- <u-datetime-picker :show="isShowTime" :minDate="new Date().getTime()" mode="datetime" closeOnClickOverlay
+ <u-datetime-picker :show="isShowTime" :formatter="formatter" :minDate="new Date().getTime()" mode="datetime" closeOnClickOverlay
@cancel="isShowTime = false" @close="isShowTime = false" @confirm="seletedDate"></u-datetime-picker>
<!-- -->
<u-popup :show="showUpload" @close="showUpload = false" closeOnClickOverlay>
@@ -140,6 +162,7 @@
param: {},
submitFileList: [],
+ isShow: false,
isShowCompany: false,
isShowArea: false,
isShowType: false,
@@ -149,6 +172,7 @@
deptList: [],
areaOptions: [],
areaType: [],
+ checkTypeList: [],
}
},
onLoad(option) {
@@ -166,7 +190,25 @@
this.$set(this.param, 'checkorName', option.name)
})
},
- methods: {
+ methods: {
+ formatter(type, value) {
+ if (type === 'year') {
+ return `${value}骞碻
+ }
+ if (type === 'month') {
+ return `${value}鏈坄
+ }
+ if (type === 'day') {
+ return `${value}鏃
+ }
+ if (type === 'hour') {
+ return `${value}鏃禶
+ }
+ if (type === 'minute') {
+ return `${value}鍒哷
+ }
+ return value
+ },
onSubmit() {
const {
param,
@@ -192,10 +234,10 @@
title: '璇疯緭鍏ユ儏鍐佃鏄�',
icon: 'none'
})
- if (param.content.length < 10) return uni.showToast({
- title: '鎯呭喌璇存槑涓嶅緱灏忎簬10涓瓧',
- icon: 'none'
- })
+ // if (param.content.length < 10) return uni.showToast({
+ // title: '鎯呭喌璇存槑涓嶅緱灏忎簬10涓瓧',
+ // icon: 'none'
+ // })
DangerCreate({
...param,
@@ -211,7 +253,10 @@
this.$set(this.param, 'companyId', item.id)
this.$set(this.param, 'companyName', item.name)
this.$set(this.param, 'areaId', '')
- this.$set(this.param, 'areaName', '')
+ this.$set(this.param, 'areaName', '')
+ this.$set(this.param, 'checkUserId', '')
+ this.$set(this.param, 'applyCheckUserId', '')
+ this.$set(this.param, 'checkorName', '')
DangerConfigType({
type: '0',
companyId: item.id
@@ -219,6 +264,10 @@
this.areaOptions = [res.data]
})
this.isShowCompany = false
+ },
+ openArea() {
+ if(!this.param.companyId) return this.showToast('璇峰厛閫夋嫨璐d换閮ㄩ棬')
+ this.isShowArea = true
},
seletedArea(e) {
const item = e.value[0]
@@ -243,6 +292,13 @@
console.log(item)
this.isShowType = false
},
+ seletedTypeVal(e) {
+ const item = e.value[0]
+ this.$set(this.param, 'checkTypeId', item.id)
+ this.$set(this.param, 'checkTypeName', item.name)
+ console.log(item)
+ this.isShow = false
+ },
seletedSafety(e) {
},
@@ -251,8 +307,17 @@
this.isShowTime = false
},
initConfig() {
- deptListPost({queryHiddenDanger: 1}).then(res => {
+ deptListPost({
+ queryHiddenDanger: 1
+ }).then(res => {
this.deptList = [res.data]
+ })
+ DangerConfigType({
+ type: '2'
+ }).then(res => {
+ this.checkTypeList = [res.data]
+ this.$set(this.param, 'checkTypeId', res.data[0].id)
+ this.$set(this.param, 'checkTypeName', res.data[0].name)
})
DangerConfigType({
type: '1'
@@ -422,7 +487,9 @@
display: flex;
flex-wrap: wrap;
}
-
+ textarea{
+ width: 100%;
+ }
.adduser_list_item_ipt1_upload {
margin-top: 24rpx;
width: 156rpx;
@@ -437,9 +504,11 @@
align-items: center;
justify-content: center;
position: relative;
- &:nth-of-type(4n){
- margin-right: 0;
+
+ &:nth-of-type(4n) {
+ margin-right: 0;
}
+
.close {
position: absolute;
right: -20rpx;
@@ -447,6 +516,23 @@
z-index: 9999;
}
+ .video_wrap {
+ position: relative;
+ border: 1px solid;
+ width: 156rpx;
+ height: 156rpx;
+ border-radius: 4rpx;
+
+ .play {
+ width: 60rpx !important;
+ height: 60rpx !important;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+ }
+
image {
width: 100%;
height: 100%;
--
Gitblit v1.9.3