Просмотр исходного кода

批发商增营业时间设置

shizhongqi 4 лет назад
Родитель
Сommit
40cc89b26a

+ 0 - 2
ghsApp/src/admin/home/login.vue

@@ -27,7 +27,6 @@
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin()">本机号码一键登录</button>
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin()">本机号码一键登录</button>
 				</view> -->
 				</view> -->
 				<!-- #endif -->
 				<!-- #endif -->
-				<!-- #ifdef APP-PLUS -->
 				<view style="color:#999999;font-size:25upx;margin-top:30upx;">
 				<view style="color:#999999;font-size:25upx;margin-top:30upx;">
 					<radio-group @change="agreeItem">
 					<radio-group @change="agreeItem">
 						<label>
 						<label>
@@ -41,7 +40,6 @@
 						</label>
 						</label>
 					</radio-group>
 					</radio-group>
 				</view>
 				</view>
-				<!-- #endif -->
 				<view style="margin-top:50upx;color:#999999;width:88%;font-size:30upx;">
 				<view style="margin-top:50upx;color:#999999;width:88%;font-size:30upx;">
 				<text style="float:right;" @click="pageTo({url: '/pagesClient/official/apply',type:2})">注册帐号</text>
 				<text style="float:right;" @click="pageTo({url: '/pagesClient/official/apply',type:2})">注册帐号</text>
 				</view>
 				</view>

+ 20 - 20
ghsApp/src/admin/home/me.vue

@@ -76,7 +76,7 @@
             </tui-list-cell>
             </tui-list-cell>
 
 
             <!-- #ifdef APP-PLUS -->
             <!-- #ifdef APP-PLUS -->
-			<!-- #endif -->            
+			      <!-- #endif -->            
             <tui-list-cell @click="pageTo({ url: '/pagesStore/me/cashSet' })" class="line-cell" :hover="false" :arrow="true" >
             <tui-list-cell @click="pageTo({ url: '/pagesStore/me/cashSet' })" class="line-cell" :hover="false" :arrow="true" >
               <div class="tui-title">提现账号</div>
               <div class="tui-title">提现账号</div>
             </tui-list-cell>
             </tui-list-cell>
@@ -176,27 +176,27 @@ export default {
     },
     },
     // #ifdef APP-PLUS
     // #ifdef APP-PLUS
     loginOut(){
     loginOut(){
-        let that = this
-        that.$util.confirmModal({content:'确认退出?'},() => {
-              uni.clearStorage()
-              that.$store.commit("setLoginInfo", {})
-              plus.runtime.restart()
-        })
+      let that = this
+      that.$util.confirmModal({content:'确认退出?'},() => {
+        uni.clearStorage()
+        that.$store.commit("setLoginInfo", {})
+        plus.runtime.restart()
+      })
     },
     },
     closeApp(){
     closeApp(){
-        let that = this
-        that.$util.confirmModal({content:'确认关闭?'},() => {
-          let type = uni.getSystemInfoSync().platform
-          switch(type){
-            case 'android':
-              plus.runtime.quit()
-              break;
-            case 'ios':
-              plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
-              break;
-            default:
-          }
-        })
+      let that = this
+      that.$util.confirmModal({content:'确认关闭?'},() => {
+        let type = uni.getSystemInfoSync().platform
+        switch(type){
+          case 'android':
+            plus.runtime.quit()
+            break;
+          case 'ios':
+            plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+            break;
+          default:
+        }
+      })
     },
     },
     // #endif
     // #endif
     async selectShopFn (val) {
     async selectShopFn (val) {

+ 106 - 28
ghsApp/src/admin/shop/add.vue

@@ -17,10 +17,47 @@
 			<!-- <div class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</div> -->
 			<!-- <div class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</div> -->
 			<!-- 登录信息 -->
 			<!-- 登录信息 -->
 			<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>
 					<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" />
 					<input v-model="form.openTime" placeholder-class="phcolor" class="tui-input" name="openTime" placeholder="请输入营业时间 例如:8:00 - 22:00" maxlength="50" type="text" />
+				</tui-list-cell> -->
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<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" />
@@ -73,23 +110,30 @@
 		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',
+					openType: 0, // openType: 0. 表示 24小时营业 1. 表示 xx ~ xx
+					openStartTime: '',
+					openEndTime: '',
+					introduction: '',
+					mobile: '',
+					img: []
 				},
 				},
 				// 详细地址
 				// 详细地址
 				showRegion: false,
 				showRegion: false,
@@ -97,8 +141,8 @@
 					lat: 0,
 					lat: 0,
 					long: 0
 					long: 0
 				},
 				},
-                // 省市联动
-                regionData: [],
+        // 省市联动
+        regionData: [],
 				cityPickerValueDefault: [0, 0]
 				cityPickerValueDefault: [0, 0]
 			}
 			}
 		},
 		},
@@ -118,7 +162,7 @@
 		methods: {
 		methods: {
 			...mapActions(['setUserShopAll']),
 			...mapActions(['setUserShopAll']),
 			init() {
 			init() {
-                this._getDet()
+      	this._getDet()
 			},
 			},
 			_resultData(val) {
 			_resultData(val) {
 				console.log(val)
 				console.log(val)
@@ -132,6 +176,21 @@
 				})
 				})
 				this.region.lat = data.lat
 				this.region.lat = data.lat
 				this.region.long = data.long
 				this.region.long = data.long
+
+				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
+				}
 			},
 			},
 			// 选择地址
 			// 选择地址
 			selRegionFn() {
 			selRegionFn() {
@@ -167,11 +226,11 @@
 				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.$util.pageTo(1)
-                    }, 1000)
+					this.$msg(promptText)
+					uni.removeStorageSync('modifyShopB')
+					setTimeout(() => {
+						this.$util.pageTo(1)
+					}, 1000)
 				})
 				})
 			},
 			},
 			// 表单验证
 			// 表单验证
@@ -183,11 +242,11 @@
 						rule: ['required'],
 						rule: ['required'],
 						msg: ['请输入名称']
 						msg: ['请输入名称']
 					},
 					},
-					{
-						name: 'openTime',
-						rule: ['required'],
-						msg: ['请输入营业时间']
-					},
+					// {
+					// 	name: 'openTime',
+					// 	rule: ['required'],
+					// 	msg: ['请输入营业时间']
+					// },
 					{
 					{
 						name: 'mobile',
 						name: 'mobile',
 						rule: ['required'],
 						rule: ['required'],
@@ -213,7 +272,26 @@
 				} else {
 				} else {
 					this.$msg(checkRes)
 					this.$msg(checkRes)
 				}
 				}
-			}
+			},
+			openChange(e) {
+				this.visible = e.target.value ? true : false
+			},
+			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'
+				}
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 13 - 17
ghsApp/src/pagesClient/official/apply.vue

@@ -61,23 +61,19 @@
           </div>
           </div>
         </div>
         </div>
       </view>
       </view>
-
-				<!-- #ifdef APP-PLUS -->
-				<view style="color:#999999;font-size:25upx;margin-top:30upx;margin-left:50upx;">
-					<radio-group @change="agreeItem">
-						<label>
-							<radio value="1" style="width:6upx;transform:scale(0.8)" />
-							<text style="margin-left:38upx;">
-								我已阅读并同意
-								<text style="font-weight:bold;color:#666666;" @click.stop="pageTo({url: '/admin/home/register'})">《服务协议》</text>
-								和
-								<text style="font-weight:bold;color:#666666;" @click.stop="pageTo({url: '/admin/home/privacy'})">《隐私政策》</text>
-							</text>
-						</label>
-					</radio-group>
-				</view>
-				<!-- #endif -->
-
+      <view style="color:#999999;font-size:25upx;margin-top:30upx;margin-left:50upx;">
+        <radio-group @change="agreeItem">
+          <label>
+            <radio value="1" style="width:6upx;transform:scale(0.8)" />
+            <text style="margin-left:38upx;">
+              我已阅读并同意
+              <text style="font-weight:bold;color:#666666;" @click.stop="pageTo({url: '/admin/home/register'})">《服务协议》</text>
+              和
+              <text style="font-weight:bold;color:#666666;" @click.stop="pageTo({url: '/admin/home/privacy'})">《隐私政策》</text>
+            </text>
+          </label>
+        </radio-group>
+      </view>
       <div class="btn-wrap">
       <div class="btn-wrap">
         <button class="admin-button-com blue big" formType="submit" >确认</button>
         <button class="admin-button-com blue big" formType="submit" >确认</button>
       </div>
       </div>