Browse Source

改为乐活小程序;调整 UI

harry 1 year ago
parent
commit
6d13ac3ea5

+ 1 - 1
package.json

@@ -2,7 +2,7 @@
   "name": "longvideoImerse",
   "version": "1.0.0",
   "private": true,
-  "description": " 票圈视频新小程序,票圈好看视频",
+  "description": " 票圈视频新小程序,票圈乐活",
   "templateInfo": {
     "name": "default",
     "typescript": true,

+ 1 - 1
plugins/PostPreViewQr/index.ts

@@ -79,7 +79,7 @@ function PostPreViewQr(ctx) {
   ctx.register({
     name: 'onPreviewComplete',
     fn: ({ success, data, error }) => {
-      console.log('接收预览后数据', success, data, error)
+    //   console.log('接收预览后数据', success, data, error)
       if (success) {
         const { qrCodeLocalPath } = data
         getAccessToken().then((res: any) => {

+ 2 - 2
project.config.json

@@ -1,8 +1,8 @@
 {
   "miniprogramRoot": "./dist",
   "projectname": " longvideoImerse",
-  "description": " 票圈视频新小程序,票圈好看视频",
-  "appid": "wxf275bb93cdcc9d87",
+  "description": " 票圈视频新小程序,票圈乐活",
+  "appid": "wxe8f8f0e23cecad0f",
   "setting": {
     "urlCheck": true,
     "es6": false,

+ 1 - 1
src/app.tsx

@@ -24,7 +24,7 @@ function App({ children }: PropsWithChildren<any>) {
         globalApp()
         // system info
         updateSystem()
-        console.log('hhz - launch option:', launch)
+        // console.log('hhz - launch option:', launch)
 
         // create session id
         updateSession()

+ 2 - 2
src/components/VideoSwiper/index.less

@@ -26,8 +26,8 @@
                 transform: translateX(-50%) translateY(-50%);
 
                 image {
-                    width: 110px;
-                    height: 110px;
+                    width: 162px;
+                    height: 182px;
                 }
             }
 

+ 2 - 11
src/components/VideoSwiper/index.tsx

@@ -6,7 +6,7 @@ import {
 } from '@tarojs/components'
 import Route from '@/class/Route'
 import { DETAIL_PAGESOURCE, CATEGORY_PAGESOURCE, VIEW_AUTO_TYPE } from '@/const'
-import { videoViewReport, videoPlayReport, videoActionReport, shareContactReport } from '@/logger'
+import { videoViewReport, videoPlayReport, videoActionReport, shareContactReport,shareReport, weixinFriend } from '@/logger'
 import { once, formatSecondsAsTime } from '@/utils'
 import { VideoInfo, PlayState } from '@/constants/commentTypes'
 import { shareTimeline } from '@/shareHelper'
@@ -39,7 +39,6 @@ export default function VideoSwiper({ list, onFinish, needResumePlay, flushList,
     })
 
     useDidShow(() => {
-        console.log('show')
 
         // 从分享页回首页要重置
         activeIndex = 0
@@ -93,8 +92,6 @@ export default function VideoSwiper({ list, onFinish, needResumePlay, flushList,
                 currentListIndex += 3
             }
         }
-        console.log('hhz- currentListIndex:', currentListIndex)
-
     }
 
     function onAnimationFinish(e) {
@@ -355,7 +352,6 @@ function CustomVideo({ video, current, index, onTimeUpdate, onProgressMove, need
 
     function onTouchEnd(e) {
         let { clientX = 0 } = (e.changedTouches || [])[0]
-        console.log('hhz- onTouchEnd ')
 
         onProgressMove(false)
 
@@ -464,19 +460,14 @@ function VideoBar({ video }) {
 
 
     function shareToPyq() {
-        /// TODO: 
-        console.log('share to pyq')
-        console.log(sessionMsg)
         let par = Taro.$global.get('sharePageParams') || {}
         shareContactReport({
-            shareDepth: (par.shareDepth || 0) + 1,
+            shareDepth: 1 + parseInt((par.shareDepth || 0)),
             
         })
     }
 
     function shareToFriend() {
-        /// TODO: 
-        console.log('share to friend')
     }
 
     /**

+ 2 - 2
src/components/VideoSwiper/index.wxss

@@ -25,8 +25,8 @@
   transform: translateX(-50%) translateY(-50%);
 }
 .video-swiper .video-swiper-item .custom-video .playBtn image {
-  width: 110px;
-  height: 110px;
+  width: 162px;
+  height: 182px;
 }
 .video-swiper .video-swiper-item .custom-video .progress-bg {
   position: absolute;

+ 5 - 4
src/config/index.ts

@@ -1,4 +1,5 @@
-export const APP_ID = 'wxf275bb93cdcc9d87'
-export const APP_TYPE = 23
-export const APP_VERSION_CODE = '2.0.768'
-export const VERSION_CODE = 768
+export const APP_ID = 'wxe8f8f0e23cecad0f'
+export const APP_TYPE = 24
+export const APP_NAME = '票圈乐活'
+export const APP_VERSION_CODE = '2.0.769'
+export const VERSION_CODE = 769

+ 1 - 5
src/pages/category/index.tsx

@@ -1,4 +1,4 @@
-import Taro, { useLoad, useDidShow, useReady, useDidHide, usePullDownRefresh, useShareAppMessage, useRouter, useShareTimeline } from '@tarojs/taro'
+import Taro, { useLoad, useDidShow, useReady, useDidHide, useShareAppMessage, useRouter } from '@tarojs/taro'
 import { useMemo, useState } from 'react'
 import type CustomTabBar from '@/custom-tab-bar'
 import { View } from '@tarojs/components'
@@ -68,10 +68,6 @@ export default function Index() {
 
     })
 
-    usePullDownRefresh(() => {
-        console.log('usePullDownRefresh', activeIndex)
-    })
-
     useShareAppMessage((shareRes) => {
         return sharePageAppMessage({
             video: videoList[activeIndex],

+ 0 - 4
src/pages/share/share.tsx

@@ -41,8 +41,6 @@ export default function Share() {
 
 
     useLoad(() => {
-        console.log('pa', params)
-
         setBotHeight(pageHeight())
         setBackBtnTop(getMenuButtonBoundingClientRect().top)
 
@@ -100,8 +98,6 @@ export default function Share() {
             let videos = filterCardProps([data], USER_SHARE_PAGESOURCE)
             videoList[0] = videos[0]
             setVideoList(videoList)
-            console.log('share detail: ', videoList)
-
         })
     }
 

+ 38 - 26
src/shareHelper/index.ts

@@ -3,8 +3,7 @@ import { stringify, S4 } from '@/utils'
 import useHotLaunch from '@/hooks/useHotLaunch'
 import { RECOMMEND_PAGESOURCE, USER_SHARE_PAGESOURCE, CATEGORY_PAGESOURCE, DETAIL_PAGESOURCE, DETAIL_RECOMMEND } from '@/const'
 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 }) {
     useHotLaunch.valid = false
@@ -13,7 +12,8 @@ export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
     const { target } = shareRes || {}
     const { dataset } = target || {}
 
-    return shareVideoToWechat({
+
+    let query = shareQuary({
         path,
         video,
         pageSource: USER_SHARE_PAGESOURCE,
@@ -33,9 +33,29 @@ export function sharePageAppMessage({ video, activeIndex, router, shareRes }) {
         shareButtonType: dataset?.buttonType || 0,
         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 mid = Taro.$global.get('mid')
     const shareId = mid + '-' + S4() + new Date().getTime()
@@ -67,17 +87,7 @@ export function shareVideoToWechat(params, isContact = false) {
         shareButtonType: params.shareButtonType, // 按钮类型
         ...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) {
@@ -112,17 +122,19 @@ export function shareTimeline({ video, messageActionType = 'videoShareH5', rootP
         isRecommendShare,
         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 {
         session_from: JSON.stringify(session_from),
         send_msg_title: video.shareTitle,