最近在做培训机构打卡小程序App,机构地址小程序实现
register.js:
var that = this;
wx.chooseLocation({
success:res=> {
console.log(res);
that.data.lng = res.address + res.name + ',latitude=' + res.latitude
+ ",longitude=" + res.longitude;
that.data.regValueData.lng=res.latitude
that.data.regValueData.lat=res.longitude
that.data.regValueData.address=res.address + res.name;
this.setData({
regValueData: that.data.regValueData
});
},
})
Register.wxml
<view class="cu-form-group sm-border align-start padding-bottom-sm">
<view class="title">机构logo</view>
<view class="grid col-3 grid-square flex-sub media-upload">
<view wx:if="{{regValueData.logo.length==1}}" class="bg-img" bindtap="ViewImage" data-url="{{regValueData.logo[0]}}">
<image src='{{regValueData.logo[0]}}' mode='aspectFill'></image>
<view class="cu-tag bg-red" catchtap="DelImg" data-index="{{index}}">
<text class="cuIcon-close"></text>
</view>
</view>
<view wx:if="{{regValueData.logo.length<1}}" class="solids" bindtap="ChooseImage">
<text class="cuIcon-cameraadd"></text>
</view>
</view>
</view>