1 line
8.7 KiB
Plaintext
1 line
8.7 KiB
Plaintext
{"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(emitName, (e) => {\r\n changeConsignee(e.addressInfo)\r\n })\r\n sheep.$router.go(addressPage)\r\n}\r\n\r\n// 更改收货人地址&计算订单信息\r\nasync function changeConsignee(addressInfo = {}) {\r\n if (!isEmpty(addressInfo)) {\r\n if (state.value.deliveryType === 1) {\r\n state.value.addressInfo = addressInfo\r\n }\r\n if (state.value.deliveryType === 2) {\r\n state.value.pickUpInfo = addressInfo\r\n }\r\n }\r\n}\r\n\r\n// 收货方式切换\r\nconst switchDeliveryType = (type) => {\r\n state.value.deliveryType = type\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.allAddress .font-color {\r\n color: #e93323 !important;\r\n}\r\n.line2 {\r\n width: 504rpx;\r\n}\r\n.textR {\r\n text-align: right;\r\n}\r\n\r\n.line {\r\n width: 100%;\r\n height: 3rpx;\r\n}\r\n\r\n.line image {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.address {\r\n box-sizing: border-box;\r\n padding: 28rpx;\r\n background-color: #fff;\r\n}\r\n\r\n.address .addressCon {\r\n width: 596rpx;\r\n font-size: 26rpx;\r\n color: #666;\r\n}\r\n\r\n.address .addressCon .name {\r\n margin-bottom: 10rpx;\r\n font-size: 30rpx;\r\n font-weight: bold;\r\n color: #282828;\r\n}\r\n\r\n.address .addressCon .name .phone {\r\n margin-left: 50rpx;\r\n}\r\n\r\n.address .addressCon .default {\r\n margin-right: 12rpx;\r\n}\r\n\r\n.address .addressCon .setaddress {\r\n font-size: 28rpx;\r\n color: #333;\r\n}\r\n\r\n.address .iconfont {\r\n font-size: 35rpx;\r\n color: #707070;\r\n}\r\n\r\n.allAddress {\r\n width: 100%;\r\n // background-image: linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);\r\n // background-image: -webkit-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);\r\n // background-image: -moz-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);\r\n //padding: 100rpx 30rpx 0 30rpx;\r\n padding-top: 100rpx;\r\n padding-bottom: 10rpx;\r\n background: linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);\r\n}\r\n\r\n.allAddress .nav {\r\n width: 690rpx;\r\n margin: 0 auto;\r\n}\r\n\r\n.allAddress .nav .item {\r\n width: 334rpx;\r\n}\r\n\r\n.allAddress .nav .item.on {\r\n position: relative;\r\n width: 230rpx;\r\n}\r\n\r\n.allAddress .nav .item.on::before {\r\n position: absolute;\r\n bottom: 0;\r\n z-index: 2;\r\n display: block;\r\n width: 336rpx;\r\n height: 0;\r\n font-size: 28rpx;\r\n line-height: 80rpx;\r\n text-align: center;\r\n content: '快递配送';\r\n border-color: transparent transparent #fff;\r\n border-style: none solid solid;\r\n border-width: 0 20rpx 80rpx 0;\r\n border-radius: 14rpx 36rpx 0 0;\r\n}\r\n\r\n.allAddress .nav .item:nth-of-type(2).on::before {\r\n content: '到店自提';\r\n border-width: 0 0 80rpx 20rpx;\r\n border-radius: 36rpx 14rpx 0 0;\r\n}\r\n\r\n.allAddress .nav .item.on2 {\r\n position: relative;\r\n}\r\n\r\n.allAddress .nav .item.on2::before {\r\n position: absolute;\r\n bottom: 0;\r\n display: block;\r\n width: 401rpx;\r\n height: 0;\r\n font-size: 28rpx;\r\n line-height: 60rpx;\r\n text-align: center;\r\n content: '到店自提';\r\n border-color: transparent transparent #f7c1bd;\r\n border-style: none solid solid;\r\n border-width: 0 0 60rpx 60rpx;\r\n border-radius: 36rpx 14rpx 0 0;\r\n}\r\n\r\n.allAddress .nav .item:nth-of-type(1).on2::before {\r\n content: '快递配送';\r\n border-width: 0 60rpx 60rpx 0;\r\n border-radius: 14rpx 36rpx 0 0;\r\n}\r\n\r\n.allAddress .address {\r\n width: 690rpx;\r\n max-height: 180rpx;\r\n margin: 0 auto;\r\n}\r\n\r\n.allAddress .line {\r\n width: 100%;\r\n margin: 0 auto;\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/modules/mall/order/addressSelection.vue'\nwx.createComponent(Component)"],"names":["computed","uni","sheep","isEmpty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,UAAM,QAAQ;AAMd,UAAM,QAAQ;AAGd,UAAM,QAAQA,cAAAA,SAAS;AAAA,MACrB,MAAM;AACJ,eAAO,IAAI,MAAM,MAAM,YAAY;AAAA,UACjC,IAAI,KAAK,MAAM,KAAK;AAClB,kBAAM,qBAAqB,iCACtB,MADsB;AAAA,cAEzB,CAAC,IAAI,GAAG;AAAA,YAClB,EAAS;AACD,mBAAO;AAAA,UACR;AAAA,QACP,CAAK;AAAA,MACF;AAAA,MACD,IAAI,KAAK;AACP,cAAM,qBAAqB,GAAG;AAAA,MAC/B;AAAA,IACH,CAAC;AAGD,aAAS,kBAAkB;AACzB,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,MAAM,MAAM,iBAAiB,GAAG;AAClC,mBAAW;AACX,sBAAc;AAAA,MACf;AACDC,oBAAAA,MAAI,MAAM,UAAU,CAAC,MAAM;AACzB,wBAAgB,EAAE,WAAW;AAAA,MACjC,CAAG;AACDC,wBAAM,QAAQ,GAAG,WAAW;AAAA,IAC9B;AAGA,aAAe,kBAAkC;AAAA,iDAAlB,cAAc,IAAI;AAC/C,YAAI,CAACC,cAAAA,QAAQ,WAAW,GAAG;AACzB,cAAI,MAAM,MAAM,iBAAiB,GAAG;AAClC,kBAAM,MAAM,cAAc;AAAA,UAC3B;AACD,cAAI,MAAM,MAAM,iBAAiB,GAAG;AAClC,kBAAM,MAAM,aAAa;AAAA,UAC1B;AAAA,QACF;AAAA,MACH;AAAA;AAGA,UAAM,qBAAqB,CAAC,SAAS;AACnC,YAAM,MAAM,eAAe;AAAA,IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClIA,GAAG,gBAAgB,SAAS;"} |