1 |
- {"version":3,"sources":["webpack:///./src/views/shop/StoreList.vue?e6ce","webpack:///src/views/shop/StoreList.vue","webpack:///./src/views/shop/StoreList.vue?6a14","webpack:///./src/views/shop/StoreList.vue","webpack:///./src/views/shop/StoreList.vue?5522"],"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","staticStyle","mapKey","_e","system_store","latitude","longitude","staticRenderFns","components","computed","data","page","limit","storeList","mapShow","cookie","locationShow","mounted","getList","selfLocation","$scroll","$refs","container","methods","window","addEventListener","e","parseFloat","goName","$router","go","$store","commit","component"],"mappings":"gJAAA,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,MAAM,CAACA,EAAG,IAAI,CAACG,YAA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AU,EACf,IAAN,GACQK,SAAUU,EAAlB,gBACQT,UAAWS,EAAnB,gBACQJ,KAAMrC,KAAKqC,KACXC,MAAOtC,KAAKsC,OAEd,OAAN,OAAM,CAAN,GACA,kBACQ,EAAR,WACQ,EAAR,kCACQ,EAAR,8CACQ,EAAR,iBAEA,mBACQ,EAAR,4BCnOsc,I,wBCQlcqB,EAAY,eACd,EACA7D,EACAmC,GACA,EACA,KACA,WACA,MAIa,aAAA0B,E,2CCnBf,yBAAwnB,EAAG","file":"h5/js/chunk-574614c8.752c22b3.js","sourcesContent":["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)?_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\"\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 } 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 let _this = this;\r\n wechatEvevt(\"getLocation\", { type: \"wgs84\" })\r\n .then(res => {\r\n let latitude = res.latitude; // 纬度\r\n let longitude = res.longitude; // 经度\r\n cookie.set(LATITUDE, latitude);\r\n cookie.set(LONGITUDE, longitude);\r\n _this.getList();\r\n })\r\n .catch(res => {\r\n if (res.is_ready) {\r\n res.wx.getLocation({\r\n success(res) {\r\n let latitude = res.latitude; // 纬度\r\n let longitude = res.longitude; // 经度\r\n cookie.set(LATITUDE, latitude);\r\n cookie.set(LONGITUDE, longitude);\r\n _this.getList();\r\n },\r\n cancel() {\r\n _this.$dialog.error(\"取消获取位置\");\r\n cookie.remove(LATITUDE);\r\n cookie.remove(LONGITUDE);\r\n _this.getList();\r\n },\r\n fail() {\r\n _this.$dialog.error(\"授权失败\");\r\n cookie.remove(LATITUDE);\r\n cookie.remove(LONGITUDE);\r\n _this.getList();\r\n }\r\n });\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 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.$router.go(-1); //返回上一层\r\n this.$store.commit(\"GET_STORE\", e);\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=1e5ef9ec&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=1e5ef9ec&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 \"1e5ef9ec\",\n null\n \n)\n\nexport default component.exports","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=1e5ef9ec&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=1e5ef9ec&scoped=true&lang=css&\""],"sourceRoot":""}
|