地图选点

master
lion 9 months ago
parent 467f1b4b20
commit e227cf02ad

@ -20,7 +20,8 @@
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="地址" prop="address" required> <u-form-item label="地址" prop="address" required>
<u-input v-model="form.address" placeholder="请输入地址" /> <u-input v-model="form.address" placeholder="请输入地址" type="textarea" />
<view style="color:blue" @click="openMap"></view>
</u-form-item> </u-form-item>
<u-form-item label="备注" prop="remark"> <u-form-item label="备注" prop="remark">
<u-input v-model="form.remark" placeholder="请输入备注" /> <u-input v-model="form.remark" placeholder="请输入备注" />
@ -114,6 +115,30 @@
this.$refs.uForm1.setRules(this.rules); this.$refs.uForm1.setRules(this.rules);
}, },
methods: { methods: {
//
openMap(){
console.log("chooseLocation")
let that = this
uni.chooseLocation({
success(res){
console.log("chooseLocationres",res)
if (res.errMsg === 'chooseLocation:ok') {
that.form.address = res.address
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
},
fail(err){
uni.showToast({
title:'打开地图失败',
icon:'none'
})
console.log("err",err)
}
});
},
save() { save() {
this.$refs.uForm1.validate(valid => { this.$refs.uForm1.validate(valid => {

@ -62,10 +62,13 @@
"desc" : "需要获取您的定位" "desc" : "需要获取您的定位"
}, },
"scope.chooseAddress" : { "scope.chooseAddress" : {
"desc" : "需要获取您的收获地址" "desc" : "需要获取您的收货地址"
},
"scope.chooseLocation" : {
"desc" : "需要获取您的详细地址"
} }
}, },
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ], "requiredPrivateInfos" : [ "getLocation", "chooseAddress","chooseLocation" ],
"optimization" : { "optimization" : {
"subPackages" : true "subPackages" : true
}, },

@ -203,7 +203,9 @@
v-model="form.city" v-model="form.city"
:disabled="!!orderId" :disabled="!!orderId"
placeholder="请填写详细地址" placeholder="请填写详细地址"
type="textarea"
/> />
<view style="text-align: right;color:blue" @click="openMap"></view>
</u-form-item> </u-form-item>
<u-form-item label="预约人" prop="appoint_name" required> <u-form-item label="预约人" prop="appoint_name" required>
<u-input <u-input
@ -988,8 +990,30 @@ export default {
this.getUserArchive(); this.getUserArchive();
} }
}, },
//
openMap(){
console.log("chooseLocation")
let that = this
uni.chooseLocation({
success(res){
console.log("chooseLocationres",res)
if (res.errMsg === 'chooseLocation:ok') {
that.form.city = res.address
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
},
fail(err){
uni.showToast({
title:'打开地图失败',
icon:'none'
})
console.log("err",err)
}
});
},
pay() { pay() {
if (!this.orderId) { if (!this.orderId) {
if(!this.form.site_id){ if(!this.form.site_id){

@ -70,7 +70,10 @@
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="详细地址" prop="city" v-if="form.type == 2"> <u-form-item label="详细地址" prop="city" v-if="form.type == 2">
<u-input v-model="form.city" placeholder="请填写详细地址" /> <u-input v-model="form.city" placeholder="请填写详细地址"
type="textarea"
/>
<view style="text-align: right;color:blue" @click="openMap"></view>
</u-form-item> </u-form-item>
<u-form-item label="预约人" prop="appoint_name" required> <u-form-item label="预约人" prop="appoint_name" required>
<u-input v-model="form.appoint_name" placeholder="请填写预约人" /> <u-input v-model="form.appoint_name" placeholder="请填写预约人" />
@ -529,7 +532,30 @@
} }
}, },
//
openMap(){
console.log("chooseLocation")
let that = this
uni.chooseLocation({
success(res){
console.log("chooseLocationres",res)
if (res.errMsg === 'chooseLocation:ok') {
that.form.city = res.address
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
},
fail(err){
uni.showToast({
title:'打开地图失败',
icon:'none'
})
console.log("err",err)
}
});
},
pay() { pay() {
this.$refs.uForm.validate(async (valid) => { this.$refs.uForm.validate(async (valid) => {
if (valid) { if (valid) {

@ -33,7 +33,7 @@
site_id: i.hospital?i.hospital.site_id:'' site_id: i.hospital?i.hospital.site_id:''
} }
})"> })">
<view class="info__item"> <view class="info__item flex100">
<text>{{i.type == 1 ? '被服务人' : '被服务人'}}</text> <text>{{i.type == 1 ? '被服务人' : '被服务人'}}</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text> <text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view> </view>
@ -41,7 +41,7 @@
<text>{{(i.type == 1 ? '就诊' : '服务') + '时间'}}</text> <text>{{(i.type == 1 ? '就诊' : '服务') + '时间'}}</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text> <text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view> </view>
<view class="info__item" v-if="i.type==2"> <view class="info__item flex100" v-if="i.type==2">
<text>详细地址</text> <text>详细地址</text>
<text>{{ i.city || " " }}</text> <text>{{ i.city || " " }}</text>
</view> </view>

@ -43,7 +43,7 @@
site_id: i.hospital?i.hospital.site_id:'' site_id: i.hospital?i.hospital.site_id:''
} }
})"> })">
<view class="info__item"> <view class="info__item flex100">
<text>{{i.type == 1 ? '被服务人' : '被服务人'}}</text> <text>{{i.type == 1 ? '被服务人' : '被服务人'}}</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text> <text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view> </view>
@ -51,7 +51,7 @@
<text>{{(i.type == 1 ? '就诊' : '服务') + '时间'}}</text> <text>{{(i.type == 1 ? '就诊' : '服务') + '时间'}}</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text> <text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view> </view>
<view class="info__item" v-if="i.type==2"> <view class="info__item flex100" v-if="i.type==2">
<text>详细地址</text> <text>详细地址</text>
<text>{{ i.city || " " }}</text> <text>{{ i.city || " " }}</text>
</view> </view>

Loading…
Cancel
Save