Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
8b973759
Commit
8b973759
authored
May 20, 2021
by
linwenqing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/test'
parents
a881e5b5
798236c6
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
488 additions
and
325 deletions
+488
-325
.env.dev.js
.env.dev.js
+2
-1
.env.js
.env.js
+3
-3
.env.prod.js
.env.prod.js
+2
-1
.env.test.js
.env.test.js
+2
-1
App.vue
src/App.vue
+1
-1
order.js
src/common/api/order.js
+5
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+26
-31
XhSelect.vue
src/components/createCom/XhSelect.vue
+36
-10
XhServiceMeasure.vue
src/components/createCom/XhServiceMeasure.vue
+38
-6
XhTime.vue
src/components/createCom/XhTime.vue
+15
-16
readme.md
src/components/take/readme.md
+8
-1
index.js
src/components/upload/index.js
+6
-4
index.js
src/config/index.js
+1
-1
index.vue
src/pages/mine/wallet/index.vue
+1
-1
statement.vue
src/pages/mine/wallet/statement.vue
+1
-1
complete.vue
src/pages/order/complete.vue
+205
-191
detail.vue
src/pages/order/detail.vue
+121
-47
list.vue
src/pages/photo/list.vue
+15
-8
No files found.
.env.dev.js
View file @
8b973759
...
...
@@ -9,6 +9,7 @@ const UNI_APP = {
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
argoDebugMode
:
1
}
module
.
exports
=
UNI_APP
;
.env.js
View file @
8b973759
;
(
function
()
{
let
NODE_ENV
=
'
prod
'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
NODE_ENV
=
'
test
'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
@@ -12,8 +12,8 @@
}
}
else
if
(
process
.
env
.
NODE_ENV
===
"production"
)
{
ENV_VAR
=
require
(
'./.env.prod.js'
);
//
ENV_VAR = require('./.env.test.js');
//
ENV_VAR = require('./.env.prod.js');
ENV_VAR
=
require
(
'./.env.test.js'
);
}
if
(
ENV_VAR
)
{
process
.
uniEnv
=
{};
...
...
.env.prod.js
View file @
8b973759
...
...
@@ -8,7 +8,8 @@ const UNI_APP = {
apiUrl
:
'https://system.banshouhui.com'
,
//java端域名请求头
},
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'https://qn-static.banshouhui.com'
qn_asset_url
:
'https://qn-static.banshouhui.com'
,
argoDebugMode
:
0
}
module
.
exports
=
UNI_APP
;
.env.test.js
View file @
8b973759
...
...
@@ -8,6 +8,7 @@ const UNI_APP = {
apiUrl
:
'https://system.dev.banshouhui.com'
,
//java端域名请求头
},
qn_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'https://qn-static.banshouhui.com'
qn_asset_url
:
'https://qn-static.banshouhui.com'
,
argoDebugMode
:
1
}
module
.
exports
=
UNI_APP
;
src/App.vue
View file @
8b973759
...
...
@@ -245,7 +245,7 @@ export default {
let
userInfo
=
{
mobile
:
user
.
mobile
,
userfrom_id
:
user
.
uid
,
userfrom
:
"
家维广场
"
,
userfrom
:
"
自营平台
"
,
avatar
:
user
.
avatar
,
nickname
:
user
.
nickname
,
username
:
user
.
username
,
...
...
src/common/api/order.js
View file @
8b973759
...
...
@@ -40,7 +40,10 @@ let orderApiFun = function(vm){
* 订单详情查询
*/
let
orderDetail
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/order/revision/'
+
vm
.
vuex_token
+
'/'
+
orderId
,
params
);
/**
* 结算详情查询
*/
let
querySettleByOrder
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/settle/'
+
vm
.
vuex_token
+
'/querySettleByOrder/'
+
orderId
,
params
);
/* 过程反馈查询接口 */
let
feedbackConfig
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/wxh-worker-rest/rest/order/v2/getFeedBack/'
+
vm
.
vuex_token
,
params
)
...
...
@@ -172,6 +175,7 @@ let orderApiFun = function(vm){
workerAppointment
,
maintainWorkerCheckin
,
orderDetail
,
querySettleByOrder
,
listOrderRecord
,
orderAccept
,
orderGan
,
...
...
src/components/createCom/XhFiles.vue
View file @
8b973759
...
...
@@ -2,10 +2,6 @@
<
template
>
<view>
<view
class=
"file-box"
>
<!--
<view
class=
"u-flex"
>
<view
class=
"txt u-flex-1"
>
{{
item
.
fieldsTitle
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
-->
<view
class=
"pics u-flex u-flex-wrap"
>
<view
class=
"img-list"
v-for=
"(item,index) in imgList"
:key=
"index"
>
<u-image
class=
"pic"
width=
"160"
height=
"160"
:src=
"item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'"
:border-radius=
"10"
@
click
.
stop=
"prviewImage(item,index)"
></u-image>
...
...
@@ -14,13 +10,14 @@
<view
class=
"icon-del rotate"
></view>
</view>
</view>
<view
class=
"img-list"
>
<slot></slot>
<!--
<view
class=
"img-list"
>
<u-image
class=
"pic"
width=
"160rpx"
height=
"160rpx"
:border-radius=
"10"
@
click=
"selectUpload"
:src=
"uploadImage"
></u-image>
</view>
</view>
-->
</view>
<
u-action-sheet
:list=
"list"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet
>
<
!--
<u-action-sheet
:list=
"list"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet>
--
>
</view>
<
take-photo
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:currentItem=
"currentItemDate"
></take-photo
>
<
!--
<take-photo
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:currentItem=
"currentItemDate"
></take-photo>
--
>
</view>
</
template
>
...
...
@@ -86,6 +83,26 @@
}
},
methods
:
{
setTmpValue
(
values
)
{
this
.
imgList
=
this
.
imgList
.
concat
(
values
)
const
dataValue
=
this
.
imgList
.
map
(
v
=>
v
.
src
)
this
.
valueChange
(
dataValue
)
},
setValue
()
{
const
dataValue
=
this
.
imgList
.
map
(
item
=>
item
.
src
)
this
.
valueChange
(
dataValue
)
},
prviewImage
(
item
,
index
)
{
uni
.
previewImage
({
urls
:
[
item
.
path
?
item
.
path
:
item
.
src
],
current
:
index
});
},
delFile
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
this
.
setValue
()
},
/*
selectUpload(){
if (this.imgList.length === 10) {
return this.$refs.uToast.show({
...
...
@@ -122,18 +139,6 @@
this.photograph()
this.getWatermark()
},
setTmpValue
(
values
)
{
this
.
imgList
=
this
.
imgList
.
concat
(
values
)
const
dataValue
=
values
.
map
(
v
=>
v
.
key
)
this
.
valueChange
(
dataValue
)
},
setValue
()
{
const
dataValue
=
[]
this
.
imgList
.
map
(
item
=>
{
dataValue
.
push
(
item
.
src
)
})
this
.
valueChange
(
dataValue
)
},
closeTake(val) {
if(val && val.length > 0){
// val.forEach(item=>{
...
...
@@ -164,16 +169,6 @@
// }
// uploader.qnFileUpload(options)
},
prviewImage
(
item
,
index
)
{
uni
.
previewImage
({
urls
:
[
item
.
path
?
item
.
path
:
item
.
src
],
current
:
index
});
},
delFile
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
this
.
setValue
()
},
photograph(){// 获取拍照规范接口
let self = this
let param = {"partnerCompanyId":self.partnerCompanyId,
...
...
@@ -201,7 +196,7 @@
console.log("获取水印备注异常",res.data.message)
}
});
}
}
*/
}
}
</
script
>
...
...
src/components/createCom/XhSelect.vue
View file @
8b973759
<!-- ******************* 单个下拉选择 ******************* -->
<
template
>
<view
class=
"xh-select"
:style=
"
{'width': fieldsWidth}">
<u-input
:value=
"text"
disabled
@
click=
"show=true"
:placeholder=
"placeholder"
:placeholder-style=
"placeholderStyle"
<
!--
<
u-input
:value=
"text"
disabled
@
click=
"show=true"
:placeholder=
"placeholder"
:placeholder-style=
"placeholderStyle"
:custom-style=
"customStyle"
:clearable=
"false"
></u-input>
<u-select
:list=
"settings"
v-model=
"show"
@
confirm=
"actionSheetCallback"
safe-area-inset-bottom
></u-select>
<u-icon
class=
"input-icon"
:name=
"show ? 'arrow-up' : 'arrow-down'"
></u-icon>
<u-icon
class=
"input-icon"
:name=
"show ? 'arrow-up' : 'arrow-down'"
></u-icon>
-->
<view
class=
"u-flex u-row-between picker-common"
>
<picker
mode=
"selector"
:value=
"index"
range-key=
"label"
:range=
"settings"
@
click=
"show = true"
@
change=
"pickerChange"
class=
"u-flex-1"
>
<view
class=
"txt"
>
{{
text
||
'请选择'
}}
</view>
</picker>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"show ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
</view>
</
template
>
...
...
@@ -26,7 +33,8 @@
},
data
()
{
return
{
show
:
false
show
:
false
,
index
:
''
}
},
computed
:
{
...
...
@@ -68,19 +76,25 @@
'font-size'
:
'26rpx'
,
'height'
:
'76rpx'
}
},
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
},
watch
:
{},
mounted
()
{},
methods
:
{
actionSheetCallback
(
event
)
{
const
id
=
event
[
0
].
value
actionSheetCallback
(
event
)
{
const
id
=
event
[
0
].
value
this
.
dataValue
=
id
this
.
valueChange
(
id
)
}
},
pickerChange
(
data
)
{
this
.
index
=
data
.
detail
.
value
const
id
=
this
.
item
.
fieldsOptions
[
this
.
index
].
key
this
.
dataValue
=
id
this
.
valueChange
(
id
)
},
}
}
</
script
>
...
...
@@ -95,5 +109,17 @@
color
:
#2272FF
;
}
}
.picker-common
{
min-height
:
35px
;
background-color
:
#F4F5F7
;
border-radius
:
6px
;
color
:
#333333
;
padding-left
:
10px
;
padding-right
:
12px
;
width
:
100%
;
height
:
38px
;
.txt
{
font-size
:
14px
;
}
}
</
style
>
src/components/createCom/XhServiceMeasure.vue
View file @
8b973759
<!-- ******************* 单级/多级 选择 ******************* -->
<
template
>
<view
class=
"picker-box"
:style=
"
{'width': fieldsWidth}">
<view
class=
"u-flex u-row-between text-view"
@
click=
"openPicker"
>
<
!--
<
view
class=
"u-flex u-row-between text-view"
@
click=
"openPicker"
>
<view
class=
"txt u-flex-1 text-title"
>
{{
text
||
''
}}
</view>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
<u-picker
v-model=
"showPicker"
range-key=
"label"
@
columnchange=
"columnchange"
:mode=
"isNotMulti?'selector':'multiSelector'"
@
confirm=
"pickerConfirm"
:range=
"settings"
></u-picker>
<u-picker
v-model=
"showPicker"
range-key=
"label"
@
columnchange=
"columnchange"
:mode=
"isNotMulti?'selector':'multiSelector'"
@
confirm=
"pickerConfirm"
:range=
"settings"
></u-picker>
-->
<view
class=
"u-flex u-row-between picker-common"
>
<picker
:mode=
"isNotMulti?'selector':'multiSelector'"
:value=
"index"
range-key=
"label"
:range=
"settings"
@
click=
"showPicker = true"
@
change=
"pickerChange"
class=
"txt u-flex-1"
>
<view>
{{
text
||
'请选择'
}}
</view>
</picker>
<u-icon
class=
"input-icon"
color=
"#2272FF"
:name=
"showPicker ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view>
<!-- :default-selector='[0, 1]' -->
<u-toast
ref=
"uToast"
/>
</view>
...
...
@@ -57,7 +63,8 @@
isNotMulti
:
true
,
showPicker
:
false
,
settings
:[],
measure
:[]
measure
:[],
index
:
''
}
},
computed
:
{
...
...
@@ -68,9 +75,9 @@
val
=
data
[
0
].
measureTypeName
+
"-"
+
data
[
0
].
measureName
}
return
val
},
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
},
watch
:
{
...
...
@@ -145,6 +152,18 @@
}
this
.
valueChange
(
JSON
.
stringify
(
result
))
},
pickerChange
(
data
)
{
this
.
showPicker
=
false
this
.
index
=
data
.
detail
.
value
let
result
=
[]
if
(
this
.
isMulti
){
// 维修
}
else
{
// 安装
result
.
push
(
this
.
measure
[
this
.
index
])
}
this
.
valueChange
(
JSON
.
stringify
(
result
))
},
columnchange
(
data
){
// // 树列改变时进行联动操作
// const {column ,index} = data
...
...
@@ -155,6 +174,19 @@
}
</
script
>
<
style
lang=
"scss"
scoped
>
.picker-common
{
min-height
:
35px
;
background-color
:
#F4F5F7
;
border-radius
:
6px
;
color
:
#333333
;
padding-left
:
10px
;
padding-right
:
12px
;
width
:
100%
;
height
:
38px
;
.txt
{
font-size
:
14px
;
}
}
.text-view
{
background-color
:
#F4F5F7
;
border-radius
:
12rpx
;
...
...
src/components/createCom/XhTime.vue
View file @
8b973759
<!-- ******************* 输入框 ******************* -->
<
template
>
<view
class=
"picker-box"
>
<view
class=
"u-flex u-row-between"
@
click=
"openPicker"
>
<!--
<view
class=
"txt"
>
{{
item
.
fieldsTitle
}}
</view>
-->
<!--
<view
class=
"u-flex u-row-between"
@
click=
"openPicker"
>
<view
class=
"txt u-flex-1"
>
{{
dataValue
||
'请选择时间'
}}
</view>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
-->
<!--
<u-picker
:params=
"params"
v-model=
"showPicker"
mode=
"time"
@
confirm=
"pickerConfirm"
></u-picker>
-->
<view
class=
"u-flex u-row-between"
>
<picker
mode=
"date"
:value=
"dataValue"
@
change=
"bindDateChange"
class=
"txt u-flex-1"
>
<view>
{{
dataValue
||
'请选择时间'
}}
</view>
</picker>
<u-icon
name=
"arrow-right"
color=
"#666"
size=
"28"
></u-icon>
</view>
<u-picker
:params=
"params"
v-model=
"showPicker"
mode=
"time"
@
confirm=
"pickerConfirm"
></u-picker>
<!--
<u-picker
v-model=
"showPicker"
:rangeKey=
"rangeKey"
@
columnchange=
"columnchange"
mode=
"multiSelector"
@
confirm=
"pickerConfirm"
:default-selector=
'[0, 1]'
:range=
"settings"
></u-picker>
-->
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhInput'
,
// 新建 input
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
...
...
@@ -29,19 +32,10 @@
minute
:
false
,
second
:
false
,
timestamp
:
true
,
}
}
},
computed
:
{
type
()
{
if
(
this
.
item
&&
this
.
item
.
fieldsType
==
'password'
)
{
return
this
.
item
.
fieldsType
}
else
{
return
'text'
}
},
date
:
'请选择'
,
}
},
watch
:
{},
mounted
()
{},
methods
:
{
openPicker
()
{
...
...
@@ -53,6 +47,11 @@
this
.
dataValue
=
dataValue
this
.
valueChange
(
dataValue
)
},
bindDateChange
:
function
(
e
)
{
const
value
=
e
.
target
.
value
this
.
dataValue
=
value
this
.
valueChange
(
value
)
}
}
}
</
script
>
...
...
src/components/take/readme.md
View file @
8b973759
...
...
@@ -17,7 +17,7 @@ uni.hideTabBar()
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: |
| up
date
| Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| up
load
| Boolean | true | true/false | 是否默认上传 true:会自动上传好图片并返回绝对路径 false: 只返回临时路径,需要在父组件做上传动作 |
| num | Number | 10 | 1-10 | 拍照数量,只能传1-10的正整数 |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID
**格式见下文**
|
...
...
@@ -67,10 +67,12 @@ uni.hideTabBar()
```
javascript
import
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
// upload为false时需加上
export
default
{
components
:
{
'take-photo'
:
takePhoto
},
mixins
:
[
baseFile
],
// upload为false时需加上
data
()
{
return
{
takeStatus
:
false
,
...
...
@@ -86,6 +88,11 @@ export default {
// 拍照完成或关闭相机
closeTake
(
images
)
{
this
.
takeStatus
=
false
// upload为false时处理
const
files
=
images
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
console
.
log
(
"value"
,
value
)
}
}
}
...
...
src/components/upload/index.js
View file @
8b973759
...
...
@@ -48,10 +48,11 @@ export default {
async
saveToTask
(
files
)
{
// 生成key返回,然后把key放到异步上传的任务队列
let
lists
=
files
.
map
(
v
=>
{
const
key
=
randomChar
(
10
)
return
{
key
:
randomChar
(
10
)
,
key
:
key
,
path
:
v
,
src
:
''
src
:
key
}
})
// for (let i = 0; i < files.length; i++) {
...
...
@@ -92,10 +93,11 @@ export default {
tempFilePath
:
path
,
success
(
e
)
{
const
{
savedFilePath
}
=
e
const
key
=
randomChar
(
10
)
const
img
=
{
key
:
randomChar
(
10
)
,
key
:
key
,
path
:
savedFilePath
,
src
:
''
src
:
key
}
resolve
(
img
)
},
...
...
src/config/index.js
View file @
8b973759
...
...
@@ -7,7 +7,7 @@ let argo ={
1 开启调试模式,数据不入库。类型:Number。
2 开启调试模式,数据入库。类型:Number。
*/
debugMode
:
0
,
debugMode
:
process
.
uniEnv
.
argoDebugMode
,
autoTrack
:
true
,
uploadURL
:
'https://argo.banshouhui.com/'
}
...
...
src/pages/mine/wallet/index.vue
View file @
8b973759
...
...
@@ -148,7 +148,7 @@
},
handleClickCell
(
orderId
)
{
this
.
$u
.
route
({
url
:
'pages/order/detail'
,
url
:
'pages/order/detail
?isFromMine=1
'
,
params
:
{
id
:
orderId
}
...
...
src/pages/mine/wallet/statement.vue
View file @
8b973759
...
...
@@ -107,7 +107,7 @@
handleClickCell
(
orderId
)
{
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
url
:
'pages/order/detail?i
sFromMine=1&i
d='
+
orderId
})
},
async
loadStatement
()
{
...
...
src/pages/order/complete.vue
View file @
8b973759
...
...
@@ -11,83 +11,86 @@
<text
class=
"u-line-1"
>
{{
item
.
name
}}
</text>
</view>
</scroll-view>
<view
class=
"right-boxs"
>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
</scroll-view>
<view
class=
"form-list"
@
touchmove=
"handleTouchstart"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:key=
"groupIndex"
v-show=
"current == groupIndex"
>
<view
class=
"title"
v-if=
"groupItem.name !== '基本信息'"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'
&&
item.formType!=='form'
&&
item.formType!=='label'">
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"item.formType==='input'"
:groupIndex=
"groupIndex"
:type=
"item.inputType"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-multi-input
v-else-if=
"item.formType==='multiinput'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-else-if=
"item.formType==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-else-if=
"item.formType==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-else-if=
"item.formType==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-files
v-else-if=
"item.formType==='file'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:partnerCompanyId=
"partnerCompanyId"
:categoryId=
"categoryId"
:value=
'form[item.fieldsName] || []'
@
value-change=
"fieldValueChange"
>
</xh-files>
<xh-location
v-else-if=
"item.formType==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-location>
<xh-scan
v-else-if=
"item.formType==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"item.formType==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"item.formType==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
@
value-change=
"fieldValueChange"
>
</xh-service-measure>
<xh-time
v-else-if=
"item.formType==='time'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-time>
<xh-service-more
v-else-if=
"item.formType==='form'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-label>
</
template
>
</u-form-item>
</view>
</view>
</template>
</u-form>
</view>
</view>
<scroll-view
:scroll-top=
"scrollRightTop"
:enhanced=
"true"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:key=
"groupIndex"
>
<view
class=
"title"
v-if=
"groupItem.name !== '基本信息'"
>
{{
groupItem
.
name
}}
</view>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'
&&
item.formType!=='form'
&&
item.formType!=='label'">
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
<template
v-if=
"item.fieldsType"
>
<xh-input
v-if=
"item.formType==='input'"
:groupIndex=
"groupIndex"
:type=
"item.inputType"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-input>
<xh-multi-input
v-else-if=
"item.formType==='multiinput'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-multi-input>
<xh-radio
v-else-if=
"item.formType==='radio'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-radio>
<xh-checkbox
v-else-if=
"item.formType==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-else-if=
"item.formType==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-select>
<view
v-else-if=
"item.formType==='file'"
>
<xh-files
:ref=
"`fileChild$
{itemIndex}`"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
<template
v-slot
>
<view
class=
"img-list"
>
<u-image
class=
"pic"
width=
"160rpx"
height=
"160rpx"
:border-radius=
"10"
@
click=
"selectUpload(JSON.stringify(item), groupIndex, itemIndex)"
:src=
"uploadImage"
></u-image>
</view>
</
template
>
</xh-files>
</view>
<xh-location
v-else-if=
"item.formType==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-location>
<xh-scan
v-else-if=
"item.formType==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"item.formType==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"item.formType==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
@
value-change=
"fieldValueChange"
>
</xh-service-measure>
<xh-time
v-else-if=
"item.formType==='time'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-time>
<xh-service-more
v-else-if=
"item.formType==='form'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-label>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view>
<view
:class=
"['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]"
>
...
...
@@ -106,10 +109,11 @@
</view>
</view>
<u-toast
ref=
"uToast"
/>
<take-photo
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:currentItem=
"currentItemDate"
></take-photo>
<u-action-sheet
:list=
"carmeraList"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet>
</view>
</template>
<
script
>
import
classifyData
from
'@/common/classify.data.js'
;
import
XhInput
from
'@/components/createCom/XhInput.vue'
import
XhMultiInput
from
'@/components/createCom/XhMultiInput.vue'
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
...
...
@@ -123,6 +127,8 @@
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
;
import
XhLabel
from
"../../components/createCom/XhLabel"
;
import
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
;
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
...
...
@@ -141,39 +147,12 @@
menuHeight
:
0
,
// 左边菜单的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
groupList
:
classifyData
,
// 基本信息、安装 、勘察(其中一项表单数据)
menuItemPos
:
[],
arr
:
[],
scrollRightTop
:
0
,
// 右边栏目scroll-view的滚动条高度
timer
:
null
,
// 定时器
form
:
{
// 一维表单
},
rules
:
{
name
:
[{
required
:
true
,
min
:
10
,
message
:
'姓名不能为空'
,
// 可以单个或者同时写两个触发验证方式
trigger
:
[
'change'
,
'blur'
],
}],
mobile
:
[{
required
:
true
,
min
:
10
,
message
:
'姓名不能为空'
,
// 可以单个或者同时写两个触发验证方式
trigger
:
[
'change'
,
'blur'
],
},
{
// 自定义验证函数,见上说明
validator
:
(
rule
,
value
,
callback
)
=>
{
// 上面有说,返回true表示校验通过,返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
return
this
.
$u
.
test
.
mobile
(
value
);
},
message
:
'手机号码不正确'
,
// 触发器可以同时用blur和change
trigger
:
[
'change'
,
'blur'
],
}]
},
submitBtnStatus
:
false
,
completeCheckStatus
:
false
,
completeCheckResult
:
[],
...
...
@@ -181,6 +160,19 @@
waitHandlerGroupIndex
:
0
,
waitHandlerEleIndex
:
0
,
pass
:
false
,
// 上传组件相关
carmeraList
:
[
{
text
:
'相册'
},
{
text
:
'拍照'
}
],
maskShow
:
false
,
takeStatus
:
false
,
currentItemDate
:{},
photoItem
:
{}
}
},
components
:
{
...
...
@@ -196,8 +188,10 @@
XhTime
,
XhServiceMeasure
,
XhServiceMore
,
XhLabel
XhLabel
,
'take-photo'
:
takePhoto
},
mixins
:
[
baseFile
],
created
()
{
// console.log(allComponents,'allComponents')
},
...
...
@@ -218,7 +212,6 @@
this
.
getCompleteData
()
},
onReady
()
{
this
.
$refs
.
uForm
.
setRules
(
this
.
rules
);
// 导航栏滚动切换
this
.
getMenuItemTop
()
},
...
...
@@ -229,6 +222,9 @@
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
},
uploadImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'upload-file.png'
},
buttonStyle
()
{
return
{
'color'
:
'#FFFFFF'
,
...
...
@@ -463,8 +459,8 @@
locationCompleteItem
(
panelIndex
,
groupIndex
,
eleIndex
){
// 页面定位到某一项
this
.
tabIndex
=
panelIndex
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
scrollRightTop
=
0
this
.
current
=
groupIndex
this
.
$nextTick
(
function
()
{
this
.
swichMenu
(
groupIndex
)
})
...
...
@@ -572,88 +568,92 @@
})
}
},
// inputType(type) {
// var inputType = ''
// let ty = type.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// inputType = 'textarea'
// break
// case 'password':
// inputType = ty
// break
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// inputType = 'digit'
// break
// case 'textarea':
// default:
// inputType = 'text'
// break
// }
// return inputType
// },
// typeToComponentType(type) {
// // 将fieldType类型统一转换为公共组件判定类型
// let formType = ''
// type = type.toLocaleLowerCase()
// switch (type) {
// case 'text':
// case 'password':
// case 'textarea':
// case 'number':
// case 'decimal':
// case 'double':
// case 'integer':
// formType = 'input'
// break
// case 'multiinput':
// formType = 'multiinput'
// break;
// case 'select':
// case 'specifications':
// formType = 'select'
// break
// case 'radio':
// formType = 'radio'
// break
// case 'checkbox':
// formType = 'checkbox'
// break
// case 'file':
// case 'photos':
// formType = 'file'
// break
// case 'location':
// formType = 'location'
// break
// case 'scan':
// case 'machine_code':
// formType = 'scan'
// break
// case 'picker':
// case 'mutipicker':
// formType = 'picker'
// break
// case 'service_measures':
// formType = 'servicemeasure'
// break
// case 'time':
// case 'date':
// formType = 'time'
// break
// case 'form':
// formType = 'form'
// break
// case 'label':
// formType = 'label'
// break
// }
// return formType
// },
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload
(
item
,
groupIndex
,
itemIndex
){
const
imgList
=
this
.
$refs
[
`fileChild
${
itemIndex
}
`
][
0
].
imgList
if
(
imgList
.
length
===
10
)
{
return
this
.
$refs
.
uToast
.
show
({
title
:
'图片已超出最大数量'
,
type
:
'error'
,
})
}
this
.
photoItem
=
{
...
JSON
.
parse
(
item
),
groupIndex
,
itemIndex
,
}
// 弹窗展示
this
.
maskShow
=
true
},
// 区分上传动作
uploadSelect
(
index
)
{
if
(
index
===
0
)
{
this
.
uploadFile
(
'photo'
)
}
else
{
this
.
uploadFile
()
}
},
// 拍照回调
async
closeTake
(
val
)
{
if
(
val
&&
val
.
length
>
0
){
const
files
=
val
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
this
.
$refs
[
`fileChild
${
this
.
photoItem
.
itemIndex
}
`
][
0
].
setTmpValue
(
value
)
}
this
.
takeStatus
=
false
},
// 上传图片
async
uploadFile
(
type
){
const
self
=
this
if
(
type
&&
type
===
'photo'
){
// 直接打开相册
let
options
=
{
sourceType
:[
'album'
],
//['album', 'camera']
count
:
3
,
sizeType
:
[
'compressed'
]
}
const
value
=
await
this
.
chooseImg
(
options
)
self
.
$refs
[
`fileChild
${
self
.
photoItem
.
itemIndex
}
`
][
0
].
setTmpValue
(
value
)
return
}
// 使用拍照工具拍摄
this
.
photograph
()
this
.
getWatermark
()
},
// 获取拍照规范
photograph
(){
let
self
=
this
let
param
=
{
"partnerCompanyId"
:
this
.
partnerCompanyId
,
"categoryId"
:
this
.
categoryId
,
"brandId"
:
this
.
brandId
,
"fieldName"
:
this
.
photoItem
.
fieldsName
}
this
.
$u
.
api
.
orderStandardItem
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
.
length
>
0
)
{
self
.
currentItemDate
=
res
.
data
[
0
]
}
else
{
console
.
log
(
"获取完工项的拍照标准异常"
,
res
.
data
.
message
)
}
self
.
takeStatus
=
true
})
},
// 获取水印
getWatermark
(){
if
(
getApp
().
globalData
.
photo
.
waterSetting
){
return
}
var
data
=
{
partnerCompanyId
:
this
.
partnerCompanyId
}
this
.
$u
.
api
.
getWatermark
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
getApp
().
globalData
.
photo
.
waterSetting
=
res
.
data
}
else
{
console
.
log
(
"获取水印备注异常"
,
res
.
data
.
message
)
}
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async
swichMenu
(
index
)
{
...
...
@@ -965,4 +965,18 @@
font-size
:
32rpx
;
font-weight
:
bold
;
}
.img-list
{
position
:
relative
;
margin
:
8rpx
;
width
:
160rpx
;
height
:
160rpx
;
.pic
{
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
}
</
style
>
src/pages/order/detail.vue
View file @
8b973759
...
...
@@ -72,10 +72,29 @@
</view>
<!--
</u-read-more>
-->
</view>
<view
class=
"card appoint-item"
v-show=
"showTimeSelect"
>
<appoint-time
:dateList=
"dateList"
:timeList=
"timeList"
@
dateChange=
"dateChange"
@
timeChange=
"timeChange"
@
weekChange=
"weekChange"
></appoint-time>
<!-- 从我的页面进来显示计算信息 -->
<view
v-if=
"isFromMine"
class=
"settlement-view"
>
<view
class=
"settlement-title"
>
结算信息
</view>
<view
class=
"settlement-content"
>
<text
class=
"content-left"
>
工单确认时间:
</text>
<text>
{{
settlementInfo
.
formatTime
}}
</text>
</view>
<view
class=
"settlement-content"
v-for=
"(item, index) in settlementInfo.list"
:key=
"index"
>
<text
class=
"content-left"
>
{{
item
.
businessSettlementType
+
':'
}}
</text>
<text>
{{
(
item
.
realSettlementAmount
||
item
.
settlementAmount
)
+
'元'
}}
</text>
<text
v-if=
"item.adjustmentRemark"
>
{{
'-'
+
item
.
adjustmentRemark
}}
</text>
</view>
<view
class=
"settlement-content"
>
<text
class=
"content-left"
>
最终结算金额:
</text>
<text>
{{
settlementInfo
.
amount
}}
元
</text>
</view>
</view>
<view
class=
"card order-item record-item"
>
<!-- 其他页面进来 -->
<view
v-else
>
<view
class=
"card appoint-item"
v-show=
"showTimeSelect"
>
<appoint-time
:dateList=
"dateList"
:timeList=
"timeList"
@
dateChange=
"dateChange"
@
timeChange=
"timeChange"
@
weekChange=
"weekChange"
></appoint-time>
</view>
<view
class=
"card order-item record-item"
>
<view
class=
"top-item"
>
<text
class=
"title"
>
履约记录
</text>
</view>
...
...
@@ -113,53 +132,57 @@
<view
v-else
style=
"height: 10rpx;"
></view>
</view>
</view>
</view>
<view
v-if=
"showCenterBtn"
class=
"toolbar"
>
<!-- 背景,内容,请求接口 根据状态不同改变
{{
operationDoing
[
order
.
orderStatus
].
background
}}
-->
<!-- 过程反馈 -->
<view
class=
"left"
>
<view
v-if=
"allowFeedback"
@
click=
"clickFeedback"
class=
"button"
>
<text>
反馈
</text>
</view>
</view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view
class=
"center"
>
<view>
<u-toast
ref=
"uToast"
/>
</view>
<!-- 不是从我的页面进来不用显示 -->
<template
v-if=
"!isFromMine"
>
<view
v-if=
"showCenterBtn"
class=
"toolbar"
>
<!-- 背景,内容,请求接口 根据状态不同改变
{{
operationDoing
[
order
.
orderStatus
].
background
}}
-->
<!-- 过程反馈 -->
<view
class=
"left"
>
<view
v-if=
"allowFeedback"
@
click=
"clickFeedback"
class=
"button"
>
<text>
反馈
</text>
</view>
</view>
<view
v-if=
"showCenterBtn"
@
click=
"$u.throttle(handleBtn, 500)"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<text>
{{
centerButtonText
}}
</text>
<view
v-if=
"order.currentOverTime && showTimeOut"
class=
"time-view"
>
<text
style=
"padding-right: 8rpx;"
>
{{
order
.
currentOverTime
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</text>
<u-count-down
:timestamp=
"timestampDiff(order.currentOverTime)"
font-size=
"20"
color=
"#FFFFFF"
bg-color=
"transparent"
separator-color=
"#FFFFFF"
separator-size=
"20"
:ref=
"'uCountDown'"
show-days
height=
"20"
:show-days=
"threeDays()"
:show-minutes=
"!threeDays()"
:show-seconds=
"!threeDays()"
:separator=
"threeDays() ? 'zh' : 'colon'"
@
change=
"timeOutChange(order.currentOverTime)"
>
</u-count-down>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view
class=
"center"
>
<view>
<u-toast
ref=
"uToast"
/>
</view>
<view
v-if=
"showCenterBtn"
@
click=
"$u.throttle(handleBtn, 500)"
class=
"button"
:class=
"['center-button-view', btnClass]"
>
<text>
{{
centerButtonText
}}
</text>
<view
v-if=
"order.currentOverTime && showTimeOut"
class=
"time-view"
>
<text
style=
"padding-right: 8rpx;"
>
{{
order
.
currentOverTime
>
new
Date
().
getTime
()?
'剩'
:
'超'
}}
</text>
<u-count-down
:timestamp=
"timestampDiff(order.currentOverTime)"
font-size=
"20"
color=
"#FFFFFF"
bg-color=
"transparent"
separator-color=
"#FFFFFF"
separator-size=
"20"
:ref=
"'uCountDown'"
show-days
height=
"20"
:show-days=
"threeDays()"
:show-minutes=
"!threeDays()"
:show-seconds=
"!threeDays()"
:separator=
"threeDays() ? 'zh' : 'colon'"
@
change=
"timeOutChange(order.currentOverTime)"
>
</u-count-down>
</view>
</view>
</view>
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view
class=
"right"
>
<view
v-if=
"errorSignIn || scenePhoto"
@
click=
"$u.throttle(handleClickRight, 500)"
:class=
"['button',
{'active': scenePhoto}]">
<text
:style=
"errorSignIn ? 'font-size:24rpx' : ''"
>
{{
errorSignIn
?
'异常
\
n签到'
:
'拍照'
}}
</text>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view
class=
"right"
>
<view
v-if=
"errorSignIn || scenePhoto"
@
click=
"$u.throttle(handleClickRight, 500)"
:class=
"['button',
{'active': scenePhoto}]">
<text
:style=
"errorSignIn ? 'font-size:24rpx' : ''"
>
{{
errorSignIn
?
'异常
\
n签到'
:
'拍照'
}}
</text>
</view>
</view>
</view>
</view
>
<take-photo
type=
"test"
v-if=
"takeStatus"
@
close=
"closeTake"
:num=
"1"
></take-photo
>
<
PopView
title=
"查看交互规范"
message=
"为完善交付质量,请查看对应的交付规范"
:visible
.
sync=
"visibale"
@
click=
"handleClick"
/
>
<take-photo
type=
"test"
v-if=
"takeStatus"
@
close=
"closeTake"
:num=
"1"
></take-photo
>
<PopView
title=
"查看交互规范"
message=
"为完善交付质量,请查看对应的交付规范"
:visible
.
sync=
"visibale"
@
click=
"handleClick"
/
>
<
/
template
>
</view>
</template>
...
...
@@ -237,7 +260,9 @@
showTimeOut
:
true
,
clicking
:
false
,
dateItem
:
null
,
centerBtnDisabled
:
false
centerBtnDisabled
:
false
,
isFromMine
:
false
,
settlementInfo
:
{
formatTime
:
'-'
,
list
:
[],
amount
:
''
}
}
},
onLoad
(
option
)
{
...
...
@@ -246,9 +271,17 @@
this
.
orderId
=
option
.
id
}
this
.
loadOrderDetail
()
this
.
loadOrderRecord
()
this
.
getLocation
()
this
.
getSignDistance
()
if
(
option
&&
option
.
isFromMine
)
{
this
.
isFromMine
=
true
// 获取结算信息
this
.
loadSettlement
()
}
else
{
this
.
loadOrderRecord
()
this
.
getSignDistance
()
}
},
onHide
()
{
this
.
closeLocationChange
()
...
...
@@ -295,7 +328,7 @@
address
+=
self
.
order
.
contactAddress
||
""
}
return
address
}
,
}
},
methods
:
{
openLocation
(
address
){
...
...
@@ -404,6 +437,26 @@
if
(
self
.
order
.
isFirstOrder
){
this
.
visibale
=
true
}
// 格式化时间
this
.
settlementInfo
.
formatTime
=
this
.
order
.
settleCenterSyncDatetime
?
this
.
$u
.
timeFormat
(
this
.
order
.
settleCenterSyncDatetime
,
'yyyy.mm.dd hh:MM:ss'
)
:
'-'
}
else
{
console
.
log
(
res
.
message
,
"获取订单详情失败!"
);
}
});
},
loadSettlement
()
{
// 获取工单详情
let
self
=
this
var
data
=
{
'orderId'
:
self
.
orderId
};
self
.
$u
.
api
.
querySettleByOrder
(
data
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
var
amount
=
0
for
(
var
item
of
res
.
data
)
{
amount
+=
(
item
.
realSettlementAmount
||
item
.
settlementAmount
)
}
this
.
settlementInfo
.
amount
=
amount
this
.
settlementInfo
.
list
=
res
.
data
}
else
{
console
.
log
(
res
.
message
,
"获取订单详情失败!"
);
}
...
...
@@ -1137,4 +1190,25 @@
text-align
:
left
;
flex-shrink
:
0
;
}
.settlement-view
{
padding
:
30rpx
;
background-color
:
#FFFFFF
;
border-radius
:
12rpx
;
.settlement-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
margin-bottom
:
30rpx
;
}
.settlement-content
{
font-size
:
26rpx
;
color
:
#333333
;
margin-bottom
:
20rpx
;
display
:
flex
;
align-items
:
flex-start
;
.content-left
{
flex-shrink
:
0
;
}
}
}
</
style
>
src/pages/photo/list.vue
View file @
8b973759
...
...
@@ -29,7 +29,7 @@
</view>
</
template
>
</scroll-view>
<take-photo
type=
"test"
v-if=
"takeStatus
"
:currentItem=
"currentItemDate"
@
close=
"closeTake"
></take-photo>
<take-photo
type=
"test"
v-if=
"takeStatus"
:upload=
"false
"
:currentItem=
"currentItemDate"
@
close=
"closeTake"
></take-photo>
<!-- <u-button v-if="activeTop + 1 === dataList.length" class="ph-list-button" type="error" shape="circle"
:disabled="buttonDisabled" :custom-style="buttonStyle" @click="isPopShow = true">一键清空展示图片</u-button> -->
</view>
...
...
@@ -57,6 +57,7 @@
<
script
>
import
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
;
export
default
{
components
:
{
'take-photo'
:
takePhoto
...
...
@@ -81,6 +82,7 @@
title
:
'全部'
}
},
mixins
:
[
baseFile
],
onLoad
(
e
)
{
getApp
().
trackPage
(
'照片规范列表页'
)
if
(
e
&&
e
.
brandId
)
{
...
...
@@ -242,22 +244,27 @@
uni
.
hideTabBar
()
this
.
takeStatus
=
true
},
closeTake
(
img
)
{
if
(
img
!==
undefined
){
async
closeTake
(
img
)
{
if
(
img
!==
undefined
){
const
files
=
img
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
// step1 添加图片
img
.
forEach
(
v
=>
{
this
.
currentItemDate
.
orderImages
.
push
(
v
.
key
)
// 复制一份 用于保存
let
saveList
=
this
.
currentItemDate
.
orderImages
.
concat
();
value
.
map
(
item
=>
{
// step1 添加缓存图片 到显示
this
.
currentItemDate
.
orderImages
.
push
(
item
.
path
)
// 文件key添加保存数组中
saveList
.
push
(
item
.
key
)
})
// step2 保存图片
var
data
=
{
type
:
this
.
currentItemDate
.
type
,
images
:
Array
.
from
(
this
.
currentItemDate
.
orderImages
),
images
:
Array
.
from
(
saveList
),
fieldsName
:
this
.
currentItemDate
.
fieldName
}
this
.
$u
.
api
.
saveImage
(
data
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
console
.
log
(
"==="
,
res
.
data
)
}
else
{
console
.
log
(
"保存图片异常"
,
res
.
data
.
message
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment