优惠券新增详情
parent
7f93de11eb
commit
ae5f12a89c
|
|
@ -2,9 +2,9 @@
|
|||
<view :class="theme_view">
|
||||
<view v-if="(propStatus || false)" class="data-bottom-line">
|
||||
<view class="bottom-exclude">
|
||||
<view class="item left"></view>
|
||||
<view class="item msg">{{propMsg || $t('bottom-line.bottom-line.44bct2')}}</view>
|
||||
<view class="item right"></view>
|
||||
<view class="line-item left"></view>
|
||||
<view class="line-item msg">{{propMsg || $t('bottom-line.bottom-line.44bct2')}}</view>
|
||||
<view class="line-item right"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -33,24 +33,24 @@
|
|||
.data-bottom-line .bottom-exclude {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.data-bottom-line .item {
|
||||
.data-bottom-line .line-item {
|
||||
width: 33.3%;
|
||||
}
|
||||
.data-bottom-line .left,
|
||||
.data-bottom-line .right {
|
||||
.data-bottom-line .line-item.left,
|
||||
.data-bottom-line .line-item.right {
|
||||
margin-top: 8px;
|
||||
border-bottom: 1px solid #e1e1e1;
|
||||
}
|
||||
.data-bottom-line .msg {
|
||||
.data-bottom-line .line-item.msg {
|
||||
color: #999;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.data-bottom-line .left,
|
||||
.data-bottom-line .msg {
|
||||
.data-bottom-line .line-item.left,
|
||||
.data-bottom-line .line-item.msg {
|
||||
float: left;
|
||||
}
|
||||
.data-bottom-line .right {
|
||||
.data-bottom-line .line-item.right {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -106,8 +106,8 @@
|
|||
},
|
||||
// 下标
|
||||
propIndex: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
type: [Number,String],
|
||||
default: 0,
|
||||
},
|
||||
// 按钮状态 0-领取,1-已领取,2-已抢完,3-去使用,4-已使用,5-已过期
|
||||
propStatusType: {
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@
|
|||
"about": "About Us",
|
||||
"plugins-seckill-index": "Limited time flash sale",
|
||||
"plugins-coupon-index": "Coupon Collection Center",
|
||||
"plugins-coupon-detail": "Coupon",
|
||||
"plugins-coupon-shop": "Shop Coupon Collection Center",
|
||||
"plugins-coupon-user": "My coupons",
|
||||
"plugins-membershiplevelvip-index": "Member VIP",
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@
|
|||
"about": "关于我们",
|
||||
"plugins-seckill-index": "限时秒杀",
|
||||
"plugins-coupon-index": "领券中心",
|
||||
"plugins-coupon-detail": "优惠券",
|
||||
"plugins-coupon-shop": "店铺领券中心",
|
||||
"plugins-coupon-user": "我的卡券",
|
||||
"plugins-membershiplevelvip-index": "会员VIP",
|
||||
|
|
|
|||
|
|
@ -540,6 +540,13 @@
|
|||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "detail/detail",
|
||||
"style": {
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "shop/shop",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,206 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data_base || null) != null" class="ht bg-white">
|
||||
<view class="plugins-coupon-container">
|
||||
<view class="coupon-content padding-top-main page-bottom-fixed">
|
||||
<!-- 优惠劵列表 -->
|
||||
<block v-if="(data || null) != null">
|
||||
<component-coupon-card :propData="data" :propStatusType="data.status_type" :propStatusOperableName="data.status_operable_name" propIndex="0" propIsProgress @call-back="coupon_receive_event"></component-coupon-card>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/coupon/user/user" @tap="url_event">{{$t('index.index.lk0i6c')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentCouponCard from '@/components/coupon-card/coupon-card.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: {},
|
||||
data: null,
|
||||
data_base: null,
|
||||
// 优惠劵领取
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentCouponCard,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 数据加载
|
||||
this.get_data();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('detail', 'index', 'coupon'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
if ((this.data || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.data.name,
|
||||
desc: this.data.desc,
|
||||
path: '/pages/plugins/coupon/detail/detail',
|
||||
query: 'id='+this.data.id
|
||||
},
|
||||
});
|
||||
|
||||
// 导航名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(index, value) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 参数处理
|
||||
if ((index || null) == null && (value || null) == null) {
|
||||
var index = this.temp_coupon_receive_index;
|
||||
var value = this.temp_coupon_receive_value;
|
||||
} else {
|
||||
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) {
|
||||
var data = this.data;
|
||||
if (data['is_operable'] != 0) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
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');
|
||||
data = res.data.data.coupon;
|
||||
this.setData({
|
||||
data_list: data,
|
||||
});
|
||||
} 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(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
@ -20,11 +20,6 @@
|
|||
padding: 0 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.popup-bottom {
|
||||
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.popup-btn {
|
||||
border: 2rpx solid #FF6E01;
|
||||
color: #FF6E01;
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@
|
|||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_event"></component-coupon-card>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-bottom bottom-fixed bg-white">
|
||||
<view class="bottom-line-exclude">
|
||||
<view data-value="/pages/plugins/coupon/user/user" @tap="url_event" class="popup-btn tc cp">{{$t('index.index.lk0i6c')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/coupon/user/user" @tap="url_event">{{$t('index.index.lk0i6c')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
|
@ -55,7 +55,6 @@
|
|||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
data_list: [],
|
||||
data_base: null,
|
||||
// 优惠劵领取
|
||||
|
|
@ -98,16 +97,6 @@
|
|||
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');
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
init() {
|
||||
this.get_data_list();
|
||||
|
|
|
|||
Loading…
Reference in New Issue