zhangqin преди 1 седмица
родител
ревизия
a79f859e2b
променени са 1 файла, в които са добавени 78 реда и са изтрити 2 реда
  1. 78 2
      src/views/adv/promotionAccount/index.vue

+ 78 - 2
src/views/adv/promotionAccount/index.vue

@@ -66,8 +66,15 @@
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240" fixed="right">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-check"
+            @click="handleVerify(scope.row)"
+            :disabled="!scope.row.authUrl"
+          >验证</el-button>
           <el-button
             size="mini"
             type="text"
@@ -121,6 +128,14 @@
               />
             </el-select>
           </el-form-item>
+          <!-- 如何申请API按钮 -->
+          <el-form-item v-if="form.advertiserId" label=" " class="api-help-button">
+            <el-button 
+              type="text" 
+              @click="openApiHelp"
+              icon="el-icon-question"
+            >如何申请API</el-button>
+          </el-form-item>
           <!-- <el-form-item label="配置方式" prop="configMode">
             <el-radio-group v-model="form.configMode">
               <el-radio :label="1" :border="true">服务模式</el-radio>
@@ -202,7 +217,7 @@
                 clearable
               />
             </el-form-item>
-            <el-form-item label="应用授权链接" prop="authUrl" class="slide-fade">
+            <el-form-item v-if="form.advertiserId !== 10002" label="应用授权链接" prop="authUrl" class="slide-fade">
               <el-input 
                 v-model="form.authUrl" 
                 placeholder="请输入应用授权链接"
@@ -262,6 +277,15 @@ export default {
       // 表单参数
       form: {
       },
+      // API文档URL映射
+      apiDocumentUrls: {
+        10001: 'https://probe.bjmantis.net/msp/prmt/help/api/BAIDU.pdf',
+        10002: 'https://probe.bjmantis.net/msp/prmt/help/api/TOUTIAO.pdf',
+        10003: 'https://probe.bjmantis.net/msp/prmt/help/api/GDT.pdf',
+        10004: 'https://probe.bjmantis.net/msp/prmt/help/api/OPPO.pdf',
+        10005: 'https://probe.bjmantis.net/msp/prmt/help/api/VIVO.pdf',
+        10006: 'https://probe.bjmantis.net/msp/prmt/help/api/AIQIYI.pdf'
+      },
       // 表单校验
       rules: {
         promotionType: [
@@ -449,6 +473,23 @@ export default {
           this.form.advertiserName = advertiser.advertiserName;
         }
       }
+    },
+    /** 打开API帮助文档 */
+    openApiHelp() {
+      const url = this.apiDocumentUrls[this.form.advertiserId];
+      if (url) {
+        window.open(url, '_blank');
+      } else {
+        this.$message.warning('此广告商暂无法理文档');
+      }
+    },
+    /** 验证按钮操作 */
+    handleVerify(row) {
+      if (!row.authUrl) {
+        this.$message.warning('此账户暂未配置应用授权链接');
+        return;
+      }
+      window.open(row.authUrl, '_blank');
     }
   }
 };
@@ -623,6 +664,41 @@ export default {
   }
 }
 
+// API帮助按钮样式
+.api-help-button {
+  ::v-deep .el-form-item__content {
+    padding-top: 5px;
+  }
+  
+  .el-button {
+    color: #667eea;
+    font-size: 13px;
+    transition: all 0.3s ease;
+    padding: 0;
+    
+    &:hover {
+      color: #764ba2;
+      
+      .el-icon-question {
+        animation: bounce 0.5s ease;
+      }
+    }
+    
+    .el-icon-question {
+      margin-right: 6px;
+    }
+  }
+}
+
+@keyframes bounce {
+  0%, 100% {
+    transform: translateY(0);
+  }
+  50% {
+    transform: translateY(-3px);
+  }
+}
+
 // 按钮样式
 .dialog-footer {
   text-align: right;