From a1fd5be5c47ca28cd987b27505e9ec4e8e56e8d7 Mon Sep 17 00:00:00 2001 From: mabo Date: Wed, 23 Jun 2021 10:45:05 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E6=8C=89=E9=92=AE=E4=B8=80=E7=9B=B4=E5=8A=A0?= =?UTF-8?q?=E8=BD=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/goodsDetail/ShowGoods.vue | 11 +- buyer/src/components/invoiceModal/index.vue | 155 +++---- buyer/src/pages/GoodsDetail.vue | 1 - buyer/src/pages/PointMall.vue | 4 +- buyer/src/pages/payment/Pay.vue | 383 ++++++++++++------ buyer/src/plugins/request.js | 105 +++-- seller/src/main.js | 2 +- 7 files changed, 397 insertions(+), 264 deletions(-) diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index a6c50be3..40bda016 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -126,7 +126,7 @@ - + @@ -199,13 +199,18 @@ export default { skuId: this.skuDetail.id }; this.loading = true; + console.log(11111111); addCartGoods(params).then(res => { + debugger; this.loading = false; if (res.success) { this.$router.push({path: '/shoppingCart', query: {detail: this.skuDetail, count: this.count}}); } else { this.$Message.warning(res.message); } + }).catch(() => { + console.log('catch'); + this.loading = false; }); }, buyNow () { // 立即购买 @@ -222,6 +227,8 @@ export default { } else { this.$Message.warning(res.message); } + }).catch(() => { + this.loading1 = false; }); }, pointPay () { // 积分购买 @@ -339,7 +346,7 @@ export default { } }) } - + this.formatSku(this.goodsSpecList); this.promotion() document.title = this.skuDetail.goodsName diff --git a/buyer/src/components/invoiceModal/index.vue b/buyer/src/components/invoiceModal/index.vue index e5394fa8..b3989fca 100644 --- a/buyer/src/components/invoiceModal/index.vue +++ b/buyer/src/components/invoiceModal/index.vue @@ -11,42 +11,37 @@ --> @@ -54,20 +49,21 @@ @@ -132,10 +132,10 @@ export default { color: $theme_color; } } + .selected-cate{ color: $theme_color; } - } .page-size { width: 1200px; diff --git a/buyer/src/pages/payment/Pay.vue b/buyer/src/pages/payment/Pay.vue index 0c91be7e..48ec2f7e 100644 --- a/buyer/src/pages/payment/Pay.vue +++ b/buyer/src/pages/payment/Pay.vue @@ -4,15 +4,23 @@ @@ -24,18 +32,35 @@ 管理收货人地址
-
+
- {{item.name}} + {{ item.name }} 默认 - {{item.alias}} + {{ + item.alias + }} +
+
{{ item.mobile }}
+
+ {{ item.consigneeAddressPath | unitAddress }} {{ item.detail }}
-
{{item.mobile}}
-
{{ item.consigneeAddressPath | unitAddress }} {{item.detail}}
修改 - 删除 + 删除
@@ -48,8 +73,12 @@
-
- {{moreAddr ? '收起地址' : '更多地址'}} +
+ {{ moreAddr ? "收起地址" : "更多地址" }}
@@ -60,10 +89,17 @@ 商品信息 返回购物车
-
+
- {{shop.storeName}}   + {{ + shop.storeName + }}  
-
- - - {{goods.goodsSku.goodsName}} +
+ + + {{ + goods.goodsSku.goodsName + }} - {{goods.goodsSku.price | unitPrice('¥')}} - x{{goods.num}} - {{goods.goodsSku.quantity > 0 ? '有货' : '无货'}} - {{goods.goodsSku.price * goods.num | unitPrice('¥')}} + {{ + goods.goodsSku.price | unitPrice("¥") + }} + x{{ goods.num }} + {{ goods.goodsSku.quantity > 0 ? "有货" : "无货" }} + {{ + (goods.goodsSku.price * goods.num) | unitPrice("¥") + }}
- - 提示:请勿填写有关支付、收货、发票方面的信息 + + 提示:请勿填写有关支付、收货、发票方面的信息
- 发票信息 - 开企业抬头发票须填写纳税人识别号,以免影响报销 - + 发票信息 + 开企业抬头发票须填写纳税人识别号,以免影响报销 +
- {{invoiceData.receiptTitle}} - {{invoiceData.receiptContent}} + {{ invoiceData.receiptTitle }} + {{ invoiceData.receiptContent }} 编辑
@@ -108,24 +171,49 @@
优惠券
-
- 无可用优惠券 -
+
无可用优惠券
    -
  • +
  • - {{item.price | unitPrice}} - {{item.couponDiscount}} - 满{{item.consumeThreshold}}元可用 + {{ + item.price | unitPrice + }} + {{ item.couponDiscount }} + 满{{ item.consumeThreshold }}元可用
    -

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

    -

    有效期:{{item.endTime}}

    +

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

    +

    有效期:{{ item.endTime }}

    - + 立即使用 - 放弃优惠 + 放弃优惠
  • @@ -138,81 +226,116 @@
- 使用积分: 您当前的可用积分为 {{otherMsgForm.totalPoint}} - ,本订单最多可以使用{{otherMsgForm.availablePoint}} + 使用积分: + 您当前的可用积分为 + {{ otherMsgForm.totalPoint }} ,本订单最多可以使用{{ + otherMsgForm.availablePoint + }}
- {{totalNum}}件商品,总商品金额:{{priceDetailDTO.goodsPrice | unitPrice('¥')}} + {{ totalNum }}件商品,总商品金额:{{ priceDetailDTO.goodsPrice | unitPrice("¥") }}
- 运费:{{ priceDetailDTO.freightPrice | unitPrice('¥')}} + 运费:{{ priceDetailDTO.freightPrice | unitPrice("¥") }}
- 优惠金额:-{{ priceDetailDTO.discountPrice + priceDetailDTO.couponPrice + priceDetailDTO.updatePrice | unitPrice('¥')}} + 优惠金额:-{{ + (priceDetailDTO.discountPrice + + priceDetailDTO.couponPrice + + priceDetailDTO.updatePrice) + | unitPrice("¥") + }}
- 应付金额:{{priceDetailDTO.billPrice | unitPrice('¥')}} + 应付金额:{{ + priceDetailDTO.billPrice | unitPrice("¥") + }}
-
- + - + diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index b937df34..727ab21f 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -1,27 +1,27 @@ // import Vue from 'vue'; -import axios from "axios"; -import https from "https"; -import { Message, Spin, Modal } from "view-design"; -import Storage from "./storage"; -import config from "@/config"; -import router from "../router/index.js"; -import store from "../vuex/store"; -import { handleRefreshToken } from "@/api/index"; -const qs = require("qs"); +import axios from 'axios'; +import https from 'https'; +import { Message, Spin, Modal } from 'view-design'; +import Storage from './storage'; +import config from '@/config'; +import router from '../router/index.js'; +import store from '../vuex/store'; +import { handleRefreshToken } from '@/api/index'; +const qs = require('qs'); export const buyerUrl = - process.env.NODE_ENV === "development" + process.env.NODE_ENV === 'development' ? config.api_dev.buyer : config.api_prod.buyer; export const commonUrl = - process.env.NODE_ENV === "development" + process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common; export const managerUrl = - process.env.NODE_ENV === "development" + process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager; export const sellerUrl = - process.env.NODE_ENV === "development" + process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller; // 创建axios实例 @@ -35,7 +35,7 @@ const service = axios.create({ }), paramsSerializer: params => qs.stringify(params, { - arrayFormat: "repeat" + arrayFormat: 'repeat' }) }); @@ -44,15 +44,15 @@ service.interceptors.request.use( config => { const { loading } = config; // 如果是put/post请求,用qs.stringify序列化参数 - const isPutPost = config.method === "put" || config.method === "post"; - const isJson = config.headers["Content-Type"] === "application/json"; - const isFile = config.headers["Content-Type"] === "multipart/form-data"; + const isPutPost = config.method === 'put' || config.method === 'post'; + const isJson = config.headers['Content-Type'] === 'application/json'; + const isFile = config.headers['Content-Type'] === 'multipart/form-data'; if (isPutPost && isJson) { config.data = JSON.stringify(config.data); } if (isPutPost && !isFile && !isJson) { config.data = qs.stringify(config.data, { - arrayFormat: "repeat" + arrayFormat: 'repeat' }); } /** 配置全屏加载 */ @@ -60,16 +60,16 @@ service.interceptors.request.use( config.loading = Spin.show(); } - const uuid = Storage.getItem("uuid"); - config.headers["uuid"] = uuid; + const uuid = Storage.getItem('uuid'); + config.headers['uuid'] = uuid; // 获取访问Token - let accessToken = Storage.getItem("accessToken"); + let accessToken = Storage.getItem('accessToken'); if (accessToken && config.needToken) { - config.headers["accessToken"] = accessToken; + config.headers['accessToken'] = accessToken; // 解析当前token时间 let jwtData = JSON.parse( - decodeURIComponent(escape(window.atob(accessToken.split(".")[1]))) + decodeURIComponent(escape(window.atob(accessToken.split('.')[1]))) ); if (jwtData.exp < Math.round(new Date() / 1000)) { refresh() @@ -83,33 +83,32 @@ service.interceptors.request.use( } ); -async function refresh() { +async function refresh (error) { const getTokenRes = await refreshToken(); - if (getTokenRes === "success") { + if (getTokenRes === 'success') { // 刷新token if (isRefreshToken === 1) { error.response.config.headers.accessToken = Storage.getItem( - "accessToken" + 'accessToken' ); return service(error.response.config); } else { router.go(0); } } else { - Storage.removeItem("accessToken"); - Storage.removeItem("refreshToken"); - Storage.removeItem("userInfo"); - Storage.setItem("cartNum", 0); - store.commit("SET_CARTNUM", 0); - console.log("1111"); + Storage.removeItem('accessToken'); + Storage.removeItem('refreshToken'); + Storage.removeItem('userInfo'); + Storage.setItem('cartNum', 0); + store.commit('SET_CARTNUM', 0); Modal.confirm({ - title: "请登录", - content: "

请登录后执行此操作

", - okText: "立即登录", - cancelText: "继续浏览", + title: '请登录', + content: '

请登录后执行此操作

', + okText: '立即登录', + cancelText: '继续浏览', onOk: () => { router.push({ - path: "/login", + path: '/login', query: { rePath: router.history.current.path, query: JSON.stringify(router.history.current.query) @@ -140,15 +139,15 @@ service.interceptors.response.use( isRefreshToken++; if (isRefreshToken === 1) { - refresh() + refresh(error) isRefreshToken = 0; } } else { if (error.message) { let _message = - error.code === "ECONNABORTED" - ? "连接超时,请稍候再试!" - : "网络错误,请稍后再试!"; + error.code === 'ECONNABORTED' + ? '连接超时,请稍候再试!' + : '网络错误,请稍后再试!'; Message.error(errorData.message || _message); } } @@ -171,13 +170,13 @@ const closeLoading = target => { }; export const Method = { - GET: "get", - POST: "post", - PUT: "put", - DELETE: "delete" + GET: 'get', + POST: 'post', + PUT: 'put', + DELETE: 'delete' }; -export default function request(options) { +export default function request (options) { // 如果是服务端或者是请求的刷新token,不需要检查token直接请求。 // if (process.server || options.url.indexOf('passport/token') !== -1) { return service(options); @@ -186,19 +185,19 @@ export default function request(options) { } // 防抖闭包来一波 -function getTokenDebounce() { +function getTokenDebounce () { let lock = false; let success = false; - return function() { + return function () { if (!lock) { lock = true; - let oldRefreshToken = Storage.getItem("refreshToken"); + let oldRefreshToken = Storage.getItem('refreshToken'); handleRefreshToken(oldRefreshToken) .then(res => { if (res.success) { let { accessToken, refreshToken } = res.result; - Storage.setItem("accessToken", accessToken); - Storage.setItem("refreshToken", refreshToken); + Storage.setItem('accessToken', accessToken); + Storage.setItem('refreshToken', refreshToken); success = true; lock = false; @@ -220,9 +219,9 @@ function getTokenDebounce() { if (!lock) { clearInterval(timer); if (success) { - resolve("success"); + resolve('success'); } else { - resolve("fail"); + resolve('fail'); } } }, 500); // 轮询时间间隔 diff --git a/seller/src/main.js b/seller/src/main.js index 094434c9..c73b4bbc 100644 --- a/seller/src/main.js +++ b/seller/src/main.js @@ -5,7 +5,7 @@ import ViewUI from "view-design"; import "./styles/theme.less"; import "core-js/stable"; -import "regenerator-runtime/runtime"; +// import "regenerator-runtime/runtime"; import vueQr from 'vue-qr' import App from "./App"; From d5c96f66cedb752cf7ee1c4a995c0411773d1d26 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 23 Jun 2021 11:34:56 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/views/promotion/live/live.vue | 15 ++++----- seller/src/views/goods/goods-seller/goods.vue | 27 ++------------- seller/src/views/logistics/index.vue | 13 +++----- seller/src/views/member/memberComment.vue | 18 +++++----- .../order/after-order/orderComplaint.vue | 12 +++---- .../order/after-order/returnGoodsOrder.vue | 30 ++++++++--------- .../order/after-order/returnMoneyOrder.vue | 26 +++++---------- seller/src/views/order/order/orderList.vue | 14 ++++---- .../views/order/order/virtualOrderList.vue | 14 ++++---- .../views/order/receiptManager/receipt.vue | 33 ++++++++----------- .../views/shop/bill/accountStatementBill.vue | 14 ++++---- seller/src/views/shop/bill/storeBill.vue | 14 ++++---- seller/src/views/shop/ship/logistics.vue | 8 ++--- 13 files changed, 95 insertions(+), 143 deletions(-) diff --git a/manager/src/views/promotion/live/live.vue b/manager/src/views/promotion/live/live.vue index b7d7498c..da943fd3 100644 --- a/manager/src/views/promotion/live/live.vue +++ b/manager/src/views/promotion/live/live.vue @@ -119,14 +119,13 @@ export default { { title: "直播状态", render: (h, params) => { - return h( - "span", - params.row.status == "NEW" - ? "未开始" - : params.row.status == "START" - ? "直播中" - : "已结束" - ); + if(params.row.status == "NEW"){ + return h("div", [h("tag", {props: {color: "blue"}}, "未开始")]); + }else if(params.row.status == "START"){ + return h("div", [h("tag", {props: {color: "green"}}, "直播中")]); + }else{ + return h("div", [h("tag", {props: {color: "volcano"}}, "已结束")]); + } }, }, { diff --git a/seller/src/views/goods/goods-seller/goods.vue b/seller/src/views/goods/goods-seller/goods.vue index df95601d..de865194 100644 --- a/seller/src/views/goods/goods-seller/goods.vue +++ b/seller/src/views/goods/goods-seller/goods.vue @@ -170,32 +170,11 @@ export default { width: 130, render: (h, params) => { if (params.row.isAuth == "TOBEAUDITED") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "待审核", - }, - }), - ]); + return h("Tag", {props: {color: "blue",},},"待审核"); } else if (params.row.isAuth == "PASS") { - return h("div", [ - h("Badge", { - props: { - status: "success", - text: "审核通过", - }, - }), - ]); + return h("Tag", {props: {color: "green",},},"通过"); } else if (params.row.isAuth == "REFUSE") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "审核拒绝", - }, - }), - ]); + return h("Tag", {props: {color: "red",},},"审核拒绝"); } }, }, diff --git a/seller/src/views/logistics/index.vue b/seller/src/views/logistics/index.vue index a8e7bc91..d773df85 100644 --- a/seller/src/views/logistics/index.vue +++ b/seller/src/views/logistics/index.vue @@ -134,21 +134,18 @@ export default { key: "name", minWidth: 120 }, - { title: "状态", key: "disabled", minWidth: 50, render(h, params) { - return h("Badge", { - props: { - status: params.row.disabled ? "success" : "error", - text: params.row.disabled ? "开启" : "关闭", - }, - }); + if(params.row.disabled){ + return h("div", [h("tag", {props: {color: "green"}}, "开启")]); + }else{ + return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]); + } }, }, - { title: "操作", key: "action", diff --git a/seller/src/views/member/memberComment.vue b/seller/src/views/member/memberComment.vue index c4eb28ff..e0c1f486 100644 --- a/seller/src/views/member/memberComment.vue +++ b/seller/src/views/member/memberComment.vue @@ -210,11 +210,11 @@ export default { width: 100, render: (h, params) => { if (params.row.grade == "GOOD") { - return h("Badge", {props: {status: "success", text: "好评"}}) + return h("Tag", {props: {color: "green",},}, "好评"); } else if (params.row.grade == "MODERATE") { - return h("Badge", {props: {status: "success", text: "中评"}}) - } else if (params.row.grade == "WORSE") { - return h("Badge", {props: {status: "error", text: "差评"}}) + return h("Tag", {props: {color: "orange",},}, "中评"); + } else { + return h("Tag", {props: {color: "red",},}, "差评"); } } }, @@ -224,9 +224,9 @@ export default { width: 100, render: (h, params) => { if (params.row.status === "OPEN") { - return h("Badge", {props: {status: "success", text: "展示"}}) + return h("Tag", {props: {color: "green"}},"展示") } else { - return h("Badge", {props: {status: "error", text: "隐藏"}}) + return h("Tag", {props: {color: "red"}},"隐藏") } }, }, @@ -236,9 +236,9 @@ export default { width: 110, render: (h, params) => { if (params.row.replyStatus) { - return h("Badge", {props: {status: "success", text: "已回复"}}) + return h("Tag", {props: {color: "green"}},"已回复") } else { - return h("Badge", {props: {status: "error", text: "未回复"}}) + return h("Tag", {props: {color: "blue"}},"未回复") } }, }, @@ -334,7 +334,7 @@ export default { this.loading = false; if (res.success) { this.data = res.result.records; - this.total = res.result.total; + this.total = res.result.total; } }); }, diff --git a/seller/src/views/order/after-order/orderComplaint.vue b/seller/src/views/order/after-order/orderComplaint.vue index 0b3f8fcf..3e606386 100644 --- a/seller/src/views/order/after-order/orderComplaint.vue +++ b/seller/src/views/order/after-order/orderComplaint.vue @@ -185,17 +185,17 @@ key: "complainStatus", render: (h, params) => { if (params.row.complainStatus == "NEW") { - return h('div', [h('span', { }, '新投诉'),]); + return h('div', [h('tag',{props: {color: "purple"}}, '新投诉'),]); } else if (params.row.complainStatus == "CANCEL") { - return h('div', [h('span', { }, '已撤销'),]); + return h('div', [h('tag', {props: {color: "cyan"}}, '已撤销'),]); } else if (params.row.complainStatus == "WAIT_APPEAL") { - return h('div', [h('span', { }, '待申诉'),]); + return h('div', [h('tag', {props: {color: "volcano"}}, '待申诉'),]); } else if (params.row.complainStatus == "COMMUNICATION") { - return h('div', [h('span', { }, '对话中'),]); + return h('div', [h('tag', {props: {color: "orange"}}, '对话中'),]); }else if (params.row.complainStatus == "WAIT_ARBITRATION") { - return h('div', [h('span', { }, '等待仲裁'),]); + return h('div', [h('tag', {props: {color: "blue"}}, '等待仲裁'),]); }else if (params.row.complainStatus == "COMPLETE") { - return h('div', [h('span', { }, '已完成'),]); + return h('div', [h('tag', {props: {color: "green"}}, '已完成'),]); } } }, diff --git a/seller/src/views/order/after-order/returnGoodsOrder.vue b/seller/src/views/order/after-order/returnGoodsOrder.vue index 297ffb39..1842d8ed 100644 --- a/seller/src/views/order/after-order/returnGoodsOrder.vue +++ b/seller/src/views/order/after-order/returnGoodsOrder.vue @@ -176,25 +176,23 @@ width: 120, render: (h, params) => { if (params.row.serviceStatus == "APPLY") { - return h('div', [h('span', { }, '申请售后'),]); + return h('div', [h('tag', {props: {color: "blue"}}, '申请中'),]); } else if (params.row.serviceStatus == "PASS") { - return h('div', [h('span', { }, '审核通过'),]); + return h('div', [h('tag', {props: {color: "cyan"}}, '通过售后'),]); } else if (params.row.serviceStatus == "REFUSE") { - return h('div', [h('span', { }, '审核拒绝'),]); + return h('div', [h('tag', {props: {color: "volcano"}}, '拒绝售后'),]); } else if (params.row.serviceStatus == "BUYER_RETURN") { - return h('div', [h('span', { }, '买家退货,待卖家收货'),]); - }else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") { - return h('div', [h('span', { }, '商家换货/补发'),]); - }else if (params.row.serviceStatus == "SELLER_CONFIRM") { - return h('div', [h('span', { }, '卖家确认收货'),]); - }else if (params.row.serviceStatus == "SELLER_TERMINATION") { - return h('div', [h('span', { }, '卖家终止售后'),]); - }else if (params.row.serviceStatus == "BUYER_CONFIRM") { - return h('div', [h('span', { }, '买家确认收货'),]); - }else if (params.row.serviceStatus == "BUYER_CANCEL") { - return h('div', [h('span', { }, '买家取消售后'),]); - }else if (params.row.serviceStatus == "COMPLETE") { - return h('div', [h('span', { }, '完成'),]); + return h('div', [h('tag', {props: {color: "orange"}}, '买家退货,待卖家收货'),]); + } else if (params.row.serviceStatus == "SELLER_CONFIRM") { + return h('div', [h('tag', {props: {color: "gold"}}, '卖家确认收货'),]); + } else if (params.row.serviceStatus == "SELLER_TERMINATION") { + return h('div', [h('tag', {props: {color: "lime"}}, '卖家终止售后'),]); + } else if (params.row.serviceStatus == "BUYER_CANCEL") { + return h('div', [h('tag', {props: {color: "purple"}}, '买家取消售后'),]); + } else if (params.row.serviceStatus == "COMPLETE") { + return h('div', [h('tag', {props: {color: "green"}}, '完成售后'),]); + }else if (params.row.serviceStatus == "WAIT_REFUND") { + return h('div', [h('tag', {props: {color: "geekblue"}}, '待平台退款'),]); } } }, diff --git a/seller/src/views/order/after-order/returnMoneyOrder.vue b/seller/src/views/order/after-order/returnMoneyOrder.vue index cc41f994..10a51621 100644 --- a/seller/src/views/order/after-order/returnMoneyOrder.vue +++ b/seller/src/views/order/after-order/returnMoneyOrder.vue @@ -182,27 +182,17 @@ minWidth: 120, render: (h, params) => { if (params.row.serviceStatus == "APPLY") { - return h('div', [h('span', { }, '申请售后'),]); + return h('div', [h('tag', {props: {color: "blue"}}, '申请中'),]); } else if (params.row.serviceStatus == "PASS") { - return h('div', [h('span', { }, '审核通过'),]); + return h('div', [h('tag', {props: {color: "cyan"}}, '通过售后'),]); } else if (params.row.serviceStatus == "REFUSE") { - return h('div', [h('span', { }, '审核拒绝'),]); - } else if (params.row.serviceStatus == "BUYER_RETURN") { - return h('div', [h('span', { }, '买家退货,待卖家收货'),]); - }else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") { - return h('div', [h('span', { }, '商家换货/补发'),]); - }else if (params.row.serviceStatus == "SELLER_CONFIRM") { - return h('div', [h('span', { }, '卖家确认收货'),]); - }else if (params.row.serviceStatus == "SELLER_TERMINATION") { - return h('div', [h('span', { }, '卖家终止售后'),]); - }else if (params.row.serviceStatus == "BUYER_CONFIRM") { - return h('div', [h('span', { }, '买家确认收货'),]); - }else if (params.row.serviceStatus == "BUYER_CANCEL") { - return h('div', [h('span', { }, '买家取消售后'),]); + return h('div', [h('tag', {props: {color: "volcano"}}, '拒绝售后'),]); + } else if (params.row.serviceStatus == "BUYER_CANCEL") { + return h('div', [h('tag', {props: {color: "purple"}}, '买家取消售后'),]); + } else if (params.row.serviceStatus == "COMPLETE") { + return h('div', [h('tag', {props: {color: "green"}}, '完成售后'),]); }else if (params.row.serviceStatus == "WAIT_REFUND") { - return h('div', [h('span', { }, '等待平台退款'),]); - }else if (params.row.serviceStatus == "COMPLETE") { - return h('div', [h('span', { }, '完成'),]); + return h('div', [h('tag', {props: {color: "geekblue"}}, '待平台退款'),]); } } }, diff --git a/seller/src/views/order/order/orderList.vue b/seller/src/views/order/order/orderList.vue index 4bc99a0b..76303816 100644 --- a/seller/src/views/order/order/orderList.vue +++ b/seller/src/views/order/order/orderList.vue @@ -126,19 +126,19 @@ export default { minWidth: 100, render: (h, params) => { if (params.row.orderStatus == "UNPAID") { - return h("div", [h("span", {}, "未付款")]); + return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]); } else if (params.row.orderStatus == "PAID") { - return h("div", [h("span", {}, "已付款")]); + return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]); } else if (params.row.orderStatus == "UNDELIVERED") { - return h("div", [h("span", {}, "待发货")]); + return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]); } else if (params.row.orderStatus == "DELIVERED") { - return h("div", [h("span", {}, "已发货")]); + return h("div", [h("tag", {props: {color: "cyan"}}, "已发货")]); } else if (params.row.orderStatus == "COMPLETED") { - return h("div", [h("span", {}, "已完成")]); + return h("div", [h("tag", {props: {color: "green"}}, "已完成")]); } else if (params.row.orderStatus == "TAKE") { - return h("div", [h("span", {}, "待核验")]); + return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]); } else if (params.row.orderStatus == "CANCELLED") { - return h("div", [h("span", {}, "已取消")]); + return h("div", [h("tag", {props: {color: "red"}}, "已取消")]); } }, }, diff --git a/seller/src/views/order/order/virtualOrderList.vue b/seller/src/views/order/order/virtualOrderList.vue index a95e5875..513160da 100644 --- a/seller/src/views/order/order/virtualOrderList.vue +++ b/seller/src/views/order/order/virtualOrderList.vue @@ -135,19 +135,19 @@ export default { minWidth: 100, render: (h, params) => { if (params.row.orderStatus == "UNPAID") { - return h("div", [h("span", {}, "未付款")]); + return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]); } else if (params.row.orderStatus == "PAID") { - return h("div", [h("span", {}, "已付款")]); + return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]); } else if (params.row.orderStatus == "UNDELIVERED") { - return h("div", [h("span", {}, "待发货")]); + return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]); } else if (params.row.orderStatus == "DELIVERED") { - return h("div", [h("span", {}, "已发货")]); + return h("div", [h("tag", {props: {color: "cyan"}}, "已发货")]); } else if (params.row.orderStatus == "COMPLETED") { - return h("div", [h("span", {}, "已完成")]); + return h("div", [h("tag", {props: {color: "green"}}, "已完成")]); } else if (params.row.orderStatus == "TAKE") { - return h("div", [h("span", {}, "待核验")]); + return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]); } else if (params.row.orderStatus == "CANCELLED") { - return h("div", [h("span", {}, "已取消")]); + return h("div", [h("tag", {props: {color: "red"}}, "已取消")]); } }, }, diff --git a/seller/src/views/order/receiptManager/receipt.vue b/seller/src/views/order/receiptManager/receipt.vue index d03ff3eb..6a90eb37 100644 --- a/seller/src/views/order/receiptManager/receipt.vue +++ b/seller/src/views/order/receiptManager/receipt.vue @@ -161,17 +161,10 @@ tooltip: true, render: (h, params) => { if(params.row.receiptStatus == 0){ - return h( - "div", - "未开票" - ); + return h("div", [h("tag", {props: {color: "volcano"}}, "未开票")]); }else{ - return h( - "div", - "已开票" - ); + return h("div", [h("tag", {props: {color: "green"}}, "未开票")]); } - }, }, { @@ -180,19 +173,19 @@ width: 90, render: (h, params) => { if (params.row.orderStatus == "UNPAID") { - return h('div', [h('span', { }, '未付款'),]); + return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]); } else if (params.row.orderStatus == "PAID") { - return h('div', [h('span', { }, '已付款'),]); + return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]); } else if (params.row.orderStatus == "UNDELIVERED") { - return h('div', [h('span', { }, '待发货'),]); - }else if (params.row.orderStatus == "DELIVERED") { - return h('div', [h('span', { }, '已发货'),]); - }else if (params.row.orderStatus == "COMPLETED") { - return h('div', [h('span', { }, '已完成'),]); - }else if (params.row.orderStatus == "TAKE") { - return h('div', [h('span', { }, '待核验'),]); - }else if (params.row.orderStatus == "CANCELLED") { - return h('div', [h('span', { }, '已取消'),]); + return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]); + } else if (params.row.orderStatus == "DELIVERED") { + return h("div", [h("tag", {props: {color: "cyan"}}, "已发货")]); + } else if (params.row.orderStatus == "COMPLETED") { + return h("div", [h("tag", {props: {color: "green"}}, "已完成")]); + } else if (params.row.orderStatus == "TAKE") { + return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]); + } else if (params.row.orderStatus == "CANCELLED") { + return h("div", [h("tag", {props: {color: "red"}}, "已取消")]); } } }, diff --git a/seller/src/views/shop/bill/accountStatementBill.vue b/seller/src/views/shop/bill/accountStatementBill.vue index e944f432..8fa895ba 100644 --- a/seller/src/views/shop/bill/accountStatementBill.vue +++ b/seller/src/views/shop/bill/accountStatementBill.vue @@ -132,15 +132,13 @@ width: 100, render: (h, params) => { if (params.row.billStatus == "OUT") { - return h( "Badge", {props: { status: "success",text: "已出账" } }) - } else if (params.row.billStatus == "EXAMINE") { - return h( "Badge", {props: { status: "success",text: "已审核" } }) + return h("Tag", {props: {color: "blue",},},"已出账"); } else if (params.row.billStatus == "CHECK") { - return h( "Badge", {props: { status: "success",text: "已对账" } }) - } else if (params.row.billStatus == "PAY") { - return h( "Badge", {props: { status: "success",text: "已付款" } }) - }else if (params.row.billStatus == "COMPLETE") { - return h( "Badge", {props: { status: "success",text: "已完成" } }) + return h("Tag", {props: {color: "geekblue",},},"已对账"); + } else if (params.row.billStatus == "EXAMINE") { + return h("Tag", {props: {color: "purple",},},"已审核"); + } else { + return h("Tag", {props: {color: "green",},},"已付款"); } } }, diff --git a/seller/src/views/shop/bill/storeBill.vue b/seller/src/views/shop/bill/storeBill.vue index 1797db66..035c76c8 100644 --- a/seller/src/views/shop/bill/storeBill.vue +++ b/seller/src/views/shop/bill/storeBill.vue @@ -143,15 +143,13 @@ width: 100, render: (h, params) => { if (params.row.billStatus == "OUT") { - return h( "Badge", {props: { status: "success",text: "已出账" } }) - } else if (params.row.billStatus == "EXAMINE") { - return h( "Badge", {props: { status: "success",text: "已审核" } }) + return h("Tag", {props: {color: "blue",},},"已出账"); } else if (params.row.billStatus == "CHECK") { - return h( "Badge", {props: { status: "success",text: "已对账" } }) - } else if (params.row.billStatus == "PAY") { - return h( "Badge", {props: { status: "success",text: "已付款" } }) - }else if (params.row.billStatus == "COMPLETE") { - return h( "Badge", {props: { status: "success",text: "已完成" } }) + return h("Tag", {props: {color: "geekblue",},},"已对账"); + } else if (params.row.billStatus == "EXAMINE") { + return h("Tag", {props: {color: "purple",},},"已审核"); + } else { + return h("Tag", {props: {color: "green",},},"已付款"); } } }, diff --git a/seller/src/views/shop/ship/logistics.vue b/seller/src/views/shop/ship/logistics.vue index 94fe169e..c9479e2d 100644 --- a/seller/src/views/shop/ship/logistics.vue +++ b/seller/src/views/shop/ship/logistics.vue @@ -58,10 +58,10 @@ minWidth: 120, sortable: true, render: (h, params) => { - if (params.row.selected === null || params.row.selected === "") { - return h( "Badge", {props: { status: "error",text: "关闭" } }) - } else if (params.row.selected !== "") { - return h( "Badge", {props: { status: "success",text: "开启" } }) + if(params.row.selected === null || params.row.selected === ""){ + return h("div", [h("tag", {props: {color: "volcano"}}, "关闭")]); + }else{ + return h("div", [h("tag", {props: {color: "green"}}, "开启")]); } } }, From c3264314072b6839401e73475e4d127dc2bbe2e3 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 23 Jun 2021 11:46:38 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seller/src/views/goods/goods-seller/goods.vue | 53 +++---------------- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/seller/src/views/goods/goods-seller/goods.vue b/seller/src/views/goods/goods-seller/goods.vue index de865194..48bae50e 100644 --- a/seller/src/views/goods/goods-seller/goods.vue +++ b/seller/src/views/goods/goods-seller/goods.vue @@ -239,11 +239,11 @@ export default { width: 130, render: (h, params) => { if (params.row.goodsType === 'PHYSICAL_GOODS') { - return h("div", "实物商品"); + return h("Tag", {props: {color: "geekblue"}},"实物商品"); } else if (params.row.goodsType === 'VIRTUAL_GOODS') { - return h("div", "虚拟商品"); + return h("Tag", {props: {color: "purple"}},"虚拟商品"); } else { - return h("div", "电子卡券"); + return h("Tag", {props: {color: "cyan"}},"电子卡券"); } }, }, @@ -276,32 +276,11 @@ export default { width: 120, render: (h, params) => { if (params.row.isAuth == "PASS") { - return h("div", [ - h("Badge", { - props: { - status: "success", - text: "审核通过", - }, - }), - ]); + return h("Tag", {props: {color: "green"}},"通过"); } else if (params.row.isAuth == "TOBEAUDITED") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "待审核", - }, - }), - ]); + return h("Tag", {props: {color: "volcano"}},"待审核"); } else if (params.row.isAuth == "REFUSE") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "审核拒绝", - }, - }), - ]); + return h("Tag", {props: {color: "red"}},"审核拒绝"); } }, }, @@ -312,28 +291,12 @@ export default { sortable: false, render: (h, params) => { if (params.row.marketEnable == "DOWN") { - return h("div", [ - h("Badge", { - props: { - status: "error", - text: "下架", - }, - }), - ]); + return h("Tag", {props: {color: "red"}},"下架"); } else if (params.row.marketEnable == "UPPER") { - return h("div", [ - h("Badge", { - props: { - status: "success", - text: "上架", - }, - }), - ]); - } else { + return h("Tag", {props: {color: "green"}},"上架"); } }, }, - { title: "操作", key: "action", From 8032f3bda1a4fbcea539d2ff7940d86667fca50c Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 23 Jun 2021 16:48:43 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=88=86=E7=B1=BB=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/api/goods.js | 15 +- .../src/views/goods/goods-manage/category.vue | 1 - manager/src/views/goods/goods-manage/spec.vue | 156 +++++++----------- 3 files changed, 60 insertions(+), 112 deletions(-) diff --git a/manager/src/api/goods.js b/manager/src/api/goods.js index 4b02cd15..13a4a41a 100644 --- a/manager/src/api/goods.js +++ b/manager/src/api/goods.js @@ -76,15 +76,15 @@ export const disableCategory = (id, type) => { // 获取商品规格分页列表 export const getSpecListData = (params) => { - return getRequest('/goods/spec/page', params) + return getRequest('/goods/spec', params) } // 添加或修改规格设置 export const insertSpec = (params) => { return postRequest('/goods/spec', params) } // 添加或修改规格设置 -export const updateSpec = (params) => { - return putRequest('/goods/spec', params) +export const updateSpec = (id,params) => { + return putRequest(`/goods/spec/${id}`, params) } //根据分类id获取关联规格 export const getCategorySpecListData = (category_id, params) => { @@ -94,15 +94,6 @@ export const getCategorySpecListData = (category_id, params) => { export const delSpec = (id, params) => { return deleteRequest(`/goods/spec/${id}`, params) } -// 获取商品规格值列表 -export const getSpecValuesListData = (id, params) => { - return getRequest(`/goods/specValues/values/${id}`, params) -} -// 添加商品规格值 -export const saveSpecValues = (id, params) => { - return postRequest(`/goods/specValues/save/${id}`, params) -} - // 查询某分类下的全部子分类列表 export const getGoodsCategory = (parent_id) => { diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index 1bcc3217..deacb087 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -261,7 +261,6 @@ export default { getCategorySpecListData(v.id).then((res) => { this.categoryId = v.id; this.modalSpecTitle = "规格关联"; - console.log(res); this.specForm.categorySpecs = res.map((item) => item.id); this.modalSpecVisible = true; }); diff --git a/manager/src/views/goods/goods-manage/spec.vue b/manager/src/views/goods/goods-manage/spec.vue index 701554d8..b6cdfa3e 100644 --- a/manager/src/views/goods/goods-manage/spec.vue +++ b/manager/src/views/goods/goods-manage/spec.vue @@ -23,8 +23,8 @@ - - + + - + + + +
-
- - -
- - -
- - 提交 +
@@ -118,10 +98,9 @@ import { getSpecListData, insertSpec, updateSpec, - delSpec, - getSpecValuesListData, - saveSpecValues, + delSpec } from "@/api/goods"; + export default { name: "spec", components: {}, @@ -131,7 +110,6 @@ export default { modalType: 0, // 添加或编辑标识 modalVisible: false, // 添加或编辑显示 modalTitle: "", // 添加或编辑标题 - dialogSpecValuesVisible: false, // 添加或编辑规格值 specTitle: "", // 添加或编辑规格值 searchForm: { // 搜索框初始化对象 @@ -145,9 +123,8 @@ export default { specName: "", specValue: "", }, - specForm: {}, /** 编辑规格值 */ - specValues: [], + specValue: [], // 表单验证规则 formValidate: {}, submitLoading: false, // 添加或编辑提交状态 @@ -179,24 +156,7 @@ export default { width: 250, render: (h, params) => { return h("div", [ - h( - "Button", - { - props: { - type: "primary", - size: "small", - }, - style: { - marginRight: "5px", - }, - on: { - click: () => { - this.editSpec(params.row); - }, - }, - }, - "编辑规格值" - ), + h( "Button", { @@ -239,23 +199,28 @@ export default { }; }, methods: { + //初始化,获取数据 init() { this.getDataList(); }, + //修改分页 changePage(v) { this.searchForm.pageNumber = v; this.getDataList(); this.clearSelectAll(); }, + //修改页面大小 changePageSize(v) { this.searchForm.pageSize = v; this.getDataList(); }, + //搜索参数 handleSearch() { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 10; this.getDataList(); }, + //重置搜索参数 handleReset() { this.$refs.searchForm.resetFields(); this.searchForm.pageNumber = 1; @@ -263,6 +228,7 @@ export default { // 重新加载数据 this.getDataList(); }, + //更改排序 changeSort(e) { this.searchForm.sort = e.key; this.searchForm.order = e.order; @@ -271,36 +237,27 @@ export default { } this.getDataList(); }, + //清除已选择 clearSelectAll() { this.$refs.table.selectAll(false); }, + //修改已选择 changeSelect(e) { this.selectList = e; this.selectCount = e.length; }, + //获取数据 getDataList() { this.loading = true; // 带多条件搜索参数获取表单数据 请自行修改接口 getSpecListData(this.searchForm).then((res) => { this.loading = false; - if (res.success) { - this.data = res.result.records; - this.total = res.result.total; - } + this.data = res.records; + this.total = res.total; }); this.loading = false; }, - submitSpecValuesForm() { - saveSpecValues(this.specForm.specId, this.specForm).then((res) => { - this.submitLoading = false; - if (res.success) { - this.$Message.success("规格值保存成功"); - this.getDataList(); - this.modalVisible = false; - this.dialogSpecValuesVisible = false; - } - }); - }, + //新增规格 saveSpec() { this.$refs.form.validate((valid) => { if (valid) { @@ -318,7 +275,7 @@ export default { }); } else { // 编辑 - updateSpec(this.form).then((res) => { + updateSpec(this.form.id, this.form).then((res) => { this.submitLoading = false; if (res.success) { this.$Message.success("操作成功"); @@ -330,6 +287,7 @@ export default { } }); }, + //弹出添加框 add() { this.modalType = 0; this.modalTitle = "添加"; @@ -337,31 +295,31 @@ export default { delete this.form.id; this.modalVisible = true; }, + //弹出编辑框 edit(v) { this.modalType = 1; this.modalTitle = "编辑"; - this.$refs.form.resetFields(); // 转换null为"" for (let attr in v) { if (v[attr] === null) { v[attr] = ""; } } - let str = JSON.stringify(v); - let data = JSON.parse(str); - this.form = data; + let localVal = v.specValue; + + this.form.specName = v.specName; + this.form.id = v.id; + this.form.specValue = v.specValue; + + if (localVal && localVal.indexOf("," > 0)) { + this.form.specValue = localVal.split(",") + this.specValue = this.form.specValue + this.$set(this, 'specValue', this.form.specValue) + } else { + this.specValue = []; + } this.modalVisible = true; }, - editSpec(v) { - getSpecValuesListData(v.id).then((res) => { - this.modalType = 1; - this.modalTitle = "编辑"; - this.specValues = res.result; - this.specForm.specValue = res.result.map(item => item.specValue) - this.specForm.specId = v.id; - this.dialogSpecValuesVisible = true; - }); - }, remove(v) { this.$Modal.confirm({ title: "确认删除", @@ -415,5 +373,5 @@ export default { }; From f2f2984c3e8d864a9c170366958920f044fc09c0 Mon Sep 17 00:00:00 2001 From: mabo Date: Wed, 23 Jun 2021 16:49:35 +0800 Subject: [PATCH 05/14] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/pages/GoodsList.vue | 2 +- buyer/src/plugins/request.js | 2 + manager/src/libs/axios.js | 10 +-- .../my-components/lili/upload-pic-thumb.vue | 83 +++++++++-------- seller/src/config/index.js | 16 ++-- seller/src/libs/axios.js | 10 +-- seller/src/libs/routerJson.js | 28 +++--- seller/src/router/router.js | 2 +- .../views/goods/goods-seller/addGoods.scss | 4 +- .../goods/goods-seller/goodsOperation.vue | 73 ++++----------- .../my-components/lili/upload-pic-thumb.vue | 90 ++++++++++--------- 11 files changed, 141 insertions(+), 179 deletions(-) diff --git a/buyer/src/pages/GoodsList.vue b/buyer/src/pages/GoodsList.vue index 718ae499..7020c2f4 100644 --- a/buyer/src/pages/GoodsList.vue +++ b/buyer/src/pages/GoodsList.vue @@ -69,7 +69,7 @@ >人评价
- {{ item.storeName }} + 自营{{ item.storeName }}
diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index 5a897bb0..c5457098 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -142,6 +142,8 @@ service.interceptors.response.use( refresh(error) isRefreshToken = 0; } + } else if (errorResponse.status === 404) { + // 避免刷新token时也提示报错信息 } else { if (error.message) { let _message = diff --git a/manager/src/libs/axios.js b/manager/src/libs/axios.js index 6bd6d6c1..5d8c68ec 100644 --- a/manager/src/libs/axios.js +++ b/manager/src/libs/axios.js @@ -64,14 +64,6 @@ service.interceptors.response.use( } return data; break; - case 403: - // 权限不足 - if (data.message !== null) { - Message.error(data.message); - } else { - Message.error("权限不足"); - } - break; case 500: // 系统异常 if (data.message !== null) { @@ -89,6 +81,8 @@ service.interceptors.response.use( if (error.response) { if (error.response.status === 401) { // 这种情况一般调到登录页 + } else if (error.response.status === 404) { + // 避免刷新token报错 } else if (error.response.status === 403) { isRefreshToken++; if(isRefreshToken === 1) { diff --git a/manager/src/views/my-components/lili/upload-pic-thumb.vue b/manager/src/views/my-components/lili/upload-pic-thumb.vue index d9583ca6..03ec4086 100644 --- a/manager/src/views/my-components/lili/upload-pic-thumb.vue +++ b/manager/src/views/my-components/lili/upload-pic-thumb.vue @@ -1,47 +1,48 @@