1 line
13 KiB
Plaintext
1 line
13 KiB
Plaintext
{"version":3,"sources":["webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/address/index.vue?cc22","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/address/index.vue?6b4f","webpack:///E:/project/project-wl-yonghuduan-uniapp-vue3/pages/address/index.vue?a6b8","uni-app:///pages/address/index.vue","uni-app:///main.js"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA8H;AAC9H;AACoE;AACL;AAC4B;;;AAG3F;AAC+L;AAC/L,gBAAgB,sMAAU;AAC1B,EAAE,sFAAM;AACR,EAAE,4FAAM;AACR,EAAE,qGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,gGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAA4uB,CAAgB,uvBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqEhwB;;;;;;;AAOA;;;;AAIA,+K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,gCACA,uCACA,oCACA,sCACA,qCACA,QADA,CACA;AADA,GAGA,gCACA,QADA,CACA;AADA,GAGA,oCACA,OADA,EAEA,YAFA,IAIA,mC,CAAA;AACA,oCACA,6BACA,wCACA,qCACA,0BACA,CAHA,EAIA,iCACA,UACA,CAFA,E,CAIA;AACA,4DACA,+BACA,OACA,CACA,iBACA,uFACA,qBAFA,IAIA,CARA,C,CASA;AACA,sDACA;AACA,uBACA,mBACA,CAFA,MAEA,CACA,iBACA,oEADA,IAGA,CACA,CATA,C,CAUA;AACA,0DACA,iBACA,6FADA,IAGA,CAJA,C,CAKA;AACA,sCACA,yBACA,+BACA,mBADA,EAEA,2BAFA,IAGA,IAHA,CAGA,gBACA,+DADA,CAEA;AACA,6BACA,6CACA,CAFA,MAEA,CACA,2BACA,CAPA,CAQA;AACA,GAZA,EAaA,CAfA,C,CAgBA;AACA,sDACA,kCACA,iCACA,OACA,CACA;AACA;AACA,CAPA;AAQA;AACA;AACA;AACA;AACA,CAHA;AAIA;AACA;AACA;AACA;AACA,CAHA;;AAKA;AACA;AACA;AACA;AACA,CAHA;;AAKA;AACA;AACA;AACA;AACA,CAHA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBADA;AAEA,qBAFA;AAGA,oBAHA;;AAKA,GAVA;AAWA,CAfA;;AAiBA;AACA;AACA;AACA;AACA;AACA,CAJA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,iCADA;;AAGA,GAJA;AAKA;AACA,CATA,C;;;;;;;;;;;;;kDClNA;;;AAGA;AACA,+F,8FAHA;AACAA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC,CAGAC,UAAU,CAACC,cAAD,CAAV,C","file":"pages/address/index.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./index.vue?vue&type=template&id=5f170bce&scoped=true&\"\nvar renderjs\nimport script from \"./index.vue?vue&type=script&setup=true&lang=js&\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=js&\"\nimport style0 from \"./index.scss?vue&type=style&index=0&id=5f170bce&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!C:\\\\Users\\\\itcast\\\\Downloads\\\\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 \"5f170bce\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/address/index.vue\"\nexport default component.exports","export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=template&id=5f170bce&scoped=true&\"","import mod from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"; export default mod; export * from \"-!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!C:\\\\Users\\\\itcast\\\\Downloads\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./index.vue?vue&type=script&setup=true&lang=js&\"","<template>\r\n\t<!-- 头部导航栏 -->\r\n\t<nav-bar title='地址簿'></nav-bar>\r\n\t<view v-if=\"list.data.length > 0\" class=\"list-container\">\r\n\t\t<scroll-view scroll-y lower-threshold=\"30\" @scrolltolower=\"LoadMoreCustomers\">\r\n\t\t\t<!-- 列表内容 -->\r\n\t\t\t<view v-for='(item,index) in list.data' @click=\"handleToAddressInfo(item.id)\" :key='index'\r\n\t\t\t\tclass=\"address-list\" :class=\"isManage?'isChecked':''\">\r\n\t\t\t\t<view class=\"checkbox\" v-if=\"isManage\">\r\n\t\t\t\t\t<view class=\"checkRadio\">\r\n\t\t\t\t\t\t<radio color=\"#F23C24\" :value=\"String(index)\" :checked=\"item.selected\"\r\n\t\t\t\t\t\t\t@click=\"checkbox(index,item)\" />\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"address-item\" :class=\"isManage?'isChecked':''\">\r\n\t\t\t\t\t<view class=\"address-name\">{{item.name}}</view>\r\n\t\t\t\t\t<view class=\"address-phone\">{{item.phoneNumber}}</view>\r\n\t\t\t\t\t<view class=\"address-address\">\r\n\t\t\t\t\t\t{{item.province? item.province.name+item.city.name+ item.county.name+item.address:''}}\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"line\"></view>\r\n\t\t\t\t\t<view class=\"address-item-footer\">\r\n\t\t\t\t\t\t<view class=\"edit-btn\" @click=\"handleEditAddress(item)\">\r\n\t\t\t\t\t\t\t<icon></icon>\r\n\t\t\t\t\t\t\t<text>编辑</text>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t<view class=\"delete-btn\" @click=\"handledDelete(item.id)\">\r\n\t\t\t\t\t\t\t<icon></icon>\r\n\t\t\t\t\t\t\t<text>删除</text>\r\n\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 加载底部 -->\r\n\t\t\t<uni-load-more :status=\"status\" />\r\n\t\t</scroll-view>\r\n\t\t<!-- 全选操作栏 -->\r\n\t\t<view class=\"all-select\" v-if=\"isManage\">\r\n\t\t\t<view class=\"checkbox\" @click=\"selectAll\">\r\n\t\t\t\t<view class=\"checkRadio\">\r\n\t\t\t\t\t<radio :checked=\"isAllSelect\" color=\"#F23C24\" />\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view>全选</view>\r\n\t\t\t<!-- <uni-radio>123</uni-radio> -->\r\n\t\t</view>\r\n\t\t<!-- 底部操作栏 -->\r\n\t\t<view class=\"address-footer\">\r\n\t\t\t<view class=\"manage-btn\" @click=\"handleEdit\">{{isManage?'完成':'管理'}}</view>\r\n\t\t\t<view class=\"addAddress-btn\" @click=\"handleDeleteOrAdd\">{{isManage?'删除':'新增地址'}}</view>\r\n\t\t</view>\r\n\t</view>\r\n\t<!-- 空页面 -->\r\n\t<view v-else>\r\n\t\t<EmptyPage :emptyData=\"emptyData\"></EmptyPage>\r\n\t</view>\r\n\r\n\t<!-- 删除确认对话框 -->\r\n\t<uni-popup ref=\"popup\" type=\"dialog\" class='address-popup'>\r\n\t\t<uni-popup-dialog mode=\"base\" :content=\"isManage?'确定是否删除所选地址?':'确定是否删除此条地址?'\" :animation='false'\r\n\t\t\t:before-close=\"true\" @close=\"close\" @confirm=\"confirm\">\r\n\r\n\t\t</uni-popup-dialog>\r\n\t</uni-popup>\r\n\r\n</template>\r\n\r\n<script setup>\r\n\timport {\r\n\t\tref,\r\n\t\treactive,\r\n\t\tonMounted,\r\n\t\twatch,\r\n\t\tnextTick\r\n\t} from 'vue';\r\n\timport {\r\n\t\tgetAddressList,\r\n\t\tdeleteAddress\r\n\t} from '@/pages/api/address.js'\r\n\timport {\r\n\t\tonLoad,\r\n\t\tonShow\r\n\t} from '@dcloudio/uni-app';\r\n\tlet popup = ref(null)\r\n\tlet isAllSelect = ref(false)\r\n\tlet isManage = ref(false)\r\n\tlet emptyData = ref('暂无数据');\r\n\tlet deleteIds = reactive({\r\n\t\tdata: [] //删除的地址id集合\r\n\t})\r\n\tlet list = reactive({\r\n\t\tdata: [] //列表数据\r\n\t})\r\n\tlet pageInfo = reactive({\r\n\t\tpage: 1,\r\n\t\tpageSize: 10\r\n\t})\r\n\tlet status = ref('more') //加载状态\r\n\tlet height = ref('670px')\r\n\tlet type = ref('')\r\n\tonLoad((options) => {\r\n\t\tconsole.log(options, 'options.type')\r\n\t\ttype.value = options.type\r\n\t})\r\n\tonMounted(() => {\r\n\t\tgetList()\r\n\t})\r\n\r\n\t//跳转回寄件收件选择地址\r\n\tconst handleToAddressInfo = (id) => {\r\n\t\tif(type.value === 'address'){\r\n\t\t\treturn\r\n\t\t}\r\n\t\tuni.redirectTo({\r\n\t\t\turl: '/pages/express-delivery/index?type=' + type.value +'&editOrAdd=edit&id=' + id +\r\n\t\t\t\t'&isFromAddress=true'\r\n\t\t});\r\n\t}\r\n\t//批量删除或者新增地址\r\n\tconst handleDeleteOrAdd = () => {\r\n\t\t// console.log()\r\n\t\tif (isManage.value) {\r\n\t\t\tpopup.value.open()\r\n\t\t} else {\r\n\t\t\tuni.redirectTo({\r\n\t\t\t\turl: '/subPages/address-info/index?isFromAddress=true&editOrAdd=add'\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t//编辑地址\r\n\tconst handleEditAddress = (item) => {\r\n\t\tuni.redirectTo({\r\n\t\t\turl: '/subPages/address-info/index?id=' + item.id + '&isFromAddress=true' + '&editOrAdd=edit'\r\n\t\t});\r\n\t}\r\n\t//获取列表数据\r\n\tconst getList = (flag) => {\r\n\t\tstatus.value = 'loading'\r\n\t\tgetAddressList({\r\n\t\t\tpage: pageInfo.page,\r\n\t\t\tpageSize: pageInfo.pageSize\r\n\t\t}).then((res) => {\r\n\t\t\tstatus.value = res.data.items.length < 10 ? 'no-more' : 'more'\r\n\t\t\t//用于区分是一次进页面记载数据还是后续上拉加载\r\n\t\t\tif (flag === 'topPull') {\r\n\t\t\t\tlist.data = list.data.concat(res.data.items)\r\n\t\t\t} else {\r\n\t\t\t\tlist.data = res.data.items\r\n\t\t\t}\r\n\t\t\t// console.log(!res.data.items[0].province, list.data, 'res')\r\n\t\t})\r\n\t}\r\n\t//上拉加载\r\n\tconst LoadMoreCustomers = () => {\r\n\t\tpageInfo.page = pageInfo.page + 1\r\n\t\tif (status.value === 'no-more') {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tgetList('topPull')\r\n\t\tconsole.log('上拉加载')\r\n\t}\r\n\t//全选\r\n\tconst handledAllSelect = () => {\r\n\t\tconsole.log(222)\r\n\t\tisAllSelect.value = !isAllSelect.value\r\n\t}\r\n\t//管理地址簿\r\n\tconst handleEdit = () => {\r\n\t\tconsole.log(111)\r\n\t\tisManage.value = !isManage.value\r\n\t}\r\n\r\n\t//删除\r\n\tconst handledDelete = (id) => {\r\n\t\tpopup.value.open()\r\n\t\tdeleteIds.data.push(id)\r\n\t}\r\n\r\n\t//关闭删除确认提示框\r\n\tconst close = () => {\r\n\t\tpopup.value.close()\r\n\t\tdeleteIds.data = []\r\n\t}\r\n\r\n\t//确认删除\r\n\tconst confirm = () => {\r\n\t\tpopup.value.close()\r\n\t\t// list.data = []\r\n\t\tconsole.log(deleteIds.data, 'deleteIds.data')\r\n\t\tdeleteAddress(deleteIds.data).then((res) => {\r\n\t\t\tconsole.log(res, 'res')\r\n\t\t\tpageInfo.page = 1\r\n\t\t\tpageInfo.pageSize = 10\r\n\t\t\tgetList()\r\n\t\t\tuni.showToast({\r\n\t\t\t\ttitle: '删除成功',\r\n\t\t\t\ticon: 'success',\r\n\t\t\t\tduration: 1000\r\n\t\t\t})\r\n\t\t})\r\n\t}\r\n\r\n\t//选中\r\n\tconst checkbox = (index, item) => {\r\n\t\tlist.data[index].selected = !list.data[index].selected\r\n\t\tdeleteIds.data = list.data.filter(item => item.selected).map(item => item.id)\r\n\t\tconsole.log(list.data, 'list.data')\r\n\t}\r\n\t//全选\r\n\tconst selectAll = () => {\r\n\t\tconsole.log(isAllSelect.value, 'isAllSelect.value')\r\n\t\tisAllSelect.value = !isAllSelect.value\r\n\t\tlist.data = list.data.map((item) => {\r\n\t\t\treturn Object.assign({}, item, {\r\n\t\t\t\tselected: isAllSelect.value\r\n\t\t\t})\r\n\t\t})\r\n\t\tdeleteIds.data = list.data.filter(item => item.selected).map(item => item.id)\r\n\t}\r\n</script>\r\n\r\n<style src=\"./index.scss\" lang=\"scss\" scoped></style>\n","import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pages/address/index.vue'\ncreatePage(Page)"],"sourceRoot":""} |