|
@@ -56,29 +56,35 @@
|
|
|
<zs-img :src="item.advertsImg" radius="full" width="344rpx" mode="widthFix" @click.native="jump(item.jumpUrl)"></zs-img>
|
|
|
</template>
|
|
|
<view v-else @click="goGoodsDetail(item)">
|
|
|
- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img>
|
|
|
+ <zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode=""></zs-img>
|
|
|
+ <!-- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img> -->
|
|
|
<view class="info">
|
|
|
<view class="title">
|
|
|
- {{item.goodsVos[0].goodsName}}
|
|
|
+ <view class="tag">
|
|
|
+ 今日特惠
|
|
|
+ </view>
|
|
|
+ <view class="text">
|
|
|
+ {{item.title}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- <view class="desc">
|
|
|
{{item.goodsVos[0].goodsDescribe}}
|
|
|
</view> -->
|
|
|
+ <view class="discount-tag" v-if="item.salePrice&&item.originalPrice">
|
|
|
+ {{(item.salePrice/item.originalPrice)*10}}
|
|
|
+ </view>
|
|
|
<view class="price-box">
|
|
|
<view class="left">
|
|
|
- <!-- <view class="unit">
|
|
|
- ¥
|
|
|
- </view> -->
|
|
|
- <view class="price">
|
|
|
- ¥{{item.goodsVos[0].realPrice}}
|
|
|
+ <view class="price" v-if="item.salePrice">
|
|
|
+ ¥{{item.salePrice}}
|
|
|
</view>
|
|
|
- <view class="old-price">
|
|
|
- ¥{{item.goodsVos[0].marketPrice}}
|
|
|
+ <view class="old-price" v-if="item.originalPrice">
|
|
|
+ ¥{{item.originalPrice}}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="right">
|
|
|
- 销量{{item.goodsVos[0].saleNum}}
|
|
|
+ <view class="right" v-if="item.salesCount">
|
|
|
+ 销量{{item.salesCount}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -94,30 +100,35 @@
|
|
|
<!-- <image class="ad" :src="item.advertsImg" mode="widthFix"></image> -->
|
|
|
</template>
|
|
|
<view v-else @click="goGoodsDetail(item)">
|
|
|
- <zs-img :src="item.goodsVos[0].goodsImg" width="344rpx" height="344rpx" mode=""></zs-img>
|
|
|
+ <zs-img :src="item.cover[0]" width="344rpx" height="344rpx" mode=""></zs-img>
|
|
|
<view class="info">
|
|
|
<view class="title">
|
|
|
- {{item.goodsVos[0].goodsName}}
|
|
|
+ <view class="tag">
|
|
|
+ 今日特惠
|
|
|
+ </view>
|
|
|
+ <view class="text">
|
|
|
+ {{item.title}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="discount-tag">
|
|
|
+ <!-- {{(item.salePrice/item.originalPrice)*10}} -->
|
|
|
+ 4.5折
|
|
|
</view>
|
|
|
<!-- <view class="desc">
|
|
|
{{item.goodsVos[0].goodsDescribe}}
|
|
|
</view> -->
|
|
|
<view class="price-box">
|
|
|
<view class="left">
|
|
|
- <!-- <view class="unit">
|
|
|
- ¥
|
|
|
- </view> -->
|
|
|
- <view class="price">
|
|
|
- ¥{{item.goodsVos[0].realPrice}}
|
|
|
+ <view class="price" v-if="item.salePrice">
|
|
|
+ ¥{{item.salePrice}}
|
|
|
</view>
|
|
|
- <view class="old-price">
|
|
|
- ¥{{item.goodsVos[0].marketPrice}}
|
|
|
+ <view class="old-price" v-if="item.originalPrice">
|
|
|
+ ¥{{item.originalPrice}}
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
|
|
|
- <view class="right">
|
|
|
- 销量{{item.goodsVos[0].saleNum}}
|
|
|
+ <view class="right" v-if="item.salesCount">
|
|
|
+ 销量{{item.salesCount}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -139,7 +150,8 @@
|
|
|
import {
|
|
|
getUserDetail,
|
|
|
getMenu,
|
|
|
- getAdv
|
|
|
+ getAdv,
|
|
|
+ homeSearch
|
|
|
} from '@/api/common.js'
|
|
|
import { search } from '@/api/shop.js';
|
|
|
// 腾讯地图
|
|
@@ -165,12 +177,20 @@
|
|
|
list1: [],
|
|
|
copyList1: [],
|
|
|
query:{
|
|
|
- queryName:'',
|
|
|
- 'location.lat':0,
|
|
|
- 'location.lon':0,
|
|
|
- pageCurrent:1,
|
|
|
- pageSize:100
|
|
|
- },
|
|
|
+ distance:100000000,
|
|
|
+ latitude:0,
|
|
|
+ longitude:0,
|
|
|
+ regionCode:'520101',
|
|
|
+ page:0,
|
|
|
+ size:10
|
|
|
+ }
|
|
|
+ // query:{
|
|
|
+ // queryName:'',
|
|
|
+ // 'location.lat':0,
|
|
|
+ // 'location.lon':0,
|
|
|
+ // pageCurrent:1,
|
|
|
+ // pageSize:100
|
|
|
+ // },
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -220,8 +240,10 @@
|
|
|
type: 'gcj02',
|
|
|
success: (res) => {
|
|
|
// 解析地址
|
|
|
- that.query['location.lat'] = res.latitude
|
|
|
- that.query['location.lon'] = res.longitude
|
|
|
+ that.query.latitude = res.latitude
|
|
|
+ that.query.longitude = res.longitude
|
|
|
+ // that.query['location.lat'] = res.latitude
|
|
|
+ // that.query['location.lon'] = res.longitude
|
|
|
// 存储经纬度
|
|
|
uni.setStorageSync('location',JSON.stringify({latitude:res.latitude,longitude:res.longitude}))
|
|
|
qqmapsdk.reverseGeocoder({
|
|
@@ -279,13 +301,76 @@
|
|
|
})
|
|
|
},
|
|
|
goGoodsDetail(item) {
|
|
|
- uni.setStorageSync('shopInfo', JSON.stringify(item))
|
|
|
+ // uni.setStorageSync('shopInfo', JSON.stringify(item))
|
|
|
+ console.log(item.productType);
|
|
|
+ let url = ''
|
|
|
+ if (item.productType === 'Web') {
|
|
|
+ console.log('链接');
|
|
|
+ } else if (item.productType === 'Recharge') {
|
|
|
+ url = '/detail/virtualGoods/index'
|
|
|
+ console.log('充值类');
|
|
|
+ } else if (item.productType === 'Scenic') {
|
|
|
+ url = '/scenic/detail'
|
|
|
+ console.log('景区');
|
|
|
+ } else if (item.productType === 'ScenicTicket') {
|
|
|
+ console.log('景区门票');
|
|
|
+ } else if (item.productType === 'StudyTour') {
|
|
|
+ url = '/detail/virtualGoods/index'
|
|
|
+ console.log('StudyTour');
|
|
|
+ } else if (item.productType === 'Hotel') {
|
|
|
+ url = '/hotel/hotelDetail'
|
|
|
+ console.log('酒店');
|
|
|
+ } else if (item.productType === 'HotelRoom') {
|
|
|
+ url = '/hotel/hotelDetail'
|
|
|
+ console.log('酒店房型');
|
|
|
+ } else if (item.productType === 'Cinema') {
|
|
|
+ url = '/movie/movieList'
|
|
|
+ console.log('电影院');
|
|
|
+ } else if (item.productType === 'MovieTicket') {
|
|
|
+ url = '/movie/movieDetail'
|
|
|
+ console.log('电影票');
|
|
|
+ } else if (item.productType === 'Restaurant') {
|
|
|
+ url = '/detail/virtualGoods/index'
|
|
|
+ console.log('餐厅');
|
|
|
+ } else if (item.productType === 'RestaurantFood') {
|
|
|
+ url = '/detail/discountsDetail/index'
|
|
|
+ console.log('餐厅美食');
|
|
|
+ } else if (item.productType === 'CarMaintain') {
|
|
|
+ url = '/detail/discountsDetail/index'
|
|
|
+ console.log('汽车保养门店');
|
|
|
+ } else if (item.productType === 'CarMaintainGoods') {
|
|
|
+ url = '/detail/detail/discountsDetail/index/index'
|
|
|
+ console.log('汽车保养商品');
|
|
|
+ } else if (item.productType === 'CarMaintainService') {
|
|
|
+ url = '/detail/detail/discountsDetail/index/index'
|
|
|
+ console.log('汽车保养服务');
|
|
|
+ } else if (item.productType === 'Shop') {
|
|
|
+ url = '/detail/shopDetail/shopDetail'
|
|
|
+ console.log('店铺');
|
|
|
+ } else if (item.productType === 'ShopGoods') {
|
|
|
+ url = '/detail/goodsDetail/index'
|
|
|
+ console.log('店铺商品');
|
|
|
+ } else if (item.productType === 'ShopService') {
|
|
|
+ url = '/detail/goodsDetail/index'
|
|
|
+ console.log('店铺服务');
|
|
|
+ } else if (item.productType === 'Coupon') {
|
|
|
+ url = '/detail/goodsDetail/index'
|
|
|
+ console.log('优惠券');
|
|
|
+ }
|
|
|
+ else if (item.productType === 'PetrolStation') {
|
|
|
+ url = '/refuel/refuelDetail'
|
|
|
+ console.log('加油站');
|
|
|
+ }
|
|
|
+
|
|
|
+ else {
|
|
|
+ // 处理未知或未定义的产品类型
|
|
|
+ console.log('未知产品类型');
|
|
|
+ }
|
|
|
uni.navigateTo({
|
|
|
- url: `../../detail/goodsDetail/index?id=${item.goodsVos[0].goodsId}`
|
|
|
+ // url: `../../detail/goodsDetail/index?id=${item.goodsVos[0].goodsId}`
|
|
|
+ url: `${url}?id=${item.pid}&epId=${item.id}`
|
|
|
})
|
|
|
- // uni.reLaunch({
|
|
|
- // url: `/signUp/index?id=${item.goodsVos[0].goodsId}`
|
|
|
- // })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
// 更多套餐
|
|
@@ -303,21 +388,24 @@
|
|
|
})
|
|
|
},
|
|
|
loadMore() {
|
|
|
- if(this.query['location.lat']&&this.query['location.lon']){
|
|
|
+ // if(this.query['location.lat']&&this.query['location.lon']){
|
|
|
+ if(this.query.latitude&&this.query.longitude){
|
|
|
this.search()
|
|
|
}
|
|
|
},
|
|
|
search() {
|
|
|
if(this.status == 'noMore' || this.status == 'loading') return
|
|
|
- console.log('加载数据',this.status,this.list,this.list1,this.query.pageCurrent);
|
|
|
this.status = 'loading'
|
|
|
- search(this.query).then(res=>{
|
|
|
+ homeSearch(this.query).then(res=>{
|
|
|
if(res.state == 'Success'){
|
|
|
this.loading = false
|
|
|
let list = []
|
|
|
let list1 = []
|
|
|
- let data = res.content.records
|
|
|
+ let data = res.content.content
|
|
|
data.map((item,index)=>{
|
|
|
+ if(item.productType == 'Cinema'){
|
|
|
+ delete item.meta
|
|
|
+ }
|
|
|
if(index%2 == 0){
|
|
|
list.push(item)
|
|
|
}else{
|
|
@@ -331,11 +419,11 @@
|
|
|
|
|
|
this.list = JSON.parse(JSON.stringify(this.copyList))
|
|
|
this.list1 = JSON.parse(JSON.stringify(this.copyList1))
|
|
|
- if(this.query.pageCurrent == res.content.pages){
|
|
|
+ if(this.query.page == res.content.totalPages){
|
|
|
this.status = 'noMore'
|
|
|
}else{
|
|
|
this.status = 'more'
|
|
|
- this.query.pageCurrent++
|
|
|
+ this.query.page++
|
|
|
}
|
|
|
if(!this.advList1.length){
|
|
|
this.getGoodsAdv().then(()=>{
|
|
@@ -668,18 +756,28 @@
|
|
|
.info{
|
|
|
flex: 1;
|
|
|
padding: 16rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
position: relative;
|
|
|
.title{
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: bold;
|
|
|
- width: 100%;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
margin-top: 10rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .tag{
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ background: $uni-color-primary;
|
|
|
+ padding: 2rpx 10rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ }
|
|
|
+ .text{
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ flex: 1;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.desc{
|
|
@@ -695,7 +793,16 @@
|
|
|
-webkit-box-orient: vertical;
|
|
|
margin-top: 12rpx;
|
|
|
}
|
|
|
-
|
|
|
+ .discount-tag{
|
|
|
+ display: inline-block;
|
|
|
+ padding: 0 10rpx;
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #EE4320;
|
|
|
+ line-height: 28rpx;
|
|
|
+ background: #FFF6F5;
|
|
|
+ border-radius: 8rpx 8rpx 8rpx 8rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ }
|
|
|
.price-box{
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|