@@ -137,7 +137,6 @@
};
},
onShow: function() {
-
methods: {
toPath(e) {
@@ -11,9 +11,9 @@
</uni-forms-item>
<uni-forms-item label="所在地区" name="deptname">
<uni-data-picker placeholder="请选择省,市,区/街道" popup-title="选择省,市,区/街道" :localdata="provincial"
- @change="onchange">
+ @change="onchange" class="local">
</uni-data-picker>
- <text class="iconfont icon-dingweixiao"
+ <text class="localicon iconfont icon-dingweixiao"
@click="tolocation('/pagesMy/address/location')">定位</text>
<uni-forms-item label="详细地址" name="address">
@@ -95,7 +95,7 @@
// 选择城市
onchange() {},
// 定位
- tolocation(route,e) {
+ tolocation(route, e) {
uni.navigateTo({
url: `${route}`
})
@@ -169,4 +169,17 @@
display: flex;
flex-direction: row;
}
+
+ .local {
+ .uni-data-tree {
+ width: 60vw;
+ }
+ .localicon {
+ position: absolute;
+ right: 0;
+ top: 5px;
</style>
@@ -1,10 +1,9 @@
<template>
- <mobile-frame :frameStyle="frameStyle" @toPath="toPath">
+ <mobile-frame :frameStyle="frameStyle">
<view class="main">
<view class="one">
</view>
</mobile-frame>
</template>
@@ -13,14 +12,17 @@
data() {
return {
frameStyle: {
- useBar: true
+ useBar: false
onLoad: function(e) {
+ console.log('1');
uni.getLocation({
type: 'wgs84',
+ geocode: true,
success: function(res) {
+ console.log(res);
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
@@ -28,11 +30,7 @@
onShow: function() {},
- toPath(e) {
- if (e && e.route) uni.redirectTo({
- url: `/${e.route}`
- })
- },
</script>