Commit be0602e7 authored by beisir's avatar beisir

Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy

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