feat: 模型增加经纬度
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/pages/home/index.js
vendored
2
dist/pages/home/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -122,14 +122,22 @@ const details = () => {
|
|||||||
<View>
|
<View>
|
||||||
<Cell
|
<Cell
|
||||||
icon="clock"
|
icon="clock"
|
||||||
title={`开始时间 ${dataSource?.startTime?moment(dataSource?.startTime).format('YYYY-MM-DD HH:mm:ss'):''}`}
|
title={`开始时间 ${
|
||||||
|
dataSource?.startTime
|
||||||
|
? moment(dataSource?.startTime).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
: ""
|
||||||
|
}`}
|
||||||
// isLink
|
// isLink
|
||||||
// linkType="navigateTo"
|
// linkType="navigateTo"
|
||||||
// url="/pages/dashboard/index"
|
// url="/pages/dashboard/index"
|
||||||
/>
|
/>
|
||||||
<Cell
|
<Cell
|
||||||
icon="clock"
|
icon="clock"
|
||||||
title={`结束时间 ${dataSource?.endTime?moment(dataSource?.endTime).format('YYYY-MM-DD HH:mm:ss'):''}`}
|
title={`结束时间 ${
|
||||||
|
dataSource?.endTime
|
||||||
|
? moment(dataSource?.endTime).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
: ""
|
||||||
|
}`}
|
||||||
// isLink
|
// isLink
|
||||||
// linkType="navigateTo"
|
// linkType="navigateTo"
|
||||||
// url="/pages/dashboard/index"
|
// url="/pages/dashboard/index"
|
||||||
@@ -140,6 +148,13 @@ const details = () => {
|
|||||||
title={`${dataSource?.address}`}
|
title={`${dataSource?.address}`}
|
||||||
linkType="navigateTo"
|
linkType="navigateTo"
|
||||||
url="/pages/dashboard/index"
|
url="/pages/dashboard/index"
|
||||||
|
onClick={() => {
|
||||||
|
Taro.openLocation({
|
||||||
|
latitude: dataSource?.latitude,
|
||||||
|
longitude: dataSource?.longitude,
|
||||||
|
scale: 18,
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Cell
|
<Cell
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const Home = () => {
|
|||||||
path: "/page/user?id=123",
|
path: "/page/user?id=123",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
@@ -91,7 +91,7 @@ const Home = () => {
|
|||||||
getsystemConfig(); //获取系统配置
|
getsystemConfig(); //获取系统配置
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getdetails(); //获取活动详情
|
getdetails(); //获取活动详情
|
||||||
}, 1000);
|
}, 300);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -244,11 +244,15 @@ const Home = () => {
|
|||||||
// Taro.navigateTo({
|
// Taro.navigateTo({
|
||||||
// url: `/pages/home/components/CheckIn/index?fileID=${tempFilePaths?.[0]}`,
|
// url: `/pages/home/components/CheckIn/index?fileID=${tempFilePaths?.[0]}`,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
uploadTaro(tempFilePaths);
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
// 刷新页面数据
|
||||||
getsystemConfig(); //获取系统配置
|
getsystemConfig(); //获取系统配置
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getdetails(); //获取活动详情
|
getdetails(); //获取活动详情
|
||||||
}, 300);
|
}, 300);
|
||||||
uploadTaro(tempFilePaths);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -370,7 +374,18 @@ const Home = () => {
|
|||||||
setisIn(true);
|
setisIn(true);
|
||||||
console.log("isin", isin);
|
console.log("isin", isin);
|
||||||
if (isin) {
|
if (isin) {
|
||||||
chooseImage();
|
// 获取定位信息
|
||||||
|
Taro.getLocation({
|
||||||
|
type: "gcj02", //返回可以用于 Taro.openLocation的经纬度
|
||||||
|
success: function (res) {
|
||||||
|
console.log("lbs", res);
|
||||||
|
const latitude = res.latitude;
|
||||||
|
const longitude = res.longitude;
|
||||||
|
// 拍照上传
|
||||||
|
chooseImage();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// chooseImage();
|
||||||
} else {
|
} else {
|
||||||
Toast.fail({
|
Toast.fail({
|
||||||
message: "请先登录",
|
message: "请先登录",
|
||||||
|
|||||||
Reference in New Issue
Block a user