1.分类
26
App.vue
|
|
@ -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;
|
||||
},
|
||||
|
||||
// 设置主题
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
},
|
||||
propBgColor: {
|
||||
type: String,
|
||||
default: '#f0f0f0'
|
||||
default: '#fff'
|
||||
},
|
||||
propBrColor: {
|
||||
type: String,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 49 KiB |