增加新功能

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)
};
})
};
}