Commit f0ec9398 authored by 徐光星's avatar 徐光星

feat: 去除优惠券弹窗需要同盾ID逻辑

parent d3660e7b
...@@ -54,9 +54,9 @@ if (EASY_ENV_IS_BROWSER) { ...@@ -54,9 +54,9 @@ if (EASY_ENV_IS_BROWSER) {
if (json.event === 'getTokenSuccess') { if (json.event === 'getTokenSuccess') {
EventBus.$emit('NATIVE_EVENT_GET_TOKEN', json); EventBus.$emit('NATIVE_EVENT_GET_TOKEN', json);
} }
if (json.event === 'getTongdunIdSuccess') { // if (json.event === 'getTongdunIdSuccess') {
EventBus.$emit('NATIVE_EVENT_GET_TDONGDUN_ID', json); // EventBus.$emit('NATIVE_EVENT_GET_TDONGDUN_ID', json);
} // }
}; };
} }
@Component({ @Component({
......
...@@ -178,31 +178,30 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle ...@@ -178,31 +178,30 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
// 获取优惠券弹窗相关配置 // 获取优惠券弹窗相关配置
if (this.pageData?.props?.couponModal && this.pageData?.props?.couponModal.length) { if (this.pageData?.props?.couponModal && this.pageData?.props?.couponModal.length) {
const couponPushIdList = this.pageData.props.couponModal.join(','); const couponPushIdList = this.pageData.props.couponModal.join(',');
let tongdunDeviceId = '';
// 先获取同盾ID,再调用优惠券弹窗推送接口 // 先获取同盾ID,再调用优惠券弹窗推送接口
if (EASY_ENV_IS_BROWSER) { if (EASY_ENV_IS_BROWSER) {
if (isApp) { if (isApp) {
// app的时候通过事件获取同盾id this.getCouponModalDetailReq(couponPushIdList);
EventBus.$on('NATIVE_EVENT_GET_TDONGDUN_ID', res => { // // app的时候通过事件获取同盾id
console.log('getTongdunIdInAppSuccess', JSON.stringify(res)); // EventBus.$on('NATIVE_EVENT_GET_TDONGDUN_ID', res => {
tongdunDeviceId = res.data.tongdunDeviceId || ''; // console.log('getTongdunIdInAppSuccess', JSON.stringify(res));
this.getCouponModalDetailReq(couponPushIdList, tongdunDeviceId); // tongdunDeviceId = res.data.tongdunDeviceId || '';
}); // this.getCouponModalDetailReq(couponPushIdList, tongdunDeviceId);
const bridge = new Bridge(); // });
bridge.run({ // const bridge = new Bridge();
event: 'getTongdunId', // bridge.run({
data: {}, // event: 'getTongdunId',
}); // data: {},
// });
} }
} }
} }
}, },
async getCouponModalDetailReq(couponPushIdList, tongdunDeviceId) { async getCouponModalDetailReq(couponPushIdList) {
// 获取推送弹窗数据 // 获取推送弹窗数据
if (!couponPushIdList || !tongdunDeviceId) { return; } if (!couponPushIdList) { return; }
const [res, err] = await modalApi.getCouponModal({ const [res, err] = await modalApi.getCouponModal({
couponPushIdList, couponPushIdList,
tongdunDeviceId
}); });
if (err) { return; } if (err) { return; }
if (res && Object.keys(res).length) { if (res && Object.keys(res).length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment