修改优惠劵接口处理

master
于肖磊 2025-04-29 10:17:31 +08:00
parent 6a7b083a53
commit 290481e157
5 changed files with 63 additions and 58 deletions

View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'http://shopxo.com/',
request_url:'https://d1.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'http://shopxo.com/',
static_url:'https://d1.shopxo.vip/',
// default
system_type: 'default',

View File

@ -316,7 +316,7 @@
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
var temp_list = this.data_list;
if (temp_list[coupon_index]['is_operable'] != 0) {
if (temp_list[coupon_index]['status_type'] == 0) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});
@ -331,12 +331,17 @@
},
//
receive_all_event() {
const filter_data_list = this.data_list.map((item) => {
if (item.is_operable != 0 && item.status_type == 0) {
return item.id;
}
});
this.coupon_api(filter_data_list.join(','));
//
const temp_list = this.data_list.filter(item => item.status_type == 0);
// 0
if (temp_list.length > 0) {
const filter_data_list = this.data_list.map((item) => {
if (item.status_type == 0) {
return item.id;
}
});
this.coupon_api(filter_data_list.join(','));
}
},
//
coupon_api(val, index) {

View File

@ -15,11 +15,11 @@
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
</view>
<view class="bottom-fixed" :style="bottom_fixed_style">
<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 class="bottom-fixed" :style="bottom_fixed_style">
<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>
@ -43,8 +43,8 @@
theme_view: app.globalData.get_theme_value_view(),
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
bottom_fixed_style: '',
data_list_loding_msg: '',
bottom_fixed_style: '',
params: {},
data: null,
data_base: null,
@ -63,12 +63,12 @@
},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
//
this.setData({
params: app.globalData.launch_params_handle(params),
//
app.globalData.page_event_onload_handle(params);
//
this.setData({
params: app.globalData.launch_params_handle(params),
});
},
@ -113,7 +113,7 @@
share_info: {
title: this.data.name,
desc: this.data.desc,
path: '/pages/plugins/coupon/detail/detail',
path: '/pages/plugins/coupon/detail/detail',
query: 'id='+this.data.id
},
});
@ -162,7 +162,7 @@
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
var data = this.data;
if (data['is_operable'] != 0) {
if (data['status_type'] == 0) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});

View File

@ -22,11 +22,11 @@
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</view>
</view>
<view class="bottom-fixed" :style="bottom_fixed_style">
<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 class="bottom-fixed" :style="bottom_fixed_style">
<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>
@ -54,7 +54,7 @@
coupon_static_url: coupon_static_url + 'app/',
data_bottom_line_status: false,
data_list_loding_status: 1,
data_list_loding_msg: '',
data_list_loding_msg: '',
bottom_fixed_style: '',
data_list: [],
data_base: null,
@ -181,7 +181,7 @@
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
var temp_list = this.data_list;
if (temp_list[index]['is_operable'] != 0) {
if (temp_list[index]['status_type'] == 0) {
uni.showLoading({
title: this.$t('common.processing_in_text'),
});

View File

@ -180,35 +180,35 @@
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) {
var temp_list = this.data_list;
if (temp_list[index]['is_operable'] != 0) {
if (temp_list[index]['status_type'] == 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');
temp_list[index] = res.data.data.coupon;
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(this.$t('common.internet_error_tips'));
},
});
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');
temp_list[index] = res.data.data.coupon;
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(this.$t('common.internet_error_tips'));
},
});
}
}