瀏覽代碼

Merge branch 'develop/3.1.0' into test

DESKTOP-SVI9JE1\muzen 2 年之前
父節點
當前提交
e054e579d1

+ 3 - 34
src/components/open-app/open-app.vue

@@ -5,7 +5,7 @@
         <img src="@/static/logo.png" />
         <text style="font-weight: 600;">OhPlay猫王妙播</text>
       </view>
-      <uni-button type="submit" @click="open">打开App</uni-button>
+      <uni-button type="submit" @click="getOpen()">打开App</uni-button>
     </view>
     <view style="height: 88rpx" v-if="isShow" />
   </view>
@@ -14,47 +14,16 @@
 <script>
 export default {
   props: {
-    // 界面类型
-    page: {
-      type: Number,
-      default: null
-    },
-    // 频道类型
-    channel: {
-      type: Number,
-      default: null
-    },
-    // 音频类型
-    audioType: {
-      type: Number,
-      default: null
-    },
-    // 音频Id
-    audioId: {
-      type: Number,
-      default: null
-    },
     // 是否覆盖
     isShow: {
       type: Boolean,
       default: true
     }
   },
-  watch: {
-    channel(val) {
-      return val
-    },
-    audioType(val) {
-      return val
-    },
-    audioId(val) {
-      return val
-    }
-  },
   methods: {
     // 打开app
-    open() {
-      this.openApp(this.page, this.channel, this.audioType, this.audioId)
+    getOpen() {
+      this.$emit('open')
     }
   }
 }

+ 2 - 38
src/main.js

@@ -1,50 +1,14 @@
 import Vue from 'vue'
 import App from './App'
 import axios from 'axios'
+import openApp from './utils/openApp'
 
 Vue.config.productionTip = false
 
 Vue.prototype.$axios = axios
 
 // 打开App
-Vue.prototype.openApp = function (page, channel, audioType, audioId) {
-  // 
-  const res = uni.getSystemInfoSync()
-  var ua = window.navigator.userAgent.toLowerCase();
-  if (ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/WeiBo/i) == "weibo" || ua.match(/QQ/i) == "qq") {
-    uni.showToast({
-      icon: 'none',
-      title: '右上角在浏览器打开',
-      mask: true
-    })
-  } else {
-    if (res.platform === 'ios') {
-      window.location.href = `airsmart://?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}`
-    } else {
-      window.location.href = `airsmart://com.muzen.radioplayer:8888/main?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}`
-    }
-
-    var timer = setTimeout(() => {
-      if (res.platform === 'ios') {
-        window.location.href = 'itms-appss://itunes.apple.com/cn/app/apple-store/id1621419943?mt=8'
-      } else {
-        window.location.href = 'https://music-play.oss-cn-shenzhen.aliyuncs.com/backOss/file/bacde3d529014ad08fcddb6baaffbc28.apk'
-      }
-    }, 3000);
-  }
-
-  document.addEventListener('visibilitychange', function () {
-    if (document.hidden) {
-      clearTimeout(timer)
-    }
-  })
-
-  window.onpagehide = event => {
-    if (event.persisted) {
-      clearTimeout(timer)
-    }
-  }
-}
+Vue.prototype.openApp = openApp
 
 App.mpType = 'app'
 

+ 9 - 4
src/pages/help/index.vue

@@ -123,9 +123,10 @@ export default {
 }
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .app-container {
   background-color: #FFFFFF;
+  height: 100%;
   color: #353535;
 }
 
@@ -161,7 +162,7 @@ export default {
   margin-top: 48rpx;
   display: flex;
   flex-wrap: wrap;
-  align-content: start;
+  align-content: flex-start;
   height: calc(160rpx * 3 + 24rpx * 3);
 
   .img-list {
@@ -199,7 +200,11 @@ export default {
 }
 
 .submit {
-  margin-top: 48rpx;
+  position: absolute;
+  bottom: 32rpx;
+  left: 50%;
+  transform: translate(-50%);
+  width: 100%;
 
   button {
     width: 400rpx;
@@ -213,7 +218,7 @@ export default {
     color: #999;
     display: flex;
     justify-content: space-around;
-    margin-top: 190rpx;
+    margin-top: 208rpx;
   }
 }
 </style>

+ 2 - 2
src/pages/share/channels.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="app-container">
-    <open-app :page="0" />
+    <open-app @open="open" />
     <!-- 12频道分享 -->
     <view class="twelve_channels">
       <view class="item" v-for="item in list" :key="item.channelId" @click="getDetail(item)">
@@ -44,7 +44,7 @@ export default {
   methods: {
     getDetail(item) {
       uni.navigateTo({
-        url: `/pages/share/list?channelId=${item.id}&userId=${this.userId}`,
+        url: `?page=/pages/share/list&channelId=${item.id}&userId=${this.userId}`,
       })
     },
   }

+ 3 - 2
src/pages/share/controls.vue

@@ -3,7 +3,7 @@
     <!-- 背景 -->
     <view class="bg" :style="{'background': `url(${form.icon})no-repeat 100% / cover`}" />
     <!-- 跳转App -->
-    <open-app :page="3" :audioId="form.audioId" />
+    <open-app @open="open" />
     <!-- 播控分享 -->
     <view class="play_control">
       <img v-if="channelType !== '1'" class="cover" :src="form.icon" />
@@ -92,7 +92,8 @@ export default {
   methods: {
     // 打开app
     open() {
-      this.openApp(3, this.form.audioId)
+      // this.openApp(3, this.form.audioId)
+      this.openApp(`?page=/mobile/audioPage&audioId=${this.form.audioId}`)
     }
   }
 }

+ 11 - 8
src/pages/share/detail.vue

@@ -3,7 +3,7 @@
     <!-- 背景 -->
     <view class="bg" />
     <!-- 跳转App -->
-    <open-app :page="2" :audioType="data.audioType" />
+    <open-app @open="open" />
     <!-- 详情 -->
     <view class="detail">
       <img class="logo" :src="data.thumb" />
@@ -27,7 +27,7 @@
     <uni-segmented-control :current="current" @clickItem="onClickItem" styleType="text" :values="items"
       activeColor="#fff" />
     <view v-show="current === 0" class="list_content">
-      <uni-row class="item" v-for="(item, index) in list" :key="item.id" @click.native="getNav(item)">
+      <uni-row class="item" v-for="(item, index) in list" :key="item.id" @click.native="open">
         <uni-col :span="2" style="color:#FFFFFF66; fontSize: 28rpx; fontWeight:bold">
           {{ index + 1}}
         </uni-col>
@@ -101,14 +101,17 @@ export default {
       })
     },
     // 下一页
-    getNav(item) {
-      uni.navigateTo({
-        url: `/pages/share/controls?audioId=${item.audioId}`
-      })
-    },
+    // getNav(item) {
+    //   uni.navigateTo({
+    //     url: `/pages/share/controls?audioId=${item.audioId}`
+    //   })
+    // },
     // 打开app
     open() {
-      this.openApp(2, this.data.audioType)
+      // this.openApp(2, this.data.audioType)
+      if(this.data.audioType === 8){
+        this.openApp(`?page=/mobile/playAlbumPage&audioType=${this.data.audioType}&audioId=${this.form.audioId}`)
+      }
     },
     onClickItem(e) {
       if (this.current != e.currentIndex) {

+ 13 - 13
src/pages/share/list.vue

@@ -1,9 +1,9 @@
 <template>
   <view class="app-container">
     <!-- 背景 -->
-    <view class="bg" :style="{'background': `url(${data.channelPic})no-repeat 100% / cover`}" />
+    <view class="bg" :style="{ 'background': `url(${data.channelPic})no-repeat 100% / cover` }" />
     <!-- 跳转App -->
-    <open-app :page="1" :channel="data.channelId" />
+    <open-app @open="open" />
     <!-- 详情 -->
     <view class="detail">
       <img :src="data.channelPic" />
@@ -22,7 +22,7 @@
     </view>
     <!-- 列表 -->
     <view class="list" v-if="list.length > 0">
-      <view class="item" v-for="item in list" :key="item.audioId" @click="getNav(item)">
+      <view class="item" v-for="item in list" :key="item.audioId" @click="open">
         <img class="logo" :src="item.audioPic" />
         <view class="title">
           <text>{{ item.audioName }}</text>
@@ -54,8 +54,8 @@ export default {
   },
   onLoad(e) {
     if (e.userId) {
-      this.form.userId = e.userId,
-        this.form.channelId = e.channelId
+      this.form.userId = e.userId
+      this.form.channelId = e.channelId
       // 频道详情
       channelDetail({
         channelId: e.channelId,
@@ -85,15 +85,15 @@ export default {
       })
     },
     // 下一页
-    getNav(item) {
-      let url = this.data.channelType === 1 || this.data.channelType === 3 ? `/pages/share/controls?channelType=${this.data.channelType}&audioId=${item.audioId}` : `/pages/share/detail?audioId=${item.audioId}`
-      uni.navigateTo({
-        url: url
-      })
-    },
+    // getNav(item) {
+    //   let url = this.data.channelType === 1 || this.data.channelType === 3 ? `/pages/share/controls?channelType=${this.data.channelType}&audioId=${item.audioId}` : `/pages/share/detail?audioId=${item.audioId}`
+    //   uni.navigateTo({
+    //     url: url
+    //   })
+    // },
     // 打开app
     open() {
-      this.openApp(1, this.data.channelId)
+      this.openApp(`?page=/mobile/channelSinglePage&channel=${this.data.channelId}&channelId=${this.data.id}`)
     }
   }
 }
@@ -237,7 +237,7 @@ export default {
   }
 }
 
-.no-data{
+.no-data {
   text-align: center;
   margin-top: 200rpx;
   color: rgba(255, 255, 255, 0.7);

+ 41 - 0
src/utils/openApp.js

@@ -0,0 +1,41 @@
+const openApp = function (url) {
+  const res = uni.getSystemInfoSync()
+  var ua = window.navigator.userAgent.toLowerCase();
+  if (ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/WeiBo/i) == "weibo" || ua.match(/QQ/i) == "qqbrowser ") {
+    uni.showToast({
+      icon: 'none',
+      title: '右上角在浏览器打开',
+      mask: true
+    })
+  } else {
+    if (res.platform === 'ios') {
+      // window.location.href = `airsmart://?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}`
+      window.location.href = `airsmart://${url}&cmd=openPage`
+    } else {
+      // window.location.href = `airsmart://com.muzen.radioplayer:8888/main?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}`
+      window.location.href = `airsmart://com.muzen.radioplayer:8888/main${url}&cmd=openPage`
+    }
+
+    var timer = setTimeout(() => {
+      if (res.platform === 'ios') {
+        window.location.href = 'itms-appss://itunes.apple.com/cn/app/apple-store/id1621419943?mt=8'
+      } else {
+        window.location.href = 'http://download.radio1964.com/readme?'
+      }
+    }, 3000)
+  }
+
+  document.addEventListener('visibilitychange', function () {
+    if (document.hidden) {
+      clearTimeout(timer)
+    }
+  })
+
+  window.onpagehide = event => {
+    if (event.persisted) {
+      clearTimeout(timer)
+    }
+  }
+}
+
+export default openApp;