Commit e820acf2 by caoyanzhi

会员相册

parent 4edb3d30
/*eslint-disable*/
import axios from 'axios';
// import store from '../store/index';
import router from '../router';
// axios 配置
// axios.defaults.timeout = 5000;
// let adminUrl = 'http://gicdev.demogic.com'
// let adminUrl = process.env.NODE_ENV === 'production' ? '':'http://111.231.99.90:8880/app/mock/19'
let adminUrl = process.env.NODE_ENV === 'production' ? '' : 'http://gicdev.demogic.com';
let request;
request = axios.create({
baseURL: adminUrl,
withCredentials: true, //跨域凭证
timeout: 30000,
headers: {
// 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
sign:''
},
});
// http request 拦截器
request.interceptors.request.use(
config => {
config.params = {
requestProject: 'mall',
...config.params
};
// if (store.state.token) {
// config.headers.Authorization = `token ${store.state.token}`;
// }
if(localStorage.getItem('sign')) {
config.headers.sign = localStorage.getItem('sign')
}else{
config.headers.sign = ''
}
return config;
},
err => {
return Promise.reject(err);
}
);
// http response 拦截器
request.interceptors.response.use(
response => {
if (response.status == 200 && response.data.errorCode === 401) {
window.location.href = window.location.origin + '/gic-web';
// window.location.href = 'http://gicdev.com/gic-web'
}
return response;
},
error => {
if (error.response) {
switch (error.response.status) {
case 401:
// 401 清除token信息并跳转到登录页面
// store.commit(types.LOGOUT);
router.replace({
name: 'login',
query: { redirect: router.currentRoute.fullPath }
});
}
}
return Promise.reject(error.response.data);
}
);
export default request;
<template>
<!-- 调整库存弹框 -->
<el-dialog title="调整库存" :visible.sync="stockModalData.modalShow" :width="(stockModalData.modalWidth+40)+'px'" @close="cancelStockModal">
</el-dialog>
</template>
<script>
import qs from 'qs';
import request from '../../api/request.js'
import common from '../../../static/js/common.js';
export default {
props:{
tableSkuHeaderData:{
type:Array,
},
stockModalData:{
type:Object,
}
},
data() {
return {
}
},
mounted(){
},
created(){
},
methods: {
}
}
</script>
<template>
<div class="container">
<vue-gic-header :projectName="projectName" :collapseFlag="collapseFlag" @collapseTag="collapseTag" @toRouterView="toRouterView"></vue-gic-header>
<div class="mall-content-container">
<div class="goods-manege-content">
<!-- 右侧页面部分 start-->
<router-view> </router-view>
<!-- 右侧页面部分 end-->
<!-- <vue-gic-footer></vue-gic-footer> -->
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
collapseFlag: false, // 折叠参数
menuRouter: [], // 路由菜单
leftMenuRouter: [],
leftModulesName: '微商城',
projectName: 'mall'
};
},
computed: {},
methods: {
// 处理路由跳转
toRouterView(val) {
var that = this;
that.$router.push({
path: val.path
});
},
// 折叠事件
collapseTag(val) {
var that = this;
that.collapseFlag = val;
if (that.collapseFlag) {
that.widthData = '64px';
} else {
that.widthData = '200px';
}
}
},
components: {}
};
</script>
<style scoped>
.container {
height: 100%;
}
.mall-section {
margin: 24px;
background: #fff;
padding: 24px;
}
.mall-content-container {
padding-top: 64px;
height: 100%;
overflow-y: auto;
}
.goods-manege-content {
height: 100%;
}
</style>
<template>
<div class="page-content">
<!-- <div class="mall-content-title">
<el-breadcrumb separator="/">
<el-breadcrumb-item>微商城</el-breadcrumb-item>
<el-breadcrumb-item>商品管理</el-breadcrumb-item>
<el-breadcrumb-item>图片空间</el-breadcrumb-item>
</el-breadcrumb>
<h3>
<span>图片空间</span>
</h3>
</div> -->
<v-nav :navpath="navpath"></v-nav>
<div class="mall-section-container" :style="{ minHeight: mallHeight + 'px' }">
<div class="img-left-content" :style="{ height: mallHeight + 'px' }">
<div class="img-left">
<div class="img-lef-title">图片目录</div>
<div class="img-tree-content">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" node-key="id" :expand-on-click-node="clickNodeExpand" :setCurrentKey="parentId"></el-tree>
</div>
</div>
</div>
<div class="img-right-content">
<div class="img-right">
<imgSpaceRight :parentId="parentId" ref="childEvent" @getFileData="getFileData" @getTree="getTree"></imgSpaceRight>
<!-- 右侧页面部分 end-->
</div>
</div>
</div>
<vue-gic-footer style="padding-bottom:80px"></vue-gic-footer>
</div>
</template>
<script>
import nav from "../../common/navbar/navbar.vue";
import request from '../../api/request.js';
import imgSpaceRight from './imgSpaceRight.vue';
export default {
data() {
return {
navpath: [
{
name: "首页",
path: ""
},
// {
// name: '微信总量',
// path: "/wechatmembers"
// },
{
name: "图片空间",
path: ""
}
],
mallHeight: document.documentElement.clientHeight - 64 - 98 - 149,
parentId: '', //点击的节点id
highlightCurrent: true, //是否高亮
data: [],
defaultProps: {
children: 'chlidren',
label: 'name'
},
clickNodeExpand: false //点击节点不收缩起节点
};
},
created() {
this.getFileDataFirst(); //左侧文件下拉树数据
},
computed: {},
methods: {
// 点击节点事件
handleNodeClick(data) {
this.parentId = data.id;
//点击父组件的
this.$refs.childEvent.getParentId(data.id);
this.$refs.childEvent.cancelCheckAll();
},
// 首次获取左侧下拉文件夹数据
getFileDataFirst() {
request.get('/api-mall/gic-cloud-image-group-list').then(res => {
if (res.data.errorCode === 0) {
this.data = res.data.result;
this.parentId = res.data.result[0].id;
this.$refs.childEvent.getParentId(this.parentId);
} else {
this.$message.error(res.data.message);
}
});
},
//非首次
getFileData() {
request.get('/api-mall/gic-cloud-image-group-list').then(res => {
if (res.data.errorCode === 0) {
this.data = res.data.result;
} else {
this.$message.error(res.data.message);
}
});
},
getTree() {
this.getFileData();
}
},
components: {
imgSpaceRight,
vNav: nav
}
};
</script>
<style>
.mall-content-title {
height: 85px;
background: #fff;
border-bottom: 1px solid #e4e7ed;
padding: 15px 0 0 25px;
}
.mall-content-title h3 {
color: #303133;
font-size: 20px;
padding: 20px 0;
font-weight: 500;
}
.mall-content-title h3 span {
color: #303133;
font-size: 20px;
font-weight: 500;
}
.img-tree-content .el-tree-node__label {
width: 120px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.img-tree-content .el-tree-node__content {
height: 32px;
}
/* .img-tree-content .el-tree{
padding-bottom:15px;
}*/
/*.img-tree-content .el-tree-node > .el-tree-node__children{
overflow: visible!important;
}
.img-tree-content .el-tree-node > .el-tree-node__children{
overflow: visible!important;
box-sizing: border-box;
}*/
/*.img-tree-content .el-tree-node__content{
width:100%;
}*/
/*.img-tree-content .el-tree-node__content:hover{
background:rgba(24, 144, 255, 0.10);
}*/
.img-tree-content .el-tree-node.is-current > .el-tree-node__content {
color: rgb(24, 144, 255);
}
</style>
<style scoped>
.page-content {
min-width: 1400px;
overflow-x: auto;
}
/*左侧*/
.img-tree-content {
width: 200px;
box-sizing: border-box;
}
.img-left-content {
width: 200px;
border-right: 1px solid rgba(231, 231, 235, 1);
overflow-y: auto;
overflow-x: hidden;
}
.img-left {
width: 200px;
background: #fff;
height: 100%;
width: 100%;
}
.img-lef-title {
height: 44px;
line-height: 44px;
padding-left: 15px;
border-bottom: 1px solid rgba(231, 231, 235, 1);
}
.mall-section-container {
display: flex;
background: #fff;
margin: 24px;
/*flex-flow: row;*/
}
/*树结构*/
.img-right-content {
height: 100%;
flex: 1;
min-width: 1200px;
overflow-x: auto;
}
.img-right {
overflow-x: auto;
min-width: 1200px;
}
</style>
export default{
//输入框的输入限制
getInputVal: function(val, max) {
var returnValue = '';
var byteValLen = 0;
for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null)
byteValLen += 1;
else
byteValLen += 0.5;
if (byteValLen > max)
break;
returnValue += val[i];
}
return returnValue;
},
// 一个汉子算一个,一个字母算一个
//输入框的输入限制
getInputValSin: function(val, max) {
var returnValue = '';
var byteValLen = 0;
for (var i = 0; i < val.length; i++) {
byteValLen += 1;
if (byteValLen > max)
break;
returnValue += val[i];
}
return returnValue;
},
/*
* 一个汉字算一个字,一个英文字母或数字算半个字
*/
getZhLen: function (val) {
var len = 0;
for (var i = 0; i < val.length; i++) {
var a = val.charAt(i);
if (a.match(/[^\x00-\xff]/ig) != null) {
len += 1;
}
else {
len += 0.5;
}
}
return Math.ceil(len);
},
// 时间戳转换成年月日
getTime:function(time){
if (!isNaN(time))
time = Number(time);
var now=new Date(time)
var year=now.getFullYear();
var month=now.getMonth()+1;
month >= 10 ?month = month : month = "0" + month;//判断小于10月份的情况
var date=now.getDate();
date >= 10 ?date = date: date = "0" + date;//判断小于10日的情况
return year+"-"+month+"-"+date
},
// 时间戳转换成时分秒
getSeconds:function(time){
if (!isNaN(time))
time = Number(time);
var now=new Date(time)
var hour=now.getHours();
hour >= 10 ?hour = hour: hour = "0" + hour;//判断小于10的时的情况
var minute=now.getMinutes();
minute>= 10 ?minute = minute: minute = "0" + minute;//判断小于10的分的情况
var second=now.getSeconds();
second >= 10 ?second = second: second = "0" + second;//判断小于10的秒的情况
return hour+":"+minute+":"+second;
},
// 时间戳转换成年月日时分秒
formatDate:function(time) {
if (!isNaN(time))
time = Number(time);
var now=new Date(time)
var year=now.getFullYear();
var month=now.getMonth()+1;
month >= 10 ?month = month : month = "0" + month;//判断小于10月份的情况
var date=now.getDate();
date >= 10 ?date = date: date = "0" + date;//判断小于10日的情况
var hour=now.getHours();
hour >= 10 ?hour = hour: hour = "0" + hour;//判断小于10的时的情况
var minute=now.getMinutes();
minute>= 10 ?minute = minute: minute = "0" + minute;//判断小于10的分的情况
var second=now.getSeconds();
second >= 10 ?second = second: second = "0" + second;//判断小于10的秒的情况
return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment