Commit 8eb78cb4 authored by 徐光星's avatar 徐光星

Merge branch 'feat/tongdun' into 'master'

Feat/tongdun

See merge request !100
parents d2008a09 f0ec9398
......@@ -54,9 +54,9 @@ if (EASY_ENV_IS_BROWSER) {
if (json.event === 'getTokenSuccess') {
EventBus.$emit('NATIVE_EVENT_GET_TOKEN', json);
}
if (json.event === 'getTongdunIdSuccess') {
EventBus.$emit('NATIVE_EVENT_GET_TDONGDUN_ID', json);
}
// if (json.event === 'getTongdunIdSuccess') {
// EventBus.$emit('NATIVE_EVENT_GET_TDONGDUN_ID', json);
// }
};
}
@Component({
......
......@@ -178,31 +178,30 @@ export default class Activity extends Mixins(TransformStyleMixin, BottomNavStyle
// 获取优惠券弹窗相关配置
if (this.pageData?.props?.couponModal && this.pageData?.props?.couponModal.length) {
const couponPushIdList = this.pageData.props.couponModal.join(',');
let tongdunDeviceId = '';
// 先获取同盾ID,再调用优惠券弹窗推送接口
if (EASY_ENV_IS_BROWSER) {
if (isApp) {
// app的时候通过事件获取同盾id
EventBus.$on('NATIVE_EVENT_GET_TDONGDUN_ID', res => {
console.log('getTongdunIdInAppSuccess', JSON.stringify(res));
tongdunDeviceId = res.data.tongdunDeviceId || '';
this.getCouponModalDetailReq(couponPushIdList, tongdunDeviceId);
});
const bridge = new Bridge();
bridge.run({
event: 'getTongdunId',
data: {},
});
this.getCouponModalDetailReq(couponPushIdList);
// // app的时候通过事件获取同盾id
// EventBus.$on('NATIVE_EVENT_GET_TDONGDUN_ID', res => {
// console.log('getTongdunIdInAppSuccess', JSON.stringify(res));
// tongdunDeviceId = res.data.tongdunDeviceId || '';
// this.getCouponModalDetailReq(couponPushIdList, tongdunDeviceId);
// });
// const bridge = new Bridge();
// bridge.run({
// event: 'getTongdunId',
// data: {},
// });
}
}
}
},
async getCouponModalDetailReq(couponPushIdList, tongdunDeviceId) {
async getCouponModalDetailReq(couponPushIdList) {
// 获取推送弹窗数据
if (!couponPushIdList || !tongdunDeviceId) { return; }
if (!couponPushIdList) { return; }
const [res, err] = await modalApi.getCouponModal({
couponPushIdList,
tongdunDeviceId
});
if (err) { return; }
if (res && Object.keys(res).length) {
......
This diff is collapsed.
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