提交 18991ed7 authored 作者: 王鹏飞's avatar 王鹏飞

feat: 链接增加视频号

上级 f5fdb183
......@@ -5,6 +5,7 @@ import type { DetailsProp, PlatformItem, ConfigAttribute } from '../types'
const StepOne = defineAsyncComponent(() => import('../components/StepOne.vue'))
const StepTwo = defineAsyncComponent(() => import('../components/StepTwo.vue'))
const WechatVideo = defineAsyncComponent(() => import('../components/WechatVideo.vue'))
const props = defineProps<{ data?: DetailsProp }>()
......@@ -18,7 +19,7 @@ const platformList: PlatformItem[] = [
type: '1',
type_name: '公众号',
config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }
{ label: '连接名称', prop: 'name', value: '' },
// { label: '公众号类型', prop: 'type', value: '' },
// { label: '授权方昵称', prop: 'nikeName', value: '' }
],
......@@ -30,7 +31,7 @@ const platformList: PlatformItem[] = [
return false
}
return true
}
},
},
{
type: '2',
......@@ -39,8 +40,8 @@ const platformList: PlatformItem[] = [
{ label: '连接名称', prop: 'name', value: '钉钉' },
{ label: 'AgentId', prop: 'agentId', value: '8441459810' },
{ label: 'AppKey', prop: 'appKey', value: 'dingigucs3beqlotpf24' },
{ label: 'AppSecret', prop: 'appSecret', value: '6dNRvuOzvX_xq5N9tFdjepdf3FeooN25yUZK6ammDbPUVq9sfdXD-sKUg' }
]
{ label: 'AppSecret', prop: 'appSecret', value: '6dNRvuOzvX_xq5N9tFdjepdf3FeooN25yUZK6ammDbPUVq9sfdXD-sKUg' },
],
},
{
type: '3',
......@@ -49,8 +50,8 @@ const platformList: PlatformItem[] = [
{ label: '连接名称', prop: 'name', value: '小鹅通' },
{ label: 'app_id', prop: 'app_id', value: 'appc4bolgenF58' },
{ label: 'client_id', prop: 'client_id', value: '_5e7f809dd6317_qSMuUoAi?type=2SDK' },
{ label: 'secret_key', prop: 'secret_key', value: 'xiao_5ac1dd24803ae_GtfAOxiS1pdf3FeooN2huhu92WRE52S-SkOh' }
]
{ label: 'secret_key', prop: 'secret_key', value: 'xiao_5ac1dd24803ae_GtfAOxiS1pdf3FeooN2huhu92WRE52S-SkOh' },
],
},
{
type: '4',
......@@ -58,8 +59,8 @@ const platformList: PlatformItem[] = [
config_attributes: [
{ label: '连接名称', prop: 'name', value: '问卷星' },
{ label: 'AppKey', prop: 'appKey', value: '82286f9c5114dc2bda214cd9567dodc' },
{ label: 'AppSecret', prop: 'appSecret', value: 'pages/wjxqList/wjxqList?activityId= P251FBP' }
]
{ label: 'AppSecret', prop: 'appSecret', value: 'pages/wjxqList/wjxqList?activityId= P251FBP' },
],
},
{ type: '5', type_name: '今日头条', config_attributes: [{ label: '连接名称', prop: 'name', value: '今日头条' }] },
{
......@@ -73,11 +74,11 @@ const platformList: PlatformItem[] = [
label: '网站应用简介',
prop: 'dyInput3',
value:
'不仅是下载抖音应用程序的官方渠道,也是一个展示抖音最新动态、功能更新和推广活动的平台。用户可以通过官网了解抖音的特色功能、查看热门视频、参与互动活动,以及获取帮助和教程等。官网还为创作者和企业提供了一个展示空间,让他们了解如何利用抖音平台进行内容创作、品牌推广和电子商务等。'
'不仅是下载抖音应用程序的官方渠道,也是一个展示抖音最新动态、功能更新和推广活动的平台。用户可以通过官网了解抖音的特色功能、查看热门视频、参与互动活动,以及获取帮助和教程等。官网还为创作者和企业提供了一个展示空间,让他们了解如何利用抖音平台进行内容创作、品牌推广和电子商务等。',
},
{ label: '应用官网', prop: 'dyInput4', value: 'https://www.douyin.com' },
{ label: '联系人姓名', prop: 'dyInput5', value: '清控紫荆(北京)教育股份有限公司' }
]
{ label: '联系人姓名', prop: 'dyInput5', value: '清控紫荆(北京)教育股份有限公司' },
],
},
{
type: '7',
......@@ -85,8 +86,8 @@ const platformList: PlatformItem[] = [
config_attributes: [
{ label: '连接名称', prop: 'name', value: '微博' },
{ label: 'AppKey', prop: 'appKey', value: '1206405345' },
{ label: 'AppSecret', prop: 'appSecret', value: '6a6095e113cd28fde6e14c7b7145c5c5' }
]
{ label: 'AppSecret', prop: 'appSecret', value: '6a6095e113cd28fde6e14c7b7145c5c5' },
],
},
{
type: '8',
......@@ -94,8 +95,8 @@ const platformList: PlatformItem[] = [
config_attributes: [
{ label: '连接名称', prop: 'name', value: '小红书' },
{ label: 'AppKey', prop: 'appKey', value: '6c1dd8dd64d074d56124c751f6bc240b' },
{ label: 'AppSecret', prop: 'appSecret', value: '' }
]
{ label: 'AppSecret', prop: 'appSecret', value: '' },
],
},
{
type: '9',
......@@ -105,8 +106,8 @@ const platformList: PlatformItem[] = [
{ label: 'client_id', prop: 'client_id', value: 'swanzhong' },
{ label: 'client_secret', prop: 'client_secret', value: '563a8c6a89d2368194c1c7889c508b34' },
{ label: 'token URL', prop: 'token', value: 'openapi/user/get' },
{ label: 'API URL', prop: 'apiUrl', value: 'openapi/user/check' }
]
{ label: 'API URL', prop: 'apiUrl', value: 'openapi/user/check' },
],
},
{
type: '10',
......@@ -116,8 +117,8 @@ const platformList: PlatformItem[] = [
{ label: 'client_id', prop: 'client_id', value: 'FbFgN2of-mlc' },
{ label: 'SdkAppId', prop: 'sdkAppId', value: 'CV3X1%2FJG7mdNZm03l9puvwPAktmfw1aj8XvBb6sm696MqoW57' },
{ label: 'token URL', prop: 'token', value: 'https://oauth-login.cloud.ali.com/oauth2/v3/token' },
{ label: 'API URL', prop: 'apiUrl', value: 'oauth2v3wPAktm' }
]
{ label: 'API URL', prop: 'apiUrl', value: 'oauth2v3wPAktm' },
],
},
{ type_name: '内部消息', type: '11', config_attributes: [{ label: '连接名称', prop: 'name', value: '内部消息' }] },
{
......@@ -126,14 +127,14 @@ const platformList: PlatformItem[] = [
config_attributes: [
{ label: '连接名称', prop: 'name', value: '自定义' },
{ label: 'APP类型', prop: 'appType', value: '自定义' },
{ label: 'AppId', prop: 'appId', value: 'Custom App ID' }
]
{ label: 'AppId', prop: 'appId', value: 'Custom App ID' },
],
},
{
type: '13',
type_name: '紫荆表单',
icon: '99',
config_attributes: [{ label: '连接名称', prop: 'name', value: '紫荆表单' }]
config_attributes: [{ label: '连接名称', prop: 'name', value: '紫荆表单' }],
},
{
type: '14',
......@@ -148,14 +149,32 @@ const platformList: PlatformItem[] = [
return false
}
return true
}
},
},
{
icon: 'mall',
type: '15',
type_name: '紫荆商城',
config_attributes: [{ label: '连接名称', prop: 'name', value: '紫荆商城' }]
}
config_attributes: [{ label: '连接名称', prop: 'name', value: '紫荆商城' }],
},
{
icon: 'wechatVideo',
type: '16',
type_name: '视频号',
config_attributes: [{ label: '连接名称', prop: 'name', value: '视频号' }],
async onBeforePrev(stepActive) {
if (stepActive == 2) {
return wechatVideoRef.value?.handlePrev()
}
return true
},
async onBeforeNext(stepActive) {
if (stepActive == 2) {
return wechatVideoRef.value?.handleNext()
}
return true
},
},
]
// 请求参数
......@@ -172,7 +191,7 @@ watchEffect(() => {
Object.assign(params, { type, config_attributes: attributes })
})
const selectedItem = computed(() => platformList.find(item => item.type === params.type))
const selectedItem = computed(() => platformList.find((item) => item.type === params.type))
const defaultStepActive = props.data?.id ? 2 : 1
const stepActive = ref(defaultStepActive)
......@@ -183,13 +202,17 @@ function handleChange(data: PlatformItem) {
}
// 上一步
function handlePrev() {
async function handlePrev() {
if (selectedItem.value?.onBeforePrev) {
const next = await selectedItem.value?.onBeforePrev(stepActive.value, selectedItem.value)
if (!next) return
}
stepActive.value--
}
// 下一步
async function handleNext() {
const isEmpty = params.config_attributes.find(item => item.value === '')
const isEmpty = params.config_attributes.find((item) => item.value === '')
if (isEmpty && stepActive.value === 2) {
ElMessage('请填写完整')
return
......@@ -223,6 +246,8 @@ async function handleSave() {
emit('update')
emit('update:modelValue', false)
}
const wechatVideoRef = ref<any>(null)
</script>
<template>
......@@ -239,7 +264,13 @@ async function handleSave() {
</el-tab-pane>
<!-- 第二步 -->
<el-tab-pane disabled lazy label="配置连接信息" :name="2">
<StepTwo :platform="selectedItem" v-model="params.config_attributes" v-if="selectedItem"></StepTwo>
<template v-if="selectedItem">
<WechatVideo
ref="wechatVideoRef"
v-model="params.config_attributes"
v-if="params.type === '16'"></WechatVideo>
<StepTwo :platform="selectedItem" v-model="params.config_attributes" v-else></StepTwo>
</template>
</el-tab-pane>
<el-tab-pane disabled lazy label="测试连接" :name="3">
<el-button type="primary" @click="handleTest">测试连接</el-button>
......
......@@ -50,6 +50,7 @@ const edit = function () {
const iconMap: Record<string, string> = {
'13': '99',
'14': '100',
'16': 'wechatVideo'
}
const generateUserData = function () {
......
<script setup>
defineProps(['data'])
const step = ref(1)
const stepLength = 4
function handlePrev() {
if (step.value === 1) return true
step.value--
}
function handleNext() {
if (step.value === stepLength) return true
step.value++
}
defineExpose({ step, handlePrev, handleNext })
</script>
<template>
<div class="wechat-video">
<div class="wechat-video-step" v-show="step === 1">
<h6 class="wechat-video-step__title">第1步:请点击下图示例的“视频号”</h6>
<img src="/wechat_video/1.png" />
</div>
<div class="wechat-video-step" v-show="step === 2">
<h6 class="wechat-video-step__title">第2步:请点击下图示例的</h6>
<img src="/wechat_video/2.png" />
</div>
<div class="wechat-video-step" v-show="step === 3">
<h6 class="wechat-video-step__title">第3步:请点击下图示例的“发表视频”</h6>
<img src="/wechat_video/3.png" />
</div>
<div class="wechat-video-step" v-show="step === 4">
<h6 class="wechat-video-step__title">第4步:上传头像,维护视频号名称,勾选相关规范和隐私说明,点击“创建”</h6>
<img src="/wechat_video/4.png" />
</div>
</div>
</template>
<style lang="scss">
.wechat-video {
.wechat-video-step {
margin-bottom: 20px;
img {
display: block;
width: 375px;
margin: 0 auto;
}
&__title {
margin-bottom: 20px;
}
}
}
</style>
......@@ -22,6 +22,7 @@ export interface PlatformItem {
type_name: string
icon?: string
config_attributes?: ConfigAttribute[]
onBeforePrev?: (index: number, data: PlatformItem) => Promise<boolean> | boolean
onBeforeNext?: (index: number, data: PlatformItem) => Promise<boolean> | boolean
}
......@@ -60,10 +61,10 @@ export interface OtherFields {
rule: any
}
export interface StudentFollow{
export interface StudentFollow {
follow_flag: string
logs: any[] | undefined
connect_id: string
type: string
data: any
}
\ No newline at end of file
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论