278 lines
8.0 KiB
Plaintext
278 lines
8.0 KiB
Plaintext
<template>
|
|
<view class="admin-page-container">
|
|
<view class="page-header">
|
|
<view class="breadcrumb">
|
|
<text class="bc-item">设置</text>
|
|
<text class="bc-sep">/</text>
|
|
<text class="bc-item">接口配置</text>
|
|
<text class="bc-sep">/</text>
|
|
<text class="bc-item active">短信接口配置</text>
|
|
</view>
|
|
</view>
|
|
<view class="content-card">
|
|
<view class="tabs-header">
|
|
<view :class="['tab-item', activeTab == 0 ? 'active' : '']" @click="activeTab = 0">
|
|
<text class="tab-text">基础配置</text>
|
|
</view>
|
|
<view :class="['tab-item', activeTab == 1 ? 'active' : '']" @click="activeTab = 1">
|
|
<text class="tab-text">阿里云配置</text>
|
|
</view>
|
|
<view :class="['tab-item', activeTab == 2 ? 'active' : '']" @click="activeTab = 2">
|
|
<text class="tab-text">腾讯云配置</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 基础配置 -->
|
|
<view class="form-section" v-if="activeTab == 0">
|
|
<view class="form-content">
|
|
<view class="form-row">
|
|
<view class="form-label">短信类型:</view>
|
|
<view class="form-input-box">
|
|
<radio-group class="form-radio-group" @change="onBaseChange('smsType', $event)">
|
|
<label class="radio-label"><radio value="onepass" :checked="form.base.smsType == 'onepass'" color="#2d8cf0" /><text class="radio-text">一号通</text></label>
|
|
<label class="radio-label"><radio value="aliyun" :checked="form.base.smsType == 'aliyun'" color="#2d8cf0" /><text class="radio-text">阿里云</text></label>
|
|
<label class="radio-label"><radio value="tencent" :checked="form.base.smsType == 'tencent'" color="#2d8cf0" /><text class="radio-text">腾讯云</text></label>
|
|
</radio-group>
|
|
<text class="form-tips">短信类型,选择发送的短信类型</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-actions" style="margin-top: 20px;">
|
|
<button class="submit-btn" type="primary" @click="handleSave">提交</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 阿里云配置 -->
|
|
<view class="form-section" v-if="activeTab == 1">
|
|
<view class="form-content">
|
|
<view class="form-row">
|
|
<view class="form-label">AccessKeyId:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.ali.ak" placeholder="请输入AccessKeyId" />
|
|
<text class="form-tips">阿里云AccessKeyId</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">AccessKeySecret:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.ali.sk" placeholder="请输入AccessKeySecret" />
|
|
<text class="form-tips">阿里云AccessKeySecret</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">短信签名:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.ali.sign" placeholder="请输入短信签名" />
|
|
<text class="form-tips">短信签名</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-actions" style="margin-top: 20px;">
|
|
<button class="submit-btn" type="primary" @click="handleSave">提交</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 腾讯云配置 -->
|
|
<view class="form-section" v-if="activeTab == 2">
|
|
<view class="form-content">
|
|
<view class="form-row">
|
|
<view class="form-label">SKD AppID:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.tencent.appId" placeholder="请输入SKD AppID" />
|
|
<text class="form-tips">腾讯云短信应用SKD APPID</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">AccessKeyId:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.tencent.ak" placeholder="请输入AccessKeyId" />
|
|
<text class="form-tips">腾讯云AccessKeyId</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">AccessKeySecret:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.tencent.sk" placeholder="请输入AccessKeySecret" />
|
|
<text class="form-tips">腾讯云AccessKeySecret</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">腾讯云短信签名:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.tencent.sign" placeholder="请输入腾讯云短信签名" />
|
|
<text class="form-tips">腾讯云短信签名</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-row">
|
|
<view class="form-label">短信区域:</view>
|
|
<view class="form-input-box">
|
|
<input class="form-input max-width-input" v-model="form.tencent.region" placeholder="请输入短信区域" />
|
|
<text class="form-tips">短信区域ap-beijing、ap-guangzhou、ap-nanjing任选其一填写</text>
|
|
</view>
|
|
</view>
|
|
<view class="form-actions" style="margin-top: 20px;">
|
|
<button class="submit-btn" type="primary" @click="handleSave">提交</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import { ref, reactive } from 'vue'
|
|
|
|
const activeTab = ref(0)
|
|
const form = reactive({
|
|
base: {
|
|
smsType: 'onepass'
|
|
},
|
|
ali: {
|
|
ak: '',
|
|
sk: '',
|
|
sign: ''
|
|
},
|
|
tencent: {
|
|
appId: '',
|
|
ak: '',
|
|
sk: '',
|
|
sign: '',
|
|
region: ''
|
|
}
|
|
})
|
|
|
|
const onBaseChange = (key : string, e : any) => {
|
|
form.base[key] = e.detail.value
|
|
}
|
|
|
|
const handleSave = () => {
|
|
uni.showToast({
|
|
title: '提交成功',
|
|
icon: 'success'
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.admin-page-container {
|
|
min-height: 100vh;
|
|
background-color: #f5f7f9;
|
|
padding: 20px;
|
|
}
|
|
.breadcrumb {
|
|
display: flex;
|
|
flex-direction: row;
|
|
margin-bottom: 20px;
|
|
}
|
|
.bc-item {
|
|
font-size: 14px;
|
|
color: #999;
|
|
}
|
|
.bc-item.active {
|
|
color: #333;
|
|
}
|
|
.bc-sep {
|
|
margin: 0 8px;
|
|
color: #ccc;
|
|
}
|
|
.content-card {
|
|
background-color: #fff;
|
|
border-radius: 4px;
|
|
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
|
}
|
|
.tabs-header {
|
|
display: flex;
|
|
flex-direction: row;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
padding: 0 30px;
|
|
}
|
|
.tab-item {
|
|
padding: 16px 20px;
|
|
margin-right: 32px;
|
|
cursor: pointer;
|
|
border-bottom: 2px solid transparent;
|
|
}
|
|
.tab-text {
|
|
font-size: 14px;
|
|
color: #666;
|
|
}
|
|
.tab-item.active {
|
|
border-bottom-color: #2d8cf0;
|
|
}
|
|
.tab-item.active .tab-text {
|
|
color: #2d8cf0;
|
|
font-weight: bold;
|
|
}
|
|
.form-section {
|
|
padding: 30px;
|
|
}
|
|
.form-content {
|
|
max-width: 900px;
|
|
}
|
|
.form-row {
|
|
display: flex;
|
|
flex-direction: row;
|
|
margin-bottom: 24px;
|
|
}
|
|
.form-label {
|
|
width: 140px;
|
|
font-size: 14px;
|
|
color: #333;
|
|
text-align: right;
|
|
margin-right: 24px;
|
|
padding-top: 8px;
|
|
}
|
|
.form-input-box {
|
|
flex: 1;
|
|
}
|
|
.form-input {
|
|
width: 100%;
|
|
border: 1px solid #dcdfe6;
|
|
border-radius: 4px;
|
|
height: 34px;
|
|
padding: 0 12px;
|
|
font-size: 14px;
|
|
}
|
|
.max-width-input {
|
|
max-width: 450px;
|
|
}
|
|
.form-tips {
|
|
display: block;
|
|
font-size: 12px;
|
|
color: #999;
|
|
margin-top: 10px;
|
|
line-height: 1.6;
|
|
}
|
|
.form-radio-group {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
height: 34px;
|
|
}
|
|
.radio-label {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
margin-right: 24px;
|
|
}
|
|
.radio-text {
|
|
font-size: 14px;
|
|
margin-left: 6px;
|
|
color: #606266;
|
|
}
|
|
.form-actions {
|
|
padding-left: 164px;
|
|
}
|
|
.submit-btn {
|
|
width: 65px;
|
|
height: 32px;
|
|
background-color: #2d8cf0;
|
|
color: #fff;
|
|
border-radius: 4px;
|
|
font-size: 14px;
|
|
line-height: 32px;
|
|
text-align: center;
|
|
border: none;
|
|
}
|
|
</style>
|