Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
h5-base
Commits
cc4d87fb
Commit
cc4d87fb
authored
Jul 08, 2019
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liwei
parent
f473fbc5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
99 deletions
+130
-99
inviteFriends.vue
src/components/buy/inviteFriends.vue
+130
-99
No files found.
src/components/buy/inviteFriends.vue
View file @
cc4d87fb
...
...
@@ -15,9 +15,11 @@
</p>
<div
class=
"invite-record-btn"
@
click=
"lookMyInviteRecords"
v-if=
"earnings>0||userNum>0"
>
<p>
查看我的邀请记录
</p>
<div
class=
"img-container"
>
<img
src=
"../../assets/inviteFriends/icon_back.png"
/>
</div>
</div>
</div>
<div
class=
"invite-friends cell"
>
<img
src=
"../../assets/inviteFriends/img_title2.png"
alt
/>
</div>
...
...
@@ -43,14 +45,16 @@
<p>
{{
item
.
pay_at
}}
</p>
</li>
</ul>
<div
class=
"look-more-record"
@
click=
"lookMoreRecord"
v-if=
"records.length >
6
"
>
<div
class=
"look-more-record"
@
click=
"lookMoreRecord"
v-if=
"records.length >
0
"
>
<p>
查看更多
</p>
<div
class=
"img-container"
>
<img
src=
"../../assets/inviteFriends/icon_back.png"
/>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"invite-friends cell"
>
<img
src=
"../../assets/inviteFriends/img_title6.png"
alt
/>
</div>
...
...
@@ -65,9 +69,11 @@ import {
getwechatParam
,
getInviteResultApi
,
getInviteListApi
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
}
from
"../../service/api"
;
import
{
Toast
}
from
'vant'
;
import
{
Toast
}
from
"vant"
;
export
default
{
name
:
"inviteFriends"
,
components
:
{},
...
...
@@ -75,27 +81,24 @@ export default {
return
{
earnings
:
0
,
userNum
:
0
,
records
:
[
],
shareTitle
:
'钜惠来袭!唱唱21天英语训练营,全勤学习返66元现金'
,
shareDesc
:
'21天让宝宝爱上说英语,报课即送教具礼盒,包邮送到家!'
,
invite_code
:
''
,
shopId
:
''
,
groupId
:
null
,
records
:
[],
shareTitle
:
"钜惠来袭!唱唱21天英语训练营,全勤学习返66元现金"
,
shareDesc
:
"21天让宝宝爱上说英语,报课即送教具礼盒,包邮送到家!"
,
invite_code
:
""
,
shopId
:
""
,
groupId
:
null
};
},
mounted
()
{
if
(
this
.
$route
.
query
.
shopId
)
{
if
(
this
.
$route
.
query
.
shopId
)
{
this
.
shopId
=
this
.
$route
.
query
.
shopId
;
}
else
{
this
.
shopId
=
46
}
else
{
this
.
shopId
=
46
;
}
this
.
getInviteResult
();
this
.
getInviteList
();
this
.
onShare
()
this
.
onShare
()
;
// this.getDetail()
},
methods
:
{
lookMyInviteRecords
()
{
...
...
@@ -125,8 +128,8 @@ export default {
let
query
=
{};
if
(
window
.
location
.
href
.
indexOf
(
"shopId"
)
>
-
1
)
{
query
.
shopId
=
this
.
$route
.
query
.
shopId
;
}
else
{
query
.
shopId
=
46
}
else
{
query
.
shopId
=
46
;
}
if
(
window
.
location
.
href
.
indexOf
(
"groupId"
)
>
-
1
)
{
query
.
groupId
=
this
.
$route
.
query
.
groupId
;
...
...
@@ -140,8 +143,8 @@ export default {
enableShare
:
function
(
opition
)
{
let
that
=
this
;
getwechatParam
({
api_list
:
'onMenuShareAppMessage,onMenuShareTimeline'
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
api_list
:
"onMenuShareAppMessage,onMenuShareTimeline"
,
url
:
window
.
location
.
href
.
split
(
"#"
)[
0
]
}).
then
(
wechatRes
=>
{
wx
.
config
({
debug
:
false
,
...
...
@@ -154,50 +157,63 @@ export default {
wx
.
ready
(
function
()
{
wx
.
onMenuShareTimeline
({
title
:
that
.
shareTitle
,
// 分享标题
desc
:
that
.
shareDesc
,
// 分享描述
desc
:
that
.
shareDesc
,
// 分享描述
link
:
opition
.
shareUrl
,
// 分享链接
imgUrl
:
'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png'
,
// 分享图标
imgUrl
:
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png"
,
// 分享图标
success
:
function
()
{
console
.
log
(
'分享成功'
);
window
.
_hmt
.
push
([
'_trackEvent'
,
'分享'
,
"商品页好友分享"
,
`id
${
that
.
shopId
}
`
,
that
.
invite_code
]);
//百度统计
console
.
log
(
"分享成功"
);
window
.
_hmt
.
push
([
"_trackEvent"
,
"分享"
,
"商品页好友分享"
,
`id
${
that
.
shopId
}
`
,
that
.
invite_code
]);
//百度统计
},
cancel
:
function
()
{
// alert("失败")
console
.
log
(
'分享失败'
)
console
.
log
(
"分享失败"
);
}
});
wx
.
onMenuShareAppMessage
({
title
:
that
.
shareTitle
,
// 分享标题
desc
:
that
.
shareDesc
,
// 分享描述
desc
:
that
.
shareDesc
,
// 分享描述
link
:
opition
.
shareUrl
,
// 分享链接
imgUrl
:
'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png'
,
// 分享图标
imgUrl
:
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png"
,
// 分享图标
success
:
function
()
{
window
.
_hmt
.
push
([
'_trackEvent'
,
'分享'
,
"商品页朋友圈分享"
,
`id
${
that
.
shopId
}
`
,
that
.
invite_code
]);
//百度统计
window
.
_hmt
.
push
([
"_trackEvent"
,
"分享"
,
"商品页朋友圈分享"
,
`id
${
that
.
shopId
}
`
,
that
.
invite_code
]);
//百度统计
},
cancel
:
function
()
{
}
cancel
:
function
()
{}
});
});
});
})
})
},
onShare
:
function
(
type
)
{
let
ownDetail
=
JSON
.
parse
(
localStorage
.
getItem
(
"userDesc"
));
let
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&groupId=
${
this
.
groupId
}
&invite_code=
${
this
.
invite_code
}
&nickname=
${
ownDetail
.
nickname
}
`
;
if
(
!
this
.
invite_code
)
{
if
(
!
this
.
invite_code
)
{
// debugger
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
;
this
.
invite_code
=
'CC-USER-'
+
this
.
user_id
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
this
.
invite_code
}
&nickname=
${
ownDetail
.
nickname
}
`
}
else
{
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
this
.
invite_code
}
&nickname=
${
ownDetail
.
nickname
}
`
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
"userDesc"
)).
user_id
;
this
.
invite_code
=
"CC-USER-"
+
this
.
user_id
;
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
this
.
invite_code
}
&nickname=
${
ownDetail
.
nickname
}
`
;
}
else
{
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
this
.
invite_code
}
&nickname=
${
ownDetail
.
nickname
}
`
;
}
// if(type === 1 ){
// }
this
.
enableShare
({
shareUrl
:
URL
})
},
shareUrl
:
URL
});
}
}
};
</
script
>
...
...
@@ -251,7 +267,7 @@ export default {
}
.cell-content.people {
top: 24vw;
right:
-
1vw;
right: 1vw;
}
.invite-record-btn {
position: absolute;
...
...
@@ -261,16 +277,23 @@ export default {
align-items: center;
font-size: 26 * @tocurrentvw;
bottom: 26 * @tocurrentvh;
display: flex;
p {
margin-left: 28%;
margin-left: 30%;
display: flex;
justify-content: flex-end;
}
.img-container {
flex: 1;
display: flex;
img {
margin-right: 35
%;
margin-left: 2
%;
display: block;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
}
}
}
.invite-record-list {
width: 676 * @tocurrentvw;
// height: 592 * @tocurrentvh;
...
...
@@ -285,7 +308,7 @@ export default {
border-radius: 10 * @tocurrentvw;
.record-content {
margin: 19 * @tocurrentvh 15 * @tocurrentvw;
margin-bottom:
0
;
margin-bottom:
19 * @tocurrentvh
;
width: 626 * @tocurrentvw;
.no-record {
height: 76 * @tocurrentvh;
...
...
@@ -324,7 +347,7 @@ export default {
}
p {
text-align: center;
width:
4
0%;
width:
5
0%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
...
...
@@ -332,20 +355,28 @@ export default {
}
}
.look-more-record {
height: 65 * @tocurrentvh;
// height: 65 * @tocurrentvh;
margin-top: 19 * @tocurrentvh;
width: 100%;
font-size: 26 * @tocurrentvw;
color: #eb7162;
display: flex;
justify-content: center;
align-items: center;
position: relative;
p {
margin-left: 40%;
display: flex;
justify-content: flex-end;
}
.img-container {
flex: 1;
display: flex;
img {
// display: none
;
position: absolute
;
margin-left: 2%
;
display: block
;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
transform: translatex(80 * @tocurrentvw);
}
}
}
}
...
...
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