修改优惠劵接口处理

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: { data: {
// //
// //
request_url:'http://shopxo.com/', request_url:'https://d1.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/ // publicpublichttps://d1.shopxo.vip/public/
static_url:'http://shopxo.com/', static_url:'https://d1.shopxo.vip/',
// default // default
system_type: 'default', system_type: 'default',

View File

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

View File

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

View File

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

View File

@ -180,35 +180,35 @@
var user = app.globalData.get_user_info(this, 'coupon_receive_event'); var user = app.globalData.get_user_info(this, 'coupon_receive_event');
if (user != false) { if (user != false) {
var temp_list = this.data_list; var temp_list = this.data_list;
if (temp_list[index]['is_operable'] != 0) { if (temp_list[index]['status_type'] == 0) {
uni.showLoading({ uni.showLoading({
title: this.$t('common.processing_in_text'), title: this.$t('common.processing_in_text'),
}); });
uni.request({ uni.request({
url: app.globalData.get_request_url('receive', 'coupon', 'coupon'), url: app.globalData.get_request_url('receive', 'coupon', 'coupon'),
method: 'POST', method: 'POST',
data: { data: {
coupon_id: value, coupon_id: value,
}, },
dataType: 'json', dataType: 'json',
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
app.globalData.showToast(res.data.msg, 'success'); app.globalData.showToast(res.data.msg, 'success');
temp_list[index] = res.data.data.coupon; temp_list[index] = res.data.data.coupon;
this.setData({ this.setData({
data_list: temp_list, data_list: temp_list,
}); });
} else { } else {
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) { if (app.globalData.is_login_check(res.data, this, 'coupon_receive_event')) {
app.globalData.showToast(res.data.msg); app.globalData.showToast(res.data.msg);
} }
} }
}, },
fail: () => { fail: () => {
uni.hideLoading(); uni.hideLoading();
app.globalData.showToast(this.$t('common.internet_error_tips')); app.globalData.showToast(this.$t('common.internet_error_tips'));
}, },
}); });
} }
} }