This commit is contained in:
yunkexin 2024-07-25 11:35:20 +08:00
parent 63e9a62ecd
commit 26e0a007dc
14 changed files with 829 additions and 119 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
unpackage/

16
.hbuilderx/launch.json Normal file
View File

@ -0,0 +1,16 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}

View File

@ -0,0 +1,225 @@
<template>
<view class="auto-complete">
<u-popup
:show="show"
:round="10"
mode="bottom"
:closeable="true"
:closeIconPos="multiple ? 'top-left' : 'top-right'"
@open="onOpen"
@close="handleClosePopup">
<u--text
v-if="multiple"
text="确定"
type="primary"
bold
class="ok-button"
size="16"
@click="handleOk"
></u--text>
<u-list
@scrolltolower="scrolltolower"
:pagingEnabled="true"
>
<view class="head">
<view class="title">{{title}}</view>
</view>
<view class="search" style="padding-top: 6px">
<u-search
v-model="searchValue"
@search="handleSearch"
@custom="handleSearch"
:clearabled="true">
</u-search>
</view>
<view v-if="multiple" class="multi-checkbox" @click.stop="">
<u-checkbox-group
placement="column"
@onchange="onCheckboxChange"
>
<u-checkbox
:customStyle="checkboxStyle"
v-for="(item, index) in indexList"
:key="index"
:label="item.NAME"
:name="item.ID"
:checked="multipleSelect.map(i => i.ID).includes(item.ID)"
>
</u-checkbox>
</u-checkbox-group>
</view>
<u-list-item
v-else
v-for="(item, index) in indexList"
:key="index"
class="single-select"
>
<view @click="handleSelected(item)">
<u-cell
:title="`${item.name}`"
>
<text v-if="item.code" slot="right-icon">{{item.code}}</text>
</u-cell>
</view>
</u-list-item>
</u-list>
</u-popup>
</view>
</template>
<script>
import UText from '../../uni_modules/uview-ui/components/u-text/u-text.vue'
export default {
components: { UText },
props: {
show: {
type: Boolean,
default: false,
required: true
},
multiple: {
type: Boolean,
default: false
},
lists: {
type: Array,
default() {
return undefined
}
},
defaultValue: {
type: String,
default: null
},
defaultChecked: {
type: Array,
default() {
return []
}
},
title:{
type: String,
default: ''
},
total:{
type: Number,
default: 0
}
},
data() {
return {
searchValue: '',
indexList: [],
pageIndex: 1,
multipleSelect: [],
checkboxStyle: {
marginBottom: '8px',
padding: '10px 0',
borderBottom: '1px solid #e5e5e5'
}
}
},
methods: {
onCheckboxChange(e) {
if (e.checked) {
const obj = this.indexList.filter(i => i.ID === e.id)[0]
this.multipleSelect.push(obj)
} else {
this.multipleSelect.forEach(item => {
if (e.id === item.ID) {
this.multipleSelect = this.multipleSelect.filter(i => i.ID !== e.id)
}
})
}
},
onOpen() {
this.pageIndex = 1
if (this.defaultValue) {
this.searchValue = this.defaultValue
this.handleSearch(this.defaultValue)
} else {
this.searchValue = ''
// this.indexList = this.lists
}
this.multipleSelect = this.defaultChecked
},
handleClosePopup() {
this.searchValue = ''
this.indexList = []
this.multipleSelect = []
this.$emit('close')
},
handleSearch(val) {
this.searchValue = val
this.indexList = []
this.$emit('search', val, 1)
},
handleSelected(val) {
this.searchValue = ''
this.indexList = []
this.multipleSelect = []
this.$emit('select', val)
},
handleOk() {
this.searchValue = ''
this.indexList = []
this.$emit('select', this.multipleSelect)
},
scrolltolower() {
if (this.total > this.pageIndex * 20) {
this.pageIndex++
this.$emit('search', this.searchValue, this.pageIndex)
}
}
},
watch: {
lists(newLists) {
this.indexList = this.indexList.concat(newLists)
}
}
}
</script>
<style scoped>
.head {
height: 46px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.head .cancel,
.head .ok {
font-size: 15px;
padding: 0 15px;
}
.head .cancel {
color: rgb(144, 145, 147);
}
.head .ok {
color: rgb(60, 156, 255)
}
.head .title {
color: #303133;
padding: 0 22px;
font-size: 16px;
flex: 1;
text-align: center;
}
.search {
padding: 0 10px;
}
.multi-checkbox {
padding: 16px;
}
.single-select {
margin-right: 16px;
margin-left: 16px
}
.ok-button {
position: absolute;
top: 15px;
right: 15px;
width: max-content;
z-index: 10;
}
</style>

View File

@ -4,6 +4,9 @@ import uView from '@/uni_modules/uview-ui'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import QuerySelector from 'components/custom/query-selector.vue'
Vue.component('query-selector', QuerySelector)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({

View File

@ -17,7 +17,10 @@
"delay" : 0
},
/* */
"modules" : {},
"modules" : {
"Barcode" : {},
"Camera" : {}
},
/* */
"distribute" : {
/* android */
@ -38,7 +41,8 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
/* ios */
"ios" : {},

View File

@ -3,7 +3,25 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
"navigationBarTitleText": "首页",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "进入",
"type": "none",
"color": "#304ffe",
"background": "#000000",
"fontSize": "14px"
}]
}
}
}
},
{
"path": "pages/camera/index",
"style": {
"navigationBarTitleText": "随手拍",
"onReachBottomDistance": 100
}
},
{
@ -25,7 +43,15 @@
}
}
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@ -8,8 +8,8 @@
<view class="content-icon">
<u-icon name="checkmark-circle" size="108" color="#5ac725" v-if="type == 'success'"></u-icon>
<view class="text" v-if="type == 'success'">提交成功</view>
<u-icon name="checkmark-circle" size="108" color="#f56c6c" v-if="type == 'failed'"></u-icon>
<view class="text" v-if="type == 'failed'">提交失败请稍后重新提交</view>
<u-icon name="close-circle" size="108" color="#f56c6c" v-if="type == 'failed'"></u-icon>
<view class="text" v-if="type == 'failed'">{{titleFailes}}</view>
<view style="display: flex;flex-direction: row;" class="bottom-button">
<!-- <u-button type="primary" @click="reset" color="#3d4b70" :plain="true" style="margin-right: 5px;">重置</u-button> -->
<u-button type="success" @click="submit" v-if="type == 'success'">完成</u-button>
@ -27,7 +27,8 @@
data() {
return {
showSex: false,
type:'success'
type: 'success',
titleFailes: '提交失败,请稍后重新提交',
}
},
@ -36,14 +37,17 @@
a.style.display = 'none';
},
onLoad(options) {
console.log(options.type, 'op')
this.type = options.type
if (options.title&&options.title!=='') {
this.titleFailes = options.title
}
},
onReady() {},
methods: {
submit() {
// uni.navigateBack()
uni.navigateTo({
uni.reLaunch({
url: '/pages/index/index'
})
},
@ -56,7 +60,12 @@
.content {
background-color: #fff;
width: 100%;
height: 100vh;
/* #ifndef APP-PLUS */
height: calc(100vh - 44px - 50px); // APP
/* #endif */
/* #ifdef APP-PLUS */
height: calc(100vh); // APP
/* #endif */
}
.container {

View File

@ -56,6 +56,10 @@
import {
RegisterUser
} from '../../services/apply.js'
import {
isChinaMobilePhone,
easyCheckID,
} from '../../utils/common.js'
export default {
data() {
return {
@ -73,6 +77,16 @@
WORKINGYEAR: '',
},
},
model2: {
userInfo: {
Name: '',
Sex: '',
Phone: '',
ID_CARD: '',
InTime: '',
WORKINGYEAR: '',
},
},
dateTimePickerInfo: {
showCheckDate: false,
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
@ -99,27 +113,36 @@
message: '请选择男或女',
trigger: ['blur', 'change']
},
'userInfo.Phone': {
type: 'string',
required: true,
message: '请填写手机号',
trigger: ['blur', 'change']
},
'userInfo.ID_CARD': {
type: 'string',
required: true,
message: '请填写身份证号',
trigger: ['blur', 'change']
},
'userInfo.InTime': {
type: 'string',
required: true,
message: '请选择入职时间',
trigger: ['blur', 'change']
},
'userInfo.WORKINGYEAR': {
type: 'string',
required: true,
message: '请选择工龄',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
}
},
onLoad() {
// console.log(this.pickerColumns, 'pickerColumns')
// let pages = getCurrentPages()
// let currentPage = pages[pages.length - 1]
// const currentUrl = `/${currentPage.route}`
// console.log(currentUrl,'currentUrl')
// let routes = currentPage.route
// let options = currentPage.options
// let opurl = routes + '?'
// console.log(options,'options')
// for(let key in options) {
// opurl +=key +'='+options[key]+'&'
// }
// opurl = opurl.substr(0,opurl.length - 1)
// console.log(opurl,'1231312321')
},
onLoad() {},
onReady() {
//setRules
this.$refs.uForm.setRules(this.rules)
@ -138,8 +161,6 @@
showCheckDate: true,
defaultDateTime: this.model1.userInfo.InTime,
}
},
handleCheckDate(e) {
// let v = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
@ -165,39 +186,56 @@
}
},
submit() {
// if (this.model1.userInfo.Name == '' ||
// this.model1.userInfo.Sex == '' ||
// this.model1.userInfo.Phone == '' ||
// this.model1.userInfo.ID_CARD == '' ||
// this.model1.userInfo.InTime == '' ||
// this.model1.userInfo.WORKINGYEAR == '') {
// uni.showToast({
// icon: 'error',
// title: ''
// })
// return
// }
console.log(this.model1.userInfo,'this.model1.userInfo')
const json = {
Name: '云',
Sex: '0',
Phone:'19846123760',
ID_CARD: '230182200000000000',
InTime: '2024-01-01 09:00:00',
WORKINGYEAR: '1',
if (this.model1.userInfo.Name == '' ||
this.model1.userInfo.Sex == '' ||
this.model1.userInfo.Phone == '' ||
this.model1.userInfo.ID_CARD == '' ||
this.model1.userInfo.InTime == '' ||
this.model1.userInfo.WORKINGYEAR == '') {
uni.showToast({
icon: 'error',
title: '信息不能为空'
})
return
}
if (isChinaMobilePhone(this.model1.userInfo.Phone) == false) {
uni.showToast({
icon: 'error',
title: '手机号码格式不正确'
})
return
}
if (easyCheckID(this.model1.userInfo.ID_CARD) == false) {
uni.showToast({
icon: 'error',
title: '身份证号码格式不正确'
})
return
}
this.model2.userInfo = this.model1.userInfo
if (this.model1.userInfo.Sex == '男') {
this.model2.userInfo.Sex = '1'
} else {
this.model2.userInfo.Sex = '0'
}
const json = this.model2.userInfo
RegisterUser(json).then((res) => {
if (res.code == 200) {
console.log('成功', res);
uni.navigateTo({
url: '/pages/apply/complete?type=success'
})
} else {
uni.navigateTo({
url: `/pages/apply/complete?type=failed&title=${res.msg}`
})
}
}).catch((err) => {
console.error('失败', err);
uni.navigateTo({
url: `/pages/apply/complete?type=failed&title=${err.msg}`
})
})
// console.log(this.model1, '12312')
// // uni.navigateBack()
// uni.navigateTo({
// url: '/pages/apply/complete?type=success'
// })
},
}
@ -208,7 +246,12 @@
.content {
background-color: #f4f7ff;
width: 100%;
height: 100vh;
/* #ifndef APP-PLUS */
height: calc(100vh - 44px - 50px); // APP
/* #endif */
/* #ifdef APP-PLUS */
height: calc(100vh); // APP
/* #endif */
}
.container {

266
pages/camera/index.vue Normal file
View File

@ -0,0 +1,266 @@
<template>
<view class="camera-page">
<uni-card class="card-style" margin="0" :is-shadow="true">
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel" :rules="rules"
ref="wForm" errorType="border-bottom">
<u-form-item label="接收人" prop="recipient.name" borderBottom
@click="handleShowPersonQuery">
<u--input :value="dataModel.recipient.name" readonly disabledColor="#fff" placeholder="请选择接收人"
border="none" inputAlign="right"></u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon>
</u-form-item>
<!-- <u-form-item label="检查层级" prop="checkLevel" borderBottom-->
<!-- @click="handleShowSheet({title: '检查层级', name: 'checkLevel'})">-->
<!-- <u&#45;&#45;input :value="dataModel.checkLevel.name" placeholder="请选择检查层级" disabled disabledColor="#fff"-->
<!-- border="none" inputAlign="right"></u&#45;&#45;input>-->
<!-- <u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon>-->
<!-- </u-form-item>-->
<!-- <u-form-item label="检查时间" prop="checkDate" borderBottom @click="showCheckDate = true;">-->
<!-- <u&#45;&#45;input disabled disabledColor="#fff" :value="dataModel.checkDate.value" border="none"-->
<!-- inputAlign="right"></u&#45;&#45;input>-->
<!-- </u-form-item>-->
<view class="label-title">照片</view>
<u-form-item borderBottom prop="pictureLists">
<u-upload :fileList="dataModel.pictureLists" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="3"
style="margin-bottom: 0;" :previewFullImage="true" uploadIcon="plus"></u-upload>
</u-form-item>
<view>
<view class="label-title">检查内容</view>
<u-form-item borderBottom>
<u--textarea :value="dataModel.checkContent.value" @input="onInput" placeholder="请输入检查内容"
border="surround"></u--textarea>
</u-form-item>
</view>
</u--form>
<!-- <people-selector :show="showSelectorPerson" @select="handleSelectorPeople"-->
<!-- @close="showSelectorPerson = false">-->
<!-- </people-selector>-->
<query-selector :show="showQueryPerson" :lists="userLists" :total="curTotal"
@close="handleClosePopup" @search="handleSearchUser" @select="handleSelectedUser" />
<!-- <u-datetime-picker :show="showCheckDate" mode="datetime" :value="dataModel.checkDate.value"-->
<!-- @confirm="handleCheckDate" @close="showCheckDate = false;"-->
<!-- @cancel="showCheckDate = false;"></u-datetime-picker>-->
<!-- <u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker"-->
<!-- @close="closePicker" @cancel="closePicker" keyName="name"></u-picker>-->
</uni-card>
<button type="primary" @click="handleSubmit">提交</button>
</view>
</template>
<script>
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendOrder,
extendRule,
guid,
initFilter, initFilterGroup
} from '../../utils/common'
// import {
// getUserLists
// } from '../../services/safe'
// import {
// saveSnapShot
// } from '../../services/app'
import config from '../../config/common'
export default {
data() {
return {
sourceUrl: config.uni_app_web_source_url,
userLists: [],
curTotal: 0,
showSelectorPerson: false,
showQueryPerson: false,
dataModel: {
recipient: {
name: '',
value: ''
},
checkContent: {
value: ''
},
pictureLists: [],
},
rules: {
'recipient.name': {
type: 'string',
required: true,
message: '请选择接收人',
trigger: ['blur', 'change']
},
'pictureLists': {
type: 'array',
required: true,
message: '请上传照片',
trigger: ['blur', 'change']
}
}
}
},
onLoad() {
// this.dataModel.pictureLists = this.$store.state.imageLists.map(i => {
// return {
// url: this.sourceUrl + i.IMG_FILE_PATH,
// id: i.IMG_FILE_ID,
// IMG_FILE_PATH: this.sourceUrl + i.IMG_FILE_PATH,
// IMG_FILE_ID: i.IMG_FILE_ID,
// }
// })
},
methods: {
handleShowPersonQuery() {
this.showQueryPerson = true
this.handleSearchUser('init')
},
handleClosePopup() {
this.showQueryPerson = false
},
// handleSelectorPeople(e) {
// console.log(e)
// },
handleSearchUser(val, pageIndex) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME", '', pageIndex)
extendInclude(json, "Nav_Person.Nav_Post")
extendRule(json, 'ENABLE_STATUS', 1, '0')
if (val !== 'init') {
const tempGroup = initFilterGroup(false);
extendGroupRule(tempGroup, 'NAME', 9, val)
extendFilterGroup(json, tempGroup);
}
json.Limit = 20
if (pageIndex) {
json.Start = (pageIndex - 1) * 20;
}
// getUserLists(json).then(res => {
// if (res.IsSuccessful) {
// this.userLists = res.Data.map(i => {
// return {
// ...i,
// name: i.NAME,
// code: i.CODE
// }
// })
// this.curTotal = res.TotalCount
// }
// })
},
handleSelectedUser(val) {
this.showQueryPerson = false
this.lists = []
this.dataModel.recipient = val
},
onInput(e) {
this.dataModel.checkContent.value = e
},
handleSubmit() {
const ele = this.$refs
ele['wForm'].validate().then(res => {
const orgId = uni.getStorageSync('orgId')
const appInfoData = uni.getStorageSync('appInfo')
const {
recipient,
checkContent,
pictureLists
} = this.dataModel
// const submitId = guid()
const params = {
ACCEPT_ID: recipient.ID,
DESCRIPTION: checkContent.value,
Nav_Files: pictureLists.map(i => {
return {
ID: guid(),
IMG_FILE_ID: i.IMG_FILE_ID,
ORG_ID: orgId,
}
}),
}
// saveSnapShot(params).then(res => {
// if (res) {
// uni.$showMsgFunc('', () => {
// uni.switchTab({
// url: '/pages/index/index2'
// })
// }, '', 1000)
// }
// })
}).catch(err => {
console.log('校验失败', err)
})
},
deletePic(event) {
this.dataModel.pictureLists.splice(event.index, 1)
},
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this.dataModel.pictureLists.length
lists.map((item) => {
this.dataModel.pictureLists.push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this.dataModel.pictureLists[fileListLen]
this.dataModel.pictureLists.splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
IMG_FILE_ID: result.imgFileID
// url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
const appInfoData = uni.getStorageSync('appInfo')
const userId = appInfoData?.User?.ID || ''
const orgId = uni.getStorageSync('orgId')
const tenant = uni.getStorageSync('Tenant') || ''
const remoteUrl = config.serviceHost('/PF/File/UploadFile')
return new Promise((resolve, reject) => {
uni.uploadFile({
url: remoteUrl,
filePath: url,
fileList: url,
name: 'file',
formData: {
OrgId: orgId
},
header: {
Tenant: tenant,
userid: userId
},
success: (res) => {
if (res.statusCode === 200) {
const uploadResult = JSON.parse(res.data)
if (uploadResult.IsSuccessful) {
resolve(uploadResult.Data)
}
}
}
})
})
},
}
}
</script>
<style scoped>
/* @import url("@/style/css/editTemplate.css"); */
.camera-page {
padding: 16px;
}
.label-title {
color: #303133;
font-size: 15px;
line-height: 22px;
padding-top: 8px;
}
</style>

View File

@ -2,35 +2,47 @@
<view class="content">
<view class="list">
<u-grid :border="false" @click="click" :col="2">
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff" @click="clicktwo">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.name" :size="42" color="#304ffe"></u-icon>
<text class="grid-text">{{baseListItem.title}}</text>
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex" bgColor="#fff">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.iconName" :size="42" color="#304ffe"></u-icon>
<text class="grid-text">{{baseListItem.name}}</text>
</u-grid-item>
</u-grid>
<view style="display: flex;flex-direction: row;" class="home-button">
<!-- <u-button type="primary" @click="reset" color="#3d4b70" :plain="true" style="margin-right: 5px;">重置</u-button> -->
<u-button type="primary" @click="goCamera" color="#3d4b70">隐患随手拍</u-button>
</view>
</view>
</view>
</template>
<script>
import {getMenu} from '../../services/apply'
import {
getMenu
} from '../../services/apply'
export default {
data() {
return {
baseList: [{
name: 'man-add',
title: '新员工信息录入'
},
baseList: [
{
name: 'warning',
title: '风险区域明细'
}, {
name: 'pushpin',
title: '区域风险四色图'
},
{
name: 'grid',
title: '区域隐患数量'
name: "新增用户",
iconName: "man-add"
},
// {
// name: "",
// iconName: "man-add"
// },
// {
// name: "",
// iconName: "man-add"
// },
// {
// name: "",
// iconName: "man-add"
// },
]
}
},
@ -41,17 +53,28 @@
this.getCaidan()
},
onNavigationBarButtonTap(e) {
let url = 'http://47.122.43.22:9100/'
uni.navigateTo({
url: '/pages/webview/webview?url=' + url
})
},
methods: {
click(name) {
console.log(name)
if (name == 0) {
this.baseList.map((item, index) => {
if (index == name) {
if (item.name == '新增用户') {
uni.navigateTo({
url: '/pages/apply/index?company=XLK&post=1'
url: '/pages/apply/index?Company=GXBB&post=1'
})
}
}
})
},
clicktwo(name) {
console.log(name, '2')
goCamera() {
uni.navigateTo({
url: '/pages/camera/index'
})
},
getCaidan() {
const json = {
@ -61,35 +84,12 @@
}
getMenu(json).then((res) => {
console.log('成功', res);
this.baseList = res.data
}).catch((err) => {
console.error('失败', err);
})
}
// getMenu() {
// uni.request({
// url: 'http://47.122.43.22:3179/api/BI/H5Controller/GetMenu', //
// data: {
// Company: 'XLK',
// Post:'',
// Type:1
// },
// header: {
// 'Content-Type': 'application/json;charset=UTF-8' //
// },
// success: res => {
// console.log(res)
// if (res.data.status !== 0) {
// return uni.showToast({
// title: ""
// })
// }
// this.data = res.data.messege
// }
// })
// }
}
}
@ -99,7 +99,12 @@
.content {
background-color: #f4f7ff;
width: 100%;
height: 100vh;
/* #ifndef APP-PLUS */
height: calc(100vh - 44px - 50px); // APP
/* #endif */
/* #ifdef APP-PLUS */
height: calc(100vh); // APP
/* #endif */
}
.list {
@ -118,6 +123,21 @@
border-radius: 10px;
}
.home-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 36px;
box-sizing: border-box;
background: #f4f7ff;
z-index: 999;
}
.home-button .u-button {
height: 50px;
}
.grid-text {
font-size: 14px;
color: #000;

18
pages/webview/webview.vue Normal file
View File

@ -0,0 +1,18 @@
<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(item) {
// 使web-view
this.url = decodeURIComponent(item.url)
// console.log(this.url)
}
}
</script>

BIN
static/camera2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -2,6 +2,7 @@
// import moment from 'moment';
// import { color } from 'html2canvas/dist/types/css/types/color'; //wyw 这个会影响
export function timeFix() {
const time = new Date()
const hour = time.getHours()
@ -1294,3 +1295,77 @@ export function duplicated(array) {
}
return false;
}
export function isChinaMobilePhone(phone) {
// 2024
var reg = new RegExp(/^(13[0-9]|14[05679]|15[012356789]|16[2567]|17[01235678]|18[0-9]|19[012356789])[0-9]{8}$/)
return reg.test(phone)
}
export function easyCheckID(code) {
return /^([0-9a-zA-Z]{15}|[0-9a-zA-Z]{18})$/.test(code)
}
export function IsChinese(str) {
// var reg = /^[\u0391-\uFFE5]+$/;
var reg =/[^\u4e00-\u9fa5]/
if (reg.test(str)) {
return false
} else {
return true
}
}
export function checkIDCard(code) {
// 校验非空
if (!code) {
return false
}
// 校验长度
if (code.length != 15 && code.length != 18) {
return false
}
// 定义判别用户身份证号的正则表达式15位或者18位最后一位可以为字母
//假设18位身份证号码:41000119910101123X 410001 19910101 123X
//^开头
//[1-9] 第一位1-9中的一个 4
//\\d{5} 五位数字 10001前六位省市县地区
//(18|19|20) 19现阶段可能取值范围18xx-20xx年
//\\d{2} 91年份
//((0[1-9])|(10|11|12)) 01月份
//(([0-2][1-9])|10|20|30|31)01日期
//\\d{3} 三位数字 123第十七位奇数代表男偶数代表女
//[0-9Xx] 0123456789Xx其中的一个 X第十八位为校验值
//$结尾
//假设15位身份证号码:410001910101123 410001 910101 123
//^开头
//[1-9] 第一位1-9中的一个 4
//\\d{5} 五位数字 10001前六位省市县地区
//\\d{2} 91年份
//((0[1-9])|(10|11|12)) 01月份
//(([0-2][1-9])|10|20|30|31)01日期
//\\d{3} 三位数字 123第十五位奇数代表男偶数代表女15位身份证不含X
//$结尾
var reg = new RegExp(/(^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/)
var matches = reg.test(code)
if (matches) {
// 15位的身份证直接返回合法
if (code.length == 15) {
return true
}
// 18位的进一步校验
try {
// TODO:
if (/^([0-9a-zA-Z]{18})$/.test(code)) {
return true
} else {
return false
}
} catch (e) {
console.error(e)
return false
}
}
return matches
}

View File

@ -6,17 +6,21 @@ import handle401 from './handle401'
export default (params) => {
let pages = getCurrentPages()
let currentPage = pages[pages.length - 1]
const currentUrl = `/${currentPage.route}`
console.log(currentUrl, 'currentUrl')
let routes = currentPage.route
let options = currentPage.options
let opurl = routes + '?'
for (let key in options) {
opurl += key + '=' + options[key] + '&amp;'
let tenantId = ''
console.log(options, 'options')
if (options.Company == 'DCJD') {
tenantId = 'A0000025'
} else if (options.Company == 'GXBB') {
tenantId = 'A0000028'
} else if (options.Company == 'LYYL') {
tenantId = 'A0000024'
} else if (options.Company == 'LYXT') {
tenantId = '0002'
} else {
tenantId = '0001'
}
opurl = opurl.substr(0, opurl.length - 1)
console.log(opurl, '1231312321')
console.log(tenantId,'tenantId')
let url = params.url;
let method = params.method || "get";
let data = params.data || {};
@ -24,13 +28,13 @@ export default (params) => {
// 'Blade-Auth': uni.getStorageSync('token') || '',
'Content-Type': 'application/json;charset=UTF-8',
// 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0',
'Tenant': uni.getStorageSync('tenantId') || '0001', // avue配置相关
'Tenant': tenantId, // avue配置相关
...params.header
}
if (method == "post") {
header = {
'Content-Type': 'application/json',
'Tenant': uni.getStorageSync('tenantId') || '0001',
'Content-Type': 'application/x-www-form-urlencoded',
'Tenant': tenantId,
...params.header
};
}