|
@@ -3,8 +3,7 @@ import { stringify, S4 } from '@/utils'
|
|
import useHotLaunch from '@/hooks/useHotLaunch'
|
|
import useHotLaunch from '@/hooks/useHotLaunch'
|
|
import { RECOMMEND_PAGESOURCE, USER_SHARE_PAGESOURCE, CATEGORY_PAGESOURCE, DETAIL_PAGESOURCE, DETAIL_RECOMMEND } from '@/const'
|
|
import { RECOMMEND_PAGESOURCE, USER_SHARE_PAGESOURCE, CATEGORY_PAGESOURCE, DETAIL_PAGESOURCE, DETAIL_RECOMMEND } from '@/const'
|
|
import { shareReport, weixinFriend, shareClickReport } from '@/logger'
|
|
import { shareReport, weixinFriend, shareClickReport } from '@/logger'
|
|
-import { USER_SENCE } from '@/const/index'
|
|
|
|
-import { APP_ID, APP_TYPE, APP_VERSION_CODE, VERSION_CODE } from '@/config'
|
|
|
|
|
|
+import { APP_ID, APP_TYPE, VERSION_CODE } from '@/config'
|
|
|
|
|
|
export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
|
|
export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
|
|
useHotLaunch.valid = false
|
|
useHotLaunch.valid = false
|
|
@@ -13,7 +12,8 @@ export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
|
|
const { target } = shareRes || {}
|
|
const { target } = shareRes || {}
|
|
const { dataset } = target || {}
|
|
const { dataset } = target || {}
|
|
|
|
|
|
- return shareVideoToWechat({
|
|
|
|
|
|
+
|
|
|
|
+ let query = shareQuary({
|
|
path,
|
|
path,
|
|
video,
|
|
video,
|
|
pageSource: USER_SHARE_PAGESOURCE,
|
|
pageSource: USER_SHARE_PAGESOURCE,
|
|
@@ -33,9 +33,29 @@ export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
|
|
shareButtonType: dataset?.buttonType || 0,
|
|
shareButtonType: dataset?.buttonType || 0,
|
|
prePageSource: '',
|
|
prePageSource: '',
|
|
})
|
|
})
|
|
|
|
+ shareReport(query)
|
|
|
|
+ weixinFriend(query)
|
|
|
|
+ const detailPath = `/pages/share/share?${stringify(query)}`
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ title: video.title || '好友分享给你一个视频,点击查看~',
|
|
|
|
+ imageUrl: video.shareImgPath,
|
|
|
|
+ path: `/pages/category/index?redirect=${encodeURIComponent(detailPath)}`
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export function shareVideoToWechat(params) {
|
|
|
|
+ let query = shareQuary(params)
|
|
|
|
+ const detailPath = `/pages/share/share?${stringify(query)}`
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ path: `/pages/category/index?redirect=${encodeURIComponent(detailPath)}`
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-export function shareVideoToWechat(params, isContact = false) {
|
|
|
|
|
|
+function shareQuary(params){
|
|
|
|
+
|
|
const { video } = params
|
|
const { video } = params
|
|
const mid = Taro.$global.get('mid')
|
|
const mid = Taro.$global.get('mid')
|
|
const shareId = mid + '-' + S4() + new Date().getTime()
|
|
const shareId = mid + '-' + S4() + new Date().getTime()
|
|
@@ -67,17 +87,7 @@ export function shareVideoToWechat(params, isContact = false) {
|
|
shareButtonType: params.shareButtonType, // 按钮类型
|
|
shareButtonType: params.shareButtonType, // 按钮类型
|
|
...videoPlayParams(video)
|
|
...videoPlayParams(video)
|
|
}
|
|
}
|
|
-
|
|
|
|
- const detailPath = `/pages/share/share?${stringify(query)}`
|
|
|
|
-
|
|
|
|
- !isContact && shareReport(query)
|
|
|
|
- !isContact && weixinFriend(query)
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- title: video.title || '好友分享给你一个视频,点击查看~',
|
|
|
|
- imageUrl: video.shareImgPath,
|
|
|
|
- path: `/pages/category/index?redirect=${encodeURIComponent(detailPath)}`
|
|
|
|
- }
|
|
|
|
|
|
+ return query
|
|
}
|
|
}
|
|
|
|
|
|
function videoPlayParams(video) {
|
|
function videoPlayParams(video) {
|
|
@@ -112,17 +122,19 @@ export function shareTimeline({ video, messageActionType = 'videoShareH5', rootP
|
|
isRecommendShare,
|
|
isRecommendShare,
|
|
h5ShareIconClickTimeType: '0',
|
|
h5ShareIconClickTimeType: '0',
|
|
}
|
|
}
|
|
- let fomr = {
|
|
|
|
- "h5ShareIconClickTimeType": "0",
|
|
|
|
- "kitPosition": "",
|
|
|
|
- "kitType": "",
|
|
|
|
- "kitId": "",
|
|
|
|
- "entranceType": "weapp_shareH5Button",
|
|
|
|
- "xcxAbinfo": "eyJhYl90ZXN0MDAxIjp7ImciOiJhYjkiLCJpZCI6IjIyMywzNDEifSwiYWJfdGVzdDAwMiI6eyJnIjoiYWI5IiwiaWQiOiIzODYsNTA3LDU1NiJ9LCJhYl90ZXN0MDAzIjp7ImciOiJhYjgiLCJpZCI6IjQ5OSw1NzIifSwiYWJfdGVzdDAwNCI6eyJnIjoiYWI5IiwiaWQiOiIyMTEsMTI2In0sImFiX3Rlc3QwMDUiOnsiZyI6ImFiMTYiLCJpZCI6IiJ9LCJhYl90ZXN0MDA2Ijp7ImciOiJhYjE5IiwiaWQiOiIyNTMsMzEwLDMxNCwzMTEsMzIxLDM1OSwzNTYsMzcxLDMzMSw0MzQsNTExLDUxMiw1MTMsNTgyIn0sImFiX3Rlc3QwMDciOnsiZyI6ImFiMTAwIiwiaWQiOiIifX01"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let obj = shareVideoToWechat({ video }, true)
|
|
|
|
- var msgPath = obj.path.replace(/%23/g, '_')
|
|
|
|
|
|
+ // let fomr = {
|
|
|
|
+ // "h5ShareIconClickTimeType": "0",
|
|
|
|
+ // "kitPosition": "",
|
|
|
|
+ // "kitType": "",
|
|
|
|
+ // "kitId": "",
|
|
|
|
+ // "entranceType": "weapp_shareH5Button",
|
|
|
|
+ // "xcxAbinfo": "eyJhYl90ZXN0MDAxIjp7ImciOiJhYjkiLCJpZCI6IjIyMywzNDEifSwiYWJfdGVzdDAwMiI6eyJnIjoiYWI5IiwiaWQiOiIzODYsNTA3LDU1NiJ9LCJhYl90ZXN0MDAzIjp7ImciOiJhYjgiLCJpZCI6IjQ5OSw1NzIifSwiYWJfdGVzdDAwNCI6eyJnIjoiYWI5IiwiaWQiOiIyMTEsMTI2In0sImFiX3Rlc3QwMDUiOnsiZyI6ImFiMTYiLCJpZCI6IiJ9LCJhYl90ZXN0MDA2Ijp7ImciOiJhYjE5IiwiaWQiOiIyNTMsMzEwLDMxNCwzMTEsMzIxLDM1OSwzNTYsMzcxLDMzMSw0MzQsNTExLDUxMiw1MTMsNTgyIn0sImFiX3Rlc3QwMDciOnsiZyI6ImFiMTAwIiwiaWQiOiIifX01"
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ let obj = shareQuary({ video })
|
|
|
|
+ const detailPath = `/pages/share/share?${stringify(obj)}`
|
|
|
|
+
|
|
|
|
+ var msgPath = detailPath.replace(/%23/g, '_')
|
|
return {
|
|
return {
|
|
session_from: JSON.stringify(session_from),
|
|
session_from: JSON.stringify(session_from),
|
|
send_msg_title: video.shareTitle,
|
|
send_msg_title: video.shareTitle,
|