dengrui/unpackage/dist/dev/.sourcemap/mp-weixin/pagesB/newAddress/newAddress.js.map

1 line
18 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"sources":["uni-app:///main.js","webpack:///D:/chenq/chen/uniapp(兼小程序)/dengrui/pagesB/newAddress/newAddress.vue?f7fd","webpack:///D:/chenq/chen/uniapp(兼小程序)/dengrui/pagesB/newAddress/newAddress.vue?82f6","webpack:///D:/chenq/chen/uniapp(兼小程序)/dengrui/pagesB/newAddress/newAddress.vue?8b92","webpack:///D:/chenq/chen/uniapp(兼小程序)/dengrui/pagesB/newAddress/newAddress.vue?f2cf","uni-app:///pagesB/newAddress/newAddress.vue"],"names":["createPage","Page"],"mappings":";;;;;;;;;;kDAAA;AACA;AACA,6G;AACAA,UAAU,CAACC,mBAAD,CAAV,C;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAmI;AACnI;AAC8D;AACL;;;AAGzD;AACmL;AACnL,gBAAgB,uLAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,iGAAM;AACR,EAAE,0GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,qGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,sNAEN;AACP;AACA;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;;;;;;;;;;;;;;AC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KA,wBALA;AAMA,gCANA;;AAQA;AACA,KA3CA;AA4CA,eA5CA,yBA4CA;AACA;AACA;AACA,OAFA,MAEA;AACA;AACA,OAFA,MAEA;AACA;AACA,OAFA,MAEA;AACA;AACA,OAFA,MAEA;AACA;AACA,OAFA,MAEA;AACA;AACA,sBADA;AAEA,6BAFA;AAGA,4BAHA;AAIA,gCAJA;AAKA,6BALA;AAMA,iCANA;AAOA;AACA;AACA;AACA,aAFA,MAEA;AACA;AACA;AACA,WAbA;;AAeA,OAhBA,MAgBA;AACA;AACA,sBADA;AAEA,kCAFA;AAGA,0BAHA;AAIA,gCAJA;AAKA,2BALA;AAMA,iCANA;AAOA;AACA;AACA;AACA;AACA,WAXA;;AAaA;AACA,KAtFA;AAuFA,UAvFA,oBAuFA;AACA;AACA;AACA;AACA;AACA,uBADA;AAEA,qBAFA,EAEA;AACA,uBAHA,EAGA;AACA,2CAJA,EAIA;AACA,mCALA,EAKA;AACA,qCANA,EAMA;AACA,2CAPA,EAOA;AACA,mCARA,EAQA;AACA,qCATA,EASA;AACA,2BAVA,EAUA;AACA,uBAXA,EAWA;AACA,oBAZA,EAYA;AACA,eAbA,CAaA;AAbA;AAeA;AACA;AACA;AACA;AACA;AACA,WAFA,EAEA,IAFA;AAGA;AACA,OAPA,EAOA,mBAPA;;AASA,KAnHA;AAoHA;AACA;AACA;AACA,KAvHA,EA3EA,E","file":"pagesB/newAddress/newAddress.js","sourcesContent":["import 'uni-pages';\nimport Vue from 'vue'\nimport Page from './pagesB/newAddress/newAddress.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./newAddress.vue?vue&type=template&id=57c16a2c&scoped=true&\"\nvar renderjs\nimport script from \"./newAddress.vue?vue&type=script&lang=js&\"\nexport * from \"./newAddress.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../HbuilderX/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 \"57c16a2c\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pagesB/newAddress/newAddress.vue\"\nexport default component.exports","export * from \"-!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./newAddress.vue?vue&type=template&id=57c16a2c&scoped=true&\"","var components\ntry {\n components = {\n city: function() {\n return import(\n /* webpackChunkName: \"components/city/city\" */ \"@/components/city/city.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/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./newAddress.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./newAddress.vue?vue&type=script&lang=js&\"","<template>\n <view class=\"\">\n <!-- 使用标题栏 -->\r\n <status-nav :statusBackw=\"true\" :statusTitle=\"true\" :whereCome=\"0\" :title-val=\"'地址管理'\" :tabcolor=\"'#ffffff'\"></status-nav>\r\n <!-- 地址信息 -->\r\n <view class=\"bacb padding-zy20 posir padding-sx30\" :style=\"{paddingTop:statusHNH+'px'}\">\r\n <view class=\"disba fon24 color33 borbot padding-sx20\">\r\n <view style=\"width: 16%;\" class=\"flexs margin-y10\">收货人</view>\r\n <input class=\"width100 fon24\" style=\"\" type=\"text\" v-model=\"name\" placeholder=\"请填写收货人姓名\" placeholder-style=\"font-size:24rpx;\"/>\r\n </view>\r\n <view class=\"disac fon24 color33 borbot padding-sx20\">\r\n <view class=\"flexs\" style=\"width: 16%;\">手机号码</view>\r\n <view class=\"disac width100\">\r\n <view class=\"flexs\">+86</view>\r\n <input class=\"width100 margin-z10 fon24\" type=\"number\" maxlength=\"11\" v-model=\"phone\" placeholder=\"请填写收货人的手机号码\" placeholder-style=\"font-size:24rpx;\"/>\r\n </view>\r\n </view>\r\n <view class=\"disba fon24 color33 borbot padding-sx20\">\r\n <view style=\"width: 16%;\" class=\"flexs margin-y10\">所在地区</view>\r\n <input @tap=\"openPicker\" disabled class=\"width100 fon24\" style=\"\" type=\"text\" v-model=\"region\" placeholder=\"省市区县、乡镇等\" placeholder-style=\"font-size:24rpx;\"/>\r\n </view>\r\n <view class=\"dis fon24 color33 borbot padding-sx20\">\r\n <view style=\"width: 16%;\" class=\"flexs margin-y10\">详细地址</view>\r\n <textarea class=\"width100 fon24\" v-model=\"address\" style=\"height: 200rpx;\" placeholder=\"街道、楼牌号等\" placeholder-style=\"font-size:24rpx;\"/>\r\n </view>\r\n <view class=\"borbot\"></view>\r\n </view>\r\n <view class=\"bacb margin-s20 padding-zy20 padding-sx30\">\r\n <view class=\"disba\">\r\n <view class=\"fon28\">设置为默认地址</view>\r\n <liSwitch :checked=\"switch_state\" @change=\"switchChange1\"></liSwitch>\r\n </view>\r\n <view class=\"fon24 color9\">提醒:每次下单会默认推荐使用该地址</view>\r\n </view>\r\n <view class=\"disbc\" style=\"position: fixed;bottom: 40px;left: 60px;right: 60px;\">\r\n <view @tap=\"saveAddress\" class=\"colorb fon30 addbtn\">保存</view>\r\n </view>\r\n <city @choseVal=\"choseValue\" :lotusAddressData=\"lotusAddressData\"></city>\r\n </view>\n</template>\n\n<script>\r\n import liSwitch from '@/components/li-switch.vue';\r\n import city from '@/components/city/city.js';\r\n import amap from '../../jsFile/amap-wx.js'\r\n export default {\r\n components:{\r\n liSwitch,\r\n city\r\n },\n data() {\n return {\r\n name:'',\r\n phone:'',\r\n address:'',\r\n switch_state: true,\r\n updateId:'',\r\n lotusAddressData:{\r\n visible:false,\r\n provinceName:'',\r\n cityName:'',\r\n townName:'',\r\n },\r\n region:'',\r\n\t\t\t\tregionObj:{\r\n\t\t\t\t\tprovince:'',\r\n\t\t\t\t\tprovinceCode:'',\r\n\t\t\t\t\tcity:'',\r\n\t\t\t\t\tcityCode:'',\r\n\t\t\t\t\ttown:'',\r\n\t\t\t\t\ttownCode:''\r\n\t\t\t\t},\r\n amapPlugin: null, //new地图\r\n key: '20e98934067a5cf96d8da862fe561787',\r\n lat:'',//纬度\r\n lng:'',//经度\r\n\t\t\t\tstatusHNH:uni.getStorageSync('statusHNH'),\r\n\t\t\t\tnewProvice:'',\r\n\t\t\t\tnewCity:'',\r\n\t\t\t\tnewDistrict:''\r\n }\n },\r\n onLoad() {\r\n\t\t\tlet obj = uni.getStorageSync('updataAddress');\r\n\t\t\tif(obj!=''){\r\n\t\t\t\tthis.updateId = obj.id\r\n\t\t\t\tthis.name = obj.name\r\n\t\t\t\tthis.phone = obj.phone\r\n\t\t\t\tthis.address = obj.address\r\n\t\t\t\tthis.regionObj.provinceCode = obj.province\r\n\t\t\t\tthis.regionObj.cityCode = obj.city\r\n\t\t\t\tthis.regionObj.townCode = obj.county\r\n\t\t\t\tthis.regionObj.province = obj.province_str\r\n\t\t\t\tthis.regionObj.city = obj.city_str\r\n\t\t\t\tthis.regionObj.town = obj.county_str\r\n\t\t\t\tif(obj.is_default==0){\r\n\t\t\t\t\tthis.switch_state = false\r\n\t\t\t\t}\r\n\t\t\t\tthis.region = `${obj.province_str} ${obj.city_str} ${obj.county_str} `\r\n\t\t\t}\r\n // uni.getLocation({\r\n // type: 'wgs84',\r\n //    geocode:true,\r\n // success: function (res) {\r\n // console.log('位置信息:'+JSON.stringify(res));\r\n // }\r\n // });\r\n },\r\n\t\tonUnload() {\r\n\t\t\tuni.removeStorageSync('updataAddress');\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tthis.$toolAll.tools.guoq()\r\n\t\t\tlet ya = this\r\n\t\t\twx.getLocation({\r\n\t\t\t success:function(res) {\r\n\t\t\t\tya.getDistrict(res.latitude, res.longitude)\r\n\t\t\t },\r\n\t\t\t})\r\n\t\t},\n methods: {\r\n\t\t\tgetDistrict(latitude, longitude) {\r\n\t\t\t\tlet ya = this\r\n\t\t\t wx.request({\r\n\t\t\t\t\turl: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=B2ABZ-SIDKS-WD2O3-6CJ2U-CDZOT-U3FKF`,\r\n\t\t\t\t\theader: {\r\n\t\t\t\t\t\t'Content-Type':'application/json'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess:function(res) {\r\n\t\t\t\t\t\t// console.log('地址数据:',res)\r\n\t\t\t\t\t\tya.newProvice = res.data.result.address_component.province\r\n\t\t\t\t\t\tya.newCity = res.data.result.address_component.city\r\n\t\t\t\t\t\tya.newDistrict = res.data.result.address_component.district\r\n\t\t\t\t\t}\r\n\t\t\t })\r\n\t\t\t},\r\n //打开picker\r\n openPicker() {\r\n this.lotusAddressData.visible = true;\r\n this.lotusAddressData.provinceName = this.newProvice;\r\n this.lotusAddressData.cityName = this.newCity;\r\n this.lotusAddressData.townName = this.newDistrict;\r\n },\r\n //回传已选的省市区的值\r\n choseValue(res){\r\n //res数据源包括已选省市区与省市区code\r\n // console.log(res);\r\n this.lotusAddressData.visible = res.visible;//visible为显示与关闭组件标识true显示false隐藏\r\n //res.isChose = 1省市区已选 res.isChose = 0;未选\r\n if(res.isChose){\r\n this.lotusAddressData.provinceName = res.province;//省\r\n this.lotusAddressData.cityName = res.city;//市\r\n this.lotusAddressData.townName = res.town;//区\r\n this.region = `${res.province} ${res.city} ${res.town}`; //region为已选的省市区的值\r\n\t\t\t\t\tthis.regionObj = {\r\n\t\t\t\t\t\tprovince:res.province,\r\n\t\t\t\t\t\tprovinceCode:res.provinceCode,\r\n\t\t\t\t\t\tcity:res.city,\r\n\t\t\t\t\t\tcityCode:res.cityCode,\r\n\t\t\t\t\t\ttown:res.town,\r\n\t\t\t\t\t\ttownCode:res.townCode\r\n\t\t\t\t\t}\r\n }\r\n },\n saveAddress(){\r\n if(!this.name){\r\n this.$toolAll.tools.showToast('请输入收货人');\r\n } else if(!this.phone){\r\n this.$toolAll.tools.showToast('请输入手机号');\r\n } else if(this.$toolAll.tools.isPhone(this.phone)){\r\n this.$toolAll.tools.showToast('请输入正确的手机号');\r\n } else if(!this.region){\r\n this.$toolAll.tools.showToast('请输入所在地区');\r\n } else if(!this.address){\r\n this.$toolAll.tools.showToast('请输入详细地址');\r\n } else if(!this.switch_state){\r\n uni.showModal({\r\n title:'提示:',\r\n content:'是否设为默认地址',\r\n cancelText:'取消默认',\r\n cancelColor:'#999999',\r\n confirmText:'设为默认',\r\n confirmColor:'#164396',\r\n success: (res) => {\r\n if(res.confirm){\r\n this.switch_state = true\r\n } else {\r\n this.saveEv()\r\n }\r\n }\r\n })\r\n } else {\r\n uni.showModal({\r\n title:'提示:',\r\n content:'确定要保存当前地址信息吗?',\r\n cancelText:'取消',\r\n cancelColor:'#999999',\r\n confirmText:'确定',\r\n confirmColor:'#164396',\r\n success: (res) => {\r\n if(res.confirm){\r\n this.saveEv()\r\n }\r\n }\r\n })\r\n }\r\n },\r\n saveEv(){//保存地址执行事件\r\n\t\t\t\tlet ya = this\r\n\t\t\t\tlet num = 1\r\n\t\t\t\tif(!ya.switch_state){num = 0}\r\n\t\t\t\tlet paramsadd = {\r\n\t\t\t\t\tid:\tya.updateId,\r\n\t\t\t\t\tname:ya.name,//姓名\r\n\t\t\t\t\tphone:ya.phone,//电话\r\n\t\t\t\t\tprovince:ya.regionObj.provinceCode,//省级行政编码 如110000\r\n\t\t\t\t\tcity:ya.regionObj.cityCode,//市级行政编码 如110100\r\n\t\t\t\t\tcounty:ya.regionObj.townCode,//县乡级行政编码 如110101\r\n\t\t\t\t\tprovince_str:ya.regionObj.province,//省级名称 如北京\r\n\t\t\t\t\tcity_str:ya.regionObj.city,//市级名称 如北京市\r\n\t\t\t\t\tcounty_str:ya.regionObj.town,//县乡区域名称 如东城区\r\n\t\t\t\t\taddress:ya.address,//具体地址 如XX路xx街\r\n\t\t\t\t\tis_default:num,//是否默认地址 0=否 1=是\r\n\t\t\t\t\tpostcode:'',//邮编 如610200\r\n\t\t\t\t\ttag:''//地址标签 如 家 公司\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.post('user/address-save',paramsadd).then(res=>{\r\n\t\t\t\t\tif(res.msg=='success'){\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast('地址保存成功');\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t uni.navigateBack({delta:1})\r\n\t\t\t\t\t\t},2000)\r\n\t\t\t\t\t}\r\n\t\t\t\t},error=>{})\r\n \r\n },\r\n switchChange1: function(e){\r\n \t// console.log(e);\r\n \tthis.switch_state = !e.checked;\r\n }\n }\n }\n</script>\n\n<style scoped>\r\n \n</style>\n"],"sourceRoot":""}