|
|
@@ -8,16 +8,13 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="share-box">
|
|
|
- <view>分销商分享给好友,好友购买产品成功后即可获</view>
|
|
|
- <view>得分享奖励</view>
|
|
|
- <view>单笔最高可赚¥200.00</view>
|
|
|
- <view>快去分享吧</view>
|
|
|
- <button type="default" open-type="share">分享</button>
|
|
|
+ <u-parse :content="shareContent"></u-parse>
|
|
|
+ <button type="default" @click.stop='showShareModal'>分享</button>
|
|
|
</view>
|
|
|
|
|
|
<view class="share-box" style="height: 200upx;margin-top: 2%;" @longpress="copyCode">
|
|
|
<view>长按复制框内整段文字,打开 [手淘] 即可购买</view>
|
|
|
- <view>¥kSfsDfrtrEjt¥</view>
|
|
|
+ <view>{{shareCode}}</view>
|
|
|
<button type="default" @click="copyCode">一键复制</button>
|
|
|
</view>
|
|
|
|
|
|
@@ -26,25 +23,43 @@
|
|
|
<u-parse :content="detailObj.content"></u-parse>
|
|
|
</view>
|
|
|
<!-- <image class="logo-footer" src="/static/detail-bg2.png"></image> -->
|
|
|
-
|
|
|
+ <uni-popup ref="popup" type="bottom">
|
|
|
+ <view class="uni-share">
|
|
|
+ <view class="uni-share-content">
|
|
|
+ <button class="uni-share-content-box" open-type="share">
|
|
|
+ <view class="uni-share-content-image"><image src="/static/userSetIcon.png" class="image" /></view>
|
|
|
+ <view class="uni-share-content-text">分享给好友</view>
|
|
|
+ </button>
|
|
|
+ <button class="uni-share-content-box" @click="goPostShare">
|
|
|
+ <view class="uni-share-content-image"><image src="/static/share-icon1.png" class="image" /></view>
|
|
|
+ <view class="uni-share-content-text">海报分享</view>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <view class="uni-share-btn" @click="cancelModal()">取消</view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
var md5 = require("../../../common/md5.js");
|
|
|
import uParse from '@/components/gaoyia-parse/parse.vue'
|
|
|
+ import uniPopup from "@/components/uni-popup/uni-popup.vue";
|
|
|
export default {
|
|
|
components: {
|
|
|
uParse,
|
|
|
+ uniPopup
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
title: 'Hello',
|
|
|
detailObj:{},
|
|
|
+ shareContent:'',
|
|
|
+ shareCode:''
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- this.getDetailInfo(option.detailId)
|
|
|
+ this.getDetailInfo(option.detailId);
|
|
|
},
|
|
|
onShareAppMessage() {
|
|
|
return {
|
|
|
@@ -69,15 +84,31 @@
|
|
|
},
|
|
|
success: res => {
|
|
|
if (res.data.code === 200) {
|
|
|
- that.detailObj = res.data.msg
|
|
|
- console.log(res.data.msg)
|
|
|
+ that.detailObj = res.data.msg;
|
|
|
+ that.shareContent = getApp().globalData.shareContent;
|
|
|
+ that.shareCode = getApp().globalData.shareTaobaoCode
|
|
|
+ console.log(that.shareContent)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ showShareModal(){
|
|
|
+ this.$refs.popup.open();
|
|
|
+ },
|
|
|
+ cancelModal(){
|
|
|
+ // 需要在 popup 组件,指定 ref 为 popup
|
|
|
+ this.$refs.popup.close();
|
|
|
+ },
|
|
|
+ goPostShare() {
|
|
|
+ this.$refs.popup.close()
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/postShare/index'
|
|
|
+ })
|
|
|
+ },
|
|
|
copyCode(){
|
|
|
+ let that = this;
|
|
|
uni.setClipboardData({
|
|
|
- data:'xxx',
|
|
|
+ data:that.shareCode,
|
|
|
success() {
|
|
|
uni.showToast({
|
|
|
icon:'none',
|
|
|
@@ -91,6 +122,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+ @import url("../../../components/gaoyia-parse/parse.css");
|
|
|
.content {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
@@ -154,4 +186,60 @@
|
|
|
margin-bottom: 2%;
|
|
|
font-size: 32rpx;
|
|
|
}
|
|
|
+ //分享模态框
|
|
|
+ .uni-share-content {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 15px;
|
|
|
+ /* justify-content: center */
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-share-content-box {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ width: 25%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-left: 0;
|
|
|
+ margin-right: 0;
|
|
|
+ border: none;
|
|
|
+ background: transparent;
|
|
|
+ padding-left: 0;
|
|
|
+ padding-right: 0;
|
|
|
+
|
|
|
+ }
|
|
|
+ .uni-share-content-box::after{
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-share-content-image {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 60upx;
|
|
|
+ height: 60upx;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 10upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-share-content-image .image {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-share-content-text {
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #999;
|
|
|
+ padding-top: 5px;
|
|
|
+ // padding-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uni-share-btn {
|
|
|
+ height: 90upx;
|
|
|
+ line-height: 90upx;
|
|
|
+ border-top: 1px #f5f5f5 solid;
|
|
|
+ text-align: center;
|
|
|
+ color: #666;
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
</style>
|