DESKTOP-SVI9JE1\muzen 1 rok pred
rodič
commit
a9336820b0
2 zmenil súbory, kde vykonal 52 pridanie a 7 odobranie
  1. 10 0
      src/api/ximalaya.js
  2. 42 7
      src/pages/ximalaya/index.vue

+ 10 - 0
src/api/ximalaya.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request"
+
+// 回调接口
+export function getCallBack(data) {
+  return request({
+    url: `/callback/ximalaya/reportAuthInfo`,
+    method: 'get',
+    data
+  })
+}

+ 42 - 7
src/pages/ximalaya/index.vue

@@ -1,19 +1,54 @@
 <template>
-  <div class='app-container'></div>
+  <div class='app-container'>
+    <uni-icons :class="[title === '加载中...' ? 'spin' : '']" :type="type" color="#FFF" size="68" />
+    <span>{{ title }}</span>
+  </div>
 </template>
 
 <script>
+import { getCallBack } from "@/api/ximalaya.js"
 export default {
   data() {
-    return  {
-
+    return {
+      type: 'spinner-cycle',
+      title: '加载中...'
     }
   },
-  mounted() {
+  onLoad(e) {
+    const deviceid = window.location.hash.split('=')[1]
+    getCallBack({ ...e, deviceid: deviceid }).then(res => {
+      if (res.data.code === 0) {
+        this.type = 'checkbox-filled'
+        this.title = '授权成功!'
+      } else {
+        this.type = 'clear'
+        this.title = '授权失败!'
+      }
+    })
+  }
+}
+</script>
 
-  },
-  methods: {
+<style lang="scss" scoped>
+.app-container {
+  height: 100%;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+
+.spin {
+  animation: spin 5s linear infinite;
+}
 
+@keyframes spin {
+  0% {
+    transform: rotate(0deg)
+  }
+  100% {
+    transform: rotate(360deg);
   }
 }
-</script>
+</style>