Browse Source

添加协议

lex 2 years ago
parent
commit
4e7641d360
2 changed files with 46 additions and 0 deletions
  1. 8 0
      src/router/routes-common.ts
  2. 38 0
      src/views/preview-protocol/index.tsx

+ 8 - 0
src/router/routes-common.ts

@@ -204,6 +204,14 @@ export const router = [
     meta: {
       title: '优惠券'
     }
+  },
+  {
+    path: '/previewProtocol',
+    name: 'previewProtocol',
+    component: () => import('@/views/preview-protocol/index'),
+    meta: {
+      title: '酷乐秀平台服务协议'
+    }
   }
 ]
 

+ 38 - 0
src/views/preview-protocol/index.tsx

@@ -0,0 +1,38 @@
+import request from '@/helpers/request'
+import { state } from '@/state'
+import { defineComponent } from 'vue'
+
+// 预览协议 - 原生实名认证使用
+export default defineComponent({
+  name: 'preview-protocol',
+  data() {
+    return {
+      protocolHTML: '' as any
+    }
+  },
+  async mounted() {
+    try {
+      // 判断是否有协议内容
+      if (!this.protocolHTML) {
+        const res = await request.get(
+          state.platformApi + '/sysUserContractRecord/queryContract',
+          {
+            params: {
+              contractType: 'BUY_ORDER'
+            }
+          }
+        )
+        this.protocolHTML = res.data
+      }
+    } catch {
+      //
+    }
+  },
+  render() {
+    return (
+      <div id="mProtocol">
+        <div v-html={this.protocolHTML}></div>
+      </div>
+    )
+  }
+})