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
48c237ad
Commit
48c237ad
authored
Jun 09, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
6b16f38e
29244ad3
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
2264 additions
and
1541 deletions
+2264
-1541
.env.dev.js
.env.dev.js
+3
-3
.env.js
.env.js
+5
-5
App.vue
src/App.vue
+2
-5
order.js
src/common/api/order.js
+13
-1
http.interceptor.js
src/common/http.interceptor.js
+2
-1
iconfont.css
src/common/iconfont.css
+18
-0
complete-check.vue
src/components/complete-check/complete-check.vue
+56
-38
XhCheckbox.vue
src/components/createCom/XhCheckbox.vue
+1
-1
XhFiles.vue
src/components/createCom/XhFiles.vue
+1
-1
XhInput.vue
src/components/createCom/XhInput.vue
+21
-31
XhRadio.vue
src/components/createCom/XhRadio.vue
+2
-1
customer.vue
src/components/mine/customer.vue
+11
-14
bottomButtons.vue
src/components/order/bottomButtons.vue
+178
-0
detail.vue
src/components/order/detail.vue
+294
-0
index.vue
src/components/order/index.vue
+20
-6
performanceRecord.vue
src/components/order/performanceRecord.vue
+33
-21
qiniup.js
src/components/upload - 副本/qiniup.js
+0
-122
upload.js
src/components/upload - 副本/upload.js
+0
-173
pages.json
src/pages.json
+151
-137
index.vue
src/pages/index/index.vue
+4
-10
learn.vue
src/pages/index/learn.vue
+150
-91
mine.vue
src/pages/index/mine.vue
+10
-11
order.vue
src/pages/index/order.vue
+15
-16
news-details.vue
src/pages/learn/news-details.vue
+61
-50
index.vue
src/pages/login/index.vue
+10
-7
index.vue
src/pages/mine/wallet/index.vue
+4
-4
settlement.vue
src/pages/mine/wallet/settlement.vue
+6
-6
statement.vue
src/pages/mine/wallet/statement.vue
+7
-7
complete.vue
src/pages/order/complete.vue
+403
-366
detail.vue
src/pages/order/detail.vue
+253
-394
document-tag.vue
src/pages/order/document-tag.vue
+106
-0
document.vue
src/pages/order/document.vue
+402
-0
list.vue
src/pages/photo/list.vue
+7
-5
util.js
src/utils/util.js
+15
-14
No files found.
.env.dev.js
View file @
48c237ad
...
...
@@ -5,11 +5,11 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl
:
{
apiUrl
:
'http://192.168.
1.22
'
,
//java端域名请求头
apiUrl
:
'http://192.168.
0.62:37080
'
,
//java端域名请求头
// 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_base_url
:
'https://qn-static.banshouhui.com/self-support/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
argoDebugMode
:
1
}
module
.
exports
=
UNI_APP
;
.env.js
View file @
48c237ad
(
function
()
{
let
NODE_ENV
=
'
prod
'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
(
function
()
{
let
NODE_ENV
=
'
test
'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
let
VERSION_NUMBER
=
'1.3.
1
'
;
//版本号
let
VERSION_NUMBER
=
'1.3.
3
'
;
//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
@@ -21,8 +21,8 @@
}
if
(
ENV_VAR
)
{
process
.
uniEnv
=
{};
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
;
process
.
uniEnv
[
'version_number'
]
=
VERSION_NUMBER
;
process
.
uniEnv
[
'node_env'
]
=
NODE_ENV
;
process
.
uniEnv
[
'version_number'
]
=
VERSION_NUMBER
;
for
(
let
key
in
ENV_VAR
)
{
process
.
uniEnv
[
key
]
=
ENV_VAR
[
key
];
}
...
...
src/App.vue
View file @
48c237ad
...
...
@@ -106,7 +106,7 @@ export default {
},
getSystemInfo
()
{
try
{
let
a
=
wx
.
getSystemInfoSync
();
let
a
=
this
.
$u
.
sys
();
this
.
globalData
.
navHeight
=
(
a
.
statusBarHeight
/
a
.
screenWidth
)
*
750
+
90
;
this
.
globalData
.
rpxScreenHeight
=
...
...
@@ -116,9 +116,6 @@ export default {
}
catch
(
a
)
{}
},
async
getBaseInfo
(
vm
,
callBack
)
{
// uni.showLoading({
// title: "加载中……",
// });
const
res
=
await
vm
.
$u
.
api
.
getSettleBaseInfo
();
if
(
res
.
code
!==
200
)
{
return
false
;
...
...
@@ -131,7 +128,6 @@ export default {
if
(
typeof
callBack
==
"function"
)
{
callBack
(
vm
,
res
.
data
);
}
// uni.hideLoading();
return
res
.
data
;
},
...
...
@@ -261,6 +257,7 @@ export default {
<
style
>
/*每个页面公共css */
@import
"@/common/iconfont.css"
;
</
style
>
<
style
lang=
"scss"
>
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
...
...
src/common/api/order.js
View file @
48c237ad
...
...
@@ -119,6 +119,11 @@ let orderApiFun = function(vm){
*/
let
getCompleteConfigAndData
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/info'
);
/**
* 完工项阶段下一步
*/
let
completeNextStep
=
async
(
params
=
{},
orderId
)
=>
await
vm
.
$u
.
post
(
prefix
+
vm
.
vuex_token
+
'/order/'
+
orderId
+
'/maintain/nextStep'
,
params
);
/**
* 查询措施
*/
...
...
@@ -172,6 +177,10 @@ let orderApiFun = function(vm){
let
otherUser
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'other/auth/'
+
vm
.
vuex_token
+
'/other/user'
,
params
);
// 是否添加客服
let
checkAddCustomer
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'order/revision/'
+
vm
.
vuex_token
+
'/checkAddCustomer'
,
params
);
// 工单文件标签
let
fileLabel
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'config/'
+
vm
.
vuex_token
+
'/finish/file/lable/'
,
params
);
// 工单文件列表
let
fileList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'config/'
+
vm
.
vuex_token
+
'/finish/file'
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
...
...
@@ -212,7 +221,10 @@ let orderApiFun = function(vm){
workerApplyPay
,
allowLogin
,
otherUser
,
checkAddCustomer
checkAddCustomer
,
fileLabel
,
fileList
,
completeNextStep
}
return
orderApi
}
...
...
src/common/http.interceptor.js
View file @
48c237ad
...
...
@@ -88,7 +88,8 @@ const install = (Vue, vm) => {
// return result;
case
200
:
return
{
data
:
result
.
data
==
null
?
result
:
result
.
data
,
// result.data的值为0, false, ''的时候也要算有值
// data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值
data
:
result
.
data
,
code
:
code
,
message
:
msg
};
...
...
src/common/iconfont.css
0 → 100644
View file @
48c237ad
@font-face
{
font-family
:
"wxh"
;
/* Project id 2600874 */
/* Color fonts */
src
:
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAHYAAwAAAAAA3wAAAGNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIhgjEgZgADwKYGwBNgIkAwwLCgAEIAWBVAcgG6sCyL5APLajkgSQKlA9xTEuxLtPw+avikE32OCp3+939u3+/1Gp7skkindRuVQ8k0iUaNNpRCLDdLF04f9/532v+ifKCgIKskACGvLAxrTW4SE+1iqP8/+6guhXXAM8hf9vEasvfKVwncDD1TkrNzR1E+lJXq2Jk7a1bQ3roijRNAvX4KcCSyxqd7YWLiJliUdasyQ5XAICJABpCMZgAkDSE0gAP2OGrgmRg5tgCnRTF5lSK4fYlCRE6qmni0ey3kWdd6AOt3OGAD8DWYQiKJCG+oE0jAWEMQIW696D9G/KUxg1AKI02plA7vAtAEFB+v7O7tkkdNLjvbjTF5h7OrYl920W6m8dFljELe5HnXjRVxjkRJ65+0r0u+pq6/XtP1pP8E4/1AFhLCAv7zVIoOnH2TR4MIAZYTWjM0p5KABhHoosGhHQgGmEmthvxABkBq2gMBm5GwxWbNsxY8CkaZsWjFpTTQVVKdtAj149uirJqit35ACW9XfEpDXrZi1bkqVWQeFDBQCPX3IBAA==')
format
(
'woff2'
);
}
.wxh
{
font-family
:
"wxh"
!important
;
font-size
:
16px
;
font-style
:
normal
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
}
.wxh-doc
:before
{
content
:
"\e601"
;
}
src/components/complete-check/complete-check.vue
View file @
48c237ad
...
...
@@ -9,38 +9,49 @@
mode=
"center"
width=
"690rpx"
>
<view
class=
"slot-content"
>
<view
class=
"check-status"
>
<u-image
width=
"224rpx"
height=
"224rpx"
:src=
"statusImage"
></u-image>
<text
:class=
"['status-txt',
{ 'pass-color': pass }]">
{{
statusTxt
}}
</text>
</view>
<view
class=
"check-list"
>
<view
class=
"u-flex u-row-between list-title"
>
<view
class=
"left-txt"
>
验证项
</view>
<view>
已提交/需提交
</view>
<view
class=
"right-txt"
>
结果
</view>
<view
v-if=
"confirmButtonText !== '确定'"
>
<view
class=
"check-status"
>
<u-image
width=
"224rpx"
height=
"224rpx"
:src=
"statusImage"
></u-image>
<text
:class=
"['status-txt',
{ 'pass-color': pass }]">
{{
statusTxt
}}
</text>
</view>
<view
class=
"u-flex u-row-between list-item"
v-for=
"(item, index) in listData"
:key=
"index"
>
<view
class=
"item-txt left-txt"
style=
"width: 160rpx;text-align: left;"
>
<u-icon
:name=
"item.pass ? passIcon : noPassIcon"
:label=
"item.label"
margin-left=
"12"
label-color=
"#333333"
label-size=
"28"
size=
"32"
></u-icon>
<view
class=
"check-list"
>
<view
class=
"u-flex u-row-between list-title"
>
<view
class=
"left-txt"
>
验证项
</view>
<view>
已提交/需提交
</view>
<view
class=
"right-txt"
>
结果
</view>
</view>
<view
class=
"item-txt"
>
{{
item
.
submitted
}}
/
{{
item
.
required
}}
</view>
<view
:class=
"['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style=
"width: 160rpx;text-align: right;"
>
{{
item
.
pass
?
"通过"
:
"未通过"
}}
<view
class=
"u-flex u-row-between list-item"
v-for=
"(item, index) in listData"
:key=
"index"
>
<view
class=
"item-txt left-txt"
style=
"width: 200rpx;text-align: left;"
>
<u-icon
:name=
"item.pass ? passIcon : noPassIcon"
:label=
"item.label"
margin-left=
"12"
label-color=
"#333333"
label-size=
"28"
size=
"32"
></u-icon>
</view>
<view
class=
"item-txt"
>
{{
item
.
submitted
}}
/
{{
item
.
required
}}
</view>
<view
:class=
"['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style=
"width: 160rpx;text-align: right;"
>
{{
item
.
pass
?
"通过"
:
"未通过"
}}
</view>
</view>
</view>
</view>
<view
v-else
>
<view
class=
"check-status"
>
<text
class=
'status-txt'
style=
"color: #333;"
>
确认安装结果
</text>
</view>
<view
class=
"u-flex no-install"
>
<text
class=
"tips"
>
提交信息,确认安装结论为不安装
</text>
</view>
</view>
<view
class=
"check-bottom"
>
<view
class=
"button cancel"
v-show=
"
!pass"
@
tap=
"cancel"
>
取消
</view>
<view
class=
"button confirm"
@
tap=
"confirm"
>
{{
confirmText
}}
</view>
<view
class=
"button cancel"
v-show=
"
cancelButtonText !== ''"
@
tap=
"cancel"
>
{{
cancelButtonText
}}
</view>
<view
class=
"button confirm"
@
tap=
"confirm"
>
{{
confirmButtonText
}}
</view>
</view>
</view>
</u-popup>
...
...
@@ -79,6 +90,14 @@
{
label
:
'安装信息'
,
submitted
:
15
,
required
:
20
,
pass
:
false
}
]
}
},
confirmButtonText
:
{
type
:
String
,
default
:
'确定'
},
cancelButtonText
:
{
type
:
String
,
default
:
''
}
},
data
()
{
...
...
@@ -104,9 +123,6 @@
statusTxt
()
{
return
this
.
pass
?
"完工校验已通过"
:
"完工校验未通过"
},
confirmText
()
{
return
this
.
pass
?
"确定"
:
"去处理"
},
passIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/pass.png'
},
noPassIcon
()
{
return
process
.
uniEnv
.
qn_base_url
+
'icon/no-pass.png'
},
},
...
...
@@ -115,14 +131,7 @@
this
.
$emit
(
'close'
)
},
confirm
()
{
if
(
this
.
pass
)
{
this
.
$emit
(
'change'
)
}
else
{
let
data
=
this
.
listData
.
find
((
item
,
index
)
=>
{
return
item
.
pass
==
false
;
})
this
.
$emit
(
'handle'
,
data
)
}
this
.
$emit
(
'confirm'
)
}
},
...
...
@@ -161,6 +170,15 @@
margin-bottom
:
40rpx
;
}
}
.no-install
{
justify-content
:
center
;
align-items
:
center
;
height
:
200rpx
;
border-top
:
2rpx
solid
#F4F5F7
;
.tips
{
font-size
:
28rpx
;
}
}
.check-bottom
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -194,7 +212,7 @@
line-height
:
32rpx
;
}
.left-txt
{
width
:
16
0rpx
;
width
:
20
0rpx
;
text-align
:
left
;
}
.right-txt
{
...
...
src/components/createCom/XhCheckbox.vue
View file @
48c237ad
...
...
@@ -61,7 +61,7 @@
display
:
flex
;
flex-wrap
:
wrap
;
line-height
:
50rpx
;
max-width
:
46%
;
max-width
:
46%
;
align-items
:
center
;
&
.active
{
background-color
:
#2272FF
;
...
...
src/components/createCom/XhFiles.vue
View file @
48c237ad
...
...
@@ -4,7 +4,7 @@
<view
class=
"file-box"
>
<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>
<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)"
fade
lazy-load
></u-image>
<view
class=
"icon-del-box"
@
click
.
stop=
"delFile(index)"
>
<view
class=
"icon-del"
></view>
<view
class=
"icon-del rotate"
></view>
...
...
src/components/createCom/XhInput.vue
View file @
48c237ad
...
...
@@ -2,7 +2,10 @@
<
template
>
<view
:style=
"
{'width': fieldsWidth}">
<u-input
:type=
"type"
class=
"input-item"
v-model=
"dataValue"
@
input=
"valueChange"
:placeholder=
"placeholder"
:placeholder-style=
"placeholderStyle"
:custom-style=
"customStyle"
:clearable=
"false"
:border=
"border"
border-color=
"#ECECEC"
:maxlength=
"maxlength"
:cursor-spacing=
"10"
hold-keyboard
/>
:custom-style=
"customStyle"
:clearable=
"false"
:border=
"border"
border-color=
"#ECECEC"
:maxlength=
"maxlength"
:cursor-spacing=
"10"
:disabled=
"isDisabled"
hold-keyboard
/>
<view
class=
"content"
v-if=
"slotContent"
>
<text
class=
"txt"
>
{{
slotContent
}}
</text>
</view>
</view>
</
template
>
...
...
@@ -26,42 +29,18 @@
type
:
{
type
:
String
,
default
:
'text'
},
slotContent
:
{
type
:
String
,
default
:
''
}
// width: { // 例如:454rpx
// type: String,
// default: '100%'
// }
},
data
()
{
return
{
inputType
:
'text'
,
// type: 'text'
inputType
:
'text'
}
},
computed
:
{
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength
()
{
return
this
.
type
==
'digit'
?
9
:
140
},
...
...
@@ -89,6 +68,9 @@
},
backgroundColor
()
{
return
this
.
textarea
?
'transparent'
:
'#F4F5F7'
},
isDisabled
()
{
return
this
.
item
.
fieldsId
===
254
||
this
.
disabled
?
true
:
false
}
},
watch
:
{},
...
...
@@ -97,8 +79,16 @@
}
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.input-item
{
background
:
#F4F5F7
;
}
.content
{
padding-top
:
20rpx
;
line-height
:
45rpx
;
.txt
{
font-size
:
24rpx
;
color
:
#999
;
}
}
</
style
>
src/components/createCom/XhRadio.vue
View file @
48c237ad
...
...
@@ -25,6 +25,7 @@
mounted
()
{},
methods
:
{
setValue
(
txt
){
if
(
this
.
disabled
)
return
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
...
...
@@ -44,7 +45,7 @@
display
:
flex
;
flex-wrap
:
wrap
;
line-height
:
50rpx
;
max-width
:
46%
;
max-width
:
46%
;
align-items
:
center
;
&
.active
{
background-color
:
#2272FF
;
...
...
src/components/mine/customer.vue
View file @
48c237ad
<
template
>
<view
class=
"cus-wrap-component"
>
<image
class=
"top-image"
mode=
"widthFix"
v-if=
"!isPop"
:src=
"
minekefutuImage
"
></image>
<image
class=
"top-image"
mode=
"widthFix"
v-if=
"!isPop"
:src=
"
qnFile(imageName)
"
></image>
<view
class=
"content-view"
>
<view
:class=
"['title-view',
{'is-mine': isMine}]">
<text
:class=
"['title-text',
{'is-mine': isMine}]">
{{
titleText
[
typeIndex
]
}}
</text>
<text>
{{
tipText
[
typeIndex
]
}}
</text>
</view>
<u-image
:class=
"['qrcode',
{'is-mine': isMine}]" :src="cusQrcode" mode="widthFix" :fade="true"
duration="450">
<u-image
:class=
"['qrcode',
{'is-mine': isMine}]" :src="qnFile(cusQrcode)" mode="widthFix" :fade="false">
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
<!-- 我的页面进来下载图片,其他页面进来open-type为客服,跳转到客服页面 -->
<button
:class=
"['settle-button',
{'is-mine': isMine}]" type="primary" :open-type="openTypes[typeIndex]" show-message-card
send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="
kefuzxiaoxiImage
"
send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="
qnFile('kefuzxiaoxi.png')
"
send-message-path="/pages/index/index">
{{
buttonText
[
typeIndex
]
}}
</button>
...
...
@@ -45,14 +45,7 @@
},
computed
:
{
cusQrcode
()
{
let
src
=
this
.
isMine
?
'erweima-rk.png'
:
'dingdanzhushou-n.png'
;
return
util
.
imageCache
(
this
,
src
)
},
kefuzxiaoxiImage
()
{
return
util
.
imageCache
(
this
,
'kefuzxiaoxi.png'
)
},
minekefutuImage
()
{
return
util
.
imageCache
(
this
,
this
.
imageName
)
return
this
.
isMine
?
'erweima-rk.png'
:
'dingdanzhushou-n.png'
;
},
imageName
()
{
return
this
.
isMine
?
'kefufuwu-n.png'
:
'kefutuzs.png'
...
...
@@ -92,12 +85,16 @@
}
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
phoneToCustomer
()
{
// 联系客户
uni
.
makePhoneCall
({
phoneNumber
:
this
.
phone
,
//仅为示例
complete
()
{}
});
},
},
// 我的页面下载图片,其他页面要跳到客服页面
download
()
{
if
(
!
this
.
isMine
)
{
this
.
$emit
(
'click'
)
...
...
src/components/order/bottomButtons.vue
0 → 100644
View file @
48c237ad
<
template
>
<view
class=
"bottom-button"
>
<view
v-for=
"(item, index) in list"
:class=
"['button-view', item.type]"
>
<u-button
:class=
"['list-button', item.type,
{'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
:custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
<view
class=
"image-view"
v-if=
"item.type == 'image'"
>
<image
:src=
"baseImageUrl + item.image"
class=
"image-content"
></image>
</view>
<view
:class=
"['text-content', item.type]"
>
{{
item
.
label
}}
</view>
</u-button>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
// customStyle: 自定义button样式
buttons
:
{
type
:
Array
,
default
()
{
return
[{
label
:
'过程反馈'
,
type
:
'image'
,
image
:
'guochengfankui.png'
,
show
:
true
,
disabled
:
false
,
},
{
label
:
'异常签到'
,
type
:
'image'
,
image
:
'yichangqiandao.png'
,
show
:
false
,
disabled
:
false
},
{
label
:
'现场拍照'
,
type
:
'image'
,
image
:
'xiancahngpaizhao.png'
,
show
:
true
,
disabled
:
false
,
},
{
label
:
'接单'
,
type
:
'text'
,
show
:
true
,
disabled
:
true
,
customStyle
:
{
'background-color'
:
'#2272FF'
}
}
]
}
}
},
computed
:
{
baseImageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
list
()
{
return
this
.
buttons
.
filter
((
item
)
=>
{
return
item
.
show
==
true
})
},
buttonStyle
()
{
return
{
'image'
:
{
'background-color'
:
'transparent'
,
'border-color'
:
'transparent'
,
'display'
:
'flex'
,
'flex-direction'
:
'column'
,
'height'
:
'104rpx'
,
'width'
:
'82rpx'
,
},
'text'
:
{
'background-color'
:
'#2272FF'
,
'border-color'
:
'transparent'
,
'display'
:
'flex'
,
'flex-direction'
:
'column'
,
'height'
:
'104rpx'
,
'width'
:
'100%'
,
},
'disabled'
:
{
'background-color'
:
'#D1D4D4'
,
'border-color'
:
'transparent'
,
'display'
:
'flex'
,
'flex-direction'
:
'column'
,
'height'
:
'104rpx'
,
'width'
:
'100%'
},
}
},
},
methods
:
{
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
handleClick
(
item
)
{
if
(
item
.
disabled
)
return
this
.
$emit
(
'submit'
,
item
.
id
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.bottom-button
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
padding
:
0
30rpx
44rpx
30rpx
;
.button-view
{
max-width
:
600rpx
;
display
:
flex
;
&
.image
{}
&
.text
{
width
:
100%
;
display
:
flex
;
justify-content
:
flex-end
;
}
.list-button
{
display
:
flex
;
flex-direction
:
column
;
width
:
100%
;
&
.image
{
margin-right
:
40rpx
;
}
&
.text
{
width
:
400rpx
;
margin-left
:
40rpx
;
&
.one
{
width
:
600rpx
;
margin-left
:
0rpx
;
}
}
.image-view
{
flex-shrink
:
0
;
background-color
:
#FFFFFF
;
border-radius
:
38rpx
;
width
:
76rpx
;
height
:
76rpx
;
.image-content
{
width
:
76rpx
;
height
:
76rpx
;
}
}
.text-content
{
&
.text
{
color
:
#FFFFFF
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
&
.image
{
color
:
#333333
;
font-size
:
20rpx
;
line-height
:
20rpx
;
height
:
20rpx
;
margin-top
:
8rpx
;
}
}
}
}
}
</
style
>
src/components/order/detail.vue
0 → 100644
View file @
48c237ad
<
template
>
<view
class=
"card base-item"
>
<view
class=
"top-item"
>
<view
class=
"left"
>
<view
:class=
"['tag',
{'active': order.orderServiceType == '安装'}]">
{{
order
.
orderServiceType
}}
</view>
<text
class=
"title"
>
{{
order
.
categoryName
}}
</text>
</view>
<view
class=
"right"
>
{{
order
.
orderBusinessTypeText
}}
</view>
</view>
<view
class=
"order-cell"
>
<text>
工单编号:
</text>
<text>
{{
order
.
orderNumber
}}
</text>
</view>
<view
class=
"order-cell"
>
<text>
合作厂商:
</text>
<text>
{{
order
.
partnerCompanyName
}}
</text>
</view>
<view
class=
"order-cell"
>
<text>
厂商编号:
</text>
<text>
{{
order
.
partnerSerialNumber
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<view
class=
"left"
>
<text>
客户信息:
</text>
<text>
{{
order
.
contactName
}}
</text>
</view>
<image
v-if=
"showOperate"
style=
"width: 84rpx;height: 56rpx;"
:src=
"phoneIcon"
@
click=
"phoneToCustomer(order.contactPhone)"
>
</image>
</view>
<view
class=
"order-cell"
>
<text>
联系方式:
</text>
<text>
{{
order
.
contactPhone
}}
</text>
</view>
<view
class=
"between-cell address-cell"
>
<view
class=
"left-address"
>
<u-icon
name=
"map"
size=
"28"
></u-icon>
<text
class=
"address-txt"
>
{{
formatAddress
}}
</text>
</view>
<image
v-if=
"showOperate"
style=
"width: 84rpx;height: 56rpx;"
:src=
"navigationIcon"
@
click=
"openLocation(order.contactAddress)"
></image>
</view>
<view
v-if=
"readMore"
@
click=
"handleClick(false)"
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-down"
></u-icon>
<text
class=
"read-more-text"
>
查看更多
</text>
</view>
<view
v-else
class=
"order-item-more"
>
<view
class=
"line-view"
></view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
品牌:
</text>
<text>
{{
order
.
brandName
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
数量:
</text>
<text>
x
{{
order
.
orderProductCount
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
充电桩信息:
</text>
<text>
{{
order
.
serviceContent
}}
</text>
</view>
<view
class=
"read-more-toggle"
@
click=
"handleClick(true)"
>
<u-icon
name=
"arrow-up"
></u-icon>
<text
class=
"read-more-text"
>
点击收起
</text>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
// 履约记录
order
:
{
type
:
Object
,
default
()
{
return
{}
}
},
// true 显示「查看更多」按钮, false 显示「点击收起」按钮
readMore
:
{
type
:
Boolean
,
default
:
true
},
// 可以点击电话和地址
operate
:
{
type
:
Boolean
,
default
:
true
},
// 显示点击电话和地址
showOperate
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
return
{}
},
computed
:
{
formatAddress
()
{
let
self
=
this
let
address
=
""
if
(
self
.
order
)
{
address
=
self
.
order
.
contactProvinceText
||
""
address
+=
self
.
order
.
contactCityText
||
""
address
+=
self
.
order
.
contactCommunityText
||
""
address
+=
self
.
order
.
contactStreetText
||
""
address
+=
self
.
order
.
contactAddress
||
""
}
return
address
},
phoneIcon
()
{
//self-support/icon/dianhua-0@2x.png
if
(
this
.
operate
)
{
return
process
.
uniEnv
.
qn_base_url
+
'dianhua.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'dianhua-d.png'
}
},
navigationIcon
()
{
//self-support/icon/daohang-0@2x.png
if
(
this
.
operate
)
{
return
process
.
uniEnv
.
qn_base_url
+
'daohang.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'daohang-d.png'
}
},
},
methods
:
{
openLocation
(
address
)
{
if
(
this
.
operate
)
{
const
latitude
=
this
.
order
.
contactAddressLatitud
//res.latitude;
const
longitude
=
this
.
order
.
contactAddressLongitud
//res.longitude;
uni
.
openLocation
({
latitude
:
Number
(
latitude
),
longitude
:
Number
(
longitude
),
success
:
function
()
{
console
.
log
(
'success'
);
}
});
}
},
phoneToCustomer
(
phone
)
{
// 联系客户
if
(
this
.
operate
)
{
uni
.
makePhoneCall
({
phoneNumber
:
phone
,
//仅为示例
complete
()
{}
});
this
.
contactTime
()
}
},
contactTime
()
{
let
self
=
this
var
data
=
{}
if
(
this
.
submitType
===
"workerAppointment"
)
{
self
.
$u
.
api
.
contactTime
(
data
,
this
.
order
.
orderId
)
}
},
handleClick
(
val
)
{
this
.
$emit
(
'update:readMore'
,
val
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.base-item
{
padding-bottom
:
6rpx
;
background-color
:
#FFFFFF
;
margin-bottom
:
20rpx
;
// padding: 30rpx 30rpx 0 30rpx;
border-radius
:
6px
;
.top-item
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
30rpx
;
.left
{
display
:
flex
;
align-items
:
center
;
.tag
{
text-align
:
center
;
width
:
84rpx
;
height
:
40rpx
;
border-radius
:
8rpx
;
font-size
:
22rpx
;
font-weight
:
500
;
color
:
#FFFFFF
;
line-height
:
40rpx
;
background-image
:
linear-gradient
(
to
right
,
#FF930D
,
#FFC174
);
&
.active
{
background-image
:
linear-gradient
(
to
right
,
#2272FF
,
#47ABFF
);
}
}
.title
{
margin-left
:
20rpx
;
height
:
36rpx
;
font-size
:
36rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
36rpx
;
}
}
.right
{
text-align
:
center
;
width
:
100rpx
;
height
:
40rpx
;
background
:
#F4F5F7
;
border-radius
:
22rpx
;
font-size
:
22rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
40rpx
;
}
}
.address-cell
{
font-size
:
24rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
24rpx
;
margin-top
:
20rpx
;
margin-bottom
:
40rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.left-address
{
display
:
flex
;
align-items
:
flex-start
;
.address-txt
{
line-height
:
30rpx
;
margin-left
:
8rpx
;
margin-right
:
30rpx
;
}
}
}
}
.read-more-toggle
{
text-align
:
center
;
color
:
#2272FF
;
font-size
:
26rpx
;
margin-top
:
30rpx
;
padding-bottom
:
30rpx
;
}
.read-more-text
{
padding-left
:
8rpx
;
}
.order-item-more
{
font-size
:
26rpx
;
color
:
#333333
;
text-align
:
right
;
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
margin-bottom
:
20rpx
;
}
}
.order-cell
{
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
48rpx
;
margin-bottom
:
10rpx
;
}
.between-cell
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.display-cell
{
display
:
flex
;
}
.cell-title
{
text-align
:
left
;
flex-shrink
:
0
;
}
</
style
>
src/components/order/index.vue
View file @
48c237ad
...
...
@@ -39,8 +39,8 @@
<view>
<view
v-if=
"showCountTime"
class=
"bottom-left-view"
>
<view
:class=
"['bottom-tag-view',
{'timeout': timeout}]">
<text>
{{
tagText
}}
</text></view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"40"
show-days
separator=
"zh"
:color=
"timeout ? '#FA5A49' : '#FF930D'"
@
change=
"handleChange"
separator-color=
"#666666"
ref=
"order-count-down"
></u-count-down>
<u-count-down
:timestamp=
"timestamp"
font-size=
"40"
show-days
separator=
"zh"
hide-zero-day
:color=
"timeout ? '#FA5A49' : '#FF930D'"
@
change=
"handleChange"
separator-color=
"#666666"
ref=
"order-count-down"
></u-count-down>
</view>
<view
v-else-if=
"showTime"
>
<text>
{{
timeTitle
}}
</text>
...
...
@@ -196,6 +196,17 @@
showDistance
()
{
return
this
.
orderType
==
0
&&
this
.
location
.
length
>=
2
&&
(
this
.
orderData
.
contactAddressLatitud
||
this
.
orderData
.
contactAddressLongitud
)
},
titles
()
{
return
{
'waitAccept'
:
'待'
+
this
.
type0Text
,
// 待接单、
'waitAppointment'
:
'待预约'
,
// 待预约、
'waitCheckIn'
:
'待签到'
,
// 待签到、
'waitFinish'
:
'待完工'
,
// 待完工、
'audit'
:
'审核中'
,
// 审核中、
'exception'
:
'异常单'
,
// 异常单、
'finish'
:
'已完工'
,
//已完工
}
},
types
()
{
return
{
'waitAccept'
:
0
,
// 待接单、
...
...
@@ -207,6 +218,9 @@
'finish'
:
6
,
//已完工
}
},
title
()
{
return
this
.
titles
[
this
.
type
]
},
orderDistance
()
{
return
this
.
distance
(
this
.
orderData
.
contactAddressLatitud
,
this
.
orderData
.
contactAddressLongitud
,
this
.
location
[
0
],
this
.
location
[
1
])
},
...
...
@@ -243,7 +257,7 @@
return
3
}
else
if
(
this
.
orderData
.
orderStatus
==
85
||
this
.
orderData
.
orderStatus
==
87
)
{
return
4
}
else
if
(
this
.
orderData
.
orderStatus
==
86
||
this
.
orderData
.
orderStatus
==
88
)
{
}
else
if
(
this
.
orderData
.
orderStatus
==
86
||
this
.
orderData
.
orderStatus
==
88
)
{
return
5
}
else
if
([
80
,
81
,
89
,
110
].
indexOf
(
this
.
orderData
.
orderStatus
)
!=
-
1
)
{
return
6
...
...
@@ -267,14 +281,14 @@
methods
:
{
handleClick
()
{
// if (this.buttonDisabled) return
this
.
$emit
(
'action'
)
this
.
$emit
(
'action'
,
this
.
orderData
,
this
.
title
)
},
handleClickCell
()
{
this
.
$emit
(
'click'
)
this
.
$emit
(
'click'
,
this
.
orderData
,
this
.
title
)
},
handleChange
(
timestamp
)
{
if
(
this
.
timeout
)
this
.
$refs
[
'order-count-down'
].
seconds
+=
2
if
(
timestamp
==
0
&&
!
this
.
timeout
)
{
if
(
timestamp
==
0
&&
!
this
.
timeout
)
{
// 超时之后倒计时变为正计时
setTimeout
(()
=>
{
this
.
timestamp
=
1
this
.
timeout
=
true
...
...
src/components/order/performanceRecord.vue
View file @
48c237ad
...
...
@@ -4,11 +4,11 @@
<text>
履约记录
</text>
</view>
<view
v-if=
"orderRecords.length == 0"
class=
"no-record-view"
>
当前暂无履约记录
</view>
<view
v-else
class=
"record-list-view
"
>
<view
v-else
:class=
"['record-list-view',
{'short': orderRecords.length
<
=
showLenght
}]
"
>
<view
class=
"record-right-view"
>
<view
class=
"dashed-line-view"
></view>
<view
class=
"order-list"
>
<view
v-for=
"(record,index) in sh
wo
OrderRecords"
:key=
"record.operationContent"
:class=
"['order-cell',
{'first': index == 0}]">
<view
v-for=
"(record,index) in sh
ow
OrderRecords"
:key=
"record.operationContent"
:class=
"['order-cell',
{'first': index == 0}]">
<view
class=
"node-view"
>
<view
class=
"node-border-view"
>
<view
class=
"node-middle-view"
></view>
...
...
@@ -18,18 +18,19 @@
<view
class=
"line-view-top"
>
<text>
{{
$u
.
timeFormat
(
record
.
operationDatetime
,
'yyyy.mm.dd hh:MM:ss'
)
}}
</text>
<text
style=
"color: red;"
>
{{
record
.
overTime
?
'超时'
:
''
}}{{
record
.
exception
?
'异常'
:
''
}}
</text>
<text
style=
"color: #2272FF;"
v-show=
"record.operationType==='报备' || record.operationType==='改约'"
>
跟进
</text>
<text
style=
"color: #2272FF;"
v-show=
"record.isTrace"
>
跟进
</text>
</view>
<view
class=
"line-view-item"
>
<view>
<text>
{{
record
.
operationTypeText
}}
</text>
</view>
<view
class=
"item-operation-view"
v-show=
"record.operationType==='报备' || record.operationType==='预约'|| record.operationType==='改约'"
>
<text>
{{
record
.
operationType
===
'报备'
?
'下次联系时间:'
:
record
.
operationType
===
'改约'
?
'改约时间:'
:
''
}}
</text>
<text
style=
"color: #2272FF;word-break: break-all;"
>
{{
record
.
orderRecordRemark
}}
</text>
<view
class=
"item-operation-view"
v-show=
"record.isTrace"
>
<text
class=
"item-label"
>
{{
record
.
traceLabel
+
":"
}}
</text>
<text
class=
"item-content"
>
{{
record
.
traceTime
}}
</text>
</view>
<view
class=
"item-operation-view"
v-show=
"record.operationContent"
>
<text
class=
"item-label"
>
备注:
</text>
<text
class=
"item-content"
>
{{
record
.
operationContent
}}
</text>
</view>
</view>
</view>
...
...
@@ -70,14 +71,14 @@
}
},
computed
:
{
sh
wo
OrderRecords
()
{
sh
ow
OrderRecords
()
{
if
(
this
.
readMoreRecord
&&
this
.
orderRecords
&&
this
.
orderRecords
.
length
>
0
)
{
return
this
.
orderRecords
.
slice
(
0
,
this
.
showLenght
)
}
else
{
return
this
.
orderRecords
}
},
}
}
,
}
</
script
>
...
...
@@ -93,14 +94,15 @@
.no-record-view
{
font-size
:
26rpx
;
color
:
#333333
;
margin-top
:
30rpx
;
margin-bottom
:
30rpx
;
padding-bottom
:
30rpx
;
}
.record-list-view
{
position
:
relative
;
&
.short
{
padding-bottom
:
30rpx
;
}
.record-right-view
{
position
:
relative
;
display
:
flex
;
...
...
@@ -128,22 +130,25 @@
.node-view
{
margin-right
:
18rpx
;
flex-shrink
:
0
;
margin-top
:
8rpx
;
margin-top
:
8rpx
;
z-index
:
1
;
.node-border-view
{
border
:
2rpx
solid
#2272FF
;
border-radius
:
11rpx
;
width
:
22rpx
;
height
:
22rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
// display: flex;
// align-items: center;
// justify-content: center;
padding
:
5rpx
;
background-color
:
#FFFFFF
;
.node-middle-view
{
width
:
10rpx
;
height
:
10rpx
;
background-color
:
#2272FF
;
border-radius
:
5
rpx
;
border-radius
:
6
rpx
;
}
}
}
...
...
@@ -156,6 +161,7 @@
align-items
:
center
;
justify-content
:
space-between
;
color
:
#333333
;
font-weight
:
bold
;
font-size
:
28rpx
;
}
...
...
@@ -166,6 +172,12 @@
.item-operation-view
{
margin-top
:
20rpx
;
.item-label
{
color
:
#2272FF
;
}
.item-content
{
word-break
:
break-all
;
}
}
}
}
...
...
@@ -179,7 +191,7 @@
text-align
:
center
;
color
:
#2272FF
;
font-size
:
26rpx
;
margin
-top
:
30rpx
;
padding
-top
:
30rpx
;
padding-bottom
:
30rpx
;
}
...
...
src/components/upload - 副本/qiniup.js
deleted
100644 → 0
View file @
6b16f38e
import
qiniuUploader
from
'@/include/libs/qiniuUploader.js'
;
const
globalUrl
=
process
.
uniEnv
||
{}
export
default
{
name
:
'qiniup'
,
components
:
{},
data
()
{
return
{
domain
:
'http://upload.qiniup.com'
,
// 七牛上传域名地址
uptokenURL
:
globalUrl
.
ucenterUrl
.
apiUrl
+
'/v1/tokens'
,
// 上传token地址
files
:[],
// 上传文件
fileMaps
:[],
// 上传文件返回对象
keys
:[],
// 七牛返回key
uploadToken
:
''
,
// 上传token
maximum
:
999
,
// 最大上传数量
qiniuOptions
:
{},
// 七牛上传配置
};
},
created
()
{
this
.
initQiniu
()
},
methods
:
{
initQiniu
:
function
()
{
var
defaulfs
=
{
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region
:
'ECN'
,
bucket
:
'fa-cms'
,
qiniuBucketURLPrefix
:
'uploads'
,
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken
:
''
,
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL
:
this
.
uptokenURL
,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc
:
function
()
{
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain
:
this
.
domain
,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName
:
true
};
let
options
=
{}
if
(
Object
.
keys
(
this
.
qiniuOptions
).
length
)
{
Object
.
assign
(
options
,
defaulfs
,
this
.
qiniuOptions
);
}
else
{
options
=
defaulfs
;
}
// 将七牛云相关配置初始化进本sdk
qiniuUploader
.
init
(
options
);
},
getUrlKey
(
file
)
{
let
index
=
file
.
lastIndexOf
(
'/'
);
let
len
=
file
.
length
let
name
=
file
.
substring
(
index
+
1
,
len
)
return
name
;
},
/**
* 确认上传
* @param {boolean} submit
*/
confirmUpload
(
submit
=
false
)
{
let
self
=
this
const
fileList
=
self
.
files
if
(
self
.
maximum
-
fileList
.
length
<=
0
)
{
uni
.
showToast
({
title
:
'图片数量不能大于'
+
self
.
maximum
,
icon
:
'none'
})
return
}
for
(
let
file
of
fileList
)
{
let
name
=
self
.
getUrlKey
(
file
)
// 交给七牛上传
let
item
=
{
src
:
''
,
id
:
''
,
key
:
''
,
// filesize: '',
progress
:
0
}
const
params
=
{
name
:
name
,
file
:
file
,
}
qiniuUploader
.
upload
(
params
,
(
res
)
=>
{
let
inLen
=
self
.
maximum
-
fileList
.
length
if
(
inLen
>
0
)
{
item
.
src
=
file
item
.
key
=
res
.
key
||
res
.
src
self
.
fileMaps
.
push
(
item
);
self
.
keys
.
push
(
item
.
key
)
if
(
submit
)
{
self
.
submitFile
()
}
}
else
{
uni
.
showToast
({
title
:
'图片数量不能大于9'
})
}
},
(
error
)
=>
{
console
.
log
(
'error: '
+
error
);
},
null
,
(
res
)
=>
{
item
.
progress
=
res
.
progress
},
()
=>
{
// 取消上传
},
()
=>
{
// `before` 上传前执行的操作
},
(
err
)
=>
{
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
}
src/components/upload - 副本/upload.js
deleted
100644 → 0
View file @
6b16f38e
import
qiniuUploader
from
'@/include/libs/qiniuUploader.js'
;
const
globalUrl
=
process
.
uniEnv
||
{}
export
default
{
name
:
'upload-img'
,
components
:
{},
data
()
{
return
{
domain
:
'http://upload.qiniup.com'
,
uptokenURL
:
globalUrl
.
ucenterUrl
.
apiUrl
+
'/v1/tokens'
,
imgList
:
[],
imgs
:[],
uploadToken
:
''
,
selectNum
:
999
,
};
},
computed
:
{
uploadBtnShow
()
{
let
flag
=
this
.
imgList
.
length
<
this
.
selectNum
return
flag
&&
this
.
uploadVisible
}
},
created
()
{
this
.
initQiniu
()
this
.
initImg
();
},
methods
:
{
initQiniu
:
function
()
{
var
options
=
{
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region
:
'ECN'
,
bucket
:
'fa-cms'
,
qiniuBucketURLPrefix
:
'uploads'
,
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken
:
''
,
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL
:
this
.
uptokenURL
,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc
:
function
()
{
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain
:
this
.
domain
,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName
:
true
};
// 将七牛云相关配置初始化进本sdk
qiniuUploader
.
init
(
options
);
},
chooseImage
()
{
if
(
this
.
selectNum
-
this
.
imgList
.
length
<=
0
)
{
uni
.
showToast
({
title
:
'图片数量不能大于'
+
this
.
selectNum
,
icon
:
'none'
})
return
}
uni
.
chooseImage
({
count
:
this
.
selectNum
,
//默认9 this.selectNum
success
:
(
chooseImageRes
)
=>
{
for
(
var
i
=
0
;
i
<
chooseImageRes
.
tempFilePaths
.
length
;
i
++
)
{
let
file
=
chooseImageRes
.
tempFilePaths
[
i
];
let
index
=
file
.
lastIndexOf
(
'/'
);
let
len
=
file
.
length
let
name
=
file
.
substring
(
index
+
1
,
len
)
// 交给七牛上传
let
newLen
=
this
.
selectNum
-
this
.
imgList
.
length
let
item
=
{
src
:
''
,
id
:
''
,
key
:
''
,
// filesize: '',
progress
:
0
}
const
params
=
{
name
:
name
,
file
:
file
,
}
if
(
newLen
>
0
)
{
qiniuUploader
.
upload
(
params
,
(
res
)
=>
{
let
inLen
=
this
.
selectNum
-
this
.
imgList
.
length
if
(
inLen
>
0
)
{
item
.
src
=
file
item
.
key
=
res
.
key
||
res
.
src
this
.
imgList
.
push
(
item
);
this
.
imgs
.
push
(
res
.
key
)
// this.addRecord(item,res)
}
else
{
uni
.
showToast
({
title
:
'图片数量不能大于9'
})
}
},
(
error
)
=>
{
console
.
log
(
'error: '
+
error
);
},
null
,
(
res
)
=>
{
// item.filesize = res.totalBytesSent
item
.
progress
=
res
.
progress
},
()
=>
{
// 取消上传
},
()
=>
{
// `before` 上传前执行的操作
},
(
err
)
=>
{
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
})
},
perviewImg
(
index
)
{
let
urls
=
[]
this
.
imgList
.
map
(
item
=>
{
urls
.
push
(
item
.
src
)
})
uni
.
previewImage
({
current
:
index
,
urls
:
urls
});
},
initImg
()
{
//传入图片,回显
this
.
imgList
=
this
.
initImgList
.
map
(
item
=>
{
let
imgItem
=
{
src
:
''
,
id
:
''
}
if
(
typeof
item
===
'string'
){
imgItem
.
src
=
item
}
else
{
imgItem
.
src
=
item
.
src
||
item
.
pic
||
item
.
image
imgItem
.
id
=
item
.
id
||
'0'
}
return
imgItem
})
},
// async addRecord(item, res) {
// let path = res.key;
// let hash = res.hash;
// let ext = path.substr(path.lastIndexOf('.') + 1);
// //推送到增加记录接口
// let params = {
// filename: hash + '.' + ext,
// full_url: res.fileURL,
// absolute_path: path,
// filesize: item.filesize,
// ext: ext
// };
// let recordRes = await this.$u.api.qiniuRecord(params);
// if (recordRes.code != 1) {
// uni.showToast({
// title: recordRs.msg,
// icon: 'none'
// })
// return
// }
// item.id = recordRes.data.id.id
// },
async
removeImg
(
index
)
{
this
.
imgList
.
splice
(
index
,
1
)
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
getUrlKey
(
file
)
{
let
index
=
file
.
lastIndexOf
(
'/'
);
let
len
=
file
.
length
let
name
=
file
.
substring
(
index
+
1
,
len
)
return
name
;
}
}
}
src/pages.json
View file @
48c237ad
...
...
@@ -5,13 +5,12 @@
"^u-(.*)"
:
"@/uview-ui/components/u-$1/u-$1.vue"
}
},
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
"pages"
:
[
{
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationBarTitleText"
:
"首页"
,
"navigationStyle"
:
"custom"
,
//
"enablePullDownRefresh"
:
true
,
"disableScroll"
:
true
}
},
...
...
@@ -27,15 +26,15 @@
"path"
:
"pages/index/learn"
,
"style"
:
{
"navigationBarTitleText"
:
"学习"
,
"navigationStyle"
:
"custom"
,
//隐藏系统导航栏
"disableScroll"
:
true
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"pages/index/mine"
,
"style"
:
{
"navigationBarTitleText"
:
"我的"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -47,8 +46,9 @@
"disableScroll"
:
true
}
}
],
"subPackages"
:
[{
],
"subPackages"
:
[
{
"root"
:
"pages/exam"
,
"pages"
:
[
{
...
...
@@ -74,42 +74,42 @@
"path"
:
"assessment"
,
"style"
:
{
"navigationBarTitleText"
:
"认证介绍"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"answer"
,
"style"
:
{
"navigationBarTitleText"
:
"考核认证"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"result"
,
"style"
:{
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"path"
:
"result"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"news-details"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"section"
,
"style"
:
{
"path"
:
"section"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"curriculum"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
}
},
{
...
...
@@ -117,7 +117,7 @@
"style"
:
{
"navigationBarTitleText"
:
"在线考试"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -125,18 +125,18 @@
"path"
:
"course-detail"
,
"style"
:
{
"navigationBarTitleText"
:
"培训视频"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
{
"path"
:
"exam-pass"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
}
}
]
...
...
@@ -149,7 +149,7 @@
"style"
:
{
"navigationBarTitleText"
:
"收获地址"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -158,7 +158,7 @@
"style"
:
{
"navigationBarTitleText"
:
"修改地址"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -168,8 +168,8 @@
"navigationBarTitleText"
:
"我的钱包"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
...
...
@@ -178,8 +178,8 @@
"navigationBarTitleText"
:
"提现"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
...
...
@@ -188,8 +188,8 @@
"navigationBarTitleText"
:
"收入流水"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
...
...
@@ -198,80 +198,77 @@
"navigationBarTitleText"
:
"结算账单"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"cert/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的证件"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"cert/detail"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件详情
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"cert/upload"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件上传
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"contract/index"
,
"style"
:{
"navigationBarTitleText"
:
""
,
//我的合同
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"contract/out"
,
"style"
:{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"customer/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"cert/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的证件"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"cert/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"证件详情"
,
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"cert/upload"
,
"style"
:
{
"navigationBarTitleText"
:
"证件上传"
,
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"contract/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的合同"
,
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"contract/out"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"customer/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"联系客服"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
},
},
{
"path"
:
"deposit/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"path"
:
"deposit/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"配件押金"
,
"enablePullDownRefresh"
:
false
}
},
},
{
"path"
:
"warehouse/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"path"
:
"warehouse/index"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"我的仓库"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"superLogin/index"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
},
{
"path"
:
"superLogin/index"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
}
]
]
},
{
"root"
:
"pages/order"
,
...
...
@@ -279,7 +276,7 @@
{
"path"
:
"complete"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单完工
"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
...
...
@@ -287,49 +284,62 @@
{
"path"
:
"feedback"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
过程反馈
"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"refuse"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单拒单
"
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"detail"
,
"style"
:
{
"path"
:
"detail"
,
"style"
:
{
"navigationBarTitleText"
:
"订单详情"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
{
"path"
:
"search"
,
"style"
:
{
"navigationBarTitleText"
:
"订单搜索"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"material"
,
"style"
:
{
"navigationBarTitleText"
:
"勘察材料"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
}
},
{
"path"
:
"document"
,
"style"
:
{
"navigationBarTitleText"
:
"安装文件"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
},
{
"path"
:
"search"
,
"style"
:
{
"navigationBarTitleText"
:
"订单搜索"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"material"
,
"style"
:
{
"navigationBarTitleText"
:
"勘察材料"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
}
}
},
{
"path"
:
"document-tag"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//
合作商或品牌标签列表
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
]
},
...
...
@@ -340,22 +350,22 @@
"path"
:
"index"
,
"style"
:
{
"navigationBarTitleText"
:
"拍照小工具"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"setting"
,
"style"
:
{
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"take"
,
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"拍照"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
...
...
@@ -366,18 +376,18 @@
"path"
:
"preview"
,
"style"
:
{
"navigationBarTitleText"
:
"照片预览"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"backgroundColor"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"white"
"navigationBarBackgroundColor"
:
"#333333"
,
"backgroundColor"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"white"
}
},
{
"path"
:
"list"
,
"style"
:
{
"navigationBarTitleText"
:
"规范展示"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
}
...
...
@@ -390,7 +400,7 @@
"path"
:
"index"
,
"style"
:
{
"navigationBarTitleText"
:
"入驻"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -436,7 +446,7 @@
"path"
:
"sign-contract"
,
"style"
:
{
"navigationBarTitleText"
:
"签约页面"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
},
...
...
@@ -454,7 +464,11 @@
"preloadRule"
:
{
"pages/index/index"
:
{
"network"
:
"all"
,
"packages"
:
[
"pages/order"
,
"pages/learn"
,
"pages/mine"
]
"packages"
:
[
"pages/order"
,
"pages/learn"
,
"pages/mine"
]
}
},
"globalStyle"
:
{
...
...
src/pages/index/index.vue
View file @
48c237ad
...
...
@@ -4,7 +4,7 @@
<scroll-view
style=
"height: 100%;"
scroll-y
@
scrolltolower=
"reachBottom"
:scroll-top=
"scrollTop"
@
scroll=
"scroll"
scroll-anchoring
scroll-y=
"true"
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
refresher-background=
"#F4F5F7"
@
refresherpulling=
"triggered = true"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
enable-back-to-top
>
@
refresherrestore=
"onRestore"
enable-back-to-top
>
<!--
<TabBarPage
title=
"扳手会"
>
-->
<image
class=
"banner-image"
:src=
"bannerImage"
@
click=
"handleClickBanner"
></image>
...
...
@@ -51,7 +51,7 @@
scroll-anchoring
>
-->
<view
v-for=
"(item, index) in orderList"
:key=
"index"
>
<OrderCell
:orderData=
"item"
type=
"waitAccept"
:location=
"location"
@
click=
"handleClick
(item.orderId)"
@
action=
"handleAction(item.orderId)
"
>
@
click=
"handleClick
"
@
action=
"handleClick
"
>
</OrderCell>
</view>
<u-loadmore
v-show=
"(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2"
:status=
"currentLoadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
...
...
@@ -166,15 +166,9 @@
this
.
getOrderCount
()
this
.
initSettleInfo
();
},
handleClick
(
orderId
)
{
// 点击了cell
this
.
viewOderItem
(
orderId
)
},
handleAction
(
orderId
)
{
// 点击了按钮
this
.
viewOderItem
(
orderId
)
},
viewOderItem
(
orderId
)
{
// 跳转工单详情页面
handleClick
(
item
,
title
)
{
// 跳转工单详情页面
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&title='
+
title
})
},
async
initSettleInfo
()
{
...
...
src/pages/index/learn.vue
View file @
48c237ad
...
...
@@ -7,7 +7,7 @@
<u-tabs-swiper
bg-color=
"#F4F5F7"
inactive-color=
"#999999"
font-size=
"28"
ref=
"uTabs"
:list=
"tabs"
:current=
"current"
@
change=
"tabsChange"
:is-scroll=
"false"
:bar-width=
"52"
swiperWidth=
"750"
></u-tabs-swiper>
<swiper
class=
"swiper_group"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper-item
@
touchmove
.
stop
.
prevent=
"stopTouchMove"
>
<scroll-view
scroll-y
style=
"
height:100%;
width:100%;"
>
<scroll-view
scroll-y
style=
"width:100%;"
>
<view
class=
"jf-currency-class"
>
<image
:src=
"jianBianImg"
mode=
""
class=
"current-img"
></image>
<view
class=
"class1"
style=
"position: relative;"
@
click=
"goToPrint"
>
...
...
@@ -19,21 +19,29 @@
<view
class=
"jf-line u-margin-right-30 u-margin-top-60"
>
去查看
</view>
</view>
</view>
<view
class=
"jf-currency-class"
>
<image
:src=
"jianbianImage"
mode=
""
class=
"current-img"
></image>
<view
class=
"class1"
style=
"position: relative;"
@
click=
"goToDocument"
>
<image
class=
"jf-img"
:src=
"anzhuangwenjianImage"
mode=
""
></image>
<view
class=
"right u-padding-top-10 u-padding-bottom-14 jf-right"
>
<view
class=
"u-font-32 font-bold u-margin-left-30 u-margin-top-30"
>
充电桩安装文件
</view>
<view
class=
"u-font-24 u-margin-left-30 u-margin-top-30"
>
请点击查看
</view>
</view>
<view
class=
"jf-line u-margin-right-30 u-margin-top-60 red-color"
>
去查看
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item
@
touchmove
.
stop
.
prevent=
"stopTouchMove"
>
<scroll-view
scroll-y
style=
"height:100%;width:100%;"
@
scrolltolower=
"onreachBottom"
scroll-y=
"true"
refresher-enabled=
"true"
:refresher-triggered=
"triggered"
:refresher-threshold=
"100"
@
refresherpulling=
"onPulling"
@
refresherrefresh=
"onRefresh"
@
refresherrestore=
"onRestore"
@
refresherabort=
"onAbort"
>
<view
v-for=
"item in list"
:key=
"item.id"
class=
"notice"
@
click=
"bbb(item)"
>
<view
class=
"n-head"
>
{{
item
.
title
}}
</view>
<view
class=
"news"
v-html=
"item.body"
>
<u-parse
:html=
"item.body"
></u-parse>
</view>
<u-line
color=
"#F4F5F7"
/>
<view
class=
"notice-bottom"
>
<view
class=
"notice-bottom-left"
>
{{
item
.
create_at
}}
</view>
<view
class=
"notice-bottom-right"
>
查看详情
</view>
<view
class=
"notice-bottom-left"
>
{{
item
.
create_at
}}
</view>
<view
class=
"notice-content"
>
<img
:src=
"item.img"
alt=
""
style=
"width:690rpx;height:260rpx;display:block"
>
<view
class=
"notice-content-bottom"
>
<view
class=
"n-head"
>
{{
item
.
title
}}
</view>
<view
class=
"news"
>
{{
item
.
text
}}
</view>
</view>
</view>
</view>
<view
v-shou=
"isLoadMore"
class=
"load-more"
>
...
...
@@ -119,7 +127,7 @@
</scroll-view>
</swiper-item>
<swiper-item
@
touchmove
.
stop
.
prevent=
"stopTouchMove"
>
<scroll-view
scroll-y
style=
"
height:100%;
width:100%;"
>
<scroll-view
scroll-y
style=
"width:100%;"
>
<view
class=
"title u-margin-top-10 u-margin-bottom-30"
>
通用认证
</view>
<view
class=
"currency-class"
>
<view
class=
"class1"
@
click=
"aaa(0)"
>
...
...
@@ -287,7 +295,7 @@ var examJson = {
desc
:
"通过本认证,是接单的必要条件"
,
condition
:
"随机20题,及格20题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
wgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
uwuguifan-d
.png"
,
id
:
2
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -299,7 +307,7 @@ var examJson = {
desc
:
"快速认证,是否具备接单操作能力"
,
condition
:
"随机20题,及格16题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
dgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
iedanguifan-d
.png"
,
id
:
2
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -313,7 +321,7 @@ var examJson = {
desc
:
"通过本认证,是接单的必要条件"
,
condition
:
"随机4题,及格4题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
wgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
uwuguifan-d
.png"
,
id
:
3
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -325,7 +333,7 @@ var examJson = {
desc
:
"快速认证,是否具备接单操作能力"
,
condition
:
"随机5题,及格5题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
dgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
iedanguifan-d
.png"
,
id
:
4
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -339,7 +347,7 @@ var examJson = {
desc
:
"通过本认证,是接单的必要条件"
,
condition
:
"随机4题,及格4题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
wgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"f
uwuguifan-d
.png"
,
id
:
3
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -351,7 +359,7 @@ var examJson = {
desc
:
"快速认证,是否具备接单操作能力"
,
condition
:
"随机5题,及格5题"
,
status
:
""
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
dgf-e-3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"j
iedanguifan-d
.png"
,
id
:
4
,
examId
:
""
,
examStatus
:
""
,
...
...
@@ -400,7 +408,7 @@ export default {
},
list
:
[],
rule
:
{
pic
:
process
.
uniEnv
.
qn_base_url
+
"guifan
@3x
.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"guifan
-d
.png"
,
},
courselist
:
[
{
...
...
@@ -429,8 +437,7 @@ export default {
pic
:
courseListJson
[
2
].
pic
,
id
:
courseListJson
[
2
].
id
,
sectionId
:
courseListJson
[
2
].
sectionId
,
}
,
},
{
title
:
courseListJson
[
3
].
title
,
desc
:
courseListJson
[
3
].
desc
,
...
...
@@ -470,7 +477,7 @@ export default {
loadStatus
:
"loading"
,
isLoadMore
:
false
,
exam
:
null
,
jianBianImg
:
process
.
uniEnv
.
qn_base_url
+
"jianbian
@3x_bak1
.png"
,
jianBianImg
:
process
.
uniEnv
.
qn_base_url
+
"jianbian
-fp
.png"
,
isReflesh
:
true
,
triggered
:
false
,
_freshing
:
false
,
...
...
@@ -478,7 +485,7 @@ export default {
};
},
onLoad
(
param
)
{
getApp
().
trackPage
(
'学习首页'
)
getApp
().
trackPage
(
"学习首页"
);
var
that
=
this
;
try
{
if
(
param
.
tabs
)
{
...
...
@@ -490,8 +497,14 @@ export default {
},
computed
:
{
bannerImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
"
banner-xx@3x
.png"
;
return
process
.
uniEnv
.
qn_base_url
+
"
xuexibanner-p
.png"
;
},
jianbianImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
"jianbian-p.png"
;
},
anzhuangwenjianImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
"wenjian-d.png"
;
},
},
onShow
:
function
(
param
)
{
try
{
...
...
@@ -512,14 +525,12 @@ export default {
.
getVersionInfo
(
version
)
.
then
((
res
)
=>
{
let
data
=
res
.
data
;
if
(
data
.
hasOwnProperty
(
'is_audit'
)
&&
data
.
is_audit
==
0
)
{
if
(
data
.
hasOwnProperty
(
"is_audit"
)
&&
data
.
is_audit
==
0
)
{
that
.
tabs
=
that
.
tabs2
;
that
.
version
=
false
that
.
version
=
false
;
}
})
.
catch
((
err
)
=>
{
});
.
catch
((
err
)
=>
{});
},
stopPull
()
{
let
that
=
this
;
...
...
@@ -564,6 +575,24 @@ export default {
stopTouchMove
()
{
return
false
;
},
//取文本第一张图片
imgUrlFun
(
str
)
{
var
data
=
""
;
str
.
replace
(
/<img
[^
>
]
*src=
[
'"
]([^
'"
]
+
)[^
>
]
*>/
,
function
(
match
,
capture
)
{
data
=
capture
;
}
);
return
data
;
},
//取文本信息
getText
(
str
)
{
return
str
.
replace
(
/<
[^
<>
]
+>/g
,
""
)
.
replace
(
/ /gi
,
""
)
.
replace
(
/
(\n)
/g
,
""
);
},
getNoticeList
()
{
let
that
=
this
;
this
.
$u
.
api
...
...
@@ -587,8 +616,11 @@ export default {
res
.
data
[
i
].
create_at
,
"yyyy.MM.dd hh:mm"
);
res
.
data
[
i
].
img
=
this
.
imgUrlFun
(
res
.
data
[
i
].
body
);
res
.
data
[
i
].
text
=
this
.
getText
(
res
.
data
[
i
].
body
);
}
that
.
list
=
that
.
list
.
concat
(
res
.
data
);
console
.
log
(
"消息列表"
,
that
.
list
);
}
if
(
res
.
data
.
length
>=
5
)
{
that
.
isLoadMore
=
false
;
...
...
@@ -715,72 +747,78 @@ export default {
},
});
},
// 安装文件
goToDocument
()
{
this
.
$u
.
route
({
url
:
'pages/order/document'
,
})
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo
()
{
uni
.
hideLoading
();
let
that
=
this
;
let
token
=
that
.
vuex_token
;
let
length
=
this
.
examList
.
length
;
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
let
examId
=
this
.
examList
[
i
].
id
;
this
.
$u
.
api
.
getExamResult
(
examId
)
.
then
((
res
)
=>
{
if
(
res
.
code
!=
200
)
{
console
.
log
(
"getUserExamInfo 200 err"
);
this
.
$u
.
api
.
getExamResult
(
examId
)
.
then
((
res
)
=>
{
if
(
res
.
code
!=
200
)
{
console
.
log
(
"getUserExamInfo 200 err"
);
uni
.
showToast
({
icon
:
"none"
,
title
:
"获取考试信息失败"
,
});
}
this
.
examList
[
i
].
examId
=
res
.
data
.
id
;
this
.
examList
[
i
].
examStatus
=
res
.
data
.
examStatus
;
//i;//
this
.
examList
[
i
].
questionTime
=
res
.
data
.
questionTime
;
let
examResult
=
res
.
data
.
examLevelResult
;
this
.
examList
[
i
].
status
=
examResult
!=
""
?
examResult
:
"未通过"
;
//动态获取条件
let
ruleDisc
=
res
.
data
.
ruleDisc
;
let
targetIndex
=
ruleDisc
.
indexOf
(
"("
);
if
(
targetIndex
)
{
this
.
examList
[
i
].
condition
=
ruleDisc
.
substr
(
targetIndex
+
1
)
.
replace
(
")"
,
""
);
}
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that
.
exam
=
res
.
data
;
if
(
res
.
data
.
examStatus
==
2
)
{
return
;
}
if
(
res
.
data
.
examStatus
==
1
)
{
that
.
examList
[
i
].
isComplete
=
this
.
examList
[
i
].
status
==
"已通过"
;
that
.
examScore
=
res
.
data
.
examScore
;
return
;
}
if
(
res
.
data
.
examStatus
==
0
)
{
that
.
userExamId
=
res
.
data
.
id
;
}
})
.
catch
((
err
)
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
icon
:
"none"
,
title
:
"获取考试信息失败"
,
});
}
this
.
examList
[
i
].
examId
=
res
.
data
.
id
;
this
.
examList
[
i
].
examStatus
=
res
.
data
.
examStatus
;
//i;//
this
.
examList
[
i
].
questionTime
=
res
.
data
.
questionTime
;
let
examResult
=
res
.
data
.
examLevelResult
;
this
.
examList
[
i
].
status
=
examResult
!=
""
?
examResult
:
"未通过"
;
//动态获取条件
let
ruleDisc
=
res
.
data
.
ruleDisc
;
let
targetIndex
=
ruleDisc
.
indexOf
(
"("
);
if
(
targetIndex
)
{
this
.
examList
[
i
].
condition
=
ruleDisc
.
substr
(
targetIndex
+
1
)
.
replace
(
")"
,
""
);
}
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that
.
exam
=
res
.
data
;
if
(
res
.
data
.
examStatus
==
2
)
{
return
;
}
if
(
res
.
data
.
examStatus
==
1
)
{
that
.
examList
[
i
].
isComplete
=
this
.
examList
[
i
].
status
==
"已通过"
;
that
.
examScore
=
res
.
data
.
examScore
;
return
;
}
if
(
res
.
data
.
examStatus
==
0
)
{
that
.
userExamId
=
res
.
data
.
id
;
}
})
.
catch
((
err
)
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
icon
:
"none"
,
title
:
"获取考试信息失败"
,
});
});
}
},
//跳转到assessment页面
aaa
(
index
)
{
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
//考试完成分成通过、未通过
getApp
().
globalData
.
questionTime
=
this
.
examList
[
index
].
questionTime
;
getApp
().
globalData
.
questionTime
=
this
.
examList
[
index
].
questionTime
;
var
examInfo
=
this
.
examList
[
index
];
wx
.
navigateTo
({
url
:
"/pages/learn/assessment?examId="
+
examInfo
.
id
,
...
...
@@ -801,6 +839,7 @@ export default {
var
news
=
{
body
:
e
.
body
,
title
:
e
.
title
,
create_at
:
e
.
create_at
,
};
let
that
=
this
;
wx
.
navigateTo
({
...
...
@@ -828,7 +867,7 @@ export default {
.banner
{
width
:
690
rpx
;
height
:
2
4
0
rpx
;
height
:
2
2
0
rpx
;
margin-top
:
10
rpx
;
}
...
...
@@ -854,26 +893,40 @@ export default {
min-height
:
370
rpx
;
margin-top
:
36
rpx
;
overflow
:
hidden
;
background-color
:
#ffffff
;
border-radius
:
12
rpx
;
padding
:
30
rpx
;
}
.notice-content
{
background
:
#ffffff
;
width
:
100%
;
border-radius
:
12
rpx
;
overflow
:
hidden
;
}
.notice-content-bottom
{
height
:
150
rpx
;
padding
:
0
30
rpx
;
overflow
:
hidden
;
}
.n-head
{
text-align
:
left
;
font-size
:
32
rpx
;
font-weight
:
bold
;
color
:
#333333
;
margin-top
:
30
rpx
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.news
{
height
:
168
rpx
;
overflow
:
hidden
;
margin-top
:
30
rpx
;
/* margin-top: 30rpx; */
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
font-size
:
24
rpx
;
color
:
#666666
;
line-height
:
34
rpx
;
margin-bottom
:
20
rpx
;
margin-top
:
16
rpx
;
}
/* 在线学习 */
...
...
@@ -893,9 +946,10 @@ export default {
.jf-currency-class
{
width
:
100%
;
height
:
180
rpx
;
position
:
absolute
;
/* position: absolute; */
position
:
relative
;
border-radius
:
12
rpx
;
margin-top
:
6
0
rpx
;
margin-top
:
8
0
rpx
;
}
.title
{
...
...
@@ -930,6 +984,7 @@ export default {
.img
{
width
:
160
rpx
;
height
:
120
rpx
;
border-radius
:
12
rpx
;
}
.learn-img
{
...
...
@@ -943,6 +998,7 @@ export default {
position
:
absolute
;
bottom
:
5
rpx
;
left
:
30
rpx
;
border-radius
:
10
rpx
;
}
.right
{
...
...
@@ -988,17 +1044,18 @@ swiper {
}
.jf-line
{
display
:
flex
;
justify-content
:
space-between
;
width
:
120
rpx
;
height
:
52
rpx
;
border-radius
:
26
rpx
;
background-color
:
#ffffff
;
color
:
#2272ff
;
text-align
:
center
;
padding-left
:
20
rpx
;
padding-top
:
6
rpx
;
margin-top
:
20
rpx
;
font-size
:
24
rpx
;
line-height
:
52
rpx
;
}
.red-color
{
color
:
#FA5A49
;
}
.u-progress
{
...
...
@@ -1056,8 +1113,10 @@ swiper {
.notice-bottom-left
{
font-size
:
24
rpx
;
font-weight
:
500
;
color
:
#999999
;
float
:
left
;
text-align
:
center
;
margin-bottom
:
20
rpx
;
}
.notice-bottom-right
{
...
...
@@ -1094,7 +1153,7 @@ swiper {
.current-img
{
width
:
100%
;
height
:
1
00%
;
height
:
1
80
rpx
;
position
:
absolute
;
}
...
...
src/pages/index/mine.vue
View file @
48c237ad
...
...
@@ -23,7 +23,7 @@
<u-cell-group
:border=
"false"
>
<view
v-for=
"(item, index) in items"
:key=
"index"
>
<u-cell-item
:value=
"item.value"
:border-bottom=
"false"
@
click=
"handleClick(item.pathName)"
>
<image
slot=
"icon"
:src=
"qn
Path + item.icon
"
:style=
"item.imageStyle"
></image>
<image
slot=
"icon"
:src=
"qn
File(item.icon)
"
:style=
"item.imageStyle"
></image>
<view
slot=
"title"
class=
"item-title"
>
{{
item
.
title
}}
</view>
<view
slot=
"value"
class=
"item-value"
>
{{
value
}}
</view>
</u-cell-item>
...
...
@@ -43,11 +43,12 @@
export
default
{
data
()
{
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
serviceTel
:
'18124099271'
,
showSuperButton
:
false
,
show
:
false
,
content
:
'是否确认退出该账户?'
content
:
'是否确认退出该账户?'
,
wodebeijingImage
:
''
,
placeholderImage
:
''
}
},
computed
:
{
...
...
@@ -122,12 +123,6 @@
headImageUrl
()
{
return
this
.
avatar
||
this
.
placeholderImage
},
wodebeijingImage
()
{
return
util
.
imageCache
(
this
,
'wodebeijing.png'
)
},
placeholderImage
()
{
return
util
.
imageCache
(
this
,
'touxiang.png'
)
},
headImageStyle
()
{
return
this
.
avatar
?
'width:136rpx; height:136rpx;border-radius:68rpx'
:
'width:144rpx; height:144rpx;border-radius:72rpx'
},
...
...
@@ -135,7 +130,7 @@
return
this
.
avatar
?
136
:
144
}
},
onLoad
()
{
async
onLoad
()
{
app
.
trackPage
(
'我的首页'
)
if
(
this
.
vuex_token
)
{
if
(
!
this
.
showSuperButton
)
{
...
...
@@ -146,9 +141,13 @@
this
.
getData
()
}
}
this
.
wodebeijingImage
=
this
.
qnFile
(
'wodebeijing.png'
)
this
.
placeholderImage
=
this
.
qnFile
(
'touxiang.png'
)
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
getData
()
{
let
self
=
this
app
.
getBaseInfo
(
self
);
...
...
src/pages/index/order.vue
View file @
48c237ad
...
...
@@ -28,8 +28,8 @@
<NoOrder
v-if=
"noMore"
type=
"black"
:customStyle=
"noOrderCustomStyle"
/>
<template
v-else
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick
(item)
"
@
action=
"handle
Action(item)
"
>
</OrderCell>
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick"
@
action=
"handle
Click
"
>
</OrderCell>
</view>
<u-loadmore
v-show=
"(pageNumber == 1 && loaded) || pageNumber > 2"
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
</
template
>
...
...
@@ -282,17 +282,15 @@
}
});
},
viewOderItem
(
orderId
)
{
// 跳转工单详情页面
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
})
},
handleClick
(
item
)
{
handleClick
(
item
,
title
)
{
console
.
log
(
item
,
title
)
if
(
item
.
orderStatus
===
86
||
item
.
orderStatus
===
88
){
this
.
filish
(
item
)
return
}
this
.
viewOderItem
(
item
.
orderId
)
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&title='
+
title
})
},
filish
(
item
){
// 去完工
...
...
@@ -303,15 +301,16 @@
+
"&inGuaranteePeriod="
+
item
.
inGuaranteePeriod
+
"&partnerCompanyId="
+
item
.
partnerCompanyId
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
+
"&maintainStep="
+
item
.
maintainStep
})
},
handleAction
(
item
)
{
if
(
item
.
orderStatus
===
86
||
item
.
orderStatus
===
88
){
this
.
filish
(
item
)
return
}
this
.
viewOderItem
(
item
.
orderId
)
},
//
handleAction(item) {
//
if(item.orderStatus===86 || item.orderStatus===88){
//
this.filish(item)
//
return
//
}
//
this.viewOderItem(item.orderId)
//
},
handleClickSearch
()
{
uni
.
navigateTo
({
url
:
'pages/order/search'
...
...
src/pages/learn/news-details.vue
View file @
48c237ad
<
template
>
<
template
>
<view>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000000"
:border-bottom=
"false"
>
</u-navbar>
<view
class=
"title"
>
{{
title
}}
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000000"
:border-bottom=
"false"
>
</u-navbar>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"creat_at"
>
{{
create_at
}}
</view>
<view
class=
"u-content"
>
<u-parse
:html=
"body"
:tag-style=
"style"
></u-parse>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
title
:
''
,
body
:
''
}
},
onLoad
()
{
getApp
().
trackPage
(
'消息通知详情页'
)
var
that
=
this
;
const
eventChannel
=
this
.
getOpenerEventChannel
()
eventChannel
.
on
(
'acceptDataFromLearn'
,
function
(
data
)
{
that
.
title
=
data
.
title
;
that
.
body
=
data
.
body
;
})
this
.
$u
.
mpShare
.
path
=
''
},
}
</
script
>
<
style
>
.title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
margin-left
:
30
rpx
;
margin-top
:
30
rpx
;
}
.u-content
{
font-size
:
24
rpx
;
line-height
:
36
rpx
;
color
:
#666666
;
margin-left
:
30
rpx
;
margin-top
:
30
rpx
;
margin-right
:
30
rpx
;
}
</
style
>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
title
:
""
,
body
:
""
,
create_at
:
""
,
};
},
onLoad
()
{
getApp
().
trackPage
(
"消息通知详情页"
);
var
that
=
this
;
const
eventChannel
=
this
.
getOpenerEventChannel
();
eventChannel
.
on
(
"acceptDataFromLearn"
,
function
(
data
)
{
that
.
title
=
data
.
title
;
that
.
body
=
data
.
body
;
that
.
create_at
=
data
.
create_at
;
console
.
log
(
data
);
});
this
.
$u
.
mpShare
.
path
=
""
;
},
};
</
script
>
<
style
>
.title
{
font-size
:
32
rpx
;
font-weight
:
bold
;
margin-left
:
30
rpx
;
margin-top
:
30
rpx
;
}
.u-content
{
font-size
:
24
rpx
;
line-height
:
36
rpx
;
color
:
#666666
;
margin-left
:
30
rpx
;
margin-right
:
30
rpx
;
}
.creat_at
{
font-size
:
24
rpx
;
color
:
#999999
;
margin-left
:
30
rpx
;
margin-top
:
20
rpx
;
}
rich-text
{
margin-top
:
40
rpx
;
display
:
block
;
}
</
style
>
src/pages/login/index.vue
View file @
48c237ad
<
template
>
<view
class=
""
>
<!--
<w-navbar></w-navbar>
-->
<view
class=
"backView"
>
<view
class=
"login-block"
v-if=
"needAuth"
>
<u-image
class=
"u-flex u-row-center logo"
:src=
"logo"
width=
"200"
height=
"200"
>
<u-image
:fade=
"false"
class=
"u-flex u-row-center logo"
:src=
"logo"
width=
"200"
height=
"200"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
<u-image
class=
"u-flex u-row-center logo2"
:src=
"logo2"
width=
"214"
height=
"60"
>
<u-image
:fade=
"false"
class=
"u-flex u-row-center logo2"
:src=
"logo2"
width=
"214"
height=
"60"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</view>
<view
class=
"bind-block"
v-else
>
<u-image
class=
"u-flex u-row-between logo"
:src=
"logo"
width=
"148"
height=
"148"
>
<u-image
:fade=
"false"
class=
"u-flex u-row-between logo"
:src=
"logo"
width=
"148"
height=
"148"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
...
...
@@ -38,7 +39,6 @@ const app = getApp()
export
default
{
data
()
{
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
needAuth
:
true
,
TimeID
:
-
1
,
loginTitle
:
'用户登录'
,
...
...
@@ -50,10 +50,10 @@ export default {
},
computed
:
{
logo
()
{
return
util
.
imageCache
(
this
,
'logo.png'
)
return
this
.
qnFile
(
'logo.png'
)
},
logo2
()
{
return
util
.
imageCache
(
this
,
'logo-2.png'
)
return
this
.
qnFile
(
'logo-2.png'
)
},
},
onLoad
(
e
)
{
...
...
@@ -67,6 +67,9 @@ export default {
this
.
getCode
()
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
async
getCode
()
{
login
.
appLogin
().
then
(
res
=>
{
this
.
code
=
res
.
code
...
...
@@ -184,7 +187,7 @@ export default {
}
})
}
else
{
th
is
.
toLogin
(
params
)
th
at
.
toLogin
(
params
)
}
}
else
{
uni
.
showModal
({
...
...
src/pages/mine/wallet/index.vue
View file @
48c237ad
...
...
@@ -4,7 +4,7 @@
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"wallet-content-view"
>
<view
class=
"header-view"
>
<image
class=
"header-image"
:src=
"q
ianbaobeijing
"
></image>
<image
class=
"header-image"
:src=
"q
nFile('qianbaobeijing.png')
"
></image>
</view>
<view
class=
"survey-view"
>
<view
class=
"survey-top-view"
>
...
...
@@ -109,9 +109,6 @@
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
qianbaobeijing
()
{
return
util
.
imageCache
(
this
,
'qianbaobeijing.png'
)
},
buttonStyle
()
{
return
{
width
:
"200rpx"
,
...
...
@@ -139,6 +136,9 @@
this
.
loadStatement
()
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
// 提现
handleClickWithdraw
()
{
this
.
$u
.
route
({
...
...
src/pages/mine/wallet/settlement.vue
View file @
48c237ad
...
...
@@ -20,7 +20,7 @@
</view>
</view>
</view>
<image
:src=
"
liushuibeijingImage
"
class=
"head-back-image"
mode=
"widthFix"
></image>
<image
:src=
"
qnFile('liushuibeijing.png')
"
class=
"head-back-image"
mode=
"widthFix"
></image>
<view
class=
"list-view"
v-if=
"hasInfo"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<u-gap
height=
"20"
></u-gap>
...
...
@@ -31,7 +31,7 @@
</view>
</view>
<view
class=
"list-view-empty"
v-else
>
<u-image
class=
"empty-image"
:src=
"banner"
width=
"374"
height=
"246"
mode=
"widthFix"
:fade=
"
true"
duration=
"450
"
>
<u-image
class=
"empty-image"
:src=
"banner"
width=
"374"
height=
"246"
mode=
"widthFix"
:fade=
"
false
"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
...
...
@@ -64,9 +64,6 @@
}
},
computed
:
{
liushuibeijingImage
()
{
return
util
.
imageCache
(
this
,
'liushuibeijing.png'
)
},
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
...
...
@@ -74,7 +71,7 @@
return
this
.
loading
||
this
.
info
.
payableRecordExtendDtos
&&
this
.
info
.
payableRecordExtendDtos
.
length
},
banner
()
{
return
util
.
imageCache
(
this
,
'receipt.png'
)
return
this
.
qnFile
(
'receipt.png'
)
},
},
onLoad
()
{
...
...
@@ -82,6 +79,9 @@
this
.
loadPayRecord
()
},
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
async
loadPayRecord
()
{
let
self
=
this
self
.
loading
=
true
...
...
src/pages/mine/wallet/statement.vue
View file @
48c237ad
...
...
@@ -20,7 +20,7 @@
</view>
</view>
</view>
<image
:src=
"
liushuibeijingImage
"
class=
"head-back-image"
mode=
"widthFix"
></image>
<image
:src=
"
qnFile('liushuibeijing.png')
"
class=
"head-back-image"
mode=
"widthFix"
></image>
<view
class=
"list-view"
v-if=
"hasInfo"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<u-gap
height=
"20"
></u-gap>
...
...
@@ -31,7 +31,7 @@
</view>
</view>
<view
class=
"list-view-empty"
v-else
>
<u-image
class=
"empty-image"
:src=
"banner"
width=
"374"
height=
"246"
mode=
"widthFix"
:fade=
"
true"
duration=
"450
"
>
<u-image
class=
"empty-image"
:src=
"banner"
width=
"374"
height=
"246"
mode=
"widthFix"
:fade=
"
false
"
>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
...
...
@@ -84,14 +84,11 @@
}
},
liushuibeijingImage
()
{
return
util
.
imageCache
(
this
,
'liushuibeijing.png'
)
},
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
},
banner
()
{
return
util
.
imageCache
(
this
,
'receipt.png'
)
return
this
.
qnFile
(
'receipt.png'
)
},
hasInfo
()
{
return
this
.
loading
||
this
.
data
.
statementList
&&
this
.
data
.
statementList
.
length
...
...
@@ -101,7 +98,10 @@
getApp
().
trackPage
(
'收入流水列表页'
)
this
.
loadStatement
()
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
bindDateChange
:
function
(
e
)
{
this
.
date
=
e
.
target
.
value
this
.
loadStatement
()
...
...
src/pages/order/complete.vue
View file @
48c237ad
<
template
>
<view
class=
"com-content"
>
<complete-check
:show=
"completeCheckStatus"
:list-data=
"completeCheckResult"
:pass=
"pass"
@
close=
"closeCheckResult"
@
handle=
"handerProgrom"
@
change=
"confirm"
></complete-check>
<view
class=
"u-wrap"
>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold>
</u-navbar>
<u-tabs
v-show=
"showTab"
class=
"order-tabs"
ref=
"tabs"
:current=
"tabIndex"
name=
"panelName"
:list=
"list"
@
change=
"tabsChange"
:is-scroll=
"false"
bg-color=
"#2272FF"
inactive-color=
"#a6c6ff"
active-color=
"#fff"
height=
"80"
font-size=
"32"
></u-tabs>
<view
:class=
"['u-menu-wrap',
{'one': !showTab}]">
<scroll-view
scroll-y
scroll-with-animation
class=
"u-tab-view menu-scroll-view"
:scroll-top=
"scrollTop"
v-if=
"list[tabIndex].items.length > 1 && showTab"
>
<view
v-for=
"(item,index) in list[tabIndex].items"
:key=
"index"
class=
"u-tab-item"
:class=
"[current == index ? 'u-tab-item-active' : '']"
@
tap
.
stop=
"swichMenu(index)"
>
<text
class=
"u-line-1"
>
{{
item
.
name
}}
</text>
</view>
</scroll-view>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
:scroll-into-view=
"itemId"
>
<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"
:id=
"`item$
{item.fieldsId}`">
<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$
{groupIndex}${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
class=
"pg-complete"
>
<complete-check
:show=
"completeCheck.status"
:list-data=
"completeCheck.result"
:pass=
"pass"
@
close=
"closeCheckResult"
@
confirm=
"confirm"
:confirm-button-text=
"completeCheck.confirmText"
:cancel-button-text=
"completeCheck.cancelText"
></complete-check>
<view
class=
"com-content"
>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" :title="list[tabIndex].panelName" title-bold>
</u-navbar>
<u-tabs
class=
"order-tabs"
ref=
"tabs"
:current=
"current"
name=
"panelName"
:list=
"tabList"
@
change=
"swichMenu"
bg-color=
"#2272FF"
inactive-color=
"#a6c6ff"
active-color=
"#fff"
height=
"80"
font-size=
"32"
></u-tabs>
<view
class=
"u-menu-wrap"
>
<scroll-view
:scroll-top=
"scrollRightTop"
style=
"height: 100%;"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
:scroll-into-view=
"itemId"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<template
v-for=
"(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"
>
<view
class=
"class-item"
:id=
"'item' + groupIndex"
:key=
"groupIndex"
>
<view
class=
"title"
>
{{
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"
:id=
"`item$
{item.fieldsId}`">
<view
class=
"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>
<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] || ""'
<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] || ""'
:disabled=
"item.disabled || false"
:slotContent=
"item.fieldsInfo"
@
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] || ""'
:disabled=
"item.disabled || false"
@
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$
{groupIndex}${itemIndex}`"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :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>
<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-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}]"
>
<u-button
class=
"btn-submit"
@
click=
"saveComplete"
type=
"primary"
shape=
"circle"
:custom-style=
"customStyle"
:hover-class=
"submitStatus ? '' : 'none'"
>
暂存
</u-button>
<u-button
class=
"btn-submit"
@
click=
"orderFinish"
v-if=
"tabIndex===list.length - 1"
type=
"primary"
shape=
"circle"
:custom-style=
"buttonStyle"
:hover-class=
"submitStatus ? '' : 'none'"
>
完工
</u-button>
<u-button
class=
"btn-submit"
@
click=
"nextStep"
:custom-style=
"buttonStyle"
v-else
<u-button
class=
"btn-submit"
@
click=
"nextStep"
:custom-style=
"buttonStyle"
type=
"primary"
shape=
"circle"
:hover-class=
"submitStatus ? '' : 'none'"
>
下一步
{{ tabIndex === list.length - 1 ? '提交' : '下一步' }}
</u-button>
</view>
</view>
...
...
@@ -122,14 +106,105 @@
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
import
XhLocation
from
'@/components/createCom/XhLocation.vue'
import
XhScan
from
'@/components/createCom/XhScan.vue'
import
XhPicker
from
'@/components/createCom/XhPicker.vue'
import
XhTime
from
'@/components/createCom/XhTime.vue'
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
;
import
XhLabel
from
"../../components/createCom/XhLabel"
;
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'
import
baseFile
from
'@/components/upload/index'
import
Detail
from
"@/components/order/detail.vue"
// 表单类型map
const
formType
=
new
Map
([
[
'text'
,
[
'input'
,
'textarea'
]],
[
'password'
,
[
'password'
,
'input'
]],
[
'textarea'
,
[
'input'
,
'digit'
]],
[
'number'
,
[
'input'
,
'digit'
]],
[
'decimal'
,
[
'input'
,
'digit'
]],
[
'double'
,
[
'input'
,
'digit'
]],
[
'integer'
,
[
'input'
,
'digit'
]],
[
'string'
,
[
'input'
,
'text'
]],
[
'jscode'
,
[
'input'
,
'text'
]],
[
'multiinput'
,
[
'multiinput'
,
'text'
]],
[
'select'
,
[
'select'
,
'text'
]],
[
'specifications'
,
[
'select'
,
'text'
]],
[
'radio'
,
[
'radio'
,
'text'
]],
[
'checkbox'
,
[
'checkbox'
,
'text'
]],
[
'file'
,
[
'file'
,
'text'
]],
[
'photos'
,
[
'file'
,
'text'
]],
[
'location'
,
[
'location'
,
'text'
]],
[
'scan'
,
[
'scan'
,
'text'
]],
[
'machine_code'
,
[
'scan'
,
'text'
]],
[
'service_measures'
,
[
'servicemeasure'
,
'text'
]],
[
'time'
,
[
'time'
,
'text'
]],
[
'date'
,
[
'time'
,
'text'
]],
[
'form'
,
[
'form'
,
'text'
]],
[
'label'
,
[
'label'
,
'text'
]],
])
/**
* modal 弹窗校验
* @description 用于校验下一步的动作
* @property {String} name 当前的订单阶段
* @property {Boolean} pass 是否通过校验
* @property {String}} type 是否有二次勘测或二次安装
* @property {submit} submit 提交或下一步
*/
const
actions
=
(
name
,
pass
,
type
,
submit
)
=>
{
const
handerProgrom
=
{
perfect
:
{
confirmText
:
'去完善'
,
action
:
'handerProgrom'
},
appointment
:
{
confirmText
:
'好的,再次预约'
,
action
:
'appointment'
},
next
:
{
confirmText
:
'下一步'
,
action
:
'nextAction'
},
noPerfectSubmit
:
{
confirmText
:
'去完善'
,
action
:
'handerProgrom'
,
cancelText
:
'部分提交'
,
cancelAction
:
'appointment'
},
submit
:
{
confirmText
:
'提交'
,
action
:
'orderFinish'
,
},
confirm
:
{
confirmText
:
'确定'
,
action
:
'nextAction'
,
}
}
if
(
name
===
'partnerInspectItem'
)
{
// 勘察
if
(
!
pass
)
return
handerProgrom
.
perfect
return
type
?
(
type
===
'01'
?
handerProgrom
.
next
:
handerProgrom
.
appointment
)
:
handerProgrom
.
perfect
}
else
if
(
name
===
'partnerInstallItem'
)
{
// 安装
let
hander
=
''
switch
(
type
){
case
'01'
:
// 安装完成
hander
=
!
pass
?
handerProgrom
.
perfect
:
handerProgrom
.
next
break
;
case
'02'
:
// 二次安装
hander
=
!
pass
?
handerProgrom
.
noPerfectSubmit
:
handerProgrom
.
appointment
break
;
case
'03'
:
//不安装
hander
=
handerProgrom
.
confirm
break
;
default
:
hander
=
handerProgrom
.
perfect
break
;
}
return
hander
}
else
{
// 基础信息
if
(
!
pass
)
return
handerProgrom
.
perfect
return
submit
?
handerProgrom
.
submit
:
handerProgrom
.
next
}
}
export
default
{
data
()
{
return
{
...
...
@@ -143,7 +218,7 @@
tabIndex
:
0
,
scrollTop
:
0
,
//tab标题的滚动条位置
oldScrollTop
:
0
,
current
:
0
,
// 预设当前项的值
current
:
null
,
// 预设当前项的值
menuHeight
:
0
,
// 左边菜单的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
...
...
@@ -155,8 +230,14 @@
form
:
{
// 一维表单
},
submitBtnStatus
:
false
,
completeCheckStatus
:
false
,
completeCheckResult
:
[],
completeCheck
:
{
status
:
false
,
resulut
:
[],
confirmText
:
'去完善'
,
cancelText
:
''
,
action
:
''
,
cancelAction
:
''
},
waitHandlerPanelIndex
:
0
,
waitHandlerGroupIndex
:
0
,
waitHandlerEleIndex
:
0
,
...
...
@@ -174,7 +255,8 @@
takeStatus
:
false
,
currentItemDate
:{},
photoItem
:
{},
showTab
:
true
maintainStep
:
'partnerInspectItem'
,
// showTab: true,
}
},
components
:
{
...
...
@@ -186,11 +268,11 @@
XhFiles
,
XhLocation
,
XhScan
,
XhPicker
,
XhTime
,
XhServiceMeasure
,
XhServiceMore
,
XhLabel
,
Detail
,
'take-photo'
:
takePhoto
},
mixins
:
[
baseFile
],
...
...
@@ -200,13 +282,15 @@
onLoad
(
option
)
{
getApp
().
trackPage
(
'订单完工信息页'
)
if
(
option
)
{
this
.
maintainStep
=
option
.
maintainStep
this
.
orderId
=
option
.
orderId
this
.
categoryId
=
option
.
categoryId
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
)
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
this
.
showTab
=
option
.
partnerCompanyName
==
'挚达充电桩'
this
.
categoryId
=
option
.
categoryId
this
.
orderServiceType
=
decodeURIComponent
(
option
.
orderServiceType
)
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
// this.showTab =item.partnerCompanyName == '挚达充电桩'
}
else
{
this
.
orderId
=
11880091
this
.
categoryId
=
1100000214
...
...
@@ -215,14 +299,13 @@
}
this
.
getCompleteData
()
},
onReady
()
{
// 导航栏滚动切换
this
.
getMenuItemTop
()
},
updated
()
{
//console.log(this.form.name, 'form.name')
},
computed
:
{
tabList
()
{
// 没有数据的时候tab要有占位数据,不然有页面有晃动
return
this
.
list
.
length
>
0
?
this
.
list
[
this
.
tabIndex
].
items
:
[{
name
:
''
}]
},
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
},
...
...
@@ -258,11 +341,13 @@
},
methods
:
{
getCompleteData
()
{
//获取工单配置的完工项目
let
self
=
this
if
(
self
.
orderId
){
self
.
$u
.
api
.
getCompleteConfigAndData
(
self
.
orderId
).
then
((
res
)
=>
{
uni
.
showLoading
({
title
:
'加载中'
})
if
(
this
.
orderId
){
this
.
$u
.
api
.
getCompleteConfigAndData
(
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
self
.
initData
(
res
)
this
.
initData
(
res
)
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
...
...
@@ -273,100 +358,33 @@
}
},
initData
(
res
)
{
for
(
var
item
of
res
.
data
.
config
)
{
for
(
var
i
of
item
.
items
)
{
for
(
var
d
of
i
.
items
)
{
var
inputType
=
'text'
var
formType
=
''
var
type
=
d
.
fieldsType
.
toLocaleLowerCase
()
switch
(
type
)
{
case
'text'
:
inputType
=
'textarea'
formType
=
'input'
break
case
'password'
:
inputType
=
'password'
formType
=
'input'
break
case
'textarea'
:
case
'number'
:
case
'decimal'
:
case
'double'
:
case
'integer'
:
formType
=
'input'
inputType
=
'digit'
break
case
'string'
:
formType
=
'input'
,
inputType
=
'text'
break
case
'multiinput'
:
formType
=
'multiinput'
inputType
=
'text'
break
;
case
'select'
:
case
'specifications'
:
formType
=
'select'
inputType
=
'text'
break
case
'radio'
:
formType
=
'radio'
inputType
=
'text'
break
case
'checkbox'
:
formType
=
'checkbox'
inputType
=
'text'
break
case
'file'
:
case
'photos'
:
formType
=
'file'
inputType
=
'text'
break
case
'location'
:
formType
=
'location'
inputType
=
'text'
break
case
'scan'
:
case
'machine_code'
:
formType
=
'scan'
inputType
=
'text'
break
case
'picker'
:
case
'mutipicker'
:
formType
=
'picker'
inputType
=
'text'
break
case
'service_measures'
:
formType
=
'servicemeasure'
inputType
=
'text'
break
case
'time'
:
case
'date'
:
formType
=
'time'
inputType
=
'text'
break
case
'form'
:
formType
=
'form'
inputType
=
'text'
break
case
'label'
:
formType
=
'label'
inputType
=
'text'
break
}
d
.
formType
=
formType
d
.
inputType
=
inputType
this
.
form
=
res
.
data
.
value
||
{}
const
list
=
res
.
data
.
config
.
sort
((
a
,
b
)
=>
a
.
order
-
b
.
order
)
list
.
forEach
((
item
,
index
)
=>
{
if
(
this
.
maintainStep
===
item
.
panelFieldsName
)
this
.
tabIndex
=
index
item
.
items
.
forEach
(
v
=>
{
v
.
items
.
forEach
(
d
=>
{
const
type
=
d
.
fieldsType
.
toLocaleLowerCase
()
const
formMap
=
formType
.
get
(
type
)
||
formType
.
get
(
'text'
)
d
.
formType
=
formMap
[
0
]
d
.
inputType
=
formMap
[
1
]
if
(
d
.
fieldsId
==
200
&&
res
.
data
.
value
)
{
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
}
}
}
}
this
.
list
=
res
.
data
.
config
this
.
showTab
=
this
.
list
.
length
>
1
this
.
form
=
res
.
data
.
value
||
{}
if
(
d
.
fieldsId
===
252
||
d
.
fieldsId
===
253
)
{
// 申请费用计算
this
.
calcMoney
()
}
})
})
})
this
.
list
=
list
// this.showTab = this.list.length > 1
this
.
current
=
0
// 异常单处理
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
()
uni
.
hideLoading
()
},
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
...
...
@@ -422,90 +440,173 @@
})
},
checkCompleteItem
(){
let
self
=
this
let
checkResult
=
[]
let
pass
=
true
let
first
=
true
self
.
list
.
forEach
((
panel
,
panelIndex
)
=>
{
let
panelResult
=
{
label
:
panel
.
panelName
,
submitted
:
0
,
required
:
0
,
pass
:
true
}
panel
.
items
.
forEach
((
group
,
groupIndex
)
=>
{
const
lists
=
this
.
tabList
lists
.
forEach
((
group
,
groupIndex
)
=>
{
const
checkRequired
=
group
.
items
.
some
(
v
=>
v
.
required
)
if
(
checkRequired
)
{
let
panelResult
=
{
label
:
group
.
name
,
submitted
:
0
,
required
:
0
,
pass
:
true
}
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
required
){
panelResult
.
required
++
let
value
=
self
.
form
[
ele
.
fieldsName
]
let
value
=
this
.
form
[
ele
.
fieldsName
]
if
(
value
&&!
Array
.
isArray
(
value
)){
panelResult
.
submitted
++
}
else
if
(
value
&&
Array
.
isArray
(
value
)
&&
value
.
length
>
0
){
panelResult
.
submitted
++
}
else
if
(
first
){
// 记录第一个 为空 并且需要必填的项 用于定位
first
=
false
self
.
waitHandlerPanelIndex
=
panel
Index
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
self
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
this
.
waitHandlerPanelIndex
=
this
.
tab
Index
this
.
waitHandlerGroupIndex
=
groupIndex
this
.
waitHandlerEleIndex
=
eleIndex
this
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
}
}
})
})
panelResult
.
pass
=
panelResult
.
required
<=
panelResult
.
submitted
pass
=
pass
&&
panelResult
.
pass
checkResult
.
push
(
panelResult
)
panelResult
.
pass
=
panelResult
.
required
<=
panelResult
.
submitted
pass
=
pass
&&
panelResult
.
pass
checkResult
.
push
(
panelResult
)
}
})
console
.
log
(
checkResult
)
self
.
completeCheckR
esult
=
checkResult
this
.
completeCheck
.
r
esult
=
checkResult
return
pass
},
confirm
(){
// 检查结果窗口 确认
回调
uni
.
reLaunch
(
{
url
:
'/pages/index/order?type=3'
}
)
// 检查结果窗口取消
回调
closeCheckResult
()
{
this
.
completeCheck
.
status
=
false
this
[
this
.
completeCheck
.
cancelAction
](
)
},
closeCheckResult
(){
// 检查结果窗口取消回调
this
.
completeCheckStatus
=
false
// 检查结果窗口 确认回调
confirm
(){
this
.
completeCheck
.
status
=
false
this
[
this
.
completeCheck
.
action
]()
},
handerProgrom
(){
// 检查结果窗口 去处理回调 定位到缺失的项
this
.
completeCheckStatus
=
false
// 去完善
handerProgrom
(){
this
.
locationCompleteItem
(
this
.
waitHandlerPanelIndex
,
this
.
waitHandlerGroupIndex
,
this
.
waitHandlerEleIndex
)
},
// 去预约
async
appointment
()
{
const
save
=
await
this
.
nextStepSaveData
()
if
(
save
)
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=0'
})
}
},
// 下一步动作
async
nextAction
()
{
const
save
=
await
this
.
nextStepSaveData
()
if
(
this
.
tabIndex
<
this
.
list
.
length
-
1
&&
save
)
{
this
.
tabIndex
++
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
current
=
0
const
itemId
=
this
.
list
[
this
.
tabIndex
].
items
[
0
].
items
[
0
].
fieldsId
this
.
oldItemId
=
`item
${
itemId
}
`
this
.
$nextTick
(
async
()
=>
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
oldItemId
=
''
})
}
},
// 下一步弹窗处理
nextStep
()
{
this
.
pass
=
this
.
checkCompleteItem
()
const
name
=
this
.
list
[
this
.
tabIndex
].
panelFieldsName
const
type
=
name
===
'partnerInspectItem'
?
this
.
form
.
inspectConclusionType
:
this
.
form
.
constructionConclusionType
const
submit
=
this
.
tabIndex
===
this
.
list
.
length
-
1
const
result
=
actions
(
name
,
this
.
pass
,
type
,
submit
)
this
.
completeCheck
.
status
=
true
this
.
completeCheck
.
confirmText
=
result
.
confirmText
this
.
completeCheck
.
action
=
result
.
action
this
.
completeCheck
.
cancelText
=
result
.
cancelText
||
''
this
.
completeCheck
.
cancelAction
=
result
.
cancelAction
||
''
},
// 下一步数据保存
nextStepSaveData
()
{
const
params
=
{
maintainFields
:
this
.
handleSaveData
(),
currentStep
:
this
.
list
[
this
.
tabIndex
].
panelFieldsName
,
nextStep
:
this
.
list
[
this
.
tabIndex
+
1
].
panelFieldsName
,
}
return
this
.
$u
.
api
.
completeNextStep
(
params
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
return
Promise
.
resolve
(
true
)
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
return
Promise
.
resolve
(
false
)
}
})
},
tabsChange
(
index
){
this
.
tabIndex
=
index
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
$nextTick
(
function
()
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
getMenuItemTop
()
})
},
locationCompleteItem
(
panelIndex
,
groupIndex
,
eleIndex
){
// 页面定位到某一项
this
.
tabIndex
=
panelIndex
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
current
=
groupIndex
;
this
.
itemId
=
''
this
.
$nextTick
(
function
()
{
this
.
swichMenu
(
groupIndex
)
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
})
},
// 提交订单
orderFinish
(){
let
self
=
this
let
pass
=
this
.
checkCompleteItem
()
if
(
!
pass
){
self
.
completeCheckStatus
=
true
}
else
{
// 先保存完工项
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
//完工项信息保存成功再次完工工单
console
.
log
(
"完工"
);
this
.
pass
=
pass
if
(
self
.
inGuaranteePeriod
===
'Y'
){
self
.
$u
.
api
.
inOrderFinish
(
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
else
{
self
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
self
.
orderId
).
then
((
res
)
=>
{
console
.
log
(
res
)
self
.
completeCheckStatus
=
true
})
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
}
const
param
=
this
.
handleSaveData
()
this
.
$u
.
api
.
saveCompleteData
(
param
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
//完工项信息保存成功再次完工工单
if
(
this
.
inGuaranteePeriod
===
'Y'
){
this
.
$u
.
api
.
inOrderFinish
(
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'提交成功'
,
type
:
'success'
,
callback
:
()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=3'
})
}
})
}
})
}
else
{
this
.
$u
.
api
.
outOrderFinish
({
customerPayType
:
'CASH'
},
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'提交成功'
,
type
:
'success'
,
callback
:
()
=>
{
uni
.
reLaunch
({
url
:
'/pages/index/order?type=3'
})
}
})
}
})
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
},
calMaterialCraftListAmount
(
arr
){
let
amount
=
0
...
...
@@ -539,49 +640,34 @@
innerItem
=
groupItem
.
items
[
data
.
itemIndex
]
}
if
(
innerItem
.
fieldsType
===
'multiInput'
){
if
(
innerItem
.
fieldsType
===
'multiInput'
){
// 多个输入框的值触发
let
key
=
Object
.
keys
(
data
.
value
)[
0
]
this
.
form
[
key
]
=
data
.
value
[
key
]
}
else
{
this
.
$set
(
this
.
form
,
innerItem
.
fieldsName
,
data
.
value
)
}
if
(
innerItem
.
fieldsId
==
199
)
{
// 选不需要收款的时候,收款金额修改为非必选
for
(
var
list
of
this
.
list
)
{
// 同时修改基本信息和完工信息
for
(
var
item
of
list
.
items
)
{
for
(
var
i
of
item
.
items
)
{
if
(
i
.
fieldsId
==
200
)
{
i
.
required
=
data
.
value
!=
'03'
}
}
}
}
}
},
nextStep
()
{
if
(
this
.
tabIndex
<
this
.
list
.
length
-
1
)
{
this
.
tabIndex
++
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
current
=
0
this
.
leftMenuStatus
(
0
)
const
itemId
=
this
.
list
[
this
.
tabIndex
].
items
[
0
].
items
[
0
].
fieldsId
this
.
oldItemId
=
`item
${
itemId
}
`
this
.
$nextTick
(
async
()
=>
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
})
if
(
innerItem
.
fieldsId
===
199
)
{
// 选不需要收款的时候,收款金额修改为非必选
const
row
=
groupItem
.
items
.
find
(
v
=>
v
.
fieldsId
===
200
)
row
.
required
=
data
.
value
!=
'03'
}
if
(
innerItem
.
fieldsId
===
252
||
innerItem
.
fieldsId
===
253
)
{
// 申请费用计算
this
.
calcMoney
()
}
},
tabsChange
(
index
){
this
.
tabIndex
=
index
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
leftMenuStatus
(
0
)
this
.
$nextTick
(
function
()
{
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
this
.
getMenuItemTop
(
)
})
// 申请费用计算
calcMoney
()
{
const
price
=
parseInt
(
this
.
form
.
pipe
)
||
0
const
pipeUseLength
=
parseFloat
(
this
.
form
.
pipeUseLength
)
||
0
if
(
price
&&
pipeUseLength
)
{
const
money
=
(
price
*
pipeUseLength
).
toFixed
(
2
)
this
.
$set
(
this
.
form
,
'pipeAmount'
,
money
)
}
else
{
this
.
$set
(
this
.
form
,
'pipeAmount'
,
0
)
}
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
...
...
@@ -675,62 +761,16 @@
if
(
this
.
arr
.
length
==
0
)
{
await
this
.
getMenuItemTop
();
}
if
(
index
==
this
.
current
)
return
;
//
if (index == this.current) return;
this
.
scrollRightTop
=
this
.
oldScrollTop
;
this
.
$nextTick
(
function
()
{
this
.
itemId
=
this
.
oldItemId
if
(
!
this
.
oldItemId
)
this
.
scrollRightTop
=
this
.
arr
[
index
];
this
.
oldItemId
=
''
this
.
current
=
index
;
this
.
leftMenuStatus
(
index
);
})
},
// 获取一个目标元素的高度
getElRect
(
elClass
,
dataVal
)
{
new
Promise
((
resolve
,
reject
)
=>
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
'.'
+
elClass
).
fields
({
size
:
true
},
res
=>
{
// 如果节点尚未生成,res值为null,循环调用执行
if
(
!
res
)
{
setTimeout
(()
=>
{
this
.
getElRect
(
elClass
);
},
10
);
return
;
}
this
[
dataVal
]
=
res
.
height
;
resolve
();
}).
exec
();
})
},
// 观测元素相交状态
async
observer
()
{
this
.
tabbar
.
map
((
val
,
index
)
=>
{
let
observer
=
uni
.
createIntersectionObserver
(
this
);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
observer
.
relativeTo
(
'.right-box'
,
{
top
:
0
}).
observe
(
'#item'
+
index
,
res
=>
{
if
(
res
.
intersectionRatio
>
0
)
{
let
id
=
res
.
id
.
substring
(
4
);
this
.
leftMenuStatus
(
id
);
}
})
setTimeout
(()
=>
{
// 没有指定滚动到某一小项,就滚动到大的项
this
.
scrollRightTop
=
this
.
arr
[
index
]
this
.
current
=
index
},
100
)
})
},
// 设置左边菜单的滚动状态
async
leftMenuStatus
(
index
)
{
this
.
current
=
index
;
// 如果为0,意味着尚未初始化
if
(
this
.
menuHeight
==
0
||
this
.
menuItemHeight
==
0
)
{
await
this
.
getElRect
(
'menu-scroll-view'
,
'menuHeight'
);
await
this
.
getElRect
(
'u-tab-item'
,
'menuItemHeight'
);
}
// 将菜单活动item垂直居中
this
.
scrollTop
=
index
*
this
.
menuItemHeight
+
this
.
menuItemHeight
/
2
-
this
.
menuHeight
/
2
;
},
// 获取右边菜单每个item到顶部的距离
getMenuItemTop
()
{
new
Promise
(
resolve
=>
{
...
...
@@ -751,7 +791,6 @@
}).
exec
()
})
},
// 右边菜单滚动
async
rightScroll
(
e
)
{
this
.
oldScrollTop
=
e
.
detail
.
scrollTop
;
...
...
@@ -759,19 +798,16 @@
await
this
.
getMenuItemTop
();
}
if
(
this
.
timer
)
return
;
if
(
!
this
.
menuHeight
)
{
await
this
.
getElRect
(
'menu-scroll-view'
,
'menuHeight'
);
}
this
.
timer
=
setTimeout
(()
=>
{
// 节流
this
.
timer
=
null
;
// scrollHeight为右边菜单垂直中点位置
let
scrollHeight
=
e
.
detail
.
scrollTop
+
this
.
menuHeight
/
2
;
let
scrollHeight
=
e
.
detail
.
scrollTop
for
(
let
i
=
0
;
i
<
this
.
arr
.
length
;
i
++
)
{
let
height1
=
this
.
arr
[
i
];
let
height2
=
this
.
arr
[
i
+
1
];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if
(
!
height2
||
scrollHeight
>=
height1
&&
scrollHeight
<
height2
)
{
this
.
leftMenuStatus
(
i
);
this
.
current
=
i
return
;
}
}
...
...
@@ -833,7 +869,7 @@
// ---------------------------- 表单样式end ----------------------------
.
u-wrap
{
.
com-content
{
height
:
calc
(
100vh
);
/* #ifdef H5 */
height
:
calc
(
100vh
-
var
(
--
window-top
));
...
...
@@ -856,16 +892,17 @@
}
.u-menu-wrap
{
flex
:
1
;
//
flex: 1;
height
:
100%
;
display
:
flex
;
overflow
:
hidden
;
overflow
:
auto
;
//
overflow: hidden;
border-radius
:
12rpx
12rpx
0
0
;
&
.one
{
border-radius
:
0
;
}
}
.detail-view
{
border-radius
:
12rpx
;
margin
:
30rpx
;
}
.u-search-inner
{
background-color
:
rgb
(
234
,
234
,
234
);
...
...
src/pages/order/detail.vue
View file @
48c237ad
<
template
>
<view
class=
"order-wrap"
>
<u-navbar
back-icon-color=
"#FFFFFF"
:background=
"background"
:border-bottom=
"false"
></u-navbar>
<view
class=
"header"
>
<view
class=
"title"
>
订单信息
</view>
<view
v-show=
"allowRejection"
class=
"button"
@
click=
"rejectOrder"
>
拒单
</view>
<u-navbar
:title=
"title"
title-color=
"#FFFFFF"
title-size=
"32"
back-icon-color=
"#FFFFFF"
:background=
"background"
:border-bottom=
"false"
></u-navbar>
<view
class=
"header"
v-if=
"order.currentOverTime && showTimeOut"
>
<!-- 倒计时 -->
<view
class=
"title"
>
<view
class=
"bottom-tag-view"
><text>
{{
timeout
?
'超时'
:
'剩余'
}}
</text></view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"28"
show-days
separator=
"zh"
separator-size=
"32"
height=
"40"
hide-zero-day
color=
"#2272FF"
separator-color=
"#FFFFFF"
@
change=
"timeOutChange"
ref=
"order-count-down"
bg-color=
"#FFFFFF"
></u-count-down>
</view>
<view
class=
"header-content"
>
<!-- 抓紧时间提示 -->
<view
class=
"tip-text"
>
{{
tipText
}}
</view>
<!-- 拒单 -->
<view
v-show=
"allowRejection"
class=
"reject-button"
@
click=
"$u.throttle(rejectOrder, 500)"
>
拒单
</view>
</view>
</view>
<view
class=
"content"
>
<!-- 订单详情 -->
<view
class=
"card base-item"
>
<view
class=
"top-item"
>
<view
class=
"left"
>
<view
:class=
"['tag',
{'active': order.orderServiceType == '安装'}]">
{{
order
.
orderServiceType
}}
</view>
<text
class=
"title"
>
{{
order
.
categoryName
}}
</text>
</view>
<view
class=
"right"
>
{{
order
.
orderBusinessTypeText
}}
</view>
</view>
<view
class=
"order-cell"
>
<text>
工单编号:
</text>
<text>
{{
order
.
orderNumber
}}
</text>
</view>
<view
class=
"order-cell"
>
<text>
合作厂商:
</text>
<text>
{{
order
.
partnerCompanyName
}}
</text>
</view>
<view
class=
"order-cell"
>
<text>
厂商编号:
</text>
<text>
{{
order
.
partnerSerialNumber
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<view
class=
"left"
>
<text>
客户信息:
</text>
<text>
{{
order
.
contactName
}}
</text>
</view>
<image
style=
"width: 84rpx;height: 56rpx;"
:src=
"phoneIcon"
@
click=
"phoneToCustomer(order.contactPhone)"
></image>
</view>
<view
class=
"order-cell"
>
<text>
联系方式:
</text>
<text>
{{
order
.
contactPhone
}}
</text>
</view>
<view
class=
"between-cell address-cell"
>
<view
class=
"left-address"
>
<u-icon
name=
"map"
size=
"28"
></u-icon>
<text
class=
"address-txt"
>
{{
formatAddress
}}
</text>
</view>
<image
style=
"width: 84rpx;height: 56rpx;"
:src=
"navigationIcon"
@
click=
"openLocation(order.contactAddress)"
></image>
</view>
<!--
<u-read-more
ref=
"uReadMore"
:show-height=
"40"
:shadowStyle=
"
{paddingTop: '0rpx',marginTop: '0rpx'}" close-text="查看更多" open-text="点击收起" toggle color="#2272FF" font-size="26"> -->
<view
v-if=
"readMore"
@
click=
"readMore = false"
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-down"
></u-icon>
<text
class=
"read-more-text"
>
查看更多
</text>
</view>
<view
v-else
class=
"order-item-more"
>
<view
class=
"line-view"
></view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
品牌:
</text>
<text>
{{
order
.
brandName
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
数量:
</text>
<text>
x
{{
order
.
orderProductCount
}}
</text>
</view>
<view
class=
"order-cell between-cell"
>
<text
class=
"cell-title"
>
充电桩信息:
</text>
<text>
{{
order
.
serviceContent
}}
</text>
</view>
<!--
<view
class=
"order-cell between-cell"
>
<!--
<view
class=
"order-cell between-cell"
>
<text>
备注:
</text>
<text>
{{
order
.
serviceContent
}}
</text>
</view>
-->
<view
class=
"read-more-toggle"
>
<u-icon
name=
"arrow-up"
></u-icon>
<text
class=
"read-more-text"
@
click=
"readMore = true"
>
点击收起
</text>
</view>
</view>
<!--
</u-read-more>
-->
<Detail
:order=
"order"
:readMore
.
sync=
"readMore"
:operate=
"isAllowDianhuaAndDaohang"
></Detail>
</view>
<!-- 从我的页面进来显示
计
算信息 -->
<!-- 从我的页面进来显示
结
算信息 -->
<view
v-if=
"isFromMine"
class=
"settlement-view"
>
<view
class=
"settlement-title"
>
结算信息
</view>
<view
class=
"settlement-content"
>
...
...
@@ -93,62 +37,32 @@
<text>
{{
settlementInfo
.
amount
}}
元
</text>
</view>
</view>
<!-- 其他页面进来 -->
<!--
不是从我的页面,而是
其他页面进来 -->
<view
v-else
>
<!-- 业务文件 -->
<view
class=
"order-file"
v-if=
"showFile"
@
click=
"$u.throttle(handleClickFile, 500)"
>
<view
class=
"order-file-left"
>
<image
:src=
"wenjianImage"
class=
"file-image"
></image>
<text>
充电桩安装业务文件
</text>
</view>
<view
class=
"order-file-right"
>
<text>
点击查看
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
<!-- 时间选择 -->
<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 record-item"
>
<Record
:orderRecords=
"orderRecords"
></Record>
</view>
</view>
</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>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view
class=
"center"
>
<view>
<u-toast
ref=
"uToast"
/>
</view>
<view
v-if=
"showCenterBtn"
@
click=
"$u.throttle(handleClickSure, 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
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>
<BottomButtons
v-if=
"showBottomBtn"
:buttons=
"buttons"
@
submit=
"handleSubmit"
></BottomButtons>
<take-photo
type=
"test"
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:num=
"1"
></take-photo>
<!--
<PopView
title=
"查看交互规范"
message=
"为完善交付质量,请查看对应的交付规范"
:visible
.
sync=
"visible"
@
click=
"handleClick"
/>
-->
<u-popup
border-radius=
"12"
v-model=
"visible"
safe-area-inset-bottom
mode=
"center"
width=
"690rpx"
...
...
@@ -168,6 +82,8 @@
import
baseFile
from
'@/components/upload/index'
import
Customer
from
"@/components/mine/customer.vue"
import
Record
from
"@/components/order/performanceRecord.vue"
import
Detail
from
"@/components/order/detail.vue"
import
BottomButtons
from
"@/components/order/bottomButtons.vue"
let
now
=
new
Date
(
new
Date
().
toLocaleDateString
()).
getTime
();
export
default
{
components
:
{
...
...
@@ -175,11 +91,14 @@
'take-photo'
:
takePhoto
,
// PopView,
Customer
,
Record
Record
,
Detail
,
BottomButtons
},
mixins
:
[
baseFile
],
data
()
{
return
{
title
:
' '
,
readMore
:
true
,
dateList
:
[
{
day
:
now
,
timeRange
:
[]},
...
...
@@ -216,14 +135,13 @@
allowFeedback
:
false
,
// 允许过程反馈
needPhotograph
:
true
,
// 需要现场拍摄
centerButton
:
''
,
// 是否显示按钮
center
ButtonText
:
''
,
bottom
ButtonText
:
''
,
orderRecords
:
[],
method
:
null
,
show
Center
Btn
:
false
,
show
Bottom
Btn
:
false
,
showTimeSelect
:
false
,
submitType
:
''
,
nextUrl
:
''
,
btnClass
:
'appoint-btn'
,
takeStatus
:
false
,
errorSignIn
:
false
,
scenePhoto
:
false
,
...
...
@@ -242,7 +160,10 @@
centerBtnDisabled
:
false
,
isFromMine
:
false
,
settlementInfo
:
{
formatTime
:
'-'
,
list
:
[],
amount
:
''
},
unloaded
:
false
unloaded
:
false
,
timeout
:
false
,
timestamp
:
0
,
showFile
:
false
,
// 显示查看业务文件
}
},
onLoad
(
option
)
{
...
...
@@ -251,6 +172,11 @@
if
(
option
&&
option
.
id
)
{
this
.
orderId
=
option
.
id
}
if
(
option
&&
option
.
title
)
{
this
.
title
=
decodeURIComponent
(
option
.
title
)
}
else
{
this
.
title
=
"订单信息"
}
this
.
loadOrderDetail
()
this
.
getLocation
()
if
(
option
&&
option
.
isFromMine
)
{
...
...
@@ -272,54 +198,70 @@
this
.
closeLocationChange
()
},
computed
:
{
phoneIcon
()
{
//self-support/icon/dianhua-0@2x.png
if
(
this
.
isAllowDianhuaAndDaohang
){
return
process
.
uniEnv
.
qn_base_url
+
'dianhua.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'dianhua-d.png
'
customStyle
()
{
return
{
'height'
:
'48rpx'
,
'width'
:
'100rpx'
,
'color'
:
'#FFFFFF'
,
'border-color'
:
'transparent'
,
'background-color'
:
'transparent
'
}
},
navigationIcon
()
{
//self-support/icon/daohang-0@2x.png
if
(
this
.
isAllowDianhuaAndDaohang
){
return
process
.
uniEnv
.
qn_base_url
+
'daohang.png'
}
else
{
return
process
.
uniEnv
.
qn_base_url
+
'daohang-d.png'
tipText
()
{
switch
(
this
.
bottomButtonText
)
{
case
'接单'
:
return
this
.
timeout
?
'您的订单已超时,请及时接单'
:
'请您注意剩余时间,及时接单'
case
'预约'
:
return
this
.
timeout
?
'您的订单已超时,请及时预约'
:
'请您注意剩余时间,及时预约'
case
'去完工'
:
return
this
.
timeout
?
'您的订单已超时,请及时完工'
:
'请您注意剩余时间,及时完工'
default
:
return
''
}
},
centerButtonClass
()
{
let
btnClass
=
"appoint-btn"
return
btnClass
buttons
()
{
//id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
return
[{
label
:
'过程反馈'
,
type
:
'image'
,
image
:
'guochengfankui.png'
,
show
:
this
.
allowFeedback
,
disabled
:
false
,
id
:
1
},
{
label
:
'异常签到'
,
type
:
'image'
,
image
:
'yichangqiandao.png'
,
show
:
this
.
errorSignIn
,
disabled
:
false
,
id
:
2
},
{
label
:
'现场拍照'
,
type
:
'image'
,
image
:
'xiancahngpaizhao.png'
,
show
:
this
.
scenePhoto
,
disabled
:
false
,
id
:
3
},
{
label
:
this
.
bottomButtonText
,
type
:
'text'
,
image
:
''
,
show
:
true
,
disabled
:
this
.
centerBtnDisabled
,
id
:
0
,
customStyle
:
{
'background-color'
:
this
.
title
==
'待抢单'
?
'#FF930D'
:
'#2272FF'
}
}]
},
wenjianImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'wenjian.png'
},
formatAddress
()
{
let
self
=
this
let
address
=
""
if
(
self
.
order
)
{
address
=
self
.
order
.
contactProvinceText
||
""
address
+=
self
.
order
.
contactCityText
||
""
address
+=
self
.
order
.
contactCommunityText
||
""
address
+=
self
.
order
.
contactStreetText
||
""
address
+=
self
.
order
.
contactAddress
||
""
}
return
address
}
},
methods
:
{
openLocation
(
address
){
if
(
this
.
isAllowDianhuaAndDaohang
){
const
latitude
=
this
.
order
.
contactAddressLatitud
//res.latitude;
const
longitude
=
this
.
order
.
contactAddressLongitud
//res.longitude;
uni
.
openLocation
({
latitude
:
Number
(
latitude
),
longitude
:
Number
(
longitude
),
success
:
function
()
{
console
.
log
(
'success'
);
}
});
}
},
updateLocation
(){
let
self
=
this
wx
.
startLocationUpdate
({
...
...
@@ -338,7 +280,6 @@
if
(
this
.
getDistance
(
res
.
latitude
,
res
.
longitude
)
>
this
.
signDistance
){
// 计算签到距离
this
.
btnClass
=
"isGan-btn"
this
.
centerBtnDisabled
=
false
}
else
{
this
.
centerBtnDisabled
=
true
...
...
@@ -352,23 +293,6 @@
console
.
log
(
"closeLocationChange"
)
wx
.
offLocationChange
(
this
.
_locationChangeFn
);
},
phoneToCustomer
(
phone
){
// 联系客户
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
makePhoneCall
({
phoneNumber
:
phone
,
//仅为示例
complete
()
{
}
});
this
.
contactTime
()
}
},
contactTime
()
{
let
self
=
this
var
data
=
{}
if
(
this
.
submitType
===
"workerAppointment"
){
self
.
$u
.
api
.
contactTime
(
data
,
this
.
order
.
orderId
)
}
},
handleClickRight
(
active
)
{
this
.
scenePhoto
?
this
.
scenePhotoClick
()
:
this
.
take
()
},
...
...
@@ -408,13 +332,9 @@
if
(
res
.
code
==
200
)
{
self
.
order
=
res
.
data
this
.
getCurrentBtn
()
var
nowTime
=
new
Date
();
if
(
this
.
showTimeOut
&&
this
.
order
.
currentOverTime
&&
nowTime
.
getTime
()
>
this
.
order
.
currentOverTime
){
this
.
btnClass
=
'timeOut-btn'
}
// if(self.order.isFirstOrder){
// this.visible = true
// }
var
nowTime
=
new
Date
().
getTime
();
this
.
timeout
=
this
.
order
.
currentOverTime
&&
nowTime
>
this
.
order
.
currentOverTime
this
.
timestamp
=
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
nowTime
)
/
1000
)
// 格式化时间
this
.
settlementInfo
.
formatTime
=
this
.
order
.
settleCenterSyncDatetime
?
this
.
$u
.
timeFormat
(
this
.
order
.
settleCenterSyncDatetime
,
'yyyy.mm.dd hh:MM:ss'
)
:
'-'
}
else
{
...
...
@@ -457,16 +377,26 @@
self
.
$u
.
api
.
listOrderRecord
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
operationType
===
'预约'
){
item
.
operationTypeText
=
'上门时间'
}
else
if
(
item
.
operationType
===
'报备'
||
item
.
operationType
===
'改约'
){
item
.
isTrace
=
false
item
.
traceTime
=
null
item
.
traceLabel
=
item
.
operationType
if
(
item
.
operationType
===
'报备'
||
item
.
operationType
===
'改约'
){
item
.
isTrace
=
true
item
.
traceLabel
=
item
.
operationType
===
'报备'
?
'下次联系时间'
:
'改约时间'
item
.
operationTypeText
=
item
.
operationType
item
.
traceTime
=
item
.
orderRecordRemark
let
arr
=
item
.
orderRecordRemark
.
split
(
','
)
item
.
operationTypeText
=
arr
[
0
]
if
(
arr
.
length
>
1
){
item
.
orderRecordRemark
=
arr
[
1
].
substring
(
arr
[
1
].
indexOf
(
':'
)
+
1
,
arr
[
1
].
length
)
if
(
arr
&&
arr
.
length
>
1
)
{
let
remark
=
arr
[
1
].
substring
(
arr
[
1
].
indexOf
(
':'
)
+
1
,
arr
[
1
].
length
)
item
.
traceTime
=
remark
item
.
operationTypeText
=
arr
[
0
]
}
}
else
{
item
.
operationTypeText
=
item
.
operationType
+
'时间'
}
else
if
(
item
.
operationType
===
'预约'
)
{
let
remark
=
item
.
orderRecordRemark
.
substring
(
item
.
orderRecordRemark
.
lastIndexOf
(
","
)
+
1
);
item
.
traceTime
=
remark
item
.
operationTypeText
=
`上门
${
remark
}
`
}
else
{
item
.
operationTypeText
=
item
.
operationType
}
})
self
.
orderRecords
=
res
.
data
...
...
@@ -552,54 +482,76 @@
var
orderBusinessType
=
this
.
order
.
orderBusinessTypeText
if
(
orderStatus
<
31
&&
orderBusinessType
===
'指派单'
)
{
// 接单
this
.
show
Center
Btn
=
true
this
.
center
ButtonText
=
"接单"
this
.
show
Bottom
Btn
=
true
this
.
bottom
ButtonText
=
"接单"
// 已派单的时显示拒单按钮
this
.
allowRejection
=
true
this
.
submitType
=
"orderAccept"
this
.
readMore
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
title
=
'待接单'
,
this
.
showFile
=
false
}
else
if
(
orderStatus
<
31
&&
orderBusinessType
===
'订单池'
)
{
// 抢单
this
.
centerButton
=
"appoint1"
this
.
center
ButtonText
=
"抢单"
this
.
show
Center
Btn
=
true
this
.
bottom
ButtonText
=
"抢单"
this
.
show
Bottom
Btn
=
true
this
.
submitType
=
"orderGan"
this
.
showTimeOut
=
false
this
.
readMore
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
title
=
'待抢单'
,
this
.
showFile
=
false
}
else
if
(
orderStatus
===
31
&&
!
this
.
order
.
appointmentDatetime
)
{
// 预约
this
.
centerButton
=
"appoint2"
this
.
center
ButtonText
=
"预约"
this
.
bottom
ButtonText
=
"预约"
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
showTimeSelect
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
readMore
=
true
this
.
submitType
=
"workerAppointment"
this
.
title
=
'待预约'
,
this
.
showFile
=
true
this
.
loadCalendar
()
}
else
if
(
orderStatus
===
31
&&
this
.
order
.
appointmentDatetime
)
{
// 签到
this
.
centerButton
=
"appoint3"
this
.
center
ButtonText
=
"签到"
this
.
bottom
ButtonText
=
"签到"
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
submitType
=
"maintainWorkerCheckin"
this
.
isAllowDianhuaAndDaohang
=
true
this
.
errorSignIn
=
true
this
.
title
=
'待签到'
,
this
.
showFile
=
true
// this.addressToCoordinate()
this
.
updateLocation
()
}
else
if
(
orderStatus
>
31
&&
orderStatus
<
80
)
{
// 完工
this
.
centerButton
=
"filish"
this
.
center
ButtonText
=
"去完工"
this
.
bottom
ButtonText
=
"去完工"
this
.
submitType
=
"toFilish"
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
scenePhoto
=
true
this
.
readMore
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
title
=
'待完工'
,
this
.
showFile
=
true
}
else
if
(
orderStatus
==
85
||
orderStatus
==
87
)
{
// 审核中
this
.
isAllowDianhuaAndDaohang
=
true
this
.
title
=
'审核中'
,
this
.
showFile
=
true
}
else
if
(
orderStatus
==
86
||
orderStatus
==
88
)
{
// 异常单
this
.
isAllowDianhuaAndDaohang
=
true
this
.
title
=
'异常单'
,
this
.
showFile
=
true
}
else
if
([
80
,
81
,
89
,
110
].
indexOf
(
orderStatus
)
!=
-
1
)
{
// 已完工
this
.
isAllowDianhuaAndDaohang
=
true
this
.
title
=
'已完工'
,
this
.
showFile
=
true
}
else
{
this
.
isAllowDianhuaAndDaohang
=
true
}
...
...
@@ -619,6 +571,24 @@
this
.
handleBtn
()
}
},
handleSubmit
(
id
)
{
console
.
log
(
id
)
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
switch
(
id
)
{
case
0
:
this
.
handleClickSure
()
break
case
1
:
this
.
clickFeedback
()
break
case
2
:
this
.
take
()
break
case
3
:
this
.
scenePhotoClick
()
break
}
},
handleBtn
()
{
console
.
log
(
'click button'
)
if
(
!
this
.
submitType
){
...
...
@@ -684,7 +654,7 @@
||
(
res
.
code
!==
undefined
&&
res
.
code
===
200
)
)
{
this
.
trackOrder
()
this
.
$refs
.
uToast
.
show
({
title
:
this
.
center
ButtonText
+
'操作成功'
,
title
:
this
.
bottom
ButtonText
+
'操作成功'
,
type
:
'success'
,
duration
:
1000
,
callback
:
function
(){
...
...
@@ -710,6 +680,10 @@
}
})
},
// 去业务材料页面
handleClickFile
()
{
this
.
$u
.
route
({
url
:
'pages/order/document'
+
'?partnerCompanyId='
+
this
.
order
.
partnerCompanyId
+
'&brandId='
+
this
.
order
.
lianbaoBrandId
})
},
trackOrder
()
{
// 接单成功事件,签到成功事件
if
(
this
.
submitType
==
'orderAccept'
...
...
@@ -728,18 +702,19 @@
})
},
isGan
(){
this
.
center
ButtonText
=
"已被抢"
this
.
bottom
ButtonText
=
"已被抢"
this
.
submitType
=
""
this
.
btnClass
=
'isGan-btn'
this
.
centerBtnDisabled
=
true
},
clickFeedback
(){
// 过程反馈
uni
.
navigateTo
({
url
:
'pages/order/feedback?orderId='
+
this
.
order
.
orderId
+
'&categoryId='
+
this
.
order
.
categoryId
+
'&showGY='
+
(
this
.
center
ButtonText
!=
'预约'
?
'1'
:
'0'
)
url
:
'pages/order/feedback?orderId='
+
this
.
order
.
orderId
+
'&categoryId='
+
this
.
order
.
categoryId
+
'&showGY='
+
(
this
.
bottom
ButtonText
!=
'预约'
?
'1'
:
'0'
)
})
},
filish
(){
// 去完工
uni
.
navigateTo
({
url
:
'pages/order/complete?orderId='
+
this
.
order
.
orderId
+
"&categoryId="
+
this
.
order
.
categoryId
...
...
@@ -747,6 +722,7 @@
+
"&inGuaranteePeriod="
+
this
.
order
.
inGuaranteePeriod
+
"&partnerCompanyId="
+
this
.
order
.
partnerCompanyId
+
'&partnerCompanyName='
+
this
.
order
.
partnerCompanyName
+
'&maintainStep='
+
this
.
order
.
maintainStep
})
},
rejectOrder
()
{
// 拒单
...
...
@@ -814,23 +790,14 @@
Rad
(
d
){
return
d
*
Math
.
PI
/
180.0
;
//经纬度转换成三角函数中度分表形式。
},
timestampDiff
(
currentOverTime
){
// 计算超时时间
if
(
!
currentOverTime
){
return
0
}
return
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
new
Date
().
getTime
())
/
1000
);
},
timeOutChange
(
currentOverTime
){
let
self
=
this
var
nowTime
=
new
Date
();
// 当前时间
if
(
currentOverTime
&&
nowTime
.
getTime
()
>
currentOverTime
){
if
(
this
.
centerBtnDisabled
===
false
&&
this
.
submitType
===
'maintainWorkerCheckin'
){
this
.
btnClass
=
"isGan-btn"
}
else
{
this
.
btnClass
=
'timeOut-btn'
}
this
.
$refs
[
'uCountDown'
].
seconds
+=
2
}
timeOutChange
(
timestamp
){
if
(
this
.
timeout
)
this
.
$refs
[
'order-count-down'
].
seconds
+=
2
if
(
timestamp
==
0
&&
!
this
.
timeout
)
{
// 超时之后倒计时变为正计时
setTimeout
(()
=>
{
this
.
timestamp
=
1
this
.
timeout
=
true
},
1000
)
}
},
// handleClick(){
// this.visible = false
...
...
@@ -843,9 +810,6 @@
this
.
visible
=
false
// 添加客服
},
threeDays
()
{
return
this
.
timestampDiff
(
this
.
order
.
currentOverTime
)
>
3600
*
24
*
3
}
}
};
</
script
>
...
...
@@ -863,26 +827,37 @@
flex-direction
:
column
;
.header
{
padding
:
30rpx
30rpx
46rpx
30rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.title
{
line-height
:
40rpx
;
font-size
:
40rpx
;
color
:
#fff
;
padding
:
4rpx
32rpx
14rpx
32rpx
;
.header-content
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-top
:
12rpx
;
.tip-text
{
font-size
:
26rpx
;
color
:
#EFEFEF
;
}
.reject-button
{
text-align
:
center
;
width
:
106rpx
;
height
:
52rpx
;
border-radius
:
40rpx
;
font-size
:
24rpx
;
font-weight
:
400
;
line-height
:
52rpx
;
color
:
#DEDEDE
;
text-align
:
right
;
}
}
.button
{
text-align
:
center
;
width
:
106rpx
;
height
:
52rpx
;
border-radius
:
40rpx
;
font-size
:
24rpx
;
font-weight
:
400
;
line-height
:
52rpx
;
color
:
#DEDEDE
;
.title
{
display
:
flex
;
align-items
:
center
;
.bottom-tag-view
{
color
:
#FFFFFF
;
font-size
:
40rpx
;
margin-right
:
10rpx
;
}
}
}
...
...
@@ -890,9 +865,7 @@
height
:
100%
;
border-radius
:
12rpx
;
overflow
:
auto
;
margin-right
:
30rpx
;
margin-left
:
30rpx
;
margin-bottom
:
30rpx
;
margin
:
6rpx
30rpx
30rpx
30rpx
;
.card
{
background-color
:
#FFFFFF
;
...
...
@@ -901,124 +874,6 @@
border-radius
:
6px
;
}
.base-item
{
padding-bottom
:
6rpx
;
.top-item
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
30rpx
;
.left
{
display
:
flex
;
align-items
:
center
;
.tag
{
text-align
:
center
;
width
:
84rpx
;
height
:
40rpx
;
border-radius
:
8rpx
;
font-size
:
22rpx
;
font-weight
:
500
;
color
:
#FFFFFF
;
line-height
:
40rpx
;
background-image
:
linear-gradient
(
to
right
,
#FF930D
,
#FFC174
);
&
.active
{
background-image
:
linear-gradient
(
to
right
,
#2272FF
,
#47ABFF
);
}
}
.title
{
margin-left
:
20rpx
;
height
:
36rpx
;
font-size
:
36rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
36rpx
;
}
}
.right
{
text-align
:
center
;
width
:
100rpx
;
height
:
40rpx
;
background
:
#F4F5F7
;
border-radius
:
22rpx
;
font-size
:
22rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
40rpx
;
}
}
.address-cell
{
font-size
:
24rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
24rpx
;
margin-top
:
20rpx
;
margin-bottom
:
40rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.left-address
{
display
:
flex
;
align-items
:
flex-start
;
.address-txt
{
line-height
:
30rpx
;
margin-left
:
8rpx
;
margin-right
:
30rpx
;
}
}
}
}
.read-more-toggle
{
text-align
:
center
;
color
:
#2272FF
;
font-size
:
26rpx
;
margin-top
:
30rpx
;
padding-bottom
:
30rpx
;
}
.read-more-text
{
padding-left
:
8rpx
;
}
.order-item-more
{
font-size
:
26rpx
;
color
:
#333333
;
text-align
:
right
;
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
margin-bottom
:
20rpx
;
}
}
.order-item
{
padding-bottom
:
6rpx
;
.top-item
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
20rpx
;
.title
{
height
:
32rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
36rpx
;
}
}
}
.record-item
{
margin-bottom
:
0rpx
;
}
...
...
@@ -1119,28 +974,6 @@
}
}
// 页面公用css
.order-cell
{
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
48rpx
;
margin-bottom
:
10rpx
;
}
.between-cell
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.display-cell
{
display
:
flex
;
}
.cell-title
{
text-align
:
left
;
flex-shrink
:
0
;
}
.settlement-view
{
padding
:
30rpx
;
background-color
:
#FFFFFF
;
...
...
@@ -1162,4 +995,30 @@
}
}
}
.order-file
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin
:
20rpx
0
;
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
padding
:
24rpx
30rpx
;
.order-file-left
{
color
:
#333333
;
font-size
:
26rpx
;
display
:
flex
;
align-items
:
center
;
.file-image
{
width
:
52rpx
;
height
:
52rpx
;
flex-shrink
:
0
;
margin-right
:
16rpx
;
}
}
.order-file-right
{
color
:
#2272FF
;
font-size
:
26rpx
;
}
}
</
style
>
src/pages/order/document-tag.vue
0 → 100644
View file @
48c237ad
<
template
>
<view
class=
"doc-tag"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
title=
"安装文件"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
<!-- 合作商或品牌标签列表 -->
<view
class=
"label-content"
>
<view
v-for=
"(label, index) in labels"
:key=
"index"
class=
"label-item"
>
<!-- 选中为蓝底,非选中状态为灰底 -->
<view
:class=
"['label-normal',
{'selected': label.id == selectedId}]"
@click="handleClick(label)">
<text
class=
"label-text"
>
{{
label
.
name
}}
</text>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
labels
:
[],
// 标签列表
selectedId
:
''
};
},
onLoad
(
e
)
{
if
(
e
&&
e
.
partnerCompanyId
)
{
// 合作商id
this
.
tagTitle
=
'品牌'
this
.
loadFileLabel
(
'2'
,
e
.
partnerCompanyId
)
}
else
{
// 获取所有文件资料
this
.
tagTitle
=
'合作商'
this
.
loadFileLabel
(
'1'
)
}
},
methods
:
{
// 选中标签
handleClick
(
key
,
label
)
{
},
// 获取合作商列表
async
loadFileLabel
(
type
,
partnerCompanyId
)
{
let
param
=
{
type
:
type
,
// 1:合作商标签,2:品牌标签
}
if
(
type
==
'2'
)
{
param
.
partnerCompanyId
=
partnerCompanyId
// 合作商的标签id
}
let
res
=
await
this
.
$u
.
api
.
fileLabel
(
param
)
if
(
res
&&
res
.
code
==
200
)
{
this
.
labels
=
res
.
data
||
[]
// this.labels = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
}
},
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.doc-tag
{
background-color
:
#F4F5F7
;
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
.label-content
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
overflow
:
auto
;
padding
:
0
10rpx
44rpx
30rpx
;
.label-item
{
padding-right
:
20rpx
;
flex-shrink
:
0
;
.label-normal
{
height
:
104rpx
;
width
:
200rpx
;
font-size
:
26rpx
;
color
:
#666666
;
background-color
:
#FFFFFF
;
border-radius
:
8rpx
;
padding-left
:
30rpx
;
padding-right
:
30rpx
;
text-align
:
center
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.label-text
{
word-break
:
break-all
;
}
&
.selected
{
color
:
#FFFFFF
;
background-color
:
#2272FF
;
}
}
}
}
}
</
style
>
src/pages/order/document.vue
0 → 100644
View file @
48c237ad
<
template
>
<view
:class=
"['doc-wrap',
{'order-file': orderFile}]">
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
title=
"安装文件"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
<template
v-if=
"!orderFile"
>
<!-- 合作商、品牌标签列表 -->
<view
v-for=
"(item, key) in labels"
:key=
"key"
class=
"label-list"
>
<view
class=
"label-title"
>
<!-- 合作商或品牌 -->
<view>
{{
items
[
key
]
}}
</view>
<!-- 跳转到所有标签页面的更多按钮 -->
<view
class=
"label-file-right"
@
click=
"handleMore(key)"
>
<text
class=
"label-right-text"
>
更多
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
<view
class=
"label-content"
>
<view
v-for=
"(label, ind) in item"
:key=
"ind"
class=
"label-item"
>
<!-- 选中为蓝底,非选中状态为灰底 -->
<view
:class=
"['label-normal',
{'selected': label.id == selected[key].id}]" @click="handleClick(key, label)">
<text
class=
"label-text"
>
{{
label
.
name
}}
</text>
</view>
</view>
</view>
</view>
</
template
>
<view
class=
"file-title"
>
文件列表
</view>
<view
class=
"file-list"
>
<!-- 文件列表 -->
<view
class=
"file-row"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"file-left"
>
<view
class=
"file-name"
>
<u-icon
class=
"item-icon"
name=
"doc"
custom-prefix=
"wxh"
size=
"52"
></u-icon>
<!-- 文件后缀的首字母,大写 -->
<view
class=
"file-format-text"
>
{{formatText(item.name)}}
</view>
</view>
<text>
{{item.name}}
</text>
</view>
<!-- 文件操作按钮 -->
<view
class=
"file-right"
>
<u-button
:custom-style=
"shareStyle"
shape=
"circle"
@
click=
"handleShare(item)"
>
分享
</u-button>
<u-button
:custom-style=
"previewStyle"
shape=
"circle"
@
click=
"handlePreview(item)"
>
查看
</u-button>
</view>
</view>
<!-- 如果是加载中,就显示转圈;如果加载完成 -->
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<!-- 加载完成之后,没有数据的提示:未选择品牌提示、无文件提示 -->
<view
class=
"tip-view"
v-else-if=
"list.length <= 0"
>
{{tipText}}
</view>
</view>
</view>
</template>
<
script
>
export
default
{
data
()
{
return
{
list
:
[],
// 文件列表
firstLoad
:
true
,
// 初次加载
labels
:
{
// 标签列表
'1'
:
[],
// 合作商标签列表
'2'
:
[]
// 品牌标签列表
},
selected
:
{
// 选中的标签
'1'
:
{},
// 选中的合作商
'2'
:
{}
// 选中的品牌
},
loading
:
false
,
// 文件列表加载中
orderFile
:
false
// 是否是订单详情进来
};
},
computed
:
{
// 合作商的key是'1',品牌的key是'2'
items
()
{
return
{
'1'
:
'合作商'
,
'2'
:
'品牌'
}
},
// 分享按钮风格
shareStyle
()
{
return
{
marginRight
:
'10rpx'
,
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#FFFFFF'
,
color
:
'#2272FF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
}
},
// 查看按钮风格
previewStyle
()
{
return
{
width
:
'100rpx'
,
height
:
'52rpx'
,
background
:
'#2272FF'
,
color
:
'#FFFFFF'
,
fontSize
:
'24rpx'
,
fontWeight
:
'400'
,
lineHeight
:
'52rpx'
}
},
// 文件列表文件图片
wenjianImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'wenjian-bk.png'
},
// 列表无数据的提示文字
tipText
()
{
return
(
this
.
selected
[
'2'
].
name
||
this
.
orderFile
)
?
'暂无文件'
:
'请选择品牌'
}
},
onLoad
(
e
)
{
if
(
e
&&
e
.
partnerCompanyId
&&
e
.
brandId
)
{
// 订单详情进来获取指定合作商和品牌的文件资料
this
.
orderFile
=
true
this
.
loadFileList
(
e
.
partnerCompanyId
,
e
.
brandId
)
}
else
{
// 获取所有文件资料
this
.
loadFileLabel
(
'1'
)
}
},
methods
:
{
// 选中标签
handleClick
(
key
,
label
)
{
this
.
selected
[
key
]
=
label
if
(
key
==
'1'
)
{
// 合作商
this
.
selected
[
'2'
]
=
{}
// 清空选中品牌标签
this
.
list
=
[]
// 清空文件列表
this
.
loadFileLabel
(
'2'
,
label
.
id
)
// 获取新合作商对应品牌
}
else
{
// 品牌
this
.
loadFileList
(
this
.
selected
[
'1'
].
id
,
this
.
selected
[
'2'
].
id
)
// 获取文件列表
}
},
// 跳转到所有标签
handleMore
(
key
)
{
var
partnerCompanyId
=
''
// 合作商id
if
(
key
==
'2'
)
{
// 点击品牌的更多,跳转要传合作商id
partnerCompanyId
=
this
.
selected
[
'1'
].
id
}
this
.
$u
.
route
({
url
:
'pages/order/document-tag'
+
'?partnerCompanyId='
+
partnerCompanyId
+
'&selectedId='
+
this
.
selected
[
key
].
id
})
},
// 分享
handleShare
(
item
)
{
// 分享资料事件
getApp
().
track
(
'share_document'
,
{
id
:
self
.
vuex_user
.
id
,
url
:
item
.
url
});
uni
.
showLoading
({
title
:
'加载中'
})
// callback 写法
wx
.
downloadFile
({
url
:
item
.
url
,
// 下载url
success
(
res
)
{
uni
.
hideLoading
()
// 下载完成后转发
wx
.
shareFileMessage
({
filePath
:
res
.
tempFilePath
,
success
()
{},
fail
:
console
.
error
,
})
},
fail
:
console
.
error
,
})
},
// 查看
handlePreview
(
item
)
{
// 查看资料事件
getApp
().
track
(
'preview_document'
,
{
id
:
self
.
vuex_user
.
id
,
url
:
item
.
url
});
uni
.
showLoading
({
title
:
'加载中'
})
uni
.
downloadFile
({
url
:
item
.
url
,
success
:
function
(
res
)
{
uni
.
hideLoading
()
var
filePath
=
res
.
tempFilePath
;
if
(
/
\.(
gif|jpg|jpeg|png|GIF|JPG|PNG
)
$/
.
test
(
filePath
))
{
// 查看图片
wx
.
previewImage
({
current
:
filePath
,
// 当前显示图片的http链接
urls
:
[
filePath
]
// 需要预览的图片http链接列表
})
}
else
{
// 查看文件
uni
.
openDocument
({
filePath
:
filePath
,
success
:
function
(
res
)
{
console
.
log
(
'打开文档成功'
);
}
});
}
}
});
},
// 获取合作商或品牌列表
async
loadFileLabel
(
type
,
partnerCompanyId
)
{
let
param
=
{
type
:
type
,
// 1:合作商标签,2:品牌标签
}
if
(
type
==
'2'
)
{
param
.
partnerCompanyId
=
partnerCompanyId
// 合作商的标签id
}
let
res
=
await
this
.
$u
.
api
.
fileLabel
(
param
)
if
(
res
&&
res
.
code
==
200
)
{
this
.
labels
[
type
]
=
res
.
data
||
[]
// this.labels[type] = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
// 初次进入页面,获取完合作商列表之后,接着获取第一个合作商的品牌列表
if
(
this
.
firstLoad
&&
type
==
'1'
)
{
this
.
firstLoad
=
false
if
(
this
.
labels
[
type
].
length
>
0
)
{
this
.
selected
[
type
]
=
this
.
labels
[
type
][
0
]
this
.
loadFileLabel
(
'2'
,
this
.
selected
[
type
].
id
)
}
}
}
},
// 获取品牌列表
async
loadFileList
(
partnerCompanyId
,
brandId
)
{
this
.
loading
=
true
let
res
=
await
this
.
$u
.
api
.
fileList
({
partnerCompanyId
:
partnerCompanyId
,
// 合作商标签
brandId
:
brandId
// 品牌标签
})
this
.
loading
=
false
if
(
res
&&
res
.
code
==
200
)
{
console
.
log
(
res
.
data
)
this
.
list
=
res
.
data
||
[]
// this.list = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
}
},
// 文件后缀的首字母,大写
formatText
(
name
)
{
let
arr
=
name
.
split
(
'.'
)
if
(
arr
.
length
>
1
)
{
let
item
=
arr
.
pop
()
return
item
.
substr
(
0
,
1
).
toUpperCase
()
}
else
{
return
'P'
}
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.doc-wrap
{
background-color
:
#F4F5F7
;
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
&
.order-file
{
background-color
:
#FFFFFF
;
}
.label-list
{
padding
:
0
0
40rpx
30rpx
;
.label-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
margin-bottom
:
30rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.label-file-right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
color
:
#2272FF
;
font-size
:
26rpx
;
padding-right
:
30rpx
;
.label-right-text
{
font-weight
:
400
;
}
}
}
.label-content
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
overflow-x
:
auto
;
min-height
:
104rpx
;
.label-item
{
padding-right
:
20rpx
;
flex-shrink
:
0
;
.label-normal
{
height
:
104rpx
;
width
:
200rpx
;
font-size
:
26rpx
;
color
:
#666666
;
background-color
:
#FFFFFF
;
border-radius
:
8rpx
;
padding-left
:
30rpx
;
padding-right
:
30rpx
;
text-align
:
center
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.label-text
{
word-break
:break-all
;
}
&
.selected
{
color
:
#FFFFFF
;
background-color
:
#2272FF
;
}
}
}
}
}
}
.file-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
padding
:
20rpx
30rpx
;
border-radius
:
32rpx
;
background-color
:
#FFFFFF
;
// margin-top: 10rpx;
}
.file-list
{
padding
:
0
30rpx
;
height
:
100%
;
overflow
:
auto
;
background-color
:
#FFFFFF
;
.file-row
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin-top
:
10rpx
;
margin-bottom
:
50rpx
;
.file-left
{
display
:
flex
;
align-items
:
center
;
color
:
#333333
;
font-size
:
26rpx
;
.file-name
{
margin-right
:
20rpx
;
position
:
relative
;
.item-icon
{
position
:
absolute
;
}
.file-format-text
{
position
:
relative
;
width
:
52rpx
;
height
:
52rpx
;
text-align
:
center
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
line-height
:
52rpx
;
}
}
}
.file-right
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
.button-class
{
margin-left
:
10rpx
;
}
}
}
.tip-view
{
color
:
#999999
;
width
:
100%
;
margin-top
:
200rpx
;
text-align
:
center
;
}
.loading-view
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-top
:
200rpx
;
}
}
</
style
>
src/pages/photo/list.vue
View file @
48c237ad
...
...
@@ -246,16 +246,17 @@
},
async
closeTake
(
img
)
{
if
(
img
!==
undefined
){
// 复制一份 用于保存
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
let
saveList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
currentItemDate
.
orderImages
))
const
files
=
img
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
if
(
!
this
.
currentItemDate
.
orderImages
)
this
.
currentItemDate
.
orderImages
=
[]
// 复制一份 用于保存
let
saveList
=
this
.
currentItemDate
.
orderImages
.
concat
();
value
.
map
(
item
=>
{
// step1 添加缓存图片 到显示
this
.
currentItemDate
.
orderImages
.
push
(
item
.
path
)
// 文件key添加保存数组中
saveList
.
push
(
item
.
key
)
// step1 添加缓存图片 到显示
this
.
currentItemDate
.
orderImages
.
push
(
item
.
path
)
})
// step2 保存图片
var
data
=
{
...
...
@@ -263,6 +264,7 @@
images
:
Array
.
from
(
saveList
),
fieldsName
:
this
.
currentItemDate
.
fieldName
}
console
.
log
(
"data"
,
data
)
this
.
$u
.
api
.
saveImage
(
data
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
}
else
{
...
...
src/utils/util.js
View file @
48c237ad
...
...
@@ -35,15 +35,18 @@ const setOpenid = function (openid) {
}
}
async
function
validImages
(
imgurl
)
{
let
exists
=
false
await
uni
.
getImageInfo
({
src
:
imgurl
,
success
(
res
)
{
exists
=
true
}
})
return
exists
function
validImages
(
imgurl
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
getImageInfo
({
src
:
imgurl
,
success
(
res
)
{
resolve
(
true
)
},
fail
()
{
reject
(
false
)
}
})
})
}
/**
...
...
@@ -52,14 +55,13 @@ async function validImages(imgurl) {
* @param {Object} src 图片地址
* @param {Object} host 图片前缀,默认使用qn_base_url
*/
const
imageCache
=
function
(
vm
,
src
,
host
)
{
const
imageCache
=
async
function
(
vm
,
src
,
host
)
{
host
=
host
||
process
.
uniEnv
.
qn_base_url
let
image_url
=
host
+
src
return
image_url
// 临时
let
image_name
=
md5Libs
.
md5
(
image_url
)
var
arr
=
Object
.
keys
(
vm
.
vuex_cache
);
if
(
vm
.
vuex_cache
&&
arr
.
length
&&
arr
.
includes
(
image_name
)
&&
validImages
(
vm
.
vuex_cache
[
image_name
])
)
{
const
result
=
await
validImages
(
vm
.
vuex_cache
[
image_name
])
if
(
vm
.
vuex_cache
&&
arr
.
length
&&
arr
.
includes
(
image_name
)
&&
result
)
{
return
vm
.
vuex_cache
[
image_name
]
}
else
{
// 本地没有缓存 需要下载
...
...
@@ -67,7 +69,6 @@ const imageCache = function (vm, src, host) {
url
:
image_url
,
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
// call_back(res.tempFilePath)
vm
.
$u
.
vuex
(
`vuex_cache.
${
image_name
}
`
,
res
.
tempFilePath
)
}
}
...
...
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