diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index a6c50be3..6380f86f 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -126,7 +126,7 @@ - + @@ -151,7 +151,7 @@ export default { count: 1, // 商品数量 imgIndex: 0, // 展示图片下标 currentSelceted: [], // 当前商品sku - imgList: this.detail.data.specList[0].specImage, // 商品图片列表 + imgList: this.detail.data.specList[0].specImage || [], // 商品图片列表 skuDetail: this.detail.data, // sku详情 goodsSpecList: this.detail.specs, // 商品spec promotionMap: { // 活动状态 @@ -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/forgetPassword.vue b/buyer/src/pages/forgetPassword.vue index 511cffb3..322c6e50 100644 --- a/buyer/src/pages/forgetPassword.vue +++ b/buyer/src/pages/forgetPassword.vue @@ -93,13 +93,13 @@
- 帮助 - 隐私 - 条款 + 帮助 + 隐私 + 条款 Copyright © 2020 - Present - lili-shop 版权所有 diff --git a/buyer/src/pages/home/orderCenter/MyOrder.vue b/buyer/src/pages/home/orderCenter/MyOrder.vue index c66c1ec5..fa03011e 100644 --- a/buyer/src/pages/home/orderCenter/MyOrder.vue +++ b/buyer/src/pages/home/orderCenter/MyOrder.vue @@ -29,7 +29,6 @@
{{ filterOrderStatus(order.orderStatus) }}
订单号:{{ order.sn }}      {{order.createTime}} -    {{ order.memberName | secrecyMobile }}
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 7d3233d5..c5457098 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -69,10 +69,10 @@ service.interceptors.request.use( config.headers['accessToken'] = accessToken; // 解析当前token时间 let jwtData = JSON.parse( - decodeURIComponent(escape(window.atob(accessToken.split('.')[1].replace(/-/g, '+').replace(/_/g, '/')))) + decodeURIComponent(escape(window.atob(accessToken.split('.')[1]))) ); if (jwtData.exp < Math.round(new Date() / 1000)) { - refresh() + refresh(config) } } @@ -83,7 +83,7 @@ service.interceptors.request.use( } ); -async function refresh () { +async function refresh (error) { const getTokenRes = await refreshToken(); if (getTokenRes === 'success') { // 刷新token @@ -101,7 +101,6 @@ async function refresh () { Storage.removeItem('userInfo'); Storage.setItem('cartNum', 0); store.commit('SET_CARTNUM', 0); - console.log('1111'); Modal.confirm({ title: '请登录', content: '

请登录后执行此操作

', @@ -140,9 +139,11 @@ service.interceptors.response.use( isRefreshToken++; if (isRefreshToken === 1) { - refresh() + refresh(error) isRefreshToken = 0; } + } else if (errorResponse.status === 404) { + // 避免刷新token时也提示报错信息 } else { if (error.message) { let _message = 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/api/promotion.js b/manager/src/api/promotion.js index 42173562..0c7c6113 100644 --- a/manager/src/api/promotion.js +++ b/manager/src/api/promotion.js @@ -30,7 +30,7 @@ export const getLiveList = params => { // 获取直播间详情 export const getLiveInfo = studioId => { - return getRequest(`/broadcast/studio/studioInfo/${studioId}`); + return getRequest(`/broadcast/studio/${studioId}`); }; // 获取当前进行中的促销活动商品 diff --git a/manager/src/config/index.js b/manager/src/config/index.js index 8b6b162f..680fb1b1 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -17,14 +17,14 @@ export default { * @description api请求基础路径 */ api_dev: { - // common: "https://common-api.pickmall.cn", - // buyer: "https://buyer-api.pickmall.cn", - // seller: "https://store-api.pickmall.cn", - // manager: "https://admin-api.pickmall.cn" - common: 'http://192.168.0.109:8890', - buyer: 'http://192.168.0.109:8888', - seller: 'http://192.168.0.109:8889', - manager: 'http://192.168.0.109:8887' + common: "https://common-api.pickmall.cn", + buyer: "https://buyer-api.pickmall.cn", + seller: "https://store-api.pickmall.cn", + manager: "https://admin-api.pickmall.cn" + // common: 'http://192.168.0.109:8890', + // buyer: 'http://192.168.0.109:8888', + // seller: 'http://192.168.0.109:8889', + // manager: 'http://192.168.0.109:8887' }, api_prod: { common: "https://common-api.pickmall.cn", 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/utils/filters.js b/manager/src/utils/filters.js index 71c092db..9124cbfe 100644 --- a/manager/src/utils/filters.js +++ b/manager/src/utils/filters.js @@ -16,6 +16,22 @@ export function unitPrice(val, unit, location) { return (unit || '') + price } +/** + * 订单来源 + */ +export function clientTypeWay(val) { + if (val == "H5") { + return "移动端"; + } else if (val == "PC") { + return "PC端"; + } else if (val == "WECHAT_MP") { + return "小程序端"; + } else if (val == "APP") { + return "移动应用端"; + } else { + return val; + } +} diff --git a/manager/src/views/distribution/distributionGoods.vue b/manager/src/views/distribution/distributionGoods.vue index a78c5830..05acecf5 100644 --- a/manager/src/views/distribution/distributionGoods.vue +++ b/manager/src/views/distribution/distributionGoods.vue @@ -67,10 +67,12 @@ export default { { type: "selection", width: 60, - align: "center" + align: "center", + fixed: "left", }, { title: "商品图片", + fixed: "left", key: "thumbnail", width: 120, align: "center", 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 { }; diff --git a/manager/src/views/main-components/footer.vue b/manager/src/views/main-components/footer.vue index 666ae443..e471877c 100644 --- a/manager/src/views/main-components/footer.vue +++ b/manager/src/views/main-components/footer.vue @@ -8,7 +8,7 @@ Copyright © 2020 - Present lili-shop {{ $t('rights') }} 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 @@