<template>
|
<view class="container">
|
<form @submit="add">
|
<view class="input-group-row">
|
<text class="label">会员姓名<text class="require">*</text></text>
|
<input name="account" type="text" value="" placeholder="请填写会员姓名" placeholder-class='placeholder'/>
|
</view>
|
<view class="input-group-row">
|
<text class="label">手机号码<text class="require">*</text></text>
|
<input name="account" type="number" value="" placeholder="请填写手机号码" placeholder-class='placeholder'/>
|
</view>
|
<view class="input-group-row">
|
<text class="label">性别<text class="require">*</text></text>
|
<view class="right-text">
|
<radio-group @change="sexChange">
|
<label><radio name="sex" value="1" color="#518EFF" class="radio" checked/>男</label>
|
<label><radio name="sex" value="2" color="#518EFF" class="radio"/>女</label>
|
</radio-group>
|
</view>
|
</view>
|
<view class="input-group-row">
|
<text class="label">生日</text>
|
<view class="right-text">
|
<picker mode="date" @change="dateChange" :end="endDate">
|
<view>{{birthday}}</view>
|
</picker>
|
</view>
|
</view>
|
<view class="input-group-row">
|
<text class="label">省市区</text>
|
<view @click="openAddres" class="right-text">
|
<text v-if="regionText">{{regionText}}</text>
|
<text v-else class="gray">请选择省市区</text>
|
</view>
|
</view>
|
<view class="input-group-row">
|
<text class="label">详细地址</text>
|
<input name="account" type="text" value="" placeholder="请填写详细地址" placeholder-class='placeholder'/>
|
</view>
|
<view class="input-group-row">
|
<text class="label">到店途径</text>
|
<view class="right-text">
|
<picker mode="selector" :range="wayList" @change="wayChange">
|
<view>
|
{{way}}
|
<text class="iconfont iconjiantouarrow486 gray"></text>
|
</view>
|
</picker>
|
</view>
|
</view>
|
<view class="input-group-row">
|
<text class="label">推荐人</text>
|
<view class="right-text">
|
<picker mode="selector" :range="referrerList" @change="referrerChange">
|
<view>
|
{{referrer}}
|
<text class="iconfont iconjiantouarrow486 gray"></text>
|
</view>
|
</picker>
|
</view>
|
</view>
|
<view class="input-group-row">
|
<text class="label">备注</text>
|
<input name="account" type="text" value="" placeholder="请填写备注" placeholder-class='placeholder'/>
|
</view>
|
<view class="input-group-row">
|
<text class="label">标签</text>
|
<view class="right-text">
|
<text class="tag">大方<text class="iconfont iconguanbi gray"></text></text>
|
<text class="tag">大方<text class="iconfont iconguanbi gray"></text></text>
|
</view>
|
</view>
|
<button type="submit" class="blue-btn sticky-footer">保存</button>
|
</form>
|
<region ref="simpleAddress" @onConfirm="addressChange" themeColor="#518EFF" cancelColor="#8c9fad"></region>
|
</view>
|
</template>
|
|
<script>
|
import region from '../../components/simple-address/simple-address.vue';
|
export default{
|
components:{
|
region
|
},
|
data(){
|
return {
|
birthday: '1990-01-02',
|
regionText: '',
|
wayList: ['美团','户外广告'],
|
way: '美团',
|
referrerList: ['张三'],
|
referrer: '张三'
|
}
|
},
|
onLoad(options) {
|
if(options.id){
|
uni.setNavigationBarTitle({
|
title: '编辑会员'
|
});
|
}
|
},
|
computed: {
|
endDate() {
|
return this.getDate('end');
|
}
|
},
|
methods:{
|
add(){
|
|
},
|
sexChange(e){
|
console.log(e)
|
},
|
dateChange(e){
|
this.birthday = e.detail.value;
|
console.log(e)
|
},
|
getDate(type) {
|
const date = new Date();
|
let year = date.getFullYear();
|
let month = date.getMonth() + 1;
|
let day = date.getDate();
|
|
if (type === 'start') {
|
year = year - 70;
|
}
|
month = month > 9 ? month : '0' + month;;
|
day = day > 9 ? day : '0' + day;
|
return `${year}-${month}-${day}`;
|
},
|
openAddres(){
|
this.$refs.simpleAddress.open();
|
},
|
addressChange(e){
|
this.regionText = e.labelArr.join(' ');
|
},
|
wayChange(e){
|
this.way = this.wayList[e.detail.value];
|
},
|
referrerChange(e){
|
this.referrer = this.referrerList[e.detail.value];
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.container{
|
padding: 10px 10px;
|
}
|
|
</style>
|