删除顶部的tab

This commit is contained in:
A1300399510
2024-09-10 14:47:51 +08:00
parent 7e4169a74e
commit c1be38d400
3 changed files with 21 additions and 73 deletions

View File

@@ -12,17 +12,10 @@
</head>
<body>
<div id="app">
<div class="tab-box">
<div class="tab">
<div class="item" :class="{'pitch': tab == 'offer'}" @click="cutTab('offer')">Offer</div>
<div class="item" :class="{'pitch': tab == 'summary'}" @click="cutTab('summary')">总结</div>
</div>
</div>
<div class="operate flexacenter">
<input placeholder="请输入" v-model="inputText" @keyup.enter="confirm()" />
<div class="btn" @click="confirm()">确定</div>
<div class="btn" @click="saveimage()">生成图片</div>
<div class="btn" :class="{ disabled: !isClickable }" :disabled="!isClickable" @click="saveimage()">生成图片</div>
</div>
<div class="main">
<template v-if="tab == 'offer' && JSON.stringify(offerinfo) !== '{}'">
@@ -458,6 +451,11 @@
this.arrowyellow = arrowyellow
this.arrowsgray = arrowsgray
},
computed: {
isClickable() {
return JSON.stringify(this.offerinfo) !== '{}' || JSON.stringify(this.info) !== '{}'
},
},
methods: {
getBase64ImageFromURL(type, index) {
if (type == "offer") {
@@ -721,18 +719,13 @@
this.personalBgGraduate = personalBgGraduate
},
// 切换类型
cutTab(key) {
this.offerinfo = {}
this.info = {}
if (key == this.tab) return
this.tab = key
},
// 确定
confirm() {
if (!this.inputText) return
if (this.inputText.indexOf("/details/") > 0) this.tab = "offer"
else this.tab = "summary"
if (this.inputText.indexOf("http") != -1) this.inputId = this.inputText.substring(this.inputText.lastIndexOf("/") + 1)
else this.inputId = this.inputText