| | |
| | | import { silentLogin } from "@/api/connect.js"; |
| | | import { getUserInfo } from "@/api/members"; |
| | | import storage from "@/utils/storage.js"; |
| | | import { getSessionId, userAction } from "@/api/userAction.js"; |
| | | import { getSessionId, userAction,userShare } from "@/api/userAction.js"; |
| | | export default { |
| | | components: {TopBar}, |
| | | computed: { |
| | |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"DETAIL" |
| | | } |
| | | }, |
| | | shareParam:{ |
| | | pageCode:"HEALTH_VIDEO", |
| | | shareOption:"{}", |
| | | pageType:"DETAIL" |
| | | }, |
| | | shareId:'', |
| | | } |
| | | }, |
| | | onShow() { |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | param.sessionId = this.pageSessionNo |
| | | userAction(param) |
| | | } |
| | |
| | | } |
| | | }, |
| | | onUnload() { |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | if (this.sendOnShow)return |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onHide() { |
| | | this.startHidenTime = Date.now() |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | this.sendOnShow = true; |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onLoad(option) { |
| | | if(option.shareId){ |
| | | console.log('触发onLoad') |
| | | this.actionParam.shareId = option.shareId; |
| | | this.actionParam.joinType = 'SHARE' |
| | | uni.setStorage({ |
| | | key: 'shareId', |
| | | data: option.shareId, |
| | | success: function () { |
| | | console.log('缓存shareId成功'); |
| | | } |
| | | }); |
| | | } |
| | | this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom |
| | | let queryParam = this.videoQuery; |
| | | if (option.q) { |
| | |
| | | shareUser: userInfo.id |
| | | } |
| | | saveShare(data) |
| | | return { |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | imageUrl: videoInfo.coverUrl |
| | | } |
| | | // return { |
| | | // title: videoInfo.title, |
| | | // path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | // imageUrl: videoInfo.coverUrl |
| | | // } |
| | | return new Promise((resolve) => { |
| | | this.shareId = ''; |
| | | let shareObj ={ |
| | | videoId:videoInfo.id, |
| | | userId:userInfo.id |
| | | } |
| | | this.shareParam.shareOption = JSON.stringify(shareObj) |
| | | userShare(this.shareParam).then(res => { |
| | | this.shareId = res.data.data; |
| | | // 当获取到shareId后,再resolve分享配置 |
| | | resolve({ |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`, |
| | | imageUrl: videoInfo.coverUrl, |
| | | success(e) { |
| | | console.log("分享成功", e); |
| | | }, |
| | | fail(e) { |
| | | console.log('分享失败', e); |
| | | } |
| | | }); |
| | | }).catch(err => { |
| | | // 处理错误情况,例如使用默认参数 |
| | | console.error('获取分享ID失败', err); |
| | | resolve({ |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | imageUrl: videoInfo.coverUrl |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | // 解析URL参数 |
| | |
| | | } from "@/api/collect.js"; |
| | | import { saveShare, saveShareClickRecord } from "@/api/share.js"; |
| | | import storage from "@/utils/storage.js"; |
| | | import { getSessionId, userAction } from "@/api/userAction.js"; |
| | | import { getSessionId, userAction,userShare } from "@/api/userAction.js"; |
| | | export default { |
| | | computed: { |
| | | hasPlayTime() { |
| | |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"LIST" |
| | | } |
| | | }, |
| | | shareParam:{ |
| | | pageCode:"KITCHEN_VIDEO", |
| | | shareOption:"{}", |
| | | pageType:"DETAIL" |
| | | }, |
| | | shareId:'', |
| | | |
| | | } |
| | | }, |
| | | onShow() { |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | param.sessionId = this.pageSessionNo |
| | | userAction(param) |
| | | } |
| | |
| | | } |
| | | }, |
| | | onUnload() { |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | if (this.sendOnShow)return |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onHide() { |
| | | this.startHidenTime = Date.now() |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | this.sendOnShow = true; |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onLoad(option) { |
| | | if(option.shareId){ |
| | | console.log('触发onLoad') |
| | | this.actionParam.shareId = option.shareId; |
| | | this.actionParam.joinType = 'SHARE' |
| | | uni.setStorage({ |
| | | key: 'shareId', |
| | | data: option.shareId, |
| | | success: function () { |
| | | console.log('缓存shareId成功'); |
| | | } |
| | | }); |
| | | } |
| | | this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom; |
| | | // 获取状态栏高度 |
| | | const systemInfo = uni.getSystemInfoSync(); |
| | |
| | | shareUser: userInfo.id |
| | | } |
| | | saveShare(data) |
| | | return { |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | imageUrl: videoInfo.coverUrl |
| | | } |
| | | // return { |
| | | // title: videoInfo.title, |
| | | // path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | // imageUrl: videoInfo.coverUrl |
| | | // } |
| | | |
| | | return new Promise((resolve) => { |
| | | this.shareId = ''; |
| | | let shareObj ={ |
| | | videoId:videoInfo.id, |
| | | userId:userInfo.id |
| | | } |
| | | this.shareParam.shareOption = JSON.stringify(shareObj) |
| | | userShare(this.shareParam).then(res => { |
| | | this.shareId = res.data.data; |
| | | // 当获取到shareId后,再resolve分享配置 |
| | | resolve({ |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`, |
| | | imageUrl: videoInfo.coverUrl, |
| | | success(e) { |
| | | console.log("分享成功", e); |
| | | }, |
| | | fail(e) { |
| | | console.log('分享失败', e); |
| | | } |
| | | }); |
| | | }).catch(err => { |
| | | // 处理错误情况,例如使用默认参数 |
| | | console.error('获取分享ID失败', err); |
| | | resolve({ |
| | | title: videoInfo.title, |
| | | path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`, |
| | | imageUrl: videoInfo.coverUrl |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | // 解析URL参数 |
| | |
| | | this.actionParam.shareId = options.shareId; |
| | | this.actionParam.joinType = 'SHARE' |
| | | console.log('触发onLoad') |
| | | uni.setStorage({ |
| | | key: 'shareId', |
| | | data: options.shareId, |
| | | success: function () { |
| | | console.log('缓存shareId成功'); |
| | | } |
| | | }); |
| | | } |
| | | this.actionParam.pageParams = JSON.stringify(options) |
| | | if(options.q){ |
| | |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | this.actionParam.sessionId = this.pageSessionNo |
| | | this.actionParam.sessionId = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = Object.assign({}, this.actionParam); |
| | | userAction(param) |
| | |
| | | userAction(param) |
| | | }, |
| | | onLoad(option) { |
| | | |
| | | if(option.shareId){ |
| | | console.log('触发onLoad') |
| | | this.actionParam.shareId = option.shareId; |
| | | this.actionParam.joinType = 'SHARE' |
| | | uni.setStorage({ |
| | | key: 'shareId', |
| | | data: option.shareId, |
| | | success: function () { |
| | | console.log('缓存shareId成功'); |
| | | } |
| | | }); |
| | | } |
| | | console.log('-----------分享出的数据---------->', option) |
| | | //处理扫码出来的视频 |
| | | this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom |
| | |
| | | |
| | | // }) |
| | | // 保存分享记录 |
| | | |
| | | |
| | | // 返回一个Promise |
| | | return new Promise((resolve) => { |
| | | this.shareId = ''; |
| | |
| | | </span> |
| | | </view> |
| | | |
| | | <view class="icons share" @click="shareChange()"> |
| | | <!-- <view class="icons share" @click="shareChange()"> |
| | | <u-icon size="30" name="share-fill"></u-icon> |
| | | <view>分享</view> |
| | | </view> |
| | | </view> --> |
| | | <view class="icons share" style="margin-top: -15px;"> |
| | | <button open-type="share" class="custom-share-btn" plain="true" style="border: none;"> |
| | | <u-icon size="30" name="share-fill" :data-obj="item"></u-icon> |
| | | </button> |
| | | <view style="margin-top: -14px;">分享</view> |
| | | </view> |
| | | |
| | | |
| | | <view class="icons" @click="clickFavorite(goodsDetail.id)"> |
| | | <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" |
| | | :name="favorite ? 'heart-fill' : 'heart'"></u-icon> |
| | |
| | | import popups from "@/pages/product/popups/popups.vue"; //气泡框 |
| | | import takeDownFormSaleGoods from "@/pages/product/m-take-down-sale-goods/index.vue"; //下架框 |
| | | import setup from "@/pages/product/product/popup/popup.js"; |
| | | import { getSessionId, userAction } from "@/api/userAction.js"; |
| | | import { getSessionId, userAction,userShare } from "@/api/userAction.js"; |
| | | |
| | | import { getGoodsDetail } from "@/api/video.js" |
| | | import { |
| | |
| | | touchStartX: 0, |
| | | touchEndX: 0, |
| | | minSwipeDistance: 100, // 最小滑动距离,用于判断是否为有效滑动 |
| | | pageSessionNo:"", |
| | | actionParam:{ |
| | | sessionId:'', |
| | | actionType:"PAGE", |
| | | joinType:"SELF", |
| | | pageCode:"SWIPER_GOODS", |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"DETAIL" |
| | | } |
| | | pageSessionNo:"", |
| | | actionParam:{ |
| | | sessionId:'', |
| | | actionType:"PAGE", |
| | | joinType:"SELF", |
| | | pageCode:"RECOMMEND_VIDEO_LEFT_GOODS", |
| | | pageParams:"{}", |
| | | pageStatus:"JOIN", |
| | | pageType:"DETAIL" |
| | | }, |
| | | shareParam:{ |
| | | pageCode:"RECOMMEND_VIDEO_LEFT_GOODS", |
| | | shareOption:"{}", |
| | | pageType:"DETAIL" |
| | | }, |
| | | shareId:'', |
| | | }; |
| | | }, |
| | | |
| | |
| | | this.productRefHeight = windowHeight - bottomHeight + "px"; |
| | | }, |
| | | async onLoad(options) { |
| | | if(options.shareId){ |
| | | this.actionParam.shareId = options.shareId; |
| | | this.actionParam.joinType = 'SHARE'; |
| | | uni.setStorage({ |
| | | key: 'shareId', |
| | | data: options.shareId, |
| | | success: function () { |
| | | console.log('缓存shareId成功'); |
| | | } |
| | | }); |
| | | console.log('触发onLoad') |
| | | } |
| | | this.actionParam.pageParams = JSON.stringify(options) |
| | | |
| | | this.videoId = options.videoId; |
| | |
| | | |
| | | // #ifdef MP-WEIXIN |
| | | // 小程序默认分享 |
| | | uni.showShareMenu({ |
| | | withShareTicket: true, |
| | | menus: ["shareAppMessage", "shareTimeline"], |
| | | }); |
| | | // uni.showShareMenu({ |
| | | // withShareTicket: true, |
| | | // menus: ["shareAppMessage", "shareTimeline"], |
| | | // }); |
| | | // #endif |
| | | }, |
| | | onUnload() { |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | if (this.sendOnShow)return |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | | }, |
| | | onHide() { |
| | | this.startHidenTime = Date.now() |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | this.sendOnShow = true; |
| | | param.pageStatus = "LEAVE" |
| | | userAction(param) |
| | |
| | | getSessionId().then(res=>{ |
| | | this.pageSessionNo = res.data.data |
| | | if(this.pageSessionNo){ |
| | | let param = this.actionParam; |
| | | let param = Object.assign({}, this.actionParam); |
| | | param.sessionId = this.pageSessionNo |
| | | userAction(param) |
| | | } |
| | |
| | | // this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId); |
| | | // } |
| | | }, |
| | | |
| | | onShareAppMessage(e){ |
| | | console.log(e) |
| | | return new Promise((resolve) => { |
| | | this.shareId = ''; |
| | | let shareObj ={ |
| | | id:e.id, |
| | | goodsId:e.goodsId |
| | | } |
| | | this.shareParam.shareOption = JSON.stringify(shareObj) |
| | | userShare(this.shareParam).then(res => { |
| | | this.shareId = res.data.data; |
| | | // 当获取到shareId后,再resolve分享配置 |
| | | resolve({ |
| | | title: this.goodsDetail.goodsName, |
| | | path: '/pages/product/goods' +'?id='+ e.id + '&goodsId=' + e.goodsId +'&shareId=' + this.shareId, |
| | | imageUrl: this.goodsDetail.goodsGalleryList[0], |
| | | success(e) { |
| | | console.log("分享成功", e); |
| | | }, |
| | | fail(e) { |
| | | console.log('分享失败', e); |
| | | } |
| | | }); |
| | | }).catch(err => { |
| | | // 处理错误情况,例如使用默认参数 |
| | | console.error('获取分享ID失败', err); |
| | | resolve({ |
| | | title: this.goodsDetail.goodsName, |
| | | path: '/pages/product/goods' +'?id='+ e.id+ '&goodsId=' + e.goodsId, |
| | | imageUrl: this.goodsDetail.goodsGalleryList[0], |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | // 获取商品列表 |
| | | async getGoodsList() { |