strategySub.vue 1.43 KB
<template>
  <LayoutApp :title="currentTitle" :show-back="true" :back-action="goBack">
    <ul>
      <li v-for="(item, index) in currentList" :key="index">
        <img :src="item.image" alt=""/>
      </li>
    </ul>

  </LayoutApp>
</template>

<script>
import data from './image.json';

export default {
  name: 'Strategy',
  data() {
    return {
      currentList: [],
      currentTitle: ''
    }
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    }
  },
  mounted() {
    let subName = this.$route.params.subName;
    let result = data.result;

    switch (subName) {
        case 'qualityStandard':
          this.currentTitle = '商品质检标准';
          this.currentList = result.standardList;
          break;
        case 'buyerPolicy':
          this.currentTitle = '买家须知';
          this.currentList = result.buyerList;
          break;
        case 'sellerPolicy':
          this.currentTitle = '卖家协议';
          this.currentList = result.sellerList;
          break;
        case 'qiugouExplain':
          this.currentTitle = '什么是求购?';
          this.currentList = result.qiugouList;
          break;
        default:
          break;
      }
  }
};
</script>

<style lang="scss" scoped>
ul {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;

  li {
    position: relative;
    width: 100%;
    overflow: hidden;

    img {
      width: 100%;
      float: left;
    }
  }
}
</style>