Commit a558db31 by 前端

手机号赋值

1 parent 3e6796bf
// components/CooperationApply/CooperationApply.js
import WxValidate from "../../utils/WxValidate";
import util from "../../utils/util"
Component({
/**
* 组件的属性列表
......@@ -103,7 +104,7 @@ Component({
// 设置手机号
setPhone(phone) {
this.setData({
[applyForm.contactPhone]: phone,
['applyForm.contactPhone']: phone,
});
},
},
......@@ -113,8 +114,13 @@ Component({
created: function () {
// 在组件实例刚刚被创建时执行
// 初始化验证规则函数
console.log("created");
this.initValidate();
},
attached: function() {
if (util.getUserInfo()&& util.getUserInfo().phone) {
this.setPhone(util.getUserInfo().phone)
console.log(this.data.applyForm)
}
}
},
});
......@@ -8,29 +8,23 @@
<form>
<view class="apply-info">
<view class='info-list'>
<text class="info-lable">
门店名称
<text class="require">*</text>
<text class="info-lable">门店名称<text class="require">*</text>
</text>
<input name="applyName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
<input name="merchantName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '主营品牌' : '合作品牌'}}</text>
<input name="telphone" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入主营车型' value="{{applyForm.carModel}}" bindinput="handleInput" data-name="carModel" maxlength="30"></input>
<input name="carModel" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入主营车型' value="{{applyForm.carModel}}" bindinput="handleInput" data-name="carModel" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">
联系人
<text class="require">*</text>
<text class="info-lable">联系人<text class="require">*</text>
</text>
<input name="bussinessName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
<input name="contactName" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
</view>
<view class='info-list'>
<text class="info-lable">
手机号
<text class="require">*</text>
<text class="info-lable">手机号<text class="require">*</text>
</text>
<input name="bussinessName" type='text' maxlength="11" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
<input name="contactPhone" type='text' maxlength="11" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
</view>
</view>
</form>
......
......@@ -24,6 +24,7 @@ Page({
this.setData({
applyShow: !this.data.applyShow
})
this.selectComponent('#applyForm').setPhone(Util.getUserInfo().phone)
},
// 授权手机号
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!