detail.vue
14.6 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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<template>
<view>
<view class="top" v-if="info.image_list && info.image_list.length>0">
<u-swiper :list="info.image_list" @click="click" height="240"></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="" v-if="info.type == 3">
<image src="/static/chushou.png" style="width: 56rpx;height: 32rpx;margin-right: 8rpx;" mode="" v-else-if="info.type == 4">
<image src="/static/need2.png" style="width: 56rpx;height: 32rpx;margin-right: 8rpx;" mode="" v-else-if="info.type == 1">
<image src="/static/need.png" style="width: 56rpx;height: 32rpx;margin-right: 8rpx;" mode="" v-else>
</image>
<p style=" color: #000000e6;font-size: 34rpx;font-weight: 500;">
{{ info.brand.name + info.xinghao.name + info.category.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;" v-if="info.is_license == 1" 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">
**万/月
</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/ld.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" style="">
{{info.bright}}
</view>
</view>
</view>
<view class="box flexBox" style="height: 128rpx;display: flex;justify-content: space-between;">
<view class="flexBox">
<view class="" style="margin-right: 24rpx;">
<image src="../../static/gj.png" style="width: 80rpx;height: 80rpx;" mode=""></image>
</view>
<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>
<view class="phonebox" @click="call" >
<image src="../../static/dh.png" style="width: 24rpx; height: 24rpx; margin-right: 4rpx;" mode=""></image>
<text style="color:#3375D8">立即联系</text>
</view>
</view>
<view class="box">
<view class="flexBox" style="margin-bottom: 24rpx;">
<image src="/static/tp.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="" @click="preImg = true; imgDes = item"></image>
</view>
<view class="flexBox" style="justify-content: center; flex-direction: column;" v-if="info.image_list.length == 0">
<image src="../../static/Group@2x.png" mode="" style="width: 200rpx; height: 200rpx;"></image>
<view class="" style="color: #3a4b63ff;font-size: 20rpx;font-weight: 400;">
车主还没有上传图片~~
</view>
</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" v-if="item.type == 3 || item.type == 4"></item>
<item-sell v-else :info="item"></item-sell>
</view>
</view>
<view class="box" style="padding-bottom:120rpx;" 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>
<button class="sharestyle" open-type="share" @click="goshare">
</button>
</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;" @click="goTs">
<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;" @click="gophone">
<u-button text="马上咨询" color="linear-gradient(to right, #FFC773,#ED681D)"
></u-button>
</view>
</view>
<!-- <u-popup closeable="true" :show="preImg" round="true" :closeable="true" @close="onClose">
<view class="warp" style="margin-bottom: 64rpx;">
<image :src="imgDes" mode="" style="height: 80vh;">
</image>
</view>
</u-popup> -->
<u-overlay :show="preImg" @click="onClose">
<view class="warp" >
<image :src="imgDes" mode="" style="max-height: 80vh;">
</image>
</view>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="onClose">
<image src="../../static/close@2x.png" style="width: 40rpx;height: 40rpx;margin-top: 20rpx;" mode=""></image>
</view>
</u-overlay>
<u-overlay :show="show" @click="onClose1">
<view class="warp">
<view class="">
<image src="http://equiphappy.shs.broing.cn/assets/miniprogram/Group1822@2x.png" mode="" style="height: 950rpx;">
</image>
</view>
<image :src="wechat.qrcode_url" @longpress="saveImgInner(wechat.qrcode_url)" style="position: absolute;top:330rpx;left: 148rpx; width: 350rpx;height: 350rpx;" mode=""></image>
</view>
<view class="bbox" style=" margin: 10px 0 0 46%; text-align: center; padding-top: 2;" @click="onClose1">
<image src="../../static/close@2x.png" style="width: 40rpx;height: 40rpx;margin-top: 20rpx;" mode=""></image>
</view>
</u-overlay>
</view>
</template>
<script>
import item from '@/component/listItem/listItem.vue'
import ItemSell from '@/component/sellItem/sellItem.vue'
export default {
components: {
item,
ItemSell
},
data() {
return {
info: {},
show: false,
preImg:false,
imgDes:'',
list1: [],
images: [],
wechat:{},
isFill: false,
resList: [],
call2: '',
call1: '',
phone: "",
}
},
methods: {
//咨询
gophone() {
if(this.call1){
uni.makePhoneCall({
phoneNumber: this.call1 //仅为示例
});
}else{
uni.showToast({
title:'暂无联系电话',
icon: 'none'
})
}
},
onClose() {
this.preImg = false
},
onClose1() {
this.show = false
},
//立即联系
call(val) {
uni.makePhoneCall({
phoneNumber: this.call2 //仅为示例
});
},
goQun() {
this.show = true
},
// 长按保存功能--保存部分
saveImgInner (url) {
wx.getImageInfo({
src: url,
success: (res) => {
let path = res.path;
wx.saveImageToPhotosAlbum({
filePath: path,
success: (res) => {
console.log(res);
wx.showToast({
title: '已保存到相册',
})
},
fail: (res) => {
console.log(res);
}
})
},
fail: (res) => {
console.log(res);
}
})
},
goStar() {
uni.$u.http.post('/api/common/favorite', {
equip_id: this.info.id
}).then(res => {
uni.showToast({
title: res.msg
})
this.getList()
})
},
click(e){
this.preImg = true
this.imgDes = this.info.image_list[e]
},
appShare(scene) {
let that = this
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
uni.share({
provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
type: 0, //分享形式
href: `${HTTP_IP_URL}${curRoute}&spread=${that.uid}`, //跳转链接
title: that.storeInfo.storeName, //分享内容的标题
summary: that.storeInfo.storeInfo, //分享内容的摘要
imageUrl: that.storeInfo.image, //图片地址
success: function(res) {
that.posters = false; //成功后关闭底部弹框
},
fail: function(err) {
uni.showToast({
title: '分享失败',
icon: 'none',
duration: 2000
})
that.posters = false;
}
});
},
goTs(){
uni.navigateTo({
url:'/pages/subPages/ad'
})
},
getList() {
uni.$u.http.post('/api/equip/get_detail', {
id: this.info.id,
lat: '',
lng: ''
}).then(res => {
console.log(res);
if(res.code == 0){
uni.showToast({
title:res.msg,
icon: 'none'
})
}
this.info = res.data.data
console.log(this.info);
this.wechat = res.data.wechat
this.phone = res.data.contract
this.resList = res.data.rec_list.data
this.call2 = 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()
console.log(this.info);
}
}
</script>
<style scoped lang="scss">
.top {
height: 480rpx;
}
.addGroup1 {
background: url('http://equiphappy.shs.broing.cn/assets/miniprogram');
width: 622rpx;
height: 950rpx;
position: relative;
}
.flexBox {
position: relative;
display: flex;
align-items: center;
}
.sharestyle {
position: absolute;
left: -10;
top: -10;
width: 100rpx;
height: 100rpx;
background-color: transparent !important;
&:after {
border: none;
}
}
.box {
margin-bottom: 24rpx;
border-radius: 12rpx;
padding: 24rpx;
opacity: 1;
background: #ffffffff;
.imgbox {
image {
width: 100%;
}
}
}
.phonebox{
width: 144rpx;
height: 56rpx;
border-radius: 8rpx;
opacity: 1;
background: #ecf2feff;
font-size: 24rpx;
line-height: 56rpx;
padding: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.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;
}
}
.bbox{
width: 80rpx;
height: 80rpx;
border-radius: 8rpx;
opacity: 1;
background: #ffffff47;
}
.title {
color: #00000066;
font-size: 26rpx;
font-weight: 400;
margin-right: 24rpx;
margin-bottom: 24rpx;
}
.fBox {
width: 654rpx;
min-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;
position: relative;
justify-content: center;
margin-top: 8%;
margin-left: 64rpx;
margin-right: 64rpx;
}
</style>