浏览代码

feat: 添加说明书内容界面

Damon 8 月之前
父节点
当前提交
1978924049
共有 4 个文件被更改,包括 71 次插入16 次删除
  1. 9 0
      src/api/explain.js
  2. 7 0
      src/pages.json
  3. 14 16
      src/pages/agreement/index.vue
  4. 41 0
      src/pages/explain/index.vue

+ 9 - 0
src/api/explain.js

@@ -0,0 +1,9 @@
+import request from "../utils/request";
+
+// 详情
+export function detail(id) {
+  return request({
+    url: `/device/getElectronicManual?id=` + id,
+    method: 'get',
+  })
+}

+ 7 - 0
src/pages.json

@@ -255,6 +255,13 @@
         "navigationBarTitleText": "猫王音响-绑定MAC地址",
         "navigationStyle": "custom"
       }
+    },
+    {
+      // 说明书内容
+      "path": "pages/explain/index",
+      "style": {
+        "navigationStyle": "custom"
+      }
     }
   ]
 }

+ 14 - 16
src/pages/agreement/index.vue

@@ -1,41 +1,39 @@
 <template>
-  <view class='app-container'>
+  <view class="app-container">
     <uv-parse :content="form.content" selectable @linktap="linktap" />
   </view>
 </template>
 
 <script>
-import { detail } from '@/api/agreement.js'
+import { detail } from "@/api/explain.js";
 export default {
   data() {
     return {
       // 表单
-      form: {}
-    }
+      form: {},
+    };
   },
   onLoad(e) {
-    this.getDetail(e.type)
+    this.getDetail(e.id);
   },
   methods: {
-    getDetail(type) {
-      detail({
-        type: type
-      }).then(res => {
+    getDetail(id) {
+      detail(id).then((res) => {
         if (res.code === 0) {
-          this.form = res.data
+          this.form = res.data;
         }
-      })
+      });
     },
     // 点击链接
     linktap(e) {
-      window.location.href = e.href
-    }
-  }
-}
+      window.location.href = e.href;
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-.app-container{
+.app-container {
   white-space: pre-wrap;
 }
 </style>

+ 41 - 0
src/pages/explain/index.vue

@@ -0,0 +1,41 @@
+<template>
+  <view class='app-container'>
+    <uv-parse :content="form.content" selectable @linktap="linktap" />
+  </view>
+</template>
+
+<script>
+import { detail } from '@/api/agreement.js'
+export default {
+  data() {
+    return {
+      // 表单
+      form: {}
+    }
+  },
+  onLoad(e) {
+    this.getDetail(e.type)
+  },
+  methods: {
+    getDetail(type) {
+      detail({
+        type: type
+      }).then(res => {
+        if (res.code === 0) {
+          this.form = res.data
+        }
+      })
+    },
+    // 点击链接
+    linktap(e) {
+      window.location.href = e.href
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container{
+  white-space: pre-wrap;
+}
+</style>