Browse Source

添加 发送推文按钮隐藏显示控制接口

xiaoxin 2 years ago
parent
commit
daf85bcf8e
2 changed files with 137 additions and 116 deletions
  1. 13 2
      pages/community/community.vue
  2. 124 114
      pages/my/my.vue

+ 13 - 2
pages/community/community.vue

@@ -84,7 +84,7 @@
 		</view>
 		</view>
 
 
 		<!-- 悬浮按钮区域 -->
 		<!-- 悬浮按钮区域 -->
-		<uni-fab :pattern="pattern" horizontal="right" @fabClick="handleClickBtn"></uni-fab>
+		<uni-fab v-if="showFab" :pattern="pattern" horizontal="right" @fabClick="handleClickBtn"></uni-fab>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -122,10 +122,12 @@ export default {
 			// 瀑布流第一列数据
 			// 瀑布流第一列数据
 			list1: [],
 			list1: [],
 			// 瀑布流第二列数据
 			// 瀑布流第二列数据
-			list2: []
+			list2: [],
+			showFab: true
 		}
 		}
 	},
 	},
 	onShow() {
 	onShow() {
+		this.getShow()
 		let userInfo = uni.getStorageSync('userInfo')
 		let userInfo = uni.getStorageSync('userInfo')
 		let tokenId = uni.getStorageSync('tokenId')
 		let tokenId = uni.getStorageSync('tokenId')
 		if (!userInfo || !tokenId) {
 		if (!userInfo || !tokenId) {
@@ -156,6 +158,15 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
+		async getShow() {
+			const res = await this.$myRequest({
+				url: '/mhotel/admintrueStr.action'
+			})
+			// console.log(res)
+			if (res.code == 200) {
+				res.data == 0 ? (this.showFab = true) : (this.showFab = false)
+			}
+		},
 		// 获取乡镇列表数组
 		// 获取乡镇列表数组
 		async getTownList() {
 		async getTownList() {
 			const res = await this.$myRequest({
 			const res = await this.$myRequest({

+ 124 - 114
pages/my/my.vue

@@ -20,36 +20,36 @@
 		</view>
 		</view>
 
 
 		<!-- 内容区域 -->
 		<!-- 内容区域 -->
-		<view class="body">
-			<!-- 民宿管理区域 -->
-			<view class="body_box">
-				<view class="box_title">民宿管理</view>
-				<view class="box_list">
-					<view class="item_box" @click="handleGoPage('/pages/orderManage/orderManage')">
-						<img class="box_img" src="../../static/my/order.png" />
-						<view class="box_text">订单管理</view>
-					</view>
-					<view class="item_box" @click="handleGoPage('/pages/myEvaluate/myEvaluate')">
-						<img class="box_img" src="../../static/my/evaluate.png" />
-						<view class="box_text">我的评价</view>
-					</view>
-					<view class="item_box" @click="handleGoPage('/pages/myComplaint/myComplaint')">
-						<img class="box_img" src="../../static/my/complaint.png" />
-						<view class="box_text">投诉进度</view>
-					</view>
-					<view class="item_box" @click="handleGoPage('/pages/collect/collect')">
-						<img class="box_img" src="../../static/my/collect.png" />
-						<view class="box_text">收藏/住过</view>
-					</view>
-					<view class="item_box" @click="handleGoPage('/pages/myCoupon/myCoupon')">
-						<img class="box_img" src="../../static/my/coupon.png" />
-						<view class="box_text">我的卡券</view>
-					</view>
-					<view class="item_box" @click="handleGoPage('/pages/common/common')">
-						<img class="box_img" src="../../static/my/people.png" />
-						<view class="box_text">常用旅客</view>
-					</view>
-				</view>
+		<view class="body">
+			<!-- 民宿管理区域 -->
+			<view class="body_box">
+				<view class="box_title">民宿管理</view>
+				<view class="box_list">
+					<view class="item_box" @click="handleGoPage('/pages/orderManage/orderManage')">
+						<img class="box_img" src="../../static/my/order.png" />
+						<view class="box_text">订单管理</view>
+					</view>
+					<view class="item_box" @click="handleGoPage('/pages/myEvaluate/myEvaluate')">
+						<img class="box_img" src="../../static/my/evaluate.png" />
+						<view class="box_text">我的评价</view>
+					</view>
+					<view class="item_box" @click="handleGoPage('/pages/myComplaint/myComplaint')">
+						<img class="box_img" src="../../static/my/complaint.png" />
+						<view class="box_text">投诉进度</view>
+					</view>
+					<view class="item_box" @click="handleGoPage('/pages/collect/collect')">
+						<img class="box_img" src="../../static/my/collect.png" />
+						<view class="box_text">收藏/住过</view>
+					</view>
+					<view class="item_box" @click="handleGoPage('/pages/myCoupon/myCoupon')">
+						<img class="box_img" src="../../static/my/coupon.png" />
+						<view class="box_text">我的卡券</view>
+					</view>
+					<view class="item_box" @click="handleGoPage('/pages/common/common')">
+						<img class="box_img" src="../../static/my/people.png" />
+						<view class="box_text">常用旅客</view>
+					</view>
+				</view>
 			</view>
 			</view>
 			<!-- 我的订单区域 -->
 			<!-- 我的订单区域 -->
 			<view class="myOrder">
 			<view class="myOrder">
@@ -83,11 +83,11 @@
 			<view class="body_box">
 			<view class="body_box">
 				<view class="box_title">常用工具</view>
 				<view class="box_title">常用工具</view>
 				<view class="box_list">
 				<view class="box_list">
-					<view class="item_box" @click="handleShowCar">
+					<view class="item_box" @click="handleShowCar" v-if="showFab">
 						<img class="box_img" src="../../static/my/shopcar.png" />
 						<img class="box_img" src="../../static/my/shopcar.png" />
 						<view class="box_text">购物车</view>
 						<view class="box_text">购物车</view>
 					</view>
 					</view>
-					<view class="item_box" @click="handleShowAddress">
+					<view class="item_box" @click="handleShowAddress" v-if="showFab">
 						<img class="box_img" src="../../static/my/address.png" />
 						<img class="box_img" src="../../static/my/address.png" />
 						<view class="box_text">收货地址</view>
 						<view class="box_text">收货地址</view>
 					</view>
 					</view>
@@ -119,7 +119,8 @@ export default {
 			// 胶囊按钮栏高度
 			// 胶囊按钮栏高度
 			customBarH: 0,
 			customBarH: 0,
 			// 顶部页面标题栏显示隐藏控制
 			// 顶部页面标题栏显示隐藏控制
-			headerType: false
+			headerType: false,
+			showFab: true
 		}
 		}
 	},
 	},
 	created() {
 	created() {
@@ -143,6 +144,7 @@ export default {
 	},
 	},
 	onLoad() {
 	onLoad() {
 		uni.$on('changeFlag', this.changeFlag)
 		uni.$on('changeFlag', this.changeFlag)
+		this.getShow()
 	},
 	},
 	onShow() {
 	onShow() {
 		let openid = uni.getStorageSync('openid')
 		let openid = uni.getStorageSync('openid')
@@ -154,6 +156,15 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
+		async getShow() {
+			const res = await this.$myRequest({
+				url: '/mhotel/admintrueStr.action'
+			})
+			// console.log(res)
+			if (res.code == 200) {
+				res.data == 0 ? (this.showFab = true) : (this.showFab = false)
+			}
+		},
 		// 跳转页面回调
 		// 跳转页面回调
 		handleGoPage(url) {
 		handleGoPage(url) {
 			if (this.isLogin()) {
 			if (this.isLogin()) {
@@ -197,84 +208,83 @@ export default {
 		},
 		},
 		handleShowTest() {
 		handleShowTest() {
 			showTest()
 			showTest()
-		},
-		//购物车
-		handleShowCar(){
-			let userInfo = uni.getStorageSync('userInfo')
-			let tokenId = uni.getStorageSync('tokenId')
-			if (!userInfo || !tokenId) {
-				uni.showModal({
-					title: '提示',
-					content: '您当前未登录,请授权登录查看社区信息',
-					showCancel: false,
-					success: (res) => {
-						if (res.confirm) {
-							uni.navigateTo({
-								url: '/pages/login/login'
-							})
-						}
-					}
-				})
-			}else{
-				uni.navigateTo({
-					url:'/packageShang/pages/tabbar/cart'
-				})
-			}
-		},
-		//收货地址
-		handleShowAddress(){
-			let userInfo = uni.getStorageSync('userInfo')
-			let tokenId = uni.getStorageSync('tokenId')
-			if (!userInfo || !tokenId) {
-				uni.showModal({
-					title: '提示',
-					content: '您当前未登录,请授权登录查看社区信息',
-					showCancel: false,
-					success: (res) => {
-						if (res.confirm) {
-							uni.navigateTo({
-								url: '/pages/login/login'
-							})
-						}
-					}
-				})
-			}else{
-				uni.navigateTo({
-					url:'/packageShang/pages/user/address/address'
-				})
-			}
-		},
-		// 跳转到 订单
-		toOrder(url, state) {
-			let userInfo = uni.getStorageSync('userInfo')
-			let tokenId = uni.getStorageSync('tokenId')
-			if (!userInfo || !tokenId) {
-				uni.showModal({
-					title: '提示',
-					content: '您当前未登录,请授权登录查看社区信息',
-					showCancel: false,
-					success: (res) => {
-						if (res.confirm) {
-							uni.navigateTo({
-								url: '/pages/login/login'
-							})
-						}
-					}
-				})
-			}else{
-				uni.setStorage({
-					key: '__order_state',
-					data: state,
-					success(res) {
-					},
-					complete() {
-						uni.navigateTo({
-							url
-						});
-					}
-				});
-			}
 		},
 		},
+		//购物车
+		handleShowCar() {
+			let userInfo = uni.getStorageSync('userInfo')
+			let tokenId = uni.getStorageSync('tokenId')
+			if (!userInfo || !tokenId) {
+				uni.showModal({
+					title: '提示',
+					content: '您当前未登录,请授权登录查看社区信息',
+					showCancel: false,
+					success: (res) => {
+						if (res.confirm) {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							})
+						}
+					}
+				})
+			} else {
+				uni.navigateTo({
+					url: '/packageShang/pages/tabbar/cart'
+				})
+			}
+		},
+		//收货地址
+		handleShowAddress() {
+			let userInfo = uni.getStorageSync('userInfo')
+			let tokenId = uni.getStorageSync('tokenId')
+			if (!userInfo || !tokenId) {
+				uni.showModal({
+					title: '提示',
+					content: '您当前未登录,请授权登录查看社区信息',
+					showCancel: false,
+					success: (res) => {
+						if (res.confirm) {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							})
+						}
+					}
+				})
+			} else {
+				uni.navigateTo({
+					url: '/packageShang/pages/user/address/address'
+				})
+			}
+		},
+		// 跳转到 订单
+		toOrder(url, state) {
+			let userInfo = uni.getStorageSync('userInfo')
+			let tokenId = uni.getStorageSync('tokenId')
+			if (!userInfo || !tokenId) {
+				uni.showModal({
+					title: '提示',
+					content: '您当前未登录,请授权登录查看社区信息',
+					showCancel: false,
+					success: (res) => {
+						if (res.confirm) {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							})
+						}
+					}
+				})
+			} else {
+				uni.setStorage({
+					key: '__order_state',
+					data: state,
+					success(res) {},
+					complete() {
+						uni.navigateTo({
+							url
+						})
+					}
+				})
+			}
+		}
 	}
 	}
 }
 }
 </script>
 </script>
@@ -409,10 +419,10 @@ export default {
 				}
 				}
 
 
 				.header_title {
 				.header_title {
-					display: flex;
-					align-items: flex-end;
-					height: 64rpx;
-					font-size: 32rpx;
+					display: flex;
+					align-items: flex-end;
+					height: 64rpx;
+					font-size: 32rpx;
 					font-weight: bold;
 					font-weight: bold;
 				}
 				}