小程序查看导航

查看导航

<block wx:if="{{index_data.shop_list != false}}">
<view class="store_information">
    <block wx:for="{{index_data.shop_list}}">
        <view class="store_detail">
            <text class="store_name">{{item.name}}</text>
            <image class="tel_img" src="/images/common/dianhua.png" />
            <text class="store_tel">{{item.tel}}</text>
            <image class="place_img" src="/images/common/dizhi-1.png" />
            <text class="store_place">{{item.distance}}km  |  {{item.address}}</text>
            <view class="navigation_img"  data-lng="{{item.longitude}}" data-lat="{{item.latitude}}" bindtap="go_to_map">
                <image src="/images/menu/daohang.png" />
            </view>
        </view>
    </block>
</view>
</block>
/**
 * 导航
 */
go_to_map: function(e) {
    let lng = parseFloat(e.currentTarget.dataset.lng);
    let lat = parseFloat(e.currentTarget.dataset.lat);
    wx.openLocation({
        latitude:lat,
        longitude:lng,
        scale: 18
    })
}
posted @ 2019-08-24 15:02  TBHacker  阅读(247)  评论(0编辑  收藏  举报