增加新功能

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
+46 -99
View File
@@ -1,100 +1,20 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_product = require("../../api/product.js");
const utils_enumUtils = require("../../utils/enumUtils.js");
const _sfc_main = {
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() {
common_vendor.index.switchTab({
@@ -106,18 +26,42 @@ const _sfc_main = {
common_vendor.index.navigateTo({
url: "/pages/invite_friends/invite_friends"
});
},
async getSearchList() {
this.productListLoading = true;
const params = {
type: utils_enumUtils.SEARCH_TYPE.SOMETHING,
page: 1,
pageSize: 99
};
const resp = await api_product.searchList(params);
if (resp && resp.bizcode === 100) {
this.productList = resp.data;
}
this.productListLoading = false;
},
/**
* 跳转到商品详情
* @param {Object} item
*/
jumpInfo(item) {
common_vendor.index.navigateTo({
url: "/pages/productInfo/productInfo?id=" + item.id
});
}
}
};
if (!Array) {
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
const _easycom_up_swiper2 = common_vendor.resolveComponent("up-swiper");
(_easycom_up_image2 + _easycom_up_swiper2)();
const _easycom_up_loading_page2 = common_vendor.resolveComponent("up-loading-page");
(_easycom_up_image2 + _easycom_up_swiper2 + _easycom_up_loading_page2)();
}
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
const _easycom_up_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
const _easycom_up_loading_page = () => "../../uni_modules/uview-plus/components/u-loading-page/u-loading-page.js";
if (!Math) {
(_easycom_up_image + _easycom_up_swiper)();
(_easycom_up_image + _easycom_up_swiper + _easycom_up_loading_page)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
@@ -145,22 +89,25 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
height: "20",
bgColor: "#f1f6ff00"
}),
g: common_vendor.f($data.productList, (item, k0, i0) => {
return common_vendor.e({
a: "7539d408-4-" + i0,
g: common_vendor.p({
loading: $data.productListLoading
}),
h: common_vendor.f($data.productList, (item, index, i0) => {
return {
a: "7539d408-5-" + i0,
b: common_vendor.p({
src: item.url,
width: "100",
height: "100",
bgColor: "#f1f6ff00"
}),
c: item.type === 1
}, item.type === 1 ? {} : {}, {
d: common_vendor.t(item.name),
e: common_vendor.t(item.oPrice),
f: common_vendor.t(item.zqPrice),
g: common_vendor.t(item.price)
});
c: common_vendor.t(item.title),
d: common_vendor.t(item.adPrice),
e: common_vendor.t(item.adPrice - item.price),
f: common_vendor.t(item.price),
g: index,
h: common_vendor.o(($event) => $options.jumpInfo(item), index)
};
})
};
}
@@ -2,6 +2,7 @@
"navigationStyle": "custom",
"usingComponents": {
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
"up-swiper": "../../uni_modules/uview-plus/components/u-swiper/u-swiper"
"up-swiper": "../../uni_modules/uview-plus/components/u-swiper/u-swiper",
"up-loading-page": "../../uni_modules/uview-plus/components/u-loading-page/u-loading-page"
}
}
@@ -1 +1 @@
<view class="preference_warp data-v-7539d408"><view class="header_comm data-v-7539d408"><up-image wx:if="{{b}}" class="data-v-7539d408" bindclick="{{a}}" u-i="7539d408-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="data-v-7539d408">好物优选专区</view><up-image wx:if="{{d}}" class="data-v-7539d408" bindclick="{{c}}" u-i="7539d408-1" bind:__l="__l" u-p="{{d}}"></up-image></view><view class="preference_content_warp data-v-7539d408"><up-swiper wx:if="{{e}}" class="data-v-7539d408" u-i="7539d408-2" bind:__l="__l" u-p="{{e}}"></up-swiper><view class="preference_title data-v-7539d408"><up-image wx:if="{{f}}" class="data-v-7539d408" u-i="7539d408-3" bind:__l="__l" u-p="{{f}}"></up-image><view class="msg data-v-7539d408">好物优选</view></view><view class="preference_product data-v-7539d408"><view wx:for="{{g}}" wx:for-item="item" class="product_item data-v-7539d408"><view class="product_item_left data-v-7539d408"><up-image wx:if="{{item.b}}" class="data-v-7539d408" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></up-image><view wx:if="{{item.c}}" class="product_item_left_bz product_item_left_bz_img data-v-7539d408"><view class="data-v-7539d408">爆款专区</view></view></view><view class="product_item_right data-v-7539d408"><view class="title_warp data-v-7539d408">{{item.d}}</view><view class="price_warp data-v-7539d408"><view class="price_o_warp data-v-7539d408"><view class="price_o_title_warp data-v-7539d408">原价</view><view class="price_o_value_warp data-v-7539d408"><text class="data-v-7539d408">¥</text><text class="data-v-7539d408">{{item.e}}</text></view></view><view class="price_zq_warp data-v-7539d408"><view class="price_lj_warp data-v-7539d408">专区立省{{item.f}}元</view><view class="price_ds_warp data-v-7539d408">到手¥<text class="data-v-7539d408" style="font-size:31rpx">{{item.g}}</text></view></view></view></view></view></view></view></view>
<view class="preference_warp data-v-7539d408"><view class="header_comm data-v-7539d408"><up-image wx:if="{{b}}" class="data-v-7539d408" bindclick="{{a}}" u-i="7539d408-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="data-v-7539d408">好物优选专区</view><up-image wx:if="{{d}}" class="data-v-7539d408" bindclick="{{c}}" u-i="7539d408-1" bind:__l="__l" u-p="{{d}}"></up-image></view><view class="preference_content_warp data-v-7539d408"><up-swiper wx:if="{{e}}" class="data-v-7539d408" u-i="7539d408-2" bind:__l="__l" u-p="{{e}}"></up-swiper><view class="preference_title data-v-7539d408"><up-image wx:if="{{f}}" class="data-v-7539d408" u-i="7539d408-3" bind:__l="__l" u-p="{{f}}"></up-image><view class="msg data-v-7539d408">好物优选</view></view><view class="preference_product data-v-7539d408"><up-loading-page wx:if="{{g}}" class="data-v-7539d408" u-i="7539d408-4" bind:__l="__l" u-p="{{g}}"></up-loading-page><view wx:for="{{h}}" wx:for-item="item" wx:key="g" class="product_item data-v-7539d408" bindtap="{{item.h}}"><view class="product_item_left data-v-7539d408"><up-image wx:if="{{item.b}}" class="data-v-7539d408" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></up-image><view class="product_item_left_bz product_item_left_bz_img data-v-7539d408"><view class="data-v-7539d408">爆款专区</view></view></view><view class="product_item_right data-v-7539d408"><view class="title_warp data-v-7539d408">{{item.c}}</view><view class="price_warp data-v-7539d408"><view class="price_o_warp data-v-7539d408"><view class="price_o_title_warp data-v-7539d408">原价</view><view class="price_o_value_warp data-v-7539d408"><text class="data-v-7539d408">¥</text><text class="data-v-7539d408">{{item.d}}</text></view></view><view class="price_zq_warp data-v-7539d408"><view class="price_lj_warp data-v-7539d408">专区立省{{item.e}}元</view><view class="price_ds_warp data-v-7539d408">到手¥<text class="data-v-7539d408" style="font-size:31rpx">{{item.f}}</text></view></view></view></view></view></view></view></view>