提交 dbf9dd1b authored 作者: huaxinzhu's avatar huaxinzhu

1、更换logo;2、商品图片上传优化;3、提现申请,去支付宝

上级 40739631
......@@ -14,7 +14,8 @@
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
// import logoImg from '@/assets/logo/logo.png';
import logoImg from '@/assets/logo/logo_white.png';
export default {
name: 'SidebarLogo',
......@@ -33,7 +34,7 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss" scoped >
.sidebarLogoFade-enter-active {
transition: opacity 1.5s;
}
......
......@@ -15,11 +15,11 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
const isToken = (config.headers || {}).isToken === false;
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5NTEyMzI0LCJpc3MiOiJnaW4tYmxvZyJ9.1I74xBUHyu_XIc7BggNMpxRUGGZnGJEEvElD85xxIPY'
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5Njc2MDMzLCJpc3MiOiJnaW4tYmxvZyJ9.ccnrAoIMRLQV1MAAII6J3F7ATnFDjcgUnMw6VoKuRA0'
return config
}, error => {
console.log("25reject");
......@@ -49,8 +49,7 @@ service.interceptors.response.use(res => {
})
} else if (code === 500) {
Message({
message: "状态吗500",
// message: message,
message: message,
type: 'error'
})
return Promise.reject(new Error(message))
......@@ -75,31 +74,31 @@ service.interceptors.response.use(res => {
}
}, error => {
// --- start ---- 开发时候用这段,把错误彻底抛出来 --- start ---
// let {message} = error;
// if (message == 'Network Error') {
// message = "后端接口连接异常";
// } else if (message.includes('timeout')) {
// message = '系统接口请求超时';
// } else if (message.includes("Request failed with status code")) {
// message = "系统接口" + message.substr(message.length - 3) + "异常";
// }
// Message({
// message: message,
// type: "error"
// });
let {message} = error;
if (message == 'Network Error') {
message = "后端接口连接异常";
} else if (message.includes('timeout')) {
message = '系统接口请求超时';
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: "error"
});
// console.log(message);
// --- end ---- 开发时候用这段,把错误彻底抛出来 --- end ---
// --- start --- 正式上线,隐藏报错信息 ----- start ----
let ssa = window.location.host;
setTimeout(function () {
if (ssa == 'localhost:1024') {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
} else {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
}
}, 1000);
// let ssa = window.location.host;
// setTimeout(function () {
// if (ssa == 'localhost:1024') {
// window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
// } else {
// window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
// }
// }, 1000);
// --- end --- 正式上线,隐藏报错信息 ----- end ----
return Promise.reject(error)
......
......@@ -38,7 +38,6 @@ export default {
this.tiaozuan();
// this.getCookie();
// this.getCode();
},
methods: {
tiaozuan(){
......
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>绑定银行卡</span>
<span>账户管理</span>
<el-button
style='float:right'
:disabled="!addbank"
......@@ -12,7 +12,6 @@
@click="handleAdd"
>新增
</el-button>
</div>
<el-table v-loading="loading" :height="tableHeight" :data="bankcardList"
......@@ -47,56 +46,66 @@
@pagination="getList"
/>
<!-- 添加或修改商户银行卡对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类型">
<el-select @change="selectChanged" v-model="form.txType" placeholder="类型">
<el-option v-for="item in state" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!-- <el-form-item label="类型">-->
<!-- <el-select @change="selectChanged" v-model="form.txType" placeholder="类型">-->
<!-- <el-option v-for="item in state" :key="item.value" :label="item.label"-->
<!-- :value="item.value"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
<!-- <el-button @click="cancel">取 消</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<el-dialog :visible.sync="bank" :title="banktitle">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="开户城市" prop="ProvinceCity">
<el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/>
</el-form-item>
<el-form-item label="银行名称">
<el-select v-model="form.BankName" placeholder="状态">
<el-option v-for="item in bankList" :key="item.value" :label="item.value"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开户行" prop="kaihuhang">
<el-input v-model="form.kaihuhang" placeholder="请输入开户行"/>
</el-form-item>
<el-form-item label="持卡人姓名" prop="BankAccountName">
<el-input v-model="form.BankAccountName" placeholder="请输入持卡人姓名"/>
</el-form-item>
<el-form-item label="卡号" prop="BankAccountNo">
<el-input v-model="form.BankAccountNo" placeholder="请输入卡号"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="开户城市" prop="ProvinceCity">
<el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="银行名称">
<el-select v-model="form.BankName" placeholder="状态" style="width: 100%">
<el-option v-for="item in bankList" :key="item.value" :label="item.value"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="开户行" prop="kaihuhang">
<el-input v-model="form.kaihuhang" placeholder="请输入开户行"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="持卡人姓名" prop="BankAccountName">
<el-input v-model="form.BankAccountName" placeholder="请输入持卡人姓名"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="卡号" prop="BankAccountNo">
<el-input v-model="form.BankAccountNo" placeholder="请输入卡号"/>
</el-form-item>
</el-col>
</el-row>
<el-dialog :visible.sync="zfb" :title="banktitle">
<el-form ref="form" :model="form" :rules="rules2" label-width="80px">
<el-form-item label="支付宝账户名称" prop="ZfbAccountName">
<el-input v-model="form.ZfbAccountName" placeholder="请输入支付宝账户名称"/>
</el-form-item>
<el-form-item label="支付宝账户" prop="ZfbAccount">
<el-input v-model="form.ZfbAccount" placeholder="请输入支付宝账户"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -104,6 +113,21 @@
</div>
</el-dialog>
<!-- <el-dialog :visible.sync="zfb" :title="banktitle">-->
<!-- <el-form ref="form" :model="form" :rules="rules2" label-width="80px">-->
<!-- <el-form-item label="支付宝账户名称" prop="ZfbAccountName">-->
<!-- <el-input v-model="form.ZfbAccountName" placeholder="请输入支付宝账户名称"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="支付宝账户" prop="ZfbAccount">-->
<!-- <el-input v-model="form.ZfbAccount" placeholder="请输入支付宝账户"/>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
<!-- <el-button @click="cancel">取 消</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</el-card>
</div>
</template>
......@@ -119,7 +143,6 @@
state: [
// {label: "支付宝", value: 2},
{label: "银行卡", value: 1},
],
//银行
bankList: [],
......@@ -139,7 +162,7 @@
bankcardList: [],
// 弹出层标题
title: "",
banktitle: "银行卡/支付宝数量最大为3个",
banktitle: "对公账户(数量最多为3个)",
// 是否显示弹出层
open: false,
addbank: false,
......@@ -152,7 +175,9 @@
sellerId: 0,
},
// 表单参数
form: {},
form: {
},
// 表单校验
rules: {},
rules2: {
......@@ -191,19 +216,18 @@
});
},
//类型改变
selectChanged(v) {
if (v == 1) {
this.bank = true
this.zfb = false
} else if (v == 2) {
this.bank = false
this.zfb = true
} else {
this.bank = false
this.zfb = true
}
},
// selectChanged(v) {
// if (v == 1) {
// this.bank = true
// this.zfb = false
// } else if (v == 2) {
// this.bank = false
// this.zfb = true
// } else {
// this.bank = false
// this.zfb = true
// }
// },
//根据银行类别判断
btypa(row) {
var lx = ""
......@@ -258,7 +282,7 @@
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.bank = true;
this.title = "添加商户银行卡";
},
/** 修改按钮操作 */
......@@ -275,7 +299,8 @@
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.sellerId = this.queryParams.sellerId
this.form.sellerId = this.queryParams.sellerId;
this.form.TxType = 1;
addBankcard(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("新增成功");
......
......@@ -14,7 +14,6 @@
:before-upload = "beforeUpGoodsMainImg"
:before-remove = "beforeRemoveMainImg"
:on-preview="handleMainImgPreview"
:on-remove="handleRemoveMainImg"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -35,9 +34,7 @@
:on-exceed="limitCount5"
:before-upload = "beforeUpCarouselImg"
:before-remove="beforeRemoveCarouselImg"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -97,23 +94,22 @@
ruleFormdialogImageUrl: {
handler(val, oldVal) {
this.$set(this.picall, 'ruleFormdialogImageUrl', val)
},
deep: true
},
// ruleFormdialogImageUrlplus: {
// handler(val, oldVal) {
// this.$set(this.picall, 'ruleFormdialogImageUrlplus', val)
// },
// deep: true
// },
ruleFormdialogImageUrlplus: {
handler(val, oldVal) {
this.$set(this.picall, 'ruleFormdialogImageUrlplus', val)
},
deep: true
},
},
methods: {
// 商品主图 数量限制
limitCount1(files,fileList){
this.$message({message: '最多上传1张图片', type: 'warning'});
},
// 上传前 商品主图 大小格式样式校验
// 商品主图 大小格式样式校验
beforeUpGoodsMainImg(file,fileList){
if(file.type !== "image/png" && file.type !== "image/jpg" && file.type != "image/jpeg") {
this.$message({
......@@ -122,7 +118,6 @@
});
return false;
}
let isImgSize = (file.size / 1024 / 1024 ) > 2;
if(isImgSize) {
this.$message({
......@@ -131,7 +126,6 @@
});
return false;
}
// 图片宽高尺寸限制
return new Promise(function(resolve, reject){
let _URL = window.URL || window.webkitURL;
......@@ -153,11 +147,64 @@
});
},
// 商品轮播图 数量限制
// 上传商品主图
uploadGoodsMain(param) {
this.getBase64(param.file).then((res) => {
let result = res.split(",");
this.Base64img = result[1];
let data = {"image": this.Base64img}
UploadImg(data).then(res => {
if (res && res.data.code == 1) {
this.ruleFormdialogImageUrlplus.push({'url': res.data.data.imageUrl})
this.$message({ message:'上传成功',type:'success'});
}else {
this.$message({ message:'上传失败,请重新上传',type:'error'});
}
})
});
},
// 商品主图 删除移除前
beforeRemoveMainImg(file,fileList) {
if(file.status === 'success') {
return new Promise((res, rej) => {
this.$confirm(`是否删除此图片`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for(let i = 0; i < this.ruleFormdialogImageUrlplus.length; i++) {
if(file.uid === this.ruleFormdialogImageUrlplus[i].uid) {
this.ruleFormdialogImageUrlplus.splice(i,1);
}
}
this.$message({
type: 'success',
message: '删除成功!'
});
return res();
}).catch(() => {
this.$message({
type: 'success',
message: '取消删除!'
});
return rej();
});
});
}
},
// 商品主图 预览
handleMainImgPreview(file) {
this.dialogImageUrlplus = file.url;
this.dialogVisibleplus = true;
},
// 轮播图 数量限制
limitCount5(files,fileList){
this.$message({message: '最多上传1张图片', type: 'warning'});
},
// 上传前 轮播图 大小格式样式校验
// 轮播图 大小格式样式校验
beforeUpCarouselImg(file) {
if(file.type !== "image/png" && file.type !== "image/jpg" && file.type != "image/jpeg") {
this.$message({
......@@ -190,138 +237,94 @@
return file;
}, ()=>{
this.$message({
message:'商品主图必须为正方形,请重新选择!',
message:'轮播图图必须为正方形,请重新选择!',
type: 'warning'
});
return Promise.reject();
});
},
handleinfomationclick() {
let pic = {
ruleFormdialogImageUrlplus: this.ruleFormdialogImageUrlplus,
ruleFormdialogImageUrl: this.ruleFormdialogImageUrl
}
this.$emit('imgclicks', pic)
},
// 商品主图删除
handleRemoveMainImg(file, fileList) {
debugger
for(let i = 0; i < this.ruleFormdialogImageUrlplus.length; i++) {
if(file.uid === this.ruleFormdialogImageUrlplus[i].uid) {
this.ruleFormdialogImageUrlplus.splice(i,1);
}
}
},
handleMainImgPreview(file) {
this.dialogImageUrlplus = file.url;
this.dialogVisibleplus = true;
},
// 上传商品主图
uploadGoodsMain(param) {
// 轮播图上传
uploadSectionFile(param) {
this.getBase64(param.file).then((res) => {
let result = res.split(",");
this.Base64img = result[1];
let data = {"image": this.Base64img}
UploadImg(data).then(res => {
if (res && res.data.code == 1) {
this.ruleFormdialogImageUrlplus.push({'url': res.data.data.imageUrl})
this.ruleFormdialogImageUrl.push({'url': res.data.data.imageUrl});
this.$message({ message:'上传成功',type:'success'});
}else {
this.$message({ message:'上传失败,请重新上传',type:'error'});
}
this.$message({ message:'上传成功',type:'success'});
})
});
},
// 商品主图 删除前
beforeRemoveMainImg() {
this.$confirm('此操作将永久删除该文件,是否继续?','提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRemoveMainImg();
}).catch(() => {});
},
//多图
uploadSectionFile(param) {
// this.getBase64(param.file).then((res) => {
// let result = res.split(",");
// this.Base64img = result[1];
// let data = {"image": this.Base64img}
// UploadImg(data).then(res => {
// if (res && res.data.code == 1) {
// this.ruleFormdialogImageUrlplus.push({'url': res.data.data.imageUrl})
// }
// this.$message({ message:'上传成功',type:'success'});
// })
// });
// if (1) {
// this.getBase64(param.file).then((res) => {
// console.log(273,res)
// let result = res.split(",");
// this.Base64img = result[1];
// let data = {"image": this.Base64img}
// UploadImg(data).then(res => {
// if (res.data.code == 1) {
// this.ruleFormdialogImageUrl.push({'url': res.data.data.imageUrl})
// }
// this.$message('上传成功');
// })
//
// });
// }
},
beforeRemove(file, fileList) {
console.log(291,file);
console.log(292,fileList);
},
handleRemove(file, fileList) {
// console.log(file, fileList);
// let listImg = this.removeAaary(fileList, file);
//
// let datas = {
// id: this.skuId,
// sampleCoverUrl: this.datadialogImageUrl(listImg),
// };
// let that = this;
// changesku(datas).then((res) => {
// that.$notify.success({
// title: "成功",
// message: "删除成功",
// });
// that.ruleFormdialogImageUrl = that.removeAaary(fileList, file);
// this.info();
// });
},
// 轮播图 删除前
beforeRemoveCarouselImg() {
},
removeAaary(_arr, _obj) {
var length = _arr.length;
for (var i = 0; i < length; i++) {
if (_arr[i] == _obj) {
if (i == 0) {
_arr.shift(); //删除并返回数组的第一个元素
return _arr;
} else if (i == length - 1) {
_arr.pop(); //删除并返回数组的最后一个元素
return _arr;
} else {
_arr.splice(i, 1); //删除下标为i的元素
return _arr;
}
}
beforeRemoveCarouselImg(file) {
console.log("轮播图删除前方法", file);
if(file.status === 'success') {
return new Promise((res, rej) => {
this.$confirm(`是否删除此图片`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
for(let i = 0; i < this.ruleFormdialogImageUrl.length; i++) {
if(file.uid === this.ruleFormdialogImageUrl[i].uid) {
this.ruleFormdialogImageUrl.splice(i,1);
}
}
console.log(275,this.ruleFormdialogImageUrl);
this.$message({
type: 'success',
message: '删除成功!'
});
return res();
}).catch(() => {
this.$message({
type: 'success',
message: '取消删除!'
});
return rej();
});
});
}
},
// 轮播图预览
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handleinfomationclick() {
let pic = {
ruleFormdialogImageUrlplus: this.ruleFormdialogImageUrlplus,
ruleFormdialogImageUrl: this.ruleFormdialogImageUrl
}
this.$emit('imgclicks', pic)
},
// removeAaary(_arr, _obj) {
// var length = _arr.length;
// for (var i = 0; i < length; i++) {
// if (_arr[i] == _obj) {
// if (i == 0) {
// _arr.shift(); //删除并返回数组的第一个元素
// return _arr;
// } else if (i == length - 1) {
// _arr.pop(); //删除并返回数组的最后一个元素
// return _arr;
// } else {
// _arr.splice(i, 1); //删除下标为i的元素
// return _arr;
// }
// }
// }
// },
// -------------------------通用
// 图片转换为 base64
getBase64(file) {
......@@ -406,4 +409,8 @@
}
}
// 上传图片样式 重置 end
/deep/.el-upload-list__item .el-icon-close-tip {
display :none!important;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论