DESKTOP-O04BTUJ\muzen 3 vuotta sitten
vanhempi
commit
bcda286b64
1 muutettua tiedostoa jossa 14 lisäystä ja 26 poistoa
  1. 14 26
      src/pages/connect/connect.vue

+ 14 - 26
src/pages/connect/connect.vue

@@ -1,13 +1,17 @@
 <template>
-  <view class="content">
-    <view class="ql-snow">
+  <view class="app-container" :style="{'height' : !content ? '100%' : ''}">
+    <view v-if="content" class="ql-snow">
       <rich-text class="ql-editor" :nodes="content" />
     </view>
-    <button class="bg-color-grad font-size-nm" @click="close">知道了</button>
+    <noData v-else>
+      暂无引导内容
+    </noData>
+    <button type="submit" circle @click="close">知道了</button>
   </view>
 </template>
 
 <script>
+import { getGuidePageContent } from '@/api/connect'
 export default {
   data() {
     return {
@@ -15,20 +19,13 @@ export default {
     }
   },
   onLoad(e) {
-    if (e.deviceModel) {
-      uni.request({
-        url: `https://o3tapi.radio1964.com/admin/web/device/getGuidePageContent`,
-        method: 'get',
-        data: {
-          clientType: e.deviceModel
-        },
-        success: (res) => {
-          if (res.data.code === 0) {
-            this.content = res.data.data.guidePageContent
-          }
-        }
-      })
-    }
+    getGuidePageContent({
+      clientType: e.deviceModel
+    }).then(res => {
+      if (res.data.code === 0) {
+        this.content = res.data.data.guidePageContent
+      }
+    })
   },
   methods: {
     close() {
@@ -37,12 +34,3 @@ export default {
   }
 }
 </script>
-
-<style lang="scss" scope>
-.bg-color-grad {
-  height: 92rpx;
-  line-height: 92rpx;
-  color: #fff;
-  border-radius: 50rpx;
-}
-</style>