lex 1 год назад
Родитель
Сommit
a1e1591eb3

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

@@ -118,7 +118,11 @@ export default defineComponent({
       !browser().isApp && callBack && callBack()
     },
     onClickLeft() {
-      this.$router.back()
+      if (browser().isApp) {
+        postMessage({ api: 'goBack' })
+      } else {
+        this.$router.back()
+      }
     },
     clickRight() {
       this.onClickRight && this.onClickRight()

+ 4 - 2
src/views/article-center/help-center-detail.tsx

@@ -37,6 +37,7 @@ export default defineComponent({
       }
 
       const documentTitle = catalogId == 2 ? '公告详情' : 'ㅤ' //'    ‌‍‎‏ '
+      this.documentTitle = documentTitle
       document.title = documentTitle
     } catch {}
     useEventTracking('帮助中心')
@@ -66,8 +67,7 @@ export default defineComponent({
   render() {
     return (
       <div class={styles['help-center-detail']}>
-        {this.catalogType === 'ANALYSIS' && (
-          // <ColHeader title={this.documentTitle} isBack />
+        {this.catalogType === 'ANALYSIS' ? (
           <NavBar
             title={this.documentTitle}
             left-arrow
@@ -76,6 +76,8 @@ export default defineComponent({
               this.$router.back()
             }}
           ></NavBar>
+        ) : (
+          <ColHeader title={' '} />
         )}
 
         <h2>{this.detail.title}</h2>

+ 3 - 0
src/views/article-center/help-center.tsx

@@ -5,6 +5,7 @@ import { defineComponent } from 'vue'
 import ColSearch from '@/components/col-search'
 import ColResult from '@/components/col-result'
 import { useEventTracking } from '@/helpers/hooks'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'help-center',
@@ -24,6 +25,7 @@ export default defineComponent({
       loading: false,
       finished: false,
       // 1:帮助中心,2:公告管理
+      pageTitle: title,
       params: {
         catalogIds: query.catalogType || 1,
         title: '',
@@ -94,6 +96,7 @@ export default defineComponent({
     return (
       <div>
         <Sticky offsetTop={0} position="top" class={'mb12'}>
+          <ColHeader isFixed={false} title={this.pageTitle} border={false} />
           <ColSearch
             type={state.projectType === 'tenant' ? 'tenant' : 'person'}
             onSearch={this.onSearch}

+ 72 - 70
src/views/article-center/special-detail.tsx

@@ -1,70 +1,72 @@
-import { useEventTracking } from '@/helpers/hooks'
-import request from '@/helpers/request'
-import dayjs from 'dayjs'
-import { ImagePreview } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './help-center-detail.module.less'
-
-export default defineComponent({
-  name: 'special-detail',
-  data() {
-    return {
-      detail: {
-        title: '',
-        createTime: '',
-        content: ''
-      }
-    }
-  },
-  async mounted() {
-    try {
-      const query = this.$route.query
-      const res = await request.get('/api-cms/news/query/' + query.id)
-      let { title, createTime, content } = res.data
-      this.detail = {
-        title,
-        createTime: dayjs(createTime).format('YYYY-MM-DD HH:mm:ss'),
-        content
-      }
-    } 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']}>
-        <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>
-    )
-  }
-})
+import { useEventTracking } from '@/helpers/hooks'
+import request from '@/helpers/request'
+import dayjs from 'dayjs'
+import { ImagePreview } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './help-center-detail.module.less'
+import ColHeader from '@/components/col-header'
+
+export default defineComponent({
+  name: 'special-detail',
+  data() {
+    return {
+      detail: {
+        title: '',
+        createTime: '',
+        content: ''
+      }
+    }
+  },
+  async mounted() {
+    try {
+      const query = this.$route.query
+      const res = await request.get('/api-cms/news/query/' + query.id)
+      const { title, createTime, content } = res.data
+      this.detail = {
+        title,
+        createTime: dayjs(createTime).format('YYYY-MM-DD HH:mm:ss'),
+        content
+      }
+    } 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']}>
+        <ColHeader />
+        <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>
+    )
+  }
+})

+ 128 - 126
src/views/article-center/special.tsx

@@ -1,126 +1,128 @@
-import { state } from '@/state'
-import request from '@/helpers/request'
-import { Cell, List, Sticky, Image, CellGroup } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './special.module.less'
-import ColSearch from '@/components/col-search'
-import ColResult from '@/components/col-result'
-import { useEventTracking } from '@/helpers/hooks'
-
-export default defineComponent({
-  name: 'special',
-  data() {
-    const query = this.$route.query
-    return {
-      list: [],
-      dataShow: true, // 判断是否有数据
-      loading: false,
-      finished: false,
-      // 1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5按钮管理 6 乐理章节
-      params: {
-        search: '',
-        type: query.type || 1,
-        platformType: state.platformType,
-        page: 1,
-        rows: 20
-      }
-    }
-  },
-  async mounted() {
-    useEventTracking('热门资讯')
-  },
-  methods: {
-    async getList() {
-      try {
-        let params = this.params
-        const res = await request.post('/api-cms/news/page', {
-          data: {
-            ...params
-          }
-        })
-        this.loading = false
-        const result = res.data || {}
-        // 处理重复请求数据
-        if (this.list.length > 0 && result.pageNo === 1) {
-          return
-        }
-        this.list = this.list.concat(result.rows || [])
-        this.finished = result.pageNo >= result.totalPage
-        this.params.page = result.pageNo + 1
-        this.dataShow = this.list.length > 0
-      } catch {
-        this.dataShow = false
-        this.finished = true
-      }
-    },
-    onSearch(val: string) {
-      this.params.search = val
-      this.params.page = 1
-      this.list = []
-      this.dataShow = true // 判断是否有数据
-      this.loading = false
-      this.finished = false
-      this.getList()
-    },
-    onDetail(item: any) {
-      if (item.linkUrl) {
-        window.location.href = item.linkUrl
-      } else {
-        this.$router.push({
-          path: 'specialDetail',
-          query: {
-            id: item.id
-          }
-        })
-      }
-    }
-  },
-  render() {
-    return (
-      <div class={styles['special']}>
-        <Sticky offsetTop={0} position="top" class={'mb12'}>
-          <ColSearch onSearch={this.onSearch} />
-        </Sticky>
-        {this.dataShow ? (
-          <List
-            class={styles.videoList}
-            v-model:loading={this.loading}
-            finished={this.finished}
-            finishedText="没有更多了"
-            onLoad={this.getList}
-          >
-            {this.list.map((item: any) => (
-              <CellGroup
-                inset
-                class={'mb12'}
-                onClick={() => {
-                  this.onDetail(item)
-                }}
-              >
-                <Cell
-                  title={item.title}
-                  titleClass={['van-ellipsis', styles.title]}
-                  v-slots={{
-                    label: () => (
-                      <div class={styles.label}>
-                        <div class={styles.time}>{item.createTime}</div>
-
-                        <Image
-                          class={styles.imgCover}
-                          src={item.coverImage}
-                          fit="cover"
-                        />
-                      </div>
-                    )
-                  }}
-                />
-              </CellGroup>
-            ))}
-          </List>
-        ) : (
-          <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无内容" />
-        )}
-      </div>
-    )
-  }
-})
+import { state } from '@/state'
+import request from '@/helpers/request'
+import { Cell, List, Sticky, Image, CellGroup } from 'vant'
+import { defineComponent } from 'vue'
+import styles from './special.module.less'
+import ColSearch from '@/components/col-search'
+import ColResult from '@/components/col-result'
+import { useEventTracking } from '@/helpers/hooks'
+import ColHeader from '@/components/col-header'
+
+export default defineComponent({
+  name: 'special',
+  data() {
+    const query = this.$route.query
+    return {
+      list: [],
+      dataShow: true, // 判断是否有数据
+      loading: false,
+      finished: false,
+      // 1热门资讯,2开屏广告,3闪页管理,4轮播图管理 5按钮管理 6 乐理章节
+      params: {
+        search: '',
+        type: query.type || 1,
+        platformType: state.platformType,
+        page: 1,
+        rows: 20
+      }
+    }
+  },
+  async mounted() {
+    useEventTracking('热门资讯')
+  },
+  methods: {
+    async getList() {
+      try {
+        const params = this.params
+        const res = await request.post('/api-cms/news/page', {
+          data: {
+            ...params
+          }
+        })
+        this.loading = false
+        const result = res.data || {}
+        // 处理重复请求数据
+        if (this.list.length > 0 && result.pageNo === 1) {
+          return
+        }
+        this.list = this.list.concat(result.rows || [])
+        this.finished = result.pageNo >= result.totalPage
+        this.params.page = result.pageNo + 1
+        this.dataShow = this.list.length > 0
+      } catch {
+        this.dataShow = false
+        this.finished = true
+      }
+    },
+    onSearch(val: string) {
+      this.params.search = val
+      this.params.page = 1
+      this.list = []
+      this.dataShow = true // 判断是否有数据
+      this.loading = false
+      this.finished = false
+      this.getList()
+    },
+    onDetail(item: any) {
+      if (item.linkUrl) {
+        window.location.href = item.linkUrl
+      } else {
+        this.$router.push({
+          path: 'specialDetail',
+          query: {
+            id: item.id
+          }
+        })
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={styles['special']}>
+        <Sticky offsetTop={0} position="top" class={'mb12'}>
+          <ColHeader />
+          <ColSearch onSearch={this.onSearch} />
+        </Sticky>
+        {this.dataShow ? (
+          <List
+            class={styles.videoList}
+            v-model:loading={this.loading}
+            finished={this.finished}
+            finishedText="没有更多了"
+            onLoad={this.getList}
+          >
+            {this.list.map((item: any) => (
+              <CellGroup
+                inset
+                class={'mb12'}
+                onClick={() => {
+                  this.onDetail(item)
+                }}
+              >
+                <Cell
+                  title={item.title}
+                  titleClass={['van-ellipsis', styles.title]}
+                  v-slots={{
+                    label: () => (
+                      <div class={styles.label}>
+                        <div class={styles.time}>{item.createTime}</div>
+
+                        <Image
+                          class={styles.imgCover}
+                          src={item.coverImage}
+                          fit="cover"
+                        />
+                      </div>
+                    )
+                  }}
+                />
+              </CellGroup>
+            ))}
+          </List>
+        ) : (
+          <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无内容" />
+        )}
+      </div>
+    )
+  }
+})

+ 2 - 0
src/views/contactus/index.tsx

@@ -6,6 +6,7 @@ import kefu2 from './image/kefu2.png'
 import { Button, Toast } from 'vant'
 import { promisefiyPostMessage } from '@/helpers/native-message'
 import { state } from '@/state'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'contactus',
@@ -44,6 +45,7 @@ export default defineComponent({
 
     return () => (
       <div class={styles.container}>
+        <ColHeader />
         <div class={styles.topWrap}>
           <div class={styles.title}>
             如您在使用

+ 9 - 9
src/views/music/album-detail/index.tsx

@@ -112,17 +112,17 @@ export default defineComponent({
         if (y.value > 20) {
           background.value = `rgba(255, 255, 255)`
           color.value = 'black'
-          postMessage({
-            api: 'backIconChange',
-            content: { iconStyle: 'black' }
-          })
+          // postMessage({
+          //   api: 'backIconChange',
+          //   content: { iconStyle: 'black' }
+          // })
         } else {
           background.value = 'transparent'
           color.value = '#fff'
-          postMessage({
-            api: 'backIconChange',
-            content: { iconStyle: 'white' }
-          })
+          // postMessage({
+          //   api: 'backIconChange',
+          //   content: { iconStyle: 'white' }
+          // })
         }
       })
 
@@ -253,7 +253,7 @@ export default defineComponent({
 
     /** 分享曲谱列表, 最大数量4 */
     const shareMusicList = computed(() => {
-      return rows.value.length > 4 ? rows.value.slice(0, 4) : rows.value
+      return rows.value.length > 4 ? rows.value.slice(0, 2) : rows.value
     })
     return () => {
       return (

+ 2 - 0
src/views/music/album/index.tsx

@@ -12,6 +12,7 @@ import SelectSubject from '../search/select-subject'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import MusicGrid from '../component/music-grid'
 import { useAsyncState } from '@vueuse/core'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'Album',
@@ -213,6 +214,7 @@ export default defineComponent({
           >
             {!hideSearch && (
               <Sticky class={styles.sticky}>
+                <ColHeader />
                 <Search
                   modelValue={params.search}
                   onSearch={onSearch}

+ 2 - 0
src/views/music/look-album-list/index.tsx

@@ -1,5 +1,6 @@
 import { defineComponent } from 'vue'
 import Album from '../album'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'look-album-list',
@@ -14,6 +15,7 @@ export default defineComponent({
   render() {
     return (
       <>
+        <ColHeader />
         <Album
           hideSearch={true}
           defauleParams={{

+ 2 - 0
src/views/music/personal/index.tsx

@@ -10,6 +10,7 @@ import AlbumMy from './album-my'
 import styles from './index.module.less'
 import { getRandomKey } from '../music'
 import { useEventTracking } from '@/helpers/hooks'
+import ColHeader from '@/components/col-header'
 
 export default defineComponent({
   name: 'MusicPersonal',
@@ -25,6 +26,7 @@ export default defineComponent({
     return () => {
       return (
         <div class={styles.personal}>
+          <ColHeader />
           <Practice
             ref={practice}
             onFavorite={() => {

+ 2 - 0
src/views/music/search/header.tsx

@@ -16,6 +16,7 @@ import { getRandomKey } from '../music'
 import SelectSubject from './select-subject'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import { state } from '@/state'
+import ColHeader from '@/components/col-header'
 
 export const mitter = mitt()
 
@@ -125,6 +126,7 @@ export default defineComponent({
       return (
         <div class={styles.search}>
           <Sticky class={styles.sticky}>
+            <ColHeader />
             <Search
               modelValue={keyword.value}
               // showAction

+ 19 - 9
src/views/shop-mall/goods-list/index.tsx

@@ -7,6 +7,7 @@ import GoodsFilterList from '../modal/goods-filter-list'
 import ColSearch from '@/components/col-search'
 import request from '@/helpers/request'
 import { useEventTracking } from '@/helpers/hooks'
+import ColHeader from '@/components/col-header'
 export default defineComponent({
   name: 'goods-list',
   data() {
@@ -39,7 +40,7 @@ export default defineComponent({
     getProductAttributeCategory() {
       if (this.productCategory.id) {
         if (this.productCategory.children) {
-          let child = (this.productCategory.children[
+          const child = (this.productCategory.children[
             this.productCategory.active
           ] || {}) as any
           return child.id || ''
@@ -52,7 +53,7 @@ export default defineComponent({
   async mounted() {
     this.$nextTick(() => {
       if (this.$route.query.input === 'focus') {
-        let input: HTMLInputElement = document.querySelector(
+        const input: HTMLInputElement = document.querySelector(
           '.van-field__control'
         ) as HTMLInputElement
         input.focus()
@@ -108,7 +109,7 @@ export default defineComponent({
     },
 
     onToggleTag() {
-      let tabList = this.$refs.tabList as any
+      const tabList = this.$refs.tabList as any
       if (tabList.loading) return
       // this.productCategory.active = i
       this.$nextTick(() => {
@@ -118,7 +119,7 @@ export default defineComponent({
 
     onClearTag(key: string) {
       this[key] = { id: 0, name: '' }
-      let goodsFilter = this.$refs.goodsFilter as any
+      const goodsFilter = this.$refs.goodsFilter as any
       if (goodsFilter) {
         if (key === 'productCategory') {
           goodsFilter.setParams('productCategorySmallVoList')
@@ -133,7 +134,7 @@ export default defineComponent({
       })
     },
     onSearch() {
-      let tabList = this.$refs.tabList as any
+      const tabList = this.$refs.tabList as any
       tabList.onSearch()
     },
     searchBtn(keyword?: string) {
@@ -148,6 +149,7 @@ export default defineComponent({
     return (
       <div>
         <Sticky>
+          <ColHeader border={false} />
           <ColSearch modelValue={this.keyword} onSearch={this.searchBtn} />
           <Row class={styles['filter-top']} align="center">
             <Col
@@ -193,7 +195,7 @@ export default defineComponent({
               销量
             </Col> */}
             <Col
-              style={{marginLeft: 'auto'}}
+              style={{ marginLeft: 'auto' }}
               span={6}
               class={styles.filterBtn}
               onClick={() => (this.filterListShow = true)}
@@ -203,9 +205,17 @@ export default defineComponent({
             </Col>
           </Row>
 
-          {this.productCategory.id && this.productCategory.children && this.productCategory.children.length ? (
-            <Tabs class={styles['filter-productCategory']} shrink ellipsis={false} v-model:active={this.productCategory.active} onChange={() => this.onToggleTag()}>
-              {this.productCategory && 
+          {this.productCategory.id &&
+          this.productCategory.children &&
+          this.productCategory.children.length ? (
+            <Tabs
+              class={styles['filter-productCategory']}
+              shrink
+              ellipsis={false}
+              v-model:active={this.productCategory.active}
+              onChange={() => this.onToggleTag()}
+            >
+              {this.productCategory &&
                 this.productCategory.children.map((n: any, i: number) => (
                   <Tab
                     name={i}