Browse Source

商铺信息:拆分为已租和招租

skym1024 11 months ago
parent
commit
9f3427c6f9
3 changed files with 32 additions and 61 deletions
  1. 4 1
      pages/shop/index.vue
  2. 26 59
      pages/shop/shoplist.vue
  3. 2 1
      pages/shop/taglist.vue

+ 4 - 1
pages/shop/index.vue

@@ -20,6 +20,9 @@
 	import request from '../../api/shop.js';
 	import { BASE_URL } from '../../env.js';
 	export default {
+		onLoad: function (option) {
+			this.status = option.status;
+		},
 		data() {
 			return {
 				districtSelected: '',
@@ -37,7 +40,7 @@
 			},
 			// 列表点击函数
 			listItemBtn(e) {
-				uni.navigateTo({ url: `/pages/shop/taglist?district=${e.value}` })
+				uni.navigateTo({ url: `/pages/shop/taglist?district=${e.value}&status=${this.status}` })
 			},
 		}
 	}

+ 26 - 59
pages/shop/shoplist.vue

@@ -2,30 +2,8 @@
 	<view class="container">
 		<view class="top">
 			<view class="search">
-				<uni-row class="demo-uni-row" :width="nvueWidth">
-					<uni-col>
-						<view class="demo-uni-col">
-							<uni-easyinput class="uni-input" prefixIcon="search" v-model="formData.name" placeholder="请输入商户名称"></uni-easyinput>
-						</view>						
-					</uni-col>
-				</uni-row>
-				<uni-row class="demo-uni-row" :width="nvueWidth">
-					<uni-col :span="16">
-						<view class="demo-uni-col">						
-							<uni-data-select class="search-data-select"  placeholder="使用状态" v-model="formData.status" :localdata="statusOptions">状态</uni-data-select>
-						</view>
-					</uni-col>
-					<uni-col :span="4">
-						<view class="demo-uni-col">
-							<button class="searchBtn" type="default" @click="handleSearch">搜索</button>
-						</view>						
-					</uni-col>
-					<uni-col :span="4">
-						<view class="demo-uni-col">
-							<button class="searchBtn" type="default" @click="handleReset">重置</button>
-						</view>						
-					</uni-col>							
-				</uni-row>
+				<uni-easyinput class="uni-input" prefixIcon="search" v-model="formData.name" placeholder="请输入商户名称"></uni-easyinput>
+				<button class="searchBtn" type="default" size="mini" @click="handleSearch">搜索</button>
 			</view>
 		</view>
 		<uni-list border class="list">
@@ -68,6 +46,11 @@
 		onLoad: function (option) {
 			this.formData.district = option.district;
 			this.formData.tag = option.tag;
+			if(option.status==1){
+				this.formData.status = "已使用";
+			}else{
+				this.formData.status = "未使用";
+			}			
 		},		
 		onShow: function() {
 			// this.init();
@@ -110,7 +93,7 @@
 			async handleReset() {								
 				this.formData.pageNum = 0;
 				this.formData.name = null;
-				this.formData.status = null;
+				// this.formData.status = null;
 
 				this.resultList.length = 0;
 
@@ -159,7 +142,7 @@
 		width: 100%;
 		z-index: 999;
 		background-color: #fff;
-		/* overflow: hidden; */
+		overflow: hidden;
 	}
 	.tabsBox {
 		width: 100%;
@@ -179,53 +162,37 @@
 		color: #ff9302;
 		border-bottom: 1px solid #ff9302;
 	}
-.search {
-		width: 98%;
+	.search {
+		width: 90%;
+		height: 2em;
 		border: 1px solid #f3f3f3;
 		background-color: #fff !important;
-		border-radius: 5px;
-		margin: 2px;
-		padding: 2rpx;
-		display: block;
-	}
-	.demo-uni-row {
-		margin-bottom: 10px;
-		display: block;
-	}
-	/deep/ .uni-row {
-		margin-bottom: 10px;
+		border-radius: 12px;
+		display: flex;
+		margin: 20px auto;
 	}
-	.demo-uni-col {
-		height: 24px;
-		margin-bottom: 10px;
-		border-radius: 4px;
-	}		
 	.uni-easyinput {
-		width: 100%;
+		width: 70%;
+		margin-left: 5%;
+		height: 100%;
 		font-size: 14px;
-		display: block;
 	}
 	.uni-easyinput .uni-easyinput__content {
-		border: 1px solid #f3f3f3;
-		border-radius: 10px;
-	}
-	.search-data-select{
-		width: 100%;
-		border-radius: 10px;
+		border: none !important;
+		height: 100%;
+		line-height: 2em;
 	}
 	.searchBtn {
-		width: 98%;
+		width: 20%;
 		background-color: #ff9302 !important;
 		border: none;
 		color: #fff !important;
+		height: 2em;
+		margin-top: 0.2em;
+		margin-left: 4%;
 		border-radius: 12px;
-		padding-left: 2px;
-		padding-right: 2px;
-		margin-left: 2px;
-		margin-right: 2px;
-		font-size: 13px;
 	}
 	.list {
 		display: block;
 	}
-</style>
+</style>

+ 2 - 1
pages/shop/taglist.vue

@@ -22,6 +22,7 @@
 		components: {},
 		onLoad: function (option) {
 			this.district = option.district;
+			this.status = option.status;
 		},
 		data() {
 			return {
@@ -36,7 +37,7 @@
 		methods: {
 			// 列表点击函数
 			listItemBtn(e) {
-				uni.navigateTo({ url: `/pages/shop/shoplist?district=${this.district}&tag=${e}` })
+				uni.navigateTo({ url: `/pages/shop/shoplist?district=${this.district}&tag=${e}&status=${this.status}` })
 			},
 		}
 	}