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";