repairCard.vue
4.49 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
<template>
<view class="orderCardCss usuallyCard">
<view class="flex justify-between">
<view class="">
{{orderObj.fBxlx}}_{{orderObj.fBxlxmx}}
</view>
<view class="themeColor">
{{orderObj.fZt || ""}}
<!-- <span v-if="orderObj.fZt =='待处理'">待维修</span>
<span v-else>已维修</span> -->
</view>
</view>
<view class="flex justify-between w100 margin-top align-center">
<view class="text-grey">
报修单号:{{orderObj.fGdh}}
</view>
</view>
<view class="flex justify-between w100 margin-top align-center">
<view class="text-grey">
联系人:{{orderObj.fLxr || ""}}({{orderObj.fLxrdh || ''}})
</view>
<view class="" @click="handlePhone">
<u-image src="/static/images/home/dianhua.png" width="18px" height="18px"></u-image>
</view>
</view>
<view class="flex justify-between w100 margin-top align-center">
<view class="text-grey w80 flex align-start">
<u-icon name="map-fill" color="#8799AC" class="" style="margin:3px 5px 0 0;"></u-icon>
<view class="">
{{orderObj.fLxdzsf || ""}} {{orderObj.fLxdzs || ""}} {{orderObj.fLxdzq || ""}}
{{orderObj.fLxdzjd || ''}} {{orderObj.fLxdzxxdz || ""}}
</view>
</view>
<view class="" @click.stop="handleMap">
<u-image src="/static/images/home/daohang.png" width="18px" height="18px"></u-image>
</view>
</view>
<view class="flex justify-end align-center margin-top-lg">
<view class="" v-if="orderStatus === 0" @click="goToDetailPage('dcl')">
<u-button shape="circle" :customStyle="{color:'#666666'}">查看详情</u-button>
</view>
<view class="margin-left" v-if="orderObj.fZt === '待处理' && orderStatus === 0" @click="goToTjgdPage">
<u-button shape="circle" color="#EA5504">提交工单</u-button>
</view>
<view class="margin-left" v-if="orderStatus === 1" @click="goToDetailPage('ycl')">
<u-button shape="circle" color="#EA5504">查看详情</u-button>
</view>
</view>
</view>
</template>
<script>
export default {
components: {
},
props: {
orderStatus: {
type: Number,
default: 0
},
orderObj: {
type: Object,
default: () => {}
}
},
data() {
return {
};
},
async mounted() {
this.loadImages();
},
watch: {
orderObj: {
handler() {
this.$nextTick(() => {
this.loadImages();
});
},
deep: true, // 深度监听orderList的变化
},
},
methods: {
async loadImages() {
let that = this;
if (this.orderObj.ddxqList && this.orderObj.ddxqList.length > 0) {
for (let i = 0; i < this.orderObj.ddxqList.length; i++) {
let JsonParse = JSON.parse(this.orderObj.ddxqList[i].fTp);
let photoUrl = await this.$getPhotoUrl(JsonParse[0].response.fileId);
this.$set(this.orderObj.ddxqList[i], 'image', photoUrl);
}
}
},
goToDetailPage(type) {
console.log(this.orderObj);
let Json = JSON.stringify(this.orderObj)
uni.navigateTo({
url: `/pages/home/appList/onSiteRepair/repairDetail?mode=wx&type=${type}&id=${this.orderObj.id}`
})
},
handleMap() {
let jd = this.orderObj.fJd || "";
let wd = this.orderObj.fWd || "";
let ads = this.orderObj.ddqc || "";
if(!jd || !wd){
uni.$u.toast('无定位信息')
return
}
this.$viewMapLocation(jd, wd, ads);
console.log('打印this.orderObj', this.orderObj);
},
handlePhone() {
console.log('打印this.orderObj', this.orderObj);
uni.makePhoneCall({
phoneNumber: this.orderObj.fLxrdh, // 电话号码
success: function() {
console.log('拨打电话成功!');
},
fail: function(err) {
console.log('拨打电话失败:' + JSON.stringify(err));
}
});
},
goToTjgdPage() {
console.log('订单详情', JSON.parse(JSON.stringify(this.orderObj)));
let orderParams = {
id: this.orderObj.id,
fBxlx: this.orderObj.fBxlx,
fGdh: this.orderObj.fGdh,
fXdxm: this.orderObj.fXdxm,
fLxfs: this.orderObj.fLxfs,
fLxdzsf: this.orderObj.fLxdzsf,
fLxdzs: this.orderObj.fLxdzs,
fLxdzq: this.orderObj.fLxdzq,
fLxdzjd: this.orderObj.fLxdzjd,
fLxdzxxdz: this.orderObj.fLxdzxxdz,
fJd: this.orderObj.fJd,
fWd: this.orderObj.fWd,
adsName:this.orderObj.ddqc
}
uni.navigateTo({
url: '/pages/home/appList/onSiteRepair/submitOrder?type=wx&orderParams=' + JSON.stringify(
orderParams)
})
}
}
}
</script>
<style lang="scss" scoped>
.orderCardCss {
padding: 12px 15px;
.shopItemCss {
height: 108px;
margin: 15px 0 0 0;
}
}
</style>