Commit cc4d87fb authored by liwei's avatar liwei

liwei

parent f473fbc5
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
</p> </p>
<div class="invite-record-btn" @click="lookMyInviteRecords" v-if="earnings>0||userNum>0"> <div class="invite-record-btn" @click="lookMyInviteRecords" v-if="earnings>0||userNum>0">
<p>查看我的邀请记录</p> <p>查看我的邀请记录</p>
<img src="../../assets/inviteFriends/icon_back.png" /> <div class="img-container">
<img src="../../assets/inviteFriends/icon_back.png" />
</div>
</div> </div>
</div> </div>
<div class="invite-friends cell"> <div class="invite-friends cell">
...@@ -43,9 +45,11 @@ ...@@ -43,9 +45,11 @@
<p>{{item.pay_at}}</p> <p>{{item.pay_at}}</p>
</li> </li>
</ul> </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> <p>查看更多</p>
<img src="../../assets/inviteFriends/icon_back.png" /> <div class="img-container">
<img src="../../assets/inviteFriends/icon_back.png" />
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -65,9 +69,11 @@ import { ...@@ -65,9 +69,11 @@ import {
getwechatParam, getwechatParam,
getInviteResultApi, getInviteResultApi,
getInviteListApi, getInviteListApi,
getGoodsDetailApi,getGroupDetailApi,getStatusWechatApi getGoodsDetailApi,
getGroupDetailApi,
getStatusWechatApi
} from "../../service/api"; } from "../../service/api";
import { Toast } from 'vant'; import { Toast } from "vant";
export default { export default {
name: "inviteFriends", name: "inviteFriends",
components: {}, components: {},
...@@ -75,27 +81,24 @@ export default { ...@@ -75,27 +81,24 @@ export default {
return { return {
earnings: 0, earnings: 0,
userNum: 0, userNum: 0,
records: [ records: [],
], shareTitle: "钜惠来袭!唱唱21天英语训练营,全勤学习返66元现金",
shareTitle: '钜惠来袭!唱唱21天英语训练营,全勤学习返66元现金', shareDesc: "21天让宝宝爱上说英语,报课即送教具礼盒,包邮送到家!",
shareDesc: '21天让宝宝爱上说英语,报课即送教具礼盒,包邮送到家!', invite_code: "",
invite_code:'', shopId: "",
shopId:'', groupId: null
groupId:null,
}; };
}, },
mounted() { mounted() {
if(this.$route.query.shopId){ if (this.$route.query.shopId) {
this.shopId = this.$route.query.shopId; this.shopId = this.$route.query.shopId;
}else{ } else {
this.shopId = 46 this.shopId = 46;
} }
this.getInviteResult(); this.getInviteResult();
this.getInviteList(); this.getInviteList();
this.onShare() this.onShare();
// this.getDetail() // this.getDetail()
}, },
methods: { methods: {
lookMyInviteRecords() { lookMyInviteRecords() {
...@@ -125,8 +128,8 @@ export default { ...@@ -125,8 +128,8 @@ export default {
let query = {}; let query = {};
if (window.location.href.indexOf("shopId") > -1) { if (window.location.href.indexOf("shopId") > -1) {
query.shopId = this.$route.query.shopId; query.shopId = this.$route.query.shopId;
}else{ } else {
query.shopId=46 query.shopId = 46;
} }
if (window.location.href.indexOf("groupId") > -1) { if (window.location.href.indexOf("groupId") > -1) {
query.groupId = this.$route.query.groupId; query.groupId = this.$route.query.groupId;
...@@ -137,67 +140,80 @@ export default { ...@@ -137,67 +140,80 @@ export default {
this.$router.push({ name: "activityInvite", query: query }); this.$router.push({ name: "activityInvite", query: query });
}, },
// 分享 // 分享
enableShare: function(opition) { enableShare: function(opition) {
let that = this; let that = this;
getwechatParam({ getwechatParam({
api_list: 'onMenuShareAppMessage,onMenuShareTimeline', api_list: "onMenuShareAppMessage,onMenuShareTimeline",
url:window.location.href.split('#')[0] url: window.location.href.split("#")[0]
}).then(wechatRes => { }).then(wechatRes => {
wx.config({ wx.config({
debug: false, debug: false,
appId: wechatRes.appId, appId: wechatRes.appId,
timestamp: parseInt(wechatRes.timestamp), timestamp: parseInt(wechatRes.timestamp),
nonceStr: wechatRes.nonceStr, nonceStr: wechatRes.nonceStr,
signature: wechatRes.signature, signature: wechatRes.signature,
jsApiList: wechatRes.jsApiList jsApiList: wechatRes.jsApiList
});
wx.ready(function() {
wx.onMenuShareTimeline({
title: that.shareTitle, // 分享标题
desc: that.shareDesc, // 分享描述
link: opition.shareUrl, // 分享链接
imgUrl:
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
console.log("分享成功");
window._hmt.push([
"_trackEvent",
"分享",
"商品页好友分享",
`id${that.shopId}`,
that.invite_code
]); //百度统计
},
cancel: function() {
// alert("失败")
console.log("分享失败");
}
}); });
wx.ready(function() { wx.onMenuShareAppMessage({
wx.onMenuShareTimeline({ title: that.shareTitle, // 分享标题
title: that.shareTitle, // 分享标题 desc: that.shareDesc, // 分享描述
desc: that.shareDesc,// 分享描述 link: opition.shareUrl, // 分享链接
link: opition.shareUrl, // 分享链接 imgUrl:
imgUrl: 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标 "https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() { success: function() {
console.log('分享成功'); window._hmt.push([
window._hmt.push(['_trackEvent', '分享', "商品页好友分享",`id${that.shopId}`,that.invite_code]);//百度统计 "_trackEvent",
}, "分享",
cancel: function() { "商品页朋友圈分享",
// alert("失败") `id${that.shopId}`,
console.log('分享失败') that.invite_code
} ]); //百度统计
}); },
wx.onMenuShareAppMessage({ cancel: function() {}
title: that.shareTitle, // 分享标题 });
desc: that.shareDesc,// 分享描述 });
link: opition.shareUrl, // 分享链接 });
imgUrl: 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标 },
success: function() { onShare: function(type) {
window._hmt.push(['_trackEvent', '分享', "商品页朋友圈分享",`id${that.shopId}`,that.invite_code]);//百度统计 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}`;
cancel: function() { 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 {
onShare: function(type) { URL = `${process.env.BUY_URL}shopId=${this.shopId}&invite_code=${this.invite_code}&nickname=${ownDetail.nickname}`;
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(type === 1 ){
if(!this.invite_code){
// debugger // }
this.user_id=JSON.parse(localStorage.getItem('userDesc')).user_id; this.enableShare({
this.invite_code = 'CC-USER-'+this.user_id shareUrl: URL
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
})
},
} }
}; };
</script> </script>
...@@ -251,7 +267,7 @@ export default { ...@@ -251,7 +267,7 @@ export default {
} }
.cell-content.people { .cell-content.people {
top: 24vw; top: 24vw;
right: -1vw; right: 1vw;
} }
.invite-record-btn { .invite-record-btn {
position: absolute; position: absolute;
...@@ -261,14 +277,21 @@ export default { ...@@ -261,14 +277,21 @@ export default {
align-items: center; align-items: center;
font-size: 26 * @tocurrentvw; font-size: 26 * @tocurrentvw;
bottom: 26 * @tocurrentvh; bottom: 26 * @tocurrentvh;
display: flex;
p { p {
margin-left: 28%; margin-left: 30%;
display: flex;
justify-content: flex-end;
} }
img { .img-container {
margin-right: 35%; flex: 1;
display: block; display: flex;
width: 12 * @tocurrentvw; img {
height: 20 * @tocurrentvh; margin-left: 2%;
display: block;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
}
} }
} }
.invite-record-list { .invite-record-list {
...@@ -285,7 +308,7 @@ export default { ...@@ -285,7 +308,7 @@ export default {
border-radius: 10 * @tocurrentvw; border-radius: 10 * @tocurrentvw;
.record-content { .record-content {
margin: 19 * @tocurrentvh 15 * @tocurrentvw; margin: 19 * @tocurrentvh 15 * @tocurrentvw;
margin-bottom: 0; margin-bottom: 19 * @tocurrentvh;
width: 626 * @tocurrentvw; width: 626 * @tocurrentvw;
.no-record { .no-record {
height: 76 * @tocurrentvh; height: 76 * @tocurrentvh;
...@@ -324,7 +347,7 @@ export default { ...@@ -324,7 +347,7 @@ export default {
} }
p { p {
text-align: center; text-align: center;
width: 40%; width: 50%;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -332,20 +355,28 @@ export default { ...@@ -332,20 +355,28 @@ export default {
} }
} }
.look-more-record { .look-more-record {
height: 65 * @tocurrentvh; // height: 65 * @tocurrentvh;
margin-top: 19 * @tocurrentvh;
width: 100%; width: 100%;
font-size: 26 * @tocurrentvw; font-size: 26 * @tocurrentvw;
color: #eb7162; color: #eb7162;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; p {
img { margin-left: 40%;
// display: none; display: flex;
position: absolute; justify-content: flex-end;
width: 12 * @tocurrentvw; }
height: 20 * @tocurrentvh; .img-container {
transform: translatex(80 * @tocurrentvw); flex: 1;
display: flex;
img {
margin-left: 2%;
display: block;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
}
} }
} }
} }
......
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