Commit 91ad93f9 authored by beisir's avatar beisir

feat:更新

parent 760d2df7
......@@ -53,8 +53,10 @@ export default {
this.shareDialogConfirm();
}
const nativeBridge = this.nativeBridge;
console.log('派发事件!');
EventBus.$emit('shareClickItem', { ev, nativeBridge });
const name = this.$route.name;
console.log(`shareClickItem${name}`);
console.log(name);
EventBus.$emit(`shareClickItem${name}`, { ev, nativeBridge });
registeredEvents('H5_GroupZeroYuanPurchaseActivityPageSharePopupWindowBtnClick', {
sku_no: '',
buttons_name: '', // 按钮名称
......
......@@ -15,7 +15,7 @@ module.exports = [
path: '/groupBuy/list',
name: 'groupBuyList',
component: () => import('../views/goodsList/index.vue'),
meta: { title: '0元购大牌', keepLive: true }
meta: { title: '0元购大牌' }
},
{
path: '/orderList/:status',
......
......@@ -135,7 +135,14 @@ export default {
// this.hasLogin = !!localStorage.get('vccToken');
},
mounted() {
this.showLoops = true;
this.$nextTick(() => {
this.$refs.swipeRota && this.$refs.swipeRota.onSlidePrevChange();
});
this.showLoading = true;
this.onShareEventChange();
console.log('开启EventBus');
},
beforeRouteEnter(to, from, next) {
const { activityId } = to.query;
......@@ -149,20 +156,27 @@ export default {
getActivityList(to.query, next);
}
},
deactivated() {
beforeDestroy() {
console.log('关闭EventBus');
const name = this.$route.name;
EventBus.$off(`shareClickItem${name}`);
clearTimeout((this.$refs.swipeRota && this.$refs.swipeRota.timer) || null);
this.showLoops = false;
EventBus.$off('shareClickItem');
},
activated() {
this.showLoops = true;
this.$nextTick(() => {
this.$refs.swipeRota && this.$refs.swipeRota.onSlidePrevChange();
});
this.onShareEventChange();
// this.setTitleColor(this.goodsTemp.bgcolor);
// store.commit('changeTitle', this.goodsTemp.title || '活动页');
},
// deactivated() {
// clearTimeout((this.$refs.swipeRota && this.$refs.swipeRota.timer) || null);
// this.showLoops = false;
// },
// activated() {
// this.showLoops = true;
// this.$nextTick(() => {
// this.$refs.swipeRota && this.$refs.swipeRota.onSlidePrevChange();
// });
// console.log('开启EventBus');
// // this.setTitleColor(this.goodsTemp.bgcolor);
// // store.commit('changeTitle', this.goodsTemp.title || '活动页');
// },
methods: {
animationEventStart() {
this.showSwipe = false;
......@@ -190,7 +204,8 @@ export default {
},
onShareEventChange() {
const vm = this;
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
const name = this.$route.name;
EventBus.$on(`shareClickItem${name}`, async function({ ev, nativeBridge }) {
let shareDic = await vm.getShareData();
if (ev === 'pic') {
// 分享海报跳转小程序海报分享页面
......
......@@ -88,7 +88,9 @@ export default {
this.onShareEventChange();
},
beforeDestroy() {
EventBus.$off('shareClickItem');
console.log('订单页EventBusClose');
const name = this.$route.name;
EventBus.$off(`shareClickItem${name}`);
},
created() {
this.nativeBridge = new MpBridge();
......@@ -118,7 +120,10 @@ export default {
},
onShareEventChange() {
const vm = this;
EventBus.$on('shareClickItem', async function({ ev, nativeBridge }) {
const name = this.$route.name;
console.log(`shareClickItem${name}`);
EventBus.$on(`shareClickItem${name}`, async function({ ev, nativeBridge }) {
console.log('订单页EventBusOpen');
const shareDic = await vm.getShareData(vm.sharePicData);
console.log(shareDic);
if (ev === 'pic') {
......@@ -126,7 +131,6 @@ export default {
// 分享海报跳转小程序海报分享页面
}
if (ev === 'weixin') {
// const res = await groupBuyApi.getGroupShareInfo(this.shareInfo.order);
// 分享朋友派发微信postMessage事件
nativeBridge.run({
event: 'showShareView',
......
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