高敬炎 hace 2 años
padre
commit
a21594ed0e

+ 10 - 1
uni_merchants_enter/App.vue

@@ -27,6 +27,7 @@
 			background:#fff;
 			border-radius:20rpx;
 			margin:20rpx;
+			padding:20rpx;
 		}
 		.caution{
 			color:red;
@@ -45,12 +46,20 @@
 				width:90%;
 			}
 		}
-		.button,.unable_button{
+		.button,.unable_button,.default_button,.caution_button{
 			background:#5F7DE9;
 			color:#fff;
 			padding:5rpx 20rpx;
 			border-radius: 10rpx;
 		}
+		.default_button{
+			background:#fff;
+			color:#000;
+			border:2rpx solid #5F7DE9;
+		}
+		.caution_button{
+			background:red;
+		}
 		.unable_button{
 			background:#999;
 		}

+ 4 - 7
uni_merchants_enter/pageA/enter/cateringindustry.vue

@@ -3,13 +3,13 @@
 		<view class='wrap'>
 			<u--form  ref="uForm">
 				<u-form-item labelWidth='80' labelPosition='top' label="营业执照">
-					<u-upload height='208' width='320' :fileList="fileList2" @afterRead="afterRead($event,1)" @delete="deletePic" name="2" multiple
+					<u-upload height='208' width='320' :fileList="fileList2" @afterRead="afterRead($event,1)" @delete="deletePic($event,1)" name="2" multiple
 						:maxCount="1">
 						<image style='width:680rpx;height:417rpx;' src="../../static/image/enter/yingyezhizhao.png" mode=""></image>
 					</u-upload>
 				</u-form-item>
 				<u-form-item labelWidth='80' labelPosition='top' label="经营许可证">
-					<u-upload height='208' width='320' :fileList="fileList3" @afterRead="afterRead($event,2)" @delete="deletePic" name="3" multiple
+					<u-upload height='208' width='320' :fileList="fileList3" @afterRead="afterRead($event,2)" @delete="deletePic($event,2)" name="3" multiple
 						:maxCount="1">
 						<image style='width:680rpx;height:417rpx;' src="../../static/image/enter/jingyingxukezheng.png" mode=""></image>
 					</u-upload>
@@ -82,13 +82,13 @@
 					</view>
 					
 				<u-form-item labelWidth='240' labelPosition='top' label="门面及门头照片(1张,店名文字清晰)">
-					<u-upload :fileList="fileList4" @afterRead="afterRead($event,3)" @delete="deletePic" name="4" multiple
+					<u-upload :fileList="fileList4" @afterRead="afterRead($event,3)" @delete="deletePic($event,3)" name="4" multiple
 						:maxCount="1">
 						
 					</u-upload>
 				</u-form-item>
 				<u-form-item labelWidth='120' labelPosition='top' label="室内照片(1-6张)">
-					<u-upload :fileList="fileList5" @afterRead="afterRead($event,4)" @delete="deletePic" name="5" multiple
+					<u-upload :fileList="fileList5" @afterRead="afterRead($event,4)" @delete="deletePic($event,4)" name="5" multiple
 						:maxCount="6">
 						
 					</u-upload>
@@ -357,9 +357,6 @@
 </script>
 
 <style lang='scss' scoped>
- .wrap{
-	 padding:20rpx;
- }
  .icon_merchants_enterjianshao{
 	 margin-left:10rpx;
 	 font-size:50rpx;

+ 4 - 5
uni_merchants_enter/pageA/enter/myCateringdustry/addGroupBuying.vue

@@ -141,6 +141,7 @@
 				status:'',
 				minDate:'',
 				maxDate:'',
+				sortDate:[],
 				weekList:[
 					{value:'周一',select:false},
 					{value:'周二',select:false},
@@ -220,8 +221,9 @@
 				console.log(e)
 				console.log(e.sort( (a, b)=> {return a.localeCompare(b)   // 按照升序排列 
 				}))
-				var sortDate=e.sort( (a, b)=> {return a.localeCompare(b)})
-				this.form.unavailableDay=sortDate.toString()  // 按照升序排列
+				this.sortDate=e.sort( (a, b)=> {return a.localeCompare(b)})
+				
+				this.form.unavailableDay=this.sortDate.toString()  // 按照升序排列
 				
 				this.show2 = false
 				
@@ -316,9 +318,6 @@
 </script>
 
 <style lang='scss' scoped>
-	.wrap{
-		padding:20rpx;
-	}
 	/deep/.u-radio-group,/deep/.u-radio-group--row {
 		flex-direction: row-reverse !important;
 		.u-radio{

+ 0 - 3
uni_merchants_enter/pageA/enter/myCateringdustry/addGroupBuyingNext.vue

@@ -325,9 +325,6 @@
 </script>
 
 <style lang='scss' scoped>
-	.wrap{
-		padding:20rpx;
-	}
 	.classify_item{
 		border:1px solid #999;
 		padding: 5rpx 10rpx;

+ 0 - 3
uni_merchants_enter/pageA/enter/myCateringdustry/addfood.vue

@@ -246,9 +246,6 @@
 </script>
 
 <style lang='scss' scoped>
-.wrap{
-	 padding:20rpx;
- }
 .add,.active{
 	background: #5F7DE9;
 	color: #fff;

+ 135 - 3
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/editCertificate.vue

@@ -1,18 +1,150 @@
 <template>
-	<view>
-		
+	<view class='content'>
+		<view class='wrap'>
+			<u--form  ref="uForm">
+				<u-form-item labelWidth='80' labelPosition='top' label="营业执照">
+					<u-upload height='208' width='320' :fileList="fileList2" @afterRead="afterRead($event,1)" @delete="deletePic" name="2" multiple
+						:maxCount="1">
+						<image style='width:680rpx;height:417rpx;' src="@/static/image/enter/yingyezhizhao.png" mode=""></image>
+					</u-upload>
+				</u-form-item>
+				<u-form-item labelWidth='80' labelPosition='top' label="经营许可证">
+					<u-upload height='208' width='320' :fileList="fileList3" @afterRead="afterRead($event,2)" @delete="deletePic" name="3" multiple
+						:maxCount="1">
+						<image style='width:680rpx;height:417rpx;' src="@/static/image/enter/jingyingxukezheng.png" mode=""></image>
+					</u-upload>
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="经营许可证有效期">
+					<view style='text-align:right;' @click='openjyxkz'>{{currectData.operateCertificateDate?currectData.operateCertificateDate:'选择日期'}}<image src="@/static/image/yjt.png" mode=""
+								style="margin-left:10rpx;width:12rpx;height: 21rpx;"></image></view>
+				</u-form-item>
+				<uni-calendar
+				   :insert="false"
+				   :lunar="true" 
+					ref="calendar"
+				   :start-date="startDate"
+				   @confirm="confirm"
+				    />
+			</u--form>
+			<view class="footer">
+				<button @click='submit' class="submit">提交</button>
+			</view>
+		</view>
+		<u-modal :show="isSubmit" content='确定提交证件图片' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
 	</view>
 </template>
 
 <script>
+	var that
+	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 		data() {
 			return {
-				
+				isSubmit:false,
+				currectData:{},
+				fileList2:[],
+				fileList3:[],
+				startDate:'',
+			}
+		},
+		onLoad() {
+			that = this
+		},
+		onShow(){
+			var date = new Date().toISOString().slice(0, 10)
+			this.startDate=date
+			if(uni.getStorageSync('myCateringdustry')){
+				this.currectData=JSON.parse(uni.getStorageSync('myCateringdustry'))
+				if(this.currectData.businessLicense){
+					this.fileList2=[{url:this.currectData.businessLicense}]
+				}
+				if(this.currectData.operateCertificate){
+					this.fileList3=[{url:this.currectData.operateCertificate}]
+				}
+				this.currectData.operateCertificateDate=this.parseTime(this.currectData.operateCertificateDate,'{y}-{m}-{d}')
 			}
 		},
 		methods: {
+			submit(){
+				this.isSubmit = true
+			},
+			confirmSubmit() {
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
+					foodInfo: JSON.stringify(this.currectData)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+			
+					uni.hideLoading()
+				}).then(res => {
+					this.isSubmit = false
+					uni.showToast({
+						icon: "success",
+						title: '编辑证件图片成功',
+						duration: 2000
+					});
+					uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
+					uni.navigateBack()
 			
+				})
+			},
+			openjyxkz(){
+				this.$refs.calendar.open();
+			},
+			// 删除图片
+			deletePic(event,status) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+				that.indoorImageArray.splice(event.index, 1)
+				that.currectData.indoorImage =that.indoorImageArray.toString()
+			},
+			// 新增图片
+			async afterRead(event,status) {
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url,status)
+					
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+					console.log(that.currectData, this[`fileList${event.name}`])
+					
+				}
+			},
+			uploadFilePromise(res,status) {
+				return new Promise((resolve, reject) => {
+					uploadImage(res, 'cardImages/',
+						result => {
+							if(status==1){
+								that.currectData.businessLicense = result
+							}else if(status==2){
+								that.currectData.operateCertificate = result
+							}
+							resolve(res)
+						}
+					)
+				})
+			},
 		}
 	}
 </script>

+ 144 - 5
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/editFoodClassify.vue

@@ -1,22 +1,161 @@
 <template>
-	<view>
-		
+	<view class='content'>
+		<view class='wrap'>
+			<view class='caution'>注意:分类排序决定顾客端显示的顺序</view>
+			<view class='flex justify-space-between align-item-center' v-for='item in classifyList'>
+				<view>{{item.classifyName}}({{item.dishesNum?item.dishesNum:0}})</view>
+				<view class='flex'>
+					<view  class='button' @click='sticky(item)'>置顶</view>
+					<view v-if='!item.dishesNum' class='button' @click='del(item)'>删除</view>
+					<view v-else class='unable_button'>删除</view>
+					<view class='button' @click='edit(item)'>编辑</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer">
+			<button @click='submit' class="submit">新增</button>
+		</view>
+		<u-modal :show="isSubmit" :content='content' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay>
+			<view class="slot-content">
+				<view v-if="status==0">
+					确定删除"{{currectData.classifyName}}"分类?
+				</view>
+				<view v-else>
+					<u--input inputAlign='center' v-model="classifyName" placeholder="输入分类名称" border="none"></u--input>
+				</view>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
 <script>
+	var that
 	export default {
 		data() {
 			return {
-				
+				currect:{},
+				currectData:{},
+				classifyList:[],
+				status:0,
+				classifyName:'',
+				form:{},
+				isSubmit:false,
 			}
 		},
+		onLoad() {
+			that = this
+		},
+		onShow(){
+			if(uni.getStorageSync('myCateringdustry')){
+				this.currect=JSON.parse(uni.getStorageSync('myCateringdustry'))
+				this.getList()
+			}
+			
+		},
 		methods: {
+			edit(item){
+				this.currectData=item
+				this.status=2
+				this.isSubmit = true
+			},
+			del(item){
+				this.currectData=item
+				this.status=0
+				this.isSubmit = true
+			},
+			submit(){
+				this.status=1
+				this.isSubmit = true
+			},
+			confirmSubmit() {
+				this.form.foodId=this.currect.id
+				this.form.classifyName=this.classifyName
+				this.currectData.classifyName=this.classifyName
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				var text ='',parameter='',data={}
+				if(this.status==0){
+					parameter='delete'
+					data={
+						id: this.currectData.id
+					}
+					text=`删除成功`
+				}else if(this.status==1){
+					parameter='add'
+					data={
+						dishClassifyInfo: JSON.stringify(this.form)
+					}
+					text=`新增成功`
+				}else if(this.status==2){
+					parameter='update'
+					data={
+						dishClassifyInfo: JSON.stringify(this.currectData)
+					}
+					text=`编辑成功`
+				}
+				this.$request.baseRequest('admin.tourism.dishClassifyInfo', parameter, data, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
 			
+					uni.hideLoading()
+				}).then(res => {
+					this.isSubmit = false
+					uni.showToast({
+						icon: "success",
+						title: text,
+						duration: 2000
+					});
+					this.getList()
+			
+				})
+			},
+			sticky(item){
+				this.$request.baseRequest('admin.tourism.dishClassifyInfo', 'top', {
+					dishClassifyInfo: JSON.stringify(item)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+							
+					uni.hideLoading()
+				}).then(res => {
+					uni.showToast({
+						icon: "success",
+						title: '置顶成功',
+						duration: 2000
+					});
+					this.getList()
+				})
+			},
+			getList(){
+				this.$request.baseRequest('admin.tourism.dishClassifyInfo', 'list', {
+					foodId:this.currect.id,
+					page:1,
+					limit:9999
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+				}).then(res => {
+					this.classifyList = res.data.items
+				})
+			},
 		}
 	}
 </script>
 
-<style>
-
+<style lang='scss' scoped>
+	.button,.unable_button{
+		margin:5px;
+	}
 </style>

+ 128 - 3
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/editShopImage.vue

@@ -1,18 +1,143 @@
 <template>
-	<view>
-		
+	<view class='content'>
+		<view class='wrap'>
+			<u--form  ref="uForm">
+				<u-form-item labelWidth='240' labelPosition='top' label="门面及门头照片(1张,店名文字清晰)">
+					<u-upload :fileList="fileList4" @afterRead="afterRead($event,3)" @delete="deletePic($event,3)" name="4" multiple
+						:maxCount="1">
+						
+					</u-upload>
+				</u-form-item>
+				<u-form-item labelWidth='120' labelPosition='top' label="室内照片(1-6张)">
+					<u-upload :fileList="fileList5" @afterRead="afterRead($event,4)" @delete="deletePic($event,4)" name="5" multiple
+						:maxCount="6">
+					</u-upload>
+				</u-form-item>
+			</u--form>
+			<view class="footer">
+				<button @click='submit' class="submit">提交</button>
+			</view>
+		</view>
+		<u-modal :show="isSubmit" content='确定提交店铺图片' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
 	</view>
 </template>
 
 <script>
+	var that
+	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 		data() {
 			return {
-				
+				isSubmit:false,
+				indoorImageArray:[],
+				fileList4:[],
+				fileList5:[],
+				currectData:{},
+			}
+		},
+		onLoad() {
+			that = this
+		},
+		onShow(){
+			if(uni.getStorageSync('myCateringdustry')){
+				this.currectData=JSON.parse(uni.getStorageSync('myCateringdustry'))
+				if(this.currectData.coverImage){
+					this.fileList4=[{url:this.currectData.coverImage}]
+				}
+				this.fileList5=[]
+				if(this.currectData.indoorImage){
+					this.indoorImageArray=this.currectData.indoorImage.split(',')
+					for(var i=0;i<this.indoorImageArray.length;i++){
+						if(this.indoorImageArray[i]){
+							this.fileList5.push({url:this.indoorImageArray[i]})
+						}
+					}
+					
+				}
 			}
 		},
 		methods: {
+			submit(){
+				this.isSubmit = true
+			},
+			confirmSubmit() {
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
+					foodInfo: JSON.stringify(this.currectData)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+			
+					uni.hideLoading()
+				}).then(res => {
+					this.isSubmit = false
+					uni.showToast({
+						icon: "success",
+						title: '编辑店铺图片成功',
+						duration: 2000
+					});
+					uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
+					uni.navigateBack()
 			
+				})
+			},
+			// 删除图片
+			deletePic(event,status) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+				if(status==4){
+					that.indoorImageArray.splice(event.index, 1)
+					that.currectData.indoorImage =that.indoorImageArray.toString()
+				}
+				
+			},
+			// 新增图片
+			async afterRead(event,status) {
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url,status)
+					
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+					console.log(that.currectData, this[`fileList${event.name}`])
+					
+				}
+			},
+			uploadFilePromise(res,status) {
+				return new Promise((resolve, reject) => {
+					uploadImage(res, 'cardImages/',
+						result => {
+							 if(status==3){
+								that.currectData.coverImage = result
+							}else if(status==4){
+								that.indoorImageArray.push(result)
+								that.currectData.indoorImage =that.indoorImageArray.toString()
+							}
+							resolve(res)
+						}
+					)
+				})
+			},
 		}
 	}
 </script>

+ 164 - 5
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/editShopInformation.vue

@@ -1,22 +1,181 @@
 <template>
-	<view>
-		
+	<view class='content'>
+		<view class='wrap'>
+			<u--form  ref="uForm">
+				
+				<u-form-item  labelWidth='150' labelPosition='left' label="店铺名称">
+					<u-input inputAlign='right' border='none' placeholder='输入店铺名称' v-model="currectData.shopNames" />
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="经营者">
+					<u-input inputAlign='right' border='none' placeholder='输入经营者姓名' v-model="currectData.operater" />
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="经营者手机号">
+					<u-input inputAlign='right' maxlength="15" border='none' placeholder='输入经营者手机号' v-model="currectData.operaterPhone" />
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="验证码">
+					<u-input inputAlign='right' border='none' placeholder='输入验证码' v-model="currectData.verifyCode" >
+						<template slot="suffix">
+							<u-code ref="uCode"
+								@change="codeChange"
+								seconds="60"
+								changeText="X秒重新获取"
+							></u-code>
+							<view class='get_code' @click='getCode'>{{tips}}</view>
+						</template>
+					</u-input>
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="业务联系人(选填)">
+					<u-input inputAlign='right' border='none' placeholder='输入联系人姓名' v-model="currectData.contacts" />
+				</u-form-item>
+				<u-form-item  labelWidth='150' labelPosition='left' label="业务联系电话(选填)">
+					<u-input inputAlign='right' maxlength="15" border='none' placeholder='输入联系电话' v-model="currectData.contactsPhone" />
+				</u-form-item>
+				<u-form-item labelWidth='80' labelPosition='left' @click='placeSelect(),hideKeyboard()' label="店铺位置">
+					<view style='text-align:right;' v-if="currectData.province">{{ currectData.province }}{{ currectData.city }}{{ currectData.area }}</view>
+					<view style='text-align:right;' v-else>
+						<text style='text-align:right;'>选择位置 </text>
+						<image src="@/static/image/yjt.png" mode=""
+							style="margin-left:10rpx;width:12rpx;height: 21rpx;"></image>
+					</view>
+				</u-form-item>
+				<u-form-item labelWidth='80' labelPosition='left' label="详细地址">
+					<u-input inputAlign='right' maxlength="15" border='none' placeholder='输入详细地址,不超过15个字' v-model="currectData.detailedAddress" />
+				</u-form-item>
+			</u--form>
+			<view class="footer">
+				<button @click='submit' class="submit">提交</button>
+			</view>
+			<u-modal :show="isSubmit" content='确定提交店铺信息?' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+				@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
+		</view>
 	</view>
 </template>
 
 <script>
+	var that
 	export default {
 		data() {
 			return {
-				
+				currectData:{
+					
+				},
+				isSubmit:false,
+				tips:'发送验证码',
+			}
+		},
+		onLoad() {
+			that = this
+		},
+		onShow(){
+			if(uni.getStorageSync('myCateringdustry')){
+				this.currectData=JSON.parse(uni.getStorageSync('myCateringdustry'))
 			}
 		},
 		methods: {
+			placeSelect() {
+				uni.chooseLocation({
+					success: function(res) {
+						console.log(res);
+						that.currectData.location = res.latitude + ',' + res.longitude
+						let _address = that.$helper.formatLocation(res.address)
+						console.log(_address)
+						that.currectData.province = _address.Province
+						that.currectData.city = _address.City
+						that.currectData.area = _address.Country
+						that.currectData.detailedAddress = _address.Village
+						that.$forceUpdate()
+					}
+				});
+			},
+			hideKeyboard() {
+				uni.hideKeyboard()
+			},
+			codeChange(text) {
+			    this.tips = text;
+			},
+			getCode() {
+				if(!this.currectData.operaterPhone){
+					uni.showToast({
+						icon: "none",
+						title: '请输入手机号再获取验证码!',
+						duration: 2000
+					});
+					return
+				}
+			    if (this.$refs.uCode.canGetCode) {
+			         // 模拟向后端请求验证码
+			        uni.showLoading({
+			        title: '正在获取验证码'
+			        })
+					this.$request.baseRequest('user', 'sendVerifyCode', {
+						phone: this.currectData.operaterPhone
+					}, failres => {
+						uni.showToast({
+							icon: "none",
+							title: failres.errmsg,
+							duration: 3000
+						});
+						uni.hideLoading()
+					}).then(res => {
+						
+								
+					})
+			        setTimeout(() => {
+			            uni.hideLoading();
+			            // 这里此提示会被this.start()方法中的提示覆盖
+			         
+			            // 通知验证码组件内部开始倒计时
+			            this.$refs.uCode.start();
+			        }, 2000);
+			    } else {
+				
+			        uni.showToast({
+			        	icon: "success",
+			        	title: '提交成功!',
+			        	duration: 2000
+			        });
+			    }
+			},
+			submit(){
+				this.isSubmit = true
+			},
+			confirmSubmit() {
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
+					foodInfo: JSON.stringify(this.currectData)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
 			
+					uni.hideLoading()
+				}).then(res => {
+					this.isSubmit = false
+					uni.showToast({
+						icon: "success",
+						title: '编辑店铺信息成功',
+						duration: 2000
+					});
+					uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
+					uni.navigateBack()
+			
+				})
+			},
 		}
 	}
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+	.get_code{
+		background: #5F7DE9;
+		color: #fff;
+		padding: 10rpx 20rpx;
+		border-radius: 10rpx;
+		font-size: 26rpx;
+	 }
 </style>

+ 246 - 5
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/foodInfomation.vue

@@ -1,22 +1,263 @@
 <template>
-	<view>
-		
+	<view class='content'>
+		<view class='wrap'>
+			<view v-for='item in foodInfomations'>
+				<view>{{item.classify}}</view>
+				<view style='margin:10rpx;' class='flex justify-space-between align-item-center' v-for='(item1,index) in item.data'>
+					<view class='flex align-item-center'>
+						<u-checkbox-group
+						    placement="column"
+						    @change="checkboxChange($event,item1)">
+						    <u-checkbox
+						    :customStyle="{marginBottom: '8px'}"
+						    :key="index"
+							:name='item1.dishName'
+							:checked='item1.checked'
+							>
+						    </u-checkbox>
+						</u-checkbox-group>
+						<image v-if='!item1.edit' style='width:200rpx;height:200rpx;margin-right:20rpx;' :src="item1.dishImage" mode="aspectFill"></image>
+						<u-upload v-else height='100' width='100' :fileList="item1[`fileList${item1.id}`]" @afterRead="afterRead($event,item1,item)" @delete="deletePic($event,item1,item)" :name="item1.id" multiple
+							:maxCount="1">
+						</u-upload>
+						 <view>
+							 <view v-if='!item1.edit'>{{item1.dishName}}</view>
+							 <u--input v-else inputAlign='right' v-model="item1.dishName" placeholder="输入菜品名称" border="none"></u--input>
+							 <view v-if='!item1.edit'>{{item1.dishPrice}}</view>
+							 <u--input v-else inputAlign='right' v-model="item1.dishPrice" placeholder="输入菜品单价" border="none"></u--input>
+						 </view>
+					 </view>
+					<view>
+						<view v-if='!item1.edit' @click='edit(item1)' class='button1 button'>编辑</view>
+						<view v-if='item1.edit' @click='submit(item1)' class='button1 button'>确定</view>
+						<view v-if='item1.edit' @click='item1.edit = false' class='default_button'>取消</view>
+						<view v-if='!item1.edit' class='default_button'>置顶</view>
+					</view>
+				 </view>
+			</view>
+		</view>
+		<view style='padding:10px;' class='footer flex justify-space-between align-item-center'>
+			<u-checkbox-group
+			    placement="column"
+			    @change="checkboxAllChange">
+			    <u-checkbox
+			    :customStyle="{marginBottom: '8px'}"
+				name='全选'
+				label='全选'
+				:checked="checkAll"
+				>
+			    </u-checkbox>
+			</u-checkbox-group>
+			<view class='flex align-item-center'>
+				<view @click='del' style='margin-right:10rpx;' class='caution_button'>删除</view>
+				<view @click='add' class='button'>添加</view>
+			</view>
+		</view>
+		<u-modal :show="isSubmit" content='确定删除菜品?' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
 	</view>
 </template>
 
 <script>
+	var that
+	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
 		data() {
 			return {
+				foodInfomations:[],
+				currect:{},
+				checkList:[],
+				checkAll:false,
+				dataList:[],
+				isSubmit:false,
 				
 			}
 		},
-		methods: {
+		onLoad() {
+			that = this
+			if(uni.getStorageSync('myCateringdustry')){
+				this.currect=JSON.parse(uni.getStorageSync('myCateringdustry'))
+				this.getList()
+			}
+		},
+		onShow(){
 			
+		},
+		methods: {
+			// 删除图片
+			deletePic(event,item1,item) {
+				console.log(item1,item)
+				item1[`fileList${item1.id}`].splice(event.index, 1)
+				this.$forceUpdate()
+				// that.indoorImageArray.splice(event.index, 1)
+				// that.currectData.indoorImage =that.indoorImageArray.toString()
+			},
+			// 新增图片
+			async afterRead(event,item1,item) {
+				console.log(item1,item)
+				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = item1[`fileList${item1.id}`].length
+				lists.map((item2) => {
+					item1[`fileList${item1.id}`].push({
+						...item2,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url,item1)
+					
+					let item = item1[`fileList${item1.id}`][fileListLen]
+					item1[`fileList${item1.id}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+					this.$forceUpdate()
+				}
+			},
+			uploadFilePromise(res,item) {
+				return new Promise((resolve, reject) => {
+					uploadImage(res, 'cardImages/',
+						result => {
+							item.dishImage = result
+							resolve(res)
+						}
+					)
+				})
+			},
+			submit(item){
+				this.$request.baseRequest('admin.tourism.foodDishesInfo', 'update', {
+					foodDishesInfo:JSON.stringify(item)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+				}).then(res => {
+					uni.showToast({
+						icon: "success",
+						title: '编辑菜品成功',
+						duration: 2000
+					});
+					this.getList()
+				})
+			},
+			del(){
+
+				this.isSubmit = true
+			},
+			confirmSubmit(){
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				for(var i = 0;i<this.checkList.length;i++){
+					this.$request.baseRequest('admin.tourism.foodDishesInfo', 'delete', {
+						id:this.checkList[i].id
+					}, failres => {
+						uni.showToast({
+							icon: "none",
+							title: failres.errmsg,
+							duration: 3000
+						});
+						uni.hideLoading()
+					}).then(res => {
+						this.isSubmit = false
+						
+						if(this.checkList.length==1||i==this.checkList.length-1){
+							uni.hideLoading()
+							uni.showToast({
+								icon: "success",
+								title: '删除菜品成功',
+								duration: 2000
+							});
+							this.getList()
+						}
+					})
+				}
+			},
+			checkboxAllChange(e){
+				console.log(e)
+				this.checkAll = !this.checkAll;
+				for(var i = 0; i < this.foodInfomations.length; i++){
+					for(var q = 0; q < this.foodInfomations[i].data.length; q++){
+						this.foodInfomations[i].data[q].checked = this.checkAll
+					}
+				}
+				console.log(this.foodInfomations)
+				this.$forceUpdate()
+				
+			},
+			edit(item){
+				console.log(item)
+				item.edit = true
+				this.$forceUpdate()
+			},
+			checkboxChange(e,item1){
+				console.log(e,item1)
+				var checkData = this.checkList.filter((item)=>{return item.id==item1.id})
+				item1.checked = !item1.checked
+				if(e[0]){
+					if(checkData.length==0){
+						this.checkList.push(item1)
+					}else{
+						var checkindex = this.checkList.findIndex((item)=>{return item.id==item1.id})
+						this.checkList[checkindex]=item1
+					}
+				}else{
+					var checkindex = this.checkList.findIndex((item)=>{return item.id==item1.id})
+					this.checkList.splice(checkindex,1)
+				}
+			},
+			add(){
+				uni.navigateTo({
+					url:'/pageA/enter/myCateringdustry/addfood?foodId='+this.currect.id+'&shopNames='+this.currect.shopNames
+				})
+			},
+			deWeightFour(arr) {
+				var obj = {};
+			    arr = arr.reduce(function(a, b) {
+			        obj[b.classify] ? '' : obj[b.classify] = true && a.push({classify:b.classify,data:[]});
+			        return a;
+			    }, [])
+			    return arr;
+			},
+			getList(){
+				this.$request.baseRequest('admin.tourism.foodDishesInfo', 'list', {
+					foodId:this.currect.id,
+					page:1,
+					limit:9999
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+				}).then(res => {
+					var arr = res.data.items
+					var newArr = this.deWeightFour(arr);
+					for(var i=0;i<arr.length;i++){
+						this.dataList=res.data.items
+						var currectList=newArr.filter((item)=>{return item.classify==arr[i].classify})
+						arr[i].checked = false
+						arr[i].edit = false
+						arr[i][`fileList${arr[i].id}`]=[{url:arr[i].dishImage}]
+						currectList[0].data.push(arr[i])
+					}
+					this.foodInfomations = newArr
+					console.log(this.foodInfomations)
+				})
+			},
 		}
 	}
 </script>
 
-<style>
-
+<style lang='scss' scoped>
+	.button1{
+		margin-bottom:20rpx;
+	}
 </style>

+ 113 - 8
uni_merchants_enter/pageA/enter/myCateringdustry/shopSetting/index.vue

@@ -21,12 +21,12 @@
 						</view>
 						<view class='flex  align-item-center'>
 							<view style='margin-right:10rpx;'>{{currectData.status}}</view>
-							<u-switch slot="right-icon" v-model="checked"></u-switch>	
+							<u-switch @change="change" slot="right-icon" v-model="checked"></u-switch>	
 						</view>
 					</view>
 				</u-cell>
 				<u-cell title="删除店铺" :isLink="true" arrow-direction="right">
-					<view slot="title" class="u-slot-title">
+					<view @click='del' slot="title" class="u-slot-title">
 						<view class="">
 							删除店铺
 						</view>
@@ -36,27 +36,28 @@
 			<view class='title'>店铺信息</view>
 			<u-cell-group>
 				<u-cell title="店铺信息" :isLink="true" arrow-direction="right">
-					<view slot="title" class="u-slot-title">
+					<view  @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editShopInformation")' slot="title" class="u-slot-title">
 						<view class="">
 							店铺信息
 						</view>
 					</view>	
 				</u-cell>
 				<u-cell title="店铺图片" :isLink="true" arrow-direction="right">
-					<view slot="title" class="u-slot-title">
+					<view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editShopImage")' slot="title" class="u-slot-title">
 						<view class="">
 							店铺图片
 						</view>
 					</view>	
 				</u-cell>
 				<u-cell title="证照图片" :isLink="true" arrow-direction="right">
-					<view slot="title" class="u-slot-title">
+					<view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editCertificate")' slot="title" class="u-slot-title">
 						<view class="">
 							证照图片
 						</view>
 					</view>	
 				</u-cell>
-				<u-cell title="菜品分类" :isLink="true" arrow-direction="right">
+				
+				<u-cell @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editFoodClassify")' title="菜品分类" :isLink="true" arrow-direction="right">
 					<view slot="title" class="u-slot-title">
 						<view class="">
 							菜品分类
@@ -64,12 +65,27 @@
 					</view>	
 				</u-cell>
 				<u-cell  title="允许用户查看菜品价格" :isLink="true" arrow-direction="right">
-					<u-switch slot="right-icon" v-model="checked1"></u-switch>
+					<view slot="title" class="u-slot-title flex justify-space-between">
+						<view class="">
+							允许用户查看菜品价格
+						</view>
+						<u-switch @change='change1' slot="right-icon" v-model="checked1"></u-switch>
+					</view>	
 				</u-cell>
 				
 			</u-cell-group>
 		</view>
+		<view style='margin:10px;' class='flex justify-space-between align-item-center'>
+			<view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/foodInfomation")' class='button'>菜品信息</view>
+			<view @click='toDetail("/pageA/enter/myCateringdustry/shopSetting/editFoodClassify")' class='button'>团购信息</view>
+		</view>
 		<smh-time-range :is-under='show' :time="time" @confrim="confrim" @cancel="cancel"></smh-time-range>
+		<u-modal :show="isSubmit" :content='content' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
+			<u-modal :show="isDel" content='确定删除店铺?' @confirm="$u.debounce(confirmDelSubmit, 500)" showCancelButton
+				@cancel="isDel=false" @close="isDel=false" closeOnClickOverlay></u-modal>
+		<u-modal :show="isStatus" :content='content' @confirm="$u.debounce(confirmStatusSubmit, 500)" showCancelButton
+			@cancel="isStatus=false" @close="isStatus=false" closeOnClickOverlay></u-modal>
 	</view>
 </template>
 
@@ -78,10 +94,15 @@
 	export default {
 		data() {
 			return {
+				content:'确定下架店铺?',
+				isSubmit:false,
+				isStatus:false,
+				isDel:false,
 				checked:true,
 				checked1:true,
 				show:false,
 				time:[],
+				currectStatus:1,
 				currectData:{
 					
 				},
@@ -167,6 +188,89 @@
 			}
 		},
 		methods: {
+			change1(e){
+				console.log(1111111)
+				this.currectStatus = 2
+				if(!this.checked1){
+					this.content='确定禁止用户查看菜品价格?'
+					this.isStatus = true
+				}else{
+					this.confirmStatusSubmit()
+				}
+			},
+			toDetail(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			del(){
+				this.isDel = true
+			},
+			change(e){
+				this.currectStatus = 1
+				console.log(e,this.checked)
+				if(!this.checked){
+					this.content='确定下架店铺?'
+					this.isStatus = true
+				}else{
+					this.confirmStatusSubmit()
+				}
+			},
+			confirmDelSubmit(){
+				this.$request.baseRequest('admin.tourism.foodInfo', 'delete', {
+					id: this.currectData.id
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+							
+					uni.hideLoading()
+				}).then(res => {
+					uni.showToast({
+						icon: "success",
+						title: '删除成功',
+						duration: 2000
+					});
+					this.isStatus = false
+					uni.navigateBack()
+				})
+			},
+			confirmStatusSubmit(){
+				if(this.currectStatus==1){
+					if(!this.checked){
+						this.currectData.status='已隐藏'
+					}else{
+						this.currectData.status='显示中'
+					}
+				}else{
+					if(!this.checked1){
+						this.currectData.lookFlag=1
+					}else{
+						this.currectData.lookFlag=0
+					}
+				}
+				this.$request.baseRequest('admin.tourism.foodInfo', 'update', {
+					foodInfo: JSON.stringify(this.currectData)
+				}, failres => {
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+							
+					uni.hideLoading()
+				}).then(res => {
+					uni.showToast({
+						icon: "success",
+						title: this.currectStatus==1?this.checked?'店铺已上架':'店铺已下架':this.checked1?'开启成功':'关闭成功',
+						duration: 2000
+					});
+					uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
+					this.isStatus = false
+				})
+			},
 			selectTime(){
 				this.show = true
 			},
@@ -190,7 +294,8 @@
 						duration: 2000
 					});
 					this.show = false
-							
+					uni.setStorageSync('myCateringdustry',JSON.stringify(this.currectData))
+
 				})
 			},
 			cancel(){