zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
export const communal = {
  data() {
    return {
      clientWidth: 0,
      showImageIcon: 0, // 图标显示
      exhibitionAllImages: 0, // 展示所有图片
      showImageNumber: 0, // 展示图片数量
      showImageIconFull: 0,
      exhibitionAllImagesFull: 0,
      showImageNumberFull: 0,
    }
  },
  computed: {
    url() {
      const { path } = this.$route
      if (path.includes('building')) {
        // 楼栋
        if (location.hostname === 'scp.jycash.cn') {
          return process.env.VUE_APP_PRODUCT_XXXFINTECH_API_HOST + 'server/addBuildImage'
        }else if (location.host === '10.10.16.114') {
          return process.env.VUE_APP_HTTPS_API_HOST + 'server/addBuildImage'
        } else {
          return process.env.VUE_APP_API_HOST + 'server/addBuildImage'
        }
      } else {
        // 项目/企业/合作方
        if (location.hostname === 'scp.jycash.cn') {
          return process.env.VUE_APP_PRODUCT_XXXFINTECH_API_HOST + 'server/addProjectImage'
        } else if (location.host === '10.10.16.114') {
          return process.env.VUE_APP_HTTPS_API_HOST + 'server/addProjectImage'
        } else {
          return process.env.VUE_APP_API_HOST + 'server/addProjectImage'
        }
      }
      // if (location.hostname === 'scp.jycash.cn') {
      //   if (path.includes('building')) {
      //     return process.env.VUE_APP_PRODUCT_XXXFINTECH_API_HOST + 'server/addBuildImage'
      //   } else {
      //     return process.env.VUE_APP_API_HOST + 'server/addProjectImage'
      //   }
      // } else {
      //   if (path.includes('building')) {
      //     return process.env.VUE_APP_PRODUCT_XXXFINTECH_API_HOST + 'server/addProjectImage'
      //   } else {
      //     return process.env.VUE_APP_API_HOST + 'server/addProjectImage'
      //   }
      // }
    },
    // showImageNumber() {
    //   const { clientWidth, $route } = this
    //   const { path } = $route
    //   if (clientWidth > 1310) {
    //     this.exhibitionAllImages = 4
    //     if (path.includes('details')) {
    //       this.showImageIcon = 4
    //       return 3
    //     } else {
    //       this.showImageIcon = 3
    //       return 2
    //     }
    //     // this.showImageIcon = 3
    //     // this.exhibitionAllImages = 4
    //     // return 2
    //   } else {
    //     this.exhibitionAllImages = 3
    //     if (path.includes('details')) {
    //       this.showImageIcon = 3
    //       return 2
    //     } else {
    //       this.showImageIcon = 2
    //       return 1
    //     }
    //     // this.showImageIcon = 2
    //     // this.exhibitionAllImages = 3
    //     // return 1
    //   }
    // },
    // showImageIcon() {
    //   const { clientWidth } = this
    //   if (clientWidth > 1325) {
    //     return 3
    //   } else {
    //     return 2
    //   }
    // },
    // exhibitionAllImages() {
    //   const { clientWidth } = this
    //   if (clientWidth > 1320) {  // 1310
    //     return 4
    //   } else {
    //     return 2
    //   }
    // }
  },
  mounted() {
    window.addEventListener('resize', this.updateClientWidth)
    this.updateClientWidth()
  },
  methods: {
    // 金额格式化
    formatMoney(value) {
      if (value) {
        value =
          parseFloat((value + '').replace(/[^\d\.-]/g, '')).toFixed(2) + ''
        if (value == 'NaN') return
        let l = value
          .split('.')[0]
          .split('')
          .reverse()
        let r = value.split('.')[1]
        let t = ''
        for (let i = 0; i < l.length; i++) {
          t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? ',' : '')
        }
        return (
          t
            .split('')
            .reverse()
            .join('') +
          '.' +
          r
        )
      }
    },
    // 浏览器大小
    updateClientWidth() {
      const clientWidth = document.documentElement.clientWidth || 0
      this.clientWidth = clientWidth
      // console.log(this.clientWidth)
      this.controllerImage()
    },
    controllerImage() {
      const { clientWidth, $route } = this
      const { path } = $route
      if (clientWidth > 1310) {
        this.exhibitionAllImages = 4
        this.exhibitionAllImagesFull = 11
        if (path.includes('details')) {
          this.showImageIcon = 4
          this.showImageNumber = 3
          this.showImageIconFull = 11
          this.showImageNumberFull = 10
        } else {
          this.showImageIcon = 3
          this.showImageNumber = 2
          this.showImageIconFull = 10
          this.showImageNumberFull = 9
        }
        // this.showImageIcon = 3
        // this.exhibitionAllImages = 4
        // return 2
      } else {
        this.exhibitionAllImages = 3
        this.exhibitionAllImagesFull = 7
        if (path.includes('details')) {
          this.showImageIcon = 3
          this.showImageNumber = 2
          this.showImageIconFull = 7
          this.showImageNumberFull = 6
        } else {
          this.showImageIcon = 2
          this.showImageNumber = 1
          this.showImageIconFull = 6
          this.showImageNumberFull = 5
        }
        // this.showImageIcon = 2
        // this.exhibitionAllImages = 3
        // return 1
      }
    }
  }
}
 
export const money = {
  methods:{
    // 金额格式化
    formatMoney(value) {
      if (value) {
        value =
          parseFloat((value + '').replace(/[^\d\.-]/g, '')).toFixed(2) + ''
        if (value == 'NaN') return
        let l = value
          .split('.')[0]
          .split('')
          .reverse()
        let r = value.split('.')[1]
        let t = ''
        for (let i = 0; i < l.length; i++) {
          t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? ',' : '')
        }
        return (
          t
            .split('')
            .reverse()
            .join('') +
          '.' +
          r
        )
      }
    },
  }
}