新增商品列表组件、多商户首页数据优化
parent
a0e1540729
commit
1084b42d8b
2
App.vue
2
App.vue
|
|
@ -45,7 +45,7 @@
|
|||
"/pages/user/user"
|
||||
],
|
||||
// 请求地址
|
||||
request_url: 'https://d1.shopxo.vip/',
|
||||
request_url: 'http://shopxo.com/',
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
|
||||
static_url: 'https://d1.shopxo.vip/',
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
|
|
|
|||
|
|
@ -785,4 +785,43 @@ button[disabled].bg-gray {
|
|||
*/
|
||||
.last-next-data navigator {
|
||||
width: calc(100% - 120rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表 - 列表
|
||||
*/
|
||||
.goods-data-list .goods-img {
|
||||
width: 190rpx !important;
|
||||
height: 190rpx !important;
|
||||
}
|
||||
.goods-data-list .base {
|
||||
width: calc(100% - 220rpx);
|
||||
}
|
||||
/*
|
||||
* 商品列表 - 滚动
|
||||
*/
|
||||
.goods-data-rolling-list swiper {
|
||||
height: 390rpx !important;
|
||||
}
|
||||
.goods-data-rolling-list .item .goods-img {
|
||||
height: 240rpx !important;
|
||||
}
|
||||
/**
|
||||
* 商品列表 - 九方格
|
||||
*/
|
||||
.goods-data-grid-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
float: left;
|
||||
padding-bottom: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.goods-data-grid-list .item:nth-of-type(2n + 1) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.goods-data-grid-list .item:nth-of-type(2n) {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.goods-data-grid-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
|
@ -126,14 +126,17 @@
|
|||
.plugins-label-bottom-right {
|
||||
right: 0;
|
||||
}
|
||||
.plugins-activity-rolling-list .plugins-label-bottom-left,
|
||||
.plugins-activity-rolling-list .plugins-label-bottom-center,
|
||||
.plugins-activity-rolling-list .plugins-label-bottom-right {
|
||||
bottom: calc(100% - 240rpx);
|
||||
/**
|
||||
* 商品列表标签处理
|
||||
*/
|
||||
.goods-data-rolling-list .plugins-label-bottom-left,
|
||||
.goods-data-rolling-list .plugins-label-bottom-center,
|
||||
.goods-data-rolling-list .plugins-label-bottom-right {
|
||||
bottom: calc(100% - 240rpx) !;
|
||||
}
|
||||
.plugins-activity-list .plugins-label-bottom-left,
|
||||
.plugins-activity-list .plugins-label-bottom-center,
|
||||
.plugins-activity-list .plugins-label-bottom-right {
|
||||
.goods-data-list .plugins-label-bottom-left,
|
||||
.goods-data-list .plugins-label-bottom-center,
|
||||
.goods-data-list .plugins-label-bottom-right {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
|
|
@ -192,45 +195,6 @@
|
|||
height: 230rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动配置 - 列表
|
||||
*/
|
||||
.plugins-activity-list .activity-img {
|
||||
width: 190rpx !important;
|
||||
height: 190rpx !important;
|
||||
}
|
||||
.plugins-activity-list .base {
|
||||
width: calc(100% - 220rpx);
|
||||
}
|
||||
/*
|
||||
* 活动配置 - 滚动
|
||||
*/
|
||||
.plugins-activity-rolling-list swiper {
|
||||
height: 390rpx !important;
|
||||
}
|
||||
.plugins-activity-rolling-list .item .activity-img {
|
||||
height: 240rpx !important;
|
||||
}
|
||||
/**
|
||||
* 活动配置 - 九方格
|
||||
*/
|
||||
.plugins-activity-grid-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
float: left;
|
||||
padding-bottom: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.plugins-activity-grid-list .item:nth-of-type(2n + 1) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.plugins-activity-grid-list .item:nth-of-type(2n) {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.plugins-activity-grid-list .item .activity-img {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店 - 数据列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,113 +3,23 @@
|
|||
<view v-if="(propConfig || null) != null && (propData || null) != null && propData.length > 0">
|
||||
<block v-for="(floor, index) in propData" :key="index">
|
||||
<block v-if="floor.goods_list.length > 0 && floor.home_data_location == propLocation">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="text-wrapper" :style="'color:'+(floor.color || '#333')+';'">{{floor.title}}</text>
|
||||
<text v-if="(floor.vice_title || null) != null" class="vice-name margin-left-lg cr-gray">{{floor.vice_title}}</text>
|
||||
<navigator :url="floor.url" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
|
||||
</view>
|
||||
<view class="wh-auto oh pr">
|
||||
<view v-if="floor.keywords_arr.length > 0" class="word-list scroll-view-horizontal margin-bottom-lg">
|
||||
<scroll-view scroll-x>
|
||||
<block v-for="(kv, ki) in floor.keywords_arr" :key="ki">
|
||||
<navigator v-if="(kv || null) != null" :url="'/pages/goods-search/goods-search?keywords=' + kv" hover-class="none" class="word-icon dis-inline-block bg-main-light text-size-xs cr-main round padding-top-xs padding-bottom-xs padding-left padding-right">{{kv}}</navigator>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<block v-if="floor.goods_list.length > 0">
|
||||
<!-- 默认图文 -->
|
||||
<block v-if="(floor.style_type || 0) == 0">
|
||||
<view class="plugins-activity-list">
|
||||
<view v-for="(item, index) in floor.goods_list" :key="index" class="item oh padding-main border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="activity-img fl radius" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base fr">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view v-if="(item.simple_desc || null) != null" class="cr-grey single-text margin-top-sm">{{item.simple_desc}}</view>
|
||||
<view class="sales-price margin-top-sm">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 九方格 -->
|
||||
<block v-else-if="floor.style_type == 1">
|
||||
<view class="plugins-activity-grid-list">
|
||||
<view v-for="(item, index) in floor.goods_list" :key="index" class="item oh border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="activity-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 滚动 -->
|
||||
<block v-else-if="floor.style_type == 2">
|
||||
<view class="plugins-activity-rolling-list scroll-view-horizontal border-radius-main oh spacing-mb">
|
||||
<swiper :vertical="false" :autoplay="(propConfig.is_home_auto_play || 0) == 1" :circular="false" :display-multiple-items="floor.goods_list.length < 3 ? floor.goods_list.length : 3" interval="3000">
|
||||
<block v-for="(item, index) in floor.goods_list" :key="index">
|
||||
<swiper-item class="padding-right-main">
|
||||
<view class="item bg-white border-radius-main oh pr ht-auto pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="activity-img dis-block wh-auto" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm margin-top-sm">
|
||||
<view class="multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<component-goods-list :propData="floor" propMoreUrlKey="url" :propLabel="propLabel" :propIsAutoPlay="(propConfig.is_home_auto_play || 0) == 1" :propCurrencySymbol="propCurrencySymbol"></component-goods-list>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
const app = getApp();
|
||||
import componentGoodsList from "../goods-list/goods-list";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
components: {},
|
||||
components: {
|
||||
componentGoodsList
|
||||
},
|
||||
props: {
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
|
|
@ -132,12 +42,7 @@
|
|||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,144 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(propData || null) != null && (propData.goods_list || null) != null && propData.goods_list.length > 0">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="text-wrapper" :style="'color:'+(propData.color || '#333')+';'">{{propData.title}}</text>
|
||||
<text v-if="(propData.vice_title || null) != null" class="vice-name margin-left-lg cr-gray">{{propData.vice_title}}</text>
|
||||
<navigator v-if="(propData[propMoreUrlKey] || null) != null" :url="propData[propMoreUrlKey]" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
|
||||
</view>
|
||||
<view class="wh-auto oh pr">
|
||||
<view v-if="propData.keywords_arr.length > 0" class="word-list scroll-view-horizontal margin-bottom-lg">
|
||||
<scroll-view scroll-x>
|
||||
<block v-for="(kv, ki) in propData.keywords_arr" :key="ki">
|
||||
<navigator v-if="(kv || null) != null" :url="propKeywordsUrl + kv" hover-class="none" class="word-icon dis-inline-block bg-main-light text-size-xs cr-main round padding-top-xs padding-bottom-xs padding-left padding-right">{{kv}}</navigator>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<block v-if="propData.goods_list.length > 0">
|
||||
<!-- 默认图文 -->
|
||||
<block v-if="(propData.style_type || 0) == 0">
|
||||
<view class="goods-data-list">
|
||||
<view v-for="(item, index) in propData.goods_list" :key="index" class="item oh padding-main border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="goods-img fl radius" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base fr">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view v-if="(item.simple_desc || null) != null" class="cr-grey single-text margin-top-sm">{{item.simple_desc}}</view>
|
||||
<view class="sales-price margin-top-sm">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 九方格 -->
|
||||
<block v-else-if="propData.style_type == 1">
|
||||
<view class="goods-data-grid-list">
|
||||
<view v-for="(item, index) in propData.goods_list" :key="index" class="item oh border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="goods-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 滚动 -->
|
||||
<block v-else-if="propData.style_type == 2">
|
||||
<view class="goods-data-rolling-list scroll-view-horizontal border-radius-main oh spacing-mb">
|
||||
<swiper :vertical="false" :autoplay="propIsAutoPlay" :circular="false" :display-multiple-items="propData.goods_list.length < 3 ? propData.goods_list.length : 3" interval="3000">
|
||||
<block v-for="(item, index) in propData.goods_list" :key="index">
|
||||
<swiper-item class="padding-right-main">
|
||||
<view class="item bg-white border-radius-main oh pr ht-auto pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="goods-img dis-block wh-auto" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="padding-left-sm padding-right-sm margin-top-sm">
|
||||
<view class="multi-text margin-bottom-sm">{{item.title}}</view>
|
||||
<view class="sales-price">{{propCurrencySymbol}}{{item.min_price}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 标签插件 -->
|
||||
<view v-if="(propLabel || null) != null && propLabel.data.length > 0" :class="'plugins-label oh pa plugins-label-'+((propLabel.base.is_user_goods_label_icon || 0) == 0 ? 'text' : 'img')+' plugins-label-'+(propLabel.base.user_goods_show_style || 'top-left')">
|
||||
<block v-for="(lv,li) in propLabel.data" :key="li">
|
||||
<view v-if="lv.goods_ids.indexOf(item.id) != -1" class="lv dis-inline-block va-m" :data-value="((propLabel.base.is_user_goods_label_url || 0) == 1) ? (lv.url || '') : ''" @tap="url_event">
|
||||
<view v-if="(propLabel.base.is_user_goods_label_icon || 0) == 0" class="round cr-white bg-main text-size-xs fl" :style="((lv.bg_color || null) != null ? 'background-color:'+ lv.bg_color+' !important;' : '')+((lv.text_color || null) != null ? 'color:'+ lv.text_color+' !important;' : '')">{{lv.name}}</view>
|
||||
<image v-else class="dis-block" :src="lv.icon" mode="scaleToFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
components: {},
|
||||
props: {
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
default: app.globalData.data.currency_symbol
|
||||
},
|
||||
propData: {
|
||||
type: [Array,Object],
|
||||
default: []
|
||||
},
|
||||
propMoreUrlKey: {
|
||||
type: String,
|
||||
default: 'url'
|
||||
},
|
||||
propKeywordsUrl: {
|
||||
type: String,
|
||||
default: '/pages/goods-search/goods-search?keywords='
|
||||
},
|
||||
propIsAutoPlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
propLabel: {
|
||||
type: [Array,Object,String],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -61,14 +61,13 @@
|
|||
"desc" : "你的位置将用于小程序中相应业务位置服务使用"
|
||||
}
|
||||
},
|
||||
"plugins" : {
|
||||
// // 直播(需要开通权限 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/live-player-plugin.html)
|
||||
// "live-player-plugin" : {
|
||||
// "version" : "1.3.0",
|
||||
// "provider" : "wx2b03c6e691cd7370"
|
||||
// }
|
||||
}
|
||||
"plugins" : {}
|
||||
},
|
||||
// // 直播(需要开通权限 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/live-player-plugin.html)
|
||||
// "live-player-plugin" : {
|
||||
// "version" : "1.3.0",
|
||||
// "provider" : "wx2b03c6e691cd7370"
|
||||
// }
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true,
|
||||
"appid" : "2021001173639600"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(data || null) != null" class="pr">
|
||||
<view v-if="(shop || null) != null" class="pr">
|
||||
<!-- 搜索 -->
|
||||
<view class="search padding-main bg-white pr oh br-b">
|
||||
<input class="bg-white fl padding-left-xxl text-size-xs round border-color-main" type="done" placeholder="请输入您搜索的商品关键字" :value="search_keywords_value || ''" placeholder-class="cr-grey" @input="search_keywords_event">
|
||||
<view class="search-btn pa">
|
||||
<button class="bg-main br-main cr-white round text-size-xs" type="default" size="mini" hover-class="none" @tap="search_button_event" :data-value="'/pages/plugins/shop/search/search?shop_id=' + shop.id + '&'">搜本店</button>
|
||||
<button class="bg-main br-main cr-white round text-size-xs" type="default" size="mini" hover-class="none" @tap="search_button_event" :data-value="'/pages/plugins/shop/search/search?shop_id='+shop.id+'&'">搜本店</button>
|
||||
<button class="bg-main-pair br-main-pair cr-white round text-size-xs" type="default" size="mini" hover-class="none" @tap="search_button_event" data-value="/pages/goods-search/goods-search?">搜全站</button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -102,35 +102,17 @@
|
|||
</block>
|
||||
<!-- 自动模式 -->
|
||||
<block v-else>
|
||||
<view class="shop-category-list scroll-view-horizontal">
|
||||
<scroll-view scroll-x>
|
||||
<view :class="'item dis-inline-block cr-base padding-horizontal-main padding-top-xs padding-bottom-xs round cp ' + ((shop_category_tab_value == 0) ? 'bg-main cr-white' : '')" @tap="shop_category_tab_event" data-value="0">全部</view>
|
||||
<block v-if="shop_goods_category.length > 0">
|
||||
<block v-for="(item, index) in shop_goods_category" :key="index">
|
||||
<view :class="'item dis-inline-block cr-base padding-horizontal-main padding-top-xs padding-bottom-xs round cp ' + ((shop_category_tab_value == item.id) ? 'bg-main cr-white' : '')" @tap="shop_category_tab_event" :data-value="item.id">{{item.name}}</view>
|
||||
</block>
|
||||
<view class="data-list padding-horizontal-main oh">
|
||||
<!-- 轮播 -->
|
||||
<view v-if="slider.length > 0" class="margin-top-main">
|
||||
<component-banner :propData="slider"></component-banner>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<block v-if="data.length > 0">
|
||||
<block v-for="(item, index) in data" :key="index">
|
||||
<component-goods-list :propData="item" propMoreUrlKey="more_url" :propKeywordsUrl="'/pages/plugins/shop/search/search?shop_id='+shop.id+'&keywords='" :propIsAutoPlay="true" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="data-list padding-horizontal-main oh">
|
||||
<block v-if="goods_list.length > 0">
|
||||
<block v-for="(item, index) in goods_list" :key="index">
|
||||
<view v-if="item.active != 0" class="item padding-bottom-sm border-radius-main bg-white margin-bottom-main oh">
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="goods-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="base padding-horizontal-main margin-top">
|
||||
<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>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
|
|
@ -148,7 +130,9 @@
|
|||
const app = getApp();
|
||||
import componentLayout from "../../../../components/layout/layout";
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
import componentBanner from "../../../../components/slider/slider";
|
||||
import componentGoodsList from "../../../../components/goods-list/goods-list";
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
export default {
|
||||
|
|
@ -166,12 +150,11 @@
|
|||
shop_favor_user: [],
|
||||
shop_navigation: [],
|
||||
shop_goods_category: [],
|
||||
data: null,
|
||||
goods_list: [],
|
||||
slider: [],
|
||||
data: [],
|
||||
search_keywords_value: '',
|
||||
header_service_status: false,
|
||||
nav_category_status: false,
|
||||
shop_category_tab_value: 0,
|
||||
shop_favor_info: {
|
||||
"text": "收藏",
|
||||
"status": 0,
|
||||
|
|
@ -185,7 +168,9 @@
|
|||
components: {
|
||||
componentLayout,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
componentBottomLine,
|
||||
componentBanner,
|
||||
componentGoodsList
|
||||
},
|
||||
props: {},
|
||||
|
||||
|
|
@ -235,23 +220,18 @@
|
|||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
shop: ((data.shop || null) == null) ? null : data.shop,
|
||||
shop: data.shop || null,
|
||||
shop_favor_user: data.shop_favor_user || [],
|
||||
shop_navigation: data.shop_navigation || [],
|
||||
shop_goods_category: data.shop_goods_category || [],
|
||||
data: data.data || null,
|
||||
goods_list: (data.data || null) != null && (data.data.goods || null) != null && data.data.goods.length > 0 ? data.data.goods : [],
|
||||
data: data.data || [],
|
||||
slider: data.slider || [],
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
|
||||
if ((this.shop || null) != null) {
|
||||
// 自动模式数据、商品列表切换处理
|
||||
if ((this.shop.data_model || 0) == 0) {
|
||||
this.shop_category_tab_handle();
|
||||
}
|
||||
|
||||
// 收藏信息
|
||||
var status = this.shop_favor_user.indexOf(this.shop.id) != -1 ? 1 : 0;
|
||||
this.setData({
|
||||
|
|
@ -401,32 +381,6 @@
|
|||
app.globalData.image_show_event(e);
|
||||
},
|
||||
|
||||
// 分类切换事件
|
||||
shop_category_tab_event(e) {
|
||||
this.setData({
|
||||
shop_category_tab_value: e.currentTarget.dataset.value || 0
|
||||
});
|
||||
this.shop_category_tab_handle();
|
||||
},
|
||||
|
||||
// 分类切换处理
|
||||
shop_category_tab_handle() {
|
||||
var value = this.shop_category_tab_value || 0;
|
||||
var temp = this.data;
|
||||
var goods = [];
|
||||
if (temp.goods.length > 0) {
|
||||
for (var i in temp.goods) {
|
||||
if (temp.goods[i]['shop_category_id'] == value || value == 0) {
|
||||
goods.push(temp.goods[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
goods_list: goods,
|
||||
data_bottom_line_status: goods.length > 0
|
||||
});
|
||||
},
|
||||
|
||||
// 进入客服系统
|
||||
chat_event() {
|
||||
app.globalData.chat_entry_handle(this.shop.chat_info.chat_url);
|
||||
|
|
|
|||
Loading…
Reference in New Issue