|
@@ -7,6 +7,7 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
+ site: getApp().globalData.site,
|
|
|
attinfos: [],
|
|
|
fromList1: [{
|
|
|
label: "姓名",
|
|
@@ -26,16 +27,6 @@ Page({
|
|
|
placeholder: "请填写",
|
|
|
valueName: "email", //绑定的字段名称
|
|
|
required: true //必填
|
|
|
- }, {
|
|
|
- label: "手机号",
|
|
|
- error: false,
|
|
|
- errMsg: "",
|
|
|
- type: "text",
|
|
|
- value: "",
|
|
|
- placeholder: "请填写",
|
|
|
- valueName: "phonenumber", //绑定的字段名称
|
|
|
- required: true, //必填
|
|
|
- callback: null,
|
|
|
}],
|
|
|
disabled: true, //禁用按钮
|
|
|
show: false, //显示验证码输入框
|
|
@@ -49,21 +40,36 @@ Page({
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
const that = this;
|
|
|
+ console.log(options.email)
|
|
|
this.setData({
|
|
|
attinfos: JSON.parse(options.attinfos),
|
|
|
"fromList1[0].value": options.name,
|
|
|
"fromList1[1].value": options.email == "undefined" ? "" : options.email,
|
|
|
- "fromList1[2].value": options.phonenumber,
|
|
|
- "fromList1[2].callback": function ({
|
|
|
- value
|
|
|
- }) {
|
|
|
- that.setData({
|
|
|
- show: (value != that.data.copyPhonenumber) ? true : false,
|
|
|
- newPhone: value
|
|
|
- })
|
|
|
- },
|
|
|
"copyPhonenumber": options.phonenumber
|
|
|
});
|
|
|
+ if (!['美大'].includes(this.data.site)) { //美大禁用修改手机号
|
|
|
+ this.data.fromList1.push({
|
|
|
+ label: "手机号",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "text",
|
|
|
+ value: options.phonenumber,
|
|
|
+ placeholder: "请填写",
|
|
|
+ valueName: "phonenumber", //绑定的字段名称
|
|
|
+ required: true, //必填
|
|
|
+ callback: function ({
|
|
|
+ value
|
|
|
+ }) {
|
|
|
+ that.setData({
|
|
|
+ show: (value != that.data.copyPhonenumber) ? true : false,
|
|
|
+ newPhone: value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ fromList1:this.data.fromList1
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
/* from1监听 */
|
|
|
form1CompletedOrNot({
|
|
@@ -112,7 +118,7 @@ Page({
|
|
|
submit() {
|
|
|
if (this.data.disabled || this.data.loading) return;
|
|
|
let data = this.selectComponent("#form1").getData().returnData;
|
|
|
- if (!deletMark.CheckPhoneNumber(data.phonenumber.trim() - 0)) return;
|
|
|
+ if (!['美大'].includes(this.data.site) && !deletMark.CheckPhoneNumber(data.phonenumber.trim() - 0)) return;
|
|
|
if (!deletMark.CheckEmail(data.email.trim())) return;
|
|
|
if (this.data.show && this.data.password.length == 0) return wx.showToast({
|
|
|
title: '请输入短信验证码',
|
|
@@ -126,7 +132,7 @@ Page({
|
|
|
"method": "updateUserMsg",
|
|
|
"content": {
|
|
|
"name": data.name,
|
|
|
- "phonenumber": data.phonenumber,
|
|
|
+ "phonenumber": !['美大'].includes(this.data.site) ? data.phonenumber : this.data.copyPhonenumber,
|
|
|
"email": data.email,
|
|
|
"password": MD5.hexMD5(this.data.password.trim())
|
|
|
}
|
|
@@ -166,23 +172,21 @@ Page({
|
|
|
"usetype": "headportrait",
|
|
|
"attachmentids": detail
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
+ }).then(async res => {
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
- let attinfos = this.data.attinfos;
|
|
|
- if (attinfos[0]) _Http.basic({
|
|
|
+ let linksids = this.data.attinfos.map(v => v.linksid);
|
|
|
+ if (linksids.length) await _Http.basic({
|
|
|
"classname": "system.attachment.Attachment",
|
|
|
"method": "deleteFileLink",
|
|
|
"content": {
|
|
|
- "linksids": [attinfos[0].linksid]
|
|
|
+ "linksids": linksids
|
|
|
}
|
|
|
});
|
|
|
- attinfos = res.data;
|
|
|
this.setData({
|
|
|
- attinfos
|
|
|
+ attinfos: res.data
|
|
|
})
|
|
|
this.changeUserMsg();
|
|
|
})
|