|
@@ -16,9 +16,41 @@
|
|
|
<!-- 登录信息 -->
|
|
<!-- 登录信息 -->
|
|
|
<div class="module-com input-line-wrap">
|
|
<div class="module-com input-line-wrap">
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
- <div class="tui-title required">营业时间</div>
|
|
|
|
|
- <input v-model="form.openTime" placeholder-class="phcolor" class="tui-input" name="openTime" placeholder="请输入营业时间 例如:8:00 - 22:00" maxlength="50" type="text" />
|
|
|
|
|
|
|
+ <div class="tui-title">是否营业</div>
|
|
|
|
|
+ <view><switch style="transform:scale(0.7,0.7)" :checked="form.open == 0 ? false : true" @change="openChange" /></view>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
+ <div v-if="visible">
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">营业时间</div>
|
|
|
|
|
+ <radio-group class="tui-input flex-center-between" @change="radioChange">
|
|
|
|
|
+ <label class="list" for="customLink">
|
|
|
|
|
+ <radio value="0" :checked="form.openType == 0" />
|
|
|
|
|
+ <span class="checkbox-text">24小时</span>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <label class="list" for="goodsLink">
|
|
|
|
|
+ <radio value="1" :checked="form.openType == 1" />
|
|
|
|
|
+ <span class="checkbox-text">指定时段</span>
|
|
|
|
|
+ </label>
|
|
|
|
|
+ <input v-model="form.openType" name="openType" hidden />
|
|
|
|
|
+ </radio-group>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+ <div v-if="openTimeVisible">
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">开店时间</div>
|
|
|
|
|
+ <picker mode="time" :value="start_time" start="00:00" end="24:00" @change="startTimeChange">
|
|
|
|
|
+ <view class="uni-input">{{start_time}}</view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ <input v-model="form.openStartTime" name="openStartTime" hidden />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">关店时间</div>
|
|
|
|
|
+ <picker mode="time" :value="end_time" start="00:00" end="24:00" @change="endTimeChange">
|
|
|
|
|
+ <view class="uni-input">{{end_time}}</view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ <input v-model="form.openEndTime" name="openEndTime" hidden />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title required">手机号</div>
|
|
<div class="tui-title required">手机号</div>
|
|
|
<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入手机号" maxlength="50" type="number" />
|
|
<input v-model="form.mobile" placeholder-class="phcolor" class="tui-input" name="mobile" placeholder="请输入手机号" maxlength="50" type="number" />
|
|
@@ -71,23 +103,31 @@
|
|
|
name: 'staff-add',
|
|
name: 'staff-add',
|
|
|
components: {
|
|
components: {
|
|
|
TuiListCell,
|
|
TuiListCell,
|
|
|
- AppAvatarModule,
|
|
|
|
|
- SimpleAddress,
|
|
|
|
|
- AppAreaSel,
|
|
|
|
|
- AppUploader
|
|
|
|
|
|
|
+ AppAvatarModule,
|
|
|
|
|
+ SimpleAddress,
|
|
|
|
|
+ AppAreaSel,
|
|
|
|
|
+ AppUploader
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ visible: true,
|
|
|
|
|
+ openTimeVisible: false,
|
|
|
|
|
+ start_time: '00:00',
|
|
|
|
|
+ end_time: '00:00',
|
|
|
form: {
|
|
form: {
|
|
|
- shopName: '',
|
|
|
|
|
- province: '',
|
|
|
|
|
- city: '',
|
|
|
|
|
- address: '',
|
|
|
|
|
- floor: '',
|
|
|
|
|
- openTime: '8:00 - 22:00',
|
|
|
|
|
- introduction: '',
|
|
|
|
|
- mobile: '',
|
|
|
|
|
- img: []
|
|
|
|
|
|
|
+ shopName: '',
|
|
|
|
|
+ province: '',
|
|
|
|
|
+ city: '',
|
|
|
|
|
+ address: '',
|
|
|
|
|
+ floor: '',
|
|
|
|
|
+ // openTime: '8:00 - 22:00',
|
|
|
|
|
+ open: 1,
|
|
|
|
|
+ openType: 0, // openType: 0. 表示 24小时营业 1. 表示 xx ~ xx
|
|
|
|
|
+ openStartTime: '',
|
|
|
|
|
+ openEndTime: '',
|
|
|
|
|
+ introduction: '',
|
|
|
|
|
+ mobile: '',
|
|
|
|
|
+ img: []
|
|
|
},
|
|
},
|
|
|
// 详细地址
|
|
// 详细地址
|
|
|
showRegion: false,
|
|
showRegion: false,
|
|
@@ -95,8 +135,8 @@
|
|
|
lat: 0,
|
|
lat: 0,
|
|
|
long: 0
|
|
long: 0
|
|
|
},
|
|
},
|
|
|
- // 省市联动
|
|
|
|
|
- regionData: [],
|
|
|
|
|
|
|
+ // 省市联动
|
|
|
|
|
+ regionData: [],
|
|
|
cityPickerValueDefault: [0, 0],
|
|
cityPickerValueDefault: [0, 0],
|
|
|
img: []
|
|
img: []
|
|
|
}
|
|
}
|
|
@@ -129,6 +169,43 @@
|
|
|
})
|
|
})
|
|
|
this.region.lat = data.lat
|
|
this.region.lat = data.lat
|
|
|
this.region.long = data.long
|
|
this.region.long = data.long
|
|
|
|
|
+
|
|
|
|
|
+ // 营业时间初始化
|
|
|
|
|
+ this.visible = this.form.open == 1 ? true : false
|
|
|
|
|
+ this.openTimeVisible = true
|
|
|
|
|
+ this.form.openType = 1
|
|
|
|
|
+ this.start_time = this.form.openStartTime
|
|
|
|
|
+ this.end_time = this.form.openEndTime
|
|
|
|
|
+ if (data.openStartTime == '') {
|
|
|
|
|
+ this.openTimeVisible = false
|
|
|
|
|
+ this.form.openType = 0
|
|
|
|
|
+ this.start_time = '09:00'
|
|
|
|
|
+ this.form.openStartTime = this.start_time
|
|
|
|
|
+ }
|
|
|
|
|
+ if (data.openEndTime == '') {
|
|
|
|
|
+ this.end_time = '18:00'
|
|
|
|
|
+ this.form.openEndTime = this.end_time
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ openChange(e) {
|
|
|
|
|
+ this.visible = e.target.value ? true : false
|
|
|
|
|
+ this.form.open = e.target.value ? 1 : 0
|
|
|
|
|
+ },
|
|
|
|
|
+ startTimeChange: function(e) {
|
|
|
|
|
+ this.start_time = e.detail.value
|
|
|
|
|
+ this.form.openStartTime = e.detail.value
|
|
|
|
|
+ },
|
|
|
|
|
+ endTimeChange: function(e) {
|
|
|
|
|
+ this.end_time = e.detail.value
|
|
|
|
|
+ this.form.openEndTime = e.detail.value
|
|
|
|
|
+ },
|
|
|
|
|
+ radioChange(e) {
|
|
|
|
|
+ this.openTimeVisible = e.detail.value == 0 ? false : true;
|
|
|
|
|
+ this.form.openType = e.detail.value == 0 ? 0 : 1; // openType: 0. 24小时 1. xx ~ xx
|
|
|
|
|
+ if (this.openTimeVisible) {
|
|
|
|
|
+ this.start_time = '09:00'
|
|
|
|
|
+ this.end_time = '18:00'
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 选择地址
|
|
// 选择地址
|
|
|
selRegionFn() {
|
|
selRegionFn() {
|
|
@@ -166,13 +243,13 @@
|
|
|
}
|
|
}
|
|
|
this.form = {...this.form,...this.region}
|
|
this.form = {...this.form,...this.region}
|
|
|
hostFn(this.form).then(res => {
|
|
hostFn(this.form).then(res => {
|
|
|
- this.setUserShopAll();
|
|
|
|
|
|
|
+ this.setUserShopAll();
|
|
|
let promptText = this.option.id ? '修改成功!' : '添加成功!'
|
|
let promptText = this.option.id ? '修改成功!' : '添加成功!'
|
|
|
- this.$msg(promptText)
|
|
|
|
|
- uni.removeStorageSync('modifyShopB')
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
|
+ this.$msg(promptText)
|
|
|
|
|
+ uni.removeStorageSync('modifyShopB')
|
|
|
|
|
+ setTimeout(() => {
|
|
|
this.$util.pageTo(1)
|
|
this.$util.pageTo(1)
|
|
|
- }, 1000)
|
|
|
|
|
|
|
+ }, 1000)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// 表单验证
|
|
// 表单验证
|
|
@@ -184,11 +261,6 @@
|
|
|
rule: ['required'],
|
|
rule: ['required'],
|
|
|
msg: ['请输入名称']
|
|
msg: ['请输入名称']
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- name: 'openTime',
|
|
|
|
|
- rule: ['required'],
|
|
|
|
|
- msg: ['请输入营业时间']
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: 'mobile',
|
|
name: 'mobile',
|
|
|
rule: ['required'],
|
|
rule: ['required'],
|