优惠券新增详情

master
gongfuxiang 2025-01-18 18:51:28 +08:00
parent 7f93de11eb
commit ae5f12a89c
8 changed files with 234 additions and 35 deletions

View File

@ -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>

View File

@ -106,8 +106,8 @@
},
//
propIndex: {
type: Number,
default: 1,
type: [Number,String],
default: 0,
},
// 0-1-2-3-使,4-使5-
propStatusType: {

View File

@ -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",

View File

@ -129,6 +129,7 @@
"about": "关于我们",
"plugins-seckill-index": "限时秒杀",
"plugins-coupon-index": "领券中心",
"plugins-coupon-detail": "优惠券",
"plugins-coupon-shop": "店铺领券中心",
"plugins-coupon-user": "我的卡券",
"plugins-membershiplevelvip-index": "会员VIP",

View File

@ -540,6 +540,13 @@
"navigationBarTitleText": ""
}
},
{
"path": "detail/detail",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": ""
}
},
{
"path": "shop/shop",
"style": {

View File

@ -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>

View File

@ -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;

View File

@ -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();