Commit d5629179 authored by Xuguangxing's avatar Xuguangxing

feat: 增加各个页面默认分享message

parent c81c6ecd
......@@ -27,6 +27,7 @@
import EmptyAddress from './emptyAddress';
import address from '@/api/address.api';
import localStorage from '@/service/localStorage.service';
import { firstGroupShare } from '@/service/utils.service';
export default {
components: {
EmptyAddress
......@@ -47,6 +48,7 @@ export default {
mounted() {
this.isSelect = this.$route.query.source == 1;
this.loadAddress();
firstGroupShare();
},
methods: {
toEdit(item) {
......
......@@ -72,6 +72,7 @@ import address from '@/api/address.api';
import { EventBus } from '@/service/utils.service';
import PopupAreaTabPicker from '@/components/popupAreaTabPicker';
const ADDRESS_ADD = 'addressAdd';
import { firstGroupShare } from '@/service/utils.service';
export default {
components: {
PopupAreaTabPicker
......@@ -95,6 +96,7 @@ export default {
};
},
mounted() {
firstGroupShare();
this.type = this.$route.query.type || '';
this.order = this.$route.query.type || false;
console.log(this.order);
......
......@@ -208,7 +208,7 @@ import groupDescInfo from './components/groupDescInfo';
import { mapState } from 'vuex';
import localStorage from '@/service/localStorage.service';
import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import { EventBus } from '@/service/utils.service';
import { EventBus, firstGroupShare } from '@/service/utils.service';
import { saTrackEvent } from '@/service/sa.service';
import { isApp, isWxMp } from '@/service/validation.service';
export default {
......@@ -411,6 +411,14 @@ export default {
const query = { ...this.$route.query };
return this.$router.replace({ name: 'groupBuySkuInfoSmallPic', query });
}
firstGroupShare(
{
...this.$route.query,
skuName: res.goodsName,
skuImg: res.thumbImageUrl
},
2
);
this.imgList = res.imageUrl || [];
this.detailInfo = res;
this.setStartStatus(res);
......
......@@ -122,7 +122,7 @@ import successInfo from '@/components/groupBuySuccessInfo';
import rules from '@/components/rules';
import groupDescInfo from './components/groupDescInfo';
import localStorage from '@/service/localStorage.service';
import { EventBus } from '@/service/utils.service';
import { EventBus, firstGroupShare } from '@/service/utils.service';
// import sharePic from '@/components/sharePic';
import config from '@/config';
import { mapState } from 'vuex';
......@@ -214,6 +214,14 @@ export default {
},
async init(detailParam) {
const [res] = await goods.detailInfo(detailParam);
firstGroupShare(
{
...this.$route.query,
skuName: res.goodsName,
skuImg: res.thumbImageUrl
},
2
);
if (res.groupBuyInfo.groupId) {
// localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单
this.groupId = +res.groupBuyInfo.groupId || '';
......
......@@ -84,6 +84,7 @@ import cookies from '@/service/cookieStorage.service';
import { isApp, isWxMp } from '@/service/validation.service';
import { mapState } from 'vuex';
import { saTrackEvent } from '@/service/sa.service';
import { firstGroupShare } from '@/service/utils.service';
export default {
name: 'CreateOrder',
components: {
......@@ -117,6 +118,7 @@ export default {
})
},
mounted() {
firstGroupShare();
this.init();
},
activated() {
......
......@@ -104,7 +104,7 @@ import crSmsCodeModal from './components/SmsModal';
import { isWechat } from '@/service/validation.service';
import { encryptByDESModeEBC } from '@/service/encrypt';
import localStorage from '@/service/localStorage.service';
import { throttle } from '@/service/utils.service';
import { throttle, firstGroupShare } from '@/service/utils.service';
// import { goUrlExtends } from './extends';
import cookies from '@/service/cookieStorage.service';
import { saTrackEvent } from '@/service/sa.service';
......@@ -225,6 +225,7 @@ export default {
}
},
mounted() {
firstGroupShare();
this.getQuery();
this.setIsOrder();
this.orderNo = this.$route.query.orderNo;
......
......@@ -19,12 +19,7 @@
</p>
<div class="actions">
<cr-button shape="circle" type="default" @click="goPage(1)">我的拼团</cr-button>
<cr-button
shape="circle"
class="actions__back"
:plain="true"
type="primary"
@click="setShareData"
<cr-button shape="circle" class="actions__back" :plain="true" type="primary" @click="share"
>邀请好友</cr-button
>
</div>
......@@ -73,7 +68,7 @@ import { getCouponList } from '@/api/pay.api';
import groupBuyApi from '@/api/groupBuy';
// import Goods from '@/components/RecoGoods/RecoGoods.vue';
import { isApp, isWxMp } from '@/service/validation.service';
import { EventBus } from '@/service/utils.service';
import { EventBus, firstGroupShare } from '@/service/utils.service';
import MpBridge from '@/service/mp';
import cookies from '@/service/cookieStorage.service';
export default {
......@@ -93,7 +88,8 @@ export default {
payStatusName: '',
payMethodName: '',
payType: '',
picUrl: ''
picUrl: '',
shareInfo: {}
};
},
created() {
......@@ -122,17 +118,22 @@ export default {
this.payStatus = success ? '订单支付成功' : '订单支付失败';
this.payStatusName = success ? '支付成功' : '支付失败';
this.getCouponList();
this.setShareData();
},
methods: {
share() {
EventBus.$emit('goods_share_info', {
shareInfo: this.shareInfo,
type: 3
});
},
async setShareData() {
const [res, error] = await groupBuyApi.getGroupShareInfo(this.orderNo);
if (error) {
return this.$toast('获取分享数据失败');
}
EventBus.$emit('goods_share_info', {
shareInfo: res,
type: 3
});
this.shareInfo = res;
firstGroupShare(res, 3);
},
goPage(type) {
if (type == 1) {
......
......@@ -28,6 +28,7 @@ import { queryPayStatus } from '@/api/pay.api';
import cookies from '@/service/cookieStorage.service';
import { goUrlExtends } from './extends';
import { isApp } from '@/service/validation.service';
import { firstGroupShare } from '@/service/utils.service';
export default {
components: {},
extends: goUrlExtends,
......@@ -51,6 +52,7 @@ export default {
}
},
mounted() {
firstGroupShare();
this.$dialog({
message: '请确认订单已完成支付',
confirmButtonText: '已完成支付',
......
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