Browse Source

首页功能跳转优化

yuxingxing 2 years ago
parent
commit
fa4d0ae109

+ 3 - 3
components/recommend/index.vue

@@ -8,13 +8,13 @@
 		<view class='recommendList acea-row row-between-wrapper'>
 			<view class='item' v-for="(item,index) in hostProduct" :key="index" hover-class='none' @tap="goDetail(item)">
 				<view class='pictrue'>
-					<image :src='item.image'></image>
+					<image :src='item.goodsCover'></image>
 					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
 					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
 					<span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
 				</view>
-				<view class='name line1'>{{item.store_name}}</view>
-				<view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.price}}</text></view>
+				<view class='name line1'>{{item.goodsName}}</view>
+				<view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.salePrice - 0}}</text></view>
 			</view>
 		</view>
 	</view>

+ 15 - 10
pages/goods/goods_list_mall/index.vue

@@ -41,7 +41,8 @@
 		</view>
 		<view class='noCommodity' v-if="productList.length == 0 && where.current > 1">
 			<view class='emptyBox'>
-				<image :src="imgHost + '/statics/images/no-thing.png'"></image>
+				<!-- <image :src="imgHost + '/statics/images/no-thing.png'"></image> -->
+				<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"/>
 			</view>
 			<recommend :hostProduct="hostProduct"></recommend>
 		</view>
@@ -79,7 +80,6 @@ export default {
 			is_switch: true,
 			where: {
 				zoneType: 3,
-				goodsCategoryId: 0,
 				current: 1,
 				size: 20,
 			},
@@ -98,7 +98,12 @@ export default {
 	},
 	onLoad: function (options) {
 		// this.where.goodsCategoryId = options.cid || 0;
-		this.$set(this.where, 'goodsCategoryId', options.sid || 0);
+		if (options.sid) {
+			this.$set(this.where, 'goodsCategoryId', options.sid);
+		}
+		if (options.zoneType) {
+			this.$set(this.where, 'zoneType', options.zoneType);
+		}
 		this.title = options.title || '';
 		this.get_product_list();
 		uni.setNavigationBarTitle({
@@ -177,13 +182,13 @@ export default {
 		},
 		//设置where条件
 		setWhere: function () {
-			if (this.price == 0) this.where.priceOrder = '';
-			else if (this.price == 1) this.where.priceOrder = 'asc';
-			else if (this.price == 2) this.where.priceOrder = 'desc';
-			if (this.stock == 0) this.where.salesOrder = '';
-			else if (this.stock == 1) this.where.salesOrder = 'asc';
-			else if (this.stock == 2) this.where.salesOrder = 'desc';
-			this.where.news = this.nows ? 1 : 0;
+			// if (this.price == 0) this.where.priceOrder = '';
+			// else if (this.price == 1) this.where.priceOrder = 'asc';
+			// else if (this.price == 2) this.where.priceOrder = 'desc';
+			// if (this.stock == 0) this.where.salesOrder = '';
+			// else if (this.stock == 1) this.where.salesOrder = 'asc';
+			// else if (this.stock == 2) this.where.salesOrder = 'desc';
+			// this.where.news = this.nows ? 1 : 0;
 		},
 		//查找产品
 		get_product_list: function (isPage) {

+ 10 - 9
pages/index/diy/index_mall.vue

@@ -17,28 +17,28 @@
 			<view class="grid-box">
 				<view class="grid-group">
 					<view class="grid-item">
-						<image src="../../../static/menus/秒杀专区.png" mode="aspectFit" @click="menusTap('秒杀专区')"></image>
+						<image src="../../../static/menus/秒杀专区.png" mode="aspectFit" @click="menusTap('秒杀专区',0)"></image>
 						<text>秒杀专区</text>
 					</view>
 					<view class="grid-item">
-						<image src="../../../static/menus/红包商城.png" mode="aspectFit" @click="menusTap('红包商城')"></image>
+						<image src="../../../static/menus/红包商城.png" mode="aspectFit" @click="menusTap('红包商城',3)"></image>
 						<text>红包商城</text>
 					</view>
 					<view class="grid-item">
-						<image src="../../../static/menus/积分专区.png" mode="aspectFit" @click="menusTap('积分专区')"></image>
+						<image src="../../../static/menus/积分专区.png" mode="aspectFit" @click="menusTap('积分专区',1)"></image>
 						<text>积分专区</text>
 					</view>
 					<view class="grid-item">
-						<image src="../../../static/menus/创客专区.png" mode="aspectFit" @click="menusTap('创客专区')"></image>
+						<image src="../../../static/menus/创客专区.png" mode="aspectFit" @click="menusTap('创客专区',4)"></image>
 						<text>创客专区</text>
 					</view>
 					<view class="grid-item">
-						<image src="../../../static/menus/城市合伙人.png" mode="aspectFit" @click="menusTap('城市合伙人')">
+						<image src="../../../static/menus/城市合伙人.png" mode="aspectFit" @click="menusTap('城市合伙人',5)">
 						</image>
 						<text>城市合伙人</text>
 					</view>
 					<view class="grid-item">
-						<image src="../../../static/menus/积分抵扣专区.png" mode="aspectFit" @click="menusTap('积分抵扣专区')">
+						<image src="../../../static/menus/积分抵扣专区.png" mode="aspectFit" @click="menusTap('积分抵扣专区',2)">
 						</image>
 						<text>抵扣专区</text>
 					</view>
@@ -66,7 +66,7 @@
 						</view>
 					</view>
 					<view class="goods-scroll">
-						<scroll-view scroll-x="true">
+						<scroll-view scroll-x="true" v-if="tempArrBao.length > 0">
 							<view class="goods-item" v-for="(item, index) in tempArrBao" :key="index"
 								@click="goDetail(item)">
 								<image :src="item.goodsCover" mode="aspectFit"></image>
@@ -79,6 +79,7 @@
 								</view>
 							</view>
 						</scroll-view>
+						<u-empty v-else mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"/>
 					</view>
 				</view>
 			</view>
@@ -723,13 +724,13 @@ export default {
 				this.navigationList.unshift(tuiJian)
 			})
 		},
-		menusTap(url) {
+		menusTap(url,zoneType) {
 			// #ifdef H5
 			location.href = url
 			// #endif
 			// #ifdef MP || APP-PLUS
 			uni.navigateTo({
-				url: "/pages/goods/goods_list_mall/index?sid=" + 1 + "&title=" + url
+				url: "/pages/goods/goods_list_mall/index?zoneType=" + zoneType + "&title=" + url
 			});
 			// #endif
 		},