增加新功能

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
+58 -69
View File
@@ -1,5 +1,7 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_product = require("../../api/product.js");
const utils_enumUtils = require("../../utils/enumUtils.js");
const choiceness = () => "../../components/choiceness/choiceness.js";
const _sfc_main = {
components: { choiceness },
@@ -75,26 +77,10 @@ const _sfc_main = {
}
],
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,
@@ -120,9 +106,15 @@ const _sfc_main = {
url: "/static/common/product_def.png",
price: 99
}
]
],
// 热门
productLoading: false
};
},
mounted() {
this.querySearchList(utils_enumUtils.SEARCH_TYPE.SOMETHING);
this.querySearchList(utils_enumUtils.SEARCH_TYPE.EXPLOSIVE);
},
methods: {
jumpTurntable() {
common_vendor.index.navigateTo({
@@ -143,22 +135,44 @@ const _sfc_main = {
common_vendor.index.navigateTo({
url: "/pages/search/search"
});
},
/**
* 查询商品列表
*/
async querySearchList(type) {
this.productLoading = true;
const params = {
type,
page: 1,
pageSize: 3
};
const resp = await api_product.searchList(params);
if (resp && resp.bizcode === 100) {
if (type === utils_enumUtils.SEARCH_TYPE.SOMETHING) {
this.yxProduct = resp.data;
} else if (type === utils_enumUtils.SEARCH_TYPE.EXPLOSIVE) {
this.faddishProduct = resp.data;
}
}
this.productLoading = false;
}
}
};
if (!Array) {
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
const _easycom_up_swiper2 = common_vendor.resolveComponent("up-swiper");
const _easycom_up_loading_icon2 = common_vendor.resolveComponent("up-loading-icon");
const _easycom_choiceness2 = common_vendor.resolveComponent("choiceness");
const _easycom_up_action_sheet2 = common_vendor.resolveComponent("up-action-sheet");
(_easycom_up_image2 + _easycom_up_swiper2 + _easycom_choiceness2 + _easycom_up_action_sheet2)();
(_easycom_up_image2 + _easycom_up_swiper2 + _easycom_up_loading_icon2 + _easycom_choiceness2 + _easycom_up_action_sheet2)();
}
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_icon = () => "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon.js";
const _easycom_choiceness = () => "../../components/choiceness/choiceness.js";
const _easycom_up_action_sheet = () => "../../uni_modules/uview-plus/components/u-action-sheet/u-action-sheet.js";
if (!Math) {
(_easycom_up_image + _easycom_up_swiper + _easycom_choiceness + _easycom_up_action_sheet)();
(_easycom_up_image + _easycom_up_swiper + _easycom_up_loading_icon + _easycom_choiceness + _easycom_up_action_sheet)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
@@ -217,9 +231,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
bgColor: "#f1f6ff00"
}),
n: common_vendor.o((...args) => $options.jumpPrdference && $options.jumpPrdference(...args)),
o: common_vendor.f($data.yxProduct, (item, k0, i0) => {
o: common_vendor.p({
show: $data.productLoading
}),
p: common_vendor.f($data.yxProduct, (item, k0, i0) => {
return {
a: "07e72d3c-7-" + i0,
a: "07e72d3c-8-" + i0,
b: common_vendor.p({
src: item.url,
width: "100%",
@@ -228,20 +245,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
shape: "square",
radius: "16"
}),
c: common_vendor.t(item.name),
d: item.id
c: common_vendor.t(item.title),
d: common_vendor.t(item.price),
e: item.id
};
}),
p: common_vendor.p({
q: common_vendor.p({
src: "/static/common/right_y_st2.png",
width: "12",
height: "12",
bgColor: "#f1f6ff00"
}),
q: common_vendor.o((...args) => $options.jumpWelcome && $options.jumpWelcome(...args)),
r: common_vendor.f($data.yxProduct, (item, k0, i0) => {
r: common_vendor.o((...args) => $options.jumpWelcome && $options.jumpWelcome(...args)),
s: common_vendor.p({
show: $data.productLoading
}),
t: common_vendor.f($data.faddishProduct, (item, k0, i0) => {
return {
a: "07e72d3c-9-" + i0,
a: "07e72d3c-11-" + i0,
b: common_vendor.p({
src: item.url,
width: "100%",
@@ -250,51 +271,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
shape: "square",
radius: "16"
}),
c: common_vendor.t(item.name),
d: item.id
c: common_vendor.t(item.title),
d: common_vendor.t(item.price),
e: item.id
};
}),
s: common_vendor.p({
src: "/static/home/hot.png",
width: "20",
height: "20",
bgColor: "#f1f6ff00"
}),
t: common_vendor.p({
src: "/static/common/right_y_st.png",
width: "12",
height: "12",
bgColor: "#f1f6ff00"
}),
v: common_vendor.f($data.hotList, (item, k0, i0) => {
return {
a: "07e72d3c-12-" + i0,
b: common_vendor.p({
src: item.url,
width: "100%",
height: "100",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.name),
d: "07e72d3c-13-" + i0,
e: common_vendor.t(item.price),
f: item.id
};
}),
w: common_vendor.p({
src: "/static/home/hot_price.png",
width: "12",
height: "12",
bgColor: "#f1f6ff00"
}),
x: common_vendor.p({
v: common_vendor.p({
src: "/static/common/right.png",
width: "16",
height: "16",
bgColor: "#f1f6ff00"
}),
y: common_vendor.o(($event) => $data.languageShow = false),
z: common_vendor.p({
w: common_vendor.o(($event) => $data.languageShow = false),
x: common_vendor.p({
actions: $data.languageList,
show: $data.languageShow,
cancelText: "取消"
+1
View File
@@ -4,6 +4,7 @@
"choiceness": "../../components/choiceness/choiceness",
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
"up-swiper": "../../uni_modules/uview-plus/components/u-swiper/u-swiper",
"up-loading-icon": "../../uni_modules/uview-plus/components/u-loading-icon/u-loading-icon",
"up-action-sheet": "../../uni_modules/uview-plus/components/u-action-sheet/u-action-sheet"
}
}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -129,13 +129,13 @@
padding: 20rpx;
border-radius: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.home_content_warp .product_content .product_item.data-v-07e72d3c {
width: 32%;
border-radius: 16rpx;
position: relative;
margin-right: 20rpx;
}
.home_content_warp .product_content .product_f_item.data-v-07e72d3c {
position: absolute;