feat: add-contact
parent
602ba24ade
commit
7a25125f1a
|
@ -0,0 +1,19 @@
|
||||||
|
// pages/API/add-contact/add-contact.js
|
||||||
|
Page({
|
||||||
|
submit(e) {
|
||||||
|
const formData = e.detail.value
|
||||||
|
wx.addPhoneContact({
|
||||||
|
...formData,
|
||||||
|
success() {
|
||||||
|
wx.showToast({
|
||||||
|
title: '联系人创建成功'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail() {
|
||||||
|
wx.showToast({
|
||||||
|
title: '联系人创建失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "新增联系人"
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
<!--pages/API/add-contact/add-contact.wxml-->
|
||||||
|
<import src="../../common/head.wxml" />
|
||||||
|
<import src="../../common/foot.wxml" />
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<template is="foot" />
|
||||||
|
</view>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
/* pages/API/add-contact/add-contact.wxss */
|
||||||
|
@import "../../common/lib/weui.wxss";
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
Loading…
Reference in New Issue