1积分+店铺
parent
b72599466b
commit
41eb15084c
7
App.vue
7
App.vue
|
|
@ -1198,7 +1198,7 @@
|
|||
return this.data.static_url + 'static/plugins/images/' + type + '/';
|
||||
} else {
|
||||
// 根据配置的静态url地址+主题标识+参数类型组合远程静态文件地址
|
||||
return this.data.static_url + 'static/app/' + this.data.default_theme + '/' + type + '/';
|
||||
return this.data.static_url + 'static/app/' + this.get_theme_value() + '/' + type + '/';
|
||||
}
|
||||
},
|
||||
// rpx转px
|
||||
|
|
@ -1726,12 +1726,13 @@
|
|||
// 蓝色 blue #1677ff
|
||||
// 棕色 brown #8B4513
|
||||
// 紫色 purple #623cec
|
||||
var default_theme = 'brown';
|
||||
var default_theme = 'blue';
|
||||
return uni.getStorageSync('theme') || default_theme;
|
||||
},
|
||||
// 设置主题
|
||||
set_theme_value() {
|
||||
let theme = this.get_theme_value();
|
||||
console.log(theme);
|
||||
// import `@/common/theme/theme-${mode}.scss`; //记住不能import哦
|
||||
require(`./common/css/theme/${theme}.css`);
|
||||
},
|
||||
|
|
@ -1793,6 +1794,8 @@
|
|||
// 协议验证处理
|
||||
this.globalData.weixin_privacy_setting();
|
||||
// #endif
|
||||
// 主题设置
|
||||
this.globalData.set_theme_value();
|
||||
},
|
||||
// 从前台进入后台
|
||||
onHide() {
|
||||
|
|
|
|||
|
|
@ -977,11 +977,6 @@ button[disabled].bg-gray {
|
|||
right: 8rpx;
|
||||
}
|
||||
|
||||
.goods-list .right-cart-icon {
|
||||
bottom: 8rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.goods-list .error-msg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
@ -1044,7 +1039,7 @@ button[disabled].bg-gray {
|
|||
.goods-data-grid-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
float: left;
|
||||
padding-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,320 +1,370 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="plugins-goods" :class="data.style_type == 2 ? 'bg-white border-radius-main padding-main spacing-mb' : ''"
|
||||
v-if="(data || null) != null && (data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<view v-if="(data.title || null) != null || (data.vice_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text v-if="(data.title || null) != null" class="text-wrapper" :class="data.style_type == 2 ? '' : 'title-left-border'"
|
||||
:style="'color:'+(data.color || '#333')+';'">{{data.title}}</text>
|
||||
<text v-if="(data.vice_title || null) != null" class="vice-name margin-left-sm cr-grey-9">{{data.vice_title}}</text>
|
||||
</view>
|
||||
<navigator v-if="(data[propMoreUrlKey] || null) != null" :url="data[propMoreUrlKey]" hover-class="none" class="arrow-right padding-right cr-grey">更多</navigator>
|
||||
</view>
|
||||
<view class="wh-auto oh pr goods-list">
|
||||
<!-- 默认图文 -->
|
||||
<block v-if="(data.style_type || 0) == 0">
|
||||
<view class="goods-data-list">
|
||||
<view v-for="(item, index) in data.goods_list" :key="index" class="item oh padding-main border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img fl radius" :src="item.images" mode="aspectFit"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius">{{item.error_msg}}</view>
|
||||
<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 text-size-sm">{{item.simple_desc}}</view>
|
||||
<view class="base-bottom pa">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="pa bg-white right-cart-icon" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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="data.style_type == 1">
|
||||
<view class="goods-data-grid-list">
|
||||
<view v-for="(item, index) in data.goods_list" :key="index" class="item oh border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img dis-block wh-auto" :src="item.images" mode="scaleToFill"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius wh-auto">{{item.error_msg}}</view>
|
||||
<view class="base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text">{{item.title}}</view>
|
||||
<view class="margin-top-sm">
|
||||
<view class="fl">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="pa bg-white right-cart-icon" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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>
|
||||
<!-- 滚动 -->
|
||||
<view v-else-if="data.style_type == 2" class="rolling-horizontal border-radius-main oh">
|
||||
<view class="goods-data-rolling-list scroll-view-horizontal">
|
||||
<swiper class="swiper" :vertical="false" :autoplay="propIsAutoPlay" :circular="false"
|
||||
:display-multiple-items="((data.multiple_items || null) == null) ? (data.goods_list.length < 3 ? data.goods_list.length : 3) : (data.goods_list.length < data.multiple_items ? data.goods_list.length : data.multiple_items)"
|
||||
interval="30000000">
|
||||
<block v-for="(item, index) in data.goods_list" :key="index">
|
||||
<swiper-item>
|
||||
<view class="item bg-white border-radius-main margin-right-main oh pr ht-auto pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img dis-block wh-auto" :src="item.images" mode="aspectFit"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius wh-auto">{{item.error_msg}}</view>
|
||||
<view class="padding-left-sm padding-right-sm margin-top-sm">
|
||||
<view class="single-text text-size-xs ">{{item.title}}</view>
|
||||
<view class="margin-top-xs">
|
||||
<view class="fl">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="pa bg-white right-cart-icon" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy v-if="is_show_cart" ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 购物车抛物线 -->
|
||||
<component-cart-para-curve v-if="is_show_cart" ref="cart_para_curve"></component-cart-para-curve>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentBadge from "../../components/badge/badge";
|
||||
import componentGoodsBuy from "../../components/goods-buy/goods-buy";
|
||||
import componentCartParaCurve from '../../components/cart-para-curve/cart-para-curve';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data: null,
|
||||
is_show_cart: false,
|
||||
themeColor: app.globalData.get_theme_color(),
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentBadge,
|
||||
componentGoodsBuy,
|
||||
componentCartParaCurve
|
||||
},
|
||||
props: {
|
||||
// 价格符号
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
default: app.globalData.data.currency_symbol
|
||||
},
|
||||
// 列表数据
|
||||
propData: {
|
||||
type: [Array, Object],
|
||||
default: []
|
||||
},
|
||||
// 更多url地址
|
||||
propMoreUrlKey: {
|
||||
type: String,
|
||||
default: 'url'
|
||||
},
|
||||
// 关键字url地址
|
||||
propKeywordsUrl: {
|
||||
type: String,
|
||||
default: '/pages/goods-search/goods-search?keywords='
|
||||
},
|
||||
// 滚动自动播放
|
||||
propIsAutoPlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 标签数据
|
||||
propLabel: {
|
||||
type: [Array, Object, String],
|
||||
default: null
|
||||
},
|
||||
// 展示加购抛物线
|
||||
propIsCartParaCurve: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 展示价格icon图标
|
||||
propIsShowPriceIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 展示价格字段
|
||||
propPriceField: {
|
||||
type: String,
|
||||
default: 'min_price'
|
||||
},
|
||||
// 来源
|
||||
propSource: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
// 属性值改变监听
|
||||
watch: {
|
||||
// 数据
|
||||
propData(value, old_value) {
|
||||
this.setData({
|
||||
data: value
|
||||
});
|
||||
}
|
||||
},
|
||||
// 页面被展示
|
||||
created: function() {
|
||||
var is_app_mourning = app.globalData.is_app_mourning();
|
||||
var is_show_cart = (app.globalData.data.is_goods_list_show_cart_opt == 1) ? (is_app_mourning && this.propSource == 'index' ? false : true) : false;
|
||||
this.setData({
|
||||
data: this.propData,
|
||||
is_show_cart: is_show_cart
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 加入购物车
|
||||
goods_cart_event(e) {
|
||||
if ((this.$refs.goods_buy || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.propData.goods_list[index];
|
||||
// 开启购物车抛物线效果则展示提示操作
|
||||
var is_success_tips = this.propIsCartParaCurve ? 0 : 1;
|
||||
this.$refs.goods_buy.init(goods, {
|
||||
buy_event_type: 'cart',
|
||||
is_direct_cart: 1,
|
||||
is_success_tips: is_success_tips
|
||||
}, {
|
||||
index: index,
|
||||
pos: e
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
// 增加数量
|
||||
var back = e.back_data;
|
||||
var temp = this.data;
|
||||
var goods = temp['goods_list'][back.index];
|
||||
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
|
||||
if (goods['user_cart_count'] > 99) {
|
||||
goods['user_cart_count'] = '99+';
|
||||
}
|
||||
temp['goods_list'][back.index] = goods;
|
||||
this.setData({
|
||||
data: temp
|
||||
});
|
||||
|
||||
// 抛物线
|
||||
if (this.propIsCartParaCurve && (this.$refs.cart_para_curve || null) != null) {
|
||||
this.$refs.cart_para_curve.init(null, back.pos, goods.images);
|
||||
}
|
||||
|
||||
// 导航购物车处理
|
||||
var cart_total = e.cart_number || 0;
|
||||
if (cart_total <= 0) {
|
||||
app.globalData.set_tab_bar_badge(2, 0);
|
||||
} else {
|
||||
app.globalData.set_tab_bar_badge(2, 1, cart_total);
|
||||
}
|
||||
|
||||
// 当前页面
|
||||
var page = app.globalData.current_page().split('?');
|
||||
switch (page[0]) {
|
||||
// 商品详情页面
|
||||
case 'pages/goods-detail/goods-detail':
|
||||
// 商品搜索
|
||||
case 'pages/goods-search/goods-search':
|
||||
var res = app.globalData.get_page_object(page[0]);
|
||||
if (res.length > 0) {
|
||||
for (var i in res) {
|
||||
res[i].$vm.goods_cart_count_handle(cart_total);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
<template>
|
||||
<view>
|
||||
<view class="plugins-goods" :class="data.style_type == 2 ? 'bg-white border-radius-main padding-main spacing-mb' : ''"
|
||||
v-if="(data || null) != null && (data.goods_list || null) != null && data.goods_list.length > 0">
|
||||
<view v-if="(data.title || null) != null || (data.vice_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text v-if="(data.title || null) != null" class="text-wrapper" :class="data.style_type == 2 ? '' : 'title-left-border'"
|
||||
:style="'color:'+(data.color || '#333')+';'">{{data.title}}</text>
|
||||
<text v-if="(data.vice_title || null) != null" class="vice-name margin-left-sm cr-grey-9">{{data.vice_title}}</text>
|
||||
</view>
|
||||
<navigator v-if="(data[propMoreUrlKey] || null) != null" :url="data[propMoreUrlKey]" hover-class="none" class="arrow-right padding-right cr-grey">更多</navigator>
|
||||
</view>
|
||||
<view class="wh-auto oh pr goods-list">
|
||||
<!-- 默认图文 -->
|
||||
<block v-if="(data.style_type || 0) == 0">
|
||||
<view class="goods-data-list">
|
||||
<view v-for="(item, index) in data.goods_list" :key="index" class="item oh padding-main border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img fl radius" :src="item.images" mode="aspectFit"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius">{{item.error_msg}}</view>
|
||||
<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 text-size-sm">{{item.simple_desc}}</view>
|
||||
<view class="base-bottom pa">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="pa bg-white right-cart-icon" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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="data.style_type == 1">
|
||||
<view class="goods-data-grid-list">
|
||||
<view v-for="(item, index) in data.goods_list" :key="index" class="item oh border-radius-main bg-white oh pr spacing-mb">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img dis-block wh-auto" :src="item.images" mode="scaleToFill"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius wh-auto">{{item.error_msg}}</view>
|
||||
<view class="base padding-horizontal-main margin-top-sm">
|
||||
<view class="goods-title multi-text">{{item.title}}</view>
|
||||
<view class="margin-top-sm flex-row jc-sb align-c">
|
||||
<view>
|
||||
<block v-if="!propIntegral">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="flex-col">
|
||||
<view class="original-price">
|
||||
<text class="va-m text-size-xsss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="va-m text-size-xs">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view class="cr-main text-size-xs">
|
||||
{{item.integral}}积分
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<block v-if="propIsOpenGridBtnSet">
|
||||
<view :disabled="grid_btn_config.disabled" @tap="url_event"
|
||||
:style="[{'color':grid_btn_config.color},{'background-color':grid_btn_config.bg_color},{'padding':grid_btn_config.padding},{'border-radius':grid_btn_config.border_radius},{'font-size':grid_btn_config.font_size}]">
|
||||
{{grid_btn_config.name}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="bg-white pr" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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>
|
||||
<!-- 滚动 -->
|
||||
<view v-else-if="data.style_type == 2" class="rolling-horizontal border-radius-main oh">
|
||||
<view class="goods-data-rolling-list scroll-view-horizontal">
|
||||
<swiper class="swiper" :vertical="false" :autoplay="propIsAutoPlay" :circular="false"
|
||||
:display-multiple-items="((data.multiple_items || null) == null) ? (data.goods_list.length < 3 ? data.goods_list.length : 3) : (data.goods_list.length < data.multiple_items ? data.goods_list.length : data.multiple_items)"
|
||||
interval="30000000">
|
||||
<block v-for="(item, index) in data.goods_list" :key="index">
|
||||
<swiper-item>
|
||||
<view class="item bg-white border-radius-main margin-right-main oh pr ht-auto pr">
|
||||
<!-- 商品主体内容 -->
|
||||
<view class="cp" :data-value="item.goods_url" @tap="url_event">
|
||||
<image class="goods-img dis-block wh-auto" :src="item.images" mode="aspectFit"></image>
|
||||
<view v-if="(item.is_error || 0) == 1" class="error-msg pa cr-gray tc radius wh-auto">{{item.error_msg}}</view>
|
||||
<view class="padding-left-sm padding-right-sm margin-top-sm">
|
||||
<view class="single-text text-size-xs ">{{item.title}}</view>
|
||||
<view class="margin-top-xs">
|
||||
<view class="fl">
|
||||
<text v-if="propIsShowPriceIcon && (item.price_icon || null) != null"
|
||||
class="bg-red br-red cr-white text-size-xs padding-left-sm padding-right-sm round va-m margin-right-xs">{{item.price_icon}}</text>
|
||||
<text class="sales-price va-m text-size-xss va-b">{{propCurrencySymbol}}</text>
|
||||
<text class="sales-price va-m">{{item[propPriceField]}}</text>
|
||||
</view>
|
||||
<view v-if="(item.is_error || 0) == 0 && is_show_cart" class="pa bg-white right-cart-icon" :data-index="index" @tap.stop="goods_cart_event">
|
||||
<iconfont name="icon-index-smbg-tj" size="40rpx" :color="themeColor"></iconfont>
|
||||
<view class="cart-badge-icon pa">
|
||||
<component-badge :propNumber="item.user_cart_count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签插件 -->
|
||||
<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 || null) != null && 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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy v-if="is_show_cart" ref="goods_buy" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 购物车抛物线 -->
|
||||
<component-cart-para-curve v-if="is_show_cart" ref="cart_para_curve"></component-cart-para-curve>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentBadge from "../../components/badge/badge";
|
||||
import componentGoodsBuy from "../../components/goods-buy/goods-buy";
|
||||
import componentCartParaCurve from '../../components/cart-para-curve/cart-para-curve';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data: null,
|
||||
is_show_cart: false,
|
||||
themeColor: app.globalData.get_theme_color(),
|
||||
grid_btn_config: {
|
||||
bg_color: '#D8D8D8',
|
||||
color: '#fff',
|
||||
name: '暂无货源',
|
||||
disabled: false,
|
||||
border_radius: '24rpx',
|
||||
padding: '6rpx 16rpx',
|
||||
font_size: '24rpx'
|
||||
}
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentBadge,
|
||||
componentGoodsBuy,
|
||||
componentCartParaCurve
|
||||
},
|
||||
props: {
|
||||
// 价格符号
|
||||
propCurrencySymbol: {
|
||||
type: String,
|
||||
default: app.globalData.data.currency_symbol
|
||||
},
|
||||
// 列表数据
|
||||
propData: {
|
||||
type: [Array, Object],
|
||||
default: []
|
||||
},
|
||||
// 更多url地址
|
||||
propMoreUrlKey: {
|
||||
type: String,
|
||||
default: 'url'
|
||||
},
|
||||
// 关键字url地址
|
||||
propKeywordsUrl: {
|
||||
type: String,
|
||||
default: '/pages/goods-search/goods-search?keywords='
|
||||
},
|
||||
// 滚动自动播放
|
||||
propIsAutoPlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 标签数据
|
||||
propLabel: {
|
||||
type: [Array, Object, String],
|
||||
default: null
|
||||
},
|
||||
// 展示加购抛物线
|
||||
propIsCartParaCurve: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 展示价格icon图标
|
||||
propIsShowPriceIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 展示价格字段
|
||||
propPriceField: {
|
||||
type: String,
|
||||
default: 'min_price'
|
||||
},
|
||||
// 来源
|
||||
propSource: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 当开启时以前的按钮将失效
|
||||
propIsOpenGridBtnSet: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 九宫格 按钮样式, ----- 需要和propIsOpenGridBtnSet一起使用
|
||||
propGridBtnConfig: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
// 积分列表时使用参数
|
||||
propIntegral: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
// 属性值改变监听
|
||||
watch: {
|
||||
// 数据
|
||||
propData(value, old_value) {
|
||||
this.setData({
|
||||
data: value
|
||||
});
|
||||
},
|
||||
propIsOpenGridBtnSet(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.setData({
|
||||
grid_btn_config: Object.assign({}, this.grid_btn_config, this.propGridBtnConfig)
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 页面被展示
|
||||
created: function() {
|
||||
var is_app_mourning = app.globalData.is_app_mourning();
|
||||
var is_show_cart = (app.globalData.data.is_goods_list_show_cart_opt == 1) ? (is_app_mourning && this.propSource == 'index' ? false : true) : false;
|
||||
this.setData({
|
||||
data: this.propData,
|
||||
is_show_cart: is_show_cart,
|
||||
grid_btn_config: Object.assign({}, this.grid_btn_config, this.propGridBtnConfig)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 加入购物车
|
||||
goods_cart_event(e) {
|
||||
if ((this.$refs.goods_buy || null) != null) {
|
||||
var index = e.currentTarget.dataset.index || 0;
|
||||
var goods = this.propData.goods_list[index];
|
||||
// 开启购物车抛物线效果则展示提示操作
|
||||
var is_success_tips = this.propIsCartParaCurve ? 0 : 1;
|
||||
this.$refs.goods_buy.init(goods, {
|
||||
buy_event_type: 'cart',
|
||||
is_direct_cart: 1,
|
||||
is_success_tips: is_success_tips
|
||||
}, {
|
||||
index: index,
|
||||
pos: e
|
||||
});
|
||||
}
|
||||
},
|
||||
// 加入购物车成功回调
|
||||
goods_cart_back_event(e) {
|
||||
// 增加数量
|
||||
var back = e.back_data;
|
||||
var temp = this.data;
|
||||
var goods = temp['goods_list'][back.index];
|
||||
goods['user_cart_count'] = parseInt(goods['user_cart_count'] || 0) + parseInt(e.stock);
|
||||
if (goods['user_cart_count'] > 99) {
|
||||
goods['user_cart_count'] = '99+';
|
||||
}
|
||||
temp['goods_list'][back.index] = goods;
|
||||
this.setData({
|
||||
data: temp
|
||||
});
|
||||
// 抛物线
|
||||
if (this.propIsCartParaCurve && (this.$refs.cart_para_curve || null) != null) {
|
||||
this.$refs.cart_para_curve.init(null, back.pos, goods.images);
|
||||
}
|
||||
// 导航购物车处理
|
||||
var cart_total = e.cart_number || 0;
|
||||
if (cart_total <= 0) {
|
||||
app.globalData.set_tab_bar_badge(2, 0);
|
||||
} else {
|
||||
app.globalData.set_tab_bar_badge(2, 1, cart_total);
|
||||
}
|
||||
// 当前页面
|
||||
var page = app.globalData.current_page().split('?');
|
||||
switch (page[0]) {
|
||||
// 商品详情页面
|
||||
case 'pages/goods-detail/goods-detail':
|
||||
// 商品搜索
|
||||
case 'pages/goods-search/goods-search':
|
||||
var res = app.globalData.get_page_object(page[0]);
|
||||
if (res.length > 0) {
|
||||
for (var i in res) {
|
||||
res[i].$vm.goods_cart_count_handle(cart_total);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
|
||||
<view class="title-left">
|
||||
<text class="text-wrapper" :class="propTitleLeftBorder ? 'title-left-border' : ''" :style="'color:' + propTitleColor + ';'">{{propTitle}}</text>
|
||||
<text class="vice-name margin-left-sm" :style="'color:' + propViceTitleColor + ';'">{{propViceTitle}}</text>
|
||||
</view>
|
||||
<navigator :url="propMoreUrl" hover-class="none" class="arrow-right padding-right cr-grey">{{propMore}}</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
propTitle: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
propTitleColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
},
|
||||
propViceTitle: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
propViceTitleColor: {
|
||||
type: String,
|
||||
default: '#999'
|
||||
},
|
||||
propMore: {
|
||||
type: String,
|
||||
default: '更多'
|
||||
},
|
||||
propMoreUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
propTitleLeftBorder: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
|
@ -780,7 +780,6 @@
|
|||
{
|
||||
"path": "detail/detail",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "店铺首页"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,51 +1,68 @@
|
|||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-content {
|
||||
padding-top: 448rpx;
|
||||
}
|
||||
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
padding: 80rpx 0 100rpx 0;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.points-user .avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin: 0 auto;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.points-user .desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user .login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
|
||||
.points-user .share-submit {
|
||||
width: 112rpx;
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
padding: 0;
|
||||
background: #D8D8D8 linear-gradient(93deg, #FF9747 0%, #FF6E01 100%);
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
top: 54rpx;
|
||||
right: 0;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
|
||||
.points-integral {
|
||||
padding: 28rpx 28rpx 0 28rpx;
|
||||
}
|
||||
.points-user .share-submit {
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
|
||||
.points-integral .item .list {
|
||||
border-bottom: 2rpx solid #eee;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.points-integral .item .list:last-of-type {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.data-list .item {
|
||||
width: calc(50% - 10rpx);
|
||||
* 积分规则
|
||||
*/
|
||||
.rule-btn {
|
||||
top: 242rpx;
|
||||
width: 148rpx;
|
||||
height: 52rpx;
|
||||
padding: 0;
|
||||
line-height: 52rpx;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 200rpx 0 0 200rpx;
|
||||
}
|
||||
.data-list .item:nth-child(2n) {
|
||||
float: right;
|
||||
|
||||
.rule {
|
||||
padding: 56rpx 24rpx;
|
||||
max-height: 50vh;
|
||||
}
|
||||
.data-list .item:nth-child(2n+1) {
|
||||
float: left;
|
||||
|
||||
.rule .item {
|
||||
padding-bottom: 100rpx;
|
||||
max-height: calc(50vh - 164rpx);
|
||||
}
|
||||
.data-list .item .goods-img {
|
||||
width: 100%;
|
||||
height: 380rpx !important;
|
||||
|
||||
.rule button {
|
||||
margin: 20rpx 70rpx 42rpx 70rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
|
@ -1,62 +1,99 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="(data_base || null) != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 广告图片 -->
|
||||
<view class="pa top-0 left-0 right-0">
|
||||
<block v-if="(data_base.right_images || null) != null">
|
||||
<!-- <image class="wh-auto advertisement" :src="data_base.right_images" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image> -->
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="wh-auto advertisement" :src="points_static_url + 'integral-bg.png'" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
</block>
|
||||
</view>
|
||||
<view class="padding-horizontal-main points-content">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc pr border-radius-main spacing-mb">
|
||||
<navigator class="points-user-menu-submit round pa" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block v-if="(user || null) == null">
|
||||
<button class="login-submit round bg-white" type="default" size="mini" @tap="login_event">立即登录</button>
|
||||
<view class="desc margin-top-xxl">获知会员积分详情</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="user.avatar || avatar_default" mode="widthFix"></image>
|
||||
<view class="cr-white margin-top-sm">{{user.user_name_view}}</view>
|
||||
<view class="desc margin-top-lg">当前可用 {{user_integral.integral || 0}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 分享 -->
|
||||
<button class="share-submit round pa" type="default" size="mini" open-type="share">分享</button>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<view v-if="(data_base.right_images || null) != null" class="spacing-mb">
|
||||
<image class="wh-auto dis-block border-radius-main" :src="data_base.right_images" mode="widthFix" :data-value="data_base.right_images_url || ''" @tap="url_event"></image>
|
||||
<view class="border-radius-main bg-white pr spacing-mb">
|
||||
<view class="points-user">
|
||||
<view class="flex-row">
|
||||
<block v-if="(user || null) == null">
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="login-submit text-size fw-b" type="default" size="mini" @tap="login_event">立即登录</view>
|
||||
<view class="desc margin-top-sm cr-gray-9">获知会员积分详情</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="avatar dis-block circle" @tap="preview_event" :src="user.avatar || avatar_default" mode="widthFix"></image>
|
||||
<view class="padding-left-main">
|
||||
<view class="text-size fw-b">{{user.user_name_view}}</view>
|
||||
<view class="desc margin-top-sm cr-gray">当前可用
|
||||
<text class="cr-black fw-b padding-horizontal-xs">
|
||||
{{user_integral.integral || 0}}
|
||||
</text>
|
||||
积分
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 分享 -->
|
||||
<button class="share-submit pa tc cr-white" type="default" size="mini" open-type="share">分享</button>
|
||||
</view>
|
||||
<view v-if="(user || null) !== null" class="points-integral br-t-dashed">
|
||||
<component-title prop-title="积分明细" prop-more-url="/pages/user-integral/user-integral"></component-title>
|
||||
<view v-if="integral_list.length>0">
|
||||
<view class="item">
|
||||
<view v-for="(item,index) in integral_list" class="list" :key="index">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9">
|
||||
原始
|
||||
<text class="cr-black fw-b padding-left-sm">{{item.original_integral}}</text>
|
||||
<text class="padding-horizontal-sm">/</text>
|
||||
最新
|
||||
<text class="cr-black fw-b padding-left-sm">{{item.new_integral}}</text>
|
||||
</view>
|
||||
<view class="cr-grey-9">{{item.add_time_time}}</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb align-c margin-top-main">
|
||||
<view>{{item.msg}}</view>
|
||||
<view class="cr-main text-size fw-b" :class="item.type == 1 ? 'cr-green' : 'cr-red'">{{item.type == 1 ? '+' : '-'}} {{item.operation_integral}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" class="spacing-mb">
|
||||
<view class="notice-content">
|
||||
<view v-for="(item, index) in data_base.points_desc" :key="index" class="item">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<button v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" class="rule-btn pa right-0 tc cr-white text-size-md" @tap="quick_open_event">
|
||||
积分规则
|
||||
</button>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view v-if="(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
<navigator url="/pages/goods-search/goods-search" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
|
||||
</view>
|
||||
<view class="data-list oh">
|
||||
<view v-for="(item, index) in data_base.goods_exchange_data" :key="index" class="item padding-bottom-sm border-radius-main bg-white margin-bottom-main">
|
||||
<navigator :url="item.goods_url" hover-class="none">
|
||||
<image class="goods-img dis-block" :src="item.images" mode="aspectFit"></image>
|
||||
<view class="padding-horizontal-main margin-top-sm">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="single-text original-price margin-top-sm">{{currency_symbol}}{{item.price}}</view>
|
||||
<view class="single-text">
|
||||
<text class="sales-price text-size">{{item.integral}}</text>
|
||||
<text class="cr-grey margin-left-xs">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<component-goods-list :propData="{style_type: 1, title:'商品兑换',url:'/pages/goods-search/goods-search', goods_list: data_base.goods_exchange_data}" prop-more-url-key="url"
|
||||
:propCurrencySymbol="currency_symbol" :prop-grid-btn-config="gridBtnConfig" :prop-is-open-grid-btn-set="isOpenGridBtnSet" propPriceField="price"
|
||||
propIntegral></component-goods-list>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
<!-- 积分规则弹窗 -->
|
||||
<component-popup v-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" :propShow="popup_status" :propIsBar="propIsBar" propPosition="bottom"
|
||||
@onclose="quick_close_event">
|
||||
<view class="rule">
|
||||
<view class="cr-black text-size-md fw-b margin-bottom-main tc">积分规则</view>
|
||||
<scroll-view :scroll-y="true" class="item">
|
||||
<view v-for="(item, index) in data_base.points_desc" :key="index" class="cr-grey text-size-md">{{item}}</view>
|
||||
</scroll-view>
|
||||
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_close_event">知道了</button>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
|
|
@ -68,10 +105,14 @@
|
|||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
|
||||
import componentGoodsList from "../../../../components/goods-list/goods-list";
|
||||
import componentPopup from "../../../../components/popup/popup";
|
||||
import componentTitle from "../../../../components/title/title";
|
||||
var points_static_url = app.globalData.get_static_url('points', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
points_static_url: points_static_url,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
|
@ -82,36 +123,54 @@
|
|||
user_integral: null,
|
||||
avatar_default: app.globalData.data.default_user_head_src,
|
||||
// 自定义分享信息
|
||||
share_info: {}
|
||||
share_info: {},
|
||||
// 配置商品列表按钮
|
||||
isOpenGridBtnSet: true,
|
||||
gridBtnConfig: {
|
||||
name: '兑换',
|
||||
bg_color: app.globalData.get_theme_color(),
|
||||
padding: '8rpx 16rpx',
|
||||
border_radius: '8rpx'
|
||||
},
|
||||
// 规则弹窗
|
||||
popup_status: false,
|
||||
propIsBar: false,
|
||||
// 积分
|
||||
integral_list: [],
|
||||
integral_list_loding_status: 1,
|
||||
integral_list_loding_msg: '',
|
||||
integral_page: 1,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
componentBottomLine,
|
||||
componentGoodsList,
|
||||
componentPopup,
|
||||
componentTitle
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
params: params
|
||||
});
|
||||
console.log(app.globalData.get_theme_color());
|
||||
},
|
||||
onShow() {
|
||||
// 用户信息
|
||||
this.setData({
|
||||
user: app.globalData.get_user_cache_info()
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
this.get_integral_data_list();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
|
|
@ -123,7 +182,6 @@
|
|||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
|
|
@ -142,7 +200,6 @@
|
|||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
|
|
@ -153,9 +210,8 @@
|
|||
img: this.data_base.right_images
|
||||
}
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if((this.data_base.application_name || null) != null) {
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name
|
||||
});
|
||||
|
|
@ -168,7 +224,6 @@
|
|||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
|
@ -183,7 +238,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.globalData.get_user_info(this, "login_event");
|
||||
|
|
@ -210,12 +264,10 @@
|
|||
user: user || null
|
||||
});
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.globalData.data.default_user_head_src != this.user.avatar) {
|
||||
|
|
@ -224,7 +276,78 @@
|
|||
urls: [this.user.avatar]
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
get_integral_data_list(is_mandatory) {
|
||||
// 是否加载中
|
||||
if (this.integral_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
integral_is_loading: 1,
|
||||
integral_list_loding_status: 1
|
||||
});
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "userintegral"),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.integral_page
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
if (res.data.data.data.length > 0) {
|
||||
console.log(res.data.data.data);
|
||||
this.setData({
|
||||
integral_list: res.data.data.data.length > 4 ? res.data.data.data.splice(0, 4) : res.data.data.data,
|
||||
integral_list_loding_status: 3,
|
||||
integral_is_loading: 0
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
integral_list_loding_status: 0,
|
||||
integral_is_loading: 0
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
integral_list_loding_status: 0,
|
||||
integral_is_loading: 0
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_integral_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0
|
||||
});
|
||||
app.globalData.showToast('服务器请求出错');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 弹层开启
|
||||
quick_open_event(e) {
|
||||
this.setData({
|
||||
popup_status: true
|
||||
});
|
||||
},
|
||||
// 弹层关闭
|
||||
quick_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
|
||||
.nav_seckill .item .state {
|
||||
margin-top: 4rpx;
|
||||
padding: 0 14rpx;
|
||||
|
|
@ -44,7 +43,7 @@
|
|||
}
|
||||
|
||||
.rule button {
|
||||
margin: 20rpx 30rpx 42rpx 30rpx;
|
||||
margin: 20rpx 70rpx 42rpx 70rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
|
@ -21,16 +21,17 @@
|
|||
:prop-time-background-color="seckill_status === 1 ? '#E22C08': '#333333'"></component-countdown>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-size-xs cr-blak">
|
||||
<view class="text-size-xs cr-blak" @tap="quick_open_event">
|
||||
活动规则
|
||||
<iconfont v-if="(data_base.content_notice || null) != null && data_base.content_notice.length > 0" name="icon-miaosha-hdgz" size="26rpx" class="margin-left-xs pr top-xs"
|
||||
color="#999" @tap="quick_open_event"></iconfont>
|
||||
color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品 -->
|
||||
<view v-if="goods.length > 0">
|
||||
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" propPriceField="seckill_min_price"></component-goods-list>
|
||||
<component-goods-list :propData="{style_type: 1, goods_list: goods}" :propCurrencySymbol="currency_symbol" :prop-grid-btn-config="gridBtnConfig"
|
||||
:prop-is-open-grid-btn-set="isOpenGridBtnSet" propPriceField="seckill_min_price"></component-goods-list>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
|
|
@ -48,7 +49,7 @@
|
|||
<scroll-view :scroll-y="true" class="item">
|
||||
<view v-for="(item, index) in data_base.content_notice" :key="index" class="cr-grey text-size-md">{{item}}</view>
|
||||
</scroll-view>
|
||||
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_open_event">知道了</button>
|
||||
<button type="default" class="bg-main cr-white round text-size-md pa bottom-0 left-0 right-0" @tap="quick_close_event">知道了</button>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
|
|
@ -65,7 +66,6 @@
|
|||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
import componentGoodsList from "../../../../components/goods-list/goods-list";
|
||||
import componentPopup from "../../../../components/popup/popup";
|
||||
|
||||
var seckill_static_url = app.globalData.get_static_url('seckill', true);
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -94,9 +94,14 @@
|
|||
// 抢购状态
|
||||
// status 0未开始, 1进行中(距离结束还有), 2已结束, 3异常错误
|
||||
seckill_status: 0,
|
||||
// 配置商品列表按钮
|
||||
isOpenGridBtnSet: false,
|
||||
gridBtnConfig: {
|
||||
name: '即将开抢',
|
||||
disabled: true,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
|
|
@ -105,22 +110,36 @@
|
|||
componentPopup
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad() {},
|
||||
|
||||
onShow() {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
watch: {
|
||||
seckill_status(val) {
|
||||
if (val === 0) {
|
||||
let newData = {
|
||||
name: '即将开抢'
|
||||
}
|
||||
this.setData({
|
||||
gridBtnConfig: Object.assign({}, gridBtnConfig, newData),
|
||||
});
|
||||
} else if (val === 2) {
|
||||
let newData = {
|
||||
name: '已结束'
|
||||
}
|
||||
this.setData({
|
||||
gridBtnConfig: Object.assign({}, gridBtnConfig, newData),
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
|
|
@ -132,7 +151,6 @@
|
|||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
|
|
@ -160,16 +178,16 @@
|
|||
current: current,
|
||||
time: time,
|
||||
time_first_text: time.time_first_text,
|
||||
seckill_status: time.status,
|
||||
seckill_status: data.periods_list[this.nav_active_index].time.status,
|
||||
isOpenGridBtnSet: data.periods_list[this.nav_active_index].time.status === 1 ? false : true,
|
||||
goods: goods,
|
||||
is_valid: is_valid,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (goods.length > 0)
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data_base.seo_title || this.data_base.application_name,
|
||||
|
|
@ -178,7 +196,6 @@
|
|||
img: ((this.slider || null) != null && this.slider.length > 0) ? this.slider[0]['images_url'] : ''
|
||||
}
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
@ -193,7 +210,6 @@
|
|||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
|
@ -216,18 +232,16 @@
|
|||
nav_active_index: index,
|
||||
time_first_text: time_first_text,
|
||||
seckill_status: seckill_status,
|
||||
goods: this.periods_list[index].goods
|
||||
goods: this.periods_list[index].goods,
|
||||
isOpenGridBtnSet: seckill_status === 1 ? false : true,
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 弹层开启
|
||||
quick_open_event(e) {
|
||||
this.setData({
|
||||
popup_status: true
|
||||
});
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
quick_close_event(e) {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -1,59 +1,55 @@
|
|||
/**
|
||||
* 搜索
|
||||
*/
|
||||
.search input {
|
||||
width: calc(100% - 328rpx);
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
height: 52rpx;
|
||||
line-height: 52rpx;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.header-shop-whole-search input {
|
||||
width: calc(100% - 168rpx);
|
||||
.search {
|
||||
border: 2rpx solid;
|
||||
padding: 2rpx;
|
||||
}
|
||||
.search-btn {
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.search-btn button {
|
||||
width: 150rpx;
|
||||
|
||||
.search button {
|
||||
width: 140rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
padding: 0;
|
||||
height: 57rpx;
|
||||
line-height: 57rpx;
|
||||
}
|
||||
.search-btn button:first-child {
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
background: #ff8c00;
|
||||
border: 1px solid #ff8c00;
|
||||
|
||||
.search input {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
.search-btn button:last-child {
|
||||
background: #483E39;
|
||||
border: 1px solid #483E39;
|
||||
margin-left: 20rpx;
|
||||
|
||||
.search-btn {
|
||||
width: 148rpx;
|
||||
}
|
||||
|
||||
.search-btn button {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部
|
||||
*/
|
||||
.header {
|
||||
padding: 20rpx 10rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
width: 90rpx;
|
||||
}
|
||||
|
||||
.base-bottom image {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
|
||||
.header .base {
|
||||
width: calc(100% - 110rpx);
|
||||
}
|
||||
|
||||
.shop-title {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
|
@ -62,49 +58,56 @@
|
|||
* 导航
|
||||
*/
|
||||
.nav {
|
||||
height: 70rpx;
|
||||
border-width: 0 0 1px 0;
|
||||
border-style: solid;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.nav .nav-scroll {
|
||||
float: right;
|
||||
width: calc(100% - 230rpx);
|
||||
width: calc(100% - 164rpx);
|
||||
}
|
||||
|
||||
.nav .nav-scroll .item {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
}
|
||||
|
||||
.nav .item {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.nav-shop-category {
|
||||
padding-right: 38rpx !important;
|
||||
padding-right: 32rpx !important;
|
||||
background-size: 14px 14px;
|
||||
}
|
||||
.nav .nav-items {
|
||||
width: 380rpx;
|
||||
left: calc(50% - 190rpx);
|
||||
top: 300rpx;
|
||||
z-index: 1;
|
||||
-webkit-box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
box-shadow: 0 10px 10px rgb(0 0 0 / 30%);
|
||||
}
|
||||
|
||||
.nav .nav-items {
|
||||
left: calc(50% - 212rpx);
|
||||
top: 340rpx;
|
||||
z-index: 1;
|
||||
box-shadow: 0 6px 6px rgb(0 0 0 / 10%);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航商品分类
|
||||
*/
|
||||
.nav-category {
|
||||
width: 220rpx;
|
||||
z-index: 1;
|
||||
margin-top: 12rpx;
|
||||
margin-top: 16rpx;
|
||||
box-shadow: 0 6px 6px rgb(0 0 0 / 10%);
|
||||
border-bottom-right-radius: 20rpx;
|
||||
border-width: 0 1px 1px 1px;
|
||||
border-style: solid;
|
||||
border-color: #efefef;
|
||||
}
|
||||
|
||||
.nav-category .category-scroll {
|
||||
max-height: 600rpx;
|
||||
}
|
||||
|
||||
.nav-category .item {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.nav-category .item:not(:last-child) {
|
||||
border-bottom: 1px dashed #f7f7f7;
|
||||
}
|
||||
|
|
@ -115,9 +118,11 @@
|
|||
.shop-category-list .item {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.shop-category-list .item {
|
||||
|
||||
.shop-category-list .item {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.shop-category-list .item:last-child {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
|
@ -2,11 +2,21 @@
|
|||
<view>
|
||||
<view v-if="(shop || null) != null" class="pr">
|
||||
<!-- 搜索 -->
|
||||
<view :class="'padding-main bg-white pr oh br-b search '+(is_shop_search_all_search_button == 1 ? '' : 'header-shop-whole-search')">
|
||||
<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+'&'">{{is_shop_search_all_search_button == 1 ? '搜本店' : '搜索'}}</button>
|
||||
<button v-if="is_shop_search_all_search_button == 1" 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 class="flex-row jc-sb align-c padding-main bg-white pr oh" :class="(is_shop_search_all_search_button == 1 ? '' : 'header-shop-whole-search')">
|
||||
<view class="flex-1 wh-auto">
|
||||
<view class="search flex-row jc-sb align-c round border-color-main bg-white">
|
||||
<view class="flex-row align-c flex-1 wh-auto padding-left-main">
|
||||
<iconfont name="icon-index-search" size="28rpx" color="#ccc"></iconfont>
|
||||
<input class="text-size-md flex-1 wh-auto padding-left-sm" type="done" placeholder="请输入您搜索的商品关键字" :value="search_keywords_value || ''" placeholder-class="cr-grey-c"
|
||||
@input="search_keywords_event">
|
||||
</view>
|
||||
<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+'&'">{{is_shop_search_all_search_button == 1 ? '搜本店' : '搜索'}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-btn padding-left-main flex-row align-c">
|
||||
<button v-if="is_shop_search_all_search_button == 1" 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>
|
||||
<!-- 顶部 -->
|
||||
|
|
@ -15,10 +25,13 @@
|
|||
<view class="base fr item">
|
||||
<view class="shop-title single-text">
|
||||
<!-- 认证信息 -->
|
||||
<view v-if="(data_base.is_enable_auth || 0) == 1 && ((shop.auth_type != -1 && (shop.auth_type_msg || null) != null) || ((shop.bond_status || 0) == 1 && (shop.bond_status_msg || null) != null))" class="auth-icon dis-inline-block">
|
||||
<view
|
||||
v-if="(data_base.is_enable_auth || 0) == 1 && ((shop.auth_type != -1 && (shop.auth_type_msg || null) != null) || ((shop.bond_status || 0) == 1 && (shop.bond_status_msg || null) != null))"
|
||||
class="auth-icon dis-inline-block">
|
||||
<!-- 实名认证 -->
|
||||
<block v-if="shop.auth_type != -1 && (shop.auth_type_msg || null) != null">
|
||||
<image :src="shop.auth_type == 0 ? data_base.shop_auth_personal_icon : data_base.shop_auth_company_icon" class="icon va-m" mode="aspectFill" :data-value="'/pages/plugins/shop/license/license?id='+shop.id" @tap="url_event"></image>
|
||||
<block v-if="shop.auth_type != -1 && (shop.auth_type_msg || null) != null">
|
||||
<image :src="shop.auth_type == 0 ? data_base.shop_auth_personal_icon : data_base.shop_auth_company_icon" class="icon va-m" mode="aspectFill"
|
||||
:data-value="'/pages/plugins/shop/license/license?id='+shop.id" @tap="url_event"></image>
|
||||
</block>
|
||||
<!-- 保证金认证 -->
|
||||
<block v-if="(shop.bond_status || 0) == 1 && (shop.bond_status_msg || null) != null">
|
||||
|
|
@ -28,23 +41,23 @@
|
|||
<!-- 标题 -->
|
||||
<text class="fw-b text-size va-m">{{shop.name}}</text>
|
||||
</view>
|
||||
<view class="base-bottom oh margin-top-sm text-size-xs">
|
||||
<view class="base-bottom oh margin-top-sm text-size-xs">
|
||||
<!-- 在线客服 -->
|
||||
<view v-if="(data_base.is_service_info || 0) == 1" class="fl margin-right-xxl cp" @tap="header_service_event">
|
||||
<image class="va-m margin-right-sm" :src="common_static_url+'customer-service-icon.png'" mode="scaleToFill"></image>
|
||||
<text class="va-m cr-base">在线客服</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 收藏 -->
|
||||
<view class="fl single-text cp" @tap="shop_favor_event">
|
||||
<image class="va-m margin-right-sm" :src="common_static_url+'favor'+(shop_favor_info.status == 1 ? '-active' : '')+'-icon.png'" mode="scaleToFill"></image>
|
||||
<text :class="'va-m ' + (shop_favor_info.status == 1 ? 'cr-main' : '')">{{shop_favor_info.text}}({{shop_favor_info.count}})</text>
|
||||
</view>
|
||||
<!-- 评分 -->
|
||||
<view v-if="(shop.score_data || null) != null" class="fl margin-left-xxl">
|
||||
<view class="dis-inline-block va-m">
|
||||
<uni-rate :value="shop.score_data.value" :readonly="true" :is-fill="false" :size="14" />
|
||||
</view>
|
||||
<text class="va-m cr-red">{{shop.score_data.value}}分</text>
|
||||
</view>
|
||||
<!-- 评分 -->
|
||||
<view v-if="(shop.score_data || null) != null" class="fl margin-left-xxl">
|
||||
<view class="dis-inline-block va-m">
|
||||
<uni-rate :value="shop.score_data.value" :readonly="true" :is-fill="false" :size="14" />
|
||||
</view>
|
||||
<text class="va-m cr-red">{{shop.score_data.value}}分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -68,38 +81,41 @@
|
|||
</view>
|
||||
<view v-if="(shop.open_week_name || null) != null && (shop.close_week_name || null) != null" class="item padding-main br-t single-text">
|
||||
<text>时间:</text>
|
||||
<text class="cp" @tap="text_copy_event" :data-value="shop.open_week_name + '至' + shop.close_week_name + ',' + shop.open_time + '-' + shop.close_time">{{shop.open_week_name}}至{{shop.close_week_name}},{{shop.open_time}}-{{shop.close_time}}</text>
|
||||
</view>
|
||||
<view v-if="(shop.service_weixin_qrcode || null) != null || (shop.service_line_qrcode || null) != null" class="oh qrcode tc br-t padding-top-main">
|
||||
<view v-if="(shop.service_weixin_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
|
||||
<image class="radius cp" :src="shop.service_weixin_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="shop.service_weixin_qrcode"></image>
|
||||
<view>长按微信咨询</view>
|
||||
</view>
|
||||
<view v-if="(shop.service_line_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
|
||||
<image class="radius cp" :src="shop.service_line_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="shop.service_line_qrcode"></image>
|
||||
<view>长按line咨询</view>
|
||||
</view>
|
||||
<text class="cp" @tap="text_copy_event"
|
||||
:data-value="shop.open_week_name + '至' + shop.close_week_name + ',' + shop.open_time + '-' + shop.close_time">{{shop.open_week_name}}至{{shop.close_week_name}},{{shop.open_time}}-{{shop.close_time}}</text>
|
||||
</view>
|
||||
<view v-if="(shop.service_weixin_qrcode || null) != null || (shop.service_line_qrcode || null) != null" class="oh qrcode tc br-t padding-top-main">
|
||||
<view v-if="(shop.service_weixin_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
|
||||
<image class="radius cp" :src="shop.service_weixin_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="shop.service_weixin_qrcode"></image>
|
||||
<view>长按微信咨询</view>
|
||||
</view>
|
||||
<view v-if="(shop.service_line_qrcode || null) != null" class="item padding-bottom-lg dis-inline-block">
|
||||
<image class="radius cp" :src="shop.service_line_qrcode" mode="scaleToFill" @tap="image_show_event" :data-value="shop.service_line_qrcode"></image>
|
||||
<view>长按line咨询</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view v-if="shop_goods_category.length > 0 || shop_navigation.length > 0" class="nav scroll-view-horizontal bg-white padding-top-lg border-color-main">
|
||||
<view v-if="shop_goods_category.length > 0" class="item padding-main arrow-bottom nav-shop-category dis-inline-block fw-b cp" @tap="nav_shop_category_event">查看商品分类</view>
|
||||
<view v-if="shop_goods_category.length > 0 || shop_navigation.length > 0" class="nav scroll-view-horizontal bg-white padding-top-main">
|
||||
<view v-if="shop_goods_category.length > 0" class="item padding-main arrow-bottom nav-shop-category dis-inline-block cp" @tap="nav_shop_category_event">商品分类</view>
|
||||
<scroll-view scroll-x class="nav-scroll">
|
||||
<block v-if="shop_navigation.length > 0">
|
||||
<block v-for="(item, index) in shop_navigation" :key="index">
|
||||
<block v-if="(item.items || null) == null || item.items.length == 0">
|
||||
<view class="item dis-inline-block fw-b cp" @tap="nav_event" :data-value="item.url" :data-index="index">{{item.name}}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="item dis-inline-block fw-b cp" @tap="nav_event" :data-index="index">{{item.name}}</view>
|
||||
<view v-if="(item.items_status || 0) == 1" class="nav-items pf border-radius-main oh bg-white br">
|
||||
<block v-for="(items, index2) in item.items" :key="index2">
|
||||
<view class="item fw-b cp margin-vertical-main" @tap="nav_event" :data-value="items.url" :data-index="index" :data-indexs="index2">{{items.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="padding-bottom-sm">
|
||||
<block v-if="shop_navigation.length > 0">
|
||||
<block v-for="(item, index) in shop_navigation" :key="index">
|
||||
<block v-if="(item.items || null) == null || item.items.length == 0">
|
||||
<view class="item dis-inline-block cp" @tap="nav_event" :data-value="item.url" :data-index="index">{{item.name}}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="item dis-inline-block cp" @tap="nav_event" :data-index="index">{{item.name}}</view>
|
||||
<view v-if="(item.items_status || 0) == 1" class="nav-items pf border-radius-main oh bg-white br">
|
||||
<block v-for="(items, index2) in item.items" :key="index2">
|
||||
<view class="item cp margin-vertical-main" @tap="nav_event" :data-value="items.url" :data-index="index" :data-indexs="index2">{{items.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="nav_category_status" class="nav-category bg-white pa tc">
|
||||
<scroll-view scroll-y class="category-scroll">
|
||||
|
|
@ -120,7 +136,8 @@
|
|||
<block v-if="(shop.data_model || 0) == 0">
|
||||
<view v-if="(data || null) != null && data.length > 0" class="padding-main oh">
|
||||
<component-goods-list :propData="{style_type: 1, goods_list: data}" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
<button class="bg-main br-main cr-white round dis-block margin-top-xl margin-bottom-xl margin-horizontal-main" @tap="url_event" :data-value="'/pages/plugins/shop/search/search?shop_id='+shop.id" size="mini">查看更多商品 >></button>
|
||||
<button class="bg-main br-main cr-white round dis-block margin-top-xl margin-bottom-xl margin-horizontal-main" @tap="url_event"
|
||||
:data-value="'/pages/plugins/shop/search/search?shop_id='+shop.id" size="mini">查看更多商品 >></button>
|
||||
</view>
|
||||
<block v-else>
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
|
|
@ -139,7 +156,8 @@
|
|||
<!-- 商品列表 -->
|
||||
<block v-if="data.length > 0">
|
||||
<block v-for="(item, index) in data" :key="index">
|
||||
<component-goods-list :propData="item" :propKeywordsUrl="'/pages/plugins/shop/search/search?shop_id='+shop.id+'&keywords='" :propIsAutoPlay="true" :propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
<component-goods-list :propData="item" :propKeywordsUrl="'/pages/plugins/shop/search/search?shop_id='+shop.id+'&keywords='" :propIsAutoPlay="true"
|
||||
:propCurrencySymbol="currency_symbol"></component-goods-list>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
|
|
@ -176,7 +194,6 @@
|
|||
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 {
|
||||
data() {
|
||||
|
|
@ -185,7 +202,7 @@
|
|||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.data.currency_symbol,
|
||||
currency_symbol: app.globalData.data.currency_symbol,
|
||||
is_shop_search_all_search_button: 0,
|
||||
params: null,
|
||||
user: null,
|
||||
|
|
@ -208,7 +225,6 @@
|
|||
share_info: {}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentLayout,
|
||||
componentNoData,
|
||||
|
|
@ -217,26 +233,21 @@
|
|||
componentGoodsList
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.globalData.get_user_cache_info()
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
|
|
@ -248,7 +259,6 @@
|
|||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
|
|
@ -261,7 +271,7 @@
|
|||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var data = res.data.data;
|
||||
var base = data.base || null;
|
||||
var temp_data = data.data || [];
|
||||
this.setData({
|
||||
|
|
@ -269,7 +279,7 @@
|
|||
shop: data.shop || null,
|
||||
shop_favor_user: data.shop_favor_user || [],
|
||||
shop_navigation: data.shop_navigation || [],
|
||||
shop_goods_category: data.shop_goods_category || [],
|
||||
shop_goods_category: data.shop_goods_category || [],
|
||||
is_shop_search_all_search_button: (base == null || parseInt(base.is_shop_search_all_search_button || 0) != 1) ? 0 : 1,
|
||||
data: temp_data,
|
||||
slider: data.slider || [],
|
||||
|
|
@ -277,7 +287,6 @@
|
|||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: temp_data.length > 0
|
||||
});
|
||||
|
||||
if ((this.shop || null) != null) {
|
||||
// 收藏信息
|
||||
var status = this.shop_favor_user.indexOf(this.shop.id) != -1 ? 1 : 0;
|
||||
|
|
@ -288,18 +297,16 @@
|
|||
"text": (status == 1 ? '已' : '') + '收藏'
|
||||
}
|
||||
});
|
||||
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.shop.seo_title || this.shop.name,
|
||||
desc: this.shop.seo_desc || this.shop.describe,
|
||||
path: '/pages/plugins/shop/detail/detail',
|
||||
query: 'id='+this.shop.id,
|
||||
query: 'id=' + this.shop.id,
|
||||
img: this.shop.logo
|
||||
}
|
||||
});
|
||||
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.shop.name
|
||||
|
|
@ -312,7 +319,6 @@
|
|||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
|
@ -327,7 +333,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 店铺收藏事件
|
||||
shop_favor_event(e) {
|
||||
var user = app.globalData.get_user_info(this, 'shop_favor_event');
|
||||
|
|
@ -370,14 +375,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索输入事件
|
||||
search_keywords_event(e) {
|
||||
this.setData({
|
||||
search_keywords_value: e.detail.value || ''
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
search_button_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
|
|
@ -385,21 +388,18 @@
|
|||
url: value + 'keywords=' + this.search_keywords_value || ''
|
||||
});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
header_service_event(e) {
|
||||
this.setData({
|
||||
header_service_status: !this.header_service_status
|
||||
});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
nav_shop_category_event(e) {
|
||||
this.setData({
|
||||
nav_category_status: !this.nav_category_status
|
||||
});
|
||||
},
|
||||
|
||||
// 导航分类事件
|
||||
shop_category_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
|
|
@ -407,47 +407,43 @@
|
|||
url: '/pages/plugins/shop/search/search?shop_id=' + this.shop.id + '&category_id=' + value
|
||||
});
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
// 存在子级则做子级显示隐藏处理
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if(value == null) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var temp_nav = this.shop_navigation;
|
||||
for(var i in temp_nav) {
|
||||
if(i == index) {
|
||||
temp_nav[i]['items_status'] = ((temp_nav[i]['items_status'] || 0) == 0) ? 1 : 0;
|
||||
} else {
|
||||
temp_nav[i]['items_status'] = 0;
|
||||
}
|
||||
}
|
||||
this.setData({shop_navigation: temp_nav});
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
nav_event(e) {
|
||||
// 存在子级则做子级显示隐藏处理
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if (value == null) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var temp_nav = this.shop_navigation;
|
||||
for (var i in temp_nav) {
|
||||
if (i == index) {
|
||||
temp_nav[i]['items_status'] = ((temp_nav[i]['items_status'] || 0) == 0) ? 1 : 0;
|
||||
} else {
|
||||
temp_nav[i]['items_status'] = 0;
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
shop_navigation: temp_nav
|
||||
});
|
||||
} else {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 剪切板
|
||||
text_copy_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
|
||||
// 电话
|
||||
tel_event(e) {
|
||||
app.globalData.call_tel(e.currentTarget.dataset.value || null);
|
||||
},
|
||||
|
||||
// 图片预览
|
||||
image_show_event(e) {
|
||||
app.globalData.image_show_event(e);
|
||||
},
|
||||
|
||||
// 进入客服系统
|
||||
chat_event() {
|
||||
app.globalData.chat_entry_handle(this.shop.chat_info.chat_url);
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@
|
|||
<!-- 分类 -->
|
||||
<scroll-view v-if="(shop_category || null) != null && shop_category.length > 0" class="nav-base scroll-view-horizontal bg-white oh" scroll-x="true">
|
||||
<block v-for="(item, index) in shop_category" :key="index">
|
||||
<view :class="'item cr-gray dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main' : '')" @tap="nav_event" :data-value="item.id">{{item.name}}</view>
|
||||
<view :class="'item cr-grey dis-inline-block padding-horizontal-main ' + (nav_active_value == item.id ? 'cr-main nav-active-line fw-b' : '')" @tap="nav_event"
|
||||
:data-value="item.id">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav plugins-shop-data-list" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
|
||||
|
|
@ -15,10 +18,14 @@
|
|||
<view class="item border-radius-main bg-white oh spacing-mb">
|
||||
<navigator :url="'/pages/plugins/shop/detail/detail?id=' + item.id" hover-class="none">
|
||||
<image :src="item.logo_long" class="logo" mode="aspectFit"></image>
|
||||
<view class="padding-main tc">
|
||||
<view class="single-text">
|
||||
<view class="tc">
|
||||
<view class="single-text padding-horizontal-main padding-top-main">
|
||||
<!-- 标题 -->
|
||||
<text class="fw-b text-size-md va-m">{{item.name}}</text>
|
||||
<!-- 认证信息 -->
|
||||
<view v-if="(data_base.is_enable_auth || 0) == 1 && ((item.auth_type != -1 && (item.auth_type_msg || null) != null) || ((item.bond_status || 0) == 1 && (item.bond_status_msg || null) != null))" class="auth-icon dis-inline-block">
|
||||
<view
|
||||
v-if="(data_base.is_enable_auth || 0) == 1 && ((item.auth_type != -1 && (item.auth_type_msg || null) != null) || ((item.bond_status || 0) == 1 && (item.bond_status_msg || null) != null))"
|
||||
class="auth-icon dis-inline-block margin-left-sm">
|
||||
<!-- 实名认证 -->
|
||||
<block v-if="item.auth_type != -1 && (item.auth_type_msg || null) != null">
|
||||
<block v-if="item.auth_type == 0">
|
||||
|
|
@ -33,13 +40,13 @@
|
|||
<image :src="data_base.shop_auth_bond_icon" class="icon va-m" mode="aspectFill"></image>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<text class="fw-b text-size cr-base va-m">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="multi-text cr-grey margin-top-sm">{{item.describe}}</view>
|
||||
<view class="oh margin-top-sm br-t-dashed padding-top-main">
|
||||
<view class="fl cr-gray single-text">商品 {{item.goods_count}}</view>
|
||||
<view class="fr cr-gray single-text">销量 {{item.goods_sales_count}}</view>
|
||||
<view class="cr-grey padding-main">
|
||||
<text class="multi-text">{{item.describe}}</text>
|
||||
</view>
|
||||
<view class="oh br-t-dashed padding-main">
|
||||
<view class="fl cr-grey-9 single-text">商品 <text class="cr-black fw-b padding-left-sm">{{item.goods_count}}</text></view>
|
||||
<view class="fr cr-grey-9 single-text">销量 <text class="cr-black fw-b padding-left-sm">{{item.goods_sales_count}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
|
|
@ -61,7 +68,6 @@
|
|||
const app = getApp();
|
||||
import componentNoData from "../../../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -81,22 +87,18 @@
|
|||
share_info: {}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params
|
||||
});
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
|
|
@ -104,7 +106,6 @@
|
|||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
get_data() {
|
||||
|
|
@ -125,7 +126,6 @@
|
|||
data_base: data.base || null,
|
||||
shop_category: data.shop_category || []
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
|
|
@ -135,15 +135,13 @@
|
|||
path: '/pages/plugins/shop/index/index'
|
||||
}
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
if((this.data_base.application_name || null) != null) {
|
||||
if ((this.data_base.application_name || null) != null) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data_base.application_name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
this.get_data_list(1);
|
||||
} else {
|
||||
|
|
@ -153,7 +151,6 @@
|
|||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
|
|
@ -167,7 +164,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
|
|
@ -177,18 +173,17 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if(this.data_is_loading == 1) {
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({data_is_loading: 1});
|
||||
|
||||
this.setData({
|
||||
data_is_loading: 1
|
||||
});
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("shoplist", "index", "shop"),
|
||||
|
|
@ -221,7 +216,6 @@
|
|||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: (this.data_page > 1 && this.data_page > this.data_page_total)
|
||||
|
|
@ -258,12 +252,10 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
.item-value {
|
||||
right: 20rpx;
|
||||
bottom: 20rpx;
|
||||
.points-integral .list {
|
||||
border-bottom: 2rpx solid #eee;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.points-integral .list:last-of-type {
|
||||
border: 0;
|
||||
}
|
||||
|
|
@ -1,26 +1,29 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="padding-main">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="padding-main border-radius-main oh bg-white pr spacing-mb">
|
||||
<view class="oh">
|
||||
<view class="fl">
|
||||
<text class="cr-base">原始</text>
|
||||
<text class="cr-base fw-b margin-left-xs">{{item.original_integral}}</text>
|
||||
<text class="cr-base margin-left-lg">最新</text>
|
||||
<text class="cr-main fw-b margin-left-xs">{{item.new_integral}}</text>
|
||||
<view v-if="data_list.length > 0" class="padding-horizontal-main points-integral bg-white border-radius-main">
|
||||
<view v-for="(item,index) in data_list" class="list" :key="index">
|
||||
<view class="flex-row jc-sb align-c">
|
||||
<view class="cr-grey-9">
|
||||
原始
|
||||
<text class="cr-black fw-b padding-left-sm">{{item.original_integral}}</text>
|
||||
<text class="padding-horizontal-sm">/</text>
|
||||
最新
|
||||
<text class="cr-black fw-b padding-left-sm">{{item.new_integral}}</text>
|
||||
</view>
|
||||
<text class="fr cr-base ">{{item.add_time_time}}</text>
|
||||
<view class="cr-grey-9">{{item.add_time_time}}</view>
|
||||
</view>
|
||||
<view class="flex-row jc-sb align-c margin-top-main">
|
||||
<view>{{item.msg}}</view>
|
||||
<view class="cr-main text-size fw-b" :class="item.type == 1 ? 'cr-green' : 'cr-red'">{{item.type == 1 ? '+' : '-'}} {{item.operation_integral}}</view>
|
||||
</view>
|
||||
<view class="cr-grey margin-top-lg">{{item.msg}}</view>
|
||||
<text :class="'fw-b pa item-value '+(item.type == 1 ? 'cr-green' : 'cr-red')">{{item.type == 1 ? '+' : '-'}} {{item.operation_integral}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</scroll-view>
|
||||
|
|
@ -30,7 +33,6 @@
|
|||
const app = getApp();
|
||||
import componentNoData from "../../components/no-data/no-data";
|
||||
import componentBottomLine from "../../components/bottom-line/bottom-line";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -42,20 +44,16 @@
|
|||
data_bottom_line_status: false
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
props: {},
|
||||
|
||||
onShow() {
|
||||
this.init();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
|
|
@ -63,7 +61,6 @@
|
|||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
|
|
@ -85,7 +82,6 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
|
|
@ -94,21 +90,18 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if(this.data_is_loading == 1) {
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "userintegral"),
|
||||
|
|
@ -131,7 +124,6 @@
|
|||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
|
|
@ -140,7 +132,6 @@
|
|||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: (this.data_page > 1 && this.data_page > this.data_page_total)
|
||||
|
|
@ -172,7 +163,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
|
|
|
|||
Loading…
Reference in New Issue