Commit 0570d3ef by 任建

rj

parent b2700f58
<template>
<!-- 根组件 -->
<div id="app" ref="app">
<Globalheader title="" url="/jdtrademark" name="首页" />
<router-view />
<Globalfooter />
</div>
</template>
<script>
import Globalheader from "@/components/globalheader";
import Globalfooter from "@/components/globalfooter";
export default {
components: {
Globalheader,
Globalfooter
}
};
......
......@@ -32,4 +32,31 @@ export function word2pic(word) {
},
actionType: "word2pic"
});
}
//获取oss
export function getOss() {
return http.post(baseUrl, {
actionBody: {},
actionType: "getOssConfig"
});
}
//商标样式转换
export function uploadStandardTm(url) {
return http.post(baseUrl, {
actionType: "uploadStandardTm",
actionBody: {
key: url
}
});
}
//企业近似查询
export function getCompanyInfoByLikeName(name) {
return http.post(baseUrl, {
actionType: "getCompanyInfoByLikeName",
actionBody: {
likestr: name
}
})
}
\ No newline at end of file
<template>
<div class="globalheader">
<div class="globalheader" ref="header">
<div class="globalheader-main">
<div class="globalheader-main-left">
<div><img src="" alt="" /></div>
......@@ -15,11 +15,31 @@
<script>
export default {
props: ["title", "url", "name"]
props: ["title", "url", "name"],
data() {
return {
windowFirstUrl: ""
};
},
created() {
this.windowFirstUrl = window.location.host.split(".")[0];
},
mounted() {
switch (this.windowFirstUrl) {
case "gsbweb":
this.$refs.header.classList.add("globalheader-red");
break;
default:
break;
}
}
};
</script>
<style lang="scss">
.globalheader-red {
background: rgb(46, 35, 35) !important;
}
.globalheader {
width: 100%;
height: 60px;
......
<template>
<div class="uploadImg">
<el-upload
class="avatar-uploader"
:action="action"
:data="data"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
</el-upload>
</div>
</template>
<script>
export default {
props:["action","data"],
data() {
return {
imageUrl: ""
};
},
methods: {
handleAvatarSuccess(res) {
var doc = (new DOMParser()).parseFromString(res,'text/xml');
let url = doc.getElementsByTagName('Location')[0].innerHTML;
this.$emit("getsuccess",url)
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg" || file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isJPG) {
this.$message.error("上传头像图片只能是 JPG 格式或者 PNG 格式!");
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 10MB!");
}
return isJPG && isLt2M;
}
}
};
</script>
<style lang="scss">
.uploadImg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
.avatar-uploader,.el-upload {
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
}
.avatar-uploader .el-upload:hover .avatar-uploader-icon {
color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
display: none;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
}
</style>
......@@ -5,7 +5,7 @@ import { getCookie } from "@/utils/getToken.js";
// 创建axios实例
const service = axios.create({
// baseURL: process.env.BASE_API, // api 的 base_url
timeout: 20000, // 请求超时时间
// timeout: 5000, // 请求超时时间
headers: {}
});
......@@ -14,13 +14,12 @@ service.interceptors.request.use(
config => {
let token = getCookie("token");
let userpin = getCookie("userpin");
console.log(config);
if (token) {
config.headers["token"] = token; // 让每个请求携带自定义token 请根据实际情况自行修改
}
if (!userpin) {
if (
config.url != "/a/web/action/tmOrder/springBoard" ||
config.url != "/api/web/action/tmOrder/springBoard" &&
config.url != "/api/web/auth/accessAuth/springBoard"
) {
Message("请重新登录");
......
......@@ -16,6 +16,14 @@ import VueClipboard from "vue-clipboard2";
// 使用bus进行通信
import VueBus from "vue-bus";
//
import Router from "vue-router";
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
getTokens().then(res => {
//存储token
seveCookie("token", res.data.data.token);
......
......@@ -110,7 +110,6 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
let userpin = getCookie("userpin");
console.log(to.path);
if (
to.path == "/user/login" ||
to.path == "/user/register" ||
......
......@@ -16,10 +16,15 @@
</el-form-item>
<div v-if="ruleForm.resource == 1">
<el-form-item label="公司名称:" prop="name">
<el-input
<el-autocomplete
v-model="ruleForm.name"
:fetch-suggestions="querySearchAsync"
placeholder="请输入公司名称"
></el-input>
@select="handleSelect"
:trigger-on-focus="false"
clearable
:debounce="700"
></el-autocomplete>
</el-form-item>
<el-form-item label="统一社会信用代码:" prop="xinyongma">
<el-input
......@@ -60,11 +65,12 @@
<el-input
v-model="ruleForm.idCard"
placeholder="请输入您的身份证号"
:maxlength="18"
></el-input>
</el-form-item>
<el-form-item label="注册地址:" prop="name">
<el-input
v-model="ruleForm.idCard"
v-model="ruleForm.zhuAddress"
placeholder="请输入注册地址"
></el-input>
</el-form-item>
......@@ -91,20 +97,20 @@
</el-form-item>
</div>
</el-form>
<!-- 底部按钮 -->
<div class="drawer-bottom">
<button class="esc">取消</button>
<button class="enter">保存</button>
<button class="enter" @click="addMessage">保存</button>
</div>
</div>
</template>
<script>
import { getCompanyInfoByLikeName } from "@/api/tmTools.js";
export default {
data() {
return {
ruleForm: {
name: "",
name: "",
resource: 1,
xinyongma: "",
address: "",
......@@ -128,7 +134,25 @@ export default {
}
};
},
methods: {}
mounted() {},
methods: {
querySearchAsync(queryString, cb) {
//企业近似查询
getCompanyInfoByLikeName(this.ruleForm.name).then(res => {
res.data.map(item => {
item.value = item.domainEntName;
});
cb(res.data);
});
},
handleSelect(item) {
this.ruleForm.xinyongma = item.creditCode;
this.ruleForm.address = item.regLocation;
},
addMessage() {
console.log(this.ruleForm);
}
}
};
</script>
<style lang="scss">
......
......@@ -37,13 +37,21 @@
>
<div class="trademark-name">
<div class="div">
<el-button>手动上传</el-button>
<el-button @click="manualupload"
>手动上传<UploadImg
:action="action"
:data="data"
ref="upImg"
flag="picUrl"
@getsuccess="getImgUrl"
/></el-button>
<el-button @click="automatic">自动生成</el-button>
</div>
<div class="div">
<div class="trademarkImg">
<div class="loadingImg" v-loading="loading"></div>
<img :src="imgUrl" alt="" />
<img v-if="!imgUrl" src="@/assets/imgs/zwtp.png" alt />
<img v-else :src="imgUrl" alt="" />
</div>
<p>
<i class="el-icon-warning"></i
......@@ -59,8 +67,16 @@
>
<div class="trademark-name">
<div class="div">
<div class="trademarkImg">
<img src="" alt="" />
<div class="trademarkImg" v-loading="loading">
<img v-if="!imgUrl" src="@/assets/imgs/sctp.png" alt="" />
<img v-else :src="imgUrl" alt="" />
<UploadImg
:action="action"
:data="data"
ref="upImg"
flag="picUrl"
@getsuccess="getImgUrl"
/>
</div>
<div class="p-left">
<p>
......@@ -118,8 +134,12 @@
</template>
<script>
import { word2pic } from "@/api/tmTools.js";
import { word2pic, getOss, uploadStandardTm } from "@/api/tmTools.js";
import UploadImg from "@/components/uploadImg";
export default {
components: {
UploadImg
},
data() {
return {
drawerRight: false,
......@@ -134,10 +154,57 @@ export default {
resource: [{ required: true, message: "", trigger: "change" }]
},
imgUrl: "",
loading: false
loading: false,
action: "",
data: {
key: "zc_picUrl670615786273319262020010.jpg",
Bucket: "gsb-zc",
OSSAccessKeyId: "",
Signature: "",
policy: "",
success_action_status: null
}
};
},
mounted() {
getOss().then(res => {
this.data = res.data;
this.data.key = this.setKey();
this.action = res.data.url;
});
},
methods: {
getImgUrl(msg) {
this.loading = true;
this.imgUrl = msg;
uploadStandardTm(this.imgUrl).then(res => {
console.log(res);
this.loading = false;
if (res.status == 0) {
this.$message({
type: "success",
message: "上传成功"
});
} else {
this.$message.error("上传失败,请重新上传!");
}
});
},
setKey(name, flag) {
// name = name.substring(name.length - 5);
var myDate = new Date();
var key =
"zc_" +
flag +
Math.round(Math.random() * 10000) +
myDate.getTime() +
myDate.getFullYear() +
myDate.getMonth() +
myDate.getDate() +
".jpg";
// this.$refs[flag].data.key = key;
return key;
},
lookImg(title, index) {
this.drawerTitle = title;
this.lookIndex = index;
......@@ -154,7 +221,8 @@ export default {
}
});
}
}
},
manualupload() {}
}
};
</script>
......@@ -204,6 +272,7 @@ export default {
border-radius: 100px;
color: rgb(102, 102, 102);
font-size: 12px;
position: relative;
}
.trademarkImg {
width: 124px;
......
......@@ -123,8 +123,7 @@ export default {
// 点击购买去相应的购买页面
goOwnBuyPage(index) {
if (index == 0) {
location.href =
"https://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=https://tm.plus.jdcloud.com/jdtm/getUser&state=selftmreg&client_id=9491577327154697";
this.$router.push("/selftmreg")
}
if (index == 1) {
location.href = "https://market.jdcloud.com/service/details/582208";
......
......@@ -155,7 +155,7 @@ export default {
methods: {
submitForm() {
if (this.active) {
console.log(123);
this.$router.push();
}
}
}
......
......@@ -146,5 +146,6 @@ export default {};
/* 激活后,高亮背景 优先级最高*/
.active {
background: #51d2b7 !important;
color: #fff;
}
</style>
<template>
<div class="user">
<Globalheader title="登录" url="/jdtrademark" name="首页" />
<!-- <Globalheader title="" url="/jdtrademark" name="首页" /> -->
<div class="user-main">
<div class="user-main-mid">
<div class="user-main-left">
......@@ -22,11 +22,11 @@
</template>
<script>
import Globalheader from "@/components/globalheader";
// import Globalheader from "@/components/globalheader";
export default {
components: {
Globalheader
},
// components: {
// Globalheader
// },
data() {
return {
activeName: "first"
......
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