Commit 58b5efd9 by 赵雅纹

邀请好友弹框

parent 84e14c8c
// component/shareBebefitModal/shareBebefitModal.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: ''
},
benefitData: {
type: Object,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
closeCardModal() {
this.setData({
show: false
})
},
_getUserInfo(res = {}) {
this.setData({
show: false
})
this.triggerEvent('getAuth', res);
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/cardModal/cardModal.wxml-->
<view>
<view class="commodity_screen2" bindtap='closeCardModal' style='opacity: 0.5;' hidden="{{!show}}" catchtouchmove='true'></view>
<view class="card-modal" hidden="{{!show}}" catchtouchmove='true'>
<view class="card-modal-content">
<image mode="widthFix" class="benefit-image" src="{{benefitData.inviteePage}}"></image>
<view wx:if="{{!benefitData.receiveAwardJumpType}}">
<button class="btn btn-primary" bindgetuserinfo="_getUserInfo" data-jflag="false" open-type='getUserInfo'>立即领取</button>
</view>
<view wx:else>
<button class="btn btn-primary" bindtap="closeCardModal">立即领取</button>
</view>
</view>
</view>
</view>
/* component/cardModal/cardModal.wxss */
@import "/app.wxss";
.commodity_screen2 {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.65;
overflow: hidden;
z-index: 9999;
color: #fff;
}
.card-modal{
position: fixed;
top:100rpx;
left: 100rpx;
z-index: 9999;
/* width: 640rpx; */
}
.card-modal-content{
/* width: 640rpx; */
height: 1000rpx;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 4rpx 17rpx 0px rgba(0, 0, 0, 0.12);
}
\ No newline at end of file
...@@ -30,8 +30,10 @@ wxService.page({ ...@@ -30,8 +30,10 @@ wxService.page({
// cardMember: null, // cardMember: null,
pageBackgroundColor: 0, pageBackgroundColor: 0,
guidePageModalShow: false, guidePageModalShow: false,
shareBenefitModalShow: false,
currHomePageId: '', currHomePageId: '',
skuVOList: [] skuVOList: [],
benefitData: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -52,6 +54,29 @@ wxService.page({ ...@@ -52,6 +54,29 @@ wxService.page({
this.generatePointObject(tentacleInfo); this.generatePointObject(tentacleInfo);
} }
// 邀请奖励弹框
if (options && options.type == 10){
this.setData({
shareBenefitModalShow: true
})
this.getShareImg()
}
},
// 获取邀请奖励图片
getShareImg() {
wxService.get(`/member/share/inviteFriends/buyer/getValid`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
let initiatorPage = JSON.parse(data.initiatorPage)
this.setData({
benefitData: data
})
}
}
})
}, },
/** /**
* 监听子组件事件 * 监听子组件事件
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"guide-page-modal": "/component/guidePageModal/guidePageModal", "guide-page-modal": "/component/guidePageModal/guidePageModal",
"bottom-tabs": "/component/bottomTabs/bottomTabs", "bottom-tabs": "/component/bottomTabs/bottomTabs",
"authorization-modal": "/component/authorization-modal/authorization-modal", "authorization-modal": "/component/authorization-modal/authorization-modal",
"plus": "/component/plus/plus" "plus": "/component/plus/plus",
"share-benefit-modal": "/component/shareBenefitModal/shareBenefitModal"
} }
} }
\ No newline at end of file
...@@ -32,4 +32,5 @@ ...@@ -32,4 +32,5 @@
</block> </block>
</view> </view>
<guide-page-modal show="{{guidePageModalShow}}" /> <guide-page-modal show="{{guidePageModalShow}}" />
<share-benefit-modal show="{{shareBenefitModalShow}}" benefit-data="{{benefitData}}"/>
<!--<authorization-modal isAuthorization='{{isAuthorization}}'/>--> <!--<authorization-modal isAuthorization='{{isAuthorization}}'/>-->
...@@ -130,12 +130,13 @@ wxService.page({ ...@@ -130,12 +130,13 @@ wxService.page({
// 分享 // 分享
onTapShare() { onTapShare() {
console.log('00000',this.data.contentInfo)
const { memberId, member } = wx.getStorageSync('_baseUserInfo') const { memberId, member } = wx.getStorageSync('_baseUserInfo')
let content = { let content = {
title: this.data.contentInfo.headline, title: this.data.contentInfo.headline,
id: this.data.contentInfo.id, id: this.data.contentInfo.id,
article: this.data.contentInfo.article, article: this.data.contentInfo.article,
url: this.data.contentInfo.url url: this.data.contentInfo.shareShowPictureRESDTOList[0].url
} }
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(content), content: JSON.stringify(content),
......
...@@ -28,7 +28,6 @@ wxService.page({ ...@@ -28,7 +28,6 @@ wxService.page({
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.hideShareMenu(); wx.hideShareMenu();
console.log('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm',options)
if (options && options.id) { if (options && options.id) {
this.setData({ this.setData({
id: options.id id: options.id
...@@ -69,7 +68,7 @@ wxService.page({ ...@@ -69,7 +68,7 @@ wxService.page({
title: this.data.contentInfo.headline, title: this.data.contentInfo.headline,
id: this.data.contentInfo.id, id: this.data.contentInfo.id,
article: this.data.contentInfo.article, article: this.data.contentInfo.article,
url: this.data.contentInfo.url url: this.data.contentInfo.sspList[0].url
} }
let tentacleInfo = { let tentacleInfo = {
content: JSON.stringify(content), content: JSON.stringify(content),
......
...@@ -93,7 +93,7 @@ wxService.page({ ...@@ -93,7 +93,7 @@ wxService.page({
let data = { let data = {
"autoColor": true, "autoColor": true,
"page": 'pages/userCenter/userCenter', "page": 'pages/userCenter/userCenter?type={{app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS}}',
"scene": '123', "scene": '123',
"width": 100 "width": 100
} }
......
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