acdr-ui/dist/dev/mp-weixin/modules/mall/order/addressSelection.js.map

1 line
8.7 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"version":3,"file":"addressSelection.js","sources":["../../../../../../src/modules/mall/order/addressSelection.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9tb2R1bGVzL21hbGwvb3JkZXIvYWRkcmVzc1NlbGVjdGlvbi52dWU"],"sourcesContent":["<!-- 下单界面,收货地址 or 自提门店的选择组件 -->\r\n<template>\r\n <view class=\"allAddress\" :style=\"state.isPickUp ? '' : 'padding-top:10rpx;'\">\r\n <view class=\"nav flex flex-wrap\">\r\n <view\r\n class=\"item font-color\"\r\n :class=\"state.deliveryType === 1 ? 'on' : 'on2'\"\r\n @tap=\"switchDeliveryType(1)\"\r\n v-if=\"state.isPickUp\"\r\n />\r\n <view\r\n class=\"item font-color\"\r\n :class=\"state.deliveryType === 2 ? 'on' : 'on2'\"\r\n @tap=\"switchDeliveryType(2)\"\r\n v-if=\"state.isPickUp\"\r\n />\r\n </view>\r\n <!-- 情况一:收货地址的选择 -->\r\n <view\r\n class=\"address flex flex-wrap flex-center ss-row-between\"\r\n @tap=\"onSelectAddress\"\r\n v-if=\"state.deliveryType === 1\"\r\n :style=\"state.isPickUp ? '' : 'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'\"\r\n >\r\n <view class=\"addressCon\" v-if=\"state.addressInfo.name\">\r\n <view class=\"name\">\r\n {{ state.addressInfo.name }}\r\n <text class=\"phone\">{{ state.addressInfo.mobile }}</text>\r\n </view>\r\n <view class=\"flex flex-wrap\">\r\n <text class=\"default font-color\" v-if=\"state.addressInfo.defaultStatus\">[默认]</text>\r\n <text class=\"line2\">\r\n {{ state.addressInfo.areaName }} {{ state.addressInfo.detailAddress }}\r\n </text>\r\n </view>\r\n </view>\r\n <view class=\"addressCon\" v-else>\r\n <view class=\"setaddress\">设置收货地址</view>\r\n </view>\r\n <view class=\"iconfont\">\r\n <view class=\"ss-rest-button\">\r\n <text class=\"_icon-forward\" />\r\n </view>\r\n </view>\r\n </view>\r\n <!-- 情况二:门店的选择 -->\r\n <view class=\"address flex flex-wrap flex-center ss-row-between\" v-else @tap=\"onSelectAddress\">\r\n <view class=\"addressCon\" v-if=\"state.pickUpInfo.name\">\r\n <view class=\"name\">\r\n {{ state.pickUpInfo.name }}\r\n <text class=\"phone\">{{ state.pickUpInfo.phone }}</text>\r\n </view>\r\n <view class=\"line1\">\r\n {{ state.pickUpInfo.areaName }}{{ ', ' + state.pickUpInfo.detailAddress }}\r\n </view>\r\n </view>\r\n <view class=\"addressCon\" v-else>\r\n <view class=\"setaddress\">选择自提门店</view>\r\n </view>\r\n <view class=\"iconfont\">\r\n <view class=\"ss-rest-button\">\r\n <text class=\"_icon-forward\" />\r\n </view>\r\n </view>\r\n </view>\r\n <view class=\"line\">\r\n <image :src=\"sheep.$url.static('/static/images/line.png', 'local')\" />\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script setup>\r\nimport { computed } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport { isEmpty } from 'lodash-es'\r\n\r\nconst props = defineProps({\r\n modelValue: {\r\n type: Object,\r\n default() {},\r\n },\r\n})\r\nconst emits = defineEmits(['update:modelValue'])\r\n\r\n// computed 解决父子组件双向数据同步\r\nconst state = computed({\r\n get() {\r\n return new Proxy(props.modelValue, {\r\n set(obj, name, val) {\r\n emits('update:modelValue', {\r\n ...obj,\r\n [name]: val,\r\n })\r\n return true\r\n },\r\n })\r\n },\r\n set(val) {\r\n emits('update:modelValue', val)\r\n },\r\n})\r\n\r\n// 选择地址\r\nfunction onSelectAddress() {\r\n let emitName = 'SELECT_ADDRESS'\r\n let addressPage = '/modules/mall/user/address/list?type=select'\r\n if (state.value.deliveryType === 2) {\r\n emitName = 'SELECT_PICK_UP_INFO'\r\n addressPage = '/modules/mall/user/goods_details_store/index'\r\n }\r\n uni.$once(e