Commit ec94a064 authored by Xuguangxing's avatar Xuguangxing

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

parents 0ac257e2 2ce78d9f
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
sharePicData: {}, sharePicData: {},
shareInfo: {}, shareInfo: {},
type: 0,
typeStatus: { typeStatus: {
0: '入口活动页面', 0: '入口活动页面',
1: '拼团列表页面', 1: '拼团列表页面',
...@@ -67,10 +67,9 @@ export default { ...@@ -67,10 +67,9 @@ export default {
if (typeof shareInfo === 'object') { if (typeof shareInfo === 'object') {
this.sharePicData = shareInfo; this.sharePicData = shareInfo;
this.handleShareInfo(shareInfo); this.handleShareInfo(shareInfo);
// 如果shareInfo为data数据则直接创建海报
return; return;
} }
// 调用分享数据接口 // 如果shareInfo为data数据则直接创建海报
this.getGroupShareInfo(shareInfo); this.getGroupShareInfo(shareInfo);
}); });
}, },
...@@ -128,19 +127,24 @@ export default { ...@@ -128,19 +127,24 @@ export default {
const type = this.type; const type = this.type;
let shareInfo = this.sharePicData; let shareInfo = this.sharePicData;
let linkPath = ''; let linkPath = '';
let detailData = {
skuNo: shareInfo.skuNo,
goodsSpecialId: shareInfo.goodsSpecialId,
activityId: shareInfo.activityId,
templateId: shareInfo.templateId,
templateDetailId: shareInfo.templateDetailId
};
switch (type) { switch (type) {
case 0: case 0:
linkPath = `${config.localHost}/groupBuy/list?h=0&activityId=${shareInfo.activityId}`; linkPath = `${config.localHost}/groupBuy/list?h=0&activityId=${shareInfo.activityId}`;
break; break;
case 1: case 1:
linkPath = qs.stringify({ case 2:
skuNo: shareInfo.skuNo, case 3:
groupBuyGroupId: shareInfo.groupBuyGroupId, if (shareInfo.groupBuyGroupId) {
goodsSpecialId: shareInfo.goodsSpecialId, detailData.groupBuyGroupId = shareInfo.groupBuyGroupId;
activityId: shareInfo.activityId, }
templateId: shareInfo.templateId, linkPath = qs.stringify(detailData);
templateDetailId: shareInfo.templateDetailId
});
linkPath = `${config.localHost}/groupBuy/skuInfo?h=0&${linkPath}`; linkPath = `${config.localHost}/groupBuy/skuInfo?h=0&${linkPath}`;
break; break;
} }
......
...@@ -2,7 +2,7 @@ import { isAndroid, isIOS, isXyqb } from './validation.service'; ...@@ -2,7 +2,7 @@ import { isAndroid, isIOS, isXyqb } from './validation.service';
import Bridge from '@qg/js-bridge'; import Bridge from '@qg/js-bridge';
const jsBridge = new Bridge(); const jsBridge = new Bridge();
import Vue from 'vue'; import Vue from 'vue';
// import qs from 'qs';
export const EventBus = new Vue(); export const EventBus = new Vue();
/** /**
* 替换邮箱字符 * 替换邮箱字符
...@@ -365,19 +365,7 @@ export function setAppTitleColor(bgcolor = '#fff') { ...@@ -365,19 +365,7 @@ export function setAppTitleColor(bgcolor = '#fff') {
}); });
} }
export function appShareEventChange({ title, desc, link, imgUrl, posterUrl }) { // export function paramsParentheses(urlPath) {
const data = { // console.log(qs);
event: 'showShareView', // // urlPath
data: { // }
platform: ['weChat', 'timeLine', 'QQ', 'CopyLink', 'GeneratePoster'], //依次分别是微信、朋友圈、QQ好友、QQ空间、复制链接
shareDic: {
title,
desc,
link, // 页面地址
imgUrl, // 图片地址
posterUrl
}
}
};
jsBridge.showShareView(data);
}
import * as types from './type'; import * as types from './type';
import groupBuy from '@/api/groupBuy'; import groupBuy from '@/api/groupBuy';
import { isWxMp, isApp } from '@/service/validation.service'; import { isWxMp } from '@/service/validation.service';
import { appShareEventChange } from '@/service/utils.service'; // import { paramsParentheses } from '@/service/utils.service';
const state = { const state = {
header: true, header: true,
title: '支付中心', title: '支付中心',
...@@ -105,7 +105,8 @@ const mutations = { ...@@ -105,7 +105,8 @@ const mutations = {
// 'https://group-buy-test1.liangkebang.net/groupBuy/list?h=0&activityId=39'// // 'https://group-buy-test1.liangkebang.net/groupBuy/list?h=0&activityId=39'//
const [res] = await groupBuy.getScheme({ const [res] = await groupBuy.getScheme({
miniUrl: 'pages/product/goodDetail', miniUrl: 'pages/product/goodDetail',
params: window.location.href // params: `url=${window.location.href}`
params: `url=${'https://group-buy-test1.liangkebang.net/groupBuy/list&h=0&activityId=39'}`
}); });
const url = res; const url = res;
window.location.href = url; // todo 需要验证 window.location.href = url; // todo 需要验证
...@@ -122,9 +123,6 @@ const mutations = { ...@@ -122,9 +123,6 @@ const mutations = {
state.shareInfo = options; state.shareInfo = options;
state.showShare = true; state.showShare = true;
} }
if (isApp) {
appShareEventChange(options);
}
}, },
[types.GOODS_SHARE_CLOSE](state) { [types.GOODS_SHARE_CLOSE](state) {
state.showShare = false; state.showShare = false;
......
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