bug修改

master
mabo 2021-06-23 16:49:35 +08:00
parent eb5816ff80
commit f2f2984c3e
11 changed files with 141 additions and 179 deletions

View File

@ -69,7 +69,7 @@
>人评价
</div>
<div class="goods-show-seller">
<span>{{ item.storeName }}</span>
<Tag v-if="item.selfOperated" style="padding:0 4px;" size="small" color="error"></Tag><span>{{ item.storeName }}</span>
</div>
</div>
</div>

View File

@ -142,6 +142,8 @@ service.interceptors.response.use(
refresh(error)
isRefreshToken = 0;
}
} else if (errorResponse.status === 404) {
// 避免刷新token时也提示报错信息
} else {
if (error.message) {
let _message =

View File

@ -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) {

View File

@ -1,47 +1,48 @@
<template>
<div>
<vuedraggable
:list="uploadList"
:disabled="!draggable||!multiple"
:animation="200"
class="list-group"
ghost-class="thumb-ghost"
@end="onEnd"
>
<div class="upload-list" v-for="(item, index) in uploadList" :key="index">
<div v-if="item.status == 'finished'" style="height:60px;">
<img :src="item.url" />
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
<Icon type="ios-trash-outline" @click="handleRemove(item)"></Icon>
<div class="upload-pic-thumb">
<vuedraggable
:list="uploadList"
:disabled="!draggable||!multiple"
:animation="200"
class="list-group"
ghost-class="thumb-ghost"
@end="onEnd"
>
<div class="upload-list" v-for="(item, index) in uploadList" :key="index">
<div v-if="item.status == 'finished'" style="height:60px;">
<img :src="item.url" />
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
<Icon type="ios-trash-outline" @click="handleRemove(item)"></Icon>
</div>
</div>
<div v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</div>
</div>
<div v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</vuedraggable>
<Upload
ref="upload"
:multiple="multiple"
:show-upload-list="false"
:on-success="handleSuccess"
:on-error="handleError"
:format="['jpg','jpeg','png','gif']"
:max-size="maxSize*1024"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:before-upload="handleBeforeUpload"
type="drag"
:action="uploadFileUrl"
:headers="accessToken"
style="display: inline-block;width:58px;"
>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="md-camera" size="20"></Icon>
</div>
</div>
</vuedraggable>
<Upload
ref="upload"
:multiple="multiple"
:show-upload-list="false"
:on-success="handleSuccess"
:on-error="handleError"
:format="['jpg','jpeg','png','gif']"
:max-size="maxSize*1024"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:before-upload="handleBeforeUpload"
type="drag"
:action="uploadFileUrl"
:headers="accessToken"
style="display: inline-block;width:58px;"
>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="md-camera" size="20"></Icon>
</div>
</Upload>
</Upload>
</div>
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
<img :src="imgUrl" alt="无效的图片链接" style="width: 100%;margin: 0 auto;display: block;" />
<div slot="footer">
@ -242,6 +243,9 @@ export default {
</script>
<style lang="scss" scoped>
.upload-pic-thumb{
display: flex;
}
.upload-list {
display: inline-block;
width: 60px;
@ -255,6 +259,7 @@ export default {
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 5px;
vertical-align: middle;
}
.upload-list img {
width: 100%;

View File

@ -18,14 +18,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',

View File

@ -69,14 +69,6 @@ service.interceptors.response.use(
router.push("/login");
}
break;
case 403:
// 权限不足
if (data.message !== null) {
Message.error(data.message);
} else {
Message.error("权限不足");
}
break;
case 500:
// 系统异常
if (data.message !== null) {
@ -94,6 +86,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) {

View File

@ -54,20 +54,20 @@ export const result = [
children: null,
permTypes: []
},
{
name: "daft-goods",
showAlways: true,
level: 2,
type: 0,
title: "草稿商品",
path: "daft-goods",
component: "goods/goods-seller/draftGoods",
icon: "md-person",
isMenu: true,
url: "",
children: null,
permTypes: []
},
// {
// name: "daft-goods",
// showAlways: true,
// level: 2,
// type: 0,
// title: "草稿商品",
// path: "daft-goods",
// component: "goods/goods-seller/draftGoods",
// icon: "md-person",
// isMenu: true,
// url: "",
// children: null,
// permTypes: []
// },
{
path: "template-goods",

View File

@ -5,7 +5,7 @@ export const loginRouter = {
path: "/login",
name: "login",
meta: {
title: "登录 - lili商家后台 "
title: "登录 - lili商家后台"
},
component: () => import("@/views/login.vue")
};

View File

@ -395,11 +395,11 @@ div.base-info-item {
text-align: center;
border: 1px solid transparent;
border-radius: 4px;
display: inline-flex;
flex-direction: column;
display: inline-block;
background: #fff;
position: relative;
margin-right: 4px;
vertical-align: bottom;
}
.demo-upload-list img {
width: 100%;

View File

@ -317,7 +317,7 @@
<editor id="mobileIntr" v-model="baseInfoForm.mobileIntro"></editor>
</FormItem>
</div>
<div v-if="this.baseInfoForm.goodsType!='VIRTUAL_GOODS'">
<div v-if="baseInfoForm.goodsType!='VIRTUAL_GOODS'">
<h4>商品物流信息</h4>
<div class="form-item-view">
<FormItem class="form-item-view-el" label="商品重量" prop="weight">
@ -325,24 +325,11 @@
<span slot="append">kg</span>
</Input>
</FormItem>
<FormItem class="form-item-view-el" label="运费" prop="skuList">
<RadioGroup type="button" button-style="solid"
@on-change="logisticsTemplateChange"
v-model="baseInfoForm.freightPayer"
>
<Radio label="STORE">
<span>卖家承担运费</span>
</Radio>
<Radio label="BUYER">
<span>使用物流规则</span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem
class="form-item-view-el"
label="物流模板"
prop="templateId"
v-if="logisticsTemplateShow"
>
<Select v-model="baseInfoForm.templateId" style="width: 200px">
<Option
@ -352,7 +339,7 @@
>{{ item.name }}
</Option>
</Select>
</FormItem>
</FormItem>
</div>
<h4>其他信息</h4>
<div class="form-item-view">
@ -431,10 +418,11 @@
<Button type="primary" @click="save" :loading="submitLoading" v-if="activestep === 1">
{{ this.goodsId ? "保存" : "保存商品" }}
</Button>
<Button type="primary" @click="saveToDraft('TEMPLATE')" v-if="activestep === 1">
</Button>
<Button type="primary" @click="saveToDraft('DRAFT')" v-if="activestep === 1 && !isOperationGoods">稿
<Button type="primary" @click="saveToDraft('TEMPLATE')" v-if="activestep === 1">
保存为模版
</Button>
<!-- <Button type="primary" @click="saveToDraft('DRAFT')" v-if="activestep === 1 && !isOperationGoods">稿
</Button> -->
</ButtonGroup>
</div>
@ -632,8 +620,6 @@ export default {
salesModel: "RETAIL",
/** 商品参数列表 */
goodsParamsList: [],
/** 运费承担者 */
// freightPayer: "STORE",
/** 商品重量 */
weight: "",
/** 商品相册列表 */
@ -710,9 +696,6 @@ export default {
/** 当前百分比 */
currentPercent: 0,
/** 物流模板是否展示 **/
logisticsTemplateShow: false,
/** 运费模板 **/
logisticsTemplate: [],
@ -779,6 +762,12 @@ export default {
this.accessToken = {
accessToken: this.getStore("accessToken"),
};
//
API_Shop.getShipTemplate().then((res) => {
if (res.success) {
this.logisticsTemplate = res.result;
}
})
//
if (this.$route.query.id) {
this.activestep = 1;
@ -786,7 +775,7 @@ export default {
this.GET_GoodData();
this.selectGoodsType = false;
}
///稿
//
else if (this.$route.query.draftId) {
this.draftId = this.$route.query.draftId;
this.activestep = 1;
@ -806,7 +795,6 @@ export default {
this.baseInfoForm = {
salesModel: "RETAIL",
goodsParamsList: [],
// freightPayer: "STORE",
weight: "",
goodsGalleryFiles: [],
release: "true",
@ -984,20 +972,7 @@ export default {
});
}
},
//
logisticsTemplateChange(v) {
if (v == "BUYER") {
//
API_Shop.getShipTemplate().then((res) => {
if (res.success) {
this.logisticsTemplate = res.result;
}
});
this.logisticsTemplateShow = true;
} else {
this.logisticsTemplateShow = false;
}
},
gotoGoodsList() {
this.$router.push({ name: "goods" });
},
@ -1053,15 +1028,8 @@ export default {
...this.baseInfoForm,
...response.result,
};
console.warn(this.baseInfoForm);
// if (this.baseInfoForm.freightPayer === "BUYER") {
// API_Shop.getShipTemplate().then((res) => {
// if (res.success) {
// this.logisticsTemplate = res.result;
// }
// });
// this.logisticsTemplateShow = true;
// }
// console.warn(this.baseInfoForm);
this.baseInfoForm.release = "true";
this.baseInfoForm.recommend = this.baseInfoForm.recommend
? "true"
@ -1555,7 +1523,6 @@ export default {
},
/** 下一步*/
next() {
console.log(111);
window.scrollTo(0, 0);
if (this.activestep === 0 && this.draftId) {
this.activestep = 1;
@ -1666,10 +1633,6 @@ export default {
this.submitLoading = false;
return;
}
// 0
// if (this.baseInfoForm.freightPayer !== "BUYER") {
// this.baseInfoForm.templateId = 0;
// }
this.baseInfoForm.skuList = this.skuTableData.map((sku) => {
delete sku._index;
@ -1762,7 +1725,7 @@ export default {
},
});
},
SAVE_DRAFT_GOODS() {
SAVE_DRAFT_GOODS() { // 稿
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
if (res.success) {
this.$Message.info("保存成功!");

View File

@ -1,49 +1,50 @@
<template>
<div>
<vuedraggable
:list="uploadList"
:disabled="!draggable||!multiple"
:animation="200"
class="list-group"
ghost-class="thumb-ghost"
@end="onEnd"
>
<div class="upload-list" v-for="(item, index) in uploadList" :key="index">
<div v-if="item.status == 'finished'">
<img :src="item.url" />
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
<Icon v-if="remove" type="ios-trash-outline" @click="handleRemove(item)"></Icon>
<div class="upload-pic-thumb">
<vuedraggable
:list="uploadList"
:disabled="!draggable||!multiple"
:animation="200"
class="list-group"
ghost-class="thumb-ghost"
@end="onEnd"
>
<div class="upload-list" v-for="(item, index) in uploadList" :key="index">
<div v-if="item.status == 'finished'">
<img :src="item.url" />
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click="handleView(item.url)"></Icon>
<Icon v-if="remove" type="ios-trash-outline" @click="handleRemove(item)"></Icon>
</div>
</div>
<div v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</div>
</div>
<div v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</vuedraggable>
<Upload
:disabled="disable"
ref="upload"
:multiple="multiple"
:show-upload-list="false"
:on-success="handleSuccess"
:on-error="handleError"
:format="['jpg','jpeg','png','gif']"
:max-size="maxSize*1024"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:before-upload="handleBeforeUpload"
type="drag"
:action="uploadFileUrl"
:headers="accessToken"
style="display: inline-block;width:58px;"
v-if="!isView"
>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="md-camera" size="20"></Icon>
</div>
</div>
</vuedraggable>
<Upload
:disabled="disable"
ref="upload"
:multiple="multiple"
:show-upload-list="false"
:on-success="handleSuccess"
:on-error="handleError"
:format="['jpg','jpeg','png','gif']"
:max-size="maxSize*1024"
:on-format-error="handleFormatError"
:on-exceeded-size="handleMaxSize"
:before-upload="handleBeforeUpload"
type="drag"
:action="uploadFileUrl"
:headers="accessToken"
style="display: inline-block;width:58px;"
v-if="!isView"
>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="md-camera" size="20"></Icon>
</div>
</Upload>
</Upload>
</div>
<Modal title="图片预览" v-model="viewImage" :styles="{top: '30px'}" draggable>
<img :src="imgUrl" alt="无效的图片链接" style="width: 100%;margin: 0 auto;display: block;" />
<div slot="footer">
@ -252,10 +253,12 @@ export default {
}
};
</script>
<style lang="scss" scoped>
.upload-pic-thumb{
display: flex;
}
.upload-list {
display: inline-block;
display: inline-flex;
width: 60px;
height: 60px;
text-align: center;
@ -267,6 +270,7 @@ export default {
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 5px;
vertical-align: middle;
}
.upload-list img {
width: 100%;