Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
group-buy-ui
Commits
bc7fbac9
Commit
bc7fbac9
authored
Oct 06, 2021
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加app版本判断
parent
20b49deb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
32604 deletions
+24
-32604
package-lock.json
package-lock.json
+0
-32567
groupShare.vue
src/components/groupShare.vue
+24
-37
No files found.
package-lock.json
deleted
100644 → 0
View file @
20b49deb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/components/groupShare.vue
View file @
bc7fbac9
...
...
@@ -38,7 +38,8 @@ export default {
sharePicData
:
{},
shareInfo
:
{},
type
:
0
,
dataType
:
false
dataType
:
false
,
isCreatePic
:
isApp
&&
+
appVersion
.
replace
(
/
\.
/g
,
''
)
<
8260
// 8251
// typeStatus: {
// 0: '入口活动页面',
// 1: '拼团列表页面',
...
...
@@ -78,7 +79,6 @@ export default {
outputPicUrl
(
posterUrl
)
{
// 海报创建成功
this
.
sharePicData
.
posterUrl
=
posterUrl
;
this
.
getShareData
();
// 弹出分享框
if
(
isApp
)
{
// 如果是app环境直接调用app方法
...
...
@@ -86,6 +86,7 @@ export default {
}
if
(
isWxMp
)
{
// 如果是小程序则直接跳转海报保存页面
this
.
getShareData
();
// 创建分享数据
this
.
openTenetPosterUrl
();
}
this
.
$store
.
dispatch
(
'
change_loading
'
,
false
);
...
...
@@ -95,10 +96,13 @@ export default {
if
(
this
.
dataType
)
{
// 有海报数据时
if
(
params
.
posterUrl
)
{
this
.
getShareData
();
// 创建分享数据
this
.
appShareEventChange
();
// 调用app分享
}
else
{
this
.
$refs
.
sharePic
.
createAndUploadPic
(
params
);
if
(
this
.
isCreatePic
)
{
this
.
appShareEventChange
();
// 调用app分享
}
else
{
this
.
$refs
.
sharePic
.
createAndUploadPic
(
params
);
}
}
this
.
$store
.
dispatch
(
'
change_loading
'
,
false
);
return
;
...
...
@@ -112,33 +116,19 @@ export default {
const
[
res
]
=
await
groupBuyApi
.
getGroupShareInfo
(
orderNo
);
this
.
$store
.
dispatch
(
'
change_loading
'
,
true
);
this
.
sharePicData
=
res
;
!
isNotPic
&&
this
.
$refs
.
sharePic
.
createAndUploadPic
(
res
);
isWxMp
&&
this
.
sendSaTrackEvent
(
res
,
!
isNotPic
?
'
pic
'
:
'
weixin
'
);
this
.
$store
.
dispatch
(
'
change_loading
'
,
false
);
if
(
this
.
isCreatePic
)
{
this
.
appShareEventChange
();
// 调用app分享
}
else
{
!
isNotPic
&&
this
.
$refs
.
sharePic
.
createAndUploadPic
(
res
);
}
}
catch
(
err
)
{
this
.
$store
.
dispatch
(
'
change_loading
'
,
false
);
console
.
log
(
err
);
}
},
handleShareInfo
(
shareInfo
)
{
this
.
getShareData
();
// 获取分享数据
// 如果是小程序则首先弹出分享框
if
(
isWxMp
)
{
this
.
shareOpenWechat
();
}
if
(
isApp
)
{
if
(
shareInfo
.
posterUrl
)
{
// 如果是App并且有海报地址直接调用app分享方法
this
.
appShareEventChange
();
}
else
{
// 否则创建海报
this
.
$refs
.
sharePic
.
createAndUploadPic
(
this
.
sharePicData
);
}
}
this
.
$store
.
dispatch
(
'
change_loading
'
,
false
);
},
// 点击微信弹出框按钮
bundleShareClickItem
(
ev
)
{
let
params
=
this
.
sharePicData
;
...
...
@@ -198,9 +188,6 @@ export default {
imgUrl
:
sharePicData
.
skuImg
,
// 图片地
posterUrl
:
sharePicData
.
posterUrl
};
if
(
isApp
&&
+
appVersion
.
replace
(
/
\.
/g
,
''
)
<
8260
)
{
delete
shareInfo
.
posterUrl
;
}
this
.
shareInfo
=
shareInfo
;
},
filterShareInfo
()
{
...
...
@@ -286,22 +273,22 @@ export default {
});
},
appShareEventChange
()
{
this
.
getShareData
();
const
{
title
,
desc
,
link
,
imgUrl
,
posterUrl
}
=
this
.
shareInfo
;
let
shareDic
=
{
title
,
desc
,
link
,
imgUrl
};
let
platform
=
[
'
weChat
'
,
'
timeLine
'
,
'
QQ
'
,
'
CopyLink
'
];
//依次分别是微信、朋友圈、QQ好友、QQ空间、复制链接
if
(
!
this
.
isCreatePic
)
{
shareDic
.
posterUrl
=
posterUrl
;
platform
.
push
(
'
GeneratePoster
'
);
}
// 进行App分享
const
data
=
{
this
.
nativeBridge
.
showShareView
(
{
event
:
'
showShareView
'
,
data
:
{
platform
:
[
'
weChat
'
,
'
timeLine
'
,
'
QQ
'
,
'
CopyLink
'
,
'
GeneratePoster
'
],
//依次分别是微信、朋友圈、QQ好友、QQ空间、复制链接
shareDic
:
{
title
,
desc
,
link
,
// 页面地址
imgUrl
,
// 图片地址
posterUrl
}
platform
,
shareDic
}
};
this
.
nativeBridge
.
showShareView
(
data
);
});
},
tipDialogMessage
()
{
this
.
$dialog
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment