适配标签插件
parent
3c92d4e136
commit
9eea04a81d
|
|
@ -27,7 +27,7 @@
|
|||
overflow: hidden;
|
||||
}
|
||||
.data-list .item {
|
||||
width: calc(50% - 50rpx);
|
||||
width: calc(50% - 10rpx);
|
||||
}
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
|
|
@ -35,9 +35,9 @@
|
|||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .item image {
|
||||
.data-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 300rpx !important;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,16 +16,26 @@
|
|||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="30">
|
||||
<view v-if="data_list.length > 0" class="data-list padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main bg-white margin-bottom-main oh">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item border-radius-main bg-white padding-bottom-sm margin-bottom-main oh pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + item.id" hover-class="none">
|
||||
<image :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base margin-top tl">
|
||||
<image class="goods-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base padding-horizontal-main margin-top-sm">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price margin-top">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(plugins_label_data || null) != null && plugins_label_data.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((plugins_label_data.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(plugins_label_data.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in plugins_label_data.data" :key="li">
|
||||
<navigator v-if="lv.goods_ids.indexOf(item.id) != -1" :url="lv.url" hover-class="none" class="fl">
|
||||
<view v-if="(plugins_label_data.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="'background-color:'+ lv.bg_color+' !important;'">{{lv.name}}</view>
|
||||
<image v-else class="dis-block fl" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
|
|
@ -185,7 +195,9 @@
|
|||
screening_price_list: {height: "82rpx", default: "82rpx", form_key: "screening_price_values"},
|
||||
goods_params_list: {height: "82rpx", default: "82rpx", form_key: "goods_params_values"},
|
||||
goods_spec_list: {height: "82rpx", default: "82rpx", form_key: "goods_spec_values"}
|
||||
}
|
||||
},
|
||||
// 标签插件
|
||||
plugins_label_data: null
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -269,7 +281,7 @@
|
|||
// 获取数据
|
||||
init() {
|
||||
// 获取数据
|
||||
this.get_data_list();
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 搜索
|
||||
|
|
@ -279,6 +291,55 @@
|
|||
data_page: 1
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
get_data() {
|
||||
uni.showLoading({
|
||||
title: "加载中...",
|
||||
mask: true
|
||||
});
|
||||
var post_data = this.request_map_handle();
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "search"),
|
||||
method: "POST",
|
||||
data: post_data,
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
search_map_info: data.search_map_info || [],
|
||||
search_map_list: {
|
||||
brand_list: data.brand_list || [],
|
||||
category_list: data.category_list || [],
|
||||
screening_price_list: data.screening_price_list || [],
|
||||
goods_params_list: data.goods_params_list || [],
|
||||
goods_spec_list: data.goods_spec_list || []
|
||||
},
|
||||
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data
|
||||
});
|
||||
|
||||
// 获取数据列表
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2
|
||||
});
|
||||
app.globalData.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
|
|
@ -298,7 +359,7 @@
|
|||
});
|
||||
var post_data = this.request_map_handle();
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "search"),
|
||||
url: app.globalData.get_request_url("datalist", "search"),
|
||||
method: "POST",
|
||||
data: post_data,
|
||||
dataType: "json",
|
||||
|
|
@ -306,22 +367,7 @@
|
|||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
// 仅首次请求赋值条件数据
|
||||
if (this.data_list_loding_status == 1) {
|
||||
this.setData({
|
||||
search_map_info: data.search_map_info || [],
|
||||
search_map_list: {
|
||||
brand_list: data.brand_list || [],
|
||||
category_list: data.category_list || [],
|
||||
screening_price_list: data.screening_price_list || [],
|
||||
goods_params_list: data.goods_params_list || [],
|
||||
goods_spec_list: data.goods_spec_list || []
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 列表数据处理
|
||||
var data = res.data.data;
|
||||
if (data.data.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
.search-content-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
z-index: 2;
|
||||
padding-top: 25px;
|
||||
padding-bottom: 20rpx;
|
||||
width: 100%;
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
.floor-list .goods-list .goods:nth-of-type(2n) {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.floor-list .goods-list .goods image {
|
||||
.floor-list .goods-list .goods .goods-img {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
.seckill .goods-list swiper {
|
||||
height: 425rpx !important;
|
||||
}
|
||||
.seckill .goods-list .item image {
|
||||
.seckill .goods-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 240rpx;
|
||||
}
|
||||
|
|
@ -108,4 +108,13 @@
|
|||
}
|
||||
.plugins-salerecords .item-content:nth-child(2) {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签 - 秒杀单独修改样式
|
||||
*/
|
||||
.seckill .plugins-label-bottom-left,
|
||||
.seckill .plugins-label-bottom-center,
|
||||
.seckill .plugins-label-bottom-right {
|
||||
bottom: calc(100% - 240rpx);
|
||||
}
|
||||
|
|
@ -44,16 +44,26 @@
|
|||
<swiper :vertical="false" :autoplay="(plugins_seckill_data.base || null) != null && (plugins_seckill_data.base.is_home_auto_play || 0) == 1" :circular="true" :display-multiple-items="plugins_seckill_data.goods.length < 3 ? plugins_seckill_data.goods.length : 3" interval="3000">
|
||||
<block v-for="(item, index) in plugins_seckill_data.goods" :key="index">
|
||||
<swiper-item class="padding-right-main">
|
||||
<view class="item bg-white border-radius-main oh pr ht-auto">
|
||||
<view class="item bg-white border-radius-main oh pr ht-auto">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + item.goods_id" hover-class="none">
|
||||
<image class="dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left padding-right">
|
||||
<image class="goods-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left padding-right margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price single-text">{{currency_symbol}}{{item.min_price}}</view>
|
||||
<view v-if="(item.min_original_price || null) != null && item.min_original_price > 0" class="original-price single-text">{{currency_symbol}}{{item.min_original_price}}</view>
|
||||
<uni-icons type="cart" size="16" color="#E02020" class="icon pa"></uni-icons>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(plugins_label_data || null) != null && plugins_label_data.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((plugins_label_data.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(plugins_label_data.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in plugins_label_data.data" :key="li">
|
||||
<navigator v-if="lv.goods_ids.indexOf(item.goods_id) != -1" :url="lv.url" hover-class="none" class="fl">
|
||||
<view v-if="(plugins_label_data.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="'background-color:'+ lv.bg_color+' !important;'">{{lv.name}}</view>
|
||||
<image v-else class="dis-block fl" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
|
|
@ -79,14 +89,24 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
<view class="goods-list margin-top-lg">
|
||||
<view v-for="(goods, index2) in floor.goods_list" :key="index2" class="goods bg-white border-radius-main oh">
|
||||
<view v-for="(goods, index2) in floor.goods_list" :key="index2" class="goods bg-white border-radius-main oh pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + goods.id" hover-class="none">
|
||||
<image :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left-lg padding-right-lg">
|
||||
<image class="goods-img dis-block" :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{goods.title}}</view>
|
||||
<view class="sales-price">{{currency_symbol}}{{goods.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(plugins_label_data || null) != null && plugins_label_data.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((plugins_label_data.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(plugins_label_data.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in plugins_label_data.data" :key="li">
|
||||
<navigator v-if="lv.goods_ids.indexOf(goods.id) != -1" :url="lv.url" hover-class="none" class="fl">
|
||||
<view v-if="(plugins_label_data.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="'background-color:'+ lv.bg_color+' !important;'">{{lv.name}}</view>
|
||||
<image v-else class="dis-block fl" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -118,14 +138,24 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="floor.goods.length > 0" class="goods-list margin-top-lg">
|
||||
<view v-for="(goods, index2) in floor.goods" :key="index2" class="goods bg-white border-radius-main oh">
|
||||
<view v-for="(goods, index2) in floor.goods" :key="index2" class="goods bg-white border-radius-main oh pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + goods.id" hover-class="none">
|
||||
<image :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left-lg padding-right-lg">
|
||||
<image class="goods-img dis-block" :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{goods.title}}</view>
|
||||
<view class="sales-price">{{currency_symbol}}{{goods.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(plugins_label_data || null) != null && plugins_label_data.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((plugins_label_data.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(plugins_label_data.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in plugins_label_data.data" :key="li">
|
||||
<navigator v-if="lv.goods_ids.indexOf(goods.id) != -1" :url="lv.url" hover-class="none" class="fl">
|
||||
<view v-if="(plugins_label_data.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="'background-color:'+ lv.bg_color+' !important;'">{{lv.name}}</view>
|
||||
<image v-else class="dis-block fl" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -151,14 +181,24 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
<view class="goods-list margin-top-lg">
|
||||
<view v-for="(goods, index2) in floor.goods_list" :key="index2" class="goods bg-white border-radius-main oh">
|
||||
<view v-for="(goods, index2) in floor.goods_list" :key="index2" class="goods bg-white border-radius-main oh pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="'/pages/goods-detail/goods-detail?goods_id=' + goods.id" hover-class="none">
|
||||
<image :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-left-lg padding-right-lg">
|
||||
<image class="goods-img dis-block" :src="goods.images" mode="aspectFit"></image>
|
||||
<view class="goods-base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{goods.title}}</view>
|
||||
<view class="sales-price">{{currency_symbol}}{{goods.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(plugins_label_data || null) != null && plugins_label_data.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((plugins_label_data.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(plugins_label_data.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in plugins_label_data.data" :key="li">
|
||||
<navigator v-if="lv.goods_ids.indexOf(goods.id) != -1" :url="lv.url" hover-class="none" class="fl">
|
||||
<view v-if="(plugins_label_data.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="'background-color:'+ lv.bg_color+' !important;'">{{lv.name}}</view>
|
||||
<image v-else class="dis-block fl" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -272,7 +312,9 @@
|
|||
// 购买记录插件
|
||||
plugins_salerecords_data: null,
|
||||
// 活动插件
|
||||
plugins_activity_data: null
|
||||
plugins_activity_data: null,
|
||||
// 标签插件
|
||||
plugins_label_data: null
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -376,7 +418,8 @@
|
|||
plugins_seckill_data: data.plugins_seckill_data || null,
|
||||
plugins_seckill_is_valid: (data.plugins_seckill_data || null) != null && (data.plugins_seckill_data.is_valid || 0) == 1 ? 1 : 0,
|
||||
plugins_salerecords_data: (data.plugins_salerecords_data || null) == null || data.plugins_salerecords_data.length <= 0 ? null : data.plugins_salerecords_data,
|
||||
plugins_activity_data: (data.plugins_activity_data || null) == null || data.plugins_activity_data.length <= 0 ? null : data.plugins_activity_data
|
||||
plugins_activity_data: (data.plugins_activity_data || null) == null || data.plugins_activity_data.length <= 0 ? null : data.plugins_activity_data,
|
||||
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data
|
||||
});
|
||||
|
||||
// 导航购物车处理
|
||||
|
|
|
|||
Loading…
Reference in New Issue