RegionPicker.js.map 15 KB

1
  1. {"version":3,"sources":["webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?3407","webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?b46f","webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?c7fa","webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?dec9","uni-app:///pages/RegionPicker.vue","webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?10cd","webpack:///D:/kongwenhao/HQT-PRO/hlm_pl_mall_h5/pages/RegionPicker.vue?3209"],"names":["name","props","modal","default","modalFade","lockScroll","closeOnClickModal","data","areaPicker","items","created","uni","icon","title","computed","buildItems","methods","showPopup","hidePopup","getDefaultItems","defaultItems","flex","values","textAlign","onValuesChange","i","show","cancel","confirm","area_id","area_name"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqI;AACrI;AACgE;AACL;AACsC;;;AAGjG;AAC0L;AAC1L,gBAAgB,uMAAU;AAC1B,EAAE,kFAAM;AACR,EAAE,mGAAM;AACR,EAAE,4GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,uGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,iQAEN;AACP,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAA4tB,CAAgB,wvBAAG,EAAC,C;;;;;;;;;;;;;;;;;;ACkBhvB;;;;;;;;;;;;;;;;;;eACA;EACAA;EACAC;IACAC;MACAC;IACA;IACAC;MACAD;IACA;IACAE;MACAF;IACA;IACAG;MACAH;IACA;EACA;EACAI;IACA;MACAC;MACAC;IACA;EACA;EACAC;IAAA;IACA;MACA;IACA;MACAC;QAAAC;QAAAC;MAAA;IACA;EACA;EACAC;IACAC;MACA;QACA;MACA;MACA;MAEA;MACA;IACA;EACA;EACAC;IACAC;MACA;IACA;IACAC;MACA;IACA;IACAC;MACA;QACA;QACA;UACAC;YACAC;YACAC;YACAC;UAEA;UACA;UACA;QACA;UACAH;YACAC;YACAC;YACAC;UAEA;UACA;UACA;QACA;MACA;IACA;IAEAC;MACA;MACA;MACA;QACAhB;QACAiB;QACA;UACA;YACA;YACAjB;UACA;YACA;YACAA;UACA;QACA;MACA;MACA;MACA;IACA;IACAkB;MACA;IACA;IACAC;MACA;IACA;IACAC;MACA;MACA;MACA;QACAN;QACA;UACAA;YACAO;YACAC;UACA;QACA;MACA;MACA;IACA;EACA;AACA;AAAA,2B;;;;;;;;;;;;;ACnIA;AAAA;AAAA;AAAA;AAA23C,CAAgB,u2CAAG,EAAC,C;;;;;;;;;;;ACA/4C;AACA,OAAO,KAAU,EAAE,kBAKd","file":"pages/RegionPicker.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./RegionPicker.vue?vue&type=template&id=03244cbb&scoped=true&\"\nvar renderjs\nimport script from \"./RegionPicker.vue?vue&type=script&lang=js&\"\nexport * from \"./RegionPicker.vue?vue&type=script&lang=js&\"\nimport style0 from \"./RegionPicker.vue?vue&type=style&index=0&id=03244cbb&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"03244cbb\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/RegionPicker.vue\"\nexport default component.exports","export * from \"-!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--17-0!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./RegionPicker.vue?vue&type=template&id=03244cbb&scoped=true&\"","var components\ntry {\n components = {\n uniPopup: function () {\n return import(\n /* webpackChunkName: \"uni_modules/uni-popup/components/uni-popup/uni-popup\" */ \"@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue\"\n )\n },\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./RegionPicker.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./RegionPicker.vue?vue&type=script&lang=js&\"","<template>\r\n\t<uni-popup background-color=\"#fff\" ref=\"currentValue\" type=\"bottom\">\r\n\t\t<view class=\"picker\">\r\n\t\t\t<view class=\"div toolbar\">\r\n\t\t\t\t<text class=\"button toolbar-item cancel-item\" @click=\"cancel\">取消</text>\r\n\t\t\t\t<view class=\"div picker-header\">请选择地区</view>\r\n\t\t\t\t<text class=\"button toolbar-item confirm-item\" @click=\"confirm\">确定</text>\r\n\t\t\t</view>\r\n <picker-view class=\"popup-content\" indicator-style=\"height:80rpx\" @change=\"onValuesChange\" :value=\"areaPicker\">\r\n <picker-view-column v-for=\"(item,index) in buildItems\" :key=\"index\">\r\n <view class=\"popup-item-wrapper\" v-for=\"(v,i) in item.values\" :key=\"i\"><text class=\"popup-item\">{{v.area_name}}</text></view>\r\n </picker-view-column>\r\n </picker-view>\r\n\t\t</view>\r\n\t</uni-popup>\r\n</template>\r\n\r\n<script>\r\nimport { getAreaTree } from '../api/area'\r\nexport default {\r\n name: 'RegionPicker',\r\n props: {\r\n modal: {\r\n default: true\r\n },\r\n modalFade: {\r\n default: false\r\n },\r\n lockScroll: {\r\n default: false\r\n },\r\n closeOnClickModal: {\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {\r\n areaPicker: [],\r\n items: false\r\n }\r\n },\r\n created: function () {\r\n getAreaTree().then(res => {\r\n this.items = res.result.area_list\r\n }).catch(function (error) {\r\n uni.showToast({icon:'none',title: error.message})\r\n })\r\n },\r\n computed: {\r\n buildItems: function () {\r\n if (!this.items) {\r\n return []\r\n }\r\n let items = new Array()\r\n\r\n this.getDefaultItems(this.items, items)\r\n return items\r\n }\r\n },\r\n methods:{\r\n showPopup(id){\r\n this.$refs[id].open()\r\n },\r\n hidePopup(id){\r\n this.$refs[id].close()\r\n },\r\n getDefaultItems(_item, defaultItems) {\r\n if (_item[0].child && _item[0].child.length > 0) {\r\n let index = 1\r\n if (defaultItems && defaultItems.length == 0) {\r\n defaultItems.push({\r\n flex: 1,\r\n values: _item,\r\n textAlign: 'center'\r\n\r\n })\r\n this.areaPicker.push(0)\r\n this.getDefaultItems(_item, defaultItems)\r\n } else if (defaultItems && defaultItems.length > 0) {\r\n defaultItems.push({\r\n flex: 1,\r\n values: _item[0].child,\r\n textAlign: 'center'\r\n\r\n })\r\n this.areaPicker.push(0)\r\n this.getDefaultItems(_item[0].child, defaultItems)\r\n }\r\n }\r\n },\r\n\r\n onValuesChange(e) {\r\n let value=e.detail.value\r\n let areaPicker=this.areaPicker\r\n for(var i in value){\r\n areaPicker[i]=value[i]\r\n i=parseInt(i)\r\n if(i<(value.length-1)){\r\n if(!this.buildItems[i]['values'].length || !this.buildItems[i]['values'][value[i]]['child'] || !this.buildItems[i]['values'][value[i]]['child'].length){\r\n this.buildItems[i+1]['values']=[]\r\n areaPicker[i+1]=0\r\n }else if(!this.buildItems[i+1]['values'].length || this.buildItems[i]['values'][value[i]]['child'][0]['area_id']!=this.buildItems[i+1]['values'][0]['area_id']){\r\n this.buildItems[i+1]['values']=this.buildItems[i]['values'][value[i]]['child']\r\n areaPicker[i+1]=0\r\n }\r\n }\r\n }\r\n this.areaPicker=areaPicker\r\n this.$forceUpdate()\r\n },\r\n show(){\r\n this.showPopup('currentValue')\r\n },\r\n cancel () {\r\n this.hidePopup('currentValue')\r\n },\r\n confirm() {\r\n this.cancel()\r\n let values = []\r\n for(var i in this.areaPicker){\r\n values[i]=this.buildItems[i]['values'][this.areaPicker[i]]\r\n if(!values[i]){\r\n values[i]={\r\n area_id:0,\r\n area_name:''\r\n }\r\n }\r\n }\r\n this.$emit('onConfirm', values)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.picker {\r\n\tbackground-color: #ffffff;\r\n}\r\n.toolbar {\r\n height: 2rem;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: space-between;\r\n align-items: center;\r\n background-color: #f0f2f5;\r\n .toolbar-item {\r\n font-size:$fontSize;\r\n border: none;\r\n border-radius: 0;\r\n background-color: #f0f2f5;\r\n }\r\n .cancel-item {\r\n margin-left: 0.5rem;\r\n color: #4e545d;\r\n }\r\n .confirm-item {\r\n margin-right: 0.5rem;\r\n color: red;\r\n }\r\n .picker-header {\r\n color: #4e545d;\r\n line-height: 2rem;\r\n font-size:$h2;\r\n }\r\n }\r\n.popup-item-wrapper{\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\t.popup-item {\r\n\t\tfont-size: 30rpx;\r\n line-height:80rpx;\r\n\t\ttext-align: center;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n\t}\r\n\r\n\t.popup-content {\r\n\t\tpadding: 0 40rpx;\r\n\t\theight: 300rpx;\r\n\t}\r\n</style>\r\n","import mod from \"-!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./RegionPicker.vue?vue&type=style&index=0&id=03244cbb&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./RegionPicker.vue?vue&type=style&index=0&id=03244cbb&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1683857282299\n var cssReload = require(\"D:/kongwenhao/HBuilderX.3.7.11.20230427/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}