1 |
- {"version":3,"sources":["webpack:///./src/views/shop/StoreList.vue?866a","webpack:///./src/views/shop/StoreList.vue?01a3","webpack:///src/views/shop/StoreList.vue","webpack:///./src/views/shop/StoreList.vue?6a14","webpack:///./src/views/shop/StoreList.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","ref","staticClass","_l","item","index","key","on","$event","stopPropagation","checked","attrs","image","_v","_s","name","address","detailed_address","phone","showMaoLocation","range","loaded","loading","locationShow","isWeixin","staticStyle","mapKey","_e","system_store","latitude","longitude","staticRenderFns","components","computed","data","page","limit","storeList","mapShow","cookie","mounted","getList","selfLocation","$scroll","$refs","container","methods","window","addEventListener","e","parseFloat","goName","$store","commit","$router","go","component"],"mappings":"kHAAA,yBAAwnB,EAAG,G,kECA3nB,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,IAAI,YAAYC,YAAY,YAAY,CAACP,EAAIQ,GAAIR,EAAa,WAAE,SAASS,EAAKC,GAAO,OAAON,EAAG,MAAM,CAACO,IAAID,EAAMH,YAAY,eAAeK,GAAG,CAAC,MAAQ,SAASC,GAAiC,OAAzBA,EAAOC,kBAAyBd,EAAIe,QAAQN,MAAS,CAACL,EAAG,MAAM,CAACG,YAAY,aAAa,CAACH,EAAG,MAAM,CAACY,MAAM,CAAC,IAAMP,EAAKQ,MAAM,YAAY,YAAYb,EAAG,MAAM,CAACG,YAAY,mBAAmB,CAACH,EAAG,MAAM,CAACG,YAAY,cAAc,CAACP,EAAIkB,GAAGlB,EAAImB,GAAGV,EAAKW,SAAShB,EAAG,MAAM,CAACG,YAAY,uBAAuB,CAACP,EAAIkB,GAAG,eAAelB,EAAImB,GAAGV,EAAKY,SAASrB,EAAImB,GAAG,KAAOV,EAAKa,kBAAkB,kBAAkBlB,EAAG,MAAM,CAACG,YAAY,aAAa,CAACH,EAAG,M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EA,mBACQ,EAAR,4BC1Msc,I,wBCQlcoB,EAAY,eACd,EACA9D,EACAqC,GACA,EACA,KACA,WACA,MAIa,aAAAyB,E","file":"h5/js/chunk-38b7b883.81538932.js","sourcesContent":["import mod from \"-!../../../node_modules/_mini-css-extract-plugin@0.8.2@mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/_css-loader@1.0.1@css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./StoreList.vue?vue&type=style&index=0&id=3e2c9467&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/_mini-css-extract-plugin@0.8.2@mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/_css-loader@1.0.1@css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./StoreList.vue?vue&type=style&index=0&id=3e2c9467&scoped=true&lang=css&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{ref:\"container\",staticClass:\"storeBox\"},[_vm._l((_vm.storeList),function(item,index){return _c('div',{key:index,staticClass:\"storeBox-box\",on:{\"click\":function($event){$event.stopPropagation();return _vm.checked(item)}}},[_c('div',{staticClass:\"store-img\"},[_c('img',{attrs:{\"src\":item.image,\"lazy-load\":\"true\"}})]),_c('div',{staticClass:\"store-cent-left\"},[_c('div',{staticClass:\"store-name\"},[_vm._v(_vm._s(item.name))]),_c('div',{staticClass:\"store-address line1\"},[_vm._v(\"\\n \"+_vm._s(item.address)+_vm._s(\", \" + item.detailed_address)+\"\\n \")])]),_c('div',{staticClass:\"row-right\"},[_c('div',[_c('a',{staticClass:\"store-phone\",attrs:{\"href\":'tel:' + item.phone}},[_c('span',{staticClass:\"iconfont icon-dadianhua01\"})])]),_c('div',{staticClass:\"store-distance\",on:{\"click\":function($event){$event.stopPropagation();return _vm.showMaoLocation(item)}}},[(item.range)?_c('span',{staticClass:\"addressTxt\"},[_vm._v(\"距离\"+_vm._s(item.range)+\"千米\")]):_c('span',{staticClass:\"addressTxt\"},[_vm._v(\"查看地图\")]),_c('span',{staticClass:\"iconfont icon-youjian\"})])])])}),_c('Loading',{attrs:{\"loaded\":_vm.loaded,\"loading\":_vm.loading}})],2),_c('div',[(_vm.locationShow && !_vm.isWeixin)?_c('iframe',{ref:\"geoPage\",staticStyle:{\"display\":\"none\"},attrs:{\"width\":\"0\",\"height\":\"0\",\"frameborder\":\"0\",\"scrolling\":\"no\",\"src\":'https://apis.map.qq.com/tools/geolocation?key=' +\n _vm.mapKey +\n '&referer=myapp'}}):_vm._e()]),(_vm.mapShow)?_c('div',{staticClass:\"geoPage\"},[_c('iframe',{attrs:{\"width\":\"100%\",\"height\":\"100%\",\"frameborder\":\"0\",\"scrolling\":\"no\",\"src\":'https://apis.map.qq.com/uri/v1/geocoder?coord=' +\n _vm.system_store.latitude +\n ',' +\n _vm.system_store.longitude +\n '&referer=' +\n _vm.mapKey}})]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div>\r\n <div class=\"storeBox\" ref=\"container\">\r\n <div\r\n class=\"storeBox-box\"\r\n v-for=\"(item, index) in storeList\"\r\n :key=\"index\"\r\n @click.stop=\"checked(item)\"\r\n >\r\n <div class=\"store-img\"><img :src=\"item.image\" lazy-load=\"true\" /></div>\r\n <div class=\"store-cent-left\">\r\n <div class=\"store-name\">{{ item.name }}</div>\r\n <div class=\"store-address line1\">\r\n {{ item.address }}{{ \", \" + item.detailed_address }}\r\n </div>\r\n </div>\r\n <div class=\"row-right\">\r\n <div>\r\n <a class=\"store-phone\" :href=\"'tel:' + item.phone\"\r\n ><span class=\"iconfont icon-dadianhua01\"></span\r\n ></a>\r\n </div>\r\n <div class=\"store-distance\" @click.stop=\"showMaoLocation(item)\">\r\n <span class=\"addressTxt\" v-if=\"item.range\"\r\n >距离{{ item.range }}千米</span\r\n >\r\n <span class=\"addressTxt\" v-else>查看地图</span>\r\n <span class=\"iconfont icon-youjian\"></span>\r\n </div>\r\n </div>\r\n </div>\r\n <Loading :loaded=\"loaded\" :loading=\"loading\"></Loading>\r\n </div>\r\n <div>\r\n <iframe\r\n v-if=\"locationShow && !isWeixin\"\r\n ref=\"geoPage\"\r\n width=\"0\"\r\n height=\"0\"\r\n frameborder=\"0\"\r\n style=\"display:none;\"\r\n scrolling=\"no\"\r\n :src=\"\r\n 'https://apis.map.qq.com/tools/geolocation?key=' +\r\n mapKey +\r\n '&referer=myapp'\r\n \"\r\n >\r\n </iframe>\r\n </div>\r\n <div class=\"geoPage\" v-if=\"mapShow\">\r\n <iframe\r\n width=\"100%\"\r\n height=\"100%\"\r\n frameborder=\"0\"\r\n scrolling=\"no\"\r\n :src=\"\r\n 'https://apis.map.qq.com/uri/v1/geocoder?coord=' +\r\n system_store.latitude +\r\n ',' +\r\n system_store.longitude +\r\n '&referer=' +\r\n mapKey\r\n \"\r\n >\r\n </iframe>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Loading from \"@components/Loading\";\r\nimport { storeListApi } from \"@api/store\";\r\nimport { isWeixin } from \"@utils/index\";\r\nimport { wechatEvevt, wxShowLocation } from \"@libs/wechat\";\r\nimport { mapGetters } from \"vuex\";\r\nimport cookie from \"@utils/store/cookie\";\r\nconst LONGITUDE = \"user_longitude\";\r\nconst LATITUDE = \"user_latitude\";\r\nconst MAPKEY = \"mapKey\";\r\nexport default {\r\n name: \"storeList\",\r\n components: { Loading },\r\n computed: mapGetters([\"goName\"]),\r\n data() {\r\n return {\r\n page: 1,\r\n limit: 20,\r\n loaded: false,\r\n loading: false,\r\n storeList: [],\r\n mapShow: false,\r\n system_store: {},\r\n mapKey: cookie.get(MAPKEY),\r\n locationShow: false\r\n };\r\n },\r\n mounted() {\r\n if (cookie.get(LONGITUDE) && cookie.get(LATITUDE)) {\r\n this.getList();\r\n } else {\r\n this.selfLocation();\r\n }\r\n this.$scroll(this.$refs.container, () => {\r\n !this.loading && this.getList();\r\n });\r\n },\r\n methods: {\r\n selfLocation() {\r\n if (isWeixin()) {\r\n wxShowLocation()\r\n .then(res => {\r\n console.log(res);\r\n this.getList();\r\n })\r\n .catch(err => {\r\n this.$dialog.error(err.msg);\r\n this.getList();\r\n });\r\n } else {\r\n if (!cookie.get(MAPKEY))\r\n return this.$dialog.error(\r\n \"暂无法使用查看地图,请配置您的腾讯地图key\"\r\n );\r\n let loc;\r\n let _this = this;\r\n if (cookie.get(MAPKEY)) _this.locationShow = true;\r\n //监听定位组件的message事件\r\n window.addEventListener(\r\n \"message\",\r\n function(event) {\r\n loc = event.data; // 接收位置信息 LONGITUDE\r\n console.log(\"location\", loc);\r\n if (loc && loc.module == \"geolocation\") {\r\n cookie.set(LATITUDE, loc.lat);\r\n cookie.set(LONGITUDE, loc.lng);\r\n _this.getList();\r\n } else {\r\n cookie.remove(LATITUDE);\r\n cookie.remove(LONGITUDE);\r\n _this.getList();\r\n //定位组件在定位失败后,也会触发message, event.data为null\r\n console.log(\"定位失败\");\r\n }\r\n },\r\n false\r\n );\r\n // this.$refs.geoPage.contentWindow.postMessage(\"getLocation\", \"*\");\r\n }\r\n },\r\n showMaoLocation(e) {\r\n this.system_store = e;\r\n if (isWeixin()) {\r\n let config = {\r\n latitude: parseFloat(this.system_store.latitude),\r\n longitude: parseFloat(this.system_store.longitude),\r\n name: this.system_store.name,\r\n address:\r\n this.system_store.address + this.system_store.detailed_address\r\n };\r\n wechatEvevt(\"openLocation\", config)\r\n .then(res => {\r\n console.log(res);\r\n })\r\n .catch(res => {\r\n if (res.is_ready) {\r\n res.wx.openLocation(config);\r\n }\r\n });\r\n } else {\r\n if (!cookie.get(MAPKEY))\r\n return this.$dialog.error(\r\n \"暂无法使用查看地图,请配置您的腾讯地图key\"\r\n );\r\n this.mapShow = true;\r\n }\r\n },\r\n // 选中门店\r\n checked(e) {\r\n if (this.goName === \"orders\") {\r\n this.$store.commit(\"GET_STORE\", e);\r\n this.$router.go(-1); //返回上一层\r\n }\r\n },\r\n // 获取门店列表数据\r\n getList: function() {\r\n if (this.loading || this.loaded) return;\r\n this.loading = true;\r\n let data = {\r\n latitude: cookie.get(LATITUDE) || \"\", //纬度\r\n longitude: cookie.get(LONGITUDE) || \"\", //经度\r\n page: this.page,\r\n limit: this.limit\r\n };\r\n storeListApi(data)\r\n .then(res => {\r\n this.loading = false;\r\n this.loaded = res.data.list.length < this.limit;\r\n this.storeList.push.apply(this.storeList, res.data.list);\r\n this.page = this.page + 1;\r\n })\r\n .catch(err => {\r\n this.$dialog.error(err.msg);\r\n });\r\n }\r\n }\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.geoPage {\r\n position: fixed;\r\n width: 100%;\r\n height: 100%;\r\n top: 0;\r\n z-index: 10000;\r\n}\r\n.storeBox {\r\n width: 100%;\r\n background-color: #fff;\r\n padding: 0 0.3rem;\r\n}\r\n.storeBox-box {\r\n width: 100%;\r\n height: auto;\r\n display: flex;\r\n align-items: center;\r\n padding: 0.23rem 0;\r\n justify-content: space-between;\r\n border-bottom: 1px solid #eee;\r\n}\r\n.store-cent {\r\n display: flex;\r\n align-items: center;\r\n width: 80%;\r\n}\r\n.store-cent-left {\r\n width: 45%;\r\n}\r\n.store-img {\r\n width: 1.2rem;\r\n height: 1.2rem;\r\n border-radius: 0.06rem;\r\n margin-right: 0.22rem;\r\n}\r\n.store-img img {\r\n width: 100%;\r\n height: 100%;\r\n}\r\n.store-name {\r\n color: #282828;\r\n font-size: 0.3rem;\r\n margin-bottom: 0.22rem;\r\n font-weight: 800;\r\n}\r\n.store-address {\r\n color: #666666;\r\n font-size: 0.24rem;\r\n}\r\n.store-phone {\r\n width: 0.5rem;\r\n height: 0.5rem;\r\n color: #fff;\r\n border-radius: 50%;\r\n display: block;\r\n text-align: center;\r\n line-height: 0.5rem;\r\n background-color: #e83323;\r\n margin-bottom: 0.22rem;\r\n}\r\n.store-distance {\r\n font-size: 0.22rem;\r\n color: #e83323;\r\n}\r\n.iconfont {\r\n font-size: 0.2rem;\r\n}\r\n.row-right {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-end;\r\n width: 33.5%;\r\n}\r\n</style>\r\n","import mod from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./StoreList.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/index.js??vue-loader-options!./StoreList.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./StoreList.vue?vue&type=template&id=3e2c9467&scoped=true&\"\nimport script from \"./StoreList.vue?vue&type=script&lang=js&\"\nexport * from \"./StoreList.vue?vue&type=script&lang=js&\"\nimport style0 from \"./StoreList.vue?vue&type=style&index=0&id=3e2c9467&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/_vue-loader@15.9.0@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3e2c9467\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}
|