| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <!--product/map/map.wxml-->
- <map id="myMap" class="map" :latitude="merchant.lat" :longitude="merchant.lng" :markers="markers" show-location></map>
- </template>
- <script>
- // product/map/map.js
- const req = require("../../utils/request.js");
- var QQMapWX = require("../../utils/qqmap.js");
- export default {
- data() {
- return {
- merchant: {},
- markers: []
- };
- },
- components: {},
- props: {},
- onLoad: function (options) {},
- onShow() {
- let merchant = req.getStorage("MERCHANT");
- // console.log(merchant);
- this.setData({
- merchant: merchant
- });
- this.setData({
- 'markers[0].latitude': merchant.lat,
- 'markers[0].longitude': merchant.lng,
- 'markers[0].iconPath': "/static/pages/images/location.png"
- });
- },
- methods: {}
- };
- </script>
- <style>
- @import "./map.css";
- </style>
|