优惠券领取错误修复
parent
19db2a907c
commit
4964ad26c6
1
App.vue
1
App.vue
|
|
@ -769,7 +769,6 @@
|
|||
}
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
self.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -117,20 +117,20 @@
|
|||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"component-goods-comments": "/pages/goods-detail/components/goods-comments/goods-comments",
|
||||
"component-binding-detail-list": "/pages/plugins/binding/components/binding-detail-list/binding-detail-list",
|
||||
"component-realstore-list": "/pages/plugins/realstore/components/realstore-list/realstore-list",
|
||||
"component-shop-list": "/pages/plugins/shop/components/shop-list/shop-list",
|
||||
"component-ask-comments-goods": "/pages/plugins/ask/components/ask-comments-goods/ask-comments-goods",
|
||||
"component-goods-comments": "/pages/goods-detail/components/goods-comments/goods-comments",
|
||||
"component-coupon-card": "/pages/plugins/coupon/components/coupon-card/coupon-card",
|
||||
"component-goods-compare": "/pages/plugins/goodscompare/components/goods-compare/goods-compare"
|
||||
},
|
||||
"componentPlaceholder": {
|
||||
"component-goods-comments": "view",
|
||||
"component-binding-detail-list": "view",
|
||||
"component-realstore-list": "view",
|
||||
"component-shop-list": "view",
|
||||
"component-ask-comments-goods": "view",
|
||||
"component-goods-comments": "view",
|
||||
"component-coupon-card": "view",
|
||||
"component-goods-compare": "view"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@
|
|||
<view class="oh">
|
||||
<view class="item margin-vertical-xs mini-coupon flex-row flex-nowrap" :class="item.status_type === 2 ? 'received-coupon mini-coupon-br' : 'not-received-coupon'">
|
||||
<text class="nowrap" @tap="popup_coupon_event">{{ item.desc || item.name }}</text>
|
||||
<text class="dis-inline-block nowrap margin-left-sm padding-left-sm divider-l" @tap="coupon_receive_event(index, item.id)">{{ item.status_operable_name }}</text>
|
||||
<text class="dis-inline-block nowrap margin-left-sm padding-left-sm divider-l" :data-index="index" :data-value="item.id" @tap="coupon_receive_event">{{ item.status_operable_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -529,7 +529,7 @@
|
|||
<view class="plugins-coupon-container padding-bottom-main">
|
||||
<block v-if="(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0">
|
||||
<block v-for="(item, index) in plugins_coupon_data.data" :key="index">
|
||||
<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>
|
||||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_back_event"></component-coupon-card>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
|
|
@ -618,7 +618,9 @@
|
|||
</block>
|
||||
|
||||
<!-- 商品对比 -->
|
||||
<component-goods-compare :propGoods="goods"></component-goods-compare>
|
||||
<block v-if="goods != null">
|
||||
<component-goods-compare :propGoods="goods"></component-goods-compare>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
|
|
@ -641,12 +643,12 @@
|
|||
import componentBindingDetailList from '@/pages/plugins/binding/components/binding-detail-list/binding-detail-list';
|
||||
import componentSharePopup from '@/components/share-popup/share-popup';
|
||||
import componentGoodsComments from '@/pages/goods-detail/components/goods-comments/goods-comments';
|
||||
import componentAskCommentsGoods from '@/pages/plugins/ask/components/ask-comments-goods/ask-comments-goods';
|
||||
import componentCouponCard from '@/pages/plugins/coupon/components/coupon-card/coupon-card';
|
||||
import componentCategorylimitWarmTips from '@/pages/goods-detail/components/categorylimit-warm-tips/categorylimit-warm-tips';
|
||||
import componentRealstoreCart from '@/components/realstore-cart/realstore-cart';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentWholesaleRules from '@/components/wholesale-rules/wholesale-rules';
|
||||
import componentCategorylimitWarmTips from '@/pages/goods-detail/components/categorylimit-warm-tips/categorylimit-warm-tips';
|
||||
import componentAskCommentsGoods from '@/pages/plugins/ask/components/ask-comments-goods/ask-comments-goods';
|
||||
import componentCouponCard from '@/pages/plugins/coupon/components/coupon-card/coupon-card';
|
||||
import componentGoodsCompare from '@/pages/plugins/goodscompare/components/goods-compare/goods-compare';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
|
|
@ -747,8 +749,6 @@
|
|||
plugins_seckill_is_valid: false,
|
||||
// 优惠劵插件
|
||||
plugins_coupon_data: null,
|
||||
temp_coupon_receive_index: null,
|
||||
temp_coupon_receive_value: null,
|
||||
popup_coupon_status: false,
|
||||
// 购买记录插件
|
||||
plugins_salerecords_data: null,
|
||||
|
|
@ -789,9 +789,9 @@
|
|||
componentGoodsBatchBuy,
|
||||
componentPopup,
|
||||
componentBadge,
|
||||
componentTrnNav,
|
||||
componentCountdown,
|
||||
componentNoData,
|
||||
componentTrnNav,
|
||||
componentBottomLine,
|
||||
componentOnlineService,
|
||||
componentRealstoreList,
|
||||
|
|
@ -799,12 +799,12 @@
|
|||
componentBindingDetailList,
|
||||
componentSharePopup,
|
||||
componentGoodsComments,
|
||||
componentAskCommentsGoods,
|
||||
componentCouponCard,
|
||||
componentCategorylimitWarmTips,
|
||||
componentRealstoreCart,
|
||||
componentGoodsList,
|
||||
componentWholesaleRules,
|
||||
componentCategorylimitWarmTips,
|
||||
componentAskCommentsGoods,
|
||||
componentCouponCard,
|
||||
componentGoodsCompare
|
||||
},
|
||||
|
||||
|
|
@ -1350,55 +1350,69 @@
|
|||
});
|
||||
},
|
||||
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(index, value) {
|
||||
// 参数处理
|
||||
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,
|
||||
});
|
||||
// 优惠券组件领取事件
|
||||
coupon_receive_back_event() {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 登录校验
|
||||
var user = app.globalData.get_user_info(this, 'coupon_receive_event');
|
||||
let user = app.globalData.get_user_info(this, 'coupon_receive_back_event');
|
||||
if (user != false) {
|
||||
var temp_list = this.plugins_coupon_data.data;
|
||||
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({
|
||||
'plugins_coupon_data.data': 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'));
|
||||
},
|
||||
});
|
||||
let res = uni.getStorageSync('cache_plugins_coupon_receive_key') || null;
|
||||
if(res != null) {
|
||||
this.coupon_receive_handle(res);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 优惠劵领取事件
|
||||
coupon_receive_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 登录校验
|
||||
let user = app.globalData.get_user_info(this, 'coupon_receive_event', e);
|
||||
if (user != false) {
|
||||
this.coupon_receive_handle(e.currentTarget.dataset);
|
||||
}
|
||||
},
|
||||
|
||||
// 优惠券领取处理
|
||||
coupon_receive_handle(params) {
|
||||
let index = params.index;
|
||||
let value = params.value;
|
||||
let temp_list = this.plugins_coupon_data.data;
|
||||
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({
|
||||
'plugins_coupon_data.data': temp_list,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_handle', params)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 购买记录提示处理
|
||||
plugins_salerecords_tips_handle() {
|
||||
// 销毁之前的任务
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</view>
|
||||
<view class="card-type">
|
||||
<!-- 按钮状态 0-领取,1-已领取,2-已抢完,3-去使用,4-已使用,5-已过期 -->
|
||||
<view v-if="propStatusType == 0" class="card-btn dis-inline-block cr-white" @tap="receive">{{ propStatusOperableName || this.$t('coupon-card.coupon-card.m9316y') }}</view>
|
||||
<view v-if="propStatusType == 0" class="card-btn dis-inline-block cr-white" @tap="receive_event">{{ propStatusOperableName || this.$t('coupon-card.coupon-card.m9316y') }}</view>
|
||||
<view v-else-if="propStatusType == 1" class="card-btn dis-inline-block cr-red br-red received">{{ propStatusOperableName || this.$t('coupon-card.coupon-card.m9316y') }}</view>
|
||||
<view v-else-if="propStatusType == 2" class="card-btn dis-inline-block cr-white robbed">{{ propStatusOperableName || this.$t('coupon-card.coupon-card.m9316y') }}</view>
|
||||
<view v-else-if="propStatusType == 3" :data-value="home_page_url" @tap="url_event" class="cp">
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<view v-else-if="propStatusType == 5" class="card-image pa top-0 right-0">
|
||||
<image class="image" :src="coupon_static_url + 'coupon-expire.png'" mode="scaleToFill"></image>
|
||||
</view>
|
||||
<view v-else @tap="receive">{{$t('coupon-card.coupon-card.j318xx')}}</view>
|
||||
<view v-else @tap="receive_event">{{$t('coupon-card.coupon-card.j318xx')}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-circle-top" :style="{ background: `${propBg}` }"></view>
|
||||
|
|
@ -136,13 +136,19 @@
|
|||
// 符号
|
||||
currency_symbol: app.globalData.currency_symbol(),
|
||||
// 首页地址
|
||||
home_page_url: tabbar_pages[0],
|
||||
home_page_url: tabbar_pages[0],
|
||||
// 缓存key
|
||||
cache_key: 'cache_plugins_coupon_receive_key',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 领取
|
||||
receive(e) {
|
||||
this.$emit('call-back', this.propIndex, this.propData.id);
|
||||
receive_event(e) {
|
||||
uni.setStorageSync(this.cache_key, {
|
||||
index: this.propIndex,
|
||||
value: this.propData.id
|
||||
});
|
||||
this.$emit('call-back');
|
||||
},
|
||||
|
||||
// url事件
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<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>
|
||||
<component-coupon-card :propData="data" :propStatusType="data.status_type" :propStatusOperableName="data.status_operable_name" propIndex="0" propIsProgress @call-back="coupon_receive_back_event"></component-coupon-card>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
|
|
@ -144,55 +144,51 @@
|
|||
});
|
||||
},
|
||||
// 优惠劵领取事件
|
||||
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['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');
|
||||
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);
|
||||
coupon_receive_back_event() {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 缓存
|
||||
let res = uni.getStorageSync('cache_plugins_coupon_receive_key') || null;
|
||||
if(res != null) {
|
||||
// 登录校验
|
||||
let user = app.globalData.get_user_info(this, 'coupon_receive_back_event');
|
||||
if (user != false) {
|
||||
let index = res.index;
|
||||
let value = res.value;
|
||||
let data = this.data;
|
||||
if (data['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');
|
||||
data = res.data.data.coupon;
|
||||
this.setData({
|
||||
data_list: data,
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, 'coupon_receive_back_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<!-- 优惠劵列表 -->
|
||||
<view v-if="data_list.length > 0" class="flex-col">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<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>
|
||||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_back_event"></component-coupon-card>
|
||||
</block>
|
||||
</view>
|
||||
<block v-else>
|
||||
|
|
@ -163,55 +163,51 @@
|
|||
});
|
||||
},
|
||||
// 优惠劵领取事件
|
||||
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 temp_list = this.data_list;
|
||||
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);
|
||||
coupon_receive_back_event() {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 缓存
|
||||
let res = uni.getStorageSync('cache_plugins_coupon_receive_key') || null;
|
||||
if(res != null) {
|
||||
// 登录校验
|
||||
let user = app.globalData.get_user_info(this, 'coupon_receive_back_event');
|
||||
if (user != false) {
|
||||
let index = res.index;
|
||||
let value = res.value;
|
||||
let temp_list = this.data_list;
|
||||
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_back_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<view v-if="data_list.length > 0" class="coupon-content bg-white pr padding-top-main page-bottom-fixed">
|
||||
<view class="flex-col">
|
||||
<block v-for="(item, index) in data_list" :key="index">
|
||||
<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>
|
||||
<component-coupon-card :propData="item" :propStatusType="item.status_type" :propStatusOperableName="item.status_operable_name" :propIndex="index" propIsProgress @call-back="coupon_receive_back_event"></component-coupon-card>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
|
|
@ -162,54 +162,50 @@
|
|||
},
|
||||
|
||||
// 优惠劵领取事件
|
||||
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 temp_list = this.data_list;
|
||||
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);
|
||||
coupon_receive_back_event() {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
// 缓存
|
||||
let res = uni.getStorageSync('cache_plugins_coupon_receive_key') || null;
|
||||
if(res != null) {
|
||||
// 登录校验
|
||||
let user = app.globalData.get_user_info(this, 'coupon_receive_back_event');
|
||||
if (user != false) {
|
||||
let index = res.index;
|
||||
let value = res.value;
|
||||
let temp_list = this.data_list;
|
||||
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_back_event')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -58,25 +58,25 @@
|
|||
popup_status: false,
|
||||
data_list: [],
|
||||
goods: null,
|
||||
config: null,
|
||||
config: null
|
||||
};
|
||||
},
|
||||
components: {
|
||||
componentPopup,
|
||||
componentNoData,
|
||||
componentNoData
|
||||
},
|
||||
// 属性
|
||||
props: {
|
||||
propGoods: {
|
||||
type: [Array,Object,String],
|
||||
default: '',
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
this.init_config();
|
||||
this.setData({
|
||||
goods: this.propGoods,
|
||||
goods: this.propGoods
|
||||
});
|
||||
},
|
||||
// 属性值改变监听
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
// 是否灰度
|
||||
propGoods(value, old_value) {
|
||||
this.setData({
|
||||
goods: value,
|
||||
goods: value
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue