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
76aa12f2
Commit
76aa12f2
authored
Jun 04, 2021
by
Damon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://git.banshouhui.com/lijundan/self-support
into dev
parents
188113e5
cf7ce8b4
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
975 additions
and
1916 deletions
+975
-1916
.env.js
.env.js
+1
-1
customer.vue
src/components/mine/customer.vue
+7
-12
bottomButtons.vue
src/components/order/bottomButtons.vue
+178
-0
detail.vue
src/components/order/detail.vue
+5
-1
index.vue
src/components/order/index.vue
+18
-4
performanceRecord.vue
src/components/order/performanceRecord.vue
+8
-6
qiniup.js
src/components/upload - 副本/qiniup.js
+0
-122
upload.js
src/components/upload - 副本/upload.js
+0
-173
pages.json
src/pages.json
+135
-139
index.vue
src/pages/index/index.vue
+3
-9
learn.vue
src/pages/index/learn.vue
+11
-9
mine.vue
src/pages/index/mine.vue
+6
-4
order.vue
src/pages/index/order.vue
+14
-16
course-detail.vue
src/pages/learn/course-detail.vue
+245
-237
news-details.vue
src/pages/learn/news-details.vue
+35
-9
section.vue
src/pages/learn/section.vue
+36
-10
index.vue
src/pages/login/index.vue
+14
-11
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 copy.vue
src/pages/order/complete copy.vue
+0
-1002
detail.vue
src/pages/order/detail.vue
+234
-124
util.js
src/utils/util.js
+8
-10
No files found.
.env.js
View file @
76aa12f2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
(
function
()
{
(
function
()
{
let
NODE_ENV
=
'test'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
NODE_ENV
=
'test'
;
// dev:开发环境 | test:测试环境 | prod:生产环境
let
ENV_VAR
=
null
;
let
ENV_VAR
=
null
;
let
VERSION_NUMBER
=
'1.
2.9
'
;
//版本号
let
VERSION_NUMBER
=
'1.
3.1
'
;
//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
if
(
NODE_ENV
===
'dev'
)
{
if
(
NODE_ENV
===
'dev'
)
{
...
...
src/components/mine/customer.vue
View file @
76aa12f2
<
template
>
<
template
>
<view
class=
"cus-wrap-component"
>
<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=
"content-view"
>
<view
:class=
"['title-view',
{'is-mine': isMine}]">
<view
:class=
"['title-view',
{'is-mine': isMine}]">
<text
:class=
"['title-text',
{'is-mine': isMine}]">
{{
titleText
[
typeIndex
]
}}
</text>
<text
:class=
"['title-text',
{'is-mine': isMine}]">
{{
titleText
[
typeIndex
]
}}
</text>
<text>
{{
tipText
[
typeIndex
]
}}
</text>
<text>
{{
tipText
[
typeIndex
]
}}
</text>
</view>
</view>
<u-image
:class=
"['qrcode',
{'is-mine': isMine}]" :src="cusQrcode" mode="widthFix" :fade="true"
<u-image
:class=
"['qrcode',
{'is-mine': isMine}]" :src="qnFile(cusQrcode)" mode="widthFix" :fade="false">
duration="450">
<u-loading
slot=
"loading"
></u-loading>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
<button
:class=
"['settle-button',
{'is-mine': isMine}]" type="primary" :open-type="openTypes[typeIndex]" show-message-card
<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">
send-message-path="/pages/index/index">
{{
buttonText
[
typeIndex
]
}}
{{
buttonText
[
typeIndex
]
}}
</button>
</button>
...
@@ -45,14 +44,7 @@
...
@@ -45,14 +44,7 @@
},
},
computed
:
{
computed
:
{
cusQrcode
()
{
cusQrcode
()
{
let
src
=
this
.
isMine
?
'erweima-rk.png'
:
'dingdanzhushou-n.png'
;
return
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
)
},
},
imageName
()
{
imageName
()
{
return
this
.
isMine
?
'kefufuwu-n.png'
:
'kefutuzs.png'
return
this
.
isMine
?
'kefufuwu-n.png'
:
'kefutuzs.png'
...
@@ -92,6 +84,9 @@
...
@@ -92,6 +84,9 @@
}
}
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
phoneToCustomer
()
{
// 联系客户
phoneToCustomer
()
{
// 联系客户
uni
.
makePhoneCall
({
uni
.
makePhoneCall
({
phoneNumber
:
this
.
phone
,
//仅为示例
phoneNumber
:
this
.
phone
,
//仅为示例
...
...
src/components/order/bottomButtons.vue
0 → 100644
View file @
76aa12f2
<
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
View file @
76aa12f2
...
@@ -14,6 +14,10 @@
...
@@ -14,6 +14,10 @@
<view
class=
"order-cell"
>
<view
class=
"order-cell"
>
<text>
合作厂商:
</text>
<text>
合作厂商:
</text>
<text>
{{
order
.
partnerCompanyName
}}
</text>
<text>
{{
order
.
partnerCompanyName
}}
</text>
</view>
<view
class=
"order-cell"
>
<text>
厂商编号:
</text>
<text>
{{
order
.
partnerSerialNumber
}}
</text>
</view>
</view>
<view
class=
"order-cell between-cell"
>
<view
class=
"order-cell between-cell"
>
<view
class=
"left"
>
<view
class=
"left"
>
...
@@ -164,7 +168,7 @@
...
@@ -164,7 +168,7 @@
padding-bottom
:
6rpx
;
padding-bottom
:
6rpx
;
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
margin-bottom
:
20rpx
;
margin-bottom
:
20rpx
;
padding
:
30rpx
30rpx
0
30rpx
;
//
padding: 30rpx 30rpx 0 30rpx;
border-radius
:
6px
;
border-radius
:
6px
;
.top-item
{
.top-item
{
...
...
src/components/order/index.vue
View file @
76aa12f2
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<view
v-if=
"showCountTime"
class=
"bottom-left-view"
>
<view
v-if=
"showCountTime"
class=
"bottom-left-view"
>
<view
:class=
"['bottom-tag-view',
{'timeout': timeout}]">
<text>
{{
tagText
}}
</text></view>
<view
:class=
"['bottom-tag-view',
{'timeout': timeout}]">
<text>
{{
tagText
}}
</text></view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"40"
show-days
separator=
"zh"
<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>
:color=
"timeout ? '#FA5A49' : '#FF930D'"
@
change=
"handleChange"
separator-color=
"#666666"
ref=
"order-count-down"
></u-count-down>
</view>
</view>
<view
v-else-if=
"showTime"
>
<view
v-else-if=
"showTime"
>
<text>
{{
timeTitle
}}
</text>
<text>
{{
timeTitle
}}
</text>
...
@@ -196,6 +196,17 @@
...
@@ -196,6 +196,17 @@
showDistance
()
{
showDistance
()
{
return
this
.
orderType
==
0
&&
this
.
location
.
length
>=
2
&&
(
this
.
orderData
.
contactAddressLatitud
||
this
.
orderData
.
contactAddressLongitud
)
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
()
{
types
()
{
return
{
return
{
'waitAccept'
:
0
,
// 待接单、
'waitAccept'
:
0
,
// 待接单、
...
@@ -207,6 +218,9 @@
...
@@ -207,6 +218,9 @@
'finish'
:
6
,
//已完工
'finish'
:
6
,
//已完工
}
}
},
},
title
()
{
return
this
.
titles
[
this
.
type
]
},
orderDistance
()
{
orderDistance
()
{
return
this
.
distance
(
this
.
orderData
.
contactAddressLatitud
,
this
.
orderData
.
contactAddressLongitud
,
this
.
location
[
0
],
this
.
location
[
1
])
return
this
.
distance
(
this
.
orderData
.
contactAddressLatitud
,
this
.
orderData
.
contactAddressLongitud
,
this
.
location
[
0
],
this
.
location
[
1
])
},
},
...
@@ -243,7 +257,7 @@
...
@@ -243,7 +257,7 @@
return
3
return
3
}
else
if
(
this
.
orderData
.
orderStatus
==
85
||
this
.
orderData
.
orderStatus
==
87
)
{
}
else
if
(
this
.
orderData
.
orderStatus
==
85
||
this
.
orderData
.
orderStatus
==
87
)
{
return
4
return
4
}
else
if
(
this
.
orderData
.
orderStatus
==
86
||
this
.
orderData
.
orderStatus
==
88
)
{
}
else
if
(
this
.
orderData
.
orderStatus
==
86
||
this
.
orderData
.
orderStatus
==
88
)
{
return
5
return
5
}
else
if
([
80
,
81
,
89
,
110
].
indexOf
(
this
.
orderData
.
orderStatus
)
!=
-
1
)
{
}
else
if
([
80
,
81
,
89
,
110
].
indexOf
(
this
.
orderData
.
orderStatus
)
!=
-
1
)
{
return
6
return
6
...
@@ -267,10 +281,10 @@
...
@@ -267,10 +281,10 @@
methods
:
{
methods
:
{
handleClick
()
{
handleClick
()
{
// if (this.buttonDisabled) return
// if (this.buttonDisabled) return
this
.
$emit
(
'action'
)
this
.
$emit
(
'action'
,
this
.
orderData
,
this
.
title
)
},
},
handleClickCell
()
{
handleClickCell
()
{
this
.
$emit
(
'click'
)
this
.
$emit
(
'click'
,
this
.
orderData
,
this
.
title
)
},
},
handleChange
(
timestamp
)
{
handleChange
(
timestamp
)
{
if
(
this
.
timeout
)
this
.
$refs
[
'order-count-down'
].
seconds
+=
2
if
(
this
.
timeout
)
this
.
$refs
[
'order-count-down'
].
seconds
+=
2
...
...
src/components/order/performanceRecord.vue
View file @
76aa12f2
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
<text>
履约记录
</text>
<text>
履约记录
</text>
</view>
</view>
<view
v-if=
"orderRecords.length == 0"
class=
"no-record-view"
>
当前暂无履约记录
</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=
"record-right-view"
>
<view
class=
"dashed-line-view"
></view>
<view
class=
"dashed-line-view"
></view>
<view
class=
"order-list"
>
<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-view"
>
<view
class=
"node-border-view"
>
<view
class=
"node-border-view"
>
<view
class=
"node-middle-view"
></view>
<view
class=
"node-middle-view"
></view>
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
}
}
},
},
computed
:
{
computed
:
{
sh
wo
OrderRecords
()
{
sh
ow
OrderRecords
()
{
if
(
this
.
readMoreRecord
&&
this
.
orderRecords
&&
this
.
orderRecords
.
length
>
0
)
{
if
(
this
.
readMoreRecord
&&
this
.
orderRecords
&&
this
.
orderRecords
.
length
>
0
)
{
return
this
.
orderRecords
.
slice
(
0
,
this
.
showLenght
)
return
this
.
orderRecords
.
slice
(
0
,
this
.
showLenght
)
}
else
{
}
else
{
...
@@ -99,8 +99,10 @@
...
@@ -99,8 +99,10 @@
.record-list-view
{
.record-list-view
{
position
:
relative
;
position
:
relative
;
&
.short
{
padding-bottom
:
30rpx
;
}
.record-right-view
{
.record-right-view
{
position
:
relative
;
position
:
relative
;
display
:
flex
;
display
:
flex
;
...
@@ -189,7 +191,7 @@
...
@@ -189,7 +191,7 @@
text-align
:
center
;
text-align
:
center
;
color
:
#2272FF
;
color
:
#2272FF
;
font-size
:
26rpx
;
font-size
:
26rpx
;
margin
-top
:
30rpx
;
padding
-top
:
30rpx
;
padding-bottom
:
30rpx
;
padding-bottom
:
30rpx
;
}
}
...
...
src/components/upload - 副本/qiniup.js
deleted
100644 → 0
View file @
188113e5
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 @
188113e5
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 @
76aa12f2
...
@@ -5,13 +5,12 @@
...
@@ -5,13 +5,12 @@
"^u-(.*)"
:
"@/uview-ui/components/u-$1/u-$1.vue"
"^u-(.*)"
:
"@/uview-ui/components/u-$1/u-$1.vue"
}
}
},
},
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
"pages"
:
[
{
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"首页"
,
"navigationBarTitleText"
:
"首页"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
//
"enablePullDownRefresh"
:
true
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -27,28 +26,29 @@
...
@@ -27,28 +26,29 @@
"path"
:
"pages/index/learn"
,
"path"
:
"pages/index/learn"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"学习"
,
"navigationBarTitleText"
:
"学习"
,
"navigationStyle"
:
"custom"
,
//隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"pages/index/mine"
,
"path"
:
"pages/index/mine"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"我的"
,
"navigationBarTitleText"
:
"我的"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"pages/login/index"
,
"path"
:
"pages/login/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"授权登录"
,
//
"navigationBarTitleText"
:
"授权登录"
,
"navigation
Style"
:
"custom"
,
"navigation
BarBackgroundColor"
:
"#FFFFFF"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
}
}
],
],
"subPackages"
:
[{
"subPackages"
:
[
{
"root"
:
"pages/exam"
,
"root"
:
"pages/exam"
,
"pages"
:
[
"pages"
:
[
{
{
...
@@ -74,42 +74,42 @@
...
@@ -74,42 +74,42 @@
"path"
:
"assessment"
,
"path"
:
"assessment"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"认证介绍"
,
"navigationBarTitleText"
:
"认证介绍"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"answer"
,
"path"
:
"answer"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"考核认证"
,
"navigationBarTitleText"
:
"考核认证"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"result"
,
"path"
:
"result"
,
"style"
:{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"news-details"
,
"path"
:
"news-details"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"section"
,
"path"
:
"section"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"curriculum"
,
"path"
:
"curriculum"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
}
}
},
},
{
{
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"在线考试"
,
"navigationBarTitleText"
:
"在线考试"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -125,18 +125,18 @@
...
@@ -125,18 +125,18 @@
"path"
:
"course-detail"
,
"path"
:
"course-detail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"培训视频"
,
"navigationBarTitleText"
:
"培训视频"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"exam-pass"
,
"path"
:
"exam-pass"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
}
}
}
}
]
]
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"收获地址"
,
"navigationBarTitleText"
:
"收获地址"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"修改地址"
,
"navigationBarTitleText"
:
"修改地址"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -168,8 +168,8 @@
...
@@ -168,8 +168,8 @@
"navigationBarTitleText"
:
"我的钱包"
,
"navigationBarTitleText"
:
"我的钱包"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
...
@@ -178,8 +178,8 @@
...
@@ -178,8 +178,8 @@
"navigationBarTitleText"
:
"提现"
,
"navigationBarTitleText"
:
"提现"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
...
@@ -188,8 +188,8 @@
...
@@ -188,8 +188,8 @@
"navigationBarTitleText"
:
"收入流水"
,
"navigationBarTitleText"
:
"收入流水"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
...
@@ -198,80 +198,77 @@
...
@@ -198,80 +198,77 @@
"navigationBarTitleText"
:
"结算账单"
,
"navigationBarTitleText"
:
"结算账单"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
,
"disableScroll"
:
true
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
"navigationBarBackgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
"path"
:
"cert/index"
,
"path"
:
"cert/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"我的证件"
,
"navigationBarTitleText"
:
"我的证件"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"cert/detail"
,
"path"
:
"cert/detail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件详情
"navigationBarTitleText"
:
"证件详情"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"cert/upload"
,
"path"
:
"cert/upload"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
//证件上传
"navigationBarTitleText"
:
"证件上传"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"contract/index"
,
"path"
:
"contract/index"
,
"style"
:{
"style"
:
{
"navigationBarTitleText"
:
""
,
//我的合同
"navigationBarTitleText"
:
"我的合同"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"contract/out"
,
"path"
:
"contract/out"
,
"style"
:{
"style"
:
{
"navigationBarTitleText"
:
""
"navigationBarTitleText"
:
""
}
}
},
},
{
{
"path"
:
"customer/index"
,
"path"
:
"customer/index"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"联系客服"
,
"navigationBarTitleText"
:
"联系客服"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"deposit/index"
,
"path"
:
"deposit/index"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"配件押金"
,
"navigationBarTitleText"
:
"配件押金"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"warehouse/index"
,
"path"
:
"warehouse/index"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"我的仓库"
,
"navigationBarTitleText"
:
"我的仓库"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
{
"path"
:
"superLogin/index"
,
"path"
:
"superLogin/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
"navigationBarTitleText"
:
""
}
}
}
}
]
]
},
},
{
{
"root"
:
"pages/order"
,
"root"
:
"pages/order"
,
...
@@ -279,7 +276,7 @@
...
@@ -279,7 +276,7 @@
{
{
"path"
:
"complete"
,
"path"
:
"complete"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单完工
"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
...
@@ -287,49 +284,44 @@
...
@@ -287,49 +284,44 @@
{
{
"path"
:
"feedback"
,
"path"
:
"feedback"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
过程反馈
"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"refuse"
,
"path"
:
"refuse"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
""
,
"navigationBarTitleText"
:
"
订单拒单
"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"detail"
,
"path"
:
"detail"
,
"style"
:
"style"
:
{
{
"navigationBarTitleText"
:
"订单详情"
,
"navigationBarTitleText"
:
"订单详情"
,
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
{
"path"
:
"search"
,
"path"
:
"search"
,
"style"
:
{
"style"
:
"navigationBarTitleText"
:
"订单搜索"
,
{
"enablePullDownRefresh"
:
false
,
"navigationBarTitleText"
:
"订单搜索"
,
"navigationBarBackgroundColor"
:
"#F4F5F7"
"enablePullDownRefresh"
:
false
,
}
"navigationBarBackgroundColor"
:
"#F4F5F7"
},
}
{
},
"path"
:
"material"
,
{
"style"
:
{
"path"
:
"material"
,
"navigationBarTitleText"
:
"勘察材料"
,
"style"
:
"enablePullDownRefresh"
:
false
,
{
"navigationBarBackgroundColor"
:
"#FFFFFF"
"navigationBarTitleText"
:
"勘察材料"
,
}
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
}
}
}
]
]
},
},
...
@@ -340,22 +332,22 @@
...
@@ -340,22 +332,22 @@
"path"
:
"index"
,
"path"
:
"index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"拍照小工具"
,
"navigationBarTitleText"
:
"拍照小工具"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
"backgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
"path"
:
"setting"
,
"path"
:
"setting"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarTitleText"
:
"水印设置"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
"backgroundColor"
:
"#F4F5F7"
}
}
},
},
{
{
"path"
:
"take"
,
"path"
:
"take"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTitleText"
:
"拍照"
,
"navigationBarTitleText"
:
"拍照"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"#FFFFFF"
,
...
@@ -366,18 +358,18 @@
...
@@ -366,18 +358,18 @@
"path"
:
"preview"
,
"path"
:
"preview"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"照片预览"
,
"navigationBarTitleText"
:
"照片预览"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"backgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#FFFFFF"
,
"navigationBarTextStyle"
:
"white"
"navigationBarTextStyle"
:
"white"
}
}
},
},
{
{
"path"
:
"list"
,
"path"
:
"list"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"规范展示"
,
"navigationBarTitleText"
:
"规范展示"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
,
"backgroundColor"
:
"#F4F5F7"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
}
}
...
@@ -390,7 +382,7 @@
...
@@ -390,7 +382,7 @@
"path"
:
"index"
,
"path"
:
"index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"入驻"
,
"navigationBarTitleText"
:
"入驻"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -436,7 +428,7 @@
...
@@ -436,7 +428,7 @@
"path"
:
"sign-contract"
,
"path"
:
"sign-contract"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"签约页面"
,
"navigationBarTitleText"
:
"签约页面"
,
"navigationStyle"
:
"custom"
,
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
@@ -454,7 +446,11 @@
...
@@ -454,7 +446,11 @@
"preloadRule"
:
{
"preloadRule"
:
{
"pages/index/index"
:
{
"pages/index/index"
:
{
"network"
:
"all"
,
"network"
:
"all"
,
"packages"
:
[
"pages/order"
,
"pages/learn"
,
"pages/mine"
]
"packages"
:
[
"pages/order"
,
"pages/learn"
,
"pages/mine"
]
}
}
},
},
"globalStyle"
:
{
"globalStyle"
:
{
...
...
src/pages/index/index.vue
View file @
76aa12f2
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
scroll-anchoring
>
-->
scroll-anchoring
>
-->
<view
v-for=
"(item, index) in orderList"
:key=
"index"
>
<view
v-for=
"(item, index) in orderList"
:key=
"index"
>
<OrderCell
:orderData=
"item"
type=
"waitAccept"
:location=
"location"
<OrderCell
:orderData=
"item"
type=
"waitAccept"
:location=
"location"
@
click=
"handleClick
(item.orderId)"
@
action=
"handleAction(item.orderId)
"
>
@
click=
"handleClick
"
@
action=
"handleClick
"
>
</OrderCell>
</OrderCell>
</view>
</view>
<u-loadmore
v-show=
"(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2"
:status=
"currentLoadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
<u-loadmore
v-show=
"(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2"
:status=
"currentLoadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
...
@@ -166,15 +166,9 @@
...
@@ -166,15 +166,9 @@
this
.
getOrderCount
()
this
.
getOrderCount
()
this
.
initSettleInfo
();
this
.
initSettleInfo
();
},
},
handleClick
(
orderId
)
{
// 点击了cell
handleClick
(
item
,
title
)
{
// 跳转工单详情页面
this
.
viewOderItem
(
orderId
)
},
handleAction
(
orderId
)
{
// 点击了按钮
this
.
viewOderItem
(
orderId
)
},
viewOderItem
(
orderId
)
{
// 跳转工单详情页面
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
orderId
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&title='
+
title
})
})
},
},
async
initSettleInfo
()
{
async
initSettleInfo
()
{
...
...
src/pages/index/learn.vue
View file @
76aa12f2
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
</view>
</view>
</scroll-view>
</scroll-view>
</swiper-item>
</swiper-item>
<swiper-item
@
touchmove
.
stop
.
prevent=
"stopTouchMove"
>
<swiper-item
@
touchmove
.
stop
.
prevent=
"stopTouchMove"
v-if=
"version"
>
<scroll-view
scroll-y
style=
"height:100%;width:100%;"
>
<scroll-view
scroll-y
style=
"height:100%;width:100%;"
>
<view
class=
"title u-margin-top-10 u-margin-bottom-30"
>
通用课程
</view>
<view
class=
"title u-margin-top-10 u-margin-bottom-30"
>
通用课程
</view>
<view
class=
"learn-currency-class"
>
<view
class=
"learn-currency-class"
>
...
@@ -231,12 +231,12 @@ var json = {
...
@@ -231,12 +231,12 @@ var json = {
sectionId
:
""
,
sectionId
:
""
,
},
},
{
{
title
:
"
充电桩安装要点提示
"
,
title
:
"
学习-我的模块
"
,
desc
:
"
在充电装安装过程中需要着重注意的要点
"
,
desc
:
"
学习-我的模块
"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"cdz-3x-v2.png"
,
pic
:
process
.
uniEnv
.
qn_base_url
+
"cdz-3x-v2.png"
,
percent
:
0
,
percent
:
0
,
status
:
""
,
status
:
""
,
id
:
15
1
,
id
:
15
2
,
sectionId
:
""
,
sectionId
:
""
,
},
},
],
],
...
@@ -374,6 +374,9 @@ export default {
...
@@ -374,6 +374,9 @@ export default {
{
{
name
:
"消息通知"
,
name
:
"消息通知"
,
},
},
{
name
:
"在线学习"
,
},
{
{
name
:
"考核认证"
,
name
:
"考核认证"
,
},
},
...
@@ -385,9 +388,6 @@ export default {
...
@@ -385,9 +388,6 @@ export default {
{
{
name
:
"消息通知"
,
name
:
"消息通知"
,
},
},
{
name
:
"在线学习"
,
},
{
{
name
:
"考核认证"
,
name
:
"考核认证"
,
},
},
...
@@ -474,7 +474,7 @@ export default {
...
@@ -474,7 +474,7 @@ export default {
isReflesh
:
true
,
isReflesh
:
true
,
triggered
:
false
,
triggered
:
false
,
_freshing
:
false
,
_freshing
:
false
,
version
:
fals
e
,
version
:
tru
e
,
};
};
},
},
onLoad
(
param
)
{
onLoad
(
param
)
{
...
@@ -512,8 +512,9 @@ export default {
...
@@ -512,8 +512,9 @@ export default {
.
getVersionInfo
(
version
)
.
getVersionInfo
(
version
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
let
data
=
res
.
data
;
let
data
=
res
.
data
;
if
(
data
.
hasOwnProperty
(
'is_audit'
)
&&
data
.
is_audit
==
1
){
if
(
data
.
hasOwnProperty
(
'is_audit'
)
&&
data
.
is_audit
==
0
){
that
.
tabs
=
that
.
tabs2
;
that
.
tabs
=
that
.
tabs2
;
that
.
version
=
false
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
...
@@ -800,6 +801,7 @@ export default {
...
@@ -800,6 +801,7 @@ export default {
var
news
=
{
var
news
=
{
body
:
e
.
body
,
body
:
e
.
body
,
title
:
e
.
title
,
title
:
e
.
title
,
create_at
:
e
.
create_at
,
};
};
let
that
=
this
;
let
that
=
this
;
wx
.
navigateTo
({
wx
.
navigateTo
({
...
...
src/pages/index/mine.vue
View file @
76aa12f2
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<u-cell-group
:border=
"false"
>
<u-cell-group
:border=
"false"
>
<view
v-for=
"(item, index) in items"
:key=
"index"
>
<view
v-for=
"(item, index) in items"
:key=
"index"
>
<u-cell-item
:value=
"item.value"
:border-bottom=
"false"
@
click=
"handleClick(item.pathName)"
>
<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=
"title"
class=
"item-title"
>
{{
item
.
title
}}
</view>
<view
slot=
"value"
class=
"item-value"
>
{{
value
}}
</view>
<view
slot=
"value"
class=
"item-value"
>
{{
value
}}
</view>
</u-cell-item>
</u-cell-item>
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
serviceTel
:
'18124099271'
,
serviceTel
:
'18124099271'
,
showSuperButton
:
false
,
showSuperButton
:
false
,
show
:
false
,
show
:
false
,
...
@@ -142,10 +141,13 @@
...
@@ -142,10 +141,13 @@
this
.
getData
()
this
.
getData
()
}
}
}
}
this
.
wodebeijingImage
=
await
util
.
imageCache
(
this
,
'wodebeijing.png'
)
this
.
wodebeijingImage
=
this
.
qnFile
(
'wodebeijing.png'
)
this
.
placeholderImage
=
await
util
.
imageCache
(
this
,
'touxiang.png'
)
this
.
placeholderImage
=
this
.
qnFile
(
'touxiang.png'
)
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
getData
()
{
getData
()
{
let
self
=
this
let
self
=
this
app
.
getBaseInfo
(
self
);
app
.
getBaseInfo
(
self
);
...
...
src/pages/index/order.vue
View file @
76aa12f2
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
<NoOrder
v-if=
"noMore"
type=
"black"
:customStyle=
"noOrderCustomStyle"
/>
<NoOrder
v-if=
"noMore"
type=
"black"
:customStyle=
"noOrderCustomStyle"
/>
<template
v-else
>
<template
v-else
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<view
v-for=
"(item, index) in orderList"
:key=
"item.orderId"
>
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick
(item)
"
<OrderCell
:orderData=
"item"
:type=
"orderType"
:location=
"dataValue"
@
click=
"handleClick"
@
action=
"handle
Action(item)
"
>
</OrderCell>
@
action=
"handle
Click
"
>
</OrderCell>
</view>
</view>
<u-loadmore
v-show=
"(pageNumber == 1 && loaded) || pageNumber > 2"
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
<u-loadmore
v-show=
"(pageNumber == 1 && loaded) || pageNumber > 2"
:status=
"loadStatus"
bgColor=
"#F4F5F7"
></u-loadmore>
</
template
>
</
template
>
...
@@ -282,17 +282,15 @@
...
@@ -282,17 +282,15 @@
}
}
});
});
},
},
viewOderItem
(
orderId
)
{
// 跳转工单详情页面
handleClick
(
item
,
title
)
{
uni
.
navigateTo
({
console
.
log
(
item
,
title
)
url
:
'pages/order/detail?id='
+
orderId
})
},
handleClick
(
item
)
{
if
(
item
.
orderStatus
===
86
||
item
.
orderStatus
===
88
){
if
(
item
.
orderStatus
===
86
||
item
.
orderStatus
===
88
){
this
.
filish
(
item
)
this
.
filish
(
item
)
return
return
}
}
this
.
viewOderItem
(
item
.
orderId
)
uni
.
navigateTo
({
url
:
'pages/order/detail?id='
+
item
.
orderId
+
'&title='
+
title
})
},
},
filish
(
item
){
filish
(
item
){
// 去完工
// 去完工
...
@@ -305,13 +303,13 @@
...
@@ -305,13 +303,13 @@
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
+
"&auditResultsId="
+
(
item
.
auditResults
?
Object
.
keys
(
item
.
auditResults
)[
Object
.
keys
(
item
.
auditResults
).
length
-
1
]:
''
)
})
})
},
},
handleAction
(
item
)
{
//
handleAction(item) {
if
(
item
.
orderStatus
===
86
||
item
.
orderStatus
===
88
){
//
if(item.orderStatus===86 || item.orderStatus===88){
this
.
filish
(
item
)
//
this.filish(item)
return
//
return
}
//
}
this
.
viewOderItem
(
item
.
orderId
)
//
this.viewOderItem(item.orderId)
},
//
},
handleClickSearch
()
{
handleClickSearch
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/order/search'
url
:
'pages/order/search'
...
...
src/pages/learn/course-detail.vue
View file @
76aa12f2
<
template
>
<
template
>
<view
class=
"learn-vedio"
>
<view
class=
"learn-vedio"
>
<u-navbar
title=
"培训视频"
></u-navbar>
<view
v-if=
"version && loaded"
>
<view
class=
"uni-padding-wrap uni-common-mt"
>
<u-navbar
title=
"培训视频"
></u-navbar>
<view
<view
class=
"uni-padding-wrap uni-common-mt"
>
><video
<view><video
object-fit=
"fill"
class=
"course-video"
id=
"courseVideo"
:src=
"courseSrc"
@
play=
"playCourse"
object-fit=
"fill"
@
error=
"videoErrorCallback"
controls
></video></view>
class=
"course-video"
<view
class=
"title-content"
>
id=
"courseVideo"
<view
class=
"item-content"
>
:src=
"courseSrc"
<view
class=
"item-st"
>
@
play=
"playCourse"
<image
style=
"width: 80rpx; height: 36rpx"
:src=
"kcImage"
></image>
@
error=
"videoErrorCallback"
<text
class=
"item-st-text"
>
{{
courseTitle
.
split
(
" "
)
?
courseTitle
.
split
(
" "
)[
0
]
:
""
}}
</text>
controls
</view>
></video
<view
class=
"item-title"
>
{{
courseTitle
.
split
(
" "
)
?
courseTitle
.
split
(
" "
)[
1
]
:
""
}}
</view>
></view>
</view>
<view
class=
"title-content"
>
<view>
接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。
</view>
<view
class=
"item-content"
>
</view>
<view
class=
"item-st"
>
<view
class=
"learn-view"
v-if=
"courseId >= 0"
>
<image
style=
"width: 80rpx; height: 36rpx"
:src=
"kcImage"
></image>
<view
class=
"learn-view-title"
>
视频内容介绍
</view>
<text
class=
"item-st-text"
>
{{
<view
class=
"learn-list"
v-for=
"(item, key) in courseOutlines[courseId]"
:key=
"key"
>
courseTitle
.
split
(
" "
)
?
courseTitle
.
split
(
" "
)[
0
]
:
""
<view
class=
"learn-list-item"
>
{{
item
}}
</view>
}}
</text>
</view>
</view>
</view>
<view
class=
"item-title"
>
{{
</view>
courseTitle
.
split
(
" "
)
?
courseTitle
.
split
(
" "
)[
1
]
:
""
}}
</view>
</view>
</view>
<view
<view
v-else-if=
"loaded"
>
>
接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。
</view
<u-navbar
title=
" "
></u-navbar>
>
<view
style=
"text-align: center;"
>
暂无数据
</view>
</view>
<view
class=
"learn-view"
v-if=
"courseId >= 0"
>
<view
class=
"learn-view-title"
>
视频内容介绍
</view>
<view
class=
"learn-list"
v-for=
"(item, key) in courseOutlines[courseId]"
:key=
"key"
>
<view
class=
"learn-list-item"
>
{{
item
}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
let
app
=
getApp
();
let
app
=
getApp
();
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
courseId
:
""
,
courseId
:
""
,
courseStatus
:
0
,
courseStatus
:
0
,
courseSrc
:
""
,
courseSrc
:
""
,
courseTitle
:
""
,
courseTitle
:
""
,
courseDesc
:
""
,
courseDesc
:
""
,
currentIndex
:
-
1
,
// 第几个视频
currentIndex
:
-
1
,
// 第几个视频
};
version
:
true
,
},
loaded
:
false
computed
:
{
};
courseOutlines
()
{
},
// 视频内容介绍
computed
:
{
return
{
courseOutlines
()
{
1
:
[
// 视频内容介绍
"1、考核规则:接单及时率"
,
return
{
"2、考核规则:上门及时率"
,
1
:
[
"3、考核规则:安装完工率"
,
"1、考核规则:接单及时率"
,
"4、考核规则:资料提交及时率"
,
"2、考核规则:上门及时率"
,
"5、考核规则:安装完工率"
,
"3、考核规则:安装完工率"
,
"6、考核规则:客户满意度"
,
"4、考核规则:资料提交及时率"
,
],
"5、考核规则:安装完工率"
,
2
:
[
"1、必备材料4大类"
,
"2、施工工具准备"
],
"6、考核规则:客户满意度"
,
3
:
[
],
"1、接线安装工艺标准"
,
2
:
[
"1、必备材料4大类"
,
"2、施工工具准备"
],
"2、PVC、镀锌管电缆管明敷"
,
3
:
[
"3、电缆敷设的防火要求"
,
"1、接线安装工艺标准"
,
"4、电源点标识"
,
"2、PVC、镀锌管电缆管明敷"
,
"5、配电箱接线及安装"
,
"3、电缆敷设的防火要求"
,
"6、管线敷设接头处理"
,
"4、电源点标识"
,
"7、充电桩内部接线"
,
"5、配电箱接线及安装"
,
"8、配电箱安装"
,
"6、管线敷设接头处理"
,
],
"7、充电桩内部接线"
,
4
:
[
"1、勘测环节录单要求"
,
"2、安装环节录单要求"
],
"8、配电箱安装"
,
};
],
},
4
:
[
"1、勘测环节录单要求"
,
"2、安装环节录单要求"
],
kcImage
()
{
};
return
process
.
uniEnv
.
qn_base_url
+
"kc.png"
;
},
},
kcImage
()
{
},
return
process
.
uniEnv
.
qn_base_url
+
"kc.png"
;
onLoad
(
e
)
{
},
app
.
trackPage
(
'入驻培训视频页'
)
},
if
(
e
)
{
onLoad
(
e
)
{
if
(
e
.
courseId
)
{
app
.
trackPage
(
'入驻培训视频页'
)
this
.
courseId
=
e
.
courseId
;
if
(
e
)
{
}
if
(
e
.
courseId
)
{
if
(
e
.
id
)
{
this
.
courseId
=
e
.
courseId
;
this
.
courseId
=
e
.
courseId
;
}
this
.
courseSrc
=
app
.
globalData
.
service_standard
[
e
.
id
].
url
;
if
(
e
.
id
)
{
this
.
courseTitle
=
app
.
globalData
.
service_standard
[
e
.
id
].
title
;
this
.
courseId
=
e
.
courseId
;
this
.
courseDesc
=
app
.
globalData
.
service_standard
[
e
.
id
].
desc
;
this
.
courseSrc
=
app
.
globalData
.
service_standard
[
e
.
id
].
url
;
}
this
.
courseTitle
=
app
.
globalData
.
service_standard
[
e
.
id
].
title
;
this
.
courseDesc
=
app
.
globalData
.
service_standard
[
e
.
id
].
desc
;
if
(
e
.
status
)
{
}
this
.
courseStatus
=
e
.
status
;
}
if
(
e
.
status
)
{
}
this
.
courseStatus
=
e
.
status
;
},
}
onReady
:
function
(
res
)
{
// #ifndef MP-ALIPAY
this
.
videoContext
=
uni
.
createVideoContext
(
"courseVideo"
);
// #endif
},
methods
:
{
videoErrorCallback
:
function
(
e
)
{
uni
.
showModal
({
content
:
e
.
target
.
errMsg
,
showCancel
:
false
,
});
},
playCourse
:
function
(
e
)
{
if
(
this
.
courseStatus
&&
(
this
.
courseStatus
==
"1"
||
this
.
courseStatus
==
1
))
{
return
}
this
.
changeCourseStatus
();
},
changeCourseStatus
()
{
let
that
=
this
;
if
(
that
.
courseId
)
{
that
.
$u
.
api
.
saveCourseRate
({
courseId
:
that
.
courseId
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
!==
200
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"更新课程状态失败"
,
});
}
}
});
this
.
getVersion
();
}
else
{
},
uni
.
showToast
({
onReady
:
function
(
res
)
{
title
:
"课程ID为空,请重新选择课程"
,
// #ifndef MP-ALIPAY
});
this
.
videoContext
=
uni
.
createVideoContext
(
"courseVideo"
);
}
// #endif
},
},
},
methods
:
{
};
getVersion
()
{
let
version
=
process
.
uniEnv
.
version_number
;
let
that
=
this
;
this
.
$u
.
api
.
getVersionInfo
(
version
)
.
then
((
res
)
=>
{
that
.
loaded
=
true
let
data
=
res
.
data
;
if
(
data
.
hasOwnProperty
(
'is_audit'
)
&&
data
.
is_audit
==
0
)
{
that
.
version
=
false
}
})
.
catch
((
err
)
=>
{
});
},
videoErrorCallback
:
function
(
e
)
{
uni
.
showModal
({
content
:
e
.
target
.
errMsg
,
showCancel
:
false
,
});
},
playCourse
:
function
(
e
)
{
if
(
this
.
courseStatus
&&
(
this
.
courseStatus
==
"1"
||
this
.
courseStatus
==
1
))
{
return
}
this
.
changeCourseStatus
();
},
changeCourseStatus
()
{
let
that
=
this
;
if
(
that
.
courseId
)
{
that
.
$u
.
api
.
saveCourseRate
({
courseId
:
that
.
courseId
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
!==
200
)
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"更新课程状态失败"
,
});
}
});
}
else
{
uni
.
showToast
({
title
:
"课程ID为空,请重新选择课程"
,
});
}
},
},
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.learn-vedio
{
.learn-vedio
{
background-color
:
#f4f5f7
;
background-color
:
#f4f5f7
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
overflow-y
:auto
;
overflow-y
:
auto
;
}
}
.course-video
{
.course-video
{
width
:
750rpx
;
width
:
750rpx
;
}
}
.course-title
{
.course-title
{
font-size
:
36rpx
;
font-size
:
36rpx
;
font-weight
:
700
;
font-weight
:
700
;
padding
:
80rpx
60rpx
40rpx
60rpx
;
padding
:
80rpx
60rpx
40rpx
60rpx
;
}
}
.course-desc
{
.course-desc
{
margin-left
:
60rpx
;
margin-left
:
60rpx
;
}
}
.title-content
{
.title-content
{
padding
:
40rpx
30rpx
;
padding
:
40rpx
30rpx
;
margin-bottom
:
20rpx
;
margin-bottom
:
20rpx
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
color
:
#999999
;
color
:
#999999
;
font-size
:
24rpx
;
font-size
:
24rpx
;
.item-content
{
.item-content
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
}
}
.item-st
{
.item-st
{
width
:
80rpx
;
width
:
80rpx
;
height
:
36rpx
;
height
:
36rpx
;
padding-right
:
2rpx
;
padding-right
:
2rpx
;
text-align
:
center
;
text-align
:
center
;
margin-right
:
20rpx
;
margin-right
:
20rpx
;
line-height
:
24rpx
;
line-height
:
24rpx
;
position
:
relative
;
position
:
relative
;
.item-st-text
{
color
:
#ffffff
;
.item-st-text
{
position
:
absolute
;
color
:
#ffffff
;
font-size
:
16rpx
;
position
:
absolute
;
left
:
20rpx
;
font-size
:
16rpx
;
top
:
8rpx
;
left
:
20rpx
;
line-height
:
28rpx
;
top
:
8rpx
;
line-height
:
28rpx
;
}
}
.item-title
{
color
:
#333333
;
font-size
:
44rpx
;
font-weight
:
bold
;
}
}
}
}
.item-content
{
.item-title
{
display
:
flex
;
color
:
#333333
;
padding-bottom
:
30rpx
;
font-size
:
44rpx
;
font-weight
:
bold
;
}
}
.item-content
{
display
:
flex
;
padding-bottom
:
30rpx
;
}
.item-title
{
color
:
#333333
;
font-size
:
28rpx
;
}
.learn-view
{
background-color
:
#ffffff
;
border-radius
:
12rpx
;
padding
:
38rpx
30rpx
30rpx
30rpx
;
margin-bottom
:
20rpx
;
font-size
:
32rpx
;
color
:
#333333
;
.learn-view-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
margin-bottom
:
10rpx
;
}
.learn-list
{
.learn-list-item
{
font-size
:
28rpx
;
margin-top
:
30rpx
;
margin-bottom
:
30rpx
;
color
:
#333333
;
}
}
.line-view
{
.item-title
{
background-color
:
#f4f5f7
;
color
:
#333333
;
height
:
2rpx
;
font-size
:
28rpx
;
width
:
100%
;
}
.learn-view
{
background-color
:
#ffffff
;
border-radius
:
12rpx
;
padding
:
38rpx
30rpx
30rpx
30rpx
;
margin-bottom
:
20rpx
;
font-size
:
32rpx
;
color
:
#333333
;
.learn-view-title
{
font-size
:
32rpx
;
font-weight
:
bold
;
margin-bottom
:
10rpx
;
}
.learn-list
{
.learn-list-item
{
font-size
:
28rpx
;
margin-top
:
30rpx
;
margin-bottom
:
30rpx
;
color
:
#333333
;
}
.line-view
{
background-color
:
#f4f5f7
;
height
:
2rpx
;
width
:
100%
;
}
}
}
}
}
</
style
>
}
</
style
>
src/pages/learn/news-details.vue
View file @
76aa12f2
<
template
>
<
template
>
<view>
<view
class=
"news-wrap"
>
<u-navbar
<u-navbar
back-icon-color=
"#000000"
back-icon-color=
"#000000"
:background=
"background"
:background=
"background"
...
@@ -9,8 +9,11 @@
...
@@ -9,8 +9,11 @@
<view
class=
"title"
>
<view
class=
"title"
>
{{
title
}}
{{
title
}}
</view>
</view>
<view
class=
"time-txt"
>
{{
time
|
datefmt
(
'YYYY.MM.DD HH:mm:ss'
)
}}
</view>
<view
class=
"u-content"
>
<view
class=
"u-content"
>
<u-parse
:html=
"body"
:tag-style=
"style"
></u-parse>
<u-parse
:html=
"body"
:tag-style=
"style"
:selectable=
"true"
></u-parse>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -20,7 +23,20 @@
...
@@ -20,7 +23,20 @@
data
()
{
data
()
{
return
{
return
{
title
:
''
,
title
:
''
,
body
:
''
body
:
''
,
time
:
''
,
style
:
{
// 字符串的形式
p
:
`
color: #666666;
font-size: 24rpx;
letter-spacing: 0.03rpx;
`
,
span
:
'font-size: 26rpx'
,
img
:
`
padding: 40rpx 0;
`
,
},
}
}
},
},
onLoad
()
{
onLoad
()
{
...
@@ -30,25 +46,35 @@
...
@@ -30,25 +46,35 @@
eventChannel
.
on
(
'acceptDataFromLearn'
,
function
(
data
)
{
eventChannel
.
on
(
'acceptDataFromLearn'
,
function
(
data
)
{
that
.
title
=
data
.
title
;
that
.
title
=
data
.
title
;
that
.
body
=
data
.
body
;
that
.
body
=
data
.
body
;
that
.
time
=
data
.
create_at
})
})
this
.
$u
.
mpShare
.
path
=
''
this
.
$u
.
mpShare
.
path
=
''
},
},
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.news-wrap
{
background-color
:
#FFFFFF
;
height
:
100vh
;
}
.title
{
.title
{
font-size
:
3
2
rpx
;
font-size
:
3
6
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
margin-left
:
30
rpx
;
margin
:
20
rpx
30
rpx
;
margin-top
:
30
rpx
;
}
}
.time-txt
{
margin
:
0
30
rpx
;
font-size
:
24
rpx
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
24
rpx
;
}
.u-content
{
.u-content
{
font-size
:
24
rpx
;
font-size
:
24
rpx
;
line-height
:
36
rpx
;
line-height
:
36
rpx
;
color
:
#666666
;
color
:
#666666
;
margin-left
:
30
rpx
;
margin-left
:
30
rpx
;
margin-top
:
30
rpx
;
margin-right
:
30
rpx
;
margin-right
:
30
rpx
;
}
}
</
style
>
</
style
>
src/pages/learn/section.vue
View file @
76aa12f2
<
template
>
<
template
v-cloak
>
<view
class=
""
>
<view
class=
""
>
<view
class=
"learn-vedio"
>
<view
class=
"learn-vedio"
v-if=
"version && loaded"
>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000000"
:border-bottom=
"false"
>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000000"
:border-bottom=
"false"
>
</u-navbar>
</u-navbar>
<view
class=
"uni-padding-wrap uni-common-mt"
>
<view
class=
"uni-padding-wrap uni-common-mt"
>
...
@@ -48,6 +48,11 @@
...
@@ -48,6 +48,11 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view
v-else-if=
"loaded"
>
<u-navbar
back-icon-color=
"#000000"
:background=
"background"
title-color=
"#000000"
:border-bottom=
"false"
>
</u-navbar>
<view
style=
"text-align: center;"
>
暂无数据
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -100,7 +105,9 @@
...
@@ -100,7 +105,9 @@
scrollTop
:
null
scrollTop
:
null
},
},
scrollValue
:
0
,
scrollValue
:
0
,
nowTime
:
0
nowTime
:
0
,
version
:
true
,
loaded
:
false
};
};
},
},
computed
:
{
computed
:
{
...
@@ -109,18 +116,37 @@
...
@@ -109,18 +116,37 @@
},
},
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
getApp
().
trackPage
(
'学习视频详情页'
)
this
.
getVersion
();
this
.
section_id
=
e
.
section_id
getApp
().
trackPage
(
'学习视频详情页'
)
this
.
params
.
course_id
=
e
.
course_id
if
(
e
){
this
.
getCapterDetails
()
this
.
section_id
=
e
.
section_id
this
.
getSectionInfo
({
this
.
params
.
course_id
=
e
.
course_id
section_id
:
e
.
section_id
this
.
getCapterDetails
()
})
this
.
getSectionInfo
({
section_id
:
e
.
section_id
})
}
},
},
onReady
:
function
(
res
)
{
onReady
:
function
(
res
)
{
this
.
videoContext
=
uni
.
createVideoContext
(
"courseVideo"
);
this
.
videoContext
=
uni
.
createVideoContext
(
"courseVideo"
);
},
},
methods
:
{
methods
:
{
getVersion
()
{
let
version
=
process
.
uniEnv
.
version_number
;
let
that
=
this
;
this
.
$u
.
api
.
getVersionInfo
(
version
)
.
then
((
res
)
=>
{
that
.
loaded
=
true
let
data
=
res
.
data
;
if
(
data
.
hasOwnProperty
(
'is_audit'
)
&&
data
.
is_audit
==
0
){
that
.
version
=
false
}
})
.
catch
((
err
)
=>
{
that
.
loaded
=
true
});
},
scroll
:
function
(
e
)
{
scroll
:
function
(
e
)
{
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
},
},
...
...
src/pages/login/index.vue
View file @
76aa12f2
<
template
>
<
template
>
<view
class=
""
>
<view
class=
""
>
<!--
<w-navbar></w-navbar>
-->
<view
class=
"backView"
>
<view
class=
"backView"
>
<view
class=
"login-block"
v-if=
"needAuth"
>
<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>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</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>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
</view>
</view>
<view
class=
"bind-block"
v-else
>
<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>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
<view
class=
"bind-phone"
>
{{
bindPhone
}}
</view>
<view
class=
"bind-phone"
>
{{
bindPhone
}}
</view>
<view
class=
"bind-tips"
>
{{
bindTips
}}
</view>
<view
class=
"bind-tips"
>
{{
bindTips
}}
</view>
</view>
</view>
<u-gap
height=
"
57
0"
></u-gap>
<u-gap
height=
"
48
0"
></u-gap>
<button
class=
"loginBtn"
v-if=
"needAuth"
lang=
"zh_CN"
@
tap=
"getUserProfile"
>
<button
class=
"loginBtn"
v-if=
"needAuth"
lang=
"zh_CN"
@
tap=
"getUserProfile"
>
<text
class=
"u-font-32 white"
>
{{
loginTitle
}}
</text>
<text
class=
"u-font-32 white"
>
{{
loginTitle
}}
</text>
</button>
</button>
...
@@ -38,7 +39,6 @@ const app = getApp()
...
@@ -38,7 +39,6 @@ const app = getApp()
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
needAuth
:
true
,
needAuth
:
true
,
TimeID
:
-
1
,
TimeID
:
-
1
,
loginTitle
:
'用户登录'
,
loginTitle
:
'用户登录'
,
...
@@ -50,10 +50,10 @@ export default {
...
@@ -50,10 +50,10 @@ export default {
},
},
computed
:
{
computed
:
{
logo
()
{
logo
()
{
return
util
.
imageCache
(
this
,
'logo.png'
)
return
this
.
qnFile
(
'logo.png'
)
},
},
logo2
()
{
logo2
()
{
return
util
.
imageCache
(
this
,
'logo-2.png'
)
return
this
.
qnFile
(
'logo-2.png'
)
},
},
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
...
@@ -67,6 +67,9 @@ export default {
...
@@ -67,6 +67,9 @@ export default {
this
.
getCode
()
this
.
getCode
()
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
async
getCode
()
{
async
getCode
()
{
login
.
appLogin
().
then
(
res
=>
{
login
.
appLogin
().
then
(
res
=>
{
this
.
code
=
res
.
code
this
.
code
=
res
.
code
...
@@ -160,7 +163,7 @@ export default {
...
@@ -160,7 +163,7 @@ export default {
login
.
signup
(
params
).
then
(
res
=>
{
login
.
signup
(
params
).
then
(
res
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
)
{
if
(
res
)
{
app
.
setUserData
(
res
.
data
,
that
)
login
.
setUserData
(
res
.
data
,
that
)
app
.
track
(
'signup_login'
,
{
mobile
:
res
.
data
.
mobile
});
app
.
track
(
'signup_login'
,
{
mobile
:
res
.
data
.
mobile
});
app
.
profileSet
(
that
)
app
.
profileSet
(
that
)
app
.
profileAppend
(
that
)
app
.
profileAppend
(
that
)
...
@@ -171,11 +174,11 @@ export default {
...
@@ -171,11 +174,11 @@ export default {
title
:
'授权失败,请重新授权'
,
title
:
'授权失败,请重新授权'
,
icon
:
'none'
icon
:
'none'
});
});
th
is
.
setLoginStatus
(
false
)
th
at
.
setLoginStatus
(
false
)
}
}
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
th
is
.
setLoginStatus
(
false
)
th
at
.
setLoginStatus
(
false
)
})
})
},
},
fail
()
{
fail
()
{
...
@@ -184,7 +187,7 @@ export default {
...
@@ -184,7 +187,7 @@ export default {
}
}
})
})
}
else
{
}
else
{
th
is
.
toLogin
(
params
)
th
at
.
toLogin
(
params
)
}
}
}
else
{
}
else
{
uni
.
showModal
({
uni
.
showModal
({
...
...
src/pages/mine/wallet/index.vue
View file @
76aa12f2
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
:border-bottom=
"false"
title-bold
></u-navbar>
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"wallet-content-view"
>
<view
class=
"wallet-content-view"
>
<view
class=
"header-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>
<view
class=
"survey-view"
>
<view
class=
"survey-view"
>
<view
class=
"survey-top-view"
>
<view
class=
"survey-top-view"
>
...
@@ -109,9 +109,6 @@
...
@@ -109,9 +109,6 @@
imageUrl
()
{
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
return
process
.
uniEnv
.
qn_base_url
},
},
qianbaobeijing
()
{
return
util
.
imageCache
(
this
,
'qianbaobeijing.png'
)
},
buttonStyle
()
{
buttonStyle
()
{
return
{
return
{
width
:
"200rpx"
,
width
:
"200rpx"
,
...
@@ -139,6 +136,9 @@
...
@@ -139,6 +136,9 @@
this
.
loadStatement
()
this
.
loadStatement
()
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
// 提现
// 提现
handleClickWithdraw
()
{
handleClickWithdraw
()
{
this
.
$u
.
route
({
this
.
$u
.
route
({
...
...
src/pages/mine/wallet/settlement.vue
View file @
76aa12f2
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</view>
</view>
</view>
</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=
"list-view"
v-if=
"hasInfo"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<u-gap
height=
"20"
></u-gap>
<u-gap
height=
"20"
></u-gap>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</view>
</view>
</view>
</view>
<view
class=
"list-view-empty"
v-else
>
<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>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
...
@@ -64,9 +64,6 @@
...
@@ -64,9 +64,6 @@
}
}
},
},
computed
:
{
computed
:
{
liushuibeijingImage
()
{
return
util
.
imageCache
(
this
,
'liushuibeijing.png'
)
},
imageUrl
()
{
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
return
process
.
uniEnv
.
qn_base_url
},
},
...
@@ -74,7 +71,7 @@
...
@@ -74,7 +71,7 @@
return
this
.
loading
||
this
.
info
.
payableRecordExtendDtos
&&
this
.
info
.
payableRecordExtendDtos
.
length
return
this
.
loading
||
this
.
info
.
payableRecordExtendDtos
&&
this
.
info
.
payableRecordExtendDtos
.
length
},
},
banner
()
{
banner
()
{
return
util
.
imageCache
(
this
,
'receipt.png'
)
return
this
.
qnFile
(
'receipt.png'
)
},
},
},
},
onLoad
()
{
onLoad
()
{
...
@@ -82,6 +79,9 @@
...
@@ -82,6 +79,9 @@
this
.
loadPayRecord
()
this
.
loadPayRecord
()
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
async
loadPayRecord
()
{
async
loadPayRecord
()
{
let
self
=
this
let
self
=
this
self
.
loading
=
true
self
.
loading
=
true
...
...
src/pages/mine/wallet/statement.vue
View file @
76aa12f2
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</view>
</view>
</view>
</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=
"list-view"
v-if=
"hasInfo"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<view
class=
"u-flex u-row-center"
v-if=
"loading"
>
<u-gap
height=
"20"
></u-gap>
<u-gap
height=
"20"
></u-gap>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</view>
</view>
</view>
</view>
<view
class=
"list-view-empty"
v-else
>
<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>
<u-loading
slot=
"loading"
></u-loading>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</u-image>
...
@@ -84,14 +84,11 @@
...
@@ -84,14 +84,11 @@
}
}
},
},
liushuibeijingImage
()
{
return
util
.
imageCache
(
this
,
'liushuibeijing.png'
)
},
imageUrl
()
{
imageUrl
()
{
return
process
.
uniEnv
.
qn_base_url
return
process
.
uniEnv
.
qn_base_url
},
},
banner
()
{
banner
()
{
return
util
.
imageCache
(
this
,
'receipt.png'
)
return
this
.
qnFile
(
'receipt.png'
)
},
},
hasInfo
()
{
hasInfo
()
{
return
this
.
loading
||
this
.
data
.
statementList
&&
this
.
data
.
statementList
.
length
return
this
.
loading
||
this
.
data
.
statementList
&&
this
.
data
.
statementList
.
length
...
@@ -101,7 +98,10 @@
...
@@ -101,7 +98,10 @@
getApp
().
trackPage
(
'收入流水列表页'
)
getApp
().
trackPage
(
'收入流水列表页'
)
this
.
loadStatement
()
this
.
loadStatement
()
},
},
methods
:
{
methods
:
{
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
bindDateChange
:
function
(
e
)
{
bindDateChange
:
function
(
e
)
{
this
.
date
=
e
.
target
.
value
this
.
date
=
e
.
target
.
value
this
.
loadStatement
()
this
.
loadStatement
()
...
...
src/pages/order/complete copy.vue
deleted
100644 → 0
View file @
188113e5
<
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>
<xh-location
v-else-if=
"item.formType==='location'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-location>
<xh-scan
v-else-if=
"item.formType==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-scan>
<xh-picker
v-else-if=
"item.formType==='picker'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-picker>
<xh-service-measure
v-else-if=
"item.formType==='servicemeasure'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:orderId=
"orderId"
:categoryId=
"categoryId"
:orderServiceType=
"orderServiceType"
:specificationId=
"form['specificationId'] || 0"
:value=
"form[item.fieldsName]"
@
value-change=
"fieldValueChange"
>
</xh-service-measure>
<xh-time
v-else-if=
"item.formType==='time'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-time>
<xh-service-more
v-else-if=
"item.formType==='form'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-label>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view>
<view
:class=
"['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]"
>
<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
type=
"primary"
shape=
"circle"
:hover-class=
"submitStatus ? '' : 'none'"
>
下一步
</u-button>
</view>
</view>
<u-toast
ref=
"uToast"
/>
<take-photo
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:currentItem=
"currentItemDate"
></take-photo>
<u-action-sheet
:list=
"carmeraList"
v-model=
"maskShow"
:cancel-btn=
"true"
@
click=
"uploadSelect"
></u-action-sheet>
</view>
</template>
<
script
>
import
XhInput
from
'@/components/createCom/XhInput.vue'
import
XhMultiInput
from
'@/components/createCom/XhMultiInput.vue'
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
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
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
;
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
return
{
orderId
:
0
,
categoryId
:
0
,
orderServiceType
:
''
,
inGuaranteePeriod
:
''
,
partnerCompanyId
:
''
,
auditResultsId
:
''
,
list
:
[],
tabIndex
:
0
,
scrollTop
:
0
,
//tab标题的滚动条位置
oldScrollTop
:
0
,
current
:
0
,
// 预设当前项的值
menuHeight
:
0
,
// 左边菜单的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
oldItemId
:
''
,
menuItemPos
:
[],
arr
:
[],
scrollRightTop
:
0
,
// 右边栏目scroll-view的滚动条高度
timer
:
null
,
// 定时器
form
:
{
// 一维表单
},
submitBtnStatus
:
false
,
completeCheckStatus
:
false
,
completeCheckResult
:
[],
waitHandlerPanelIndex
:
0
,
waitHandlerGroupIndex
:
0
,
waitHandlerEleIndex
:
0
,
pass
:
false
,
// 上传组件相关
carmeraList
:
[
{
text
:
'相册'
},
{
text
:
'拍照'
}
],
maskShow
:
false
,
takeStatus
:
false
,
currentItemDate
:{},
photoItem
:
{},
showTab
:
true
}
},
components
:
{
XhInput
,
XhMultiInput
,
XhRadio
,
XhCheckbox
,
XhSelect
,
XhFiles
,
XhLocation
,
XhScan
,
XhPicker
,
XhTime
,
XhServiceMeasure
,
XhServiceMore
,
XhLabel
,
'take-photo'
:
takePhoto
},
mixins
:
[
baseFile
],
created
()
{
// console.log(allComponents,'allComponents')
},
onLoad
(
option
)
{
getApp
().
trackPage
(
'订单完工信息页'
)
if
(
option
)
{
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
==
'挚达充电桩'
}
else
{
this
.
orderId
=
11880091
this
.
categoryId
=
1100000214
this
.
orderServiceType
=
'安装'
this
.
inGuaranteePeriod
=
'Y'
}
this
.
getCompleteData
()
},
onReady
()
{
// 导航栏滚动切换
this
.
getMenuItemTop
()
},
updated
()
{
//console.log(this.form.name, 'form.name')
},
computed
:
{
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
},
uploadImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'upload-file.png'
},
buttonStyle
()
{
return
{
'color'
:
'#FFFFFF'
,
'background-color'
:
'#2272FF;'
,
'width'
:
'300rpx'
,
'height'
:
'104rpx'
,
'font-size'
:
'32rpx'
,
'font-weight'
:
'bold'
,
'margin-left'
:
'50rpx'
}
},
customStyle
()
{
return
{
'background-color'
:
'#D1D4D4'
,
'width'
:
'300rpx'
,
'height'
:
'104rpx'
,
'background-color'
:
'transparent'
,
'border'
:
'1px solid #2272FF'
,
'color'
:
'#2272FF'
,
'font-weight'
:
'bold'
,
'font-size'
:
'32rpx'
,
}
},
show200
()
{
return
this
.
form
.
paymentMethodsType
&&
this
.
form
.
paymentMethodsType
!=
'03'
}
},
methods
:
{
getCompleteData
()
{
//获取工单配置的完工项目
let
self
=
this
if
(
self
.
orderId
){
self
.
$u
.
api
.
getCompleteConfigAndData
(
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
self
.
initData
(
res
)
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
});
}
},
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
if
(
d
.
fieldsId
==
200
&&
res
.
data
.
value
)
{
d
.
required
=
res
.
data
.
value
[
'paymentMethodsType'
]
!=
'03'
}
}
}
}
this
.
list
=
res
.
data
.
config
this
.
showTab
=
this
.
list
.
length
>
1
this
.
form
=
res
.
data
.
value
||
{}
// 异常单处理
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
()
},
checkCompleteError
()
{
// 异常单定位错误项
let
self
=
this
self
.
list
.
forEach
((
panel
,
panelIndex
)
=>
{
panel
.
items
.
forEach
((
group
,
groupIndex
)
=>
{
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
fieldsName
===
self
.
auditResultsId
)
{
self
.
waitHandlerPanelIndex
=
panelIndex
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
self
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
}
})
})
})
this
.
locationCompleteItem
(
self
.
waitHandlerPanelIndex
,
self
.
waitHandlerGroupIndex
,
self
.
waitHandlerEleIndex
)
},
handleSaveData
(){
let
param
=
{}
this
.
list
.
forEach
((
panel
)
=>
{
param
[
panel
.
panelFieldsName
]
=
[]
panel
.
items
.
forEach
((
group
)
=>
{
group
.
items
.
forEach
((
ele
)
=>
{
if
(
this
.
form
[
ele
.
fieldsName
]){
param
[
panel
.
panelFieldsName
].
push
({
"fieldsName"
:
ele
.
fieldsName
,
"fieldsType"
:
ele
.
fieldsType
,
"fieldsValue"
:
this
.
form
[
ele
.
fieldsName
],
"required"
:
ele
.
required
,
})
}
})
})
})
return
param
},
saveComplete
(){
// 保存完工信息
let
self
=
this
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'保存成功'
,
type
:
'success'
,
})
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
message
,
type
:
'error'
,
})
}
})
},
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
)
=>
{
group
.
items
.
forEach
((
ele
,
eleIndex
)
=>
{
if
(
ele
.
required
){
panelResult
.
required
++
let
value
=
self
.
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
=
panelIndex
self
.
waitHandlerGroupIndex
=
groupIndex
self
.
waitHandlerEleIndex
=
eleIndex
self
.
oldItemId
=
`item
${
ele
.
fieldsId
}
`
}
}
})
})
panelResult
.
pass
=
panelResult
.
required
<=
panelResult
.
submitted
pass
=
pass
&&
panelResult
.
pass
checkResult
.
push
(
panelResult
)
})
console
.
log
(
checkResult
)
self
.
completeCheckResult
=
checkResult
return
pass
},
confirm
(){
// 检查结果窗口 确认回调
uni
.
reLaunch
({
url
:
'/pages/index/order?type=3'
})
},
closeCheckResult
(){
// 检查结果窗口取消回调
this
.
completeCheckStatus
=
false
},
handerProgrom
(){
// 检查结果窗口 去处理回调 定位到缺失的项
this
.
completeCheckStatus
=
false
this
.
locationCompleteItem
(
this
.
waitHandlerPanelIndex
,
this
.
waitHandlerGroupIndex
,
this
.
waitHandlerEleIndex
)
},
locationCompleteItem
(
panelIndex
,
groupIndex
,
eleIndex
){
// 页面定位到某一项
this
.
tabIndex
=
panelIndex
this
.
arr
=
[]
this
.
scrollRightTop
=
0
;
this
.
current
=
0
;
this
.
$nextTick
(
function
()
{
this
.
swichMenu
(
groupIndex
)
})
},
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'
,
})
}
})
}
},
calMaterialCraftListAmount
(
arr
){
let
amount
=
0
if
(
arr
){
arr
.
forEach
(
item
=>
{
if
(
Number
(
item
.
useLength
)
&&
Number
(
item
.
freeLength
)
&&
Number
(
item
.
unitAmt
))
{
amount
+=
Math
.
max
(
Number
(
item
.
useLength
)
-
Number
(
item
.
freeLength
),
0
)
*
Number
(
item
.
unitAmt
)
}
if
(
Number
(
item
.
extraAmt
)){
amount
+=
Number
(
item
.
extraAmt
)
}
})
}
return
amount
},
setData
(
data
){
// 通过页面设置数据
Object
.
keys
(
data
).
forEach
(
key
=>
{
this
.
$set
(
this
.
form
,
key
,
data
[
key
])
})
// 更新预计超出金额
let
amount
=
this
.
calMaterialCraftListAmount
(
this
.
form
.
materialList
)
amount
+=
this
.
calMaterialCraftListAmount
(
this
.
form
.
craftList
)
this
.
$set
(
this
.
form
,
'overAmount'
,
amount
)
},
// 字段的值更新
fieldValueChange
(
data
)
{
const
groupItem
=
this
.
list
[
this
.
tabIndex
].
items
[
data
.
groupIndex
]
let
innerItem
if
(
groupItem
.
items
)
{
innerItem
=
groupItem
.
items
[
data
.
itemIndex
]
}
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
})
}
},
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
()
})
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload
(
item
,
groupIndex
,
itemIndex
){
const
imgList
=
this
.
$refs
[
`fileChild
${
groupIndex
}${
itemIndex
}
`
][
0
].
imgList
if
(
imgList
.
length
===
10
)
{
return
this
.
$refs
.
uToast
.
show
({
title
:
'图片已超出最大数量'
,
type
:
'error'
,
})
}
this
.
photoItem
=
{
...
JSON
.
parse
(
item
),
groupIndex
,
itemIndex
,
}
// 弹窗展示
this
.
maskShow
=
true
},
// 区分上传动作
uploadSelect
(
index
)
{
if
(
index
===
0
)
{
this
.
uploadFile
(
'photo'
)
}
else
{
this
.
uploadFile
()
}
},
// 拍照回调
async
closeTake
(
val
)
{
if
(
val
&&
val
.
length
>
0
){
const
files
=
val
.
map
(
v
=>
v
.
path
)
const
value
=
await
this
.
saveToTask
(
files
)
this
.
$refs
[
`fileChild
${
this
.
photoItem
.
groupIndex
}${
this
.
photoItem
.
itemIndex
}
`
][
0
].
setTmpValue
(
value
)
}
this
.
takeStatus
=
false
},
// 上传图片
async
uploadFile
(
type
){
const
self
=
this
if
(
type
&&
type
===
'photo'
){
// 直接打开相册
let
options
=
{
sourceType
:[
'album'
],
//['album', 'camera']
count
:
3
,
sizeType
:
[
'compressed'
]
}
const
value
=
await
this
.
chooseImg
(
options
)
self
.
$refs
[
`fileChild
${
self
.
photoItem
.
groupIndex
}${
self
.
photoItem
.
itemIndex
}
`
][
0
].
setTmpValue
(
value
)
return
}
// 使用拍照工具拍摄
this
.
photograph
()
this
.
getWatermark
()
},
// 获取拍照规范
photograph
(){
let
self
=
this
let
param
=
{
"partnerCompanyId"
:
this
.
partnerCompanyId
||
''
,
"categoryId"
:
this
.
categoryId
,
"brandId"
:
this
.
brandId
||
''
,
"fieldName"
:
this
.
photoItem
.
fieldsName
}
this
.
$u
.
api
.
orderStandardItem
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
.
length
>
0
)
{
self
.
currentItemDate
=
res
.
data
[
0
]
}
else
{
console
.
log
(
"获取完工项的拍照标准异常"
,
res
.
data
.
message
)
}
self
.
takeStatus
=
true
})
},
// 获取水印
getWatermark
(){
if
(
getApp
().
globalData
.
photo
.
waterSetting
){
return
}
var
data
=
{
partnerCompanyId
:
this
.
partnerCompanyId
||
''
}
this
.
$u
.
api
.
getWatermark
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
getApp
().
globalData
.
photo
.
waterSetting
=
res
.
data
}
else
{
console
.
log
(
"获取水印备注异常"
,
res
.
data
.
message
)
}
});
},
// ------------------------- 以上方法为上传组件相关 -------------------------
// ------------------------- 以下方法为展示滚动切换 -------------------------
// 点击左边的栏目切换
async
swichMenu
(
index
)
{
if
(
this
.
arr
.
length
==
0
)
{
await
this
.
getMenuItemTop
();
}
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
);
}
})
})
},
// 设置左边菜单的滚动状态
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
=>
{
let
selectorQuery
=
uni
.
createSelectorQuery
();
selectorQuery
.
selectAll
(
'.class-item'
).
boundingClientRect
((
rects
)
=>
{
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
if
(
!
rects
.
length
)
{
setTimeout
(()
=>
{
this
.
getMenuItemTop
();
},
10
);
return
;
}
rects
.
forEach
((
rect
)
=>
{
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
this
.
arr
.
push
(
rect
.
top
-
rects
[
0
].
top
);
resolve
();
})
}).
exec
()
})
},
// 右边菜单滚动
async
rightScroll
(
e
)
{
this
.
oldScrollTop
=
e
.
detail
.
scrollTop
;
if
(
this
.
arr
.
length
==
0
)
{
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
;
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
);
return
;
}
}
},
10
)
},
handleTouchstart
()
{
// 防止输入光标滚动出现错乱
uni
.
hideKeyboard
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
// ---------------------------- 表单样式begin ----------------------------
/
deep
/
.u-form-item
{
.u-form-item__message
{
padding-left
:
0
!
important
;
}
.u-form-item--left__content--required
{
vertical-align
:
top
;
}
}
.class-item
{
background-color
:
#fff
;
padding
:
28rpx
;
border-radius
:
8rpx
;
.title
{
font-weight
:
bold
;
font-size
:
32rpx
;
line-height
:
32rpx
;
color
:
#333
;
}
.label
{
color
:
#333
;
font-size
:
28rpx
;
line-height
:
40rpx
;
padding-bottom
:
20rpx
;
}
.label-bold
{
font-size
:
32rpx
;
font-weight
:
bold
;
}
.required
{
padding-right
:
10rpx
;
font-size
:
28rpx
;
line-height
:
40rpx
;
color
:
#fa3534
;
}
.item-image
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
10rpx
;
}
}
// ---------------------------- 表单样式end ----------------------------
.u-wrap
{
height
:
calc
(
100vh
);
/* #ifdef H5 */
height
:
calc
(
100vh
-
var
(
--
window-top
));
/* #endif */
display
:
flex
;
flex-direction
:
column
;
background-color
:
#FFFFFF
;
background-image
:
linear-gradient
(
to
top
,
#2272ff
0%
,
#2272ff
100%
);
background-size
:
750rpx
600rpx
;
background-repeat
:
no-repeat
;
}
.u-search-box
{
padding
:
18rpx
30rpx
;
}
.order-tabs
{
margin-top
:
20rpx
;
margin-bottom
:
32rpx
;
}
.u-menu-wrap
{
flex
:
1
;
height
:
100%
;
display
:
flex
;
overflow
:
hidden
;
border-radius
:
12rpx
12rpx
0
0
;
&
.one
{
border-radius
:
0
;
}
}
.u-search-inner
{
background-color
:
rgb
(
234
,
234
,
234
);
border-radius
:
100rpx
;
display
:
flex
;
align-items
:
center
;
padding
:
10rpx
16rpx
;
}
.u-search-text
{
font-size
:
26rpx
;
color
:
$u-tips-color
;
margin-left
:
10rpx
;
}
.u-tab-view
{
width
:
200rpx
;
height
:
100%
;
border
:
4rpx
solid
#F4F5F7
;
overflow
:
auto
;
}
.u-tab-item
{
height
:
110rpx
;
background
:
#fff
;
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
26rpx
;
color
:
#333333
;
font-weight
:
400
;
line-height
:
1
;
}
.u-tab-item-active
{
position
:
relative
;
color
:
#2272FF
;
background
:
#fff
;
}
// .u-tab-item-active::before {
// content: "";
// position: absolute;
// border-left: 4px solid $u-type-primary;
// height: 32rpx;
// left: 0;
// top: 39rpx;
// }
.u-tab-view
{
height
:
100%
;
}
.right-box
,
.right-boxs
{
// background-color: rgb(250, 250, 250);
background-color
:
#FFFFFF
;
overflow
:
auto
;
width
:
100%
;
}
.page-view
{
padding
:
16rpx
;
}
.class-item
:last-child
{
max-height
:
100vh
;
}
.item-title
{
font-size
:
26rpx
;
color
:
$u-main-color
;
font-weight
:
bold
;
}
.item-menu-name
{
font-weight
:
normal
;
font-size
:
24rpx
;
color
:
$u-main-color
;
}
.item-container
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.thumb-box
{
width
:
33
.333333%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
column
;
margin-top
:
20rpx
;
}
.item-menu-image
{
width
:
120rpx
;
height
:
120rpx
;
}
/*提交按钮*/
.btn-bottom
{
border
:
2rpx
solid
#F4F5F7
;
}
.btn-wrap
{
width
:
100%
;
padding
:
20rpx
0
44rpx
0
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.btn-save
{
color
:
#FFFFFF
;
background-color
:
#2272FF
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
.img-list
{
position
:
relative
;
margin
:
8rpx
;
width
:
160rpx
;
height
:
160rpx
;
.pic
{
// margin-right: 15rpx;
// margin-bottom: 15rpx;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
}
}
</
style
>
src/pages/order/detail.vue
View file @
76aa12f2
<
template
>
<
template
>
<view
class=
"order-wrap"
>
<view
class=
"order-wrap"
>
<u-navbar
back-icon-color=
"#FFFFFF"
:background=
"background"
:border-bottom=
"false"
></u-navbar>
<u-navbar
:title=
"title"
title-color=
"#FFFFFF"
title-size=
"32"
back-icon-color=
"#FFFFFF"
:background=
"background"
:border-bottom=
"false"
></u-navbar>
<view
class=
"header"
>
<view
class=
"header"
v-if=
"order.currentOverTime && showTimeOut"
>
<view
class=
"title"
>
订单信息
</view>
<!-- 倒计时 -->
<view
v-show=
"allowRejection"
class=
"button"
@
click=
"rejectOrder"
>
拒单
</view>
<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"
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>
<view
class=
"content"
>
<view
class=
"content"
>
<!-- 订单详情 -->
<view
class=
"card base-item"
>
<view
class=
"card base-item"
>
<Detail
:order=
"order"
:readMore
.
sync=
"readMore"
:operate=
"isAllowDianhuaAndDaohang"
></Detail>
<Detail
:order=
"order"
:readMore
.
sync=
"readMore"
:operate=
"isAllowDianhuaAndDaohang"
></Detail>
</view>
</view>
<!-- 从我的页面进来显示
计
算信息 -->
<!-- 从我的页面进来显示
结
算信息 -->
<view
v-if=
"isFromMine"
class=
"settlement-view"
>
<view
v-if=
"isFromMine"
class=
"settlement-view"
>
<view
class=
"settlement-title"
>
结算信息
</view>
<view
class=
"settlement-title"
>
结算信息
</view>
<view
class=
"settlement-content"
>
<view
class=
"settlement-content"
>
...
@@ -26,62 +37,32 @@
...
@@ -26,62 +37,32 @@
<text>
{{
settlementInfo
.
amount
}}
元
</text>
<text>
{{
settlementInfo
.
amount
}}
元
</text>
</view>
</view>
</view>
</view>
<!-- 其他页面进来 -->
<!--
不是从我的页面,而是
其他页面进来 -->
<view
v-else
>
<view
v-else
>
<!-- 业务文件 -->
<view
class=
"order-file"
v-if=
"showFile"
>
<view
class=
"order-file-left"
>
<image
:src=
"wenjianImage"
class=
"file-image"
></image>
<text>
充电桩安装业务文件
</text>
</view>
<view
class=
"order-file-right"
@
click=
"$u.throttle(handleClickFile, 500)"
>
<text>
点击查看
</text>
<u-icon
name=
"arrow-right"
></u-icon>
</view>
</view>
<!-- 时间选择 -->
<view
class=
"card appoint-item"
v-show=
"showTimeSelect"
>
<view
class=
"card appoint-item"
v-show=
"showTimeSelect"
>
<appoint-time
:dateList=
"dateList"
:timeList=
"timeList"
@
dateChange=
"dateChange"
@
timeChange=
"timeChange"
@
weekChange=
"weekChange"
></appoint-time>
<appoint-time
:dateList=
"dateList"
:timeList=
"timeList"
@
dateChange=
"dateChange"
@
timeChange=
"timeChange"
@
weekChange=
"weekChange"
></appoint-time>
</view>
</view>
<!-- 履约记录 -->
<view
class=
"card record-item"
>
<view
class=
"card record-item"
>
<Record
:orderRecords=
"orderRecords"
></Record>
<Record
:orderRecords=
"orderRecords"
></Record>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 不是从我的页面进来
不用
显示 -->
<!-- 不是从我的页面进来
才
显示 -->
<template
v-if=
"!isFromMine"
>
<template
v-if=
"!isFromMine"
>
<view
v-if=
"showCenterBtn"
class=
"toolbar"
>
<BottomButtons
v-if=
"showBottomBtn"
:buttons=
"buttons"
@
submit=
"handleSubmit"
></BottomButtons>
<!-- 背景,内容,请求接口 根据状态不同改变
{{
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>
<take-photo
type=
"test"
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:num=
"1"
></take-photo>
<take-photo
type=
"test"
v-if=
"takeStatus"
@
close=
"closeTake"
:upload=
"false"
:num=
"1"
></take-photo>
<!--
<PopView
title=
"查看交互规范"
message=
"为完善交付质量,请查看对应的交付规范"
:visible
.
sync=
"visible"
@
click=
"handleClick"
/>
-->
<!--
<PopView
title=
"查看交互规范"
message=
"为完善交付质量,请查看对应的交付规范"
:visible
.
sync=
"visible"
@
click=
"handleClick"
/>
-->
<u-popup
border-radius=
"12"
v-model=
"visible"
safe-area-inset-bottom
mode=
"center"
width=
"690rpx"
<u-popup
border-radius=
"12"
v-model=
"visible"
safe-area-inset-bottom
mode=
"center"
width=
"690rpx"
...
@@ -102,6 +83,7 @@
...
@@ -102,6 +83,7 @@
import
Customer
from
"@/components/mine/customer.vue"
import
Customer
from
"@/components/mine/customer.vue"
import
Record
from
"@/components/order/performanceRecord.vue"
import
Record
from
"@/components/order/performanceRecord.vue"
import
Detail
from
"@/components/order/detail.vue"
import
Detail
from
"@/components/order/detail.vue"
import
BottomButtons
from
"@/components/order/bottomButtons.vue"
let
now
=
new
Date
(
new
Date
().
toLocaleDateString
()).
getTime
();
let
now
=
new
Date
(
new
Date
().
toLocaleDateString
()).
getTime
();
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -110,11 +92,13 @@
...
@@ -110,11 +92,13 @@
// PopView,
// PopView,
Customer
,
Customer
,
Record
,
Record
,
Detail
Detail
,
BottomButtons
},
},
mixins
:
[
baseFile
],
mixins
:
[
baseFile
],
data
()
{
data
()
{
return
{
return
{
title
:
' '
,
readMore
:
true
,
readMore
:
true
,
dateList
:
[
dateList
:
[
{
day
:
now
,
timeRange
:
[]},
{
day
:
now
,
timeRange
:
[]},
...
@@ -151,14 +135,13 @@
...
@@ -151,14 +135,13 @@
allowFeedback
:
false
,
// 允许过程反馈
allowFeedback
:
false
,
// 允许过程反馈
needPhotograph
:
true
,
// 需要现场拍摄
needPhotograph
:
true
,
// 需要现场拍摄
centerButton
:
''
,
// 是否显示按钮
centerButton
:
''
,
// 是否显示按钮
center
ButtonText
:
''
,
bottom
ButtonText
:
''
,
orderRecords
:
[],
orderRecords
:
[],
method
:
null
,
method
:
null
,
show
Center
Btn
:
false
,
show
Bottom
Btn
:
false
,
showTimeSelect
:
false
,
showTimeSelect
:
false
,
submitType
:
''
,
submitType
:
''
,
nextUrl
:
''
,
nextUrl
:
''
,
btnClass
:
'appoint-btn'
,
takeStatus
:
false
,
takeStatus
:
false
,
errorSignIn
:
false
,
errorSignIn
:
false
,
scenePhoto
:
false
,
scenePhoto
:
false
,
...
@@ -177,7 +160,10 @@
...
@@ -177,7 +160,10 @@
centerBtnDisabled
:
false
,
centerBtnDisabled
:
false
,
isFromMine
:
false
,
isFromMine
:
false
,
settlementInfo
:
{
formatTime
:
'-'
,
list
:
[],
amount
:
''
},
settlementInfo
:
{
formatTime
:
'-'
,
list
:
[],
amount
:
''
},
unloaded
:
false
unloaded
:
false
,
timeout
:
false
,
timestamp
:
0
,
showFile
:
false
,
// 显示查看业务文件
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
...
@@ -186,6 +172,11 @@
...
@@ -186,6 +172,11 @@
if
(
option
&&
option
.
id
)
{
if
(
option
&&
option
.
id
)
{
this
.
orderId
=
option
.
id
this
.
orderId
=
option
.
id
}
}
if
(
option
&&
option
.
title
)
{
this
.
title
=
decodeURIComponent
(
option
.
title
)
}
else
{
this
.
title
=
"订单信息"
}
this
.
loadOrderDetail
()
this
.
loadOrderDetail
()
this
.
getLocation
()
this
.
getLocation
()
if
(
option
&&
option
.
isFromMine
)
{
if
(
option
&&
option
.
isFromMine
)
{
...
@@ -207,11 +198,68 @@
...
@@ -207,11 +198,68 @@
this
.
closeLocationChange
()
this
.
closeLocationChange
()
},
},
computed
:
{
computed
:
{
centerButtonClass
()
{
customStyle
()
{
let
btnClass
=
"appoint-btn"
return
{
return
btnClass
'height'
:
'48rpx'
,
'width'
:
'100rpx'
,
'color'
:
'#FFFFFF'
,
'border-color'
:
'transparent'
,
'background-color'
:
'transparent'
}
},
tipText
()
{
switch
(
this
.
bottomButtonText
)
{
case
'接单'
:
return
this
.
timeout
?
'您的订单已超时,请及时接单'
:
'请您注意剩余时间,及时接单'
case
'预约'
:
return
this
.
timeout
?
'您的订单已超时,请及时预约'
:
'请您注意剩余时间,及时预约'
case
'去完工'
:
return
this
.
timeout
?
'您的订单已超时,请及时完工'
:
'请您注意剩余时间,及时完工'
default
:
return
''
}
},
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'
},
},
},
},
methods
:
{
methods
:
{
updateLocation
(){
updateLocation
(){
...
@@ -232,7 +280,6 @@
...
@@ -232,7 +280,6 @@
if
(
this
.
getDistance
(
res
.
latitude
,
res
.
longitude
)
>
this
.
signDistance
){
if
(
this
.
getDistance
(
res
.
latitude
,
res
.
longitude
)
>
this
.
signDistance
){
// 计算签到距离
// 计算签到距离
this
.
btnClass
=
"isGan-btn"
this
.
centerBtnDisabled
=
false
this
.
centerBtnDisabled
=
false
}
else
{
}
else
{
this
.
centerBtnDisabled
=
true
this
.
centerBtnDisabled
=
true
...
@@ -285,13 +332,9 @@
...
@@ -285,13 +332,9 @@
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
self
.
order
=
res
.
data
self
.
order
=
res
.
data
this
.
getCurrentBtn
()
this
.
getCurrentBtn
()
var
nowTime
=
new
Date
();
var
nowTime
=
new
Date
().
getTime
();
if
(
this
.
showTimeOut
&&
this
.
order
.
currentOverTime
&&
nowTime
.
getTime
()
>
this
.
order
.
currentOverTime
){
this
.
timeout
=
this
.
order
.
currentOverTime
&&
nowTime
>
this
.
order
.
currentOverTime
this
.
btnClass
=
'timeOut-btn'
this
.
timestamp
=
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
nowTime
)
/
1000
)
}
// if(self.order.isFirstOrder){
// this.visible = true
// }
// 格式化时间
// 格式化时间
this
.
settlementInfo
.
formatTime
=
this
.
order
.
settleCenterSyncDatetime
?
this
.
$u
.
timeFormat
(
this
.
order
.
settleCenterSyncDatetime
,
'yyyy.mm.dd hh:MM:ss'
)
:
'-'
this
.
settlementInfo
.
formatTime
=
this
.
order
.
settleCenterSyncDatetime
?
this
.
$u
.
timeFormat
(
this
.
order
.
settleCenterSyncDatetime
,
'yyyy.mm.dd hh:MM:ss'
)
:
'-'
}
else
{
}
else
{
...
@@ -439,54 +482,76 @@
...
@@ -439,54 +482,76 @@
var
orderBusinessType
=
this
.
order
.
orderBusinessTypeText
var
orderBusinessType
=
this
.
order
.
orderBusinessTypeText
if
(
orderStatus
<
31
&&
orderBusinessType
===
'指派单'
)
{
if
(
orderStatus
<
31
&&
orderBusinessType
===
'指派单'
)
{
// 接单
// 接单
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
center
ButtonText
=
"接单"
this
.
bottom
ButtonText
=
"接单"
// 已派单的时显示拒单按钮
// 已派单的时显示拒单按钮
this
.
allowRejection
=
true
this
.
allowRejection
=
true
this
.
submitType
=
"orderAccept"
this
.
submitType
=
"orderAccept"
this
.
readMore
=
false
this
.
readMore
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
title
=
'待接单'
,
this
.
showFile
=
false
}
else
if
(
orderStatus
<
31
&&
orderBusinessType
===
'订单池'
)
{
}
else
if
(
orderStatus
<
31
&&
orderBusinessType
===
'订单池'
)
{
// 抢单
// 抢单
this
.
centerButton
=
"appoint1"
this
.
centerButton
=
"appoint1"
this
.
center
ButtonText
=
"抢单"
this
.
bottom
ButtonText
=
"抢单"
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
submitType
=
"orderGan"
this
.
submitType
=
"orderGan"
this
.
showTimeOut
=
false
this
.
showTimeOut
=
false
this
.
readMore
=
false
this
.
readMore
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
isAllowDianhuaAndDaohang
=
false
this
.
title
=
'待抢单'
,
this
.
showFile
=
false
}
else
if
(
orderStatus
===
31
&&
!
this
.
order
.
appointmentDatetime
)
{
}
else
if
(
orderStatus
===
31
&&
!
this
.
order
.
appointmentDatetime
)
{
// 预约
// 预约
this
.
centerButton
=
"appoint2"
this
.
centerButton
=
"appoint2"
this
.
center
ButtonText
=
"预约"
this
.
bottom
ButtonText
=
"预约"
this
.
allowFeedback
=
true
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
showTimeSelect
=
true
this
.
showTimeSelect
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
readMore
=
true
this
.
readMore
=
true
this
.
submitType
=
"workerAppointment"
this
.
submitType
=
"workerAppointment"
this
.
title
=
'待预约'
,
this
.
showFile
=
true
this
.
loadCalendar
()
this
.
loadCalendar
()
}
else
if
(
orderStatus
===
31
&&
this
.
order
.
appointmentDatetime
)
{
}
else
if
(
orderStatus
===
31
&&
this
.
order
.
appointmentDatetime
)
{
// 签到
// 签到
this
.
centerButton
=
"appoint3"
this
.
centerButton
=
"appoint3"
this
.
center
ButtonText
=
"签到"
this
.
bottom
ButtonText
=
"签到"
this
.
allowFeedback
=
true
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
submitType
=
"maintainWorkerCheckin"
this
.
submitType
=
"maintainWorkerCheckin"
this
.
isAllowDianhuaAndDaohang
=
true
this
.
isAllowDianhuaAndDaohang
=
true
this
.
errorSignIn
=
true
this
.
errorSignIn
=
true
this
.
title
=
'待签到'
,
this
.
showFile
=
true
// this.addressToCoordinate()
// this.addressToCoordinate()
this
.
updateLocation
()
this
.
updateLocation
()
}
else
if
(
orderStatus
>
31
&&
orderStatus
<
80
)
{
}
else
if
(
orderStatus
>
31
&&
orderStatus
<
80
)
{
// 完工
// 完工
this
.
centerButton
=
"filish"
this
.
centerButton
=
"filish"
this
.
center
ButtonText
=
"去完工"
this
.
bottom
ButtonText
=
"去完工"
this
.
submitType
=
"toFilish"
this
.
submitType
=
"toFilish"
this
.
allowFeedback
=
true
this
.
allowFeedback
=
true
this
.
show
Center
Btn
=
true
this
.
show
Bottom
Btn
=
true
this
.
scenePhoto
=
true
this
.
scenePhoto
=
true
this
.
readMore
=
true
this
.
readMore
=
true
this
.
isAllowDianhuaAndDaohang
=
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
{
}
else
{
this
.
isAllowDianhuaAndDaohang
=
true
this
.
isAllowDianhuaAndDaohang
=
true
}
}
...
@@ -506,6 +571,24 @@
...
@@ -506,6 +571,24 @@
this
.
handleBtn
()
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
()
{
handleBtn
()
{
console
.
log
(
'click button'
)
console
.
log
(
'click button'
)
if
(
!
this
.
submitType
){
if
(
!
this
.
submitType
){
...
@@ -571,7 +654,7 @@
...
@@ -571,7 +654,7 @@
||
(
res
.
code
!==
undefined
&&
res
.
code
===
200
)
)
{
||
(
res
.
code
!==
undefined
&&
res
.
code
===
200
)
)
{
this
.
trackOrder
()
this
.
trackOrder
()
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
this
.
center
ButtonText
+
'操作成功'
,
title
:
this
.
bottom
ButtonText
+
'操作成功'
,
type
:
'success'
,
type
:
'success'
,
duration
:
1000
,
duration
:
1000
,
callback
:
function
(){
callback
:
function
(){
...
@@ -596,6 +679,10 @@
...
@@ -596,6 +679,10 @@
})
})
}
}
})
})
},
// 去业务材料页面
handleClickFile
()
{
},
},
trackOrder
()
{
trackOrder
()
{
// 接单成功事件,签到成功事件
// 接单成功事件,签到成功事件
...
@@ -615,14 +702,14 @@
...
@@ -615,14 +702,14 @@
})
})
},
},
isGan
(){
isGan
(){
this
.
center
ButtonText
=
"已被抢"
this
.
bottom
ButtonText
=
"已被抢"
this
.
submitType
=
""
this
.
submitType
=
""
this
.
btnClass
=
'isGan-btn'
this
.
centerBtnDisabled
=
true
},
},
clickFeedback
(){
clickFeedback
(){
// 过程反馈
// 过程反馈
uni
.
navigateTo
({
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
(){
filish
(){
...
@@ -703,23 +790,14 @@
...
@@ -703,23 +790,14 @@
Rad
(
d
){
Rad
(
d
){
return
d
*
Math
.
PI
/
180.0
;
//经纬度转换成三角函数中度分表形式。
return
d
*
Math
.
PI
/
180.0
;
//经纬度转换成三角函数中度分表形式。
},
},
timestampDiff
(
currentOverTime
){
// 计算超时时间
timeOutChange
(
timestamp
){
if
(
!
currentOverTime
){
if
(
this
.
timeout
)
this
.
$refs
[
'order-count-down'
].
seconds
+=
2
return
0
if
(
timestamp
==
0
&&
!
this
.
timeout
)
{
// 超时之后倒计时变为正计时
}
setTimeout
(()
=>
{
return
Math
.
round
(
Math
.
abs
(
this
.
order
.
currentOverTime
-
new
Date
().
getTime
())
/
1000
);
this
.
timestamp
=
1
},
this
.
timeout
=
true
timeOutChange
(
currentOverTime
){
},
1000
)
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
}
},
},
// handleClick(){
// handleClick(){
// this.visible = false
// this.visible = false
...
@@ -732,9 +810,6 @@
...
@@ -732,9 +810,6 @@
this
.
visible
=
false
this
.
visible
=
false
// 添加客服
// 添加客服
},
},
threeDays
()
{
return
this
.
timestampDiff
(
this
.
order
.
currentOverTime
)
>
3600
*
24
*
3
}
}
}
};
};
</
script
>
</
script
>
...
@@ -752,26 +827,37 @@
...
@@ -752,26 +827,37 @@
flex-direction
:
column
;
flex-direction
:
column
;
.header
{
.header
{
padding
:
30rpx
30rpx
46rpx
30rpx
;
padding
:
4rpx
32rpx
14rpx
32rpx
;
display
:
flex
;
justify-content
:
space-between
;
.header-content
{
align-items
:
center
;
display
:
flex
;
justify-content
:
space-between
;
.title
{
align-items
:
center
;
line-height
:
40rpx
;
margin-top
:
12rpx
;
font-size
:
40rpx
;
.tip-text
{
color
:
#fff
;
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
;
}
}
}
.title
{
.button
{
display
:
flex
;
text-align
:
center
;
align-items
:
center
;
width
:
106rpx
;
.bottom-tag-view
{
height
:
52rpx
;
color
:
#FFFFFF
;
border-radius
:
40rpx
;
font-size
:
40rpx
;
font-size
:
24rpx
;
margin-right
:
10rpx
;
font-weight
:
400
;
}
line-height
:
52rpx
;
color
:
#DEDEDE
;
}
}
}
}
...
@@ -779,9 +865,7 @@
...
@@ -779,9 +865,7 @@
height
:
100%
;
height
:
100%
;
border-radius
:
12rpx
;
border-radius
:
12rpx
;
overflow
:
auto
;
overflow
:
auto
;
margin-right
:
30rpx
;
margin
:
6rpx
30rpx
30rpx
30rpx
;
margin-left
:
30rpx
;
margin-bottom
:
30rpx
;
.card
{
.card
{
background-color
:
#FFFFFF
;
background-color
:
#FFFFFF
;
...
@@ -911,4 +995,30 @@
...
@@ -911,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
>
</
style
>
src/utils/util.js
View file @
76aa12f2
...
@@ -38,14 +38,14 @@ const setOpenid = function (openid) {
...
@@ -38,14 +38,14 @@ const setOpenid = function (openid) {
function
validImages
(
imgurl
)
{
function
validImages
(
imgurl
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
getImageInfo
({
uni
.
getImageInfo
({
src
:
imgurl
,
src
:
imgurl
,
success
(
res
)
{
success
(
res
)
{
resolve
(
true
)
resolve
(
true
)
},
},
fail
()
{
fail
()
{
reject
(
false
)
reject
(
false
)
}
}
})
})
})
})
}
}
...
@@ -58,7 +58,6 @@ function validImages(imgurl) {
...
@@ -58,7 +58,6 @@ function validImages(imgurl) {
const
imageCache
=
async
function
(
vm
,
src
,
host
)
{
const
imageCache
=
async
function
(
vm
,
src
,
host
)
{
host
=
host
||
process
.
uniEnv
.
qn_base_url
host
=
host
||
process
.
uniEnv
.
qn_base_url
let
image_url
=
host
+
src
let
image_url
=
host
+
src
return
image_url
// 临时
let
image_name
=
md5Libs
.
md5
(
image_url
)
let
image_name
=
md5Libs
.
md5
(
image_url
)
var
arr
=
Object
.
keys
(
vm
.
vuex_cache
);
var
arr
=
Object
.
keys
(
vm
.
vuex_cache
);
const
result
=
await
validImages
(
vm
.
vuex_cache
[
image_name
])
const
result
=
await
validImages
(
vm
.
vuex_cache
[
image_name
])
...
@@ -70,7 +69,6 @@ const imageCache = async function (vm, src, host) {
...
@@ -70,7 +69,6 @@ const imageCache = async function (vm, src, host) {
url
:
image_url
,
url
:
image_url
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
if
(
res
.
statusCode
===
200
)
{
// call_back(res.tempFilePath)
vm
.
$u
.
vuex
(
`vuex_cache.
${
image_name
}
`
,
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