Sfoglia il codice sorgente

修改选择问题

lex 1 anno fa
parent
commit
92c3450694

+ 17 - 0
src/components/col-search/index.module.less

@@ -47,6 +47,20 @@
     }
   }
 
+  &.col-tenant-search {
+    &.default {
+      :global {
+        .van-search__content {
+          background: #f5f6f8;
+        }
+
+        .van-field__control {
+          color: #aaa;
+        }
+      }
+    }
+  }
+
   &.white {
     :global {
       .van-search__content {
@@ -82,10 +96,13 @@
     font-size: 14px;
     --van-button-mini-height: 28px;
     --van-font-size-xs: 14px;
+    line-height: 1;
 
     &.searchTenantBtn {
       background: linear-gradient(270deg, #FF3C81 0%, #FF76A6 100%);
       border: none;
+
+
     }
   }
 }

+ 5 - 1
src/components/col-search/index.tsx

@@ -74,7 +74,11 @@ export default defineComponent({
     return (
       <div>
         <Search
-          class={[styles['col-search'], styles[this.inputBackground]]}
+          class={[
+            styles['col-search'],
+            this.type === 'tenant' && styles['col-tenant-search'],
+            styles[this.inputBackground]
+          ]}
           v-model={this.search}
           background={this.background}
           showAction={this.showAction}

+ 1 - 1
src/tenant/music/component/song/index.tsx

@@ -96,7 +96,7 @@ export default defineComponent({
                 <div class={styles.user}>
                   <Image
                     src={
-                      n.favorite === 1
+                      n.favorite
                         ? getAssetsHomeFile('collection_active.png')
                         : getAssetsHomeFile('collection.png')
                     }

+ 2 - 2
src/tenant/music/music-detail/new-index.tsx

@@ -604,8 +604,8 @@ export default defineComponent({
                 }}
               >
                 {musicDetail.value?.addName
-                  ? `上传者:${musicDetail.value?.addName}`
-                  : `作曲:${musicDetail.value?.composer}`}
+                  ? `上传者:${musicDetail.value?.addName || ''}`
+                  : `作曲:${musicDetail.value?.composer || ''}`}
               </div>
               <div class={styles.tags}>
                 {musicDetail.value?.id && (

+ 1 - 1
src/tenant/music/search/header.tsx

@@ -179,8 +179,8 @@ export default defineComponent({
         }),
         'set'
       )
-      mitter.emit('confirmSubject', subject)
       subject.show = false
+      mitter.emit('confirmSubject', subject)
     }
 
     const getSubject: any = useSubjectId(SubjectEnum.SEARCH)

+ 9 - 1
src/tenant/music/search/index.module.less

@@ -16,6 +16,13 @@
     >div {
       background-color: var(--base-bg);
     }
+
+    :global {
+      .van-search__content {
+        border: 1px solid #fff !important;
+        box-sizing: border-box;
+      }
+    }
   }
 
   .title {
@@ -32,6 +39,7 @@
     align-items: center;
     justify-content: space-between;
     padding: 8px 9px;
+    position: relative;
 
     .t {
       font-size: 14px;
@@ -142,7 +150,7 @@
   width: 100%;
   height: 214px;
   // object-fit: cover;
-  z-index: -1;
+  z-index: 0;
 }
 
 .tagTabs {

+ 12 - 16
src/tenant/music/train-list/index.tsx

@@ -308,23 +308,19 @@ export default defineComponent({
                   showTitleImg
                   list={data.value.rows}
                   onDetail={(item: any) => {
-                    if (onItemClick === noop) {
-                      const url =
-                        location.origin +
-                        location.pathname +
-                        '#/music-detail?id=' +
-                        item.id
-                      openDefaultWebView(url, () => {
-                        router.push({
-                          path: '/music-detail',
-                          query: {
-                            id: item.id
-                          }
-                        })
+                    const url =
+                      location.origin +
+                      location.pathname +
+                      '#/music-detail?id=' +
+                      item.id
+                    openDefaultWebView(url, () => {
+                      router.push({
+                        path: '/music-detail',
+                        query: {
+                          id: item.id
+                        }
                       })
-                    } else {
-                      onItemClick?.(item)
-                    }
+                    })
                   }}
                 />
               ) : (

+ 62 - 53
src/views/article-center/help-center-detail.module.less

@@ -1,53 +1,62 @@
-.imgContent {
-  margin-bottom: 15px;
-  img {
-    width: 100% !important;
-  }
-  video {
-    width: 100% !important;
-    height: 210px;
-  }
-
-  h2 {
-    display: flex;
-    align-items: center;
-    &::before {
-      content: ' ';
-      display: inline-block;
-      width: 18px;
-      height: 18px;
-      background: url('./images/icon_content.png') no-repeat center;
-      background-size: contain;
-      margin-right: 6px;
-      margin-top: -2px;
-    }
-  }
-}
-
-.help-center-detail {
-  min-height: 100vh;
-  overflow: hidden;
-  background-color: #fff;
-  padding: 0 14px;
-  line-height: 1.2;
-  --van-nav-bar-icon-color: #000;
-  h2 {
-    font-weight: 500;
-    color: rgba(68, 68, 68, 1);
-    line-height: 38px;
-    font-size: 22px;
-    padding-top: 12px;
-    margin-bottom: 10px;
-  }
-}
-
-.titleInfo {
-  height: 15px;
-  line-height: 15px;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  color: #999;
-  margin-bottom: 15px;
-  font-size: 14px;
-}
+.imgContent {
+  margin-bottom: 15px;
+
+  img {
+    width: 100% !important;
+  }
+
+  video {
+    width: 100% !important;
+    height: 210px;
+  }
+
+  h2 {
+    display: flex;
+    align-items: center;
+
+    &::before {
+      content: ' ';
+      display: inline-block;
+      width: 18px;
+      height: 18px;
+      background: url('./images/icon_content.png') no-repeat center;
+      background-size: contain;
+      margin-right: 6px;
+      margin-top: -2px;
+    }
+  }
+}
+
+.help-center-detail {
+  min-height: 100vh;
+  overflow: hidden;
+  // background-color: #fff;
+  padding: 0 14px;
+  line-height: 1.2;
+  --van-nav-bar-icon-color: #000;
+
+  h2 {
+    font-weight: 600;
+    color: 20px;
+    line-height: 38px;
+    font-size: 20px;
+    padding-top: 12px;
+    margin-bottom: 10px;
+  }
+}
+
+.titleInfo {
+  height: 15px;
+  line-height: 15px;
+  display: flex;
+  flex-direction: row;
+  // justify-content: space-between;
+  color: #999;
+  margin-bottom: 15px;
+  font-size: 14px;
+
+  p:first-child {
+    padding-right: 10px;
+    color: #FE2451;
+  }
+}

+ 94 - 95
src/views/article-center/help-center-detail.tsx

@@ -1,95 +1,94 @@
-import ColHeader from '@/components/col-header'
-import { useEventTracking } from '@/helpers/hooks'
-import request from '@/helpers/request'
-import dayjs from 'dayjs'
-import { ImagePreview, NavBar } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './help-center-detail.module.less'
-
-export default defineComponent({
-  name: 'help-center-detail',
-  data() {
-    const query = this.$route.query
-    return {
-      catalogType: query.catalogType,
-      documentTitle: query.catalogType === 'ANALYSIS' ? '帮助中心详情' : '',
-      detail: {
-        title: '',
-        createTime: '',
-        content: ''
-      }
-    }
-  },
-  async mounted() {
-    try {
-      const query = this.$route.query
-      const res = await request.get(
-        '/api-cms/helpCenterContent/get/' + query.id
-      )
-      let { title, releaseTime, createTime, content, catalogId } = res.data
-      this.detail = {
-        title,
-        createTime:
-          catalogId == 2
-            ? dayjs(releaseTime).format('YYYY-MM-DD HH:mm:ss')
-            : dayjs(createTime).format('YYYY-MM-DD HH:mm:ss'),
-        content
-      }
-
-      const documentTitle = catalogId == 2 ? '公告详情' : '帮助中心详情'
-      document.title = documentTitle
-    } catch {}
-    useEventTracking('帮助中心')
-  },
-  methods: {
-    onShowImg(target: any) {
-      const { localName } = target.srcElement
-      if (localName !== 'img') {
-        return
-      }
-      let startPosition = 0
-      const domList = document.querySelectorAll('.msgWrap img')
-      let imgList = Array.from(domList).map((item: any, index: number) => {
-        if (target.srcElement == item) {
-          startPosition = index
-        }
-        return item.src
-      })
-
-      ImagePreview({
-        images: imgList,
-        startPosition: startPosition,
-        closeable: true
-      })
-    }
-  },
-  render() {
-    return (
-      <div class={styles['help-center-detail']}>
-        {this.catalogType === 'ANALYSIS' && (
-          // <ColHeader title={this.documentTitle} isBack />
-          <NavBar
-            title={this.documentTitle}
-            left-arrow
-            fixed
-            onClick-left={() => {
-              this.$router.back()
-            }}
-          ></NavBar>
-        )}
-
-        <h2>{this.detail.title}</h2>
-        <div class={styles.titleInfo}>
-          <p>酷乐秀</p>
-          <p>{this.detail.createTime}</p>
-        </div>
-        <div
-          style={{ height: '1000px' }}
-          class={[styles.imgContent, 'msgWrap']}
-          // onClick={this.onShowImg}
-          v-html={this.detail.content}
-        ></div>
-      </div>
-    )
-  }
-})
+import ColHeader from '@/components/col-header'
+import { useEventTracking } from '@/helpers/hooks'
+import request from '@/helpers/request'
+import dayjs from 'dayjs'
+import { ImagePreview, NavBar } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './help-center-detail.module.less'
+
+export default defineComponent({
+  name: 'help-center-detail',
+  data() {
+    const query = this.$route.query
+    return {
+      catalogType: query.catalogType,
+      documentTitle: query.catalogType === 'ANALYSIS' ? '帮助中心详情' : '',
+      detail: {
+        title: '',
+        createTime: '',
+        content: ''
+      }
+    }
+  },
+  async mounted() {
+    try {
+      const query = this.$route.query
+      const res = await request.get(
+        '/api-cms/helpCenterContent/get/' + query.id
+      )
+      const { title, releaseTime, createTime, content, catalogId } = res.data
+      this.detail = {
+        title,
+        createTime:
+          catalogId == 2
+            ? dayjs(releaseTime).format('YYYY-MM-DD HH:mm:ss')
+            : dayjs(createTime).format('YYYY-MM-DD HH:mm:ss'),
+        content
+      }
+
+      const documentTitle = catalogId == 2 ? '公告详情' : ' '
+      document.title = documentTitle
+    } catch {}
+    useEventTracking('帮助中心')
+  },
+  methods: {
+    onShowImg(target: any) {
+      const { localName } = target.srcElement
+      if (localName !== 'img') {
+        return
+      }
+      let startPosition = 0
+      const domList = document.querySelectorAll('.msgWrap img')
+      const imgList = Array.from(domList).map((item: any, index: number) => {
+        if (target.srcElement == item) {
+          startPosition = index
+        }
+        return item.src
+      })
+
+      ImagePreview({
+        images: imgList,
+        startPosition: startPosition,
+        closeable: true
+      })
+    }
+  },
+  render() {
+    return (
+      <div class={styles['help-center-detail']}>
+        {this.catalogType === 'ANALYSIS' && (
+          // <ColHeader title={this.documentTitle} isBack />
+          <NavBar
+            title={this.documentTitle}
+            left-arrow
+            fixed
+            onClick-left={() => {
+              this.$router.back()
+            }}
+          ></NavBar>
+        )}
+
+        <h2>{this.detail.title}</h2>
+        <div class={styles.titleInfo}>
+          <p>酷乐秀</p>
+          <p>{this.detail.createTime}</p>
+        </div>
+        <div
+          class={[styles.imgContent, 'msgWrap']}
+          // onClick={this.onShowImg}
+          v-html={this.detail.content}
+        ></div>
+      </div>
+    )
+  }
+})

+ 8 - 1
src/views/music/album-detail/index.tsx

@@ -181,6 +181,7 @@ export default defineComponent({
             orderStatus.orderObject.orderNo = result.orderNo
             orderStatus.orderObject.actualPrice = result.actualPrice
             orderStatus.orderObject.discountPrice = result.discountPrice
+            orderStatus.orderObject.paymentConfig = result.paymentConfig
             routerTo()
           })
           .catch(() => {
@@ -495,7 +496,13 @@ export default defineComponent({
                   </p>
                   <div class={styles.shareAlumCollect}>
                     <img src={icon_music_list} />
-                    <span>共<span style="color: var(--van-primary-color);">{albumDetail.value?.musicSheetCount}</span>首曲目</span>
+                    <span>
+                      共
+                      <span style="color: var(--van-primary-color);">
+                        {albumDetail.value?.musicSheetCount}
+                      </span>
+                      首曲目
+                    </span>
                   </div>
                 </div>
               </div>

+ 1 - 0
src/views/music/music-detail/index.tsx

@@ -431,6 +431,7 @@ export default defineComponent({
             orderStatus.orderObject.orderNo = result.orderNo
             orderStatus.orderObject.actualPrice = result.actualPrice
             orderStatus.orderObject.discountPrice = result.discountPrice
+            orderStatus.orderObject.paymentConfig = result.paymentConfig
             routerTo()
           })
           .catch(() => {

+ 16 - 3
src/views/order-detail/index.tsx

@@ -20,6 +20,7 @@ import UrlPayment from '../adapay/payment'
 import ColHeader from '@/components/col-header'
 import { state } from '@/state'
 import {
+  beforeSubmit,
   orderInfos,
   orderStatus,
   orderTenantInfos,
@@ -30,7 +31,7 @@ import OrderLive from './order-live'
 import OrderPractice from './order-practice'
 import OrderVip from './order-vip'
 import OrderMusic from './order-music'
-import { moneyFormat } from '@/helpers/utils'
+import { browser, moneyFormat } from '@/helpers/utils'
 import OrderPinao from './order-pinao'
 import { getMusicDetail } from '@/student/trade/tradeOrder'
 import OrderActive from './order-active'
@@ -208,12 +209,24 @@ export default defineComponent({
         }
       }
 
-      console.log(orderStatus.orderObject, 'orderInfo')
       // 判断是否有订单号
       if (orderStatus.orderObject.orderNo) {
         this.paymentStatus = true
         this.orderInfo = orderStatus.orderObject.paymentConfig || {}
-        this.orderNo = orderStatus.orderObject.paymentConfig.orderNo
+        this.orderNo = orderStatus.orderObject.orderNo
+        // if (this.paymentVersion === 'V1') {
+        // } else {
+        //   this.orderInfo = orderStatus.orderObject.paymentConfig || {}
+        //   this.orderNo = orderStatus.orderObject.orderNo
+        //   const paymentChannel =
+        //     orderStatus.orderObject.paymentConfig.paymentConfig.paymentChannel
+        //   const payCode = beforeSubmit(paymentChannel)
+        //   this.onConfirm({
+        //     payCode,
+        //     pay_channel: paymentChannel
+        //   })
+        // }
+
         return
       }
 

+ 63 - 0
src/views/order-detail/orderStatus.ts

@@ -2,6 +2,7 @@ import { orderType } from './../../constant/index'
 import { reactive } from 'vue'
 import { state } from '@/state'
 import request from '@/helpers/request'
+import { browser } from '@/helpers/utils'
 import { Dialog } from 'vant'
 type orderType =
   | 'VIDEO'
@@ -180,6 +181,37 @@ export const orderTenantInfos = () => {
       params.bizContent = {
         groupId: item.courseGroupId
       }
+    } else if (item.orderType === 'VIDEO') {
+      params.bizContent = {
+        videoLessonGroupId: item.courseGroupId,
+        payMoney: item.coursePrice || 0
+      }
+    } else if (item.orderType === 'PRACTICE') {
+      const tempTime = item.classTime || []
+      const classCourse: any = []
+      tempTime.forEach((time: any) => {
+        classCourse.push({
+          classDate: time.classDate,
+          startTime: time.startTime,
+          endTime: time.endTime
+        })
+      })
+      params.bizContent = {
+        courseGroupName: item.courseGroupName,
+        courseIntroduce: item.courseIntroduce,
+        subjectId: item.subjectId,
+        singleCourseMinutes: item.singleCourseMinutes,
+        courseNum: item.courseNum,
+        coursePrice: item.coursePrice,
+        teacherId: item.teacherId,
+        classTime: classCourse
+      }
+    } else if (item.orderType === 'PIANO_ROOM') {
+      params.bizContent = item.id
+    } else if (item.orderType === 'ACTI_REGIST') {
+      params.bizContent = {
+        activityId: item.activityId
+      }
     }
     return params
   })
@@ -237,3 +269,34 @@ export const onSubmitZero = async (callBack?: Function): Promise<void> => {
     })
   }
 }
+
+/**
+ * @author wxl
+ * @description 处理基础支付功能
+ */
+
+// 判断浏览器与支付类型,返回对应页面名称
+export const beforeSubmit = (pt: string) => {
+  // const pt = state.pay_channel
+  let payCode = 'qrCode'
+  // 判断当前浏览器
+  if (browser().weixin) {
+    // 微信浏览器
+    if (pt == 'alipay_qr' || pt == 'alipay_wap') {
+      payCode = 'qrCode'
+    } else if (pt == 'wx_pub') {
+      payCode = 'pay'
+    }
+  } else if (browser().alipay) {
+    // 支付宝浏览器
+    if (pt == 'alipay_wap') {
+      // 支付宝 H5 支付
+      payCode = 'pay'
+    } else {
+      payCode = 'qrCode'
+    }
+  } else {
+    payCode = 'qrCode'
+  }
+  return payCode == 'qrCode' ? 'payDefine' : 'payResult'
+}