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

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

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