增加新功能
This commit is contained in:
+46
-99
@@ -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.EXPLOSIVE,
|
||||
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 {
|
||||
@@ -144,22 +88,25 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
width: "200",
|
||||
height: "20"
|
||||
}),
|
||||
g: common_vendor.f($data.productList, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: "085f0530-4-" + i0,
|
||||
g: common_vendor.p({
|
||||
loading: $data.productListLoading
|
||||
}),
|
||||
h: common_vendor.f($data.productList, (item, index, i0) => {
|
||||
return {
|
||||
a: "085f0530-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),
|
||||
f: common_vendor.t(item.adPrice),
|
||||
g: index,
|
||||
h: common_vendor.o(($event) => $options.jumpInfo(item), index)
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
+2
-1
@@ -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
@@ -1 +1 @@
|
||||
<view class="preference_warp data-v-085f0530"><view class="header_comm data-v-085f0530"><up-image wx:if="{{b}}" class="data-v-085f0530" bindclick="{{a}}" u-i="085f0530-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="data-v-085f0530">爆款专区</view><up-image wx:if="{{d}}" class="data-v-085f0530" bindclick="{{c}}" u-i="085f0530-1" bind:__l="__l" u-p="{{d}}"></up-image></view><view class="preference_content_warp data-v-085f0530"><up-swiper wx:if="{{e}}" class="data-v-085f0530" u-i="085f0530-2" bind:__l="__l" u-p="{{e}}"></up-swiper><view class="preference_title data-v-085f0530"><up-image wx:if="{{f}}" class="data-v-085f0530" u-i="085f0530-3" bind:__l="__l" u-p="{{f}}"></up-image><view class="msg data-v-085f0530">款款都是爆款</view></view><view class="preference_product data-v-085f0530"><view wx:for="{{g}}" wx:for-item="item" class="product_item data-v-085f0530"><view class="product_item_left data-v-085f0530"><up-image wx:if="{{item.b}}" class="data-v-085f0530" 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-085f0530"><view class="data-v-085f0530">爆款专区</view></view></view><view class="product_item_right data-v-085f0530"><view class="title_warp data-v-085f0530">{{item.d}}</view><view class="price_warp data-v-085f0530"><view class="price_o_warp data-v-085f0530"><view class="price_o_title_warp data-v-085f0530">原价</view><view class="price_o_value_warp data-v-085f0530"><text class="data-v-085f0530">¥</text><text class="data-v-085f0530">{{item.e}}</text></view></view><view class="price_zq_warp data-v-085f0530"><view class="price_lj_warp data-v-085f0530">专区立省{{item.f}}元</view><view class="price_ds_warp data-v-085f0530">到手¥<text class="data-v-085f0530" style="font-size:31rpx">{{item.g}}</text></view></view></view></view></view></view></view></view>
|
||||
<view class="preference_warp data-v-085f0530"><view class="header_comm data-v-085f0530"><up-image wx:if="{{b}}" class="data-v-085f0530" bindclick="{{a}}" u-i="085f0530-0" bind:__l="__l" u-p="{{b}}"></up-image><view class="data-v-085f0530">爆款专区</view><up-image wx:if="{{d}}" class="data-v-085f0530" bindclick="{{c}}" u-i="085f0530-1" bind:__l="__l" u-p="{{d}}"></up-image></view><view class="preference_content_warp data-v-085f0530"><up-swiper wx:if="{{e}}" class="data-v-085f0530" u-i="085f0530-2" bind:__l="__l" u-p="{{e}}"></up-swiper><view class="preference_title data-v-085f0530"><up-image wx:if="{{f}}" class="data-v-085f0530" u-i="085f0530-3" bind:__l="__l" u-p="{{f}}"></up-image><view class="msg data-v-085f0530">款款都是爆款</view></view><view class="preference_product data-v-085f0530"><up-loading-page wx:if="{{g}}" class="data-v-085f0530" u-i="085f0530-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-085f0530" bindtap="{{item.h}}"><view class="product_item_left data-v-085f0530"><up-image wx:if="{{item.b}}" class="data-v-085f0530" 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-085f0530"><view class="data-v-085f0530">爆款专区</view></view></view><view class="product_item_right data-v-085f0530"><view class="title_warp data-v-085f0530">{{item.c}}</view><view class="price_warp data-v-085f0530"><view class="price_o_warp data-v-085f0530"><view class="price_o_title_warp data-v-085f0530">原价</view><view class="price_o_value_warp data-v-085f0530"><text class="data-v-085f0530">¥</text><text class="data-v-085f0530">{{item.d}}</text></view></view><view class="price_zq_warp data-v-085f0530"><view class="price_lj_warp data-v-085f0530">专区立省{{item.e}}元</view><view class="price_ds_warp data-v-085f0530">到手¥<text class="data-v-085f0530" style="font-size:31rpx">{{item.f}}</text></view></view></view></view></view></view></view></view>
|
||||
Reference in New Issue
Block a user