|
@@ -7,14 +7,16 @@ import { getDesignerInfo, updateDesignerInfo } from '../../../../core/libs/reque
|
|
import { useUserStore } from '../../../../store'
|
|
import { useUserStore } from '../../../../store'
|
|
import { storeToRefs } from 'pinia'
|
|
import { storeToRefs } from 'pinia'
|
|
import { pick } from 'radash'
|
|
import { pick } from 'radash'
|
|
-import { requestToast } from '../../../../core/utils/common'
|
|
|
|
|
|
+import { requestToast, validate } from '../../../../core/utils/common'
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
import { useMessage } from 'wot-design-uni'
|
|
import { useMessage } from 'wot-design-uni'
|
|
import { NetImages } from '../../../../core/libs/net-images'
|
|
import { NetImages } from '../../../../core/libs/net-images'
|
|
|
|
+import {useRouter} from "@/core/utils/router";
|
|
|
|
|
|
-const { alert } = useMessage()
|
|
|
|
|
|
+const { alert, confirm } = useMessage('wd-message-box-slot')
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
const { userInfo } = storeToRefs(userStore)
|
|
const { userInfo } = storeToRefs(userStore)
|
|
|
|
+const {back} = useRouter()
|
|
const form = ref<{
|
|
const form = ref<{
|
|
userId?: number
|
|
userId?: number
|
|
videoNumber?: string
|
|
videoNumber?: string
|
|
@@ -22,9 +24,27 @@ const form = ref<{
|
|
const { data, run: setData } = useRequest(() => getDesignerInfo(userInfo.value.userId))
|
|
const { data, run: setData } = useRequest(() => getDesignerInfo(userInfo.value.userId))
|
|
const { loading, run: submiting } = useRequest(() => updateDesignerInfo(form.value))
|
|
const { loading, run: submiting } = useRequest(() => updateDesignerInfo(form.value))
|
|
const handleSubmit = async () => {
|
|
const handleSubmit = async () => {
|
|
- await submiting()
|
|
|
|
- await setData()
|
|
|
|
- alert({ title: '关联成功', confirmButtonText: '我知道了' })
|
|
|
|
|
|
+ if (!validate(form.value, { videoNumber: [{ required: true, message: '请输入视频号ID' }] }))
|
|
|
|
+ return
|
|
|
|
+ const { action } = await confirm({
|
|
|
|
+ title: '温馨提示',
|
|
|
|
+ confirmButtonText: '同意并关联',
|
|
|
|
+ cancelButtonText: '不同意',
|
|
|
|
+ })
|
|
|
|
+ console.log(action)
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
+ await submiting()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '视频号关联成功',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ success: () => {
|
|
|
|
+ back()
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ await setData()
|
|
|
|
+ }
|
|
|
|
+ // await alert({ title: '关联成功', confirmButtonText: '我知道了' })
|
|
}
|
|
}
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await setData()
|
|
await setData()
|
|
@@ -44,20 +64,35 @@ onMounted(async () => {
|
|
</div>
|
|
</div>
|
|
<SectionHeading title="如何关联视频号?" size="sm"></SectionHeading>
|
|
<SectionHeading title="如何关联视频号?" size="sm"></SectionHeading>
|
|
<wd-img class="rounded-2xl" width="100%" mode="widthFix" :src="NetImages.WechatChannelsGuide" />
|
|
<wd-img class="rounded-2xl" width="100%" mode="widthFix" :src="NetImages.WechatChannelsGuide" />
|
|
- <BottomAppBar fixed :border="false">
|
|
|
|
|
|
+ <SectionHeading title="视频教程" size="sm"></SectionHeading>
|
|
|
|
+ <div class="aspect-[1.87/1] rounded-2xl overflow-hidden">
|
|
|
|
+ <video class="w-full h-full" :src="NetImages.VideoTutorial"></video>
|
|
|
|
+ </div>
|
|
|
|
+ <BottomAppBar fixed placeholder :border="false" v-if="(data.videoNumber ?? '') === ''">
|
|
<div>
|
|
<div>
|
|
- <div class="text-center mb-5.5">
|
|
|
|
- <span class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-tight">
|
|
|
|
- 点击确认关联即表示同意
|
|
|
|
- </span>
|
|
|
|
- <span class="text-[#0cbe7c] text-xs font-normal font-['PingFang_SC'] leading-tight">
|
|
|
|
- 《个人微信视频号授权使用协议》
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- <div class="text-center mb-5.5">-->
|
|
|
|
+ <!-- <span class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-tight">-->
|
|
|
|
+ <!-- 点击确认关联即表示同意-->
|
|
|
|
+ <!-- </span>-->
|
|
|
|
+ <!-- <span class="text-[#0cbe7c] text-xs font-normal font-['PingFang_SC'] leading-tight">-->
|
|
|
|
+ <!-- 《个人微信视频号授权使用协议》-->
|
|
|
|
+ <!-- </span>-->
|
|
|
|
+ <!-- </div>-->
|
|
<wd-button :round="false" block :loading="loading" @click="handleSubmit">
|
|
<wd-button :round="false" block :loading="loading" @click="handleSubmit">
|
|
确定关联
|
|
确定关联
|
|
</wd-button>
|
|
</wd-button>
|
|
</div>
|
|
</div>
|
|
</BottomAppBar>
|
|
</BottomAppBar>
|
|
|
|
+
|
|
|
|
+ <wd-message-box selector="wd-message-box-slot">
|
|
|
|
+ <div class="">
|
|
|
|
+ <span class="text-black/40 text-base font-normal font-['PingFang SC'] leading-relaxed">
|
|
|
|
+ 关联后,小程序开发者将获取您的视频号相关信息,并为您提供相关服务,请您充分阅读
|
|
|
|
+ </span>
|
|
|
|
+ <span class="text-[#3f598f] text-base font-normal font-['PingFang SC'] leading-relaxed">
|
|
|
|
+ 《个人微信视频号授权使用协议》
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </wd-message-box>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|