吆喝
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
|
||||
|
||||
<template>
|
||||
<uni-popup ref="share" type="bottom">
|
||||
<view class="shareCont">
|
||||
<view class="shareHeader">
|
||||
<text class="shareTitle">分享到</text>
|
||||
<text class="shareClose" @click="closeShare">取消</text>
|
||||
</view>
|
||||
<view class="shareList">
|
||||
<view class="shareItem" @click="shareApp('WXSceneTimeline')">
|
||||
<image src="../../../static/wechart.png" mode="widthFix" class="shareIcon" />
|
||||
<text class="shareText">朋友圈</text>
|
||||
</view>
|
||||
<view class="shareItem" @click="shareApp('WXSceneSession')">
|
||||
<image src="../../../static/wechart.png" mode="widthFix" class="shareIcon" />
|
||||
<text class="shareText">微信好友</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
|
||||
export default {
|
||||
name: "share",
|
||||
props:{
|
||||
videoInfo:{
|
||||
type:Object,
|
||||
default:function(){
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo:{},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = uni.getStorageSync('userInfo')
|
||||
},
|
||||
methods: {
|
||||
closeShare() {
|
||||
this.$refs.share.close();
|
||||
},
|
||||
showSharePup() {
|
||||
this.$refs.share.open();
|
||||
},
|
||||
shareApp(type) {
|
||||
let that = this;
|
||||
uni.share({
|
||||
provider: 'weixin',
|
||||
scene: type,
|
||||
type: 0,
|
||||
imageUrl:that.videoInfo.coverImg, //此处图片可以更换
|
||||
title: "柠檬短剧",
|
||||
summary:`我正在看 ${this.videoInfo.name} 超好看,一起来看看吧`,
|
||||
href:"https://baogu.hnjrdzkj.xyz/h5/#/pages/promotion/promotion?id="+this.userInfo.id,
|
||||
success: res => {
|
||||
console.log(JSON.stringify(res));
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shareCont{
|
||||
background-color: #FFFFFF;
|
||||
width: 750rpx;
|
||||
padding: 34rpx;
|
||||
border-radius: 34rpx 34rpx 0 0;
|
||||
}
|
||||
.shareHeader{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
}
|
||||
.shareTitle{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
.shareClose{
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
.shareList{
|
||||
padding: 60rpx 0 130rpx 0 ;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.shareIcon{
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.shareText{
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
line-height: 34rpx;
|
||||
padding-top: 12rpx;
|
||||
}
|
||||
.shareItem{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user