detail.vue
9.3 KB
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<template>
<view >
<view class="top">
<u-swiper :list="info.image_list" @change="change" @click="click"></u-swiper>
</view>
<view class="main" style="margin: 24rpx 24rpx 220rpx 24rpx;">
<view class="" style="margin-bottom: 24rpx;" @click="goQun">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/qun.png" style="height: 152rpx; width: 100%;" mode=""></image>
</view>
<view class="box">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="../../static/chuzu.png" style="width: 56rpx;height: 32rpx;margin-right: 8rpx;" mode="">
</image>
<p style=" color: #000000e6;font-size: 34rpx;font-weight: 500;">{{info.category.name + info.brand.name + info.xinghao.name}}</p>
</view>
<view class="flexBox" style="justify-content: space-between;">
<view class="flexBox">
<image src="/static/logo.png" style="width: 164rpx;height: 44rpx; margin-right: 16rpx;" mode="">
</image>
<view style="display: flex; align-items: center;" >
<view style="margin:0 5rpx " v-for="item in info.tag_list">
<u-tag :text="item.name" plain size="mini" type="info"></u-tag>
</view>
</view>
</view>
<view class="" style="color:#E63D27">
{{info.price}}/月
</view>
</view>
<view class="flexBox" style="justify-content: space-evenly;margin-top: 40rpx;">
<view class="itembox" >
<p class="itembox_title">{{info.brand.name|| '-'}}</p>
<p class="itembox_desc">设备品牌</p>
</view>
<view class="itembox" >
<p class="itembox_title">{{info.year || '-'}}</p>
<p class="itembox_desc">出厂时间</p>
</view>
<view class="itembox" >
<p class="itembox_title">{{info.xinghao.name || '-'}}</p>
<p class="itembox_desc">设备型号</p>
</view>
<view class="itembox" >
<p class="itembox_title">{{info.hours || '-'}}</p>
<p class="itembox_desc">表显小时数</p>
</view>
</view>
</view>
<view class="box" style="height: auto;">
<!-- <view class="flexBox" style="justify-content: space-between;">
<view class="flexBox">
<image src="../../static/col.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode=""></image>
<p style=" color: #000000e6;font-size: 32rpx;font-weight: 500;">设备规格</p>
</view>
<view class="" style=" color: #00000066;font-size: 26rpx;font-weight: 400;">
更多参数 >
</view>
</view> -->
<!-- <view class="flexBox" style="flex-direction: column;margin-top: 32rpx ;">
<view class="flexBox" style="justify-content: space-between; width: 100%;">
<view class="flexBox">
<p class="title">铲斗容量</p>
<p class="desc">123</p>
</view>
<view class="flexBox" >
<p class="title">铲斗容量</p>
<p class="desc">123</p>
</view>
</view>
<view class="flexBox" style="justify-content: space-between; width: 100%;">
<view class="flexBox">
<p class="title">铲斗容量</p>
<p class="desc">123</p>
</view>
<view class="flexBox">
<p class="title">铲斗容量</p>
<p class="desc">123</p>
</view>
</view>
</view> -->
<view class="">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="../../static/col.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode=""></image>
<p style=" color: #000000e6;font-size: 32rpx;font-weight: 500;">设备亮点</p>
</view>
<view class="fBox">
{{info.bright}}
</view>
</view>
</view>
<view class="box flexBox" style="height: 128rpx;display: flex;justify-content: space-between;">
<view class="" style="display: flex; flex-direction: column;">
<p style=" color: #000000e6;font-size: 28rpx;font-weight: 500;">设备乐管家</p>
<p style=" color: #00000066;font-size: 24rpx;font-weight: 400;">专注建筑工程设备经理</p>
</view>
<view class="">
<u-button text="立即联系" type="primary" @click="call(call)"></u-button>
</view>
</view>
<view class="box" style="height: 872rpx;">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="../../static/col.png" style="width: 40rpx; height: 40rpx;margin-right: 16rpx;" mode=""></image>
<p style=" color: #000000e6;font-size: 32rpx;font-weight: 500;">设备图片</p>
</view>
<view class="imgbox" v-for="item in info.image_list">
<image :src="item" mode=""></image>
</view>
</view>
<p style="color: #000000e6;font-size: 32rpx;font-weight: 500;margin-bottom: 24rpx;" >相似设备</p>
<view class="" v-if="resList && resList.length>0">
<view class="" v-for="item in resList ">
<item :info="item" :isBtn="false"></item>
</view>
</view>
<view class="box" v-else>
<u-empty
>
</u-empty>
</view>
</view>
<view class="fixB flexBox" style="justify-content: space-around;">
<view class="flexBox" >
<view class="flexBox" style="flex-direction: column; margin: 0 24rpx;">
<image src="../../static/share.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
<text style=" color: #000000e6;font-size: 22rpx;font-weight: 400;">分享</text>
</view>
<view class="flexBox" style="flex-direction: column; margin: 0 24rpx;" @click="goStar">
<image src="../../static/star.png" v-if="info.is_follow !== 1" style="width: 48rpx;height: 48rpx;" mode=""></image>
<image src="../../static/starsFill.png" v-else style="width: 48rpx;height: 48rpx;" mode=""></image>
<text style=" color: #000000e6;font-size: 22rpx;font-weight: 400;" v-if="info.is_follow !== 1" >收藏</text>
<text style=" color: #FFB629;font-size: 22rpx;font-weight: 400;" v-else >已收藏</text>
</view>
<view class="flexBox" style="flex-direction: column; margin: 0 24rpx;">
<image src="../../static/warn.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
<text style=" color: #000000e6;font-size: 22rpx;font-weight: 400;">投诉 </text>
</view>
</view>
<view style="width: 348rpx;" >
<u-button text="马上咨询" color="linear-gradient(to right, #FFC773,#ED681D)"
@click="call(call1)"></u-button>
</view>
</view>
<u-popup :show="isShowAddGroup" round="true" closeable="true" @close="onClose">
<view class="addGroup1">
<image src="../../static/code1.png"
style="width: 354rpx;height: 354rpx; position: absolute; top: 330rpx; left: 134rpx;" mode="">
</image>
</view>
</u-popup>
<u-overlay :show="show" @click="show = false">
<view class="warp">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style=""></image>
</view>
</u-overlay>
</view>
</template>
<script>
import item from '@/component/listItem/listItem.vue'
export default {
components: {
item
},
data() {
return {
info:{},
show: false,
isShowAddGroup: false,
list1: [
],
images:[],
isFill:false,
resList:[],
call:'',
call1:''
}
},
methods: {
onClose() {
},
call(val){
wx.makePhoneCall({
phoneNumber:val
})
},
goQun(){
this.show = true
},
goStar(){
uni.$u.http.post('/api/common/favorite',{equip_id: this.info.id}).then(res => {
uni.showToast({
title:res.msg
})
this.getList()
})
},
getList(){
uni.$u.http.post('/api/equip/get_detail',{id: this.info.id, lat:'',lng:''}).then(res => {
console.log(res);
this.info = res.data.data
this.resList = res.data.rec_list.data
this.call = res.data.contract
this.call1 = res.data.ask_phone
let imgs = JSON.parse(res.data.data.images_json)
this.isFill = res.data.data
imgs.forEach(item => {
this.images.push(Object.values(item))
})
console.log(this.images.flat(Infinity));
this.images = this.images.flat(Infinity).filter(item => item!=='')
}).catch(err => {
console.log(err);
uni.showToast({
title: err.msg
})
})
}
},
onLoad(option) {
this.info.id = option.id
this.getList()
}
}
</script>
<style scoped lang="scss">
.addGroup1 {
background: url('http://equiphappy.shs.broing.cn/assets/miniprogram');
width: 622rpx;
height: 950rpx;
position: relative;
}
.flexBox {
display: flex;
align-items: center;
}
.box {
height: 324rpx;
margin-bottom: 24rpx;
border-radius: 12rpx;
padding: 24rpx;
opacity: 1;
background: #ffffffff;
}
.itembox {
width: 152rpx;
height: 112rpx;
border-radius: 8rpx;
opacity: 1;
border: 1rpx solid #0000001a;
background: #f7f8faff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&_title{
color: #000000e6;
font-size: 24rpx;
font-weight: 500;
margin-bottom: 4rpx;
}
&_desc{
color: #00000066;
font-size: 22rpx;
font-weight: 400;
}
}
.title{
color: #00000066;
font-size: 26rpx;
font-weight: 400;
margin-right: 24rpx;
margin-bottom: 24rpx;
}
.fBox{
width: 654rpx;
height: 168rpx;
border-radius: 12rpx;
border: 1rpx solid #fff5e6ff;
background: linear-gradient(180deg, #fef5ecff 0%, #ffffffff 100%);
}
.fixB{
position: fixed;
bottom:0;
width: 100%;
height: 176rpx;
opacity: 1;
background: #ffffffff;
}
.desc{
color: #000000e6;
font-size: 26rpx;
font-weight: 400;
margin-bottom: 24rpx;
}
.warp{
display: flex;
justify-content: center;
margin-top: 15%;
}
</style>