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
4b2490e8
Commit
4b2490e8
authored
Apr 22, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
d6a13c45
403838d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
290 additions
and
48 deletions
+290
-48
index.vue
src/components/order/index.vue
+263
-28
main.js
src/main.js
+5
-2
pages.json
src/pages.json
+14
-14
index.vue
src/pages/learn/index.vue
+2
-1
news-details.vue
src/pages/learn/news-details.vue
+4
-1
mpShare.js
src/uview-ui/libs/mixin/mpShare.js
+2
-2
No files found.
src/components/order/index.vue
View file @
4b2490e8
<
template
>
<
template
>
<view
class=
"order-view"
>
<view
class=
"order-view"
@
click=
"handleClickCell"
>
<text>
订单
</text>
<view
class=
"order-top-view"
>
</view>
<view
class=
"left-view"
>
</
template
>
<view
:class=
"['tag-view',
{'active': orderData.orderServiceType == '安装'}]">
{{
orderData
.
orderServiceType
}}
</view>
<
script
>
<view
class=
"store-view"
>
{{
orderData
.
categoryName
}}
</view>
export
default
{
</view>
props
:
{
<view
class=
"right-view"
>
{{
orderData
.
orderBusinessTypeText
}}
</view>
orderData
:
{
</view>
type
:
Object
,
<view
class=
"content-view"
>
default
:
{}
<view
class=
"info-view"
v-for=
"(item, key) in infoTexts"
:key=
"key"
>
}
<text>
{{
item
}}
:
</text>
},
<text>
{{
orderData
[
key
]
}}
</text>
data
()
{
</view>
return
{
<view
class=
"address-view"
>
<view
class=
"address-left-view"
>
};
<image
class=
"address-image"
:src=
"dizhiImage"
></image>
}
<text>
{{
orderData
.
contactAddress
}}
</text>
}
</view
class="address-right-view"
>
</
script
>
<view>
{{
getDistance
(
orderData
.
contactAddressLatitud
,
orderData
.
contactAddressLongitud
)
}}
km
</view>
</view>
<
style
lang=
"scss"
scoped
>
</view>
.order-view
{
width
:
100%
;
<u-divider
margin-top=
"16"
half-width=
"630"
border-color=
"#F4F5F7"
:use-slot=
"false"
>
height
:
200rpx
;
</u-divider>
}
<view
class=
"bottom"
>
<view
class=
"left"
>
<view
class=
"tag"
>
剩
</view>
<u-count-down
:timestamp=
"timestamp"
font-size=
"44"
color=
"#FF930D"
></u-count-down>
</view>
<u-button
class=
"right-btn"
@
click
.
stop=
"handleClick"
:custom-style=
"buttonStyle"
>
{{
orderText
}}
</u-button>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
orderData
:
{
type
:
Object
,
default
:
{
orderServiceType
:
'安装'
,
// 服务类型:安装、维修
categoryName
:
'充电桩'
,
// 品类:充电桩
orderBusinessTypeText
:
'分配单'
,
// 业务类型:分配单、订单池
orderNumber
:
'OR2021041809827'
,
// 工单编号
contactName
:
'郭小清'
,
// 客户信息
contactPhone
:
'13631612077'
,
// 联系方式
contactAddress
:
'湾街道荔枝花园D座125号'
,
// 详细地址
contactAddressLatitud
:
'116.3896'
,
// 联系人地址经度
contactAddressLongitud
:
'39.91917'
,
// 联系人地址纬度
orderStatus
:
'0'
,
// 工单状态
appointmentDatetime
:
''
// 预约时间
}
},
orderType
:
Number
// 0:待接单 1:'去预约', 2:'去签到', 3:'去完工', 4:'审核中', 5:'去处理', 6'已完工'
},
data
()
{
return
{
};
},
computed
:
{
/*
orderStatus:
待接单 orderStatus<31 工单状态小于31
待预约 orderStatus == 31 and appointmentDatetime == null 工单状态等于30并且预约时间为空
待签到 orderStatus == 31 and appointmentDatetime is not null 工单状态等于30并且预约时间不为空
待完工 orderStatus >31 and orderStatus < 80 工单状态大于31 小于80
审核中 orderStatus ==85 or orderStatus == 87 工单状态 等于85 或者 等于有87
异常 orderStatus ==86 or orderStatus == 88 工单状态 等于86 或者 等于有88
已完工 orderStatus in(80,81,89,110) 工单状态 等于80 or 81 or 89 or 110
*/
orderText
()
{
// 按钮文字
if
(
!
this
.
orderType
)
{
if
(
this
.
orderData
.
orderStatus
<
31
)
{
this
.
orderType
=
0
}
else
if
(
this
.
orderData
.
orderStatus
==
31
)
{
if
(
this
.
orderData
.
appointmentDatetime
)
{
return
this
.
orderType
=
2
}
else
{
this
.
orderType
=
1
}
}
else
if
(
this
.
orderData
.
orderStatus
>
31
&&
this
.
orderData
.
orderStatus
<
80
)
{
this
.
orderType
=
3
}
else
if
(
this
.
orderData
.
orderStatus
==
85
&&
this
.
orderData
.
orderStatus
==
87
)
{
this
.
orderType
=
4
}
else
if
(
this
.
orderData
.
orderStatus
==
86
&&
this
.
orderData
.
orderStatus
==
88
)
{
this
.
orderType
=
5
}
else
if
([
80
,
81
,
89
,
110
].
indexOf
(
this
.
orderData
.
orderStatus
)
!=
-
1
)
{
this
.
orderType
=
6
}
else
{
this
.
orderType
=
0
}
}
return
this
.
typeTexts
[
this
.
orderType
]
},
buttonStyle
()
{
// 按钮样式
switch
(
this
.
status
)
{
case
0
:
if
(
this
.
orderData
.
currentWillOverTime
)
{
return
this
.
buttonStyle
[
0
]
}
else
{
return
this
.
buttonStyle
[
1
]
}
case
1
:
case
2
:
case
3
:
case
5
:
return
this
.
buttonStyle
[
0
]
case
4
:
case
6
:
return
this
.
buttonStyle
[
2
]
}
},
infoTexts
()
{
return
{
'orderNumber'
:
'工单编号'
,
'contactName'
:
'客户信息'
,
'contactPhone'
:
'联系方式'
}
},
typeTexts
()
{
return
[
this
.
type0Text
,
'去预约'
,
'去签到'
,
'去完工'
,
'审核中'
,
'去处理'
,
'已完工'
]
},
type0Text
()
{
return
this
.
orderData
.
currentWillOverTime
?
'接单'
:
'抢单'
},
buttonStyles
()
{
return
[{
'background-color'
:
'#2272FF'
,
'color'
:
'#FFFFFF'
},
{
'background-color'
:
'#FF930D'
,
'color'
:
'#FFFFFF'
},
{
'background-color'
:
'transparent'
,
'color'
:
'#2272FF'
}]
},
buttonDisabled
()
{
return
this
.
orderData
.
orderStatus
==
4
||
this
.
orderData
.
orderStatus
==
6
},
dizhiImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'dizhi.png'
},
},
methods
:
{
handleClick
()
{
if
(
buttonDisabled
)
return
this
.
$emit
(
'action'
)
},
actionClick
()
{
this
.
$emit
(
'click'
)
},
getDistance
(
Latitud
,
Longitud
)
{
return
this
.
distance
(
Latitud
,
Longitud
,
this
.
dataValue
[
0
],
this
.
dataValue
[
1
])
},
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1 经度
* @param float $lat1 维度
* @param float $lon2 经度
* @param float $lat2 维度
* @return float 浮点数
*/
distance
(
la1
,
lo1
,
la2
,
lo2
)
{
var
La1
=
la1
*
Math
.
PI
/
180.0
;
var
La2
=
la2
*
Math
.
PI
/
180.0
;
var
La3
=
La1
-
La2
;
var
Lb3
=
lo1
*
Math
.
PI
/
180.0
-
lo2
*
Math
.
PI
/
180.0
;
var
s
=
2
*
Math
.
asin
(
Math
.
sqrt
(
Math
.
pow
(
Math
.
sin
(
La3
/
2
),
2
),
Math
.
cos
(
La1
)
*
Math
.
cos
(
La2
)
*
Math
.
pow
(
Math
.
sin
(
Lb3
/
2
),
2
)));
s
=
s
*
6378.137
;
//地球半径
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
// console.log("计算结果",s,'KM');
return
s
?
s
.
toFixed
(
2
)
:
0
;
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.order-view
{
width
:
100%
;
background-color
:
#FFFFFF
;
border-radius
:
12rpx
;
padding
:
30rpx
;
.order-top-view
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.left-view
{
display
:
flex
;
align-items
:
center
;
.tag-view
{
width
:
84rpx
;
height
:
40rpx
;
color
:
#FFFFFF
;
border-radius
:
8rpx
;
background-image
:
linear-gradient
(
to
right
,
#FF930D
,
#FFC174
);
&
.active
{
background-image
:
linear-gradient
(
to
right
,
#2272FF
,
#47ABFF
);
}
}
.store-view
{
color
:
#333333
;
font-size
:
36rpx
;
font-weight
:
bold
;
margin-left
:
20rpx
;
}
}
.right-view
{
width
:
100rpx
;
height
:
40rpx
;
background-color
:
#F4F5F7
;
border-radius
:
20rpx
;
color
:
#333333
;
font-size
:
22rpx
;
line-height
:
40rpx
;
}
}
.content-view
{
.info-view
{
text-align
:
left
;
margin-top
:
20rpx
;
color
:
#333333
;
font-size
:
26rpx
;
}
.address-view
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
color
:
#333333
;
font-size
:
24rpx
;
.address-left-view
{
display
:
flex
;
align-items
:
center
;
.address-image
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
8rpx
;
}
}
.address-right-view
{}
}
}
}
</
style
>
</
style
>
src/main.js
View file @
4b2490e8
...
@@ -21,8 +21,11 @@ Vue.use(httpInterceptor, app)
...
@@ -21,8 +21,11 @@ Vue.use(httpInterceptor, app)
Vue
.
use
(
router
)
Vue
.
use
(
router
)
// http接口API抽离,免于写url或者一些固定的参数
// http接口API抽离,免于写url或者一些固定的参数
import
httpApi
from
'@/common/http.api.js'
import
httpApi
from
'@/common/http.api.js'
Vue
.
use
(
httpApi
,
app
)
Vue
.
use
(
httpApi
,
app
)
// 分享
let
mpShare
=
require
(
'@/uview-ui/libs/mixin/mpShare.js'
)
Vue
.
mixin
(
mpShare
)
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
// #ifdef H5
RouterMount
(
app
,
router
,
'#app'
)
RouterMount
(
app
,
router
,
'#app'
)
...
...
src/pages.json
View file @
4b2490e8
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"订单"
"navigationBarTitleText"
:
"订单"
}
}
},
},
{
{
"path"
:
"pages/order/complete"
,
"path"
:
"pages/order/complete"
,
"style"
:
{
"style"
:
{
...
@@ -175,15 +175,15 @@
...
@@ -175,15 +175,15 @@
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
}
}
,{
,{
//
订单详情页
//
订单详情页
"path"
:
"pages/order/detail"
,
"path"
:
"pages/order/detail"
,
"style"
:
"style"
:
{
{
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
"navigationStyle"
:
"custom"
//
隐藏系统导航栏
}
}
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
...
@@ -261,10 +261,10 @@
...
@@ -261,10 +261,10 @@
"path"
:
"pages/settle/file"
,
//启动页面,必选
"path"
:
"pages/settle/file"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
},
{
{
"name"
:
"缴纳保证金"
,
//模式名称
"name"
:
"缴纳保证金"
,
//模式名称
"path"
:
"pages/settle/pay-ensure"
,
//启动页面,必选
"path"
:
"pages/settle/pay-ensure"
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
},
},
{
{
"name"
:
"签约页面"
,
//模式名称
"name"
:
"签约页面"
,
//模式名称
...
...
src/pages/learn/index.vue
View file @
4b2490e8
...
@@ -198,7 +198,8 @@ export default {
...
@@ -198,7 +198,8 @@ export default {
};
};
},
},
onLoad
()
{
onLoad
()
{
this
.
getList
();
this
.
getList
();
this
.
$u
.
mpShare
.
path
=
''
},
},
methods
:
{
methods
:
{
...
...
src/pages/learn/news-details.vue
View file @
4b2490e8
...
@@ -23,7 +23,10 @@
...
@@ -23,7 +23,10 @@
},
},
methods
:
{
methods
:
{
}
},
onLoad
()
{
this
.
$u
.
mpShare
.
path
=
''
},
}
}
</
script
>
</
script
>
...
...
src/uview-ui/libs/mixin/mpShare.js
View file @
4b2490e8
...
@@ -2,8 +2,8 @@ module.exports = {
...
@@ -2,8 +2,8 @@ module.exports = {
onLoad
()
{
onLoad
()
{
// 设置默认的转发参数
// 设置默认的转发参数
this
.
$u
.
mpShare
=
{
this
.
$u
.
mpShare
=
{
title
:
''
,
// 默认为小程序名称
title
:
'
充电桩安装火爆进行中...就等你
'
,
// 默认为小程序名称
path
:
''
,
// 默认为当前页面路径
path
:
'
/pages/index/index
'
,
// 默认为当前页面路径
imageUrl
:
''
// 默认为当前页面的截图
imageUrl
:
''
// 默认为当前页面的截图
}
}
},
},
...
...
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