小程序接入保安证号接口

This commit is contained in:
wangyilin 2024-12-02 16:09:25 +08:00
parent 90202e7e95
commit 6d0c45931b
4 changed files with 57 additions and 7 deletions

View File

@ -5,11 +5,14 @@
"appid": "touristappid",
"setting": {
"urlCheck": false,
"es6": false,
"es6": true,
"enhance": false,
"minified": true,
"minifyWXSS": true,
"minifyWXML": true,
"compileHotReLoad": false,
"postcss": false,
"minified": false
"postcss": true,
"minified": true
},
"compileType": "miniprogram"
}

View File

@ -24,6 +24,40 @@ const App = createApp({
})
}
},
onShow(){
const updateManager = Taro.getUpdateManager()
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
if (res.hasUpdate) {
// 新版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
})
updateManager.onUpdateReady(function() {
// 新版本已经准备好,可以提示用户更新
Taro.showModal({
title: '更新提示',
content: '发现新版本,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经准备好,调用 applyUpdate 应用新版本
updateManager.applyUpdate()
}
}
}).then(res=>{
console.log(res)
})
})
updateManager.onUpdateFailed(function() {
// 新版本下载失败,可进行一些提示用户的操作
Taro.showModal({
title: '已有新版本',
content: '请删除当前小程序,重新从搜索界面打开获取最新版本',
}).then(res => {
console.log(res)
})
})
}
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
})

View File

@ -10,3 +10,11 @@
height: 140px
}
}
.uploadPictures{
display: flex;
justify-content: center;
align-items: center;
width: 220px;
height: 254px;
border: 2px solid #d5d3d3;
}

View File

@ -1,7 +1,13 @@
<template>
<view class="form">
<nut-form ref="formRef" :model-value="formData" :rules="rules">
<nut-form-item label="头像" prop="avatar">
<nut-form-item label="头像" prop="avatar">
<!-- <view class="uploadPictures" @click="chooseImage">-->
<!-- <view v-if="!formData.photo">-->
<!-- <IconFont name="uploader" size="25" color="#98a7b0"></IconFont>-->
<!-- </view>-->
<!-- <image v-else :src="minioBaseUrl +formData.photo" style="width: 100%; height: 100%"></image>-->
<!-- </view>-->
<view @click="chooseImage" size>
<image v-if="!formData.photo" src="@/assets/logo/avatar1.png" style="width: 50px; height: 50px"></image>
<image v-else :src="minioBaseUrl +formData.photo" style="width: 160px; height: 128px"></image>
@ -29,7 +35,6 @@
<nut-form-item label="工作岗位" prop="workPost">
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text" />
</nut-form-item>
<nut-form-item label="手机号" prop="telephone">
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text" />
</nut-form-item>
@ -85,6 +90,7 @@ import dayjs from 'dayjs'
import { SecurityUserFormParams, securityNumberByIdCard } from '@/types/subPages/projectManager/securityUserForm'
import { FormInstance } from '@nutui/nutui-taro'
import { generateSimpleObjectName, getResignedObjectUrl } from '@/utils'
import {IconFont} from "@nutui/icons-vue-taro";
const SEX = enumSelectNodes('Sex')
const minioBaseUrl = process.env.TARO_APP_MINIO_URL
@ -112,7 +118,6 @@ const rules: FormRules = {
}
useLoad((options) => {
console.log(options)
type.value = options.type
if (type.value === 'QcCodeInput') {
formData.value = {
@ -191,7 +196,7 @@ const chooseImage = () => {
count: 1, //
mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
sizeType:['original', 'compressed'],
camera: 'front',
success: async (res) => {
Url.value = res.tempFiles[0].tempFilePath