From b7ae3f69ae6706a692284d2f12835d213debfb1a Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期二, 07 四月 2026 17:21:41 +0800
Subject: [PATCH] -
---
src/pages/checkin/checkin.vue | 114 ++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 85 insertions(+), 29 deletions(-)
diff --git a/src/pages/checkin/checkin.vue b/src/pages/checkin/checkin.vue
index e204362..add30d5 100644
--- a/src/pages/checkin/checkin.vue
+++ b/src/pages/checkin/checkin.vue
@@ -1,31 +1,44 @@
<template>
<view>
<view class='chuany-flex camera-fill chuany-justify-center chuany-align-center'>
- <fui-upload immediate :url="`${apiBaseUrl}/api/UpFile/UpdateFile`" ref="uploadE" max='1' @success="success"
- :sizeType='sizeType' :sourceType='sourceType' @error="error" @complete="complete" width="280"
- height="280">
+ <tem-upload-fui immediate :url="`${apiBaseUrl}/api/UpFile/UpdateFile`" ref="uploadE" max='1'
+ @success="success" cameraType='back' :sizeType='sizeType' :sourceType='sourceType' @error="error"
+ @complete="complete" width="280" :mediaType='mediaType' height="280">
<view class="" v-if="checkPhoto">
- <image :src="checkPhoto" mode="widthFix" style="width: 280rpx;height: 280rpx;">
+ <image :src="checkPhoto" mode="aspectFill" style="width: 280rpx;height: 280rpx;">
</image>
</view>
<view class=" chuany-flex chuany-flex-direction chuany-align-center" v-else>
<fui-icon name="camera-fill"></fui-icon>
<view class="chuany-font20">鎷嶆憚鐜鐓х墖</view>
</view>
- </fui-upload>
- <fui-upload ref="uploadP" max='1' @error="error" @complete="completePerson" width="280" height="280"
- :sizeType='sizeType' :sourceType='sourceType'>
+ </tem-upload-fui>
+ <tem-upload-fui ref="uploadP" max='1' @error="error" @complete="completePerson" width="280" height="280"
+ :sizeType='sizeType' :sourceType='sourceType' :mediaType='mediaType' :isFace='true'>
<view class="" v-if="faceImg">
- <image :src="faceImg" mode="widthFix" style="width: 280rpx;height: 280rpx;"></image>
+ <image :src="faceImg" mode="aspectFill" style="width: 280rpx;height: 280rpx;"></image>
</view>
<view class=" chuany-flex chuany-flex-direction chuany-align-center" v-else>
<fui-icon name="addfriends-fill"></fui-icon>
<view class="chuany-font20">鎷嶆憚浜鸿劯鐓х墖</view>
</view>
- </fui-upload>
+ </tem-upload-fui>
+
+ <!-- <view class="fui-upload__item fui-upload__noborder"
+ style="width:280rpx;height:280rpx;background:#eee;" @tap.stop="openCamera">
+ <view class="" v-if="faceImg">
+ <image :src="faceImg" mode="aspectFill" style="width: 280rpx;height: 280rpx;"></image>
+ </view>
+ <view class=" chuany-flex chuany-flex-direction chuany-align-center" v-else>
+ <fui-icon name="addfriends-fill"></fui-icon>
+ <view class="chuany-font20">鎷嶆憚浜鸿劯鐓х墖</view>
+ </view>
+ </view> -->
</view>
<view class="c-m-20 chuany-font24">
- 涓轰簡淇濊瘉鎵撳崱鐨勬纭�э紝鈥屽缓璁湪鍏徃闂ㄥ彛鎴栬繘鍏ュ姙鍏鐨勯棬鍙e啀鎵撳崱銆傗�屽悓鏃讹紝鈥岀‘淇濈収鐗囩殑娓呮櫚銆佲�屾槑浜紝鈥岄潰閮ㄥ彲瑙併��
+ 1銆佷负浜嗙‘淇濆姵鍔℃姤閰殑鍑嗙‘缁撶畻锛岃鍦ㄥ紑濮嬪伐浣滃墠3鍒嗛挓鍐呭紑濮嬭鏃讹紝涓婁紶鈥滃姵鍔¤鏃垛�濈殑鐓х墖鍚庡繀椤荤珛鍗虫姇鍏ュ伐浣滐紝鍚﹀垯灏嗗鍊嶆墸闄ゅ姟宸ユ椂闀匡紱
+ 2銆佸繀椤荤‘淇濈収鐗囩殑娓呮櫚銆佹槑浜紝闈㈤儴鍜屽綋鍓嶅伐浣滅幆澧冨彲瑙侊紝鍚﹀垯灏嗗奖鍝嶅姵鍔¤垂鐢ㄨ绠楋紱
+ 3銆佸姵鍔¤鏃朵互灏忔椂涓哄崟浣嶈繘琛屾牳绠椼�備緥濡傦細寮�濮嬭鏃舵椂闂翠负鏃╀笂8:00锛岀粨鏉熻鏃舵椂闂翠负11:05鍒嗘垨11:55鍒嗭紝绯荤粺鏍稿畾鐨勫姟宸ユ椂闂村潎涓�3灏忔椂銆�
</view>
<view v-if='dakaList&&dakaList.length>0'>
<view class="chuany-flex chuany-justify-evenly chuany-flex-wrap c-p-t-20">
@@ -41,14 +54,14 @@
v-if="index!==dakaList.length-1&&index%2==0">
</view>
</view>
- <text>{{item.checktime?'宸叉墦鍗�':'鏈墦鍗�'}}</text>
+ <text>{{item.checktime?'宸茶鏃�':'鏈鏃�'}}</text>
<text
:class="$util.formatDate(item.checktime,true)=='-'?'core-opa':''">{{$util.formatDate(item.checktime,true)}}</text>
</view>
</view>
</view>
<view class="tabbtns">
- <up-button color='#fece01' class="text-69" text="纭鎵撳崱" :loading='isLoading' loadingText="鎵撳崱涓�"
+ <up-button color='#fece01' text="纭璁℃椂" :loading='isLoading' loadingText="璁℃椂涓�"
@click="enroll"></up-button>
</view>
</view>
@@ -64,11 +77,12 @@
src: '',
apiBaseUrl,
orderBiddingId: '', //鎷涘伐鏄庣粏OrderBiddingId
- checkPhoto: '', //鎵撳崱鐓х墖
+ checkPhoto: '', //璁℃椂鐓х墖
faceImg: '', //浜鸿劯鍥剧墖
dakaList: [],
sourceType: ["camera"],
sizeType: ['compressed'],
+ mediaType: ['image'],
isLoading: false
}
},
@@ -77,6 +91,19 @@
let id = option.orderid
this.orderBiddingId = id
this.getDaka(id)
+ },
+ onShow(){
+ if(this.$db.get('faceImg')){
+ let faceImgPath = this.$db.get('faceImg')
+ this.$refs.uploadP.urls = [faceImgPath]
+ this.$refs.uploadP.status = ['success']
+ this.$util.pathToBase64(faceImgPath).then(res => {
+ this.faceImg = res
+ })
+ }
+ },
+ onUnload(){
+ this.$db.del('faceImg')
},
methods: {
getDaka(id) {
@@ -100,18 +127,22 @@
},
openCamera() {
// 鎷嶇収鍜岀浉鍐�
- uni.chooseImage({
- count: 1,
- sizeType: ["original", "compressed"],
- sourceType: ["camera"],
- success: (res) => {
- const {
- tempFilePaths
- } = res;
- console.log(tempFilePaths);
- },
- });
-
+ // uni.chooseMedia({
+ // count: 1,
+ // mediaType: ['image'],
+ // sizeType: ["compressed"],
+ // sourceType: ["camera"],
+ // camera: 'front',
+ // success: (res) => {
+ // const {
+ // tempFiles
+ // } = res;
+ // this.$util.pathToBase64(tempFiles[0].tempFilePath).then(res => {
+ // this.faceImg = res
+ // })
+ // },
+ // });
+
},
success(e) {
@@ -119,7 +150,7 @@
//涓婁紶鎴愬姛鍥炶皟锛屽鐞嗘湇鍔″櫒杩斿洖鏁版嵁銆愭澶勬牴鎹疄闄呰繑鍥炴暟鎹繘琛屽鐞嗐��
let res = JSON.parse(e.res.data.replace(/\ufeff/g, "") || "{}")
if (res.data) {
- this.checkPhoto = res.data //鎵撳崱鐓х墖
+ this.checkPhoto = res.data //璁℃椂鐓х墖
//浜鸿劯鍥剧墖
// enterpriseInfo.businessLicense = res.data.url
// enterpriseInfo.suppliername = res.data.info.name //浼佷笟鍚嶇О
@@ -140,6 +171,8 @@
},
completePerson(e) {
if (e.action == 'delete') {
+ this.faceImg = ''
+ this.$db.del('faceImg')
// 鍒犻櫎澶勭悊
return
}
@@ -170,17 +203,18 @@
this.isLoading = true
let obj = {
OrderId: this.orderBiddingId, //鎷涘伐鏄庣粏OrderBiddingId
- checkPhoto: this.checkPhoto, //鎵撳崱鐓х墖
+ checkPhoto: this.checkPhoto, //璁℃椂鐓х墖
faceImg: this.faceImg,
}
this.$api.saveDaka(obj).then(res => {
if (res.code == 1) {
this.$util.showToast({
- title: "鎵撳崱鎴愬姛锛�",
+ title: "璁℃椂鎴愬姛锛�",
icon: "success"
})
- this.checkPhoto = '' //鎵撳崱鐓х墖
+ this.checkPhoto = '' //璁℃椂鐓х墖
this.faceImg = ''
+ this.$db.del('faceImg')
this.$refs.uploadP.deleteImage()
this.$refs.uploadE.deleteImage()
this.getDaka(this.orderBiddingId)
@@ -197,6 +231,28 @@
</script>
<style lang="scss">
+ .fui-upload__item {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ align-items: center;
+ justify-content: center;
+ margin-right: 20rpx;
+ margin-bottom: 20rpx;
+ /* #ifdef H5 */
+ cursor: pointer;
+ /* #endif */
+ position: relative;
+
+ /* #ifndef APP-NVUE */
+ box-sizing: border-box;
+ /* #endif */
+ }
+
+ .fui-upload__noborder {
+ border-width: 0;
+ }
+
.camera-fill {
// width: 400rpx;
// height: 400rpx;
--
Gitblit v1.9.1