diff --git a/buyer/package-lock.json b/buyer/package-lock.json index ba8bf571..b0dcf19e 100644 --- a/buyer/package-lock.json +++ b/buyer/package-lock.json @@ -477,70 +477,6 @@ "webpack-merge": "^4.2.2" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, - "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", - "dev": true, - "optional": true - }, - "loader-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.3.tgz", - "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, "postcss-loader": { "version": "3.0.0", "resolved": "https://registry.npmmirror.com/postcss-loader/-/postcss-loader-3.0.0.tgz", @@ -585,28 +521,6 @@ "ajv-errors": "^1.0.0", "ajv-keywords": "^3.1.0" } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.8.3", - "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", - "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - } } } }, @@ -10278,6 +10192,94 @@ } } }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.8.3", + "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", + "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "optional": true + }, + "loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "vue-piczoom": { "version": "1.0.6", "resolved": "https://registry.npmmirror.com/vue-piczoom/-/vue-piczoom-1.0.6.tgz", diff --git a/buyer/public/config.js b/buyer/public/config.js index d7556570..d06d9dd2 100644 --- a/buyer/public/config.js +++ b/buyer/public/config.js @@ -3,8 +3,8 @@ var BASE = { * @description api请求基础路径 */ API_DEV: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", + common: "http://192.168.0.113:8890", + buyer: "http://192.168.0.113:8888", seller: "https://store-api.pickmall.cn", manager: "https://admin-api.pickmall.cn" }, diff --git a/buyer/src/api/cart.js b/buyer/src/api/cart.js index 57d99878..c8d13461 100644 --- a/buyer/src/api/cart.js +++ b/buyer/src/api/cart.js @@ -212,3 +212,52 @@ export function receiptSelect (params) { params }); } + +/** + * 获取全部配送方式 + */ + export function shippingMethodList(params) { + return request({ + url: `/buyer/trade/carts/shippingMethodList`, + method: Method.GET, + needToken: true, + params: params, + }); +} + +/** + * 获取全部配送方式 + */ + export function storeAddressList(params) { + return request({ + url: `/buyer/store/address/shippingMethodList`, + method: Method.GET, + needToken: true, + params: params, + }); +} + +/** + * 设置自提地址ID + * @param addressId + */ + export function setStoreAddressId(storeAddressId,way) { + return request({ + url: `/buyer/trade/carts/storeAddress?storeAddressId=${storeAddressId}&way=${way}`, + method: Method.GET, + needToken: true, + }); +} + +/** + * 提交配送方式 + * @param params + */ + export function setShipMethod(params) { + return request({ + url: "/buyer/trade/carts/shippingMethod", + method: Method.PUT, + needToken: true, + params, + }); +} diff --git a/buyer/src/api/shopentry.js b/buyer/src/api/shopentry.js index 96aa08f8..b1d178ae 100644 --- a/buyer/src/api/shopentry.js +++ b/buyer/src/api/shopentry.js @@ -75,3 +75,15 @@ export function applyStatus () { method: Method.GET }) } + +/** + * 获取自提点信息 + * @param storeId + */ + export function getStoreAddress(storeId,params) { + return request({ + url: `/buyer/store/address/page/${storeId}`, + method: Method.GET, + params + }); +} diff --git a/buyer/src/pages/home/enumeration.js b/buyer/src/pages/home/enumeration.js index ee39e556..60a6f82f 100644 --- a/buyer/src/pages/home/enumeration.js +++ b/buyer/src/pages/home/enumeration.js @@ -32,6 +32,10 @@ export const orderStatusList = [ { name: '已取消', status: 'CANCELLED' + }, + { + name: '待提货', + status: 'STAY_PICKED_UP' } ] // 订单售后状态 diff --git a/buyer/src/pages/home/orderCenter/OrderDetail.vue b/buyer/src/pages/home/orderCenter/OrderDetail.vue index e33472f6..13ba38be 100644 --- a/buyer/src/pages/home/orderCenter/OrderDetail.vue +++ b/buyer/src/pages/home/orderCenter/OrderDetail.vue @@ -53,7 +53,7 @@ > -
+

收货人信息

收货人:{{ order.order.consigneeName }}

手机号码:{{ order.order.consigneeMobile | secrecyMobile }}

@@ -62,6 +62,11 @@ {{ order.order.consigneeDetail }}

+
+

自提点信息

+

自提点名称:{{ order.order.storeAddressPath }}

+

联系方式:{{ order.order.storeAddressMobile }}

+

付款信息

支付方式:{{ order.paymentMethodValue }}

@@ -70,7 +75,7 @@

配送信息

配送方式:{{ order.deliveryMethodValue }}

-

配送状态:{{ order.deliverStatusValue }}

+

配送状态:{{ order.deliverStatusValue }}

物流信息:{{ logistics.shipper || "暂无物流信息" }}

@@ -270,6 +275,9 @@ export default { if (res.success) { this.order = res.result; this.progressList = res.result.orderLogs; + if (this.order.order.deliveryMethod === 'LOGISTICS') { + this.traces(); + } } }); }, @@ -336,7 +344,6 @@ export default { }, mounted() { this.getDetail(); - this.traces(); }, }; diff --git a/buyer/src/pages/payment/Pay.vue b/buyer/src/pages/payment/Pay.vue index 35fbec7b..60cea477 100644 --- a/buyer/src/pages/payment/Pay.vue +++ b/buyer/src/pages/payment/Pay.vue @@ -9,42 +9,29 @@
1.我的购物车 - + 2.填写订单信息 - + 3.成功提交订单
-
+
收货人信息 管理收货人地址
-
+
{{ item.name }} 默认 - {{ item.alias }} + {{ item.alias }}
{{ item.mobile }}
@@ -53,12 +40,7 @@
修改 - 删除 + 删除
@@ -70,75 +52,99 @@
添加新地址
- -
+
{{ moreAddr ? "收起地址" : "更多地址" }}
+ +
+
+ 自提点信息 +
+
+
+
+ {{ item.addressName }} +
+
{{ item.mobile }}
+
+ {{ item.address | unitAddress }} {{ item.detail }} +
+
+
+ +
+
+
+
+ {{ storeMoreAddr ? "收起地址" : "更多地址" }} + + +
+
+
+
+
+
+ 配送方式 +
+
+ +
+
{{ item.label }}
+
+
+ +
+
+
+
商品信息 返回购物车
-
+
{{ - shop.storeName - }}   + shop.storeName + }}  
-
- +
+ {{ - goods.goodsSku.goodsName + goods.goodsSku.goodsName }} {{ - goods.purchasePrice | unitPrice("¥") + goods.purchasePrice | unitPrice("¥") }} x{{ goods.num }} {{ goods.goodsSku.quantity > 0 ? "有货" : "无货" }} {{ - goods.subTotal | unitPrice("¥") + goods.subTotal | unitPrice("¥") }}
- - 提示:请勿填写有关支付、收货、发票方面的信息 + + 提示:请勿填写有关支付、收货、发票方面的信息
@@ -146,13 +152,9 @@
- 发票信息 - 开企业抬头发票须填写纳税人识别号,以免影响报销 - + 发票信息 + 开企业抬头发票须填写纳税人识别号,以免影响报销 +
{{ invoiceData.receiptTitle }} @@ -167,47 +169,24 @@
无可用优惠券
    -
  • +
  • - {{ + {{ item.price | unitPrice - }} - {{ item.discount }} - 满{{ item.consumeThreshold }}元可用 + }} + {{ + item.discount + }} + 满{{ item.consumeThreshold }}元可用

    使用范围:{{ useScope(item.scopeType) }}

    有效期:{{ item.endTime }}

    - + 立即使用 - 放弃优惠 + 放弃优惠
  • @@ -216,30 +195,24 @@
    - {{ totalNum }}件商品,总商品金额:{{ priceDetailDTO.goodsPrice | unitPrice("¥") }} + {{ totalNum }}件商品,总商品金额:{{ priceDetailDTO.goodsPrice | unitPrice("¥") }}
    - 运费:{{ priceDetailDTO.freightPrice | unitPrice("¥") }} + 运费:{{ priceDetailDTO.freightPrice | unitPrice("¥") }}
    - 优惠金额:-{{ priceDetailDTO.discountPrice | unitPrice("¥") }} + 优惠金额:-{{ priceDetailDTO.discountPrice | unitPrice("¥") }}
    - 优惠券金额:-{{ priceDetailDTO.couponPrice | unitPrice("¥") }} + 优惠券金额:-{{ priceDetailDTO.couponPrice | unitPrice("¥") }}
    - 应付积分:{{ priceDetailDTO.payPoint }} + 应付积分:{{ priceDetailDTO.payPoint }}
    - 应付金额:{{ - priceDetailDTO.flowPrice | unitPrice("¥") + 应付金额:{{ + priceDetailDTO.flowPrice | unitPrice("¥") }}
    @@ -250,23 +223,15 @@
    配送至:{{ selectedAddress.consigneeAddressPath | unitAddress }} {{ selectedAddress.detail }}  收货人:{{ - selectedAddress.name + selectedAddress.name }}  {{ selectedAddress.mobile }}
- + - +
@@ -279,8 +244,12 @@ import { createTrade, selectAddr, selectCoupon, + setShipMethod, + setStoreAddressId, + shippingMethodList, couponNum, } from "@/api/cart"; +import { getStoreAddress } from "@/api/shopentry.js" import { canUseCouponList } from "@/api/member.js"; export default { @@ -288,15 +257,35 @@ export default { components: { invoiceModal, addressManage }, data() { return { + selectedStoreAddress: 'm', + selectMethod: '', stepIndex: 1, // 顶部步骤条状态 invoiceAvailable: false, // 发票编辑按钮 showEditBtn: "", // 鼠标移入显示编辑按钮 orderMark: "", // 订单备注 + storeMoreAddr: false, invoiceData: { // 发票数据 receiptTitle: "个人", receiptContent: "不开发票", }, + searchForm: { + pageNumber: 1, + pageSize: 100 + }, + shippingMethod: [], + storeAddressList: [], + shippingWay: [ + { + value: "LOGISTICS", + label: "物流", + }, + { + value: "SELF_PICK_UP", + label: "自提", + }, + ], + selectedDeliverMethod: 'LOGISTICS', addressList: [], // 地址列表 selectedAddress: {}, // 所选地址 goodsList: [], // 商品列表 @@ -308,6 +297,7 @@ export default { couponList: [], // 可用优惠券列表 usedCouponId: [], // 已使用优惠券id selectedCoupon: {}, // 已选优惠券对象 + storeId: '', //店铺Id }; }, mounted() { @@ -317,6 +307,7 @@ export default { // 初始化数据 init() { this.getGoodsDetail(); + this.getDistribution(); }, goAddressManage() { // 跳转地址管理页面 @@ -324,7 +315,7 @@ export default { }, getAddress() { // 获取收货地址列表 - memberAddress().then((res) => { + memberAddress(this.searchForm).then((res) => { if (res.success) { this.addressList = res.result.records; this.addressList.forEach((e, index) => { @@ -335,6 +326,38 @@ export default { } }); }, + // 获取配送方式列表 + async getDistribution() { + let shopRes = await shippingMethodList({ way: this.$route.query.way }); + let shopList; + if (shopRes.success) { + shopList = shopRes.result; + let way = []; + console.log(shopList) + this.shippingWay.forEach((item) => { + shopList.forEach((child) => { + if (item.value == child) { + way.push(item); + } + }); + }); + this.shippingMethod = way; + console.log(this.shippingMethod) + } + }, + + async getStoreAddressList() { + getStoreAddress(this.storeId,this.searchForm).then(res => { + if (res.success) { + this.storeAddressList = res.result.records + this.storeAddressList.forEach((e, index) => { + if (e.id === this.selectedAddress.id && index > 2) { + this.storeMoreAddr = true; + } + }); + } + }) + }, getGoodsDetail() { // 订单商品详情 this.$Spin.show(); @@ -364,7 +387,7 @@ export default { this.goodsList = res.result.cartList; this.priceDetailDTO = res.result.priceDetailDTO; this.skuList = res.result.skuList; - + this.storeId = this.goodsList[0].storeId if (res.result.receiptVO) { this.invoiceData = res.result.receiptVO; } @@ -401,6 +424,7 @@ export default { this.selectedAddress = res.result.memberAddress; } this.getAddress(); + this.getStoreAddressList(); this.totalNum = 0; for (let i = 0; i < this.skuList.length; i++) { this.totalNum += this.skuList[i].num; @@ -475,8 +499,32 @@ export default { }; selectAddr(params).then((res) => { if (res.success) { - this.$Message.success("选择收货地址成功"); - this.selectedAddress = item; + this.$Message.success("选择配送方式成功"); + this.selectMethod = item; + this.getGoodsDetail(); + } + }); + }, + selectStoreAddress(item) { + console.log(item.id) + console.log(this.$route.query.way) + // 选择自提地址 + setStoreAddressId(item.id,this.$route.query.way).then((res) => { + if (res.success) { + this.$Message.success("选择自提地址成功"); + this.selectedStoreAddress = item; + this.getGoodsDetail(); + } + }); + }, + selectDeliverMethod(item) { + let params = { + way: this.$route.query.way, + shippingMethod: item.value, + }; + setShipMethod(params).then((res) => { + if (res.success) { + this.selectedDeliverMethod = item.value; this.getGoodsDetail(); } }); @@ -503,7 +551,7 @@ export default { } }); }, - onCancel: () => {}, + onCancel: () => { }, }); }, goGoodsDetail(skuId, goodsId) { @@ -605,9 +653,11 @@ export default {