From 9037ff1365b98052bc45d08bff53f8f9f3b990cc Mon Sep 17 00:00:00 2001 From: shuiqing Date: Mon, 16 Jul 2018 18:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 --- app.json | 2 ++ pages/at_present/at_present.js | 42 ++++++++++++++++++++++++++++++ pages/at_present/at_present.json | 3 +++ pages/at_present/at_present.wxml | 15 +++++++++++ pages/at_present/at_present.wxss | 44 ++++++++++++++++++++++++++++++++ project.config.json | 2 +- 7 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 pages/at_present/at_present.js create mode 100644 pages/at_present/at_present.json create mode 100644 pages/at_present/at_present.wxml create mode 100644 pages/at_present/at_present.wxss diff --git a/app.js b/app.js index 31fabe9..9bc65ac 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,8 @@ //app.js App({ gw: { -<<<<<<< HEAD - hostUrl: 'https://test.1hjz.cn', -======= // hostUrl: 'https://www.1hjz.cn', hostUrl: 'https://test.1hjz.cn/', ->>>>>>> 66bdd2a78217c5b94b59c7561723555bd2cd5ee7 mapUrl:'https://api.map.baidu.com', systemInfo : null,//系统信息 }, diff --git a/app.json b/app.json index f15cc3d..22cb676 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/at_present/at_present", "pages/index/index", "pages/mall/mall", "pages/jz/jz", @@ -21,6 +22,7 @@ "pages/two_code/two_code", "pages/out/out", "pages/agreement/agreement" + ], "window": { "backgroundTextStyle": "light", diff --git a/pages/at_present/at_present.js b/pages/at_present/at_present.js new file mode 100644 index 0000000..41662c3 --- /dev/null +++ b/pages/at_present/at_present.js @@ -0,0 +1,42 @@ +// pages/demo/demo.js +Page({ + /** + * 页面的初始数据 + */ + data: {}, + // 引入腾讯地图文件js + // var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'), + // var qqmapsdk + onLoad: function (options) { + this.getLocation(); + }, + getLocation() { + var that = this; + wx.getLocation({ + type: "wgs84", + success: function (res) { + var locationString = res.latitude + "," + res.longitude; + wx.request({ + url: "https://apis.map.qq.com/ws/geocoder/v1/", + data: { + key: "C5KBZ-RISKD-INW4P-PWYQJ-QC6C7-BQBGC", + location: locationString + }, + method: "GET", + success: function (res) { + console.log("用户位置信息", res.data, that); + var district = res.data.result.ad_info.district; + var city = res.data.result.ad_info.city + console.log(city); + console.log(district); + that.setData({ + city, + district + }); + } + }); + } + }); + } +}); + diff --git a/pages/at_present/at_present.json b/pages/at_present/at_present.json new file mode 100644 index 0000000..077404a --- /dev/null +++ b/pages/at_present/at_present.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/pages/at_present/at_present.wxml b/pages/at_present/at_present.wxml new file mode 100644 index 0000000..8b94e70 --- /dev/null +++ b/pages/at_present/at_present.wxml @@ -0,0 +1,15 @@ + + + 当前定位地址: + {{city}}{{district}} + 此区/县暂未开放,敬请期待 + 手动切换地址 + + + 确定 + 切换 + + + + + \ No newline at end of file diff --git a/pages/at_present/at_present.wxss b/pages/at_present/at_present.wxss new file mode 100644 index 0000000..c924c30 --- /dev/null +++ b/pages/at_present/at_present.wxss @@ -0,0 +1,44 @@ +page{ + background-color: #ccc; +} +.base{ + background-color: #fff; + width: 600rpx; + /* height: 400rpx; */ + text-align: center; + margin: 300rpx auto; + border-radius: 20rpx +} +.base_center{ +margin-top: 20rpx; +margin-bottom: 20rpx; +} +.base_top{ +padding-top: 30rpx; +padding-bottom: 30rpx; +} +.base_district{ + color: #1E90FF; +padding-bottom: 30rpx; +} +.base_hint{ + padding-bottom: 30rpx; + border-bottom: 1px solid #ccc; +} +.choice_switchover{ + color: #1E90FF; + padding-top: 30rpx; +padding-bottom: 30rpx; +} +.choice{ + width: 100%; +} +.confirm_left{ + width: 50%; + display: inline-block; +} +.confirm_right{ + width: 50%; + display: inline-block; + padding-bottom: 30rpx; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index a2b0222..e0dfff3 100644 --- a/project.config.json +++ b/project.config.json @@ -1,7 +1,7 @@ { "description": "项目配置文件。", "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "postcss": true, "minified": true,