|
|
@@ -15,7 +15,7 @@
|
|
|
<text>姓名</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="text" placeholder="请输入姓名" name="selfName">
|
|
|
+ <input type="text" placeholder="请输入姓名" name="selfName" :value="userName" >
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
@@ -24,7 +24,7 @@
|
|
|
<text>手机号</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="tel" placeholder="请输入手机号" name="selfTel">
|
|
|
+ <input type="tel" placeholder="请输入手机号" name="selfTel" :value="userPhone" disabled="true">
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
@@ -33,17 +33,14 @@
|
|
|
<text>个人照片</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <view class="update_button display-flex">
|
|
|
+ <!-- <image :src="userHeadImg" mode="aspectFit" style="width: 120rpx;height: 120rpx;border-radius: 10rpx;" @click="showLarge(userHeadImg)"></image> -->
|
|
|
+ <view class="update_button display-flex">
|
|
|
<view class="upload-box" @click="getImage('album')">
|
|
|
<view class="img">
|
|
|
<image src="/static/photo.png" class="photo"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view
|
|
|
- class="display-flex upload-box-photo"
|
|
|
- v-for="(item, index) in uploadList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
+ <view class="display-flex upload-box-photo" v-for="(item, index) in uploadList" :key="index">
|
|
|
<image :src="item" mode="aspectFit" style="width: 100%; height: 100%" @click="showLarge(item)"/>
|
|
|
<image src="/static/del.png" class="del-icon"mode="aspectFit"
|
|
|
style="width: 30rpx; height: 30rpx" @click="delPhoto(index)"></image>
|
|
|
@@ -51,8 +48,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
<view class="info-box">
|
|
|
<view class="info-title-box">
|
|
|
<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
|
|
|
@@ -80,7 +75,7 @@
|
|
|
<text>民族</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="text" placeholder="请输入民族" name="selfName">
|
|
|
+ <input type="text" placeholder="请输入民族" name="selfNation" :value="userNation" >
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -106,7 +101,7 @@
|
|
|
<uni-datetime-picker
|
|
|
class="time-select-box"
|
|
|
type="date"
|
|
|
- :value="single"
|
|
|
+ :value="userBorn"
|
|
|
@change="change"
|
|
|
:clear-icon="false"
|
|
|
/>
|
|
|
@@ -118,7 +113,7 @@
|
|
|
<text>学历</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <picker @change="bindPickerChange($event,'education')" :range="educationArray" class="select-box" name="education">
|
|
|
+ <picker @change="bindPickerChange($event,'education')" :range="educationArray" class="select-box" >
|
|
|
<view class="uni-input">{{educationValue}}</view>
|
|
|
<image src="/static/arrow_down.svg" mode="aspectFill"></image>
|
|
|
</picker>
|
|
|
@@ -130,7 +125,7 @@
|
|
|
<text>工作单位</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="text" placeholder="西安芝麻开花科技有限公司" name="selfName">
|
|
|
+ <input type="text" placeholder="" name="selfOffice" :value="userOffice" >
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
@@ -139,7 +134,7 @@
|
|
|
<text>职务</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="text" placeholder="无" name="selfName">
|
|
|
+ <input type="text" placeholder="无" name="selfPosition" :value="userPosition">
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info-box">
|
|
|
@@ -148,11 +143,11 @@
|
|
|
<text>职称</text>
|
|
|
</view>
|
|
|
<view class="info-value-box">
|
|
|
- <input type="text" placeholder="项目经理" name="selfName">
|
|
|
+ <input type="text" placeholder="" :value="userTitle" name="selfTitle">
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="display: flex;justify-content: space-evenly;">
|
|
|
- <button type="default" class="submit-bth" style="background-color: #aaaaaa;">清空</button>
|
|
|
+ <!-- <button type="default" class="submit-bth" style="background-color: #aaaaaa;">清空</button> -->
|
|
|
<button type="primary" class="submit-bth" style="background-color: #169bd5;" formType="submit">提交</button>
|
|
|
</view>
|
|
|
</form>
|
|
|
@@ -172,12 +167,20 @@
|
|
|
dateMonth:new Date().getMonth() + 1,
|
|
|
arrayMonth:["1", "2","3", "4","5", "6","7", "8","9", "10","11", "12"],
|
|
|
title: 'Hello',
|
|
|
+ userName:'',
|
|
|
+ userPhone:getApp().globalData.user_phone,
|
|
|
+ userHeadImg:getApp().globalData.user_headUrl,
|
|
|
detailObj:{},
|
|
|
shareContent:'',
|
|
|
shareCode:'',
|
|
|
storeImg:'',
|
|
|
isAuthPhone:getApp().globalData.user_phone,
|
|
|
userSex:'1',
|
|
|
+ userNation:'',
|
|
|
+ userBorn:'',
|
|
|
+ userOffice:'',
|
|
|
+ userPosition:'',
|
|
|
+ userTitle:'',
|
|
|
txt: '请选择',
|
|
|
educationValue:'请选择',
|
|
|
educationArray: ['博士研究生','硕士研究生','本科','大专','中专'],
|
|
|
@@ -198,10 +201,25 @@
|
|
|
loginObj:{},
|
|
|
uploadList: [],
|
|
|
imgIdList: [],
|
|
|
+ headImgId:'',
|
|
|
+ educationObj:{
|
|
|
+ '1':'中专',
|
|
|
+ '2':'大专',
|
|
|
+ '3':'本科',
|
|
|
+ '4':'硕士研究生',
|
|
|
+ '5':'博士研究生'
|
|
|
+ },
|
|
|
+ educationObjEdit:{
|
|
|
+ '中专':'1',
|
|
|
+ '大专':'2',
|
|
|
+ '本科':'3',
|
|
|
+ '硕士研究生':'4',
|
|
|
+ '博士研究生':'5'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- //this.getTradeRequest();
|
|
|
+ this.getMemberInfo();
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
|
@@ -212,27 +230,68 @@
|
|
|
// }
|
|
|
// },
|
|
|
methods: {
|
|
|
+ getMemberInfo() {
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +"member" + "×tamp=" + getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" + getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url = getApp().globalData.shareUrl +"api/api.php" +
|
|
|
+ "?method=member&action=info×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&sign=" +
|
|
|
+ md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openid: getApp().globalData.open_id,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ let userInfoObj = res.data.data;
|
|
|
+ this.userName = userInfoObj.name;
|
|
|
+ this.dateYear = userInfoObj.jion_year;
|
|
|
+ this.dateMonth = userInfoObj.jion_month;
|
|
|
+ this.userNation = userInfoObj.nation;
|
|
|
+ this.userSex = userInfoObj.sex;
|
|
|
+ this.userBorn = (userInfoObj.birth_day).substr(0,4) + '-' + (userInfoObj.birth_day).substr(4,2) + '-' + (userInfoObj.birth_day).substr(6);
|
|
|
+ this.educationValue = this.educationObj[userInfoObj.education_level];
|
|
|
+ this.userOffice = userInfoObj.office;
|
|
|
+ this.userPosition = userInfoObj.position;
|
|
|
+ this.userTitle = userInfoObj.technical_title;
|
|
|
+ if(userInfoObj.pic_url){
|
|
|
+ userInfoObj.pic_url = getApp().globalData.shareUrl + userInfoObj.pic_url
|
|
|
+ this.uploadList.push(userInfoObj.pic_url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
bindDateChange(e){
|
|
|
this.dateYear = e.target.value
|
|
|
-
|
|
|
},
|
|
|
bindDateMonthChange(e){
|
|
|
this.dateMonth = this.arrayMonth[e.target.value]
|
|
|
},
|
|
|
change(e) {
|
|
|
- this.single = e;
|
|
|
- console.log("-change事件:", e);
|
|
|
+ this.userBorn = e;
|
|
|
},
|
|
|
getImage(type) {
|
|
|
let that = this;
|
|
|
- // if (that.uploadList.length >= 9) {
|
|
|
- // uni.showToast({
|
|
|
- // title: "最多上传9张图片",
|
|
|
- // icon: "none",
|
|
|
- // duration: 2500,
|
|
|
- // });
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ if (that.uploadList.length === 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "最多上传1张图片",
|
|
|
+ icon: "none",
|
|
|
+ duration: 2500,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
uni.chooseImage({
|
|
|
sourceType: [type],
|
|
|
count: 1,
|
|
|
@@ -253,17 +312,14 @@
|
|
|
});
|
|
|
let that = this;
|
|
|
let md5Sign = md5(
|
|
|
- "method=" +
|
|
|
- "upload" +
|
|
|
- "×tamp=" +
|
|
|
+ "method=" +"member_upload" +"×tamp=" +
|
|
|
getApp().globalData.globalTimestamp +
|
|
|
- "&secret=" +
|
|
|
- getApp().globalData.secret
|
|
|
+ "&secret=" + getApp().globalData.secret
|
|
|
);
|
|
|
let url =
|
|
|
getApp().globalData.shareUrl +
|
|
|
"api/api.php" +
|
|
|
- "?method=upload&source=activity&id=1×tamp=" +
|
|
|
+ "?method=member_upload×tamp=" +
|
|
|
getApp().globalData.globalTimestamp +
|
|
|
"&sign=" +
|
|
|
md5Sign;
|
|
|
@@ -273,12 +329,14 @@
|
|
|
name: "file",
|
|
|
formData: {
|
|
|
file: fileVal,
|
|
|
+ openid:getApp().globalData.open_id,
|
|
|
},
|
|
|
success: (res) => {
|
|
|
let tmpres = JSON.parse(res.data);
|
|
|
console.log(tmpres);
|
|
|
uni.hideLoading();
|
|
|
that.imgIdList.push(tmpres.data.id);
|
|
|
+ that.headImgId = tmpres.data.id;
|
|
|
},
|
|
|
fail: (res) => {
|
|
|
console.log("上传请求失败");
|
|
|
@@ -302,12 +360,6 @@
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- getProvinceRequest(){
|
|
|
- let that = this;
|
|
|
- },
|
|
|
- getTradeRequest(){
|
|
|
- let that = this;
|
|
|
- },
|
|
|
radioCheck(e){
|
|
|
console.log(e.target.value)
|
|
|
this.userSex = e.target.value;
|
|
|
@@ -318,87 +370,69 @@
|
|
|
console.log(data.data.join(''))
|
|
|
},
|
|
|
bindPickerChange(e,type) {
|
|
|
- let that = this;
|
|
|
- switch (type){
|
|
|
- case 'education':
|
|
|
- that.educationValue = that.educationArray[e.target.value]
|
|
|
- console.log(that.educationValue)
|
|
|
- break;
|
|
|
- case 'profession':
|
|
|
- that.professionValue = that.professionArray[e.target.value]
|
|
|
- break;
|
|
|
- case 'ends':
|
|
|
- that.endsValue = that.endsArray[e.target.value]
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- testLength(){
|
|
|
- if(this.addressDetail.length > 25){
|
|
|
- uni.showToast({
|
|
|
- title: '详细地址应为0-25个字符',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
+ this.educationValue = this.educationArray[e.target.value]
|
|
|
+ console.log(this.educationValue)
|
|
|
+ console.log(this.educationObjEdit[this.educationValue])
|
|
|
+ },
|
|
|
formSubmit(e) {
|
|
|
- //this.goCustomCardPage()
|
|
|
- //将下列代码加入到对应的检查位置
|
|
|
- //定义表单规则
|
|
|
- var rule = [
|
|
|
- {
|
|
|
- name: "selfName",
|
|
|
- checkType: "notnull",
|
|
|
- errorMsg: "姓名不能为空"
|
|
|
- },
|
|
|
- // {
|
|
|
- // name: "selfName",
|
|
|
- // checkType: "string",
|
|
|
- // checkRule: "2,15",
|
|
|
- // errorMsg: "姓名不能少于2个汉字"
|
|
|
- // },
|
|
|
- {
|
|
|
- name: "selfName",
|
|
|
- checkType: "reg",
|
|
|
- checkRule: "[\u4e00-\u9fa5]",
|
|
|
- errorMsg: "姓名需为中文"
|
|
|
- }
|
|
|
- // {
|
|
|
- // name: "trade",
|
|
|
- // checkType: "notnull",
|
|
|
- // errorMsg: "行业不能为空"
|
|
|
- // }
|
|
|
- ];
|
|
|
//进行表单检查
|
|
|
var formData = e.detail.value;
|
|
|
console.log(formData)
|
|
|
- var checkRes = graceChecker.check(formData, rule);
|
|
|
- if (checkRes) {
|
|
|
- this.txt === '请选择' ?
|
|
|
+ if(!formData.selfName){
|
|
|
uni.showToast({
|
|
|
- title: '请选择地区',
|
|
|
- icon: "none"
|
|
|
- }):
|
|
|
- this.submitRequest(formData);
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: graceChecker.error,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- }
|
|
|
+ title:'请填写姓名',
|
|
|
+ duration:2500,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.submitRequest(formData)
|
|
|
+ }
|
|
|
},
|
|
|
submitRequest(params){
|
|
|
- console.log(params)
|
|
|
- let that = this;
|
|
|
+ console.log(this.userTitle,this.headImgId)
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +"member" + "×tamp=" + getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" + getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url = getApp().globalData.shareUrl +"api/api.php" +
|
|
|
+ "?method=member&action=info_update×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&sign=" +
|
|
|
+ md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openid: getApp().globalData.open_id,
|
|
|
+ name:params.selfName,
|
|
|
+ jion_year :this.dateYear,
|
|
|
+ jion_month :this.dateMonth,
|
|
|
+ sex : this.userSex,
|
|
|
+ birth_day: this.userBorn,
|
|
|
+ office :params.selfOffice,
|
|
|
+ position:params.selfPosition,
|
|
|
+ nation:params.selfNation,
|
|
|
+ technical_title:params.selfTitle,
|
|
|
+ education_level:this.educationObjEdit[this.educationValue],
|
|
|
+ photo_attach_id:this.headImgId,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'修改成功',
|
|
|
+ duration:2500,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
- goCustomCardPage(){
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/index/successPage/index?types='+'custom', //游客成功页面
|
|
|
- success: res => {},
|
|
|
- fail: () => {},
|
|
|
- complete: () => {}
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</script>
|