2912631854@qq.com 1 рік тому
батько
коміт
4a79ac7edd
3 змінених файлів з 114 додано та 48 видалено
  1. 13 7
      pages/my/roomType.vue
  2. 73 31
      pagesHouse/HotelMerchandise/index.vue
  3. 28 10
      pagesHouse/home/tj.vue

+ 13 - 7
pages/my/roomType.vue

@@ -56,9 +56,9 @@
 					</view>
 				</view>
 				<view class="right">
-					<view class="right-btn" @click="piliangxiajia()">
+					<!-- 	<view class="right-btn" @click="piliangxiajia()">
 						批量下架
-					</view>
+					</view> -->
 					<view class="right-btn" @click="Pricing()">
 						批量定价
 					</view>
@@ -88,11 +88,13 @@
 					<view class="hander-two-text">
 						每天价格
 					</view>
+
 					<u-radio-group @change="selectType" size="32" iconSize="24" v-model="fromData.comboType"
 						placement="row" activeColor='#1372FF'>
 						<u-radio labelSize='30' label="固定设置" :name='1'></u-radio>
 						<u-radio labelSize='30' label="按天设置" :name='2' v-if="tabIndex==0"></u-radio>
 					</u-radio-group>
+
 				</view>
 				<view class="hander-three">
 					<view class="hander-three-text">
@@ -141,7 +143,9 @@
 				showPricing: false,
 				selectedTags: [],
 				ids: [],
-				from: {}
+				from: {},
+				tabIndex: 0,
+
 			}
 		},
 		onLoad() {
@@ -152,7 +156,7 @@
 			selectType(type) {
 				console.log(type);
 				this.typeIndex = type;
-				this.fromData.comboType = type
+				// this.fromData.comboType = type
 			},
 			piliangxiajia() {
 				this.$api.post('/merchant/hotel/repast/batchPutAway', this.from).then(res => {
@@ -170,9 +174,9 @@
 				} else {
 					console.log('2222');
 					this.selectedTags.push(e);
-					this.ids.push(e.id)
+					this.ids.push(e.houseBaseId)
 					this.from = {
-						ids: this.ids,
+						idList: this.ids,
 						status: e.status == 1 ? 0 : 1
 					}
 				}
@@ -258,6 +262,7 @@
 				font-size: 30rpx;
 				color: #333333;
 				font-weight: Regular;
+				margin-right: 30rpx;
 			}
 
 			.hander-two-image {
@@ -463,7 +468,8 @@
 				justify-content: space-evenly;
 
 				.right-btn {
-					width: 148rpx;
+					// width: 148rpx;
+					width: 100%;
 					height: 80rpx;
 					line-height: 80rpx;
 					background-color: #1372FF;

+ 73 - 31
pagesHouse/HotelMerchandise/index.vue

@@ -10,7 +10,6 @@
 			</view>
 		</view>
 		<!-- 房型数量 -->
-		
 		<view class="">
 			<view class="typeNum">
 				<view class="left" style="font-size: 24rpx; color: #777;" @click="areaShowed()">
@@ -75,13 +74,53 @@
 							<text style="font-size: 30rpx; color: #333;">{{item.name||item.goodsName}}</text>
 						</view>
 						<view class="under">
-							<view style="font-size: 24rpx; color: #777;">销量:{{item.salesVolume||item.soldNum}}</view>
-							<view style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
-								¥{{item.discountPrice||item.normalPrice}}</view>
+							<!-- <view style="font-size: 24rpx; color: #777;">销量:{{item.salesVolume||item.soldNum||0}}</view> -->
+							<view style="font-size: 24rpx; color: #777;">
+								销量:{{item.salesVolume!=null?item.salesVolume:item.soldNum}}</view>
+
+							<view v-if='item.goodsType==1'
+								style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
+								¥{{item.discountPrice}}</view>
+
+							<view v-else-if="item.goodsType==2"
+								style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
+								¥{{item.normalPrice}}</view>
+
+							<view v-else-if="item.goodsType==3"
+								style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
+								¥{{item.avePrice}}</view>
+
+							<view v-else
+								style="font-size: 36rpx; color: #FF4141; font-weight: Bold; margin-top: 16rpx;">
+								¥{{item.discountPrice}}</view>
+
+
+
+						</view>
+					</view>
+				</view>
+				<view class="type-btn" v-if='!canyinmeishi'>
+					<view class="type-btn-left">
+
+					</view>
+					<view class="type-btn-right">
+						<view class="" @click="shanchu(item,index)">
+							删除
+						</view>
+						<view class="" @click="gaijia(item,index)" v-if='item.goodsType == 2'>
+							改价格
+						</view>
+						<view v-if="canyinmeishi" class="" @click="xiajia(item,index)">
+							{{fromData.status==0?'下架':'上架'}}
+						</view>
+
+						<view v-if="!canyinmeishi" class="" @click="xiajia1(item,index)">
+							{{fromData.status==0?'上架':'下架'}}
 						</view>
 					</view>
 				</view>
-				<view class="type-btn">
+
+				<view class="type-btn" v-if='canyinmeishi'>
 					<view class="type-btn-left">
 
 					</view>
@@ -311,10 +350,10 @@
 						let namesArray = this.selectedTags.map(obj => obj.id);
 						let postdata = {
 							discountPrice: 0,
-							id: namesArray,
-							status: this.fromData.status == 1 ? 0 : 1,
+							ids: namesArray,
+							status: this.fromData.status == 0 ? 1 : 0,
 						};
-						this.$api.post('/scenic/goods/batchUpDownFrame', postdata).then(res => {
+						this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
 							this.$refs.uToast.show({
 								type: 'success',
 								title: '',
@@ -338,6 +377,7 @@
 
 					} else {
 
+
 						let postdata = this.selectedTags.map((item, index, arr) => {
 							let json = {};
 							json.id = item.id;
@@ -404,7 +444,7 @@
 
 					} else {
 						let namesArray = this.selectedTags.map(obj => obj.id);
-
+						console.log('111111111111111111', namesArray)
 						//status: this.fromData.status,
 						this.$api.del('/scenic/goods', namesArray).then(res => {
 							this.$refs.uToast.show({
@@ -500,24 +540,9 @@
 
 				} else {
 					//获取商品列表(渔家乐)
-					if (this.lsdata.goodsType == 1) {
-						let postdata = {
-							discountPrice: this.newprice,
-							id: this.lsdata.id,
-							status: this.fromData.status,
-						};
-						console.log('postdata', postdata)
-						this.$api.put('/scenic/goods', postdata).then(res => {
-							this.$refs.uToast.show({
-								type: 'success',
-								title: '',
-								message: "成功",
-								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
-							})
-							this.closegaijia();
-							this.yujialedata(); //获取商品列表(渔家乐)
-						})
-					} else {
+
+
+					if (this.lsdata.goodsType == 2) {
 						let postdata = {
 							normalPrice: this.newprice,
 							id: this.lsdata.id,
@@ -534,6 +559,23 @@
 							this.closegaijia();
 							this.yujialedata(); //获取商品列表(渔家乐)
 						})
+					} else {
+						// let postdata = {
+						// 	normalPrice: this.newprice,
+						// 	id: this.lsdata.id,
+						// 	status: this.fromData.status,
+						// };
+						// console.log('postdata', postdata)
+						// this.$api.put('/scenic/goods', postdata).then(res => {
+						// 	this.$refs.uToast.show({
+						// 		type: 'success',
+						// 		title: '',
+						// 		message: "成功",
+						// 		iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
+						// 	})
+						// 	this.closegaijia();
+						// 	this.yujialedata(); //获取商品列表(渔家乐)
+						// })
 					}
 
 				}
@@ -557,13 +599,13 @@
 					let postdata = {
 						discountPrice: this.lsdata.discountPrice,
 						ids: [this.lsdata.id],
-						status: this.fromData.status,
+						status: this.fromData.status == 0 ? 1 : 0,
 					};
 					this.$api.post('/api/merchant/food/updateStatus', postdata).then(res => {
 						this.$refs.uToast.show({
 							type: 'success',
 							title: '',
-							message: "下架成功",
+							message: "成功",
 							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
 						})
 						this.quxiaoxiajia();
@@ -579,7 +621,7 @@
 						this.$refs.uToast.show({
 							type: 'success',
 							title: '',
-							message: "下架成功",
+							message: "成功",
 							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
 						})
 						this.quxiaoxiajia();
@@ -595,13 +637,13 @@
 			},
 
 			selectPerson(e, i) {
-				console.log('+++++++', e, i);
 				if (this.selectedTags.includes(e)) {
 					this.selectedTags = this.selectedTags.filter(t => t !== e);
 				} else {
 					this.selectedTags.push(e);
 				}
 				console.log(' this.selectedTags', this.selectedTags)
+
 			},
 			yujialedata() {
 				this.$api.get('/scenic/goods/page', this.fromData).then(res => {

+ 28 - 10
pagesHouse/home/tj.vue

@@ -43,7 +43,9 @@
 </template>
 
 <script>
-import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
+	import {
+		data
+	} from '../../uni_modules/uview-ui/libs/mixin/mixin';
 	export default {
 		data() {
 			return {
@@ -107,9 +109,9 @@ import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
 			},
 			date(newval, oldval) {
 				if (newval != oldval) {
-					if(this.merchantType==10){
+					if (this.merchantType == 10) {
 						this.getList()
-					}else{
+					} else {
 						this.gettopData();
 						this.getBottomData();
 					}
@@ -117,9 +119,9 @@ import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
 			}
 		},
 		onLoad() {
-			if(this.merchantType==10){
+			if (this.merchantType == 10) {
 				this.getList()
-			}else{
+			} else {
 				this.gettopData();
 				this.getBottomData();
 			}
@@ -127,6 +129,11 @@ import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
 		},
 		methods: {
 			confirmDate(e) {
+				// //调起时间弹出弹窗时候用
+				// var pickerSlot = document.getElementsByClassName('picker-slot');
+				// pickerSlot[1].style.display = 'none'
+				// pickerSlot[2].style.display = 'none'
+
 				// 创建一个Date对象并传入时间戳
 				const date = new Date(e.value);
 				// 使用Date对象的方法获取年、月、日、小时、分钟和秒
@@ -159,14 +166,15 @@ import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
 					this.total2 = 0;
 					if (res.data.code === 0) {
 						this.info = res.data.data;
-						this.info.allOrderAmount=res.data.data.statistics.allOrderAmount;
-						this.info.allOrders=res.data.data.statistics.allOrders,
-						this.info.allRefundOrderAmount=res.data.data.statistics.allRefundOrderAmount,
-						this.info.allRefundOrders=res.data.data.statistics.allRefundOrders
+						this.info.allOrderAmount = res.data.data.statistics.allOrderAmount;
+						this.info.allOrders = res.data.data.statistics.allOrders,
+							this.info.allRefundOrderAmount = res.data.data.statistics.allRefundOrderAmount,
+							this.info.allRefundOrders = res.data.data.statistics.allRefundOrders
 						//折线图
 						this.dataList = res.data.data.curve;
 						for (let i = 0; i < res.data.data.curve.length; i++) {
-							x.push(this.type == 1 ? res.data.data.curve[i].dateKey : (res.data.data.curve[i].dateKey + '月'));
+							x.push(this.type == 1 ? res.data.data.curve[i].dateKey : (res.data.data.curve[i]
+								.dateKey + '月'));
 							y.push(res.data.data.curve[i].orderNums);
 							z.push(res.data.data.curve[i].refundOrderNums);
 							this.total += res.data.data.curve[i].orderNums;
@@ -261,6 +269,16 @@ import { data } from '../../uni_modules/uview-ui/libs/mixin/mixin';
 	.u-transition {
 		z-index: 99999998 !important;
 	}
+
+	// .yearPicker {
+	// 	.picker-items {
+
+	// 		.picker-slot:nth-child(2),
+	// 		.picker-slot:nth-child(3) {
+	// 			display: none;
+	// 		}
+	// 	}
+	// }
 </style>
 <style scoped lang="less">
 	/deep/.visibleItemCount {