Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
34903bae
Commit
34903bae
authored
Jun 05, 2026
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享
parent
e0bf26c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
30 deletions
+11
-30
src/components/activity/coupon.vue
+1
-1
src/pages/index/index.vue
+9
-28
src/utils/mayi.js
+1
-1
No files found.
src/components/activity/coupon.vue
View file @
34903bae
...
...
@@ -648,7 +648,7 @@ export default {
useCoupon
(
val
)
{
coupon
.
receive_coupon
(
this
.
couponCode
).
then
(
res
=>
{
console
.
log
(
res
,
"cou137"
);
if
(
res
.
data
.
data
==
'true'
)
{
if
(
res
.
data
.
code
==
200
)
{
this
.
couItem
.
receiveStatus
=
1
;
if
(
val
==
1
)
{
wx
.
showToast
({
...
...
src/pages/index/index.vue
View file @
34903bae
...
...
@@ -535,6 +535,8 @@ export default {
this
.
withoutScene
=
true
;
console
.
log
(
this
.
withoutScene
,
this
.
newPageUrl
,
'index页面------onShow'
)
log
.
info
(
'index页面------onShow'
)
// 提前获取分销员信息,供 onShareAppMessage 使用
this
.
getSpokesman
();
},
methods
:
{
init
()
{
...
...
@@ -577,7 +579,8 @@ export default {
},
async
getSpokesman
()
{
await
spokesman
.
getSpokesmanidByShare
().
then
(
res
=>
{
log
.
info
(
'onShareAppMessage-getSpokesmanidByShare'
,
res
)
log
.
info
(
'onShareAppMessage-getSpokesmanidByShare'
,
res
)
console
.
log
(
'onShareAppMessage-getSpokesmanidByShare'
,
res
.
data
.
data
)
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
hasInvitationStatus
==
1
)
{
this
.
hasInvitationStatus
=
1
;
...
...
@@ -616,7 +619,7 @@ export default {
//分享内容中有订单信息为送礼活动
this
.
shareOrderSn
=
res
.
target
.
data
[
len
].
orderSn
;
this
.
shareTid
=
res
.
target
.
data
[
len
].
shareTid
;
this
.
newWindowHref
=
res
.
target
.
data
[
len
].
shareImgUrl
+
'&verifyShare=1'
;
// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
this
.
newWindowHref
=
res
.
target
.
data
[
len
].
shareImgUrl
+
'&
\
verifyShare=1'
;
// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
log
.
info
(
"getMessage-分享信息:"
,
this
.
shareLogoUrl
,
this
.
shareShopName
,
1111111
,
this
.
newWindowHref
);
console
.
log
(
"getMessage-分享信息:"
,
this
.
shareLogoUrl
,
this
.
shareShopName
,
1111111
,
this
.
newWindowHref
);
//文章详情分享埋点
...
...
@@ -771,9 +774,8 @@ export default {
onUnload
()
{
log
.
info
(
"卸载----------------"
,
this
.
options
);
},
async
onShareAppMessage
(
res
)
{
onShareAppMessage
(
res
)
{
log
.
info
(
'onShareAppMessage'
,
res
)
await
this
.
getSpokesman
();
let
url
=
''
log
.
info
(
this
.
newWindowHref
+
'this.newWindowHref'
)
//分享路径
...
...
@@ -794,9 +796,6 @@ export default {
this
.
shopId
}
`
;
}
log
.
info
(
'shareUrl---------------'
+
url
)
console
.
log
(
'shareUrl---------------'
+
url
)
//增加分销员信息
if
(
this
.
hasInvitationStatus
==
1
&&
url
.
indexOf
(
'spokesmanGroupId'
)
==-
1
){
this
.
shareUrl
=
url
+
this
.
newHref
...
...
@@ -805,31 +804,13 @@ export default {
}
log
.
info
(
'onShareAppMessage-shareUrl'
,
this
.
shareUrl
,
);
console
.
log
(
'onShareAppMessage-shareUrl'
,
this
.
shareUrl
,
);
log
.
info
(
`/pages/index/main?share=
${
encodeURIComponent
(
this
.
shareUrl
)}
`
,
'测试直播分享相关'
)
console
.
log
(
'onShareAppMessage-shareShopName'
,
this
.
shareShopName
);
console
.
log
(
'onShareAppMessage-shareUrl'
,
`/pages/index/main?share=
${
encodeURIComponent
(
this
.
shareUrl
)}
`
);
console
.
log
(
'onShareAppMessage-shareLogoUrl'
,
this
.
shareLogoUrl
);
return
{
title
:
this
.
shareShopName
,
// 默认是小程序的名称
path
:
`/pages/index/main?share=
${
encodeURIComponent
(
this
.
shareUrl
)}
`
,
// 默认是当前页面
imageUrl
:
this
.
shareLogoUrl
,
success
:
function
(
res
)
{
// 转发成功之后的回调
if
(
res
.
errMsg
==
"shareAppMessage:ok"
)
{
log
.
info
(
res
,
"分享成功"
);
}
},
fail
:
function
()
{
// 转发失败之后的回调
if
(
res
.
errMsg
==
"shareAppMessage:fail cancel"
)
{
// 用户取消转发
log
.
info
(
res
,
"分享失败"
);
}
else
if
(
res
.
errMsg
==
"shareAppMessage:fail"
)
{
// 转发失败,其中 detail message 为详细失败信息
}
},
complete
:
function
()
{
// 转发结束之后的回调(转发成不成功都会执行)
}
};
}
};
...
...
src/utils/mayi.js
View file @
34903bae
...
...
@@ -342,7 +342,7 @@ export function getCoupon(code, item) {
function
useCoupon
(
val
,
couponCode
,
usingIntegrals
)
{
coupon
.
receive_coupon
(
couponCode
).
then
(
res
=>
{
console
.
log
(
res
,
"cou137"
);
if
(
res
.
data
.
data
==
"true"
)
{
if
(
res
.
data
.
code
==
200
)
{
if
(
val
==
1
)
{
wx
.
showToast
({
title
:
"领取成功"
,
icon
:
"success"
});
}
else
{
...
...
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