Browse Source

修改字段

lex 2 years ago
parent
commit
830fd8dd94

+ 3 - 3
src/teacher/income-consus/index.tsx

@@ -151,7 +151,6 @@ export default defineComponent({
           }
         )
         const result = res.data || {}
-
         this.moneyInfo = {
           totalSingleRate:
             result.practiceRate +
@@ -190,6 +189,7 @@ export default defineComponent({
           actiRegistShareAmount: result.actiRegistShareAmount || 0,
           actiRegistShareRate: result.actiRegistShareRate || 0
         }
+        console.log(this.moneyInfo)
         // 处理折线图数据
         const lineData = {
           xAxis: [] as any,
@@ -371,7 +371,7 @@ export default defineComponent({
                 <div class={styles.type}>
                   <span>专辑推荐</span>
                   <span class={styles.price}>
-                    {moneyFormat(this.moneyInfo.musicShareAmount)}
+                    {moneyFormat(this.moneyInfo.albumShareAmount)}
                   </span>
                 </div>
               </Col>
@@ -472,7 +472,7 @@ export default defineComponent({
             <div>
               <i class={styles.pie7}></i>
               <span class={styles.pieTitle}>专辑推荐</span>
-              <span>{this.moneyInfo.mallShareRate}%</span>
+              <span>{this.moneyInfo.albumShareRate}%</span>
             </div>
           </div>
         </div>

+ 13 - 0
src/views/music/album-detail/index.module.less

@@ -284,3 +284,16 @@
   color: #ffffff;
   line-height: 24px;
 }
+.buttonDiscount {
+  position: absolute;
+  top: -23px;
+  right: 15px;
+  padding: 0 10px;
+  height: 23px;
+  background: linear-gradient(180deg, #ffb635 0%, #ff4e18 100%);
+  border-radius: 8px 8px 0px 0px;
+  font-size: 14px;
+  font-weight: 600;
+  color: #ffffff;
+  line-height: 24px;
+}

+ 32 - 19
src/views/music/album-detail/index.tsx

@@ -41,6 +41,7 @@ export default defineComponent({
   setup({ onItemClick }) {
     localStorage.setItem('behaviorId', getRandomKey())
     const router = useRouter()
+    const route = useRoute()
     const params = reactive({
       search: '',
       relatedNum: 6, //相关专辑数
@@ -51,6 +52,8 @@ export default defineComponent({
     // const data = ref<any>(null)
     const rows = ref<any[]>([])
     const loading = ref(false)
+    const aId = route.query.activityId || ''
+    const studentActivityId = ref(aId)
     // const finished = ref(false)
     const isError = ref(false)
     const favorited = ref(0)
@@ -60,7 +63,6 @@ export default defineComponent({
     const color = ref<string>('#fff')
     const heightInfo = ref<any>('auto')
 
-    const route = useRoute()
     const FetchList = async (id?: any) => {
       if (loading.value) {
         return
@@ -219,8 +221,14 @@ export default defineComponent({
             userId
           }
         })
-        activityId = res.data.activityId || 0
-        shareDiscount.value = res.data.discount || 0
+        // 如果有会员则显示
+        if (
+          albumDetail.value?.musicPaymentTypes &&
+          albumDetail.value?.musicPaymentTypes.includes('VIP')
+        ) {
+          activityId = res.data.activityId || 0
+          shareDiscount.value = res.data.discount || 0
+        }
       }
       shareUrl.value = `${location.origin}/teacher#/shareAblum?id=${id}&recomUserId=${userId}&activityId=${activityId}&userType=${state.platformType}`
       console.log(shareUrl.value, 'shareUrl')
@@ -388,22 +396,27 @@ export default defineComponent({
                   </Button>
                   {albumDetail.value?.musicPaymentTypes &&
                     albumDetail.value?.musicPaymentTypes.includes('VIP') && (
-                      <Button
-                        block
-                        round
-                        type="primary"
-                        style={{ fontSize: '16px' }}
-                        onClick={() => {
-                          router.push({
-                            path: '/memberCenter',
-                            query: {
-                              ...route.query
-                            }
-                          })
-                        }}
-                      >
-                        开通会员
-                      </Button>
+                      <>
+                        <Button
+                          block
+                          round
+                          type="primary"
+                          style={{ fontSize: '16px' }}
+                          onClick={() => {
+                            router.push({
+                              path: '/memberCenter',
+                              query: {
+                                ...route.query
+                              }
+                            })
+                          }}
+                        >
+                          {studentActivityId.value > 0 && (
+                            <div class={[styles.buttonDiscount]}>专属优惠</div>
+                          )}
+                          开通会员
+                        </Button>
+                      </>
                     )}
                 </div>
               </ColSticky>