master
sws 2023-09-05 19:23:05 +08:00
parent 6a0f07a451
commit 1379aa689b
16 changed files with 284 additions and 253 deletions

26
App.vue
View File

@ -85,16 +85,6 @@
version: 'v3.0.0',
//
currency_symbol: '¥',
//
// yellow #f6c133
// red #ff0036
// black #333333
// 绿 green #20a53a
// orange #fe6f04
// blue #1677ff
// brown #8B4513
// purple #623cec
default_theme: 'yellow',
},
/**
@ -1292,8 +1282,9 @@
// url+
return this.data.static_url + 'static/plugins/images/' + type + '/';
} else {
var theme = this.get_theme_value();
// url++
return this.data.static_url + 'static/app/' + this.data.default_theme + '/' + type + '/';
return this.data.static_url + 'static/app/' + theme + '/' + type + '/';
}
},
@ -1817,7 +1808,18 @@
},
//
get_theme_value() {
return uni.getStorageSync('theme') || 'yellow'
//
// yellow #f6c133
// red #ff0036
// black #333333
// 绿 green #20a53a
// orange #fe6f04
// blue #1677ff
// brown #8B4513
// purple #623cec
var default_theme = 'brown';
return uni.getStorageSync('theme') || default_theme;
},
//

View File

@ -24,8 +24,8 @@
<style scoped>
/* iconfont.css全局注册需要将src切换成绝对路径 */
/* @/static/icon/ */
/* @import url("@/static/icon/iconfont.css"); */
@import url('https://at.alicdn.com/t/c/font_4227145_p6vbjfm5ej.css');
@import url("@/static/icon/iconfont.css");
/* @import url('https://at.alicdn.com/t/c/font_4227145_p6vbjfm5ej.css'); */
.iconfont {
display: inline-block;

View File

@ -5,7 +5,7 @@
<iconfont name="icon-fenlei-more"></iconfont>
</view>
<!-- 弹窗 -->
<component-popup :propShow="popup_status" :propIsBar="propIsBar" propPosition="top" :propMask="false" :propTop="propTop" @onclose="quick_close_event">
<component-popup :propShow="popup_status" :propIsBar="propIsBar" propPosition="top" :propMask="true" :propTop="propTop" @onclose="quick_close_event">
<view class="padding-vertical-lg">
<view class="padding-left-main padding-bottom-main">全部分类</view>
<view class="divider-b">
@ -74,7 +74,7 @@
<style scoped>
.more {
width: 30rpx;
background-color: #fff;
/* background-color: #fff; */
padding: 15rpx 20rpx;
position: absolute;
top: 0;

View File

@ -45,7 +45,7 @@
},
propBgColor: {
type: String,
default: '#f0f0f0'
default: '#fff'
},
propBrColor: {
type: String,

View File

@ -1,3 +1,17 @@
/**
*
*/
.goods-top-bg {
height: 280rpx;
}
.goods-top-search-bg {
height: 138rpx;
/* #ifdef H5 || APP */
height: 98rpx;
/* #endif */
}
/**
*
*/
@ -10,6 +24,7 @@
padding-right: 20rpx;
/* #endif */
padding-bottom: 10px;
z-index: 101;
}
.category-content {
@ -245,7 +260,7 @@
.goods-right-content .word-list {
position: sticky;
top: 0;
top: -2rpx;
right: 0;
background: #fff;
z-index: 1;

View File

@ -1,9 +1,15 @@
<template>
<view>
<view :class="(is_single_page == 1 ? 'margin-top-xxxl single-page-top' : '')">
<view class="goods-top-bg pa top-0 left-0 right-0 wh-auto">
<image :src="theme_static_url + 'goods-top-bg.png'" mode="scaleToFill" class="wh-auto ht-auto"></image>
</view>
<!-- 搜索框 -->
<block v-if="is_single_page == 0">
<view class="nav-search padding-horizontal-main bg-white" :style="'padding-top:'+(status_bar_height+8)+'px;'">
<view class="nav-search padding-horizontal-main pr" :style="'padding-top:'+(status_bar_height+8)+'px;'">
<view class="goods-top-search-bg pa top-0 left-0 right-0 wh-auto">
<image :src="theme_static_url + 'goods-top-bg.png'" mode="top" class="wh-auto ht-auto"></image>
</view>
<block v-if="is_goods_category_search_alone == 1">
<component-search propPlaceholder="输入商品名称搜索"></component-search>
</block>
@ -37,7 +43,7 @@
<!-- 商品列表模式 -->
<block v-if="category_show_level == 0">
<!-- 一级导航 -->
<view class="top-nav bg-white wh-auto pa scroll-view-horizontal">
<view class="top-nav wh-auto pa scroll-view-horizontal">
<scroll-view :scroll-x="true" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-'+nav_active_index" class="top-nav-scroll">
<block v-for="(item, index) in category_list" :key="index">
<view class="item tc cp dis-inline-block text-size-xss" :id="'one-nav-item-'+index" :data-index="index" :data-itemtwoindex="-1" :data-itemthreeindex="-1"
@ -51,7 +57,7 @@
</view>
</block>
</scroll-view>
<component-nav-more prop-top="98rpx" :prop-status="popupStatus" @open-popup="open_popup_event">
<component-nav-more :prop-top="popup_top" :prop-status="popup_status" @open-popup="open_popup_event">
<view class="nav-list-more">
<view class="flex-row flex-warp align-c">
<block v-for="(item, index) in category_list" :key="index">
@ -132,13 +138,13 @@
<view v-if="common_site_type != 1" class="buy-opt tc flex-row align-c">
<block v-if="(item.is_error || 0) == 0">
<view v-if="(item.buy_number || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="buy_number_event">
<iconfont name="icon-fenlei-jianhao" size="28rpx" :color="themeColor"></iconfont>
<iconfont name="icon-fenlei-jianhao" size="28rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(item.buy_number || 0) > 0" class="buy-number cr-black text-size-sm padding-left-xs padding-right-xs">
{{item.buy_number}}
</view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="buy_number_event">
<iconfont name="icon-fenlei-jiahao" size="28rpx" :color="themeColor"></iconfont>
<iconfont name="icon-fenlei-jiahao" size="28rpx" :color="theme_color"></iconfont>
</view>
</block>
<block v-else>
@ -304,13 +310,13 @@
<view class="tc fr flex-row align-c">
<block v-if="goods.is_error == 0">
<view v-if="(goods.stock || 0) > 0" class="cp pr top-sm" :data-index="index" data-type="0" @tap.stop="cart_buy_number_event">
<iconfont name="icon-fenlei-jianhao" size="28rpx" :color="themeColor"></iconfont>
<iconfont name="icon-fenlei-jianhao" size="28rpx" :color="theme_color"></iconfont>
</view>
<view v-if="(goods.stock || 0) > 0" class="buy-number dis-inline-block cr-black text-size-sm padding-left-xs padding-right-xs va-m">
{{goods.stock}}
</view>
<view class="cp pr top-sm" :data-index="index" data-type="1" @tap.stop="cart_buy_number_event">
<iconfont name="icon-fenlei-jiahao" size="28rpx" :color="themeColor"></iconfont>
<iconfont name="icon-fenlei-jiahao" size="28rpx" :color="theme_color"></iconfont>
</view>
</block>
<block v-else>
@ -374,6 +380,7 @@
import componentUserBase from "../../components/user-base/user-base";
import componentNavMore from "../../components/nav-more/nav-more";
var theme_static_url = app.globalData.get_static_url('goods');
var common_static_url = app.globalData.get_static_url('common');
//
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
@ -385,6 +392,7 @@
export default {
data() {
return {
theme_static_url: theme_static_url,
common_static_url: common_static_url,
status_bar_height: bar_height,
data_bottom_line_status: false,
@ -427,8 +435,9 @@
temp_opt_data: null,
//
plugins_label_data: null,
themeColor: app.globalData.get_theme_color(),
popupStatus: false
theme_color: app.globalData.get_theme_color(),
popup_status: false,
popup_top: '138rpx',
};
},
@ -471,6 +480,11 @@
onPullDownRefresh() {
this.init();
},
created() {
// #ifdef H5 || APP
this.popup_top = '98rpx';
// #endif
},
methods: {
//
@ -743,7 +757,7 @@
data_page: 1,
data_list_loding_status: 1,
data_list: [],
popupStatus: false
popup_status: false
});
//
@ -756,7 +770,7 @@
//
open_popup_event(e) {
this.setData({
popupStatus: e
popup_status: e
});
},

View File

@ -91,8 +91,8 @@
<!-- 限时秒杀 - 插件 -->
<view
v-if="pv.plugins == 'seckill' && (plugins_seckill_data || null) != null && (plugins_seckill_data.data || null) != null && (plugins_seckill_data.data.goods || null) != null && plugins_seckill_data.data.goods.length > 0"
class="plugins-seckill-data border-radius-main padding-horizontal-main spacing-mb padding-top-main"
:style="'background: url('+plugins_seckill_data.data.home_bg+') top/100% no-repeat;'">
class="plugins-seckill-data border-radius-main padding-horizontal-main spacing-mb padding-top-main bg-white"
:style="'background-image: url('+plugins_seckill_data.data.home_bg+');'">
<view class="spacing-nav-title flex-row jc-sb align-c">
<view class="flex-1">
<image class="dis-inline-block va-m icon" :src="plugins_seckill_data.data.home_title_icon" mode="widthFix"></image>

View File

@ -1,242 +1,242 @@
<template>
<view>
<view v-if="(data_base || null) != null && (data_base.banner_images || null) != null" class="padding-horizontal-main padding-top-main">
<image class="wh-auto dis-block border-radius-main" :src="data_base.banner_images" mode="widthFix" :data-value="data_base.url || ''" @tap="url_event"></image>
</view>
<view>
<view v-if="(data_base || null) != null && (data_base.banner_images || null) != null" class="pa top-0 left-0 right-0">
<image class="wh-auto dis-block border-radius-main" :src="data_base.banner_images" mode="widthFix" :data-value="data_base.url || ''" @tap="url_event"></image>
</view>
<!-- 优惠劵列表 -->
<view v-if="data_list.length > 0" class="plugins-coupon-container padding-horizontal-main padding-top-main">
<block v-for="(item, index) in data_list" :key="index">
<view :class="'item border-radius-main bg-white spacing-mb ' + (item.is_operable == 0 ? 'item-disabled' : '')">
<view class="v-left fl">
<view class="base single-text" :style="'color:' + item.bg_color_value + ';'">
<text v-if="item.type == 0" class="symbol">{{currency_symbol}}</text>
<text class="price">{{item.discount_value}}</text>
<text class="unit">{{item.type_unit}}</text>
<text v-if="(item.desc || null) != null" class="desc cr-gray">{{item.desc}}</text>
</view>
<view v-if="(item.use_limit_type_name || null) != null" class="base-tips cr-base single-text text-size-xs">{{item.use_limit_type_name}}</view>
</view>
<view class="v-right fr cp" @tap="coupon_receive_event" :data-index="index" :data-value="item.id" :style="'background:' + item.bg_color_value + ';'">
<text class="circle"></text>
<text>{{item.is_operable_name}}</text>
</view>
</view>
</block>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 优惠劵列表 -->
<view v-if="data_list.length > 0" class="plugins-coupon-container padding-horizontal-main padding-top-main">
<block v-for="(item, index) in data_list" :key="index">
<view :class="'item border-radius-main bg-white spacing-mb ' + (item.is_operable == 0 ? 'item-disabled' : '')">
<view class="v-left fl">
<view class="base single-text" :style="'color:' + item.bg_color_value + ';'">
<text v-if="item.type == 0" class="symbol">{{currency_symbol}}</text>
<text class="price">{{item.discount_value}}</text>
<text class="unit">{{item.type_unit}}</text>
<text v-if="(item.desc || null) != null" class="desc cr-gray">{{item.desc}}</text>
</view>
<view v-if="(item.use_limit_type_name || null) != null" class="base-tips cr-base single-text text-size-xs">{{item.use_limit_type_name}}</view>
</view>
<view class="v-right fr cp" @tap="coupon_receive_event" :data-index="index" :data-value="item.id" :style="'background:' + item.bg_color_value + ';'">
<text class="circle"></text>
<text>{{item.is_operable_name}}</text>
</view>
</view>
</block>
</view>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
</template>
<script>
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
const app = getApp();
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
data_list: [],
data_base: null,
//
temp_coupon_receive_index: null,
temp_coupon_receive_value: null,
//
share_info: {}
};
},
export default {
data() {
return {
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
currency_symbol: app.globalData.data.currency_symbol,
data_list: [],
data_base: null,
//
temp_coupon_receive_index: null,
temp_coupon_receive_value: null,
//
share_info: {}
};
},
components: {
componentNoData,
componentBottomLine
},
props: {},
components: {
componentNoData,
componentBottomLine
},
props: {},
onShow() {
//
this.init();
//
this.init_config();
},
onShow() {
//
this.init();
//
onPullDownRefresh() {
this.get_data_list();
},
//
this.init_config();
},
methods: {
//
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol')
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
//
onPullDownRefresh() {
this.get_data_list();
},
//
init() {
this.get_data_list();
},
methods: {
//
init_config(status) {
if ((status || false) == true) {
this.setData({
currency_symbol: app.globalData.get_config('currency_symbol')
});
} else {
app.globalData.is_config(this, 'init_config');
}
},
//
get_data_list() {
var self = this;
uni.showLoading({
title: '加载中...'
});
if (self.data_list.length <= 0) {
self.setData({
data_list_loding_status: 1
});
}
uni.request({
url: app.globalData.get_request_url("index", "index", "coupon"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var status = (data.data || []).length > 0;
this.setData({
data_base: data.base || null,
data_list: data.data || [],
data_list_loding_msg: '',
data_list_loding_status: status ? 3 : 0,
data_bottom_line_status: status
});
//
init() {
this.get_data_list();
},
if ((this.data_base || null) != null) {
//
this.setData({
share_info: {
title: this.data_base.seo_title || this.data_base.application_name,
desc: this.data_base.seo_desc,
path: '/pages/plugins/coupon/index/index'
}
});
//
get_data_list() {
var self = this;
uni.showLoading({
title: '加载中...'
});
if (self.data_list.length <= 0) {
self.setData({
data_list_loding_status: 1
});
}
uni.request({
url: app.globalData.get_request_url("index", "index", "coupon"),
method: 'POST',
data: {},
dataType: 'json',
success: res => {
uni.hideLoading();
uni.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
var status = (data.data || []).length > 0;
this.setData({
data_base: data.base || null,
data_list: data.data || [],
data_list_loding_msg: '',
data_list_loding_status: status ? 3 : 0,
data_bottom_line_status: status
});
//
if((this.data_base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: this.data_base.application_name
});
}
}
} else {
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
app.globalData.showToast(res.data.msg);
}
if ((this.data_base || null) != null) {
//
this.setData({
share_info: {
title: this.data_base.seo_title || this.data_base.application_name,
desc: this.data_base.seo_desc,
path: '/pages/plugins/coupon/index/index'
}
});
//
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
//
if ((this.data_base.application_name || null) != null) {
uni.setNavigationBarTitle({
title: this.data_base.application_name
});
}
}
} else {
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg
});
app.globalData.showToast(res.data.msg);
}
//
coupon_receive_event(e) {
if(!app.globalData.is_single_page_check()) {
return false;
}
//
if ((e || null) == null) {
var index = this.temp_coupon_receive_index;
var value = this.temp_coupon_receive_value;
} else {
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
this.setData({
temp_coupon_receive_index: index,
temp_coupon_receive_value: value
});
}
//
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.navigateTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
} else {
var temp_list = this.data_list;
if (temp_list[index]['is_operable'] != 0) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("receive", "coupon", "coupon"),
method: 'POST',
data: {
"coupon_id": value
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success');
if (this.data_base != null && this.data_base.is_repeat_receive !=
1) {
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
this.setData({
data_list: temp_list
});
}
} else {
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
}
}
},
//
app.globalData.page_share_handle(this.share_info);
},
fail: () => {
uni.hideLoading();
uni.stopPullDownRefresh();
self.setData({
data_bottom_line_status: false,
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast('服务器请求出错');
}
});
},
// url
url_event(e) {
app.globalData.url_event(e);
}
}
};
//
coupon_receive_event(e) {
if (!app.globalData.is_single_page_check()) {
return false;
}
//
if ((e || null) == null) {
var index = this.temp_coupon_receive_index;
var value = this.temp_coupon_receive_value;
} else {
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
this.setData({
temp_coupon_receive_index: index,
temp_coupon_receive_value: value
});
}
//
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.navigateTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
} else {
var temp_list = this.data_list;
if (temp_list[index]['is_operable'] != 0) {
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("receive", "coupon", "coupon"),
method: 'POST',
data: {
"coupon_id": value
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success');
if (this.data_base != null && this.data_base.is_repeat_receive !=
1) {
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
this.setData({
data_list: temp_list
});
}
} else {
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
}
}
},
// url
url_event(e) {
app.globalData.url_event(e);
}
}
};
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB