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
f19f0e42
Commit
f19f0e42
authored
May 08, 2021
by
Damon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.banshouhui.com/lijundan/self-support
parents
5f4adc8e
9744d1fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
16 deletions
+100
-16
index.vue
src/components/order/index.vue
+8
-7
index.vue
src/pages/index/index.vue
+36
-2
order.vue
src/pages/index/order.vue
+22
-4
detail.vue
src/pages/order/detail.vue
+34
-3
No files found.
src/components/order/index.vue
View file @
f19f0e42
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<text>
{{
orderData
.
contactAddress
}}
</text>
<text>
{{
orderData
.
contactAddress
}}
</text>
</view>
</view>
<view
v-if=
"showDistance"
>
<view
v-if=
"showDistance"
>
{{
getDistance
(
orderData
.
contactAddressLatitud
,
orderData
.
contactAddressLongitud
)
}}
km
{{
orderDistance
}}
km
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
location
:
{
// 当前坐标
location
:
{
// 当前坐标
type
:
Array
,
type
:
Array
,
default
()
{
default
()
{
return
[
116.3896
,
39.91917
]
//
经度,纬
度
return
[
116.3896
,
39.91917
]
//
纬度,经
度
}
}
}
}
},
},
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
*/
*/
orderType
:
0
orderType
:
0
};
};
},
},
computed
:
{
computed
:
{
orderText
()
{
// 按钮文字
orderText
()
{
// 按钮文字
return
this
.
typeTexts
[
this
.
orderType
]
return
this
.
typeTexts
[
this
.
orderType
]
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
return
this
.
orderType
==
5
return
this
.
orderType
==
5
},
},
showDistance
()
{
showDistance
()
{
return
this
.
orderType
==
0
return
this
.
orderType
==
0
&&
this
.
location
.
length
>=
2
},
},
types
()
{
types
()
{
return
{
return
{
...
@@ -208,6 +208,10 @@
...
@@ -208,6 +208,10 @@
'exception'
:
5
,
// 异常单、
'exception'
:
5
,
// 异常单、
'finish'
:
6
,
//已完工
'finish'
:
6
,
//已完工
}
}
},
orderDistance
()
{
console
.
log
(
'orderData.contactAddressLatitud:'
,
this
.
orderData
.
contactAddressLatitud
,
'orderData.contactAddressLongitud'
,
this
.
orderData
.
contactAddressLongitud
,
'location:'
,
this
.
location
[
0
],
this
.
location
[
1
])
return
this
.
distance
(
this
.
orderData
.
contactAddressLatitud
,
this
.
orderData
.
contactAddressLongitud
,
this
.
location
[
0
],
this
.
location
[
1
])
}
}
},
},
created
()
{
created
()
{
...
@@ -265,9 +269,6 @@
...
@@ -265,9 +269,6 @@
},
1000
)
},
1000
)
}
}
},
},
getDistance
(
Latitud
,
Longitud
)
{
return
this
.
distance
(
Latitud
,
Longitud
,
this
.
location
[
0
],
this
.
location
[
1
])
},
/**
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* 计算两点之间直线距离
...
...
src/pages/index/index.vue
View file @
f19f0e42
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
data
()
{
data
()
{
return
{
return
{
status
:
0
,
// 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
status
:
0
,
// 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location
:
[
116.3896
,
39.91917
],
// 经纬度
location
:
[],
// 经纬度
title
:
false
,
title
:
false
,
title
:
"Hello"
,
title
:
"Hello"
,
loaded
:
false
,
loaded
:
false
,
...
@@ -146,7 +146,8 @@
...
@@ -146,7 +146,8 @@
// 每次进入页面都刷新入驻状态
// 每次进入页面都刷新入驻状态
if
(
this
.
vuex_token
)
{
if
(
this
.
vuex_token
)
{
this
.
initSettleInfo
();
this
.
initSettleInfo
();
}
}
this
.
getLocation
()
},
},
// onPullDownRefresh() {
// onPullDownRefresh() {
// console.log('------下拉刷新------')
// console.log('------下拉刷新------')
...
@@ -365,6 +366,39 @@
...
@@ -365,6 +366,39 @@
}
}
});
});
},
},
/**
* 获取当前位置的经纬度
*/
getLocation
()
{
let
self
=
this
uni
.
getLocation
({
type
:
'gcj02'
,
success
:
function
(
res
)
{
self
.
location
=
[
res
.
latitude
,
res
.
longitude
]
},
complete
:
function
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'auth'
)
!=
-
1
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'获取权限失败,请到设置页面开启权限'
,
confirmText
:
'好的'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
uni
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
.
authSetting
)
}
});
}
}
})
}
},
fail
:
function
(
err
)
{
}
});
},
},
},
};
};
</
script
>
</
script
>
...
...
src/pages/index/order.vue
View file @
f19f0e42
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
},
},
onLoad
()
{
onLoad
()
{
this
.
_freshing
=
false
;
this
.
_freshing
=
false
;
this
.
getLocation
();
// this.getLocation(); // 不需要获取位置
// this.getOrderCount();
// this.getOrderCount();
// this.getOrderList(0);
// this.getOrderList(0);
},
},
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
},
},
computed
:
{
computed
:
{
subList
()
{
subList
()
{
return
[
'待
受
理'
,
'已完工'
]
return
[
'待
处
理'
,
'已完工'
]
},
},
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
orderType
()
{
orderType
()
{
...
@@ -170,8 +170,26 @@
...
@@ -170,8 +170,26 @@
dataValue
.
push
(
res
.
latitude
)
dataValue
.
push
(
res
.
latitude
)
self
.
dataValue
=
dataValue
self
.
dataValue
=
dataValue
},
},
fail
(
err
)
{
complete
:
function
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'auth'
)
!=
-
1
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'获取权限失败,请到设置页面开启权限'
,
confirmText
:
'好的'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
uni
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
.
authSetting
)
}
});
}
}
})
}
},
fail
:
function
(
err
)
{
}
}
});
});
},
},
...
...
src/pages/order/detail.vue
View file @
f19f0e42
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<u-icon
name=
"map"
size=
"28"
></u-icon>
<u-icon
name=
"map"
size=
"28"
></u-icon>
<text
class=
"address-txt"
>
{{
order
.
contactAddress
}}
</text>
<text
class=
"address-txt"
>
{{
order
.
contactAddress
}}
</text>
</view>
</view>
<u-image
width=
"48rpx"
height=
"48rpx"
:src=
"navigationIcon"
@
click=
"openLocation"
></u-image>
<u-image
width=
"48rpx"
height=
"48rpx"
:src=
"navigationIcon"
@
click=
"openLocation
(order.contactAddress)
"
></u-image>
</view>
</view>
<!--
<u-read-more
ref=
"uReadMore"
:show-height=
"40"
:shadowStyle=
"
{paddingTop: '0rpx',marginTop: '0rpx'}" close-text="查看更多" open-text="点击收起" toggle color="#2272FF" font-size="26"> -->
<!--
<u-read-more
ref=
"uReadMore"
:show-height=
"40"
:shadowStyle=
"
{paddingTop: '0rpx',marginTop: '0rpx'}" close-text="查看更多" open-text="点击收起" toggle color="#2272FF" font-size="26"> -->
<view
v-if=
"readMore"
@
click=
"readMore = false"
class=
"read-more-toggle"
>
<view
v-if=
"readMore"
@
click=
"readMore = false"
class=
"read-more-toggle"
>
...
@@ -268,7 +268,7 @@
...
@@ -268,7 +268,7 @@
}
}
},
},
methods
:
{
methods
:
{
openLocation
(){
openLocation
(
address
){
if
(
this
.
isAllowDianhuaAndDaohang
){
if
(
this
.
isAllowDianhuaAndDaohang
){
uni
.
getLocation
({
uni
.
getLocation
({
type
:
'gcj02'
,
//返回可以用于uni.openLocation的经纬度
type
:
'gcj02'
,
//返回可以用于uni.openLocation的经纬度
...
@@ -281,7 +281,35 @@
...
@@ -281,7 +281,35 @@
success
:
function
()
{
success
:
function
()
{
console
.
log
(
'success'
);
console
.
log
(
'success'
);
}
}
});
});
},
complete
:
function
(
res
)
{
console
.
log
(
'-------complete-----'
,
res
)
if
(
res
.
errMsg
.
indexOf
(
'auth'
)
!=
-
1
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'获取权限失败,请到设置页面开启权限'
,
confirmText
:
'好的'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
uni
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
.
authSetting
)
}
});
}
}
})
}
else
{
uni
.
setClipboardData
({
data
:
address
,
success
:
function
()
{
console
.
log
(
'success'
);
}
});
}
}
}
});
});
}
}
...
@@ -346,7 +374,7 @@
...
@@ -346,7 +374,7 @@
self
.
order
=
res
.
data
self
.
order
=
res
.
data
this
.
getCurrentBtn
()
this
.
getCurrentBtn
()
var
nowTime
=
new
Date
();
var
nowTime
=
new
Date
();
if
(
nowTime
.
getTime
()
>
this
.
order
.
currentOverTime
){
if
(
this
.
order
.
currentOverTime
&&
nowTime
.
getTime
()
>
this
.
order
.
currentOverTime
){
this
.
btnClass
=
'timeOut-btn'
this
.
btnClass
=
'timeOut-btn'
}
}
if
(
self
.
order
.
isFirstOrder
){
if
(
self
.
order
.
isFirstOrder
){
...
@@ -789,6 +817,9 @@
...
@@ -789,6 +817,9 @@
line-height
:
24rpx
;
line-height
:
24rpx
;
margin-top
:
20rpx
;
margin-top
:
20rpx
;
margin-bottom
:
40rpx
;
margin-bottom
:
40rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.left
{
.left
{
.address-txt
{
.address-txt
{
margin-left
:
8rpx
;
margin-left
:
8rpx
;
...
...
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