Commit c528c4e9c0b6fbc6003765450d102f38664a194c
1 parent
8bb867e2
Exists in
develop
feat: 接口调试,页面调试
Showing
18 changed files
with
1348 additions
and
666 deletions
Show diff stats
api/scan.js
... | ... | @@ -9,3 +9,6 @@ export const getProductFind = sn => http.get('/business/product-manage/find?sn= |
9 | 9 | |
10 | 10 | //二维码识别 |
11 | 11 | export const getWxScan = data => http.post('/business/wx/scan', data) |
12 | + | |
13 | +// 创建故障报修 | |
14 | +export const createAFaultReport = data => http.post('/business/repair/create', data) | ... | ... |
common/config.js
1 | 1 | module.exports = { |
2 | - //后端接口地址 | |
3 | - // baseUrl: 'http://192.168.0.41:48080/admin-api', | |
4 | - //图片预览地址 | |
5 | - //测试环境 | |
6 | - fileUrl:"https://hdk-aero.ip-server.cn/hdk", | |
7 | - baseUrl: 'https://hdk-aero.ip-server.cn/admin-api', | |
8 | - //正式环境 | |
9 | - // fileUrl:"https://qr.hdk-aero.com/hdk", | |
10 | - // baseUrl: 'https://qr.hdk-aero.com/admin-api', | |
11 | - // 超时 | |
12 | - timeout: 30000, | |
13 | - // 禁用 Cookie 等信息 | |
14 | - withCredentials: false, | |
15 | - header: { | |
16 | - //租户ID | |
17 | - 'tenant-id': 1, | |
18 | - 'Content-Type':'application/json' | |
19 | - } | |
20 | -} | |
2 | + //开发环境 | |
3 | + // prefixUrl: "http://123.60.140.65:18180", //仅带前缀,用于拼接维护报修页图片预览地址 | |
4 | + // fileUrl: "http://123.60.140.65:18180/hdk", | |
5 | + // baseUrl: 'http://123.60.140.65:18180/admin-api', | |
6 | + | |
7 | + | |
8 | + | |
9 | + //测试环境 | |
10 | + prefixUrl: "https://hdk-aero.ip-server.cn", //仅带前缀,用于拼接维护报修页图片预览地址 | |
11 | + fileUrl: "https://hdk-aero.ip-server.cn/hdk", | |
12 | + baseUrl: 'https://hdk-aero.ip-server.cn/admin-api', | |
13 | + | |
14 | + | |
15 | + //正式环境 | |
16 | + // prefixUrl:"https://qr.hdk-aero.com", //仅带前缀,用于拼接维护报修页图片预览地址 | |
17 | + // fileUrl:"https://qr.hdk-aero.com/hdk", | |
18 | + // baseUrl: 'https://qr.hdk-aero.com/admin-api', | |
19 | + // 超时 | |
20 | + timeout: 30000, | |
21 | + // 禁用 Cookie 等信息 | |
22 | + withCredentials: false, | |
23 | + header: { | |
24 | + //租户ID | |
25 | + 'tenant-id': 1, | |
26 | + 'Content-Type': 'application/json' | |
27 | + } | |
28 | +} | |
21 | 29 | \ No newline at end of file | ... | ... |
locale/en.json
... | ... | @@ -49,5 +49,16 @@ |
49 | 49 | "hdk.AttachmentModel":"AttachmentModel", |
50 | 50 | "hdk.OrderCode":"OrderCode", |
51 | 51 | "hdk.AttachmentIsEmpty":"AttachmentIsEmpty", |
52 | - "hdk.scan":"scan" | |
52 | + "hdk.scan":"scan", | |
53 | + "hdk.Required":"(Required)", | |
54 | + "hdk.Basicinformation":"BasicInformation", | |
55 | + "hdk.ProblemDescription":"ProblemDescription", | |
56 | + "hdk.DescriptionPlaceholder":"Please describe the situation and location of the problem accurately, which is more conducive to solution", | |
57 | + "hdk.AirportName":"AirportName", | |
58 | + "hdk.Name":"Name", | |
59 | + "hdk.ContactInformations":"ContactInformation", | |
60 | + "hdk.Email":"Email", | |
61 | + "hdk.DetailedAddress":"DetailedAddress(e.g.**Street**)", | |
62 | + "hdk.ConfirmAndReport":"ConfirmAndReport", | |
63 | + "hdk.Repair":"Repair" | |
53 | 64 | } | ... | ... |
locale/zh-Hans.json
... | ... | @@ -49,5 +49,17 @@ |
49 | 49 | "hdk.AttachmentModel":"附件型号", |
50 | 50 | "hdk.OrderCode":"订货编码", |
51 | 51 | "hdk.AttachmentIsEmpty":"附件为空", |
52 | - "hdk.scan":"扫一扫" | |
52 | + "hdk.scan":"扫一扫", | |
53 | + "hdk.Required":"(必填)", | |
54 | + "hdk.Basicinformation":"基本信息", | |
55 | + "hdk.ProblemDescription":"问题描述", | |
56 | + "hdk.DescriptionPlaceholder":"请将所遇问题情况和具体位置描述准确,更有利于解决。", | |
57 | + "hdk.ContactInformation":"联系方式", | |
58 | + "hdk.AirportName":"机场名", | |
59 | + "hdk.Name":"姓名", | |
60 | + "hdk.ContactInformations":"联系方式", | |
61 | + "hdk.Email":"邮箱", | |
62 | + "hdk.DetailedAddress":"详细地址(例如**街**号)", | |
63 | + "hdk.ConfirmAndReport":"确认并上报", | |
64 | + "hdk.Repair":"维护报修" | |
53 | 65 | } |
54 | 66 | \ No newline at end of file | ... | ... |
manifest.json
1 | 1 | { |
2 | 2 | "name" : "hdk-web-query-service", |
3 | - "appid" : "__UNI__E90A703", | |
3 | + "appid" : "__UNI__BB59251", | |
4 | 4 | "description" : "", |
5 | 5 | "versionName" : "1.0.1", |
6 | 6 | "versionCode" : "100", |
... | ... | @@ -71,7 +71,8 @@ |
71 | 71 | "vueVersion" : "2", |
72 | 72 | "h5" : { |
73 | 73 | "router" : { |
74 | - "mode" : "history" | |
74 | + "mode" : "history", | |
75 | + "base" : "/hdk-web/" | |
75 | 76 | }, |
76 | 77 | "devServer" : { |
77 | 78 | "https" : false | ... | ... |
mobile/pages/component/AuxiliaryModule.vue
1 | 1 | <template> |
2 | - <view> | |
3 | - <view class="empty" v-if="auxiliaryData.length <= 0 || auxiliaryData === null"> | |
4 | - <u-empty :text="$t('hdk.AttachmentIsEmpty')" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty> | |
5 | - </view> | |
6 | - <view class="auxiliaryModule" v-for="(item,index) in auxiliaryData" :key="index" v-else> | |
7 | - <view class="title">{{$t('hdk.AttachmentModel')}}:{{item.type}}</view> | |
8 | - <view class="photo"> | |
9 | - <u-swiper @click="previewLargeImage(item.productPicturePath,index)" :current="currents[index]" | |
10 | - :list="item.productPicturePath" indicator indicatorMode="dot" circular imgMode="aspectFit" :height="$isMobile?'400rpx':'600px'" | |
11 | - indicatorActiveColor="#00aeaa" indicatorInactiveColor="rgba(0, 174, 170, 0.3)" @change=" e => currents[index] = e.current" | |
12 | - :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
13 | - </view> | |
14 | - <view class="title">{{$t('hdk.OrderCode')}}:{{item.orderCode}}</view> | |
15 | - <UploadFile :fileType="1" :downloadFileName="item.productManual" :downloadFileNamePath="item.productManualPath" /> | |
16 | - </view> | |
17 | - </view> | |
2 | + <view class="containers"> | |
3 | + <view class="empty" v-if="auxiliaryData.length <= 0 || auxiliaryData === null"> | |
4 | + <u-empty :text="$t('hdk.AttachmentIsEmpty')" mode="data" | |
5 | + icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty> | |
6 | + </view> | |
7 | + <view class="auxiliaryModule" v-for="(item,index) in auxiliaryData" :key="index" v-else> | |
8 | + <view class="title">{{$t('hdk.AttachmentModel')}}:{{item.type}}</view> | |
9 | + <view class="photo"> | |
10 | + <u-swiper @click="previewLargeImage(item.productPicturePath,index)" :current="currents[index]" | |
11 | + :list="item.productPicturePath" indicator indicatorMode="dot" circular imgMode="aspectFit" | |
12 | + :height="$isMobile?'400rpx':'600px'" indicatorActiveColor="#00aeaa" | |
13 | + indicatorInactiveColor="rgba(0, 174, 170, 0.3)" @change=" e => currents[index] = e.current" | |
14 | + :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
15 | + </view> | |
16 | + <view class="title">{{$t('hdk.OrderCode')}}:{{item.orderCode}}</view> | |
17 | + <UploadFile :fileType="1" :downloadFileName="item.productManual" | |
18 | + :downloadFileNamePath="item.productManualPath" /> | |
19 | + </view> | |
20 | + </view> | |
18 | 21 | </template> |
19 | 22 | |
20 | 23 | <script> |
21 | - import UploadFile from './UploadFile.vue' | |
22 | - export default { | |
23 | - components: { | |
24 | - UploadFile | |
25 | - }, | |
26 | - props: { | |
27 | - auxiliaryData: { | |
28 | - type: Array | |
29 | - } | |
30 | - }, | |
31 | - data() { | |
32 | - return { | |
33 | - currents:[] | |
34 | - } | |
35 | - }, | |
36 | - computed: { | |
37 | - | |
38 | - }, | |
39 | - mounted() { | |
40 | - this.currents = this.auxiliaryData.map(()=> 0) | |
41 | - }, | |
42 | - methods: { | |
43 | - previewLargeImage(productPicturePath,index) { | |
44 | - console.log("第几组图",index); | |
45 | - console.log("图片列表", productPicturePath); | |
46 | - console.log("滑块", this.currents[index]); | |
47 | - const current = this.currents[index] | |
48 | - wx.previewImage({ | |
49 | - current: productPicturePath[current], | |
50 | - urls: productPicturePath | |
51 | - }); | |
52 | - } | |
53 | - } | |
54 | - } | |
24 | + import UploadFile from './UploadFile.vue' | |
25 | + export default { | |
26 | + components: { | |
27 | + UploadFile | |
28 | + }, | |
29 | + props: { | |
30 | + auxiliaryData: { | |
31 | + type: Array | |
32 | + } | |
33 | + }, | |
34 | + data() { | |
35 | + return { | |
36 | + currents: [] | |
37 | + } | |
38 | + }, | |
39 | + computed: { | |
40 | + | |
41 | + }, | |
42 | + mounted() { | |
43 | + this.currents = this.auxiliaryData.map(() => 0) | |
44 | + }, | |
45 | + methods: { | |
46 | + previewLargeImage(productPicturePath, index) { | |
47 | + console.log("第几组图", index); | |
48 | + console.log("图片列表", productPicturePath); | |
49 | + console.log("滑块", this.currents[index]); | |
50 | + const current = this.currents[index] | |
51 | + wx.previewImage({ | |
52 | + current: productPicturePath[current], | |
53 | + urls: productPicturePath | |
54 | + }); | |
55 | + } | |
56 | + } | |
57 | + } | |
55 | 58 | </script> |
56 | 59 | |
57 | 60 | <style lang="scss" scoped> |
58 | - | |
61 | + .containers { | |
62 | + display: flex; | |
63 | + justify-content: center; | |
64 | + align-items: center; | |
65 | + flex-direction: column; | |
66 | + } | |
67 | + | |
59 | 68 | @media screen and (max-width: 767px) { |
60 | 69 | .title { |
61 | 70 | font-size: 15px; |
62 | 71 | margin: 19px 0 0 14px; |
63 | 72 | } |
64 | - | |
73 | + | |
65 | 74 | .flex-between { |
66 | - margin: 16.5px; | |
67 | - display: flex; | |
68 | - justify-content: space-between; | |
69 | - font-size: 13px; | |
75 | + margin: 16.5px; | |
76 | + display: flex; | |
77 | + justify-content: space-between; | |
78 | + font-size: 13px; | |
79 | + } | |
80 | + | |
81 | + .auxiliaryModule { | |
82 | + width: 95%; | |
83 | + margin: 16px 24px 20px 24px; | |
84 | + padding: 2px 2px 2px 2px; | |
85 | + border-radius: 20px; | |
86 | + background-color: #ffffff; | |
87 | + box-sizing: border-box; | |
70 | 88 | } |
71 | 89 | } |
90 | + | |
72 | 91 | //PC端样式 |
73 | 92 | @media screen and (min-width: 768px) { |
74 | - .title { | |
75 | - font-size: 30px; | |
76 | - margin: 38px 0 0 28px; | |
77 | - } | |
78 | - .flex-between { | |
79 | - margin: 33px; | |
80 | - display: flex; | |
81 | - justify-content: space-between; | |
82 | - font-size: 26px; | |
83 | - } | |
93 | + .title { | |
94 | + font-size: 30px; | |
95 | + margin: 38px 0 0 28px; | |
96 | + } | |
97 | + | |
98 | + .flex-between { | |
99 | + margin: 33px; | |
100 | + display: flex; | |
101 | + justify-content: space-between; | |
102 | + font-size: 26px; | |
103 | + } | |
104 | + | |
105 | + .auxiliaryModule { | |
106 | + width: 80%; | |
107 | + margin: 16px 24px 20px 24px; | |
108 | + padding: 2px 2px 2px 2px; | |
109 | + border-radius: 20px; | |
110 | + background-color: #ffffff; | |
111 | + box-sizing: border-box; | |
112 | + } | |
113 | + } | |
114 | + | |
115 | + .empty { | |
116 | + width: 100%; | |
117 | + height: 100%; | |
118 | + } | |
119 | + | |
120 | + | |
121 | + | |
122 | + .photo { | |
123 | + margin: 47px 28px 0 28px; | |
124 | + } | |
125 | + | |
126 | + | |
127 | + | |
128 | + .leftT { | |
129 | + background-color: rgba(255, 255, 255, 0); | |
130 | + box-sizing: border-box; | |
131 | + font-family: '苹方 中等', '苹方', sans-serif; | |
132 | + color: #999db0; | |
133 | + text-align: left; | |
134 | + line-height: normal; | |
135 | + } | |
136 | + | |
137 | + .rightT { | |
138 | + background-color: rgba(255, 255, 255, 0); | |
139 | + box-sizing: border-box; | |
140 | + font-family: '苹方 中等', '苹方', sans-serif; | |
141 | + color: #2b3950; | |
142 | + text-align: left; | |
143 | + line-height: normal; | |
84 | 144 | } |
85 | - | |
86 | - .empty { | |
87 | - width: 100%; | |
88 | - height: 100%; | |
89 | - } | |
90 | - | |
91 | - .informationModule { | |
92 | - width: 702px; | |
93 | - height: 467px; | |
94 | - margin: 20px 24px; | |
95 | - padding: 2px 2px 2px 2px; | |
96 | - border-radius: 20px; | |
97 | - background-color: #ffffff; | |
98 | - box-sizing: border-box; | |
99 | - } | |
100 | - | |
101 | - .fileViewingModule { | |
102 | - width: 702px; | |
103 | - height: 235px; | |
104 | - margin: 20px 24px; | |
105 | - padding: 2px 2px 2px 2px; | |
106 | - border-radius: 20px; | |
107 | - background-color: #ffffff; | |
108 | - box-sizing: border-box; | |
109 | - } | |
110 | - | |
111 | - | |
112 | - | |
113 | - .dataViewingModule { | |
114 | - width: 702px; | |
115 | - height: 637px; | |
116 | - margin: 20px 24px; | |
117 | - padding: 2px 2px 2px 2px; | |
118 | - border-radius: 20px; | |
119 | - background-color: #ffffff; | |
120 | - box-sizing: border-box; | |
121 | - } | |
122 | - | |
123 | - .photo { | |
124 | - margin: 47px 28px 0 28px; | |
125 | - } | |
126 | - | |
127 | - .auxiliaryModule { | |
128 | - width: 702px; | |
129 | - margin: 16px 24px 20px 24px; | |
130 | - padding: 2px 2px 2px 2px; | |
131 | - border-radius: 20px; | |
132 | - background-color: #ffffff; | |
133 | - box-sizing: border-box; | |
134 | - } | |
135 | - | |
136 | - .leftT { | |
137 | - background-color: rgba(255, 255, 255, 0); | |
138 | - box-sizing: border-box; | |
139 | - font-family: '苹方 中等', '苹方', sans-serif; | |
140 | - color: #999db0; | |
141 | - text-align: left; | |
142 | - line-height: normal; | |
143 | - } | |
144 | - | |
145 | - .rightT { | |
146 | - background-color: rgba(255, 255, 255, 0); | |
147 | - box-sizing: border-box; | |
148 | - font-family: '苹方 中等', '苹方', sans-serif; | |
149 | - color: #2b3950; | |
150 | - text-align: left; | |
151 | - line-height: normal; | |
152 | - } | |
153 | -</style> | |
145 | +</style> | |
154 | 146 | \ No newline at end of file | ... | ... |
mobile/pages/component/InformationModule.vue
1 | 1 | <template> |
2 | - <view> | |
3 | - <u-swiper :list="informationData.lampPath" @click="previewLargeImage(informationData.lampPath,current)" | |
4 | - :current="current" indicator indicatorMode="dot" imgMode="aspectFit" circular :height="$isMobile?'400rpx':'600px'" indicatorActiveColor="#00aeaa" | |
5 | - indicatorInactiveColor="rgba(0, 174, 170, 0.3)" @change="changeSwiper" | |
6 | - :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
7 | - <view class="informationModule"> | |
8 | - <view class="title"> | |
9 | - {{$t('hdk.productInformation')}} | |
10 | - </view> | |
11 | - <view class="flex-between"> | |
12 | - <text class="leftT">{{$t('hdk.SnCode')}}</text> | |
13 | - <text class="rightT">{{informationData.sn || ""}}</text> | |
14 | - </view> | |
15 | - <view class="flex-between"> | |
16 | - <text class="leftT">{{$t('hdk.ProductName')}}</text> | |
17 | - <text class="rightT">{{informationData.productName || ""}}</text> | |
18 | - </view> | |
19 | - <view class="flex-between"> | |
20 | - <text class="leftT">{{$t('hdk.Model')}}</text> | |
21 | - <text class="rightT">{{informationData.type || ""}}</text> | |
22 | - </view> | |
23 | - <view class="flex-between"> | |
24 | - <text class="leftT">{{$t('hdk.DateOfProduction')}}</text> | |
25 | - <text class="rightT">{{$u.timeFormat(informationData.productionTime, 'yyyy年mm月dd日') || ""}}</text> | |
26 | - </view> | |
27 | - <view class="flex-between"> | |
28 | - <text class="leftT">{{$t('hdk.ProductionPersonnel')}}</text> | |
29 | - <text class="rightT">{{informationData.productionUserName || ""}}</text> | |
30 | - </view> | |
31 | - </view> | |
32 | - <view class="fileViewingModule"> | |
33 | - <view class="title"> | |
34 | - {{$t('hdk.ProductSpecification')}} | |
35 | - </view> | |
36 | - <UploadFile :fileType="1" :downloadFileName="informationData.productDatasheet" | |
37 | - :downloadFileNamePath="informationData.productDatasheetPath" /> | |
38 | - </view> | |
39 | - | |
40 | - <view class="fileViewingModule"> | |
41 | - <view class="title"> | |
42 | - {{$t('hdk.ProductManual')}} | |
43 | - </view> | |
44 | - <UploadFile :fileType="1" :downloadFileName="informationData.productManual" | |
45 | - :downloadFileNamePath="informationData.productManualPath" /> | |
46 | - </view> | |
47 | - </view> | |
2 | + <view class="containers"> | |
3 | + <u-swiper class="swiperCss" :list="informationData.lampPath" | |
4 | + @click="previewLargeImage(informationData.lampPath,current)" :current="current" indicator | |
5 | + indicatorMode="dot" imgMode="aspectFill" circular :height="$isMobile?'400rpx':'600px'" | |
6 | + indicatorActiveColor="#00aeaa" indicatorInactiveColor="rgba(0, 174, 170, 0.3)" @change="changeSwiper" | |
7 | + :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
8 | + <view class="informationModule"> | |
9 | + <view class="title"> | |
10 | + {{$t('hdk.productInformation')}} | |
11 | + </view> | |
12 | + <view class="flex-between"> | |
13 | + <text class="leftT">{{$t('hdk.SnCode')}}</text> | |
14 | + <text class="rightT">{{informationData.sn || ""}}</text> | |
15 | + </view> | |
16 | + <view class="flex-between"> | |
17 | + <text class="leftT">{{$t('hdk.ProductName')}}</text> | |
18 | + <text class="rightT">{{informationData.productName || ""}}</text> | |
19 | + </view> | |
20 | + <view class="flex-between"> | |
21 | + <text class="leftT">{{$t('hdk.Model')}}</text> | |
22 | + <text class="rightT">{{informationData.type || ""}}</text> | |
23 | + </view> | |
24 | + <view class="flex-between"> | |
25 | + <text class="leftT">{{$t('hdk.DateOfProduction')}}</text> | |
26 | + <text class="rightT">{{$u.timeFormat(informationData.productionTime, 'yyyy年mm月dd日') || ""}}</text> | |
27 | + </view> | |
28 | + <view class="flex-between"> | |
29 | + <text class="leftT">{{$t('hdk.ProductionPersonnel')}}</text> | |
30 | + <text class="rightT">{{informationData.productionUserName || ""}}</text> | |
31 | + </view> | |
32 | + </view> | |
33 | + <view class="fileViewingModule"> | |
34 | + <view class="title"> | |
35 | + {{$t('hdk.ProductSpecification')}} | |
36 | + </view> | |
37 | + <UploadFile :fileType="1" :downloadFileName="informationData.productDatasheet" | |
38 | + :downloadFileNamePath="informationData.productDatasheetPath" /> | |
39 | + </view> | |
40 | + | |
41 | + <view class="fileViewingModule"> | |
42 | + <view class="title"> | |
43 | + {{$t('hdk.ProductManual')}} | |
44 | + </view> | |
45 | + <UploadFile :fileType="1" :downloadFileName="informationData.productManual" | |
46 | + :downloadFileNamePath="informationData.productManualPath" /> | |
47 | + </view> | |
48 | + </view> | |
48 | 49 | </template> |
49 | 50 | |
50 | 51 | <script> |
51 | - import UploadFile from './UploadFile.vue' | |
52 | - export default { | |
53 | - components: { | |
54 | - UploadFile | |
55 | - }, | |
56 | - props: { | |
57 | - informationData: { | |
58 | - type: Object | |
59 | - } | |
60 | - }, | |
61 | - data() { | |
62 | - return { | |
63 | - current: 0 | |
64 | - } | |
65 | - }, | |
66 | - computed: { | |
67 | - | |
68 | - }, | |
69 | - onLoad() {}, | |
70 | - methods: { | |
71 | - changeSwiper(e) { | |
72 | - this.current = e.current | |
73 | - // console.log("当前滑块", this.current); | |
74 | - }, | |
75 | - previewLargeImage(productPicturePath, current) { | |
76 | - console.log("图片列表", productPicturePath); | |
77 | - console.log("滑块", current); | |
78 | - wx.previewImage({ | |
79 | - current: productPicturePath[current], | |
80 | - urls: productPicturePath | |
81 | - }); | |
82 | - } | |
83 | - } | |
84 | - } | |
52 | + import UploadFile from './UploadFile.vue' | |
53 | + export default { | |
54 | + components: { | |
55 | + UploadFile | |
56 | + }, | |
57 | + props: { | |
58 | + informationData: { | |
59 | + type: Object | |
60 | + } | |
61 | + }, | |
62 | + data() { | |
63 | + return { | |
64 | + current: 0 | |
65 | + } | |
66 | + }, | |
67 | + computed: { | |
68 | + | |
69 | + }, | |
70 | + onLoad() {}, | |
71 | + methods: { | |
72 | + changeSwiper(e) { | |
73 | + this.current = e.current | |
74 | + // console.log("当前滑块", this.current); | |
75 | + }, | |
76 | + previewLargeImage(productPicturePath, current) { | |
77 | + console.log("图片列表", productPicturePath); | |
78 | + console.log("滑块", current); | |
79 | + wx.previewImage({ | |
80 | + current: productPicturePath[current], | |
81 | + urls: productPicturePath | |
82 | + }); | |
83 | + } | |
84 | + } | |
85 | + } | |
85 | 86 | </script> |
86 | 87 | |
87 | 88 | <style lang="scss" scoped> |
89 | + .containers { | |
90 | + display: flex; | |
91 | + justify-content: center; | |
92 | + align-items: center; | |
93 | + flex-direction: column; | |
94 | + } | |
95 | + | |
96 | + | |
88 | 97 | //移动端样式 |
89 | 98 | @media screen and (max-width: 767px) { |
90 | 99 | .title { |
91 | 100 | font-size: 15px; |
92 | 101 | margin: 19px 0 0 14px; |
93 | 102 | } |
94 | - | |
103 | + | |
104 | + .swiperCss { | |
105 | + width: 95%; | |
106 | + } | |
107 | + | |
95 | 108 | .flex-between { |
96 | - margin: 16.5px; | |
97 | - display: flex; | |
98 | - justify-content: space-between; | |
99 | - font-size: 13px; | |
109 | + margin: 16.5px; | |
110 | + display: flex; | |
111 | + justify-content: space-between; | |
112 | + font-size: 13px; | |
113 | + } | |
114 | + | |
115 | + .pdfTitle { | |
116 | + font-size: 13px; | |
117 | + margin-left: 8px; | |
100 | 118 | } |
101 | - | |
102 | - .pdfTitle { | |
103 | - font-size: 13px; | |
104 | - margin-left: 8px; | |
119 | + | |
120 | + .informationModule { | |
121 | + width: 95%; | |
122 | + margin: 20px 24px; | |
123 | + padding: 2px; | |
124 | + border-radius: 20px; | |
125 | + background-color: #ffffff; | |
126 | + box-sizing: border-box; | |
127 | + } | |
128 | + | |
129 | + .fileViewingModule { | |
130 | + width: 95%; | |
131 | + min-height: 100px; | |
132 | + margin: 20px 24px; | |
133 | + padding: 2px 2px 2px 2px; | |
134 | + border-radius: 20px; | |
135 | + background-color: #ffffff; | |
136 | + box-sizing: border-box; | |
105 | 137 | } |
106 | - | |
138 | + | |
107 | 139 | } |
140 | + | |
108 | 141 | //PC端样式 |
109 | 142 | @media screen and (min-width: 768px) { |
110 | - .title { | |
111 | - font-size: 30px; | |
112 | - margin: 38px 0 0 28px; | |
113 | - } | |
114 | - .flex-between { | |
115 | - margin: 33px; | |
116 | - display: flex; | |
117 | - justify-content: space-between; | |
118 | - font-size: 26px; | |
119 | - } | |
143 | + .title { | |
144 | + font-size: 30px; | |
145 | + margin: 38px 0 0 28px; | |
146 | + } | |
147 | + | |
148 | + .swiperCss { | |
149 | + width: 80%; | |
150 | + } | |
151 | + | |
152 | + .flex-between { | |
153 | + margin: 33px; | |
154 | + display: flex; | |
155 | + justify-content: space-between; | |
156 | + font-size: 26px; | |
157 | + } | |
158 | + | |
159 | + .informationModule { | |
160 | + width: 80%; | |
161 | + margin: 20px 24px; | |
162 | + padding: 2px; | |
163 | + border-radius: 20px; | |
164 | + background-color: #ffffff; | |
165 | + box-sizing: border-box; | |
166 | + } | |
167 | + | |
168 | + | |
169 | + .fileViewingModule { | |
170 | + width: 80%; | |
171 | + min-height: 100px; | |
172 | + margin: 20px 24px; | |
173 | + padding: 2px 2px 2px 2px; | |
174 | + border-radius: 20px; | |
175 | + background-color: #ffffff; | |
176 | + box-sizing: border-box; | |
177 | + } | |
178 | + } | |
179 | + .leftT { | |
180 | + background-color: rgba(255, 255, 255, 0); | |
181 | + box-sizing: border-box; | |
182 | + font-family: '苹方 中等', '苹方', sans-serif; | |
183 | + color: #999db0; | |
184 | + text-align: left; | |
185 | + line-height: normal; | |
120 | 186 | } |
121 | - | |
122 | - .informationModule { | |
123 | - width: 702px; | |
124 | - // height: 467px; | |
125 | - margin: 20px 24px; | |
126 | - padding: 2px; | |
127 | - border-radius: 20px; | |
128 | - background-color: #ffffff; | |
129 | - box-sizing: border-box; | |
187 | + | |
188 | + .rightT { | |
189 | + background-color: rgba(255, 255, 255, 0); | |
190 | + box-sizing: border-box; | |
191 | + font-family: '苹方 中等', '苹方', sans-serif; | |
192 | + color: #2b3950; | |
193 | + text-align: left; | |
194 | + line-height: normal; | |
130 | 195 | } |
131 | - | |
132 | - | |
133 | - .fileViewingModule { | |
134 | - width: 702px; | |
135 | - min-height: 100px; | |
136 | - margin: 20px 24px; | |
137 | - padding: 2px 2px 2px 2px; | |
138 | - border-radius: 20px; | |
139 | - background-color: #ffffff; | |
140 | - box-sizing: border-box; | |
141 | - } | |
142 | - | |
143 | - | |
144 | - | |
145 | - .leftT { | |
146 | - background-color: rgba(255, 255, 255, 0); | |
147 | - box-sizing: border-box; | |
148 | - font-family: '苹方 中等', '苹方', sans-serif; | |
149 | - color: #999db0; | |
150 | - text-align: left; | |
151 | - line-height: normal; | |
152 | - } | |
153 | - | |
154 | - .rightT { | |
155 | - background-color: rgba(255, 255, 255, 0); | |
156 | - box-sizing: border-box; | |
157 | - font-family: '苹方 中等', '苹方', sans-serif; | |
158 | - color: #2b3950; | |
159 | - text-align: left; | |
160 | - line-height: normal; | |
161 | - } | |
162 | -</style> | |
196 | +</style> | |
163 | 197 | \ No newline at end of file | ... | ... |
mobile/pages/component/InspectionModule.vue
1 | 1 | <template> |
2 | - <view> | |
3 | - <!-- <view class="empty" v-if="inspectionData === null"> | |
2 | + <view class="containers"> | |
3 | + <!-- <view class="empty" v-if="inspectionData === null"> | |
4 | 4 | <u-empty text="附件为空" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty> |
5 | 5 | </view> --> |
6 | - <view class="informationModule"> | |
7 | - <view class="title"> | |
8 | - {{$t('hdk.inspectionInformation')}} | |
9 | - </view> | |
10 | - <view class="flex-between"> | |
11 | - <text class="leftT">{{$t('hdk.SoftwareVersion')}}</text> | |
12 | - <text class="rightT">{{inspectionData.softwareVersion || ''}}</text> | |
13 | - </view> | |
14 | - <view class="flex-between"> | |
15 | - <text class="leftT">{{$t('hdk.HardwareVersion')}}</text> | |
16 | - <text class="rightT">{{inspectionData.hardwareVersion || ''}}</text> | |
17 | - </view> | |
18 | - <view class="flex-between"> | |
19 | - <text class="leftT">{{$t('hdk.TestDate')}}</text> | |
20 | - <text class="rightT">{{$u.timeFormat(inspectionData.checkTime, 'yyyy年mm月dd日') || ''}}</text> | |
21 | - </view> | |
22 | - </view> | |
23 | - | |
24 | - <view class="informationModule"> | |
25 | - <view class="title"> | |
26 | - {{$t('hdk.ElectricalParameters')}} | |
27 | - </view> | |
28 | - <view class="flex-between"> | |
29 | - <text class="leftT">{{$t('hdk.Power')}}</text> | |
30 | - <text class="rightT">{{inspectionData.power || ''}}</text> | |
31 | - </view> | |
32 | - <view class="flex-between"> | |
33 | - <text class="leftT">{{$t('hdk.PowerFactor')}}</text> | |
34 | - <text class="rightT">{{inspectionData.powerFactor || ''}}</text> | |
35 | - </view> | |
36 | - </view> | |
37 | - | |
38 | - <view class="dataViewingModule"> | |
39 | - <view class="title"> | |
40 | - {{$t('hdk.LightIntensityDistribution')}} | |
41 | - </view> | |
42 | - <view class="photo"> | |
43 | - <u-swiper :list="inspectionData.lightIntensityPhoto" @click="previewLargeImage(inspectionData.lightIntensityPhoto,current)" :current="current" v-if="inspectionData.lightIntensityPhoto.length > 0" | |
44 | - indicator indicatorMode="dot" circular imgMode="aspectFit" :height="$isMobile?'400rpx':'600px'" indicatorActiveColor="#00aeaa" @change="changeSwiper" | |
45 | - indicatorInactiveColor="rgba(0, 174, 170, 0.3)" :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
46 | - </view> | |
47 | - <UploadFile :fileType="2" v-for="(item,index) in inspectionData.lightIntensityFile" :key="index" :downloadFileName="item" | |
48 | - :downloadFileNamePath="item" :isCsv="true" /> | |
49 | - </view> | |
50 | - | |
51 | - <view class="fileViewingModule"> | |
52 | - <view class="title"> | |
53 | - {{$t('hdk.AirTightnessInspectionDocuments')}} | |
54 | - </view> | |
55 | - <UploadFile :fileType="2" :downloadFileName="inspectionData.tightnessCheckFile" | |
56 | - :downloadFileNamePath="inspectionData.tightnessCheckFilePath" /> | |
57 | - </view> | |
58 | - | |
59 | - </view> | |
6 | + <view class="informationModule"> | |
7 | + <view class="title"> | |
8 | + {{$t('hdk.inspectionInformation')}} | |
9 | + </view> | |
10 | + <view class="flex-between"> | |
11 | + <text class="leftT">{{$t('hdk.SoftwareVersion')}}</text> | |
12 | + <text class="rightT">{{inspectionData.softwareVersion || ''}}</text> | |
13 | + </view> | |
14 | + <view class="flex-between"> | |
15 | + <text class="leftT">{{$t('hdk.HardwareVersion')}}</text> | |
16 | + <text class="rightT">{{inspectionData.hardwareVersion || ''}}</text> | |
17 | + </view> | |
18 | + <view class="flex-between"> | |
19 | + <text class="leftT">{{$t('hdk.TestDate')}}</text> | |
20 | + <text class="rightT">{{$u.timeFormat(inspectionData.checkTime, 'yyyy年mm月dd日') || ''}}</text> | |
21 | + </view> | |
22 | + </view> | |
23 | + | |
24 | + <view class="informationModule"> | |
25 | + <view class="title"> | |
26 | + {{$t('hdk.ElectricalParameters')}} | |
27 | + </view> | |
28 | + <view class="flex-between"> | |
29 | + <text class="leftT">{{$t('hdk.Power')}}</text> | |
30 | + <text class="rightT">{{inspectionData.power || ''}}</text> | |
31 | + </view> | |
32 | + <view class="flex-between"> | |
33 | + <text class="leftT">{{$t('hdk.PowerFactor')}}</text> | |
34 | + <text class="rightT">{{inspectionData.powerFactor || ''}}</text> | |
35 | + </view> | |
36 | + </view> | |
37 | + | |
38 | + <view class="dataViewingModule"> | |
39 | + <view class="title"> | |
40 | + {{$t('hdk.LightIntensityDistribution')}} | |
41 | + </view> | |
42 | + <view class="photo"> | |
43 | + <u-swiper :list="inspectionData.lightIntensityPhoto" | |
44 | + @click="previewLargeImage(inspectionData.lightIntensityPhoto,current)" :current="current" | |
45 | + v-if="inspectionData.lightIntensityPhoto.length > 0" indicator indicatorMode="dot" circular | |
46 | + imgMode="aspectFit" :height="$isMobile?'400rpx':'600px'" indicatorActiveColor="#00aeaa" | |
47 | + @change="changeSwiper" indicatorInactiveColor="rgba(0, 174, 170, 0.3)" | |
48 | + :indicatorStyle="{bottom:'20px',right:'5px'}"></u-swiper> | |
49 | + </view> | |
50 | + <UploadFile :fileType="2" v-for="(item,index) in inspectionData.lightIntensityFile" :key="index" | |
51 | + :downloadFileName="item" :downloadFileNamePath="item" :isCsv="true" /> | |
52 | + </view> | |
53 | + | |
54 | + <view class="fileViewingModule"> | |
55 | + <view class="title"> | |
56 | + {{$t('hdk.AirTightnessInspectionDocuments')}} | |
57 | + </view> | |
58 | + <UploadFile :fileType="2" :downloadFileName="inspectionData.tightnessCheckFile" | |
59 | + :downloadFileNamePath="inspectionData.tightnessCheckFilePath" /> | |
60 | + </view> | |
61 | + | |
62 | + </view> | |
60 | 63 | </template> |
61 | 64 | |
62 | 65 | <script> |
63 | - import UploadFile from './UploadFile.vue' | |
64 | - export default { | |
65 | - components: { | |
66 | - UploadFile | |
67 | - }, | |
68 | - props: { | |
69 | - inspectionData: { | |
70 | - type: Object | |
71 | - } | |
72 | - }, | |
73 | - data() { | |
74 | - return { | |
75 | - current: 0 | |
76 | - } | |
77 | - }, | |
78 | - computed: { | |
79 | - | |
80 | - }, | |
81 | - onLoad() { | |
82 | - | |
83 | - }, | |
84 | - methods: { | |
85 | - changeSwiper(e){ | |
86 | - this.current = e.current | |
87 | - // console.log("当前滑块",this.current); | |
88 | - }, | |
89 | - previewLargeImage(productPicturePath, current) { | |
90 | - console.log("图片列表", productPicturePath); | |
91 | - console.log("滑块", current); | |
92 | - wx.previewImage({ | |
93 | - current: productPicturePath[current], | |
94 | - urls: productPicturePath | |
95 | - }); | |
96 | - } | |
97 | - } | |
98 | - } | |
66 | + import UploadFile from './UploadFile.vue' | |
67 | + export default { | |
68 | + components: { | |
69 | + UploadFile | |
70 | + }, | |
71 | + props: { | |
72 | + inspectionData: { | |
73 | + type: Object | |
74 | + } | |
75 | + }, | |
76 | + data() { | |
77 | + return { | |
78 | + current: 0 | |
79 | + } | |
80 | + }, | |
81 | + computed: { | |
82 | + | |
83 | + }, | |
84 | + onLoad() { | |
85 | + | |
86 | + }, | |
87 | + methods: { | |
88 | + changeSwiper(e) { | |
89 | + this.current = e.current | |
90 | + // console.log("当前滑块",this.current); | |
91 | + }, | |
92 | + previewLargeImage(productPicturePath, current) { | |
93 | + console.log("图片列表", productPicturePath); | |
94 | + console.log("滑块", current); | |
95 | + wx.previewImage({ | |
96 | + current: productPicturePath[current], | |
97 | + urls: productPicturePath | |
98 | + }); | |
99 | + } | |
100 | + } | |
101 | + } | |
99 | 102 | </script> |
100 | 103 | |
101 | 104 | <style lang="scss" scoped> |
105 | + .containers { | |
106 | + display: flex; | |
107 | + justify-content: center; | |
108 | + align-items: center; | |
109 | + flex-direction: column; | |
110 | + } | |
111 | + | |
102 | 112 | //移动端样式 |
103 | 113 | @media screen and (max-width: 767px) { |
104 | 114 | .title { |
105 | 115 | font-size: 15px; |
106 | 116 | margin: 19px 0 0 14px; |
107 | 117 | } |
108 | - | |
118 | + | |
109 | 119 | .flex-between { |
110 | - margin: 16.5px; | |
111 | - display: flex; | |
112 | - justify-content: space-between; | |
113 | - font-size: 13px; | |
120 | + margin: 16.5px; | |
121 | + display: flex; | |
122 | + justify-content: space-between; | |
123 | + font-size: 13px; | |
124 | + } | |
125 | + | |
126 | + .informationModule { | |
127 | + width: 95%; | |
128 | + max-height: 467px; | |
129 | + margin: 20px 24px; | |
130 | + padding: 2px 2px 2px 2px; | |
131 | + border-radius: 20px; | |
132 | + background-color: #ffffff; | |
133 | + box-sizing: border-box; | |
134 | + } | |
135 | + | |
136 | + .fileViewingModule { | |
137 | + width: 95%; | |
138 | + margin: 20px 24px; | |
139 | + padding: 2px 2px 2px 2px; | |
140 | + border-radius: 20px; | |
141 | + background-color: #ffffff; | |
142 | + box-sizing: border-box; | |
143 | + } | |
144 | + | |
145 | + | |
146 | + .dataViewingModule { | |
147 | + width: 95%; | |
148 | + margin: 20px 24px; | |
149 | + padding: 2px 2px 2px 2px; | |
150 | + border-radius: 20px; | |
151 | + background-color: #ffffff; | |
152 | + box-sizing: border-box; | |
114 | 153 | } |
115 | 154 | } |
155 | + | |
116 | 156 | //PC端样式 |
117 | 157 | @media screen and (min-width: 768px) { |
118 | - .title { | |
119 | - font-size: 30px; | |
120 | - margin: 38px 0 0 28px; | |
121 | - } | |
122 | - .flex-between { | |
123 | - margin: 33px; | |
124 | - display: flex; | |
125 | - justify-content: space-between; | |
126 | - font-size: 26px; | |
127 | - } | |
158 | + .title { | |
159 | + font-size: 30px; | |
160 | + margin: 38px 0 0 28px; | |
161 | + } | |
162 | + | |
163 | + .flex-between { | |
164 | + margin: 33px; | |
165 | + display: flex; | |
166 | + justify-content: space-between; | |
167 | + font-size: 26px; | |
168 | + } | |
169 | + | |
170 | + .informationModule { | |
171 | + width: 80%; | |
172 | + max-height: 467px; | |
173 | + margin: 20px 24px; | |
174 | + padding: 2px 2px 2px 2px; | |
175 | + border-radius: 20px; | |
176 | + background-color: #ffffff; | |
177 | + box-sizing: border-box; | |
178 | + } | |
179 | + | |
180 | + .fileViewingModule { | |
181 | + width: 80%; | |
182 | + height: 235px; | |
183 | + margin: 20px 24px; | |
184 | + padding: 2px 2px 2px 2px; | |
185 | + border-radius: 20px; | |
186 | + background-color: #ffffff; | |
187 | + box-sizing: border-box; | |
188 | + } | |
189 | + | |
190 | + | |
191 | + .dataViewingModule { | |
192 | + width: 80%; | |
193 | + margin: 20px 24px; | |
194 | + padding: 2px 2px 2px 2px; | |
195 | + border-radius: 20px; | |
196 | + background-color: #ffffff; | |
197 | + box-sizing: border-box; | |
198 | + } | |
199 | + } | |
200 | + | |
201 | + | |
202 | + | |
203 | + .photo { | |
204 | + margin: 47px 28px 0 28px; | |
205 | + } | |
206 | + | |
207 | + | |
208 | + .leftT { | |
209 | + background-color: rgba(255, 255, 255, 0); | |
210 | + box-sizing: border-box; | |
211 | + font-family: '苹方 中等', '苹方', sans-serif; | |
212 | + color: #999db0; | |
213 | + text-align: left; | |
214 | + line-height: normal; | |
215 | + } | |
216 | + | |
217 | + .rightT { | |
218 | + background-color: rgba(255, 255, 255, 0); | |
219 | + box-sizing: border-box; | |
220 | + font-family: '苹方 中等', '苹方', sans-serif; | |
221 | + color: #2b3950; | |
222 | + text-align: left; | |
223 | + line-height: normal; | |
128 | 224 | } |
129 | - | |
130 | - .informationModule { | |
131 | - width: 702px; | |
132 | - max-height: 467px; | |
133 | - margin: 20px 24px; | |
134 | - padding: 2px 2px 2px 2px; | |
135 | - border-radius: 20px; | |
136 | - background-color: #ffffff; | |
137 | - box-sizing: border-box; | |
138 | - } | |
139 | - | |
140 | - .fileViewingModule { | |
141 | - width: 702px; | |
142 | - height: 235px; | |
143 | - margin: 20px 24px; | |
144 | - padding: 2px 2px 2px 2px; | |
145 | - border-radius: 20px; | |
146 | - background-color: #ffffff; | |
147 | - box-sizing: border-box; | |
148 | - } | |
149 | - | |
150 | - | |
151 | - .dataViewingModule { | |
152 | - width: 702px; | |
153 | - margin: 20px 24px; | |
154 | - padding: 2px 2px 2px 2px; | |
155 | - border-radius: 20px; | |
156 | - background-color: #ffffff; | |
157 | - box-sizing: border-box; | |
158 | - } | |
159 | - | |
160 | - .photo { | |
161 | - margin: 47px 28px 0 28px; | |
162 | - } | |
163 | - | |
164 | - .auxiliaryModule { | |
165 | - width: 702px; | |
166 | - margin: 16px 24px 20px 24px; | |
167 | - padding: 2px 2px 2px 2px; | |
168 | - border-radius: 20px; | |
169 | - background-color: #ffffff; | |
170 | - box-sizing: border-box; | |
171 | - } | |
172 | - | |
173 | - .leftT { | |
174 | - background-color: rgba(255, 255, 255, 0); | |
175 | - box-sizing: border-box; | |
176 | - font-family: '苹方 中等', '苹方', sans-serif; | |
177 | - color: #999db0; | |
178 | - text-align: left; | |
179 | - line-height: normal; | |
180 | - } | |
181 | - | |
182 | - .rightT { | |
183 | - background-color: rgba(255, 255, 255, 0); | |
184 | - box-sizing: border-box; | |
185 | - font-family: '苹方 中等', '苹方', sans-serif; | |
186 | - color: #2b3950; | |
187 | - text-align: left; | |
188 | - line-height: normal; | |
189 | - } | |
190 | -</style> | |
225 | +</style> | |
191 | 226 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,46 @@ |
1 | +<template> | |
2 | + <view class="back" @click="goback" v-if="!$isMobile"> | |
3 | + <u-image src="/static/images/icon/back.png" mode="witFix" width="100px" height="100px"></u-image> | |
4 | + </view> | |
5 | +</template> | |
6 | + | |
7 | +<script> | |
8 | + export default { | |
9 | + components: {}, | |
10 | + props: { | |
11 | + | |
12 | + }, | |
13 | + data() { | |
14 | + return { | |
15 | + | |
16 | + } | |
17 | + }, | |
18 | + computed: { | |
19 | + | |
20 | + }, | |
21 | + onLoad() { | |
22 | + | |
23 | + }, | |
24 | + methods: { | |
25 | + goback() { | |
26 | + window.history.back(); | |
27 | + } | |
28 | + } | |
29 | + } | |
30 | +</script> | |
31 | + | |
32 | +<style lang="scss" scoped> | |
33 | + .back { | |
34 | + width: 50px; | |
35 | + height: 50px; | |
36 | + border-radius: 50px; | |
37 | + position: fixed; | |
38 | + display: flex; | |
39 | + flex-direction: column; | |
40 | + justify-content: center; | |
41 | + align-items: center; | |
42 | + left:1%; | |
43 | + top: 10%; | |
44 | + bottom: 0; | |
45 | + } | |
46 | +</style> | |
0 | 47 | \ No newline at end of file | ... | ... |
mobile/pages/component/topWindow.vue
1 | 1 | <template> |
2 | 2 | <view> |
3 | 3 | <b-navbar toggleable="lg" type="dark" class="b-navbar"> |
4 | - <b-navbar-brand :title="$t('hdk.gohome')" href="/mobile/pages/homePage/index"> | |
4 | + <b-navbar-brand :title="$t('hdk.gohome')" href="/hdk-web"> | |
5 | 5 | <img src="@/static/hdk-top-logo.png" width="63px" height="32px" style="margin-left: 10px;" alt="Kitten"> |
6 | 6 | </b-navbar-brand> |
7 | 7 | <b-navbar-toggle target="nav-collapse"></b-navbar-toggle> |
... | ... | @@ -13,20 +13,22 @@ |
13 | 13 | |
14 | 14 | <!-- Right aligned nav items --> |
15 | 15 | <b-navbar-nav class="ml-auto"> |
16 | - <b-navbar-nav v-show="!isHome" class="b-navbar"> | |
17 | - <b-nav-item @click="handleClick('productInformation')" | |
18 | - :class="{ 'activeCSS': selectedNavItem === 'productInformation' }">{{$t('hdk.productInformation')}}</b-nav-item> | |
19 | - <b-nav-item @click="handleClick('inspectionInformation')" | |
20 | - :class="{ 'activeCSS': selectedNavItem === 'inspectionInformation' }">{{$t('hdk.inspectionInformation')}}</b-nav-item> | |
21 | - <b-nav-item @click="handleClick('attachmentInformation')" | |
22 | - :class="{ 'activeCSS': selectedNavItem === 'attachmentInformation' }">{{$t('hdk.attachmentInformation')}}</b-nav-item> | |
16 | + <b-navbar-nav class="b-navbar"> | |
17 | + <b-nav-item v-show="!isHome" @click="handleClick('productInformation')" | |
18 | + :class="{ 'activeCSS': selectedNavItem === 'productInformation' }">{{$t('hdk.productInformation')}}</b-nav-item> | |
19 | + <b-nav-item v-show="!isHome" @click="handleClick('inspectionInformation')" | |
20 | + :class="{ 'activeCSS': selectedNavItem === 'inspectionInformation' }">{{$t('hdk.inspectionInformation')}}</b-nav-item> | |
21 | + <b-nav-item v-show="!isHome" @click="handleClick('attachmentInformation')" | |
22 | + :class="{ 'activeCSS': selectedNavItem === 'attachmentInformation' }">{{$t('hdk.attachmentInformation')}}</b-nav-item> | |
23 | + <b-nav-item-dropdown :text="selectedLanguage" right> | |
24 | + <b-dropdown-item href="#" | |
25 | + @click="changeLanguage('en')">{{$t('locale.en')}}</b-dropdown-item> | |
26 | + <b-dropdown-item href="#" | |
27 | + @click="changeLanguage('zh-hans')">{{$t('locale.zh-hans')}}</b-dropdown-item> | |
28 | + </b-nav-item-dropdown> | |
23 | 29 | </b-navbar-nav> |
24 | 30 | |
25 | - <b-nav-item-dropdown :text="selectedLanguage" right> | |
26 | - <b-dropdown-item href="#" @click="changeLanguage('en')">{{$t('locale.en')}}</b-dropdown-item> | |
27 | - <b-dropdown-item href="#" | |
28 | - @click="changeLanguage('zh-hans')">{{$t('locale.zh-hans')}}</b-dropdown-item> | |
29 | - </b-nav-item-dropdown> | |
31 | + | |
30 | 32 | </b-navbar-nav> |
31 | 33 | </b-collapse> |
32 | 34 | </b-navbar> |
... | ... | @@ -50,24 +52,25 @@ |
50 | 52 | mounted() { |
51 | 53 | var url = window.location.href; |
52 | 54 | var lang = this.getQueryString('lang'); |
53 | - console.log("地址携带语种",lang); | |
54 | - if(lang === "zh"){ | |
55 | + console.log("地址携带语种", lang); | |
56 | + if (lang === "zh") { | |
55 | 57 | this.$i18n.locale = 'zh-Hans'; |
56 | 58 | uni.setLocale('zh-Hans'); |
57 | 59 | this.selectedLanguage = `${this.$t('index.language')}:${this.$t('locale.zh-hans')}`; |
58 | - }else if(lang === "en"){ | |
60 | + } else if (lang === "en") { | |
59 | 61 | this.$i18n.locale = 'en'; |
60 | 62 | uni.setLocale('en'); |
61 | 63 | this.selectedLanguage = `${this.$t('index.language')}:${this.$t('locale.en')}`; |
62 | - }else{ | |
64 | + } else { | |
63 | 65 | let Localelang = uni.getLocale(); |
64 | - console.log("本地语言",Localelang); | |
65 | - this.selectedLanguage = Localelang == 'en'?`${this.$t('index.language')}:${this.$t('locale.en')}`:`${this.$t('index.language')}:${this.$t('locale.zh-hans')}` | |
66 | + console.log("本地语言", Localelang); | |
67 | + this.selectedLanguage = Localelang == 'en' ? `${this.$t('index.language')}:${this.$t('locale.en')}` : | |
68 | + `${this.$t('index.language')}:${this.$t('locale.zh-hans')}` | |
66 | 69 | } |
67 | 70 | }, |
68 | 71 | methods: { |
69 | 72 | getQueryString(key) { |
70 | - const url = new URL(decodeURIComponent(location.href)); | |
73 | + const url = new URL(decodeURIComponent(location.href)); | |
71 | 74 | return url.searchParams.get(key); |
72 | 75 | }, |
73 | 76 | handleClick(item) { |
... | ... | @@ -108,19 +111,20 @@ |
108 | 111 | width: 100vw; |
109 | 112 | background-color: #00AEAA; |
110 | 113 | } |
111 | - .nav-items{ | |
114 | + | |
115 | + .nav-items { | |
112 | 116 | background: #000; |
113 | 117 | } |
114 | - | |
115 | - .b-navCss{ | |
118 | + | |
119 | + .b-navCss { | |
116 | 120 | color: #fff; |
117 | 121 | } |
118 | - | |
119 | - #nav-collapse{ | |
122 | + | |
123 | + #nav-collapse { | |
120 | 124 | height: 100%; |
121 | 125 | } |
122 | 126 | |
123 | - .activeCSS{ | |
127 | + .activeCSS { | |
124 | 128 | /* background: rgba(255, 255, 255, 0.5); */ |
125 | 129 | /* color: #000 !important; */ |
126 | 130 | ... | ... |
mobile/pages/homePage/index.vue
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | <view class="tipsCss">{{$t('hdk.tips')}}</view> |
7 | 7 | <view class="flex-row"> |
8 | 8 | <b-input ref="inputField" class="inputCss" autofocus="autofocus" :placeholder="$t('hdk.placeholder')" |
9 | - @change="handleChange" @input="handleInput" v-model="SNcode"></b-input> | |
9 | + @change="handleChange" v-model="SNcode"></b-input> | |
10 | 10 | <!-- <input type="text"> --> |
11 | 11 | <b-button class="SearchBtnCss my-2 my-sm-0" size="sm" @click="search" |
12 | 12 | style="background:#00AEAA;">{{$t('hdk.search')}}</b-button> | ... | ... |
mobile/pages/product/index.vue
1 | 1 | <template> |
2 | 2 | <view class="containers"> |
3 | 3 | <topWindow :isHome="false" @item-click="handleItemClick"></topWindow> |
4 | + <goback></goback> | |
4 | 5 | <view class="ComponentsBody"> |
5 | - <view class="" v-if="current == 'productInformation'"> | |
6 | - <InformationModule v-if="informationData != null" :informationData="informationData" ></InformationModule> | |
6 | + <view class="productInformation" v-if="current == 'productInformation'"> | |
7 | + <InformationModule v-if="informationData != null" :informationData="informationData"> | |
8 | + </InformationModule> | |
7 | 9 | </view> |
8 | - <view class="" v-else-if="current == 'inspectionInformation'"> | |
10 | + <view class="inspectionInformation" v-else-if="current == 'inspectionInformation'"> | |
9 | 11 | <InspectionModule v-if="inspectionData != null" :inspectionData="inspectionData"></InspectionModule> |
10 | 12 | </view> |
11 | - <view class="" v-else-if="current == 'attachmentInformation'"> | |
13 | + <view class="attachmentInformation" v-else-if="current == 'attachmentInformation'"> | |
12 | 14 | <AuxiliaryModule v-if="auxiliaryData != null" :auxiliaryData="auxiliaryData"></AuxiliaryModule> |
13 | 15 | </view> |
16 | + <view class="repairReportBtnCss" @click="jumpService"> | |
17 | + <u-image src="/static/images/icon/repair.png" mode="witFix" :width="$isMobile?'100px':'200px'" | |
18 | + :height="$isMobile?'100px':'200px'"></u-image> | |
19 | + <text class="repairReportTextCss">{{$t("hdk.Repair")}}</text> | |
20 | + </view> | |
14 | 21 | </view> |
15 | - | |
22 | + | |
16 | 23 | </view> |
17 | 24 | </template> |
18 | 25 | |
19 | 26 | <script> |
20 | 27 | import config from '@/common/config.js' |
21 | - import { getProductFind } from '@/api/scan' | |
28 | + import { | |
29 | + getProductFind | |
30 | + } from '@/api/scan' | |
22 | 31 | import topWindow from "@/mobile/pages/component/topWindow.vue" |
32 | + import goback from "@/mobile/pages/component/goback.vue" | |
23 | 33 | import InformationModule from '@/mobile/pages/component/InformationModule.vue' |
24 | 34 | import InspectionModule from '@/mobile/pages/component/InspectionModule.vue' |
25 | 35 | import AuxiliaryModule from '@/mobile/pages/component/AuxiliaryModule.vue' |
... | ... | @@ -28,16 +38,18 @@ |
28 | 38 | InformationModule, |
29 | 39 | InspectionModule, |
30 | 40 | AuxiliaryModule, |
31 | - topWindow | |
41 | + topWindow, | |
42 | + goback | |
32 | 43 | }, |
33 | 44 | data() { |
34 | 45 | return { |
35 | - sn:"", | |
36 | - productObject:null, | |
37 | - informationData:null, | |
38 | - inspectionData:null, | |
39 | - auxiliaryData:null, | |
40 | - current:"productInformation" | |
46 | + sn: "", | |
47 | + productObject: null, | |
48 | + informationData: null, | |
49 | + inspectionData: null, | |
50 | + auxiliaryData: null, | |
51 | + repairInformation: null, | |
52 | + current: "productInformation" | |
41 | 53 | } |
42 | 54 | }, |
43 | 55 | computed: { |
... | ... | @@ -45,13 +57,13 @@ |
45 | 57 | }, |
46 | 58 | onLoad(data) { |
47 | 59 | console.log(data); |
48 | - if(data){ | |
60 | + if (data) { | |
49 | 61 | this.sn = data.sn; |
50 | 62 | } |
51 | 63 | this.initData() |
52 | 64 | }, |
53 | 65 | methods: { |
54 | - initData(){ | |
66 | + initData() { | |
55 | 67 | // uni.showLoading({title: '查询中...'}) |
56 | 68 | getProductFind(this.sn).then(res => { |
57 | 69 | uni.hideLoading() |
... | ... | @@ -61,159 +73,178 @@ |
61 | 73 | this.initializationMethod() |
62 | 74 | } else { |
63 | 75 | uni.showToast({ |
64 | - icon:'error', | |
76 | + icon: 'error', | |
65 | 77 | title: '网络错误', |
66 | 78 | }) |
67 | 79 | } |
68 | 80 | }) |
69 | 81 | }, |
70 | 82 | initializationMethod() { |
71 | - //重新组装产品信息数据 | |
72 | - this.informationData = { | |
73 | - lamp: this.productObject.productRespVO?.lamp || null, | |
74 | - lampPath: this.productObject.productRespVO?.lampPath || [require('@/static/images/noPhoto.png')], | |
75 | - sn: this.productObject.sn, | |
76 | - productName: this.productObject.productRespVO?.productName || null, | |
77 | - type: this.productObject.productRespVO?.type || null, | |
78 | - productionTime: this.productObject.productionTime, | |
79 | - productionUserName: this.productObject.productionUserName, | |
80 | - productDatasheet: this.productObject.productRespVO?.productDatasheet || null, | |
81 | - productDatasheetPath: this.productObject.productRespVO?.productDatasheetPath || [], | |
82 | - productManual: this.productObject.productRespVO?.productManual || null, | |
83 | - productManualPath: this.productObject.productRespVO?.productManualPath || [] | |
84 | - }; | |
85 | - console.log("产品信息",this.informationData); | |
86 | - //重新组装检验信息数据 | |
87 | - this.inspectionData = { | |
88 | - softwareVersion: this.productObject.softwareVersion, | |
89 | - hardwareVersion: this.productObject.hardwareVersion, | |
90 | - checkTime: this.productObject.checkTime, | |
91 | - type: this.productObject.productRespVO?.type || null, | |
92 | - power: this.productObject.power, | |
93 | - powerFactor: this.productObject.powerFactor, | |
94 | - tightnessCheckFile: this.productObject.tightnessCheckFile, | |
95 | - tightnessCheckFilePath: this.productObject.tightnessCheckFilePath, | |
96 | - lightIntensityPhoto: [], | |
97 | - lightIntensityFile: '' | |
98 | - }; | |
99 | - console.log("检验信息",this.inspectionData); | |
100 | - //重新组装附件信息数据 | |
101 | - this.auxiliaryData = this.productObject.attachmentRespVOList || []; | |
102 | - | |
103 | - | |
104 | - // console.log("重新组装检验信息", this.inspectionData); | |
105 | - if(this.productObject.attachmentRespVOList === null){ | |
106 | - this.auxiliaryData = []; | |
107 | - }else{ | |
108 | - this.auxiliaryData = this.productObject.attachmentRespVOList.map(obj => ({ ...obj, current: 0 })); | |
109 | - } | |
110 | - console.log("附件信息", this.auxiliaryData); | |
111 | - //产品数据转图片 | |
112 | - if (this.productObject && this.productObject.productRespVO) { | |
113 | - const productRespVO = this.productObject.productRespVO; | |
114 | - // console.log("灯具", productRespVO); | |
115 | - // const modifiedManuals = this.generateDownloadUrls(productRespVO.lamp); | |
116 | - // this.informationData.lamp = modifiedManuals; | |
117 | - this.generateDownloadUrls(productRespVO.lampPath) | |
118 | - .then(modifiedManuals => { | |
119 | - // console.log("灯具==>", modifiedManuals); | |
120 | - this.informationData.lampPath = modifiedManuals; | |
121 | - }) | |
122 | - .catch(error => { | |
123 | - console.error(error); | |
124 | - }); | |
125 | - } | |
126 | - //光强数据转图片 | |
127 | - if (this.productObject && this.productObject.lightIntensityPath) { | |
128 | - if (this.productObject.lightIntensityPath) { | |
129 | - this.generateDownloadUrls(this.productObject.lightIntensityPath) | |
130 | - .then(modifiedManuals => { | |
131 | - // console.log("光强==>", modifiedManuals); | |
132 | - this.inspectionData.lightIntensityPhoto = modifiedManuals.filter(url => this.isPicture(url)); | |
133 | - this.inspectionData.lightIntensityFile = modifiedManuals.filter(filename => !this.isPicture(filename) && filename.includes('.')); | |
134 | - // 在这里可以访问已更新的inspectionData.lightIntensityPhoto和inspectionData.lightIntensityFile的值 | |
135 | - }) | |
136 | - .catch(error => { | |
137 | - console.error(error); | |
138 | - }); | |
139 | - } | |
140 | - } | |
141 | - //附件信息转图片 | |
142 | - if (this.auxiliaryData) { | |
143 | - this.auxiliaryData.forEach(attachment => { | |
144 | - if (attachment.productPicturePath) { | |
145 | - this.generateDownloadUrls(attachment.productPicturePath) | |
146 | - .then(modifiedPictures => { | |
147 | - // console.log("附件图片==>", modifiedPictures); | |
148 | - attachment.productPicturePath = modifiedPictures; | |
149 | - }) | |
150 | - .catch(error => { | |
151 | - console.error(error); | |
152 | - }); | |
153 | - } | |
154 | - }); | |
155 | - } | |
156 | - | |
83 | + //重新组装产品信息数据 | |
84 | + this.informationData = { | |
85 | + lamp: this.productObject.productRespVO?.lamp || null, | |
86 | + lampPath: this.productObject.productRespVO?.lampPath || [require('@/static/images/noPhoto.png')], | |
87 | + sn: this.productObject.sn, | |
88 | + productName: this.productObject.productRespVO?.productName || null, | |
89 | + type: this.productObject.productRespVO?.type || null, | |
90 | + productionTime: this.productObject.productionTime, | |
91 | + productionUserName: this.productObject.productionUserName, | |
92 | + productDatasheet: this.productObject.productRespVO?.productDatasheet || null, | |
93 | + productDatasheetPath: this.productObject.productRespVO?.productDatasheetPath || [], | |
94 | + productManual: this.productObject.productRespVO?.productManual || null, | |
95 | + productManualPath: this.productObject.productRespVO?.productManualPath || [] | |
96 | + }; | |
97 | + console.log("产品信息", this.informationData); | |
98 | + | |
99 | + this.repairInformation = { | |
100 | + sn: this.productObject.sn, | |
101 | + productName: this.productObject.productRespVO?.productName || null, | |
102 | + type: this.productObject.productRespVO?.type || null | |
103 | + } | |
104 | + | |
105 | + //重新组装检验信息数据 | |
106 | + this.inspectionData = { | |
107 | + softwareVersion: this.productObject.softwareVersion, | |
108 | + hardwareVersion: this.productObject.hardwareVersion, | |
109 | + checkTime: this.productObject.checkTime, | |
110 | + type: this.productObject.productRespVO?.type || null, | |
111 | + power: this.productObject.power, | |
112 | + powerFactor: this.productObject.powerFactor, | |
113 | + tightnessCheckFile: this.productObject.tightnessCheckFile, | |
114 | + tightnessCheckFilePath: this.productObject.tightnessCheckFilePath, | |
115 | + lightIntensityPhoto: [], | |
116 | + lightIntensityFile: '' | |
117 | + }; | |
118 | + console.log("检验信息", this.inspectionData); | |
119 | + //重新组装附件信息数据 | |
120 | + this.auxiliaryData = this.productObject.attachmentRespVOList || []; | |
121 | + | |
122 | + | |
123 | + // console.log("重新组装检验信息", this.inspectionData); | |
124 | + if (this.productObject.attachmentRespVOList === null) { | |
125 | + this.auxiliaryData = []; | |
126 | + } else { | |
127 | + this.auxiliaryData = this.productObject.attachmentRespVOList.map(obj => ({ | |
128 | + ...obj, | |
129 | + current: 0 | |
130 | + })); | |
131 | + } | |
132 | + console.log("附件信息", this.auxiliaryData); | |
133 | + //产品数据转图片 | |
134 | + if (this.productObject && this.productObject.productRespVO) { | |
135 | + const productRespVO = this.productObject.productRespVO; | |
136 | + // console.log("灯具", productRespVO); | |
137 | + // const modifiedManuals = this.generateDownloadUrls(productRespVO.lamp); | |
138 | + // this.informationData.lamp = modifiedManuals; | |
139 | + this.generateDownloadUrls(productRespVO.lampPath) | |
140 | + .then(modifiedManuals => { | |
141 | + // console.log("灯具==>", modifiedManuals); | |
142 | + this.informationData.lampPath = modifiedManuals; | |
143 | + }) | |
144 | + .catch(error => { | |
145 | + console.error(error); | |
146 | + }); | |
147 | + } | |
148 | + //光强数据转图片 | |
149 | + if (this.productObject && this.productObject.lightIntensityPath) { | |
150 | + if (this.productObject.lightIntensityPath) { | |
151 | + this.generateDownloadUrls(this.productObject.lightIntensityPath) | |
152 | + .then(modifiedManuals => { | |
153 | + // console.log("光强==>", modifiedManuals); | |
154 | + this.inspectionData.lightIntensityPhoto = modifiedManuals.filter(url => this.isPicture( | |
155 | + url)); | |
156 | + this.inspectionData.lightIntensityFile = modifiedManuals.filter(filename => !this | |
157 | + .isPicture(filename) && filename.includes('.')); | |
158 | + // 在这里可以访问已更新的inspectionData.lightIntensityPhoto和inspectionData.lightIntensityFile的值 | |
159 | + }) | |
160 | + .catch(error => { | |
161 | + console.error(error); | |
162 | + }); | |
163 | + } | |
164 | + } | |
165 | + //附件信息转图片 | |
166 | + if (this.auxiliaryData) { | |
167 | + this.auxiliaryData.forEach(attachment => { | |
168 | + if (attachment.productPicturePath) { | |
169 | + this.generateDownloadUrls(attachment.productPicturePath) | |
170 | + .then(modifiedPictures => { | |
171 | + // console.log("附件图片==>", modifiedPictures); | |
172 | + attachment.productPicturePath = modifiedPictures; | |
173 | + }) | |
174 | + .catch(error => { | |
175 | + console.error(error); | |
176 | + }); | |
177 | + } | |
178 | + }); | |
179 | + } | |
180 | + | |
181 | + }, | |
182 | + jumpService() { | |
183 | + console.log(this.repairInformation); | |
184 | + uni.navigateTo({ | |
185 | + url: "/mobile/pages/product/repairReport?repairpObject=" + encodeURIComponent(JSON.stringify( | |
186 | + this.repairInformation)), | |
187 | + }) | |
157 | 188 | }, |
158 | 189 | generateDownloadUrls(filenames) { |
159 | - // console.log("filenames", filenames) | |
160 | - if (!filenames || filenames.length === 0) { | |
161 | - // 如果 filenames 为空或者null,则执行相应的操作 | |
162 | - return Promise.resolve(require('@/static/images/noPhoto.png')) | |
163 | - } | |
164 | - const modifiedFilenames = filenames.replace(/;+$/, ''); | |
165 | - const modifiedUrls = modifiedFilenames.split(";").map(filename => { | |
166 | - const trimmedFilename = filename.trim(); | |
167 | - if (trimmedFilename.endsWith('.png') || trimmedFilename.endsWith('.jpg')) { | |
168 | - // const encodedFilename = Buffer.from(trimmedFilename, 'utf-8').toString('base64'); | |
169 | - const url = config.fileUrl+`/${trimmedFilename}`; | |
170 | - // console.log(url); | |
171 | - return this.checkUrlValidity(url).catch(error => { | |
172 | - // console.error(error); | |
173 | - // console.log("请求失败", trimmedFilename) | |
174 | - return Promise.resolve(require('@/static/images/noPhoto.png')); | |
175 | - }); | |
176 | - } else if (trimmedFilename.includes('.')) { | |
177 | - return Promise.resolve(trimmedFilename); | |
178 | - } else { | |
179 | - return Promise.resolve(require('@/static/images/noPhoto.png')); | |
180 | - } | |
181 | - }); | |
182 | - | |
183 | - return Promise.all(modifiedUrls).then(results => { | |
184 | - const validUrls = results.filter(url => url !== null); | |
185 | - if (validUrls.length > 0) { | |
186 | - // console.log("有效地址",validUrls); | |
187 | - return validUrls; | |
188 | - } else { | |
189 | - return [require('@/static/images/noPhoto.png')]; | |
190 | - } | |
191 | - }); | |
190 | + // console.log("filenames", filenames) | |
191 | + if (!filenames || filenames.length === 0) { | |
192 | + // 如果 filenames 为空或者null,则执行相应的操作 | |
193 | + return Promise.resolve(require('@/static/images/noPhoto.png')) | |
194 | + } | |
195 | + const modifiedFilenames = filenames.replace(/;+$/, ''); | |
196 | + const modifiedUrls = modifiedFilenames.split(";").map(filename => { | |
197 | + const trimmedFilename = filename.trim(); | |
198 | + if (trimmedFilename.endsWith('.png') || trimmedFilename.endsWith('.jpg')) { | |
199 | + // const encodedFilename = Buffer.from(trimmedFilename, 'utf-8').toString('base64'); | |
200 | + const url = config.fileUrl + `/${trimmedFilename}`; | |
201 | + // console.log(url); | |
202 | + return this.checkUrlValidity(url).catch(error => { | |
203 | + // console.error(error); | |
204 | + // console.log("请求失败", trimmedFilename) | |
205 | + return Promise.resolve(require('@/static/images/noPhoto.png')); | |
206 | + }); | |
207 | + } else if (trimmedFilename.includes('.')) { | |
208 | + return Promise.resolve(trimmedFilename); | |
209 | + } else { | |
210 | + return Promise.resolve(require('@/static/images/noPhoto.png')); | |
211 | + } | |
212 | + }); | |
213 | + | |
214 | + return Promise.all(modifiedUrls).then(results => { | |
215 | + const validUrls = results.filter(url => url !== null); | |
216 | + if (validUrls.length > 0) { | |
217 | + // console.log("有效地址",validUrls); | |
218 | + return validUrls; | |
219 | + } else { | |
220 | + return [require('@/static/images/noPhoto.png')]; | |
221 | + } | |
222 | + }); | |
192 | 223 | }, |
193 | 224 | checkUrlValidity(url) { |
194 | - return new Promise((resolve, reject) => { | |
195 | - uni.request({ | |
196 | - url, | |
197 | - method: 'HEAD', | |
198 | - success(res) { | |
199 | - // console.log("检验地址",res); | |
200 | - if (res.statusCode >= 200 && res.statusCode < 400) { | |
201 | - resolve(url); // URL有效 | |
202 | - } else { | |
203 | - // console.log("地址无效"); | |
204 | - resolve(null); // URL无效 | |
205 | - } | |
206 | - }, | |
207 | - fail(err) { | |
208 | - reject(err); // 请求失败 | |
209 | - } | |
210 | - }); | |
211 | - }); | |
225 | + return new Promise((resolve, reject) => { | |
226 | + uni.request({ | |
227 | + url, | |
228 | + method: 'HEAD', | |
229 | + success(res) { | |
230 | + // console.log("检验地址",res); | |
231 | + if (res.statusCode >= 200 && res.statusCode < 400) { | |
232 | + resolve(url); // URL有效 | |
233 | + } else { | |
234 | + // console.log("地址无效"); | |
235 | + resolve(null); // URL无效 | |
236 | + } | |
237 | + }, | |
238 | + fail(err) { | |
239 | + reject(err); // 请求失败 | |
240 | + } | |
241 | + }); | |
242 | + }); | |
212 | 243 | }, |
213 | 244 | isPicture(str) { |
214 | - // 正则表达式判断是否为网址类型的字符串 | |
215 | - const pictureRegex = /\.(jpg|jpeg|png|gif)$/i; | |
216 | - return pictureRegex.test(str); | |
245 | + // 正则表达式判断是否为网址类型的字符串 | |
246 | + const pictureRegex = /\.(jpg|jpeg|png|gif)$/i; | |
247 | + return pictureRegex.test(str); | |
217 | 248 | }, |
218 | 249 | handleItemClick(item) { |
219 | 250 | this.current = item; |
... | ... | @@ -225,16 +256,77 @@ |
225 | 256 | </script> |
226 | 257 | |
227 | 258 | <style lang="scss" scoped> |
228 | - .containers{ | |
259 | + .containers { | |
229 | 260 | width: 100%; |
230 | 261 | height: 100%; |
231 | 262 | background: #F9FAF9; |
232 | 263 | } |
233 | - .ComponentsBody{ | |
234 | - width: 100vw; | |
235 | - display: flex; | |
236 | - justify-content: center; | |
237 | - align-items: center; | |
264 | + | |
265 | + .ComponentsBody { | |
266 | + // width:100%; | |
267 | + // display: flex; | |
268 | + // justify-content: center; | |
269 | + // align-items: center; | |
270 | + } | |
271 | + | |
272 | + // .productInformation{ | |
273 | + // width: 100%; | |
274 | + // } | |
275 | + | |
276 | + // .inspectionInformation{ | |
277 | + // width: 100%; | |
278 | + // } | |
279 | + | |
280 | + // .attachmentInformation{ | |
281 | + // width: 100%; | |
282 | + // } | |
283 | + | |
284 | + @media screen and (max-width: 767px) { | |
285 | + .repairReportBtnCss { | |
286 | + width: 100px; | |
287 | + height: 100px; | |
288 | + border-radius: 100px; | |
289 | + position: fixed; | |
290 | + display: flex; | |
291 | + flex-direction: column; | |
292 | + justify-content: center; | |
293 | + align-items: center; | |
294 | + right: 0; | |
295 | + bottom: 100px; | |
296 | + // background-color: #00aeaa; | |
297 | + } | |
298 | + | |
299 | + .repairReportTextCss { | |
300 | + position: absolute; | |
301 | + bottom: 30px; | |
302 | + color: #fff; | |
303 | + font-size: 10px; | |
304 | + } | |
238 | 305 | } |
239 | 306 | |
307 | + | |
308 | + | |
309 | + // //PC端样式 | |
310 | + @media screen and (min-width: 768px) { | |
311 | + .repairReportBtnCss { | |
312 | + width: 100px; | |
313 | + height: 100px; | |
314 | + border-radius: 100px; | |
315 | + position: fixed; | |
316 | + display: flex; | |
317 | + flex-direction: column; | |
318 | + justify-content: center; | |
319 | + align-items: center; | |
320 | + right: 20px; | |
321 | + bottom: 100px; | |
322 | + // background-color: #00aeaa; | |
323 | + } | |
324 | + | |
325 | + .repairReportTextCss { | |
326 | + position: absolute; | |
327 | + bottom: 15px; | |
328 | + color: #fff; | |
329 | + } | |
330 | + | |
331 | + } | |
240 | 332 | </style> |
241 | 333 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,432 @@ |
1 | +<template> | |
2 | + <view class="containers"> | |
3 | + <topWindow></topWindow> | |
4 | + <goback></goback> | |
5 | + <view class="content"> | |
6 | + <u-form labelPosition="top" labelAlign="left" :model="modal" :rules="rules" ref="uForm" | |
7 | + :labelStyle="{fonSize:'26px',color:'#8B91A4',paddingLeft:'10px'}"> | |
8 | + <view class="basicInformation"> | |
9 | + <view class="title">{{$t('hdk.Basicinformation')}}<text | |
10 | + style="color:#8B91A4;">{{$t('hdk.Required')}}</text></view> | |
11 | + <view class="uform"> | |
12 | + <u-form-item required :label="$t('hdk.SnCode')" labelWidth="50%" prop="formInfo.sn" borderBottom | |
13 | + ref="item1"> | |
14 | + <u-input v-model="modal.formInfo.sn" border="none"></u-input> | |
15 | + </u-form-item> | |
16 | + <u-form-item required :label="$t('hdk.ProductName')" labelWidth="50%" | |
17 | + prop="formInfo.productName" borderBottom ref="item2"> | |
18 | + <u-input v-model="modal.formInfo.productName" border="none"></u-input> | |
19 | + </u-form-item> | |
20 | + <u-form-item :label="$t('hdk.Model')" labelWidth="50%" prop="formInfo.type" borderBottom | |
21 | + ref="item3"> | |
22 | + <u-input v-model="modal.formInfo.type" border="none"></u-input> | |
23 | + </u-form-item> | |
24 | + </view> | |
25 | + </view> | |
26 | + <view class="basicInformation"> | |
27 | + <view class="title">{{$t('hdk.ProblemDescription')}}<text | |
28 | + style="color:#8B91A4;">{{$t('hdk.Required')}}</text></view> | |
29 | + <view class="textAreaCss"> | |
30 | + <u-textarea v-model="modal.formInfo.repairDescribe" count maxlength="200" | |
31 | + :placeholder="$t('hdk.DescriptionPlaceholder')"></u-textarea> | |
32 | + </view> | |
33 | + <view class="uploadCss"> | |
34 | + <u-upload upload-icon="plus" :fileList="modal.formInfo.fileList" @afterRead="afterRead" | |
35 | + @delete="deletePic" :previewFullImage="true" name="faultPicture" multiple :maxCount="5" | |
36 | + accept="image"></u-upload> | |
37 | + </view> | |
38 | + </view> | |
39 | + <view class="basicInformation"> | |
40 | + <view class="title">{{$t('hdk.ContactInformation')}}<text | |
41 | + style="color:#8B91A4;">{{$t('hdk.Required')}}</text></view> | |
42 | + <view class="uform"> | |
43 | + <u-form-item required :label="$t('hdk.AirportName')" labelWidth="50%" | |
44 | + prop="formInfo.airportName" borderBottom ref="item3"> | |
45 | + <u-input v-model="modal.formInfo.airportName" border="none"></u-input> | |
46 | + </u-form-item> | |
47 | + <u-form-item required :label="$t('hdk.Name')" labelWidth="50%" prop="formInfo.contactPersonName" | |
48 | + borderBottom ref="item4"> | |
49 | + <u-input v-model="modal.formInfo.contactPersonName" border="none"></u-input> | |
50 | + </u-form-item> | |
51 | + <u-form-item :label="$t('hdk.ContactInformation')" labelWidth="50%" prop="formInfo.phone" | |
52 | + borderBottom ref="item5"> | |
53 | + <u-input v-model="modal.formInfo.contactPersonPhone" border="none"></u-input> | |
54 | + </u-form-item> | |
55 | + <u-form-item required :label="$t('hdk.Email')" labelWidth="50%" prop="formInfo.email" | |
56 | + borderBottom ref="item6"> | |
57 | + <u-input v-model="modal.formInfo.email" border="none"></u-input> | |
58 | + </u-form-item> | |
59 | + <u-form-item :label="$t('hdk.DetailedAddress')" labelWidth="100%" prop="formInfo.address" | |
60 | + borderBottom ref="item7"> | |
61 | + <u-input v-model="modal.formInfo.address" border="none"></u-input> | |
62 | + </u-form-item> | |
63 | + </view> | |
64 | + </view> | |
65 | + </u-form> | |
66 | + <view class="submitBtn" @click="openModal()"> | |
67 | + {{$t('hdk.ConfirmAndReport')}} | |
68 | + </view> | |
69 | + <u-modal :show="confirmModal" :title="title" showCancelButton @confirm="submit()" | |
70 | + @cancel="confirmModal = false"> | |
71 | + <view class="slot-content"> | |
72 | + <rich-text class="contentTextCss" :nodes="content"></rich-text> | |
73 | + </view> | |
74 | + </u-modal> | |
75 | + <u-toast ref="uToast"></u-toast> | |
76 | + </view> | |
77 | + </view> | |
78 | +</template> | |
79 | + | |
80 | +<script> | |
81 | + import topWindow from "@/mobile/pages/component/topWindow.vue" | |
82 | + import goback from "@/mobile/pages/component/goback.vue" | |
83 | + import { | |
84 | + createAFaultReport | |
85 | + } from "@/api/scan.js" | |
86 | + import config from '@/common/config' | |
87 | + export default { | |
88 | + components: { | |
89 | + topWindow, | |
90 | + goback | |
91 | + }, | |
92 | + props: { | |
93 | + | |
94 | + }, | |
95 | + data() { | |
96 | + return { | |
97 | + modal: { | |
98 | + formInfo: { | |
99 | + sn: "", | |
100 | + productName: "", | |
101 | + type: "", | |
102 | + repairDescribe: "", | |
103 | + fileList: [], | |
104 | + picPath: "", | |
105 | + airportName: "", | |
106 | + contactPersonName: "", | |
107 | + contactPersonPhone: "", | |
108 | + email: "", | |
109 | + address: "", | |
110 | + } | |
111 | + }, | |
112 | + confirmModal: false, | |
113 | + title: "", | |
114 | + content: "", | |
115 | + rules: { | |
116 | + 'formInfo.sn': { | |
117 | + type: 'string', | |
118 | + required: true, | |
119 | + message: '请填写SN码', | |
120 | + trigger: ['blur', 'change'] | |
121 | + }, | |
122 | + 'formInfo.productName': { | |
123 | + type: 'string', | |
124 | + required: true, | |
125 | + message: '请填写产品名称', | |
126 | + trigger: ['blur', 'change'] | |
127 | + }, | |
128 | + 'formInfo.contactPersonName': { | |
129 | + type: 'string', | |
130 | + required: true, | |
131 | + message: '请填写名称', | |
132 | + trigger: ['blur', 'change'] | |
133 | + }, | |
134 | + 'formInfo.email': { | |
135 | + type: 'email', | |
136 | + required: true, | |
137 | + message: '请填写正确的邮箱', | |
138 | + trigger: ['blur', 'change'] | |
139 | + }, | |
140 | + 'formInfo.repairDescribe': { | |
141 | + type: 'string', | |
142 | + required: true, | |
143 | + message: '请填写描述或上传图片/视频', | |
144 | + trigger: ['blur', 'change'] | |
145 | + }, | |
146 | + 'formInfo.airportName': { | |
147 | + type: 'string', | |
148 | + required: true, | |
149 | + message: '请填写机场名', | |
150 | + trigger: ['blur', 'change'] | |
151 | + }, | |
152 | + }, | |
153 | + } | |
154 | + }, | |
155 | + computed: { | |
156 | + | |
157 | + }, | |
158 | + onReady() {}, | |
159 | + onLoad(data) { | |
160 | + if (data.repairpObject) { | |
161 | + const repairpObject = JSON.parse(decodeURIComponent(data.repairpObject)) | |
162 | + console.log(repairpObject); | |
163 | + this.modal.formInfo = { | |
164 | + ...this.modal.formInfo, | |
165 | + ...repairpObject | |
166 | + }; | |
167 | + console.log(this.modal.formInfo); | |
168 | + } | |
169 | + }, | |
170 | + methods: { | |
171 | + deletePic(event) { | |
172 | + this.modal.formInfo.fileList.splice(event.index, 1) | |
173 | + }, | |
174 | + async afterRead(event) { | |
175 | + console.log(event); | |
176 | + let lists = [].concat(event.file) | |
177 | + let data = this.modal.formInfo; | |
178 | + let fileListLen = data.fileList.length | |
179 | + lists.map((item) => { | |
180 | + data.fileList.push({ | |
181 | + ...item, | |
182 | + status: 'uploading', | |
183 | + message: '上传中' | |
184 | + }) | |
185 | + }) | |
186 | + for (let i = 0; i < lists.length; i++) { | |
187 | + const result = await this.uploadFilePromise(lists[i].url) | |
188 | + let item = data.fileList[fileListLen] | |
189 | + data.fileList.splice(fileListLen, 1, Object.assign(item, { | |
190 | + status: 'success', | |
191 | + message: '', | |
192 | + realUrl: result, | |
193 | + url: config.prefixUrl + result | |
194 | + })) | |
195 | + console.log(data.fileList); | |
196 | + fileListLen++ | |
197 | + } | |
198 | + }, | |
199 | + uploadFilePromise(url) { | |
200 | + console.log(url); | |
201 | + const filename = url.substring(url.indexOf('tmp/') + 4); | |
202 | + // return; | |
203 | + return new Promise((resolve, reject) => { | |
204 | + let a = uni.uploadFile({ | |
205 | + url: config.baseUrl + '/upload-file', // 仅为示例,非真实的接口地址 | |
206 | + header: { | |
207 | + 'tenant-id': '1', | |
208 | + 'Content-Type': 'multipart/form-data' | |
209 | + }, | |
210 | + filePath: url, | |
211 | + name: "file", | |
212 | + // formData: { | |
213 | + // user: 'test' | |
214 | + // }, | |
215 | + success: (res) => { | |
216 | + console.log(res); | |
217 | + let data = JSON.parse(res.data); | |
218 | + console.log(data); | |
219 | + if (data.code === 0) { | |
220 | + setTimeout(() => { | |
221 | + resolve(data.data) | |
222 | + }, 500) | |
223 | + } else { | |
224 | + reject("") | |
225 | + } | |
226 | + } | |
227 | + }); | |
228 | + }) | |
229 | + }, | |
230 | + openModal() { | |
231 | + this.title = "温馨提示"; | |
232 | + this.content = "确认提交此内容"; | |
233 | + this.confirmModal = true | |
234 | + }, | |
235 | + submit() { | |
236 | + console.log(this.modal.formInfo); | |
237 | + this.$refs.uForm.validate().then(res => { | |
238 | + let ohterValidate = this.checkOtherItems() | |
239 | + if (ohterValidate) { | |
240 | + // return | |
241 | + createAFaultReport(this.modal.formInfo).then(res => { | |
242 | + console.log(res); | |
243 | + if (res.code === 0) { | |
244 | + this.$refs.uToast.show({ | |
245 | + type: 'success', | |
246 | + message: "上报成功", | |
247 | + iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png', | |
248 | + complete() { | |
249 | + uni.navigateBack(1) | |
250 | + } | |
251 | + }) | |
252 | + } else if (res.code === 1400001001) { | |
253 | + this.$refs.uToast.show({ | |
254 | + type: 'error', | |
255 | + icon: false, | |
256 | + message: "请检查SN码是否正确", | |
257 | + iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png' | |
258 | + }) | |
259 | + } | |
260 | + }) | |
261 | + } else { | |
262 | + this.$refs.uToast.show({ | |
263 | + type: 'error', | |
264 | + icon: false, | |
265 | + message: "请填写描述或上传图片/视频", | |
266 | + iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png' | |
267 | + }) | |
268 | + } | |
269 | + }).catch(errors => { | |
270 | + this.$refs.uToast.show({ | |
271 | + type: 'error', | |
272 | + icon: false, | |
273 | + message: "检查未填项", | |
274 | + iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png' | |
275 | + }) | |
276 | + console.log(errors); | |
277 | + }) | |
278 | + this.confirmModal = false; | |
279 | + }, | |
280 | + checkOtherItems() { | |
281 | + let data = this.modal.formInfo; | |
282 | + if (data.repairDescribe === "" && data.fileList.length <= 0) { | |
283 | + // uni.$u.toast('描述或图片未上传'); | |
284 | + return false; | |
285 | + } | |
286 | + data.picPath = JSON.stringify(data.fileList.map(it => `${it.realUrl}`)); | |
287 | + // delete data.fileList; | |
288 | + console.log(data.picPath); | |
289 | + return true; | |
290 | + } | |
291 | + } | |
292 | + } | |
293 | +</script> | |
294 | + | |
295 | +<style lang="scss" scoped> | |
296 | + .containers { | |
297 | + display: flex; | |
298 | + flex-direction: column; | |
299 | + justify-content: center; | |
300 | + align-items: center; | |
301 | + background: #F2F4F3; | |
302 | + } | |
303 | + | |
304 | + | |
305 | + | |
306 | + .uform { | |
307 | + margin: 20px; | |
308 | + position:relative; | |
309 | + } | |
310 | + | |
311 | + .textAreaCss { | |
312 | + margin: 30px; | |
313 | + background-color: #f8f9fd; | |
314 | + } | |
315 | + | |
316 | + .uploadCss { | |
317 | + margin: 30px; | |
318 | + } | |
319 | + | |
320 | + /deep/.u-modal__title { | |
321 | + display: flex; | |
322 | + justify-content: center; | |
323 | + } | |
324 | + | |
325 | + | |
326 | + | |
327 | + //移动端样式 | |
328 | + @media screen and (max-width: 767px) { | |
329 | + .title { | |
330 | + width: 114px; | |
331 | + margin: 20px 0 0 15px; | |
332 | + font-size: 15px; | |
333 | + background-color: rgba(255, 255, 255, 0); | |
334 | + box-sizing: border-box; | |
335 | + font-family: '苹方 中等', '苹方', sans-serif; | |
336 | + color: #333333; | |
337 | + text-align: left; | |
338 | + } | |
339 | + .content{ | |
340 | + width: 100%; | |
341 | + } | |
342 | + | |
343 | + .basicInformation { | |
344 | + width: 95%; | |
345 | + height: auto; | |
346 | + padding: 2px; | |
347 | + border-radius: 10px; | |
348 | + background-color: #ffffff; | |
349 | + box-sizing: border-box; | |
350 | + margin: 10px 12px; | |
351 | + padding-bottom: 80px; | |
352 | + } | |
353 | + | |
354 | + .submitBtn { | |
355 | + width: 350px; | |
356 | + height: 40px; | |
357 | + padding: 2px; | |
358 | + margin: 24px; | |
359 | + position: fixed; | |
360 | + bottom: 0px; | |
361 | + display: flex; | |
362 | + justify-content: center; | |
363 | + align-items: center; | |
364 | + border-radius: 8px; | |
365 | + background-color: #00aeaa; | |
366 | + box-sizing: border-box; | |
367 | + font-family: '苹方 中等', '苹方', sans-serif; | |
368 | + color: #ffffff; | |
369 | + text-align: center; | |
370 | + line-height: normal; | |
371 | + } | |
372 | + } | |
373 | + | |
374 | + //PC端样式 | |
375 | + @media screen and (min-width: 768px) { | |
376 | + .title { | |
377 | + width: 228px; | |
378 | + margin: 40px 0 0 30px; | |
379 | + font-size: 30px; | |
380 | + background-color: rgba(255, 255, 255, 0); | |
381 | + box-sizing: border-box; | |
382 | + font-family: '苹方 中等', '苹方', sans-serif; | |
383 | + color: #333333; | |
384 | + text-align: left; | |
385 | + } | |
386 | + | |
387 | + .content{ | |
388 | + width: 80%; | |
389 | + position: relative; | |
390 | + } | |
391 | + | |
392 | + /deep/.u-form-item__body__left__content__label { | |
393 | + font-size: 22px; | |
394 | + } | |
395 | + | |
396 | + .basicInformation { | |
397 | + width: 100%; | |
398 | + height: auto; | |
399 | + padding: 2px; | |
400 | + border-radius: 20px; | |
401 | + background-color: #ffffff; | |
402 | + box-sizing: border-box; | |
403 | + margin: 20px 24px; | |
404 | + padding-bottom: 40px; | |
405 | + } | |
406 | + | |
407 | + .submitBtn { | |
408 | + width: 500px; | |
409 | + height: 39px; | |
410 | + padding: 2px; | |
411 | + position: fixed; | |
412 | + left: 0;right: 0; | |
413 | + bottom: 30px; | |
414 | + margin: 0 auto; | |
415 | + display: flex; | |
416 | + justify-content: center; | |
417 | + align-items: center; | |
418 | + border-radius: 4px; | |
419 | + background-color: #00aeaa; | |
420 | + box-sizing: border-box; | |
421 | + font-family: '苹方 中等', '苹方', sans-serif; | |
422 | + color: #ffffff; | |
423 | + text-align: center; | |
424 | + line-height: normal; | |
425 | + } | |
426 | + } | |
427 | + | |
428 | + .contentTextCss { | |
429 | + font-size: 30px; | |
430 | + color: #999999; | |
431 | + } | |
432 | +</style> | |
0 | 433 | \ No newline at end of file | ... | ... |
pages.json
... | ... | @@ -3,15 +3,15 @@ |
3 | 3 | { |
4 | 4 | "path": "mobile/pages/homePage/index", |
5 | 5 | "style": { |
6 | - "navigationStyle":"custom" | |
6 | + "navigationStyle": "custom" | |
7 | 7 | // "navigationBarTitleText": "%index.title%" |
8 | 8 | } |
9 | - },{ | |
9 | + }, { | |
10 | 10 | "path": "mobile/pages/product/index", |
11 | 11 | "style": { |
12 | - "navigationStyle":"custom" | |
12 | + "navigationStyle": "custom" | |
13 | 13 | } |
14 | - },{ | |
14 | + }, { | |
15 | 15 | "path": "mobile/pages/component/component", |
16 | 16 | "style": { |
17 | 17 | "navigationBarTitleText": "%index.component%", |
... | ... | @@ -20,12 +20,17 @@ |
20 | 20 | }, { |
21 | 21 | "path": "mobile/pages/product/scan", |
22 | 22 | "style": { |
23 | - "navigationStyle":"custom" | |
23 | + "navigationStyle": "custom" | |
24 | 24 | } |
25 | - },{ | |
25 | + }, { | |
26 | 26 | "path": "mobile/pages/product/invalidCode", |
27 | 27 | "style": { |
28 | - "navigationStyle":"custom" | |
28 | + "navigationStyle": "custom" | |
29 | + } | |
30 | + }, { | |
31 | + "path": "mobile/pages/product/repairReport", | |
32 | + "style": { | |
33 | + "navigationStyle": "custom" | |
29 | 34 | } |
30 | 35 | } |
31 | 36 | ], |
... | ... | @@ -56,4 +61,4 @@ |
56 | 61 | "navigationBarBackgroundColor": "#F8F8F8", |
57 | 62 | "backgroundColor": "#F8F8F8" |
58 | 63 | } |
59 | 64 | -} |
65 | +} | |
60 | 66 | \ No newline at end of file | ... | ... |
postcss.config.js
... | ... | @@ -9,7 +9,7 @@ module.exports = { |
9 | 9 | fontViewportUnit: 'px', // 字体使用的视口单位 |
10 | 10 | // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。 |
11 | 11 | // 下面配置表示类名中含有'keep-px'都不会被转换 |
12 | - selectorBlackList: ['keep-px'], | |
12 | + selectorBlackList: ['keep-px','u-modal','u-form-item'], | |
13 | 13 | minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换 |
14 | 14 | mediaQuery: false, // 媒体查询里的单位是否需要转换单位 |
15 | 15 | replace: true, // 是否直接更换属性值,而不添加备用属性 | ... | ... |
5.62 KB
27.1 KB