Commit 95c60b5e authored by 高铭波's avatar 高铭波

地址页面修改,地图定位key修改

parent 10811067
(function () { (function () {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null; let ENV_VAR = null;
let VERSION_NUMBER = '1.3.6';//版本号 let VERSION_NUMBER = '1.3.6';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js'); ENV_VAR = require('./.env.dev.js');
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
} else if (NODE_ENV === 'prod') { } else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js'); ENV_VAR = require('./.env.prod.js');
} }
ENV_VAR['bmapAK'] = 'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A';
} else if (process.env.NODE_ENV === "production") { } else if (process.env.NODE_ENV === "production") {
if (NODE_ENV === 'test') { if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js'); ENV_VAR = require('./.env.test.js');
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
process.uniEnv = {}; process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV; process.uniEnv['node_env'] = NODE_ENV;
process.uniEnv['version_number'] = VERSION_NUMBER; process.uniEnv['version_number'] = VERSION_NUMBER;
process.uniEnv['bmapAK'] = 'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI';
for (let key in ENV_VAR) { for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]; process.uniEnv[key] = ENV_VAR[key];
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"sdkConfigs" : {} "sdkConfigs" : {}
}, },
"uniStatistics" : { "uniStatistics" : {
"enable" : true "enable" : false
} }
}, },
/* SDK配置 */ /* SDK配置 */
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
} }
}, },
"uniStatistics" : { "uniStatistics" : {
"enable" : true "enable" : false
} }
}, },
"mp-alipay" : { "mp-alipay" : {
......
...@@ -3,27 +3,31 @@ ...@@ -3,27 +3,31 @@
<w-navbar :title="title"></w-navbar> <w-navbar :title="title"></w-navbar>
<view class="top"> <view class="top">
<view class="item"> <view class="item">
<view class="left">姓名</view> <view class="left">收货人</view>
<input disabled v-model="name" type="text" placeholder-class="line" placeholder="请填写姓名" /> <input disabled v-model="name" type="text" placeholder-class="line" placeholder="请填写收货人姓名" />
</view> </view>
<view class="item"> <view class="item">
<view class="left">电话</view> <view class="left">手机号码</view>
<input disabled v-model="mobile" type="text" placeholder-class="line" placeholder="请填写电话" /> <input disabled v-model="mobile" type="text" placeholder-class="line" placeholder="请填写收货人手机号" />
</view> </view>
<view class="item address">
<view class="left label">地址</view> <view class="item">
<textarea v-model="address" type="text" placeholder-class="line" placeholder="请填写地址" /> <view class="left">所在地区</view>
<view class="right" @tap="autoLocation"> <input @tap="showRegionPicker" disabled v-model="region" type="text" placeholder-class="line" placeholder="省市区县、乡镇等" />
<u-icon <u-icon @click="autoLocation" class="right" name="map" label="定位" label-size="24" label-color="#2272FF" />
name="map"
color="#2272FF"
size="30"
label="自动定位"
label-size="24"
label-color="#2272FF"
></u-icon>
</view>
</view> </view>
<u-field
class="item-address"
v-model="address"
label="详细地址"
label-width="160"
placeholder="街道、楼牌等"
placeholder-style="color:#c0c4cc;"
type="textarea"
:auto-height="false"
:border-bottom="false"
>
</u-field>
</view> </view>
<view class="bottom"> <view class="bottom">
<button class="btn, bottom-btn" @click="show = true"> <button class="btn, bottom-btn" @click="show = true">
...@@ -37,6 +41,7 @@ ...@@ -37,6 +41,7 @@
<view class="right"><switch color="red" @change="setDefault" /></view> <view class="right"><switch color="red" @change="setDefault" /></view>
</view> --> </view> -->
</view> </view>
<u-picker mode="region" ref="uPicker" v-model="showPicker" :params="params" @confirm="confirmRegion" />
<u-popup <u-popup
border-radius="12" border-radius="12"
width="690" width="690"
...@@ -65,7 +70,7 @@ ...@@ -65,7 +70,7 @@
<script> <script>
let r = require("libs/bmap-wx.min.js"); let r = require("libs/bmap-wx.min.js");
let h = new r.BMapWX({ let h = new r.BMapWX({
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI" ak: process.uniEnv.bmapAK
}); });
export default { export default {
data() { data() {
...@@ -78,6 +83,14 @@ export default { ...@@ -78,6 +83,14 @@ export default {
name: '--', name: '--',
mobile: '', mobile: '',
settled: null, settled: null,
region: [],
regionObj: [],
showPicker: false,
params: {
province: true,
city: true,
area: true
},
}; };
}, },
computed: {}, computed: {},
...@@ -103,19 +116,13 @@ export default { ...@@ -103,19 +116,13 @@ export default {
callback(this, this.vuex_settled) callback(this, this.vuex_settled)
} }
getApp().getBaseInfo(this, callback); getApp().getBaseInfo(this, callback);
this.initLocation()
}, },
/** showRegionPicker() {
* 初始化位置 this.showPicker = true
*/ },
initLocation() { confirmRegion(params) {
const self = this this.regionObj = params
uni.getLocation({ this.region = params.province.label+params.city.label+params.area.label
type: 'wgs84',
success: function(res) {
self.baiduLocation(res.longitude, res.latitude)
}
});
}, },
/** /**
* 百度定位 * 百度定位
...@@ -123,25 +130,28 @@ export default { ...@@ -123,25 +130,28 @@ export default {
* @param {Object} lat * @param {Object} lat
*/ */
baiduLocation(long, lat) { baiduLocation(long, lat) {
let self = this, console.log("11111111111", this.title)
t = function() { let t = {
let t = { success: (res) => {
success: function(res) { console.log('success:', res)
let e = res.wxMarkerData[0]; let e = res.wxMarkerData[0];
let i = e.address; let i = e.address;
self.location = i this.location = i;
}, },
fail: function(error) { fail: (res) => {
// n.error(a), console.log(a); console.log('fail:', res)
} }
}; }
if (lat && long) { if (lat && long) {
let e = lat + "," + long let e = lat + "," + long
t.location = e; t.location = e
} // t.coordtype = 'wgs84'
h.regeocoding(t); // t.latitude = lat
}; // t.longitude = long
t() console.log('regeocoding:', t)
h.regeocoding(t);
}
}, },
/** /**
...@@ -150,8 +160,8 @@ export default { ...@@ -150,8 +160,8 @@ export default {
autoLocation() { autoLocation() {
let that = this let that = this
uni.chooseLocation({ uni.chooseLocation({
success: function(res) { success: (res) => {
that.address = res.address + res.name this.baiduLocation(res.longitude, res.latitude)
}, },
fail: function(res) { fail: function(res) {
// uni.showToast({ // uni.showToast({
...@@ -199,33 +209,57 @@ export default { ...@@ -199,33 +209,57 @@ export default {
color: #333333; color: #333333;
line-height: 88rpx; line-height: 88rpx;
align-items: center; align-items: center;
border-bottom: solid 2rpx $u-border-color; border-bottom: solid 2rpx #F4F5F7;
.left { .left {
width: 88rpx; width: 160rpx;
color: #999999; color: #999999;
} }
input { input {
text-align: left; text-align: left;
flex: auto;
} }
}
.textarea {
.address {
padding: 24rpx 0;
align-items: flex-start;
textarea {
height: 240rpx;
background-color: #f7f7f7;
line-height: 60rpx;
padding: 20rpx;
width: 400rpx;
} }
.right { .right {
text-align: right; margin-left: 30rpx;
width: 160rpx; font-size: 30rpx;
font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #2272FF; color: #2272FF;
line-height: 88rpx; }
}
.item-address {
height: 168rpx;
width: auto;
flex: auto;
/deep/ .u-field {
padding: 0;
padding-top: 30rpx;
border-bottom: solid 2rpx #F4F5F7;
.u-label {
color: #999999;
line-height: normal;
}
.fild-body {
font-size: 28rpx;
font-weight: 400;
color: #333333;
textarea {
line-height: normal;
height: 98rpx;
}
}
.fild-body > view {
margin: 4rpx 8rpx 0 0 !important;
}
.right {
margin-left: 30rpx;
font-size: 30rpx;
font-weight: 400;
color: #2272FF;
align-self: top;
}
} }
} }
} }
......
...@@ -42,8 +42,7 @@ ...@@ -42,8 +42,7 @@
<script> <script>
let r = require("../../libs/bmap-wx.min.js"); let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({ let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG", ak: process.uniEnv.bmapAK
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
}); });
import standard from '@/components/photo/standard.vue' import standard from '@/components/photo/standard.vue'
export default { export default {
......
...@@ -81,8 +81,7 @@ ...@@ -81,8 +81,7 @@
let r = require("../../libs/bmap-wx.min.js"); let r = require("../../libs/bmap-wx.min.js");
let h = new r.BMapWX({ let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG", ak: process.uniEnv.bmapAK
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
}); });
export default { export default {
components: { components: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment