Commit cc4d87fb authored by liwei's avatar liwei

liwei

parent f473fbc5
......@@ -15,7 +15,9 @@
</p>
<div class="invite-record-btn" @click="lookMyInviteRecords" v-if="earnings>0||userNum>0">
<p>查看我的邀请记录</p>
<img src="../../assets/inviteFriends/icon_back.png" />
<div class="img-container">
<img src="../../assets/inviteFriends/icon_back.png" />
</div>
</div>
</div>
<div class="invite-friends cell">
......@@ -43,9 +45,11 @@
<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>
<img src="../../assets/inviteFriends/icon_back.png" />
<div class="img-container">
<img src="../../assets/inviteFriends/icon_back.png" />
</div>
</div>
</div>
</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){
this.shopId = this.$route.query.shopId;
}else{
this.shopId = 46
}
if (this.$route.query.shopId) {
this.shopId = this.$route.query.shopId;
} 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;
......@@ -137,67 +140,80 @@ export default {
this.$router.push({ name: "activityInvite", query: query });
},
// 分享
enableShare: function(opition) {
let that = this;
getwechatParam({
api_list: 'onMenuShareAppMessage,onMenuShareTimeline',
url:window.location.href.split('#')[0]
}).then(wechatRes => {
wx.config({
debug: false,
appId: wechatRes.appId,
timestamp: parseInt(wechatRes.timestamp),
nonceStr: wechatRes.nonceStr,
signature: wechatRes.signature,
jsApiList: wechatRes.jsApiList
enableShare: function(opition) {
let that = this;
getwechatParam({
api_list: "onMenuShareAppMessage,onMenuShareTimeline",
url: window.location.href.split("#")[0]
}).then(wechatRes => {
wx.config({
debug: false,
appId: wechatRes.appId,
timestamp: parseInt(wechatRes.timestamp),
nonceStr: wechatRes.nonceStr,
signature: wechatRes.signature,
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.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.onMenuShareAppMessage({
title: that.shareTitle, // 分享标题
desc: that.shareDesc,// 分享描述
link: opition.shareUrl, // 分享链接
imgUrl: 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标
success: function() {
window._hmt.push(['_trackEvent', '分享', "商品页朋友圈分享",`id${that.shopId}`,that.invite_code]);//百度统计
},
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){
// 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}`
}
// if(type === 1 ){
// }
this.enableShare({
shareUrl:URL
})
},
wx.onMenuShareAppMessage({
title: that.shareTitle, // 分享标题
desc: that.shareDesc, // 分享描述
link: opition.shareUrl, // 分享链接
imgUrl:
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
window._hmt.push([
"_trackEvent",
"分享",
"商品页朋友圈分享",
`id${that.shopId}`,
that.invite_code
]); //百度统计
},
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) {
// 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}`;
}
// if(type === 1 ){
// }
this.enableShare({
shareUrl: URL
});
}
}
};
</script>
......@@ -251,7 +267,7 @@ export default {
}
.cell-content.people {
top: 24vw;
right: -1vw;
right: 1vw;
}
.invite-record-btn {
position: absolute;
......@@ -261,14 +277,21 @@ 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 {
margin-right: 35%;
display: block;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
.img-container {
flex: 1;
display: flex;
img {
margin-left: 2%;
display: block;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
}
}
}
.invite-record-list {
......@@ -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: 40%;
width: 50%;
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;
img {
// display: none;
position: absolute;
width: 12 * @tocurrentvw;
height: 20 * @tocurrentvh;
transform: translatex(80 * @tocurrentvw);
p {
margin-left: 40%;
display: flex;
justify-content: flex-end;
}
.img-container {
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