Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a558db31
authored
Oct 28, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
手机号赋值
1 parent
3e6796bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
components/CooperationApply/CooperationApply.js
components/CooperationApply/CooperationApply.wxml
pages/newEnergy/newEnergy.js
components/CooperationApply/CooperationApply.js
View file @
a558db3
// components/CooperationApply/CooperationApply.js
// components/CooperationApply/CooperationApply.js
import
WxValidate
from
"../../utils/WxValidate"
;
import
WxValidate
from
"../../utils/WxValidate"
;
import
util
from
"../../utils/util"
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -103,7 +104,7 @@ Component({
...
@@ -103,7 +104,7 @@ Component({
// 设置手机号
// 设置手机号
setPhone
(
phone
)
{
setPhone
(
phone
)
{
this
.
setData
({
this
.
setData
({
[
applyForm
.
contactPhone
]:
phone
,
[
'applyForm.contactPhone'
]:
phone
,
});
});
},
},
},
},
...
@@ -113,8 +114,13 @@ Component({
...
@@ -113,8 +114,13 @@ Component({
created
:
function
()
{
created
:
function
()
{
// 在组件实例刚刚被创建时执行
// 在组件实例刚刚被创建时执行
// 初始化验证规则函数
// 初始化验证规则函数
console
.
log
(
"created"
);
this
.
initValidate
();
this
.
initValidate
();
},
},
attached
:
function
()
{
if
(
util
.
getUserInfo
()
&&
util
.
getUserInfo
().
phone
)
{
this
.
setPhone
(
util
.
getUserInfo
().
phone
)
console
.
log
(
this
.
data
.
applyForm
)
}
}
},
},
});
});
components/CooperationApply/CooperationApply.wxml
View file @
a558db3
...
@@ -8,29 +8,23 @@
...
@@ -8,29 +8,23 @@
<form>
<form>
<view class="apply-info">
<view class="apply-info">
<view class='info-list'>
<view class='info-list'>
<text class="info-lable">
<text class="info-lable">门店名称<text class="require">*</text>
门店名称
<text class="require">*</text>
</text>
</text>
<input name="
apply
Name" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
<input name="
merchant
Name" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入门店名称' value="{{applyForm.merchantName}}" bindinput="handleInput" data-name="merchantName" maxlength="30"></input>
</view>
</view>
<view class='info-list'>
<view class='info-list'>
<text class="info-lable">{{tabIndex == 0 ? '主营品牌' : '合作品牌'}}</text>
<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>
<view class='info-list'>
<view class='info-list'>
<text class="info-lable">
<text class="info-lable">联系人<text class="require">*</text>
联系人
<text class="require">*</text>
</text>
</text>
<input name="
bussiness
Name" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
<input name="
contact
Name" type='text' placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入姓名' value="{{applyForm.contactName}}" bindinput="handleInput" data-name="contactName" maxlength="30"></input>
</view>
</view>
<view class='info-list'>
<view class='info-list'>
<text class="info-lable">
<text class="info-lable">手机号<text class="require">*</text>
手机号
<text class="require">*</text>
</text>
</text>
<input name="
bussinessNam
e" type='text' maxlength="11" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
<input name="
contactPhon
e" type='text' maxlength="11" placeholder-style='font-size:28rpx;color: #9E9EA8;' placeholder='请输入手机号' value="{{applyForm.contactPhone}}" bindinput="handleInput" data-name="contactPhone"></input>
</view>
</view>
</view>
</view>
</form>
</form>
...
...
pages/newEnergy/newEnergy.js
View file @
a558db3
...
@@ -24,6 +24,7 @@ Page({
...
@@ -24,6 +24,7 @@ Page({
this
.
setData
({
this
.
setData
({
applyShow
:
!
this
.
data
.
applyShow
applyShow
:
!
this
.
data
.
applyShow
})
})
this
.
selectComponent
(
'#applyForm'
).
setPhone
(
Util
.
getUserInfo
().
phone
)
},
},
// 授权手机号
// 授权手机号
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment