增加新功能

This commit is contained in:
hejiangming
2025-03-23 20:36:06 +08:00
parent 2ae62b59ed
commit 78270eeda0
184 changed files with 2690 additions and 1496 deletions
+36 -64
View File
@@ -16,25 +16,26 @@
<view class="msg">好物优选</view>
</view>
<view class="preference_product">
<view class="product_item" v-for="item in productList">
<up-loading-page :loading="productListLoading"></up-loading-page>
<view class="product_item" v-for="(item,index) in productList" :key="index" @click="jumpInfo(item)">
<view class="product_item_left">
<up-image :src="item.url" width="100" height="100" bgColor="#f1f6ff00"></up-image>
<view class="product_item_left_bz product_item_left_bz_img" v-if="item.type === 1">
<view class="product_item_left_bz product_item_left_bz_img">
<view>爆款专区</view>
</view>
</view>
<view class="product_item_right">
<view class="title_warp">{{item.name}}</view>
<view class="title_warp">{{item.title}}</view>
<view class="price_warp">
<view class="price_o_warp">
<view class="price_o_title_warp">原价</view>
<view class="price_o_value_warp">
<text>¥</text>
<text>{{item.oPrice}}</text>
<text>{{item.adPrice}}</text>
</view>
</view>
<view class="price_zq_warp">
<view class="price_lj_warp">专区立省{{item.zqPrice}}元</view>
<view class="price_lj_warp">专区立省{{item.adPrice - item.price}}元</view>
<view class="price_ds_warp">到手¥<text style="font-size: 31rpx;">{{item.price}}</text></view>
</view>
</view>
@@ -46,73 +47,22 @@
</template>
<script>
import { searchList } from '@/api/product.js';
import { SEARCH_TYPE } from '@/utils/enumUtils.js';
export default {
data() {
return {
swiperList:[
'/static/home/banner03.png',
],
productList:[
{
id:1,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:1,// 1:爆款区的 0:普通区
},{
id:2,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:0,
},{
id:3,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:0,
},{
id:4,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:1,
},{
id:5,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:0,
},{
id:6,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:0,
},{
id:7,
name:"Michael Kors I Jodie 老花狗牙托特包手提单肩包-小号...",
url:"/static/common/product_def.png",
zqPrice:42.84,// 专区价格
price:424.84,// 到手价格
oPrice:466.84,// 原价价格
type:0,
},
]
productList:[],
productListLoading:false,
}
},
onLoad() {
this.getSearchList();
},
methods: {
jumpHome(){
uni.switchTab({
@@ -125,6 +75,28 @@
url: '/pages/invite_friends/invite_friends',
})
},
async getSearchList(){
this.productListLoading = true;
const params = {
type:SEARCH_TYPE.SOMETHING,
page:1,
pageSize:99,
}
const resp = await searchList(params);
if(resp && resp.bizcode === 100){
this.productList = resp.data;
}
this.productListLoading = false;
},
/**
* 跳转到商品详情
* @param {Object} item
*/
jumpInfo(item){
uni.navigateTo({
url: '/pages/productInfo/productInfo?id='+item.id,
})
}
}
}
</script>