chenlei 7 ماه پیش
والد
کامیت
9b18d5b923

+ 7 - 3
components/audio-item/audio-item.vue

@@ -32,13 +32,17 @@ const props=defineProps({
     isShowTitle:{//是否显示标题
         type:Boolean,
         default:true,
-    }
+    },
+    isShowSubscribe:{//是否显示订阅按钮
+        type:Boolean,
+        default:true,
+    },
 })
 let isPlay = computed(()=>{
     return (!globalAudio.paused&&props.data.mediaId===globalAudio.audioId)
 })
 const title=computed(()=>{
-  return `<div>${props.data.mediaTitle||props.data.mediaName}</div>`
+  return `<div>${props.data.mediaTitle||props.data.mediaName||props.data.sourceTile}</div>`
 })
 const emits=defineEmits(['playAudio'])
 async function handlePlayAudio(){
@@ -109,7 +113,7 @@ async function goOrder(params) {
             <view class="risk-level">
                 风险评级:{{ props.data.riskLevel }}
             </view>
-            <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe">
+            <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe && isShowSubscribe">
                 <view class="price">{{props.data.price}}¥</view>
                 <view class="sub-btn" @click.stop="goOrder(props.data)">立即订阅</view>
             </view>

+ 6 - 3
components/report-item/report-item.vue

@@ -35,8 +35,11 @@ const props = defineProps({
   isProduct:{ // 区分是否是选择产品页面
     type:Boolean,
     default:false,
-
-  }
+  },
+  isShowSubscribe:{//是否显示订阅按钮
+    type:Boolean,
+    default:true,
+  },
 })
 
 async function goDetail(){
@@ -93,7 +96,7 @@ const title=computed(()=>{
                 <view class="risk">
                     风险评级:{{ props.data.riskLevel }}
                 </view>
-                <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe">
+                <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe && isShowSubscribe">
                     <view class="price">{{props.data.price}}¥</view>
                     <view class="sub-btn" v-if="!props.isProduct" @click.stop="goOrder(props.data)">立即订阅</view>
                 </view>

+ 6 - 2
components/video-item/video-item.vue

@@ -34,6 +34,10 @@ const props=defineProps({
         type:Boolean,
         default:true,
     },
+    isShowSubscribe:{//是否显示订阅按钮
+        type:Boolean,
+        default:true,
+    },
     riskLevelStatus: {
         type: String,
         default: ''
@@ -84,7 +88,7 @@ watch(()=>globalVideo.videoId,()=>{
     }
 })
 const title=computed(()=>{
-  return `<div>${props.data.mediaTitle||props.data.mediaName}</div>`
+  return `<div>${props.data.mediaTitle||props.data.mediaName||props.data.sourceTitle}</div>`
 })
 function handleVideoPlay(){
     console.log('视频播放了')
@@ -149,7 +153,7 @@ async function goOrder(params) {
             <view class="risk-level">
                 风险评级:{{ props.data.riskLevel }}
             </view>
-            <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe">
+            <view class="sub-box" v-if="!props.data.isFree && !props.data.isSubscribe && isShowSubscribe">
                 <view class="price">{{props.data.price}}¥</view>
                 <view class="sub-btn" @click.stop="goOrder(props.data)">立即订阅</view>
             </view>

+ 62 - 2
pages-media/audioDetail/index.vue

@@ -115,7 +115,21 @@ const pageUrl=ref(`/pages-media/videoDetail/index?id=${audioId.value}`)
         </template>
 
         <NoAuthBox :riskLevelStatus="riskLevelStatus" :pageUrl="pageUrl"/>
-        
+        <view class="tips-box" v-if="!audioDetail.isFree && !audioDetail.isSubscribe">
+            <view class="tips-title">风险提示</view>
+            <view class="tips-content">
+                若需继续查看可点击【立即订阅】
+            </view>
+        </view>
+        <view class="subscribe-btn" v-if="!audioDetail.isFree && !audioDetail.isSubscribe">
+            <view class="pay-btn-confirm">
+                <view class="pay-btn-money">
+                    合计
+                    <text class="pay">¥{{ audioDetail.Price }}</text>
+                </view>
+                <button class="btn" type="primary" @click="goPrimary(audioDetail)">提交订单</button>
+            </view>
+        </view>
     </default-page>
 </template>
 
@@ -128,6 +142,52 @@ const pageUrl=ref(`/pages-media/videoDetail/index?id=${audioId.value}`)
             padding:var(--page-padding);
         }
     }
-    .audio-content{}
+    // .audio-content{}
+}
+.tips-box {
+    font-size: 34rpx;
+    text-align: center;
+    color: #053CC9;
+}
+.subscribe-btn {
+    width: 100%;
+    margin: 0 auto;
+    background-color: #fff;
+    border-radius: 16rpx;
+    padding: 40rpx;
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    position: absolute;
+    bottom: 0;
+    .pay-btn-cancel {
+        color: #0078E8;
+        font-size: 28rpx;
+    }
+    .pay-btn-confirm{
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        .pay-btn-money {
+            font-size: 32rpx;
+            text-align: right;
+            color: #999999;
+            margin-right: 20rpx;
+            .pay{
+                font-size: 36rpx;
+                color: #e54d42;
+                margin-left: 10rpx;
+            }
+        }
+        button {
+            margin: 0;
+            width: 268rpx;
+            height: 80rpx;
+            line-height: 80rpx;
+            border-radius: 80rpx;
+            background-color: #0078E8;
+        }
+    }
+
 }
 </style>

+ 64 - 3
pages-media/videoDetail/index.vue

@@ -31,6 +31,8 @@ function getVideoDetail(){
             return 
         }
         videoDetail.value = res.data||{}
+        console.log(videoDetail.value);
+        
         riskLevelStatus.value=res.data.riskLevelStatus
         getAuthorDetail()
     })
@@ -109,7 +111,21 @@ const pageUrl=ref(`/pages-media/videoDetail/index?id=${videoId.value}`)
                     content="分享"></t-button>
             </view>
             <NoAuthBox :riskLevelStatus="riskLevelStatus" :pageUrl="pageUrl"/>
-            
+            <view class="tips-box" v-if="!videoDetail.isFree && !videoDetail.isSubscribe">
+                <view class="tips-title">风险提示</view>
+                <view class="tips-content">
+                    若需继续查看可点击【立即订阅】
+                </view>
+            </view>
+            <view class="subscribe-btn" v-if="!videoDetail.isFree && !videoDetail.isSubscribe">
+                <view class="pay-btn-confirm">
+                    <view class="pay-btn-money">
+                        合计
+                        <text class="pay">¥{{ videoDetail.Price }}</text>
+                    </view>
+                    <button class="btn" type="primary" @click="goPrimary(videoDetail)">提交订单</button>
+                </view>
+            </view>
         </view>
     </default-page>
 </template>
@@ -123,7 +139,52 @@ const pageUrl=ref(`/pages-media/videoDetail/index?id=${videoId.value}`)
             padding:var(--page-padding);
         }
     }
-    .video-content{}
-    
+    // .video-content{}
+    .tips-box {
+        font-size: 34rpx;
+        text-align: center;
+        color: #053CC9;
+    }
+    .subscribe-btn {
+        width: 100%;
+        margin: 0 auto;
+        background-color: #fff;
+        border-radius: 16rpx;
+        padding: 40rpx;
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+        position: absolute;
+        bottom: 0;
+        .pay-btn-cancel {
+            color: #0078E8;
+            font-size: 28rpx;
+        }
+        .pay-btn-confirm{
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            .pay-btn-money {
+                font-size: 32rpx;
+                text-align: right;
+                color: #999999;
+                margin-right: 20rpx;
+                .pay{
+                    font-size: 36rpx;
+                    color: #e54d42;
+                    margin-left: 10rpx;
+                }
+            }
+            button {
+                margin: 0;
+                width: 268rpx;
+                height: 80rpx;
+                line-height: 80rpx;
+                border-radius: 80rpx;
+                background-color: #0078E8;
+            }
+        }
+
+    }
 }
 </style>

+ 28 - 0
pages-report/indexSearch/index.vue

@@ -3,6 +3,8 @@ import { onReachBottom, onShareAppMessage, onReady,onShow,onPullDownRefresh } fr
 import apiCommon from '@/api/common'
 import { ref } from 'vue'
 import order from '@/api/order'
+import { useUserState } from '@/hooks/useUserState'
+const { checkUserIsBind } = useUserState()
 
 const list = ref([])
 let page = 1
@@ -45,6 +47,32 @@ onReachBottom(() => {
 })
 function goReportDetail(item){
     
+}
+async function goVideoDetail(item){
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/videoDetail/index?id=${item.mediaId}`
+    }); 
+}
+async function goAudioDetail(item){
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/audioDetail/index?id=${item.mediaId}`
+    });
 }
 </script>
 

+ 55 - 6
pages-report/subscriptCenter/index.vue

@@ -7,7 +7,7 @@ import {checkResState} from '@/utils/common'
 import { useConfig } from '@/hooks/useConfig.js'
 const { config } = useConfig()
 import { useUserState } from '@/hooks/useUserState'
-const { userInfo, getUserInfo } = useUserState()
+const { userInfo, getUserInfo,checkUserIsBind } = useUserState()
 
 const activeType = ref('single')
 const singleType = ref('report')
@@ -68,6 +68,9 @@ async function getReportList(){
     const {Data,Page={}} = res.data
     const arr = Data||[]
     reportList.value = [...reportList.value,...arr]
+    reportList.value.map((item)=>{
+        item.productId = item.id
+    })
     latestId = Page.latestId||0
     finished.value=Page.totalPage===page||arr.length===0
 }
@@ -98,6 +101,34 @@ onPullDownRefresh(()=>{
     }, 1500);
 })
 
+async function goVideoDetail(item){
+    console.log(item);
+    
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/videoDetail/index?id=${item.mediaId}`
+    }); 
+}
+async function goAudioDetail(item){
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/audioDetail/index?id=${item.mediaId}`
+    });
+}
 </script>
 
 <template>
@@ -149,11 +180,29 @@ onPullDownRefresh(()=>{
         </view>
         <scroll-view class="report-content" scroll-y @scrolltolower="onReachBottom">
             <empty-box v-if="reportList.length === 0"></empty-box>
-            <report-item
-                :data="item"
-                v-for="item in reportList"
-                :key="item.Id"
-            />
+            <template v-if="activeType === 'package' || singleType==='report'">
+                <report-item
+                    :data="item"
+                    v-for="item in reportList"
+                    :key="item.id"
+                />
+            </template>
+            <template v-if="singleType==='video'">
+                <video-item 
+                    :data="item"
+                    v-for="item in reportList"
+                    :key="item.id"
+                    @tap="goVideoDetail(item)">
+                </video-item>
+            </template>
+            <template v-if="singleType==='audio'">
+                <audio-item 
+                    :data="item"
+                    v-for="item in reportList"
+                    :key="item.id"
+                    @tap="goAudioDetail(item)">
+                </audio-item>
+            </template>
         </scroll-view>
     </view>
     <!-- eslint-disable-next-line -->

+ 32 - 5
pages-user/mySubscript/index.vue

@@ -3,11 +3,10 @@ import { onShareAppMessage, onReady,onLoad,onPullDownRefresh,onShow } from '@dcl
 import { ref, computed } from 'vue'
 import order from '@/api/order'
 import {checkResState} from '@/utils/common'
-
 import { useConfig } from '@/hooks/useConfig.js'
 const { config } = useConfig()
 import { useUserState } from '@/hooks/useUserState'
-const { userInfo, getUserInfo } = useUserState()
+const { userInfo, getUserInfo, checkUserIsBind } = useUserState()
 
 const activeType = ref('report')
 const tabs = ref(null)
@@ -72,7 +71,32 @@ onPullDownRefresh(()=>{
         uni.stopPullDownRefresh()
     }, 1500);
 })
-
+async function goVideoDetail(item){
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId || (!item.isFree && !item.isSubscribe) ) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/videoDetail/index?id=${item.mediaId}`
+    }); 
+}
+async function goAudioDetail(item){
+    if (item.isPackage) {
+        uni.navigateTo({
+            url: `/pages-order/packageDetail/index?id=${item.productId}`
+        });
+        return
+    }
+    if(!item.mediaId || (!item.isFree && !item.isSubscribe) ) return
+    await checkUserIsBind()
+    uni.navigateTo({
+        url: `/pages-media/audioDetail/index?id=${item.mediaId}`
+    });
+}
 </script>
 
 <template>
@@ -104,19 +128,22 @@ onPullDownRefresh(()=>{
         <scroll-view class="report-content content-wrap" scroll-y @scrolltolower="onReachBottom">
             <empty-box v-if="productList.length === 0"></empty-box>
             <template v-for="item in productList">
-                <template v-if="item.activeType==='video'">
+                <template v-if="item.type==='video'">
                     <video-item 
                         :data="item"
+                        :isShowSubscribe="false"
                         @tap="goVideoDetail(item)"></video-item>
                 </template>
-                <template v-else-if="item.activeType === 'audio'">
+                <template v-else-if="item.type === 'audio'">
                     <audio-item 
                         :data="item"
+                        :isShowSubscribe="false"
                         @tap="goAudioDetail(item)"></audio-item>
                 </template>
                 <template v-else>
                     <report-item
                         :data="item"
+                        :isShowSubscribe="false"
                         :key="item.Id"
                     />
                 </template>

+ 2 - 4
pages/media/index.vue

@@ -59,9 +59,7 @@ async function goVideoDetail(item){
         });
         return
     }
-    console.log(item);
-    
-    if(!item.mediaId || (!item.isFree && !item.isSubscribe) ) return
+    if(!item.mediaId) return
     await checkUserIsBind()
     uni.navigateTo({
         url: `/pages-media/videoDetail/index?id=${item.mediaId}`
@@ -74,7 +72,7 @@ async function goAudioDetail(item){
         });
         return
     }
-    if(!item.mediaId || (!item.isFree && !item.isSubscribe) ) return
+    if(!item.mediaId) return
     await checkUserIsBind()
     uni.navigateTo({
         url: `/pages-media/audioDetail/index?id=${item.mediaId}`