Commit 0570d3ef by 任建

rj

parent b2700f58
<template> <template>
<!-- 根组件 --> <!-- 根组件 -->
<div id="app" ref="app"> <div id="app" ref="app">
<Globalheader title="" url="/jdtrademark" name="首页" />
<router-view /> <router-view />
<Globalfooter /> <Globalfooter />
</div> </div>
</template> </template>
<script> <script>
import Globalheader from "@/components/globalheader";
import Globalfooter from "@/components/globalfooter"; import Globalfooter from "@/components/globalfooter";
export default { export default {
components: { components: {
Globalheader,
Globalfooter Globalfooter
} }
}; };
......
...@@ -32,4 +32,31 @@ export function word2pic(word) { ...@@ -32,4 +32,31 @@ export function word2pic(word) {
}, },
actionType: "word2pic" 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> <template>
<div class="globalheader"> <div class="globalheader" ref="header">
<div class="globalheader-main"> <div class="globalheader-main">
<div class="globalheader-main-left"> <div class="globalheader-main-left">
<div><img src="" alt="" /></div> <div><img src="" alt="" /></div>
...@@ -15,11 +15,31 @@ ...@@ -15,11 +15,31 @@
<script> <script>
export default { 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> </script>
<style lang="scss"> <style lang="scss">
.globalheader-red {
background: rgb(46, 35, 35) !important;
}
.globalheader { .globalheader {
width: 100%; width: 100%;
height: 60px; 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"; ...@@ -5,7 +5,7 @@ import { getCookie } from "@/utils/getToken.js";
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// baseURL: process.env.BASE_API, // api 的 base_url // baseURL: process.env.BASE_API, // api 的 base_url
timeout: 20000, // 请求超时时间 // timeout: 5000, // 请求超时时间
headers: {} headers: {}
}); });
...@@ -14,13 +14,12 @@ service.interceptors.request.use( ...@@ -14,13 +14,12 @@ service.interceptors.request.use(
config => { config => {
let token = getCookie("token"); let token = getCookie("token");
let userpin = getCookie("userpin"); let userpin = getCookie("userpin");
console.log(config);
if (token) { if (token) {
config.headers["token"] = token; // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers["token"] = token; // 让每个请求携带自定义token 请根据实际情况自行修改
} }
if (!userpin) { if (!userpin) {
if ( if (
config.url != "/a/web/action/tmOrder/springBoard" || config.url != "/api/web/action/tmOrder/springBoard" &&
config.url != "/api/web/auth/accessAuth/springBoard" config.url != "/api/web/auth/accessAuth/springBoard"
) { ) {
Message("请重新登录"); Message("请重新登录");
......
...@@ -16,6 +16,14 @@ import VueClipboard from "vue-clipboard2"; ...@@ -16,6 +16,14 @@ import VueClipboard from "vue-clipboard2";
// 使用bus进行通信 // 使用bus进行通信
import VueBus from "vue-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 => { getTokens().then(res => {
//存储token //存储token
seveCookie("token", res.data.data.token); seveCookie("token", res.data.data.token);
......
...@@ -110,7 +110,6 @@ const router = new VueRouter({ ...@@ -110,7 +110,6 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
let userpin = getCookie("userpin"); let userpin = getCookie("userpin");
console.log(to.path);
if ( if (
to.path == "/user/login" || to.path == "/user/login" ||
to.path == "/user/register" || to.path == "/user/register" ||
......
...@@ -16,10 +16,15 @@ ...@@ -16,10 +16,15 @@
</el-form-item> </el-form-item>
<div v-if="ruleForm.resource == 1"> <div v-if="ruleForm.resource == 1">
<el-form-item label="公司名称:" prop="name"> <el-form-item label="公司名称:" prop="name">
<el-input <el-autocomplete
v-model="ruleForm.name" v-model="ruleForm.name"
:fetch-suggestions="querySearchAsync"
placeholder="请输入公司名称" placeholder="请输入公司名称"
></el-input> @select="handleSelect"
:trigger-on-focus="false"
clearable
:debounce="700"
></el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="统一社会信用代码:" prop="xinyongma"> <el-form-item label="统一社会信用代码:" prop="xinyongma">
<el-input <el-input
...@@ -60,11 +65,12 @@ ...@@ -60,11 +65,12 @@
<el-input <el-input
v-model="ruleForm.idCard" v-model="ruleForm.idCard"
placeholder="请输入您的身份证号" placeholder="请输入您的身份证号"
:maxlength="18"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="注册地址:" prop="name"> <el-form-item label="注册地址:" prop="name">
<el-input <el-input
v-model="ruleForm.idCard" v-model="ruleForm.zhuAddress"
placeholder="请输入注册地址" placeholder="请输入注册地址"
></el-input> ></el-input>
</el-form-item> </el-form-item>
...@@ -91,20 +97,20 @@ ...@@ -91,20 +97,20 @@
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<div class="drawer-bottom"> <div class="drawer-bottom">
<button class="esc">取消</button> <button class="esc">取消</button>
<button class="enter">保存</button> <button class="enter" @click="addMessage">保存</button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getCompanyInfoByLikeName } from "@/api/tmTools.js";
export default { export default {
data() { data() {
return { return {
ruleForm: { ruleForm: {
name: "", name: "",
resource: 1, resource: 1,
xinyongma: "", xinyongma: "",
address: "", address: "",
...@@ -128,7 +134,25 @@ export default { ...@@ -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> </script>
<style lang="scss"> <style lang="scss">
......
...@@ -37,13 +37,21 @@ ...@@ -37,13 +37,21 @@
> >
<div class="trademark-name"> <div class="trademark-name">
<div class="div"> <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> <el-button @click="automatic">自动生成</el-button>
</div> </div>
<div class="div"> <div class="div">
<div class="trademarkImg"> <div class="trademarkImg">
<div class="loadingImg" v-loading="loading"></div> <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> </div>
<p> <p>
<i class="el-icon-warning"></i <i class="el-icon-warning"></i
...@@ -59,8 +67,16 @@ ...@@ -59,8 +67,16 @@
> >
<div class="trademark-name"> <div class="trademark-name">
<div class="div"> <div class="div">
<div class="trademarkImg"> <div class="trademarkImg" v-loading="loading">
<img src="" alt="" /> <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>
<div class="p-left"> <div class="p-left">
<p> <p>
...@@ -118,8 +134,12 @@ ...@@ -118,8 +134,12 @@
</template> </template>
<script> <script>
import { word2pic } from "@/api/tmTools.js"; import { word2pic, getOss, uploadStandardTm } from "@/api/tmTools.js";
import UploadImg from "@/components/uploadImg";
export default { export default {
components: {
UploadImg
},
data() { data() {
return { return {
drawerRight: false, drawerRight: false,
...@@ -134,10 +154,57 @@ export default { ...@@ -134,10 +154,57 @@ export default {
resource: [{ required: true, message: "", trigger: "change" }] resource: [{ required: true, message: "", trigger: "change" }]
}, },
imgUrl: "", 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: { 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) { lookImg(title, index) {
this.drawerTitle = title; this.drawerTitle = title;
this.lookIndex = index; this.lookIndex = index;
...@@ -154,7 +221,8 @@ export default { ...@@ -154,7 +221,8 @@ export default {
} }
}); });
} }
} },
manualupload() {}
} }
}; };
</script> </script>
...@@ -204,6 +272,7 @@ export default { ...@@ -204,6 +272,7 @@ export default {
border-radius: 100px; border-radius: 100px;
color: rgb(102, 102, 102); color: rgb(102, 102, 102);
font-size: 12px; font-size: 12px;
position: relative;
} }
.trademarkImg { .trademarkImg {
width: 124px; width: 124px;
......
...@@ -123,8 +123,7 @@ export default { ...@@ -123,8 +123,7 @@ export default {
// 点击购买去相应的购买页面 // 点击购买去相应的购买页面
goOwnBuyPage(index) { goOwnBuyPage(index) {
if (index == 0) { if (index == 0) {
location.href = this.$router.push("/selftmreg")
"https://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=https://tm.plus.jdcloud.com/jdtm/getUser&state=selftmreg&client_id=9491577327154697";
} }
if (index == 1) { if (index == 1) {
location.href = "https://market.jdcloud.com/service/details/582208"; location.href = "https://market.jdcloud.com/service/details/582208";
......
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
methods: { methods: {
submitForm() { submitForm() {
if (this.active) { if (this.active) {
console.log(123); this.$router.push();
} }
} }
} }
......
...@@ -146,5 +146,6 @@ export default {}; ...@@ -146,5 +146,6 @@ export default {};
/* 激活后,高亮背景 优先级最高*/ /* 激活后,高亮背景 优先级最高*/
.active { .active {
background: #51d2b7 !important; background: #51d2b7 !important;
color: #fff;
} }
</style> </style>
<template> <template>
<div class="user"> <div class="user">
<Globalheader title="登录" url="/jdtrademark" name="首页" /> <!-- <Globalheader title="" url="/jdtrademark" name="首页" /> -->
<div class="user-main"> <div class="user-main">
<div class="user-main-mid"> <div class="user-main-mid">
<div class="user-main-left"> <div class="user-main-left">
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
</template> </template>
<script> <script>
import Globalheader from "@/components/globalheader"; // import Globalheader from "@/components/globalheader";
export default { export default {
components: { // components: {
Globalheader // Globalheader
}, // },
data() { data() {
return { return {
activeName: "first" 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