瀏覽代碼

首页产品跳转

yfso 2 年之前
父節點
當前提交
363513c3eb
共有 3 個文件被更改,包括 10 次插入4 次删除
  1. 2 2
      pages/goods/goods-detail/index.vue
  2. 7 1
      pages/index/index.vue
  3. 1 1
      setting.js

+ 2 - 2
pages/goods/goods-detail/index.vue

xqd
@@ -66,11 +66,11 @@
 				<text class="about-name">{{hotelDetail.name}}</text>
 				<view class="about-address">
 					<text style="margin-right:20rpx ;">地址:</text>
-					<text>{{hotelDetail.address}}</text>
+					<text>{{hotelDetail.address?hotelDetail.address:""}}</text>
 				</view>
 				<view class="about-phone">
 					<text style="margin-right:20rpx ;">电话:</text>
-					<text>{{hotelDetail.phone}}</text>
+					<text>{{hotelDetail.phone?hotelDetail.phone:""}}</text>
 				</view>
 				<view class="about-all">
 					<text @click="goGoodsHotel(product_id)" style="margin-right: 16rpx;">全部酒店</text>

+ 7 - 1
pages/index/index.vue

xqd xqd
@@ -135,7 +135,8 @@
 						<text class="text-top">{{item.name}}</text>
 				</view> -->
 				<view  class="home-hotel-img-content-item" v-for="(item,index) in goodsList" :key="index"
-					:style="{marginTop:item.marginTop || 0 }">
+					:style="{marginTop:item.marginTop || 0 }" 
+					@click="goToProduct(item.id)">
 					<image class="home-hotel-img-content-item-img"
 						:class="item.short?'home-hotel-img-content-item-img': 'home-hotel-img-content-item-img-long' "
 						:src="item.cover_img" mode=""></image>
@@ -618,6 +619,11 @@
 					})
 				}
 			},
+			goToProduct(id){
+				uni.navigateTo({
+					url:`/pages/goods/goods-detail/index?id=${id}&type=1`
+				})
+			},
 			//产品列表
 			goProduceList() {
 				uni.navigateTo({

+ 1 - 1
setting.js

xqd
@@ -1,7 +1,7 @@
 /**
  * Created by JianJia.Zhou<jianjia.zhou> on 2022/3/18.
  */
-const IS_DEV = process.env.NODE_ENV === 'development'
+const IS_DEV = process.env.NODE_ENV === 'development1'
 // const URL = 'https://t9.9026.com'
 const URL = 'https://ihg.9026.com'