增加新功能
This commit is contained in:
+43
-29
@@ -29,7 +29,7 @@
|
||||
</template>
|
||||
</up-swiper>
|
||||
</view>
|
||||
<!-- 分类 -->
|
||||
<!-- banner图 -->
|
||||
<view class="home_sort_warp">
|
||||
<view class="sort_warp">
|
||||
<view v-for="item in sortList" :key="item.id" class="sort_item">
|
||||
@@ -55,16 +55,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="product_content">
|
||||
<up-loading-icon :show="productLoading"></up-loading-icon>
|
||||
<view class="product_item" v-for="item in yxProduct" :key="item.id">
|
||||
<up-image :src="item.url" width="100%" height="100" bgColor="#f1f6ff00" shape="square" radius='16'></up-image>
|
||||
<view class="product_f_item">
|
||||
<view class="product_f_item_name">{{item.name}}</view>
|
||||
<view class="product_f_item_price product_f_item_price_yx">优选价 99元</view>
|
||||
<view class="product_f_item_name">{{item.title}}</view>
|
||||
<view class="product_f_item_price product_f_item_price_yx">优选价 {{item.price}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 哈希优品 福利价-->
|
||||
<!-- 爆款专区-->
|
||||
<view class="product_comm hx_warp">
|
||||
<view class="product_title">
|
||||
<view class="product_title_left">
|
||||
@@ -77,17 +78,18 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="product_content">
|
||||
<view class="product_item" v-for="item in yxProduct" :key="item.id">
|
||||
<up-loading-icon :show="productLoading"></up-loading-icon>
|
||||
<view class="product_item" v-for="item in faddishProduct" :key="item.id">
|
||||
<up-image :src="item.url" width="100%" height="100" bgColor="#f1f6ff00" shape="square" radius='16'></up-image>
|
||||
<view class="product_f_item">
|
||||
<view class="product_f_item_name">{{item.name}}</view>
|
||||
<view class="product_f_item_price product_f_item_price_hx">优选价 99元</view>
|
||||
<view class="product_f_item_name">{{item.title}}</view>
|
||||
<view class="product_f_item_price product_f_item_price_hx">优选价 {{item.price}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 热门榜 -->
|
||||
<view class="hot_warp">
|
||||
<!-- <view class="hot_warp">
|
||||
<view class="hot_title_warp">
|
||||
<view class="title_warp">
|
||||
<text class="title_">热门榜</text>
|
||||
@@ -113,7 +115,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 哈希商学院 -->
|
||||
<view class="business_school_warp">
|
||||
<view>
|
||||
@@ -134,6 +136,8 @@
|
||||
|
||||
<script>
|
||||
import choiceness from '@/components/choiceness/choiceness.vue';
|
||||
import { searchList } from '@/api/product.js';
|
||||
import { SEARCH_TYPE } from '@/utils/enumUtils.js'
|
||||
|
||||
export default {
|
||||
components:{choiceness},
|
||||
@@ -198,24 +202,8 @@
|
||||
},
|
||||
],
|
||||
currentLanguage:{},
|
||||
yxProduct:[
|
||||
{
|
||||
id:1,
|
||||
name:"中文中文中文中文中文",
|
||||
url:"/static/common/product_def.png",
|
||||
price:99,
|
||||
},{
|
||||
id:2,
|
||||
name:"中文中文中文中文",
|
||||
url:"/static/common/product_def.png",
|
||||
price:99,
|
||||
},{
|
||||
id:3,
|
||||
name:"中文中文中文中文中文",
|
||||
url:"/static/common/product_def.png",
|
||||
price:99,
|
||||
},
|
||||
],
|
||||
yxProduct:[],// 好物优选列表
|
||||
faddishProduct:[],// 爆款专区
|
||||
hotList:[
|
||||
{
|
||||
id:1,
|
||||
@@ -238,9 +226,14 @@
|
||||
url:"/static/common/product_def.png",
|
||||
price:99,
|
||||
},
|
||||
]
|
||||
],// 热门
|
||||
productLoading:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.querySearchList(SEARCH_TYPE.SOMETHING);// 好物专区
|
||||
this.querySearchList(SEARCH_TYPE.EXPLOSIVE);// 爆单专区
|
||||
},
|
||||
methods: {
|
||||
jumpTurntable(){
|
||||
uni.navigateTo({
|
||||
@@ -262,6 +255,26 @@
|
||||
url:'/pages/search/search',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
async querySearchList(type){
|
||||
this.productLoading = true;
|
||||
const params = {
|
||||
type,
|
||||
page:1,
|
||||
pageSize:3,
|
||||
}
|
||||
const resp = await searchList(params);
|
||||
if(resp && resp.bizcode === 100){
|
||||
if(type === SEARCH_TYPE.SOMETHING){// 好物优选
|
||||
this.yxProduct = resp.data;
|
||||
}else if(type === SEARCH_TYPE.EXPLOSIVE){// 爆单专区
|
||||
this.faddishProduct = resp.data;
|
||||
}
|
||||
}
|
||||
this.productLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -378,12 +391,13 @@
|
||||
padding: 20rpx;
|
||||
border-radius: 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
align-items: center;
|
||||
.product_item{
|
||||
width: 32%;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.product_f_item{
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user