Forráskód Böngészése

Merge branch 'master' into feature/v1.1.78

123456 1 éve
szülő
commit
1a560889f1

+ 10 - 0
src/api/modules/public.js

@@ -257,3 +257,13 @@ export function getCompanyAssociation (data) {
     data
   })
 }
+
+// 获取活动配置信息
+export function getActivityConfig (data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/publicapply/activity/day/info',
+    method: 'post',
+    data
+  })
+}

+ 10 - 0
src/router/modules/static.js

@@ -61,6 +61,16 @@ export default [
       title: '赠送须知'
     }
   },
+  // 通用赠送须知。
+  {
+    path: '/terms/activity',
+    name: 'activity_terms',
+    component: () => import('@/views/static/ActivityTerms.vue'),
+    meta: {
+      header: true,
+      title: '赠送须知'
+    }
+  },
   {
     path: '/subscribe_transfer',
     name: 'subscribe_transfer',

+ 81 - 0
src/views/static/ActivityTerms.vue

@@ -0,0 +1,81 @@
+<template>
+  <div class="activity-terms">
+    <ol class="activity-terms-content">
+      <li v-for="(item, index) in contentList" :key="index" v-html="item.text"></li>
+    </ol>
+  </div>
+</template>
+
+<script>
+import { mixinHeader } from '@/utils/mixins/header'
+import { getActivityConfig } from '@/api/modules'
+export default {
+  name: 'activity-terms',
+  mixins: [mixinHeader],
+  data () {
+    return {
+      pageLayoutConf: {},
+      query: {},
+      contentList: [
+        // {
+        //   text: '本活动最终解释权归剑鱼标讯所有。'
+        // }
+      ]
+    }
+  },
+  created () {
+    this.getQuery()
+    this.getConfig()
+    this.refreshTitle()
+  },
+  methods: {
+    getQuery () {
+      const query = this.$route.query
+      this.query = query
+    },
+    refreshTitle () {
+      if (!this.query.title) {
+        return
+      }
+      this.pageLayoutConf.title = decodeURIComponent(this.query.title)
+      this.mergePageConf()
+    },
+    async getConfig () {
+      // ?id=Rw==
+      const id = this.query.id
+      if (!id) {
+        return this.$toast('缺少活动id')
+      }
+      const { error_code: code, error_msg: msg, data } = await getActivityConfig({ id })
+      if (code === 0 && data) {
+        if (Array.isArray(data.rule)) {
+          this.contentList = data.rule
+        }
+      } else {
+        this.$toast(msg || '请求失败')
+      }
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+::v-deep {
+  a,
+  .terms-link {
+    color: blue;
+  }
+}
+ol {
+  padding-left: 20px;
+}
+ol, li {
+  list-style-type: decimal;
+}
+.activity-terms {
+  padding: 16px;
+  color: #5F5E64;
+  font-size: 12px;
+  line-height: 24px;
+}
+</style>