用nuiApp+php实现抖音小程序艺术签名

下面直接上代码
<template>
<view>
<swiper class="banner" indicator-dots='true' mode="widthFix" indicator-color='#333' indicator-active-color='#f30' autoplay='true'>
<swiper-item>
<image src='https://chatgpt.goolibao.com/static/uploads/banner.jpg' mode="widthFix" ></image>
</swiper-item>
<swiper-item>
<image src='https://chatgpt.goolibao.com/static/uploads/banner1.jpg' mode="widthFix"></image>
</swiper-item>
<swiper-item>
<image src='https://chatgpt.goolibao.com/static/uploads/banner2.jpg' mode="widthFix"></image>
</swiper-item>
</swiper>
<input v-model="name" placeholder="请输入2-4个字的姓名" />
<div class="tab-container">
<div :class="['tab', { active: type === '901' }]" @click="handleTabClick('901')">一笔艺术签</div>
<div :class="['tab', { active: type === '905' }]" @click="handleTabClick('905')">一笔商务签</div>
<div :class="['tab', { active: type === '5' }]" @click="handleTabClick('5')">明星手写</div>
</div>
<button class="zoom-animation" @click="handleDesign">设计签名</button>
<image v-if="imageUrl && showImage" :src="imageUrl"></image>
<view v-if="isLoading">
<text>正在加载中...</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
name: '',
type: '901',
color: '#000000',
imageUrl: '',
showImage: false,
isLoading: false
}
},
methods: {
handleTabClick(value) {
this.type = value
},
handleDesign() {
if (this.showImage) {
this.showImage = false
this.imageUrl = ''
}
uni.request({
url: '抖音信息安全接口地址/iii.php',
method: 'POST',
header: {
'Content-Type': 'application/json'
},
data: {
tasks: [
{
content: this.name
}
]
},
success: (res) => {
console.log(res.data)
if (res.data.data[0].predicts[0].hit) {
uni.showToast({
title: '输入的名字疑似违规,请重新输入',
icon: 'none'
})
} else {
this.showModal()
}
},
fail: (err) => {
console.error(err)
}
})
},
showModal() {
if (this.showImage) {
this.showImage = false
this.imageUrl = ''
}
uni.showModal({
content: '获得需要观看完广告视频,才获得权限',
cancelText: '不看了',
confirmText: '观看',
success: (res) => {
if (res.confirm) {
this.isWatch = true
this.isLoading = true
this.requestAPI()
} else {
uni.showToast({ title: '嘤嘤嘤!心诚则灵嘛', duration: 3000 })
}
}
})
},
requestAPI() {
uni.showLoading({
title: '加载中'
})
const rewardedVideoAd = tt.createRewardedVideoAd({
adUnitId: '6uxegf22tlasyahw7j'
})
rewardedVideoAd.onLoad(() => {
console.log('激励视频广告加载成功')
})
rewardedVideoAd.onError((err) => {
console.log('激励视频广告加载失败', err)
})
rewardedVideoAd.onClose((res) => {
if (res.isEnded) {
console.log('激励视频广告观看完整')
if (!this.showImage) {
this.showImage = true
}
} else {
console.log('激励视频广告提前关闭')
}
})
rewardedVideoAd.load().then(() => {
console.log('激励视频广告加载成功')
rewardedVideoAd.show().then(() => {
console.log('激励视频广告显示成功')
}).catch((err) => {
console.log('激励视频广告显示失败', err)
})
}).catch((err) => {
console.log('激励视频广告加载失败', err)
})
uni.request({
url: '签名接口地址',
method: 'GET',
data: {
id: this.name,
zhenbi: '20191123',
id1: '1000',
id2: this.type,
id3: this.color
},
success: (res) => {
this.imageUrl = res.data
},
fail: (err) => {
console.log(err)
},
complete: () => {
uni.hideLoading()
this.isLoading = false
}
})
}
}
}
</script>
<style>
.zoom-animation {
animation: zoom 2s infinite;
margin-top: 20px;
width: 80%;
}
.tab-container {
display: flex;
justify-content: center;
margin-top: 20px;
width: 100%;
max-width: 90%;
margin: 0 auto;
margin-top: 20px;
}
input {
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
margin-bottom: 10px;
width: 90%;
margin: 0 auto;
margin-top: 20px;
}
.tab {
padding: 10px 20px;
cursor: pointer;
background-color: #ccc;
color: #000;
margin-right: 10px;
}
.active {
background-color: #007bff;
color: #fff;
}
.zoom-animation {
animation: zoom 2s infinite;
}
@keyframes zoom {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
swiper {
height: 300rpx;
width: 750rpx;
}
swiper image {
width: 100%;
}
</style>
下载说明:
1、本站所有资源均从互联网上收集整理而来,仅供学习交流之用,因此不包含技术服务请大家谅解!
2、本站不提供任何实质性的付费和支付资源,所有需要积分下载的资源均为网站日常活跃所需,积分可通过日常活跃免费获得!
3、本站所有资源仅用于学习及研究使用,您必须在下载后的24小时内删除所下载资源,切勿用于商业用途,否则由此引发的法律纠纷及连带责任本站和发布者概不承担!
4、本站站内提供的所有可下载资源,本站保证未做任何负面改动(不包含修复bug和完善功能等正面优化或二次开发),但本站不保证资源的准确性、安全性和完整性,用户下载后自行斟酌,我们以交流学习为目的,并不是所有的源码都100%无错或无bug!如有链接无法下载、失效或广告,请联系客服处理!
5、本站资源除标明原创外均来自网络整理,版权归原作者或本站特约原创作者所有,如侵犯到您的合法权益,请立即告知本站,本站将及时予与删除并致以最深的歉意!
6、如果您也有好的资源或教程,您可以投稿发布,成功分享后有站币奖励,同时还能获得对应的人气!
7、如果您喜欢该资源,请支持官方正版资源,以得到更好的正版服务!
8、请您认真阅读上述内容,注册本站用户或下载本站资源即您同意上述内容!
原文链接:http://www.yonghengzy.cn/43097.html,转载请注明出处。
1、本站所有资源均从互联网上收集整理而来,仅供学习交流之用,因此不包含技术服务请大家谅解!
2、本站不提供任何实质性的付费和支付资源,所有需要积分下载的资源均为网站日常活跃所需,积分可通过日常活跃免费获得!
3、本站所有资源仅用于学习及研究使用,您必须在下载后的24小时内删除所下载资源,切勿用于商业用途,否则由此引发的法律纠纷及连带责任本站和发布者概不承担!
4、本站站内提供的所有可下载资源,本站保证未做任何负面改动(不包含修复bug和完善功能等正面优化或二次开发),但本站不保证资源的准确性、安全性和完整性,用户下载后自行斟酌,我们以交流学习为目的,并不是所有的源码都100%无错或无bug!如有链接无法下载、失效或广告,请联系客服处理!
5、本站资源除标明原创外均来自网络整理,版权归原作者或本站特约原创作者所有,如侵犯到您的合法权益,请立即告知本站,本站将及时予与删除并致以最深的歉意!
6、如果您也有好的资源或教程,您可以投稿发布,成功分享后有站币奖励,同时还能获得对应的人气!
7、如果您喜欢该资源,请支持官方正版资源,以得到更好的正版服务!
8、请您认真阅读上述内容,注册本站用户或下载本站资源即您同意上述内容!
原文链接:http://www.yonghengzy.cn/43097.html,转载请注明出处。
评论0