init
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
25
xhs-mini-demos/component-case/add-contact/add-contact.js
Normal file
25
xhs-mini-demos/component-case/add-contact/add-contact.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Page({
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '新增联系人',
|
||||
path: 'packageAPI/pages/add-contact/add-contact',
|
||||
};
|
||||
},
|
||||
|
||||
submit(e) {
|
||||
const formData = e.detail.value;
|
||||
xhs.addPhoneContact({
|
||||
...formData,
|
||||
success() {
|
||||
xhs.showToast({
|
||||
title: '联系人创建成功',
|
||||
});
|
||||
},
|
||||
fail() {
|
||||
xhs.showToast({
|
||||
title: '联系人创建失败',
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "新增联系人"
|
||||
}
|
||||
36
xhs-mini-demos/component-case/add-contact/add-contact.xhsml
Normal file
36
xhs-mini-demos/component-case/add-contact/add-contact.xhsml
Normal file
@@ -0,0 +1,36 @@
|
||||
<view class="container">
|
||||
<template is="head" data="{{title: 'addPhoneContact'}}"/>
|
||||
|
||||
<view class="page-body">
|
||||
<form bindsubmit="submit">
|
||||
<view class="page-section">
|
||||
<view class="weui-cells__title">姓氏</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell weui-cell_input">
|
||||
<input class="weui-input" name="lastName" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-section">
|
||||
<view class="weui-cells__title">名字</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell weui-cell_input">
|
||||
<input class="weui-input" name="firstName" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-section">
|
||||
<view class="weui-cells__title">手机号</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell weui-cell_input">
|
||||
<input class="weui-input" name="mobilePhoneNumber" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" formType="submit">创建联系人</button>
|
||||
<button type="default" formType="reset">重置</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user