视频模块

This commit is contained in:
张文涛 2024-10-28 23:40:53 +08:00
parent cfc0150419
commit 2dfa821ffb
2 changed files with 142 additions and 90 deletions

View File

@ -3,24 +3,24 @@
<view class="edit-info">
<view style="padding-bottom: 200rpx;">
<u-cell-group :border='false'>
<u-cell title="姓名" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleName">
<!-- @click="handleName" -->
<u-cell title="姓名" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 400rpx;" slot="value">
{{userInfo.name}}
<input type="text" v-model="userInfo.name" />
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="身份证号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleIdcard">
<!-- @click="handleIdcard" -->
<u-cell title="身份证号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
{{userInfo.idcard}}
<input type="text" v-model="userInfo.idcard" />
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="手机号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleMobile">
<!-- @click="handleMobile" -->
<u-cell title="手机号" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
{{userInfo.contact_mobile}}
<input type="number" v-model="userInfo.contact_mobile" />
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
@ -31,13 +31,12 @@
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="生日" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<u-cell @click="handleBirth" title="生日" size="large" :border='false'
:titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
v-model="userInfo.birthday">{{userInfo.birthday}}
</uni-datetime-picker>
{{userInfo.birthday}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="学历" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleEmotion">
@ -55,40 +54,39 @@
</u-cell>
<u-cell title="安置地" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="showCity">
<view class="input-val" style="width: 450rpx;" slot="value">
{{userInfo.to_province_name}}-{{userInfo.to_city_name}}-{{userInfo.to_area_name}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell v-if="userInfo.reside_province_name" title="现居住地" size="large" :border='false'
:titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}" @click="showReside">
<view class="input-val" style="width: 450rpx;" slot="value">
{{userInfo.reside_province_name}}-{{userInfo.reside_city_name}}-{{userInfo.reside_area_name}}
{{userInfo.to_province_name}}{{userInfo.to_city_name}}{{userInfo.to_area_name}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="详细地址" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleDetail">
<u-cell title="现居住地" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="showReside">
<view class="input-val" style="width: 450rpx;" slot="value">
{{userInfo.detail}}
{{userInfo.reside_province_name}}{{userInfo.reside_city_name}}{{userInfo.reside_area_name}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="入伍时间" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
v-model="userInfo.join_time">{{userInfo.join_time}}
</uni-datetime-picker>
<!-- @click="handleDetail" -->
<u-cell title="详细地址" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 450rpx;" slot="value">
<input type="text" v-model="userInfo.detail" />
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="退役时间" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<u-cell @click="handlejoinTime" title="入伍时间" size="large" :border='false'
:titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
<uni-datetime-picker ref="birth" type="date" :clear-icon="false"
v-model="userInfo.retire_time">{{userInfo.retire_time}}
</uni-datetime-picker>
{{userInfo.join_time}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF" @click="handleBirth"></u-icon>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell @click="handleretireTime" title="退役时间" size="large" :border='false'
:titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
{{userInfo.retire_time}}
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="人员类别" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handleCategory">
@ -104,10 +102,10 @@
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
<u-cell title="职业技能培训意向" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}"
@click="handlePurpose">
<!-- @click="handlePurpose" -->
<u-cell title="职业技能培训意向" size="large" :border='false' :titleStyle="{fontSize:'32rpx',color:'#9CA3AF'}">
<view class="input-val" style="width: 350rpx;" slot="value">
{{userInfo.purpose}}
<input type="text" v-model="userInfo.purpose" />
</view>
<u-icon slot="right-icon" name="edit-pen" size="26" color="#9CA3AF"></u-icon>
</u-cell>
@ -119,36 +117,23 @@
<button @click="submit" class="button">确认</button>
</view>
</view>
<!-- 昵称 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入昵称" :value="userInfo.name" placeholder="请输入内容"
@confirm="nameConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 身份证号 -->
<uni-popup ref="idcardDialog" type="dialog">
<uni-popup-dialog :before-close='true' ref="inputClose" mode="input" title="输入身份证" :value="userInfo.idcard"
placeholder="请输入内容" @close="idcardClose" @confirm="idcardConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 手机号码 -->
<uni-popup ref="mobileDialog" type="dialog">
<uni-popup-dialog :before-close='true' ref="inputClose" mode="input" title="输入手机号"
:value="userInfo.contact_mobile" placeholder="请输入内容" @close="mobileClose"
@confirm="mobileConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 详细地址 -->
<uni-popup ref="detailDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入详细地址" :value="userInfo.detail" placeholder="请输入内容"
@confirm="detailConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 意向 -->
<uni-popup ref="purposeDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入职业技能培训意向" :value="userInfo.purpose"
placeholder="请输入内容" @confirm="purposeConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 安置地城市选择 -->
<liuChooseAddress ref="scroll" @change='chooseSuccess'></liuChooseAddress>
<!-- 现居地城市选择 -->
<liuChooseAddress ref="scrolls" @change='chooseSuccesss'></liuChooseAddress>
<!-- 生日 -->
<u-datetime-picker @cancel="birth=false" :minDate="Number(new Date('1950-01-01'))"
:maxDate='new Date().getTime()' ref="datetimePicker" :show="birth" v-model="value1" mode="date"
:formatter="formatter" @confirm="birthConfirm"></u-datetime-picker>
<!-- 入伍时间 -->
<u-datetime-picker @cancel="joinTime=false" :minDate="Number(new Date('1950-01-01'))"
:maxDate='new Date().getTime()' ref="datetimePicker" :show="joinTime" v-model="value1" mode="date"
:formatter="formatter" @confirm="joinTimeConfirm"></u-datetime-picker>
<!-- 退伍时间 -->
<u-datetime-picker @cancel="retireTime=false" :minDate="Number(new Date('1950-01-01'))"
:maxDate='new Date().getTime()' ref="datetimePicker" :show="retireTime" v-model="value1" mode="date"
:formatter="formatter" @confirm="retireTimeConfirm"></u-datetime-picker>
</view>
</template>
@ -170,6 +155,10 @@
},
data() {
return {
birth: false,
joinTime: false,
retireTime: false,
value1: Number(new Date()),
userInfo: {
code: "", //code
org_id: "", //ID 1
@ -226,11 +215,11 @@
},
isPickerVisible: false, //
selectedAddress: '', //
pageType: 'edit'
pageType: 'edit',
}
},
onLoad(options) {
console.log(options,'');
console.log(options, '');
if (options.type && options.type == 'register') {
this.userInfo.org_id = 1
this.userInfo.code = options.code
@ -247,7 +236,25 @@
}
},
onReady() {
//
this.$refs.datetimePicker.setFormatter(this.formatter)
},
methods: {
formatter(type, value) {
if (type === 'year') {
return `${value}`
}
if (type === 'month') {
return `${value}`
}
if (type === 'day') {
return `${value}`
}
return value
},
getPreInfo() {
uni.showLoading({
title: '加载中...'
@ -356,9 +363,36 @@
}
})
},
formatDate(timestamp) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 01
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
handleBirth() {
this.$refs.birth.show()
this.birth = true
},
birthConfirm(e) {
this.birth = false
this.userInfo.birthday = this.formatDate(e.value)
},
handlejoinTime() {
this.joinTime = true
},
joinTimeConfirm(e) {
this.joinTime = false
this.userInfo.join_time = this.formatDate(e.value)
},
handleretireTime() {
this.retireTime = true
},
retireTimeConfirm(e) {
this.retireTime = false
this.userInfo.retire_time = this.formatDate(e.value)
},
//
handleEmotion() {
@ -456,9 +490,9 @@
})
return
}
if (!that.userInfo.contact_mobile) {
if (!that.isValidIDCard(that.userInfo.idcard)) {
uni.showToast({
title: '请输入手机号',
title: '身份证格式错误',
icon: 'none'
})
return
@ -470,6 +504,13 @@
})
return
}
if (!that.isValidPhoneNumber(that.userInfo.contact_mobile)) {
uni.showToast({
title: '手机号格式错误',
icon: 'none'
})
return
}
if (!that.userInfo.sex) {
uni.showToast({
title: '请选择性别',
@ -560,37 +601,47 @@
that.userInfo.name = rsaEncrypt(that.userInfo.name);
that.userInfo.idcard = rsaEncrypt(that.userInfo.idcard);
that.userInfo.contact_mobile = rsaEncrypt(that.userInfo.contact_mobile);
infoEdit(that.userInfo).then(res => {
uni.hideLoading()
if (res.code == 0) {
uni.showLoading({
title: '提交成功',
icon: 'none'
})
if (that.pageType == 'edit') {
if (that.pageType == 'edit') {
infoEdit(that.userInfo).then(res => {
uni.hideLoading()
if (res.code == 0) {
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 400)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
} else {
register(that.userInfo).then(res => {
uni.hideLoading()
if (res.code == 0) {
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/home/home'
})
}, 400)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
} else {
uni.showLoading({
title: res.msg,
icon: 'none'
})
}
})
})
}
}
}

View File

@ -18,7 +18,8 @@ function codes() {
uni.reLaunch({
url: '/pages/home/home'
})
} else {
}
else {
uni.reLaunch({
url: '/pages/mine/edit-info?type=register' + '&code=' + res.code
})