Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
3a8c7f2c
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3a8c7f2c
编写于
9月 14, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序新增坐标转换
上级
9dac5101
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
65 addition
and
110 deletion
+65
-110
application/service/ConfigService.php
application/service/ConfigService.php
+0
-18
application/service/OrderService.php
application/service/OrderService.php
+0
-15
application/service/UserService.php
application/service/UserService.php
+0
-15
sourcecode/weixin/app.js
sourcecode/weixin/app.js
+45
-22
sourcecode/weixin/pages/buy/buy.js
sourcecode/weixin/pages/buy/buy.js
+4
-9
sourcecode/weixin/pages/extraction-address/extraction-address.js
...ode/weixin/pages/extraction-address/extraction-address.js
+6
-11
sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js
...eixin/pages/plugins/distribution/extraction/extraction.js
+5
-10
sourcecode/weixin/pages/user-order-detail/user-order-detail.js
...ecode/weixin/pages/user-order-detail/user-order-detail.js
+5
-10
未找到文件。
application/service/ConfigService.php
浏览文件 @
3a8c7f2c
...
...
@@ -336,24 +336,6 @@ class ConfigService
}
}
// 坐标处理
if
(
!
empty
(
$data
)
&&
is_array
(
$data
)
&&
in_array
(
APPLICATION_CLIENT_TYPE
,
config
(
'shopxo.coordinate_transformation'
)))
{
foreach
(
$data
as
&
$v
)
{
// 坐标转换 百度转火星(高德,谷歌,腾讯坐标)
if
(
isset
(
$v
[
'lng'
])
&&
isset
(
$v
[
'lat'
]))
{
$map
=
\
base\GeoTransUtil
::
BdToGcj
(
$v
[
'lng'
],
$v
[
'lat'
]);
if
(
isset
(
$map
[
'lng'
])
&&
isset
(
$map
[
'lat'
]))
{
$v
[
'lng'
]
=
$map
[
'lng'
];
$v
[
'lat'
]
=
$map
[
'lat'
];
}
}
}
}
// 自提点地址列表数据钩子
$hook_name
=
'plugins_service_site_extraction_address_list'
;
Hook
::
listen
(
$hook_name
,
[
...
...
application/service/OrderService.php
浏览文件 @
3a8c7f2c
...
...
@@ -1317,21 +1317,6 @@ class OrderService
{
// 销售模式+自提模式 地址信息
$data
=
Db
::
name
(
'OrderAddress'
)
->
where
([
'order_id'
=>
$order_id
])
->
find
();
// 坐标处理
if
(
!
empty
(
$data
)
&&
is_array
(
$data
)
&&
in_array
(
APPLICATION_CLIENT_TYPE
,
config
(
'shopxo.coordinate_transformation'
)))
{
// 坐标转换 百度转火星(高德,谷歌,腾讯坐标)
if
(
isset
(
$data
[
'lng'
])
&&
isset
(
$data
[
'lat'
]))
{
$map
=
\
base\GeoTransUtil
::
BdToGcj
(
$data
[
'lng'
],
$data
[
'lat'
]);
if
(
isset
(
$map
[
'lng'
])
&&
isset
(
$map
[
'lat'
]))
{
$data
[
'lng'
]
=
$map
[
'lng'
];
$data
[
'lat'
]
=
$map
[
'lat'
];
}
}
}
return
empty
(
$data
)
?
[]
:
$data
;
}
...
...
application/service/UserService.php
浏览文件 @
3a8c7f2c
...
...
@@ -418,21 +418,6 @@ class UserService
$is_default
=
false
;
foreach
(
$data
as
&
$v
)
{
// 坐标处理
if
(
in_array
(
APPLICATION_CLIENT_TYPE
,
config
(
'shopxo.coordinate_transformation'
)))
{
// 坐标转换 百度转火星(高德,谷歌,腾讯坐标)
if
(
isset
(
$v
[
'lng'
])
&&
isset
(
$v
[
'lat'
]))
{
$map
=
\
base\GeoTransUtil
::
BdToGcj
(
$v
[
'lng'
],
$v
[
'lat'
]);
if
(
isset
(
$map
[
'lng'
])
&&
isset
(
$map
[
'lat'
]))
{
$v
[
'lng'
]
=
$map
[
'lng'
];
$v
[
'lat'
]
=
$map
[
'lat'
];
}
}
}
// 地区
$v
[
'province_name'
]
=
RegionService
::
RegionName
(
$v
[
'province'
]);
$v
[
'city_name'
]
=
RegionService
::
RegionName
(
$v
[
'city'
]);
...
...
sourcecode/weixin/app.js
浏览文件 @
3a8c7f2c
...
...
@@ -68,7 +68,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
request_url
:
'
http://shopxo.com/
'
,
//
request_url: 'https://dev.shopxo.net/',
request_url
:
'
https://dev.shopxo.net/
'
,
// 基础信息
application_title
:
"
{{application_title}}
"
,
...
...
@@ -531,14 +531,7 @@ App({
this
.
showToast
(
'
事件值格式有误
'
);
return
false
;
}
var
map
=
this
.
BMapTransqqMap
(
parseFloat
(
values
[
2
]),
parseFloat
(
values
[
3
]));
wx
.
openLocation
({
name
:
values
[
0
],
address
:
values
[
1
],
longitude
:
map
.
lng
,
latitude
:
map
.
lat
});
this
.
open_location
(
values
[
2
],
values
[
3
],
values
[
0
],
values
[
1
]);
break
;
// 拨打电话
...
...
@@ -802,18 +795,48 @@ App({
},
100
);
},
BMapTransqqMap
(
lng
,
lat
)
{
let
x_pi
=
3.14159265358979324
*
3000.0
/
180.0
;
let
x
=
lng
-
0.0065
;
let
y
=
lat
-
0.006
;
let
z
=
Math
.
sqrt
(
x
*
x
+
y
*
y
)
+
0.00002
*
Math
.
sin
(
y
*
x_pi
);
let
theta
=
Math
.
atan2
(
y
,
x
)
+
0.000003
*
Math
.
cos
(
x
*
x_pi
);
let
lngs
=
z
*
Math
.
cos
(
theta
);
let
lats
=
z
*
Math
.
sin
(
theta
);
return
{
lng
:
lngs
,
lat
:
lats
};
},
/**
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
* object 回调操作对象
* method 回调操作对象的函数
*/
map_bd_to_gcj
(
lng
,
lat
)
{
let
x_pi
=
3.14159265358979324
*
3000.0
/
180.0
;
let
x
=
lng
-
0.0065
;
let
y
=
lat
-
0.006
;
let
z
=
Math
.
sqrt
(
x
*
x
+
y
*
y
)
+
0.00002
*
Math
.
sin
(
y
*
x_pi
);
let
theta
=
Math
.
atan2
(
y
,
x
)
+
0.000003
*
Math
.
cos
(
x
*
x_pi
);
let
lngs
=
z
*
Math
.
cos
(
theta
);
let
lats
=
z
*
Math
.
sin
(
theta
);
return
{
lng
:
lngs
,
lat
:
lats
};
},
/**
* 百度坐标BD-09到火星坐标GCJ02(高德,谷歌,腾讯坐标)
* lng 经度
* lat 纬度
* name 地图上面显示的名称
* address 地图上面显示的详细地址
* scale 缩放比例,范围5~18
*/
open_location
(
lng
,
lat
,
name
,
address
,
scale
)
{
if
(
lng
==
undefined
||
lat
==
undefined
||
lng
==
''
||
lat
==
''
)
{
this
.
showToast
(
'
坐标有误
'
);
return
false
;
}
// 转换坐标打开位置
var
position
=
this
.
map_bd_to_gcj
(
parseFloat
(
lng
),
parseFloat
(
lat
));
wx
.
openLocation
({
name
:
name
||
''
,
address
:
address
||
''
,
scale
:
scale
||
18
,
longitude
:
position
.
lng
,
latitude
:
position
.
lat
});
},
});
\ No newline at end of file
sourcecode/weixin/pages/buy/buy.js
浏览文件 @
3a8c7f2c
...
...
@@ -365,14 +365,9 @@ Page({
return
false
;
}
var
lng
=
parseFloat
(
data
.
lng
||
0
);
var
lat
=
parseFloat
(
data
.
lat
||
0
);
wx
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
data
.
name
||
data
.
alias
||
''
,
address
:
(
data
.
province_name
||
''
)
+
(
data
.
city_name
||
''
)
+
(
data
.
county_name
||
''
)
+
(
data
.
address
||
''
),
});
// 打开地图
var
name
=
data
.
name
||
data
.
alias
||
''
;
var
address
=
(
data
.
province_name
||
''
)
+
(
data
.
city_name
||
''
)
+
(
data
.
county_name
||
''
)
+
(
data
.
address
||
''
);
app
.
open_location
(
data
.
lng
,
data
.
lat
,
name
,
address
);
},
});
sourcecode/weixin/pages/extraction-address/extraction-address.js
浏览文件 @
3a8c7f2c
...
...
@@ -107,22 +107,17 @@ Page({
// 地图查看
address_map_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
||
0
;
var
ads
=
this
.
data
.
data_list
[
index
]
||
null
;
if
(
ads
==
null
)
var
data
=
this
.
data
.
data_list
[
index
]
||
null
;
if
(
data
==
null
)
{
app
.
showToast
(
"
地址有误
"
);
return
false
;
}
var
lng
=
parseFloat
(
ads
.
lng
||
0
);
var
lat
=
parseFloat
(
ads
.
lat
||
0
);
wx
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
ads
.
alias
||
''
,
address
:
(
ads
.
province_name
||
''
)
+
(
ads
.
city_name
||
''
)
+
(
ads
.
county_name
||
''
)
+
(
ads
.
address
||
''
),
});
// 打开地图
var
name
=
data
.
alias
||
''
;
var
address
=
(
data
.
province_name
||
''
)
+
(
data
.
city_name
||
''
)
+
(
data
.
county_name
||
''
)
+
(
data
.
address
||
''
);
app
.
open_location
(
data
.
lng
,
data
.
lat
,
name
,
address
);
},
// 地址内容事件
...
...
sourcecode/weixin/pages/plugins/distribution/extraction/extraction.js
浏览文件 @
3a8c7f2c
...
...
@@ -91,17 +91,12 @@ Page({
if
((
this
.
data
.
extraction
||
null
)
==
null
)
{
return
false
;
}
var
data
=
this
.
data
.
extraction
;
var
ads
=
this
.
data
.
extraction
;
var
lng
=
parseFloat
(
ads
.
lng
||
0
);
var
lat
=
parseFloat
(
ads
.
lat
||
0
);
wx
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
ads
.
alias
||
''
,
address
:
(
ads
.
province_name
||
''
)
+
(
ads
.
city_name
||
''
)
+
(
ads
.
county_name
||
''
)
+
(
ads
.
address
||
''
),
});
// 打开地图
var
name
=
data
.
alias
||
''
;
var
address
=
(
data
.
province_name
||
''
)
+
(
data
.
city_name
||
''
)
+
(
data
.
county_name
||
''
)
+
(
data
.
address
||
''
);
app
.
open_location
(
data
.
lng
,
data
.
lat
,
name
,
address
);
},
// 进入取货订单管理
...
...
sourcecode/weixin/pages/user-order-detail/user-order-detail.js
浏览文件 @
3a8c7f2c
...
...
@@ -124,17 +124,12 @@ Page({
app
.
showToast
(
"
地址有误
"
);
return
false
;
}
var
data
=
this
.
data
.
detail
.
address_data
;
var
ads
=
this
.
data
.
detail
.
address_data
;
var
lng
=
parseFloat
(
ads
.
lng
||
0
);
var
lat
=
parseFloat
(
ads
.
lat
||
0
);
wx
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
ads
.
alias
||
''
,
address
:
(
ads
.
province_name
||
''
)
+
(
ads
.
city_name
||
''
)
+
(
ads
.
county_name
||
''
)
+
(
ads
.
address
||
''
),
});
// 打开地图
var
name
=
data
.
alias
||
''
;
var
address
=
(
data
.
province_name
||
''
)
+
(
data
.
city_name
||
''
)
+
(
data
.
county_name
||
''
)
+
(
data
.
address
||
''
);
app
.
open_location
(
data
.
lng
,
data
.
lat
,
name
,
address
);
},
// 下拉刷新
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录