123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <script>
- import amap from './common/amap-wx.130.js'
- var amapPlugin = new amap.AMapWX({
- key: 'bb69713f3c3d3c85e2662d313daa47b9'
- });
- export default {
- globalData: {
-
- getLoca: function() {
- var city = uni.getStorageSync('city')
- return new Promise((resolve, reject) => {
- if(!city) {
- uni.authorize({
- scope: 'scope.userLocation',
- success() {
- wx.getLocation({
- type: 'wgs84',
- success(res) {
- amapPlugin.getRegeo({
- success(data) {
- resolve(data)
- },
- fail(err) {
- console.log('err=',err)
- }
- })
- },
- fail(err){
- console.log('err=',err)
- }
- })
- },
- fail(err) {
- closeLoading('error',err)
- }
- })
- }
- })
-
- }
- },
- onLoad() {
-
- },
- onLaunch: function() {
- console.log('App Launch')
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- },
- }
- </script>
- <style lang="scss">
- /*每个页面公共css */
- @import "uview-ui/index.scss";
-
- .content {
- background-color: #ffffff;
- width: 100%;
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- font-size: 28rpx;
- color: #333;
- box-sizing: border-box;
- }
- .hflex {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- }
- .vflex {
- display: flex;
- flex-direction: column;
- flex-wrap: nowrap;
- }
- .jbetween {
- justify-content: space-between;
- }
- .jaround {
- justify-content: space-around;
- }
- .jend {
- justify-content: flex-end;
- }
- .jcenter {
- justify-content: center;
- }
- .acenter {
- align-items: center;
- }
- .abetween {
- align-content: space-between;
- }
- .astart {
- align-items: flex-start;
- }
- .aend {
- align-items: flex-end;
- }
- .fwrap {
- flex-wrap: wrap;
- }
- .text_hide {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- </style>
|