tanghaolin
2022-07-28 62aa8e0f0b366bc131309b72e1350d800d30be72
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
  <div class="HY-box" v-myTitle="{ title: m_Title }">
    <!-- 头部导航栏 -->
    <van-nav-bar style="background-color: #528abe">
      <template #left>
        <div @click="pageBack" style="display: flex; align-items: center">
        <van-icon name="arrow-left" size="18" />
        <span>{{$t('selectPage.index.TR')}}</span>
        </div>
      </template>
      <template #title>
        <label>{{$t('indexPage.byIndustry.TR')}}</label>
      </template>
      <template #right>
        <!-- <van-icon name="search" size="18" /> -->
      </template>
    </van-nav-bar>
    <!-- 公司标题 -->
    <div style="width: 100%">
      <!-- <img
        src="/static/img/Title.png"
        style="max-width: 100%; max-height: 100%; width: auto; height: 65px"
      /> -->
    </div>
    <!-- 显示内容 -->
    <div class="HY-main" style="height: calc(100% - 50px);">
      <div style="width: 100%; position: relative">
        <van-cell
          is-link
          v-for="hyItem in m_HangYeList"
          :key="hyItem.Name"
          :style="'background-color:' + hyItem.bkColor"
          @click="goPumpDetail(hyItem)"
        >
          <!-- 使用 right-icon 插槽来自定义右侧图标 -->
          <template #icon>
            <img :src="hyItem.ImageSrc" style="width: 32px; height: 32px" />
          </template>
          <!-- 使用 title 插槽来自定义标题 -->
          <template #title>
            <span class="custom-title">{{ hyItem.Name }}</span>
          </template>
        </van-cell>
      </div>
      <!-- </van-collapse-item>
      </van-collapse>-->
    </div>
  </div>
</template>
 
<script>
import languageMixin from "@/mixin/language";
export default {
  mixins: [languageMixin],
  data() {
    return {
      m_HangYeList: [], //类型列表
      m_Title:"",
    };
  },
  mounted() {
    this.m_Title =  this.getSoftName();
    this.buildHangYeList(this.$i18n.locale);
  },
  methods: {
    //跳转到详情
    goPumpDetail(hyItem) { 
      this.$router.push({
        path: `/${this.$getCurrentLanguageUrl()}/SeriesHY`,
        query: { HID: hyItem.HID},
      });
    },
    buildHangYeList(langType) {
      let hangYeList = window.seriesApplication.HangYe.List;
      let list = [];
      if (langType == "cn") {
        hangYeList.forEach((element, index) => {
          // console.log(element.ID,77)
          let itemObj = {
            HID:element.ID,
            PumpSeriesID: element.PumpSeriesID,
            Name: element.NameCN,
            ImageSrc:require(
              "../../assets/img/HangYe/" + element.ImageName + "/ffffffx128.png"),
          };
          if (index % 2 == 0) {
            itemObj.bkColor = "#aaaaaa";
          } else {
            itemObj.bkColor = "#ffffff";
          }
          list.push(itemObj);
        });
      }
      if (langType == "en") {
        hangYeList.forEach((element, index) => {
          let itemObj = {
            HID:element.ID,
            PumpSeriesID: element.PumpSeriesID,
            Name: element.NameEN,
            ImageSrc:require("../../assets/img/HangYe/" + element.ImageName + "/ffffffx128.png"),
          };
          if (index % 2 == 0) {
            itemObj.bkColor = "#aaaaaa";
          } else {
            itemObj.bkColor = "#ffffff";
          }
          list.push(itemObj);
        });
      }
      this.m_HangYeList = list;
    },
    //返回上一页
    pageBack() {
      this.$router.push({
        path: `/${this.$getCurrentLanguageUrl()}/Index`,
      });
    },
  },
};
</script>
 
<style lang="scss">
@import url("../../assets/css/page.css");
.HY-box {
  background: #fafafa;
  width: 100%;
  height: 100vh;
  .van-cell__title {
    text-align: start;
    display: flex;
    align-items: center;
    padding: 10px !important;
    color: #000000 !important;
  }
  .HY-main {
    width: 100%;
    height: calc(100% - 115px);
    overflow: auto;
    .van-cell {
      color: #000000 !important;
      padding: 5px 15px !important;
      align-items: center;
    }
    .van-cell__right-icon {
      color: #bbb;
    }
    .van-cell::after {
      border-bottom: unset;
    }
  }
}
</style>