|
@@ -99,8 +99,15 @@
|
|
|
<!-- <view class="priceTag">¥ {{toFixed(detail.standPrice)}}</view> -->
|
|
|
<!-- <view class="priceTag">分享</view> -->
|
|
|
<view class="icons">
|
|
|
- <image src="/static/index/share.png" class="share"></image>
|
|
|
- <image src="/static/index/shopcar.png" class="shopcar" @click="toShopcar()"></image>
|
|
|
+ <view class="icon_item ones">
|
|
|
+ <image src="/static/index/share.png" class="share"></image>
|
|
|
+ <button type="default" open-type="share" class="bt_share"></button>
|
|
|
+ <view class="share_w">分享</view>
|
|
|
+ </view>
|
|
|
+ <view class="icon_item">
|
|
|
+ <image src="/static/index/shopcar.png" class="shopcar" @click="toShopcar()"></image>
|
|
|
+ <view class="share_w">购物车</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view style="display: flex;color: #FFFFFF;align-items: center;">
|
|
|
<view class="btn1" @click="addCart">加购物车</view>
|
|
@@ -150,12 +157,34 @@ export default {
|
|
|
this.getDetail()
|
|
|
this.goodsCourseList()
|
|
|
this.appCommonGoodsCourseModuleFreeExamList();
|
|
|
+ wx.showShareMenu({
|
|
|
+ withShareTicket: true,
|
|
|
+ menus: ["shareAppMessage", "shareTimeline"]
|
|
|
+ })
|
|
|
},
|
|
|
onUnload(option) {
|
|
|
this.$store.commit('setPlaySectionId', {playSectionId :0});
|
|
|
//移除所有的事件监听器
|
|
|
uni.$off();
|
|
|
},
|
|
|
+ // 分享到朋友圈
|
|
|
+ onShareTimeline() {
|
|
|
+ console.log('safsaghdsoug')
|
|
|
+ return {
|
|
|
+ title: this.detail.goodsName,
|
|
|
+ query: 'id=' + this.id,
|
|
|
+ imageUrl: this.$method.splitImgHost(this.detail.coverUrl)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 分享给朋友
|
|
|
+ onShareAppMessage() {
|
|
|
+ return {
|
|
|
+ title: this.detail.goodsName,
|
|
|
+ path: `/pages3/course/detail?id=` + this.id,
|
|
|
+ imageUrl: this.$method.splitImgHost(this.detail.coverUrl)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
mounted() {
|
|
|
let self = this
|
|
|
uni.$on('getSection', item => {
|
|
@@ -597,11 +626,43 @@ export default {
|
|
|
align-items: center;
|
|
|
padding: 0 24rpx;
|
|
|
box-shadow: 0px -5px 20px 1px rgba(1,99,235,0.1000);
|
|
|
+ .icons {
|
|
|
+ display: flex;
|
|
|
+ .share_w {
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: #666666;
|
|
|
+ margin-top: 6rpx;
|
|
|
+ }
|
|
|
+ .icon_item {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .ones {
|
|
|
+ margin-left: 32rpx;
|
|
|
+ margin-right: 60rpx;
|
|
|
+ position: relative;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ /deep/ button::after{
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ .bt_share {
|
|
|
+ width: 38rpx;
|
|
|
+ height: 38rpx;
|
|
|
+ position: absolute;
|
|
|
+ top: 3rpx;
|
|
|
+ left: 0;
|
|
|
+ z-index: 100;
|
|
|
+ opacity: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.share {
|
|
|
width: 38rpx;
|
|
|
height: 38rpx;
|
|
|
- margin-left: 32rpx;
|
|
|
- margin-right: 60rpx;
|
|
|
+ position: relative;
|
|
|
+ top: 3rpx;
|
|
|
+ z-index: 99;
|
|
|
+ margin-bottom: 4rpx;
|
|
|
}
|
|
|
.shopcar {
|
|
|
width: 40rpx;
|