PixelAI-mobile/pages/mobile_web/workshops/index.vue

1400 lines
39 KiB
Vue
Raw Normal View History

2024-12-03 09:34:24 +08:00
<template>
<!-- #ifdef APP -->
<view class="mobile-workshops" :style="{ backgroundImage: `url(${myFileUrl+background})`,paddingTop: CustomBar+'rpx' }">
<view class="app-top" :style="{ height: CustomBar+'rpx',
background: topLevel===0? '#ffffff00' : `rgba(255, 255, 255,${topLevel})` }"></view>
<!-- #endif -->
<!-- #ifndef APP -->
<view class="mobile-workshops" :style="{ backgroundImage: `url(${myFileUrl+background})` }">
<!-- #endif -->
<view class="mwt-top">
2025-02-08 13:39:32 +08:00
<!-- #ifdef MP -->
<view class="app-top" :style="{height: `${StatusBar}px`,background: topLevel===0? '#ffffff00' : `rgba(255, 255, 255,${topLevel})`}"></view>
<view :style="{height: `${StatusBar}px`}"></view>
<view class="mobile-logo" :style="{height: `${CustomBarHeight}px`,backgroundColor: `rgba(255, 255, 255,${topLevel})`}">
<!-- #endif -->
<!-- #ifndef MP -->
2024-12-03 09:34:24 +08:00
<view class="mobile-logo" :style="{backgroundColor: `rgba(255, 255, 255,${topLevel})`}">
2025-02-08 13:39:32 +08:00
<!-- #endif -->
2024-12-03 09:34:24 +08:00
<image :src="myFileUrl+logo"></image>
</view>
<view class="mw-title">
<u-icon name="arrow-left" size="40" color="#fff" class="back" @click="back"></u-icon>
2024-12-06 23:58:58 +08:00
{{ form.name }}
2024-12-03 09:34:24 +08:00
</view>
2024-12-29 16:09:08 +08:00
<view class="mw-upload" v-if="form.type!==4 || (form.type === 4 && resultFile)">
2024-12-10 10:25:46 +08:00
<!-- 文生图-空格位 -->
<view v-if="form.type === 1 && !resultFile"></view>
<!-- 未有结果+类型为文生图可选options -->
<view class="mwu-promt" v-else-if="form.type===3 && !resultFile">
<u-input :customStyle="{color:'#dcf1fc',fontSize:'50rpx'}" v-model="form.text"
placeholder="请输入需要生成的文字" trim inputAlign="center" :clearable="false" :maxlength="6"/>
</view>
<!-- 类型为图生图类 -->
<view class="mwu-cover" v-else-if="uploadFile==''&&form.type!==3&&form.type!==1" @click="selectImage">
2024-12-03 09:34:24 +08:00
<u-icon name="plus-circle" size="100" color="#fff" label="上传图片" labelSize="40"
labelColor="#fff" labelPos="bottom" marginTop="25"></u-icon>
2024-12-29 16:09:08 +08:00
<view class="mwuc-tips">
请上传大小为<text>5KB~5MB</text>的图片
</view>
2024-12-03 09:34:24 +08:00
</view>
2024-12-10 10:25:46 +08:00
<!-- 上传了需修改图 -->
2024-12-03 09:34:24 +08:00
<view class="center-image" v-else-if="resultFile===''">
<image mode="widthFix" :src="uploadFile" @click="selectImage"></image>
</view>
2024-12-10 10:25:46 +08:00
<!-- 结果图 -->
2024-12-03 09:34:24 +08:00
<view class="center-image" v-else>
2025-01-22 20:25:38 +08:00
<image mode="widthFix" :src="getResultImagePath(resultFile)" @click="previewImage"></image>
2024-12-03 09:34:24 +08:00
</view>
2024-12-10 10:25:46 +08:00
<!-- 其他-涂抹重绘 -->
<view class="selections" v-if="!resultFile && form.type===-1">
2025-01-22 20:25:38 +08:00
<view class="selections-item" :style="[getSelectionsStyle(index)]"
2024-12-03 09:34:24 +08:00
v-for="(item,index) in selections" :key="index" @click="currentSelect=index">
{{ item }}
</view>
</view>
</view>
2024-12-10 10:25:46 +08:00
<!-- -->
<view class="mw-editor" v-if="!resultFile && form.type===-1">
2025-01-22 20:25:38 +08:00
<EditorBox :icon="fileUrl+editorIcon" @strengthenTip="strengthenTip"
2024-12-03 09:34:24 +08:00
placeholder="如: 衣服/鞋子/头发或者英文:clothes and shose">
<template #title>
<text class="slot"><text style="color: #d8fa35;">替换</text>的元素</text>
</template>
</EditorBox>
2025-01-22 20:25:38 +08:00
<EditorBox :icon="fileUrl+editorIcon" @strengthenTip="strengthenTip"
2024-12-03 09:34:24 +08:00
placeholder="如: 衣服/鞋子/头发或者英文:clothes and shose">
<template #title>
<text class="slot"><text style="color: #d8fa35;">替换后</text>的图像</text>
</template>
</EditorBox>
</view>
<view class="workshops-tip" v-if="(form.type !== 4 || (form.type === 4 && resultFile)) && (form.type !== 1 || (form.type === 1 && resultFile))">
<view @click="showTutorial" class="tip-content" v-if="asyncPollTime === -1" :style="{color: errorTips?'#e0584b' : '#d5ff00'}">
2025-01-22 20:25:38 +08:00
<u-icon name="question-circle" size="35" :color="errorTips?'#e0584b' : '#c2fc3b'" />
Tips{{resultFile ? errorTips || '点击预览图片效果~' : form.tips||'智能创作~'}}
2025-01-06 00:54:54 +08:00
</view>
<view class="tip-progress" v-if="asyncPollTime !== -1">
2025-01-06 00:54:54 +08:00
<text class="progress-title">进度</text>
<u-line-progress class="uline-progress" :percent="dealPercent" :show-percent="false" inactive-color="#2d3240" round/>
2025-01-06 00:54:54 +08:00
<text class="progress-deal">{{ dealPercent }}%</text>
</view>
2024-12-10 10:25:46 +08:00
</view>
<!-- 文生图 -->
<view class="mw-editor" v-if="!resultFile && form.type===1">
<EditorBox :height="200" :icon="fileUrl+editorIcon" title="提示词"
2025-01-22 20:25:38 +08:00
v-model="form.text" placeholder="请输入描述的提示词(限制300词)~~" rightIcon="question-circle"
rightTip="使用教程" @rightIconClick="showTutorial" @strengthenTip="strengthenTip"/>
2024-12-10 10:25:46 +08:00
</view>
<view class="mw-editor" v-if="!resultFile && form.type===1">
<u-section title="尺寸选择" color="#fff" :right="false" lineColor="#c2ea04" fontSize="34" />
<scroll-view scroll-x>
<view class="dimensional-drawing">
<view class="dimensional-item" v-for="(item,index) in (form.id === 4 ? aliDimensions : volcengineDimensions)" :key="index"
:class="selectSizeIndex===index?'dimensional-item-select':''" @click="selectSize(index)">
<view :style="{ aspectRatio: item.value }"></view>
<text>{{ item.name }}</text>
</view>
</view>
</scroll-view>
</view>
2024-12-10 10:25:46 +08:00
<!-- 提示文字 -->
<view class="mw-editor" v-if="!resultFile && form.type===3">
<EditorBox :icon="fileUrl+editorIcon" title="提示词" v-model="form.promt"
2025-01-22 20:25:38 +08:00
placeholder="请输入描述的提示词(限制300词)~~" rightIcon="question-circle"
rightTip="使用教程" @rightIconClick="showTutorial" @strengthenTip="strengthenTip"/>
2024-12-10 10:25:46 +08:00
</view>
<!-- 选项生图 -->
<view class="mw-editor" v-if="!resultFile && (form.type===2||form.type===3 || form.type === 1)">
2024-12-29 16:09:08 +08:00
<u-section title="类型选择" color="#fff" :right="form.options.length>8" lineColor="#c2ea04" fontSize="34" @click="showMoreOptions = true"
subTitle="更多" :subColor="selectElementIndex>=getOptions.length ? '#b3a0da' : '#eee'"></u-section>
2024-12-10 10:25:46 +08:00
<view class="section-options">
2024-12-29 16:09:08 +08:00
<view class="section-tags" v-for="(item,index) in getOptions" :key="item.id"
:class="selectElementIndex===index?'section-tags-select':''" @click="selectElement(index)">
2024-12-30 19:01:03 +08:00
<image :src="getTypeImage(item.path)"></image>
2024-12-29 16:09:08 +08:00
<text>{{ item.optionName }}</text>
</view>
<!-- <u-tag v-for="(item,index) in getOptions" :key="item.id" :index="index"
2024-12-10 10:25:46 +08:00
:text="item.optionName" @click="selectElement" :class="selectElementIndex===index?'u-tag-select':''"></u-tag>
<u-tag v-if="form.options.length>9" :index="-1" :class="selectElementIndex>=getOptions.length?'u-tag-select':''"
2024-12-29 16:09:08 +08:00
text="更多" @click="showMoreOptions = true"></u-tag> -->
2024-12-10 10:25:46 +08:00
</view>
</view>
<!-- 换衣选择 -->
2024-12-29 16:09:08 +08:00
<view class="mw-editor" style="margin-left: 0;margin-right: 0;" v-if="!resultFile && form.type===4">
2024-12-11 19:36:51 +08:00
<DressSelect ref="dressRef" @previewMannequin="previewMannequin"/>
2024-12-03 09:34:24 +08:00
</view>
</view>
2024-12-10 10:25:46 +08:00
2024-12-03 09:34:24 +08:00
<view class="workshops-btn">
2025-01-22 20:25:38 +08:00
<view class="price-tips" v-if="resultFile===''">钻石 :<text>{{ form.price }}</text> / </view>
2024-12-11 19:36:51 +08:00
<u-button class="wbu-btn" @click="startDeal" v-if="resultFile===''" :disabled="functionDisable"
2025-01-22 20:25:38 +08:00
:style="{opacity: functionDisable?'0.6':'1'}"
2024-12-03 09:34:24 +08:00
ripple :hairLine="false" shape="circle" rippleBgColor="#f0fdbf" :loading='dotLoading'>
<u-icon name="edit-pen" size="42"></u-icon>
</u-button>
2025-01-22 20:25:38 +08:00
<view class="workshops-btn" :style="{flexDirection: 'row'}" v-else>
2024-12-29 16:09:08 +08:00
<u-button :loading="functionLoading" class="wbu-dbtn" ripple :hairLine="false"
shape="circle" rippleBgColor="#f0fdbf" @click="download" :class="transition?'transition':''">
<u-icon name="download" size="32"></u-icon>
</u-button>
<view class="wbu-dbtn wbu-odbtn">
2025-01-06 00:54:54 +08:00
<u-button class="wbud-btn" ripple :hairLine="false" shape="circle"
rippleBgColor="#f0fdbf" @click="resultFunction['reUpload'].fun" :class="transition?'transition':''">
2024-12-29 16:09:08 +08:00
<u-icon name="edit-pen" color="#8fb4e6" size="32"></u-icon>
<text>重新绘制</text>
</u-button>
</view>
</view>
<!-- <u-button :loading="functionLoading" class="wbu-btn" v-else ripple :hairLine="false"
2024-12-03 09:34:24 +08:00
shape="circle" rippleBgColor="#f0fdbf" @click="resultFunction[currentType].fun"
:style="{backgroundImage: resultFunction[currentType].background}" :class="transition?'transition':''">
<u-icon :name="resultFunction[currentType].icon" size="42"></u-icon>
{{ resultFunction[currentType].name }}
</u-button>
<view class="wb-change" v-if="resultFile!==''">
<u-icon :name="fileUrl+'change.png'" size="50" @click="changeFunction"></u-icon>
2024-12-29 16:09:08 +08:00
</view> -->
2024-12-03 09:34:24 +08:00
</view>
2024-12-10 10:25:46 +08:00
<!-- 更多类型 -->
<u-popup class="options-popup" v-model="showMoreOptions" mode="bottom" border-radius="30"
closeable close-icon="arrow-down" close-icon-color="#fff">
<view class="op-content">
<view class="op-top">
<u-icon name="tags" size="42" label="更多类型" color="#a7b6b8"
label-size="35" label-color="#a7b6b8" margin-left="20"></u-icon>
</view>
<scroll-view :scrollY="true" class="options-list">
<view class="section-options">
2024-12-29 16:09:08 +08:00
<view class="section-tags" v-for="(item,index) in form.options" :key="item.id"
:class="selectElementIndex===index?'section-tags-select':''" @click="selectElement(index)">
2024-12-30 19:01:03 +08:00
<image :src="getTypeImage(item.path)"></image>
2024-12-29 16:09:08 +08:00
<text>{{ item.optionName }}</text>
</view>
<!-- <u-tag v-for="(item,index) in form.options" :key="item.id" :index="index"
:text="item.optionName" @click="selectElement" :class="selectElementIndex===index?'u-tag-select':''"></u-tag> -->
2024-12-10 10:25:46 +08:00
</view>
</scroll-view>
</view>
</u-popup>
2024-12-03 09:34:24 +08:00
<u-toast ref="uToast"></u-toast>
<DotLoading :show="dotLoading" />
2024-12-10 10:25:46 +08:00
<Loading :show="loading"></Loading>
2024-12-03 09:34:24 +08:00
</view>
</template>
<script>
import configService from '@/common/config.service.js';
import { tools } from '@/utils/utils.js';
import EditorBox from './components/editor.vue';
2024-12-10 10:25:46 +08:00
import DressSelect from './components/dress_select.vue';
2024-12-11 19:36:51 +08:00
import { ossUpload } from '@/common/ossutil/ossWebUpload.js';
2024-12-03 09:34:24 +08:00
export default {
// #ifdef MP
options: {
styleIsolation: 'shared'
},
// #endif
2024-12-03 09:34:24 +08:00
components: {
2024-12-10 10:25:46 +08:00
EditorBox, DressSelect
2024-12-03 09:34:24 +08:00
},
data(){
return{
2025-02-08 13:39:32 +08:00
// #ifdef MP
// 微信小程序自定义导航栏参数
StatusBar: this.StatusBar || 0,
CustomBarHeight: this.Custom.height+(this.Custom.top-this.StatusBar)*2 || 0,
// #endif
2024-12-10 10:25:46 +08:00
// 全加载
loading: false,
2024-12-03 09:34:24 +08:00
// 顶部距离等级
topLevel: 0,
// 基础路径
ip: configService.ip,
2024-12-29 16:09:08 +08:00
aliIp: configService.aliUrl,
2025-01-22 20:25:38 +08:00
otherAliIp: configService.otherAliUrl,
anotherAliIp: configService.anotherAliUrl,
2024-12-29 16:09:08 +08:00
aliAsyncIp: configService.aliAsyncUrl,
2024-12-03 09:34:24 +08:00
myFileUrl: configService.fileUrl + 'pixel/my/',
fileUrl: configService.fileUrl + 'pixel/workshops/',
// 上传图片
// http://8.138.171.103/upload%5CAttachment%5C20241127%5Caa73abfb8b3a433292c94de57aef0a35.png
uploadFile: '',
// 结果图
// upload%5CAttachment%5C20241127%5Caa73abfb8b3a433292c94de57aef0a35.png
resultFile: '',
// logo图标
2025-01-22 20:25:38 +08:00
logo: 'logo-new.png',
2024-12-03 09:34:24 +08:00
// 我的页面背景
background: 'background.png',
// 数据
form: {
2024-12-06 23:58:58 +08:00
id: ''//id
2024-12-03 09:34:24 +08:00
},
// 模式选择
selections:["保留模式","替换模式"],
// 模式选择下标
currentSelect: 0,
// 模式选择背景
selectBackground: 'selectedBd.png',
// 未选择背景
noSelectBackground: 'noSelectedBd.png',
// 编辑图标
editorIcon: 'editor.png',
// 提示语列表
2024-12-06 23:58:58 +08:00
// placeholderList: {
// stylereplace: '上传图片后,选择更换不同风格~',
// animeization: '上传人像图快进入anime的世界吧~',
// oldrepair: '上传黑白旧照片,焕发色彩~'
// },
2024-12-03 09:34:24 +08:00
// 创作之后的操作按钮
resultFunction: {
download: {
name: '下载',
icon: 'download',
background: 'linear-gradient(to right, #56ab2f 0%, #96fe11 51%, #56ab2f 100%)',
fun: ()=>{this.download()}
},
reUpload: {
2024-12-10 10:25:46 +08:00
name: '重新制图',
2024-12-03 09:34:24 +08:00
icon: 'camera',
background: 'linear-gradient(to right, #c2fc3b 0%, #c2ffd8 51%, #c2fc3b 100%)',
2024-12-29 16:09:08 +08:00
fun: ()=>{this.redraw()}
2024-12-03 09:34:24 +08:00
},
2024-12-29 16:09:08 +08:00
// saveWork: {
// name: '保存作品',
// icon: 'bookmark',
// background: 'linear-gradient(to right, #4AC29A 0%, #BDFFF3 51%, #4AC29A 100%)',
// fun: ()=>{}
// }
2024-12-03 09:34:24 +08:00
},
// 当前功能按钮
currentType: 'download',
// 当前功能下标
index: 0,
// 下载加载
functionLoading: false,
// 过渡动画
transition: false,
// 图片处理加载动画
2024-12-10 10:25:46 +08:00
dotLoading: false,
// 元素选择下标
selectElementIndex: '',
// 尺寸选择下标
selectSizeIndex: '',
2024-12-10 10:25:46 +08:00
// 弹窗显示更多选项
2024-12-11 19:36:51 +08:00
showMoreOptions: false,
// 按钮禁用
2024-12-29 16:09:08 +08:00
functionDisable: false,
// 轮询次数——不轮询-1
asyncPollTime: -1,
// 异步结果——成功true失败false
asyncResult: false,
// 加载中随机图片
rangeImageList: [],
2025-01-06 00:54:54 +08:00
// 进度条
dealPercent: 20,
2025-01-06 00:54:54 +08:00
// 进度条计时器
2025-01-22 20:25:38 +08:00
dealPercentTimer: 1,
// 生成失败提示词
errorTips: '',
// 火山尺寸列表——文生图
volcengineDimensions: [
{ name: "512*512", value: "1/1" },
{ name: "512*384", value: "4/3" },
{ name: "384*512", value: "3/4" },
{ name: "512*341", value: "3/2" },
{ name: "341*512", value: "2/3" },
{ name: "512*288", value: "16/9" },
{ name: "288*512", value: "9/16" },
],
// 阿里尺寸列表——文生图
aliDimensions: [
{ name: "1024*1024", value: "1/1" },
{ name: "720*1280", value: "9/16" },
{ name: "768*1152", value: "2/3" },
{ name: "1280*720", value: "16/9" },
]
2024-12-03 09:34:24 +08:00
}
},
// #ifndef H5
onPageScroll(e) {
const level = e.scrollTop/60;
if(level<=1) this.topLevel = level;
else this.topLevel = 1;
},
// #endif
// #ifdef H5
mounted(){
let that = this;
window.onscroll = function () {
//为了保证兼容性,这里取三个值,哪个有值取哪一个
//scrollTop就是触发滚轮事件时滚轮的高度
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
const level = scrollTop/60;
if(level<=1) that.topLevel = level;
else that.topLevel = 1;
}
},
2024-12-05 11:46:54 +08:00
onHide() {
window.onscroll = null;
},
2024-12-03 09:34:24 +08:00
// #endif
onLoad(options) {
2024-12-06 23:58:58 +08:00
this.form.id = options.id;
this.getForm();
2024-12-29 16:09:08 +08:00
this.getRangeImages();
2024-12-03 09:34:24 +08:00
},
2024-12-10 10:25:46 +08:00
computed: {
2025-01-22 20:25:38 +08:00
// 获取一般展示页选项——8个最多
2024-12-10 10:25:46 +08:00
getOptions(){
let options = this.form.options;
const length = this.form.options.length;
2024-12-29 16:09:08 +08:00
return length > 8 ? options.slice(0,8) : options;
2025-01-22 20:25:38 +08:00
},
// 获取涂抹重绘选中样式
getSelectionsStyle(index){
return (index) => {
return this.currentSelect===index?{ backgroundImage: `url(${this.fileUrl+this.selectBackground})` }:
{ color: '#000', backgroundImage: `url(${this.fileUrl+this.noSelectBackground})` }
}
},
2024-12-10 10:25:46 +08:00
},
methods: {
2024-12-06 23:58:58 +08:00
// 获取ai功能详情
async getForm(){
2024-12-10 10:25:46 +08:00
this.loading = true;
try{
let res = await this.$api.singleServices(this.form.id);
if(res.success){
res.data.type = Number(res.data.type);
this.form = res.data;
}else{
2024-12-11 19:36:51 +08:00
this.functionDisable = true;
2024-12-10 10:25:46 +08:00
this.$refs.uToast.show({type:'error',title: "ai功能暂未开放!"});
}
}catch(e){}
finally{
this.loading = false;
2024-12-06 23:58:58 +08:00
}
},
2024-12-29 16:09:08 +08:00
// 获取加载中图片
async getRangeImages(){
let res = await this.$api.getCpPhotoById({labelId: 6});
if(res?.success){
this.rangeImageList = res.data;
}else{
this.$refs.uToast.show({type:'error',title: "随机加载图片获取失败!"});
}
},
2024-12-30 19:01:03 +08:00
// 图片格式化
getTypeImage(path){
if(path === null || path === ''){
2025-01-06 00:54:54 +08:00
return '/static/default-select.png';
2024-12-30 19:01:03 +08:00
}else if(path.startsWith("http")){
return path;
}else if(path.startsWith("/")){
// #ifdef H5
return encodeURI(path);
// #endif
// #ifndef H5
return encodeURI(this.ip+path);
// #endif
}else{
return encodeURI(this.ip+path);
}
},
2024-12-03 09:34:24 +08:00
// 返回
back(){
2025-02-18 11:53:32 +08:00
// #ifdef MP || APP
2025-02-08 13:39:32 +08:00
uni.navigateBack();
// #endif
2025-02-18 11:53:32 +08:00
// #ifndef MP || APP
2025-01-22 20:25:38 +08:00
uni.redirectTo({
url: '/pages/mobile_web/index/index'
})
2025-02-08 13:39:32 +08:00
// #endif
2024-12-03 09:34:24 +08:00
},
// 上传图片
selectImage(){
let that = this;
uni.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: (res) => {
// #ifdef H5
if (res.tempFiles[0].type.indexOf('image') === -1) {
that.$refs.uToast.show({
type: 'warning',
title: "图片上传格式错误!"
});
return;
}
// #endif
2024-12-29 16:09:08 +08:00
const size = res.tempFiles[0].size / 1024; // 计算文件大小
if(size<5 || (size/1024)>5){
that.$refs.uToast.show({
type: 'warning',
title: "图片大小不符合规范!"
});
return;
2024-12-11 19:36:51 +08:00
}
2024-12-29 16:09:08 +08:00
if(that.resultFile!=='') that.resultFile = '';
2025-01-22 20:25:38 +08:00
that.uploadFile = res.tempFilePaths[0];
2024-12-03 09:34:24 +08:00
}
});
},
2024-12-11 19:36:51 +08:00
// ai试衣模特预选
previewMannequin(model){
this.uploadFile = model;
},
2024-12-03 09:34:24 +08:00
// 预览图片
previewImage(){
2025-01-22 20:25:38 +08:00
if(this.asyncPollTime !== -1){
2024-12-29 16:09:08 +08:00
this.setResultFile();
}else{
2025-01-22 20:25:38 +08:00
const previewImages = [this.getResultImagePath(this.resultFile)];
2024-12-29 16:09:08 +08:00
if(this.uploadFile) previewImages.push(this.uploadFile);
tools.methods.lookImage(0,previewImages);
}
2024-12-03 09:34:24 +08:00
},
// 开始处理图片
async startDeal(){
try{
let that = this;
2024-12-29 16:09:08 +08:00
// 判断图片是否符合规范
2024-12-10 10:25:46 +08:00
if(!this.legalJudge()) return;
2025-01-22 20:25:38 +08:00
that.dotLoading = true;
let mannequinIndex = that.form.type === 4 ? that.$refs.dressRef.form.mannequinIndex : '';
if(that.uploadFile && (mannequinIndex === '' || mannequinIndex === -1)){
// 上传图片
ossUpload(that,that.uploadFile,(path)=>{
if(!path) return;
that.uploadFile = path;
// 再实际处理
that.realUpload();
});
}else{
// 再实际处理
that.realUpload();
}
2024-12-03 09:34:24 +08:00
}catch(e){
this.dotLoading = false;
}finally{
}
},
2024-12-29 16:09:08 +08:00
// 真正处理方法
async realUpload(){
let that = this;
let resp = await that.$api.generateImages(that.getParams(that.form));
if(resp?.success){
that.setResultFile(resp.data.path);
console.log('that.resultFile',that.resultFile);
2025-01-22 20:25:38 +08:00
that.$refs.uToast.show({type:'success',title:
'等待ai生成中......点击先看临时工表演',duration: 3000});
2024-12-29 16:09:08 +08:00
that.dotLoading = false;
// 开启轮询
that.delayLoadImage(resp.data.id);
}else{
that.$refs.uToast.show({type:'error',title: `${that.form.name}失败!`});
that.dotLoading = false;
}
},
// 设置结果图
setResultFile(path = ''){
2025-01-22 20:25:38 +08:00
// if(this.form.id > 3){
2024-12-29 16:09:08 +08:00
const length = this.rangeImageList.length;
// 获取随机下标
let num = Math.floor(Math.random() * length);
let image = this.rangeImageList[num]?.path;
this.resultFile = length>0 ?
(image.startsWith("http") ? image : encodeURI(this.ip+image)) : path;
2025-01-22 20:25:38 +08:00
// } else {
// this.resultFile = path;
// }
2024-12-29 16:09:08 +08:00
},
// 开启轮询查询结果图片
delayLoadImage(id){
2025-01-22 20:25:38 +08:00
// if(this.form.id > 3&&id){
if(id){
2025-01-06 00:54:54 +08:00
this.dealPercent = 0;
2024-12-29 16:09:08 +08:00
this.asyncPollTime = 0;
2025-01-06 00:54:54 +08:00
this.startDealPercent();
2024-12-29 16:09:08 +08:00
this.asyncPoll(id);
}
},
2025-01-22 20:25:38 +08:00
// 结果图格式化
getResultImagePath(path){
if(!path) return;
let index = path?.indexOf('?');
let judge = path?.includes(configService.anotherAliUrl);
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
2025-01-22 20:25:38 +08:00
},
2024-12-29 16:09:08 +08:00
// 轮询
async asyncPoll(id) {
if(this.asyncPollTime === -1) return;
2024-12-30 19:01:03 +08:00
// 超13次轮询结束
if(this.asyncPollTime > 13) {
2024-12-29 16:09:08 +08:00
this.asyncPollTime = -1;
2024-12-30 19:01:03 +08:00
this.$refs.uToast.show({type:'warning',title:'生成时间过长,请移步作品栏目查看图片'});
2024-12-29 16:09:08 +08:00
return;
}
if(this.asyncPollTime === 3){
this.$refs.uToast.show({type:'warning',title:'火速插队中......客官可稍后移步作品栏目查看图片',
duration: 3000});
}
try {
let res = await this.$api.singlePhotoById(id);
if(res?.success && res.data !== null && res.data?.creationState !== "create"){
2025-01-06 00:54:54 +08:00
this.dealPercent = 100;
2024-12-29 16:09:08 +08:00
this.resultFile = res.data?.path;
2025-01-06 00:54:54 +08:00
setTimeout(()=>{this.asyncPollTime = -1;},100);
2024-12-29 16:09:08 +08:00
// 结果判断
2025-01-22 20:25:38 +08:00
this.asyncResult = res.data?.creationState === 't';
this.errorTips = this.asyncResult ? '' : res.data?.reason;
this.$refs.uToast.show({type:this.asyncResult?'success':'error',title: `${this.form.name}${this.asyncResult?'成功':'失败'}`});
2024-12-29 16:09:08 +08:00
return;
}
this.asyncPollTime++;
console.log('轮询次数:',this.asyncPollTime);
} catch (error) {
return;
}
setTimeout(() => this.asyncPoll(id), 5000);
},
2025-01-06 00:54:54 +08:00
// 设置进度条——最多15秒
startDealPercent(){
let that = this;
let timerx = 1;
let timer = function(){
let random = Math.floor(Math.random()*3.5);
let num = timerx === 75 ? 99 : that.dealPercent + random;
if(num<99){
that.dealPercent = num;
timerx++;
}else{
that.dealPercent = 99;
clearInterval(that.dealPercentTimer);
}
}
this.dealPercentTimer = setInterval(timer,200);
},
2024-12-10 10:25:46 +08:00
// 表单合法判断
legalJudge(){
const currentType = this.form.type;
if(currentType !== 3 && currentType !== 1 && this.uploadFile===''){
2025-01-22 20:25:38 +08:00
this.$refs.uToast.show({type:'error',title: currentType === 4 ? "请选择模特!" : "请上传图片!"});
// this.dotLoading = false;
2024-12-10 10:25:46 +08:00
return false;
}
if(currentType === 1){
if(this.selectElementIndex === '' || !this.form.text){
2024-12-11 19:36:51 +08:00
this.$refs.uToast.show({type:'error',title: "请完善信息!"});
2025-01-22 20:25:38 +08:00
// this.dotLoading = false;
2024-12-10 10:25:46 +08:00
return false;
}
}
if(currentType === 2 && this.selectElementIndex === ''){
this.$refs.uToast.show({type:'error',title: "请选择图片元素!"});
2025-01-22 20:25:38 +08:00
// this.dotLoading = false;
2024-12-10 10:25:46 +08:00
return false;
}
if(currentType === 3){
if(this.selectElementIndex === '' || !this.form.text || !this.form.promt){
2024-12-11 19:36:51 +08:00
this.$refs.uToast.show({type:'error',title: "请完善信息!"});
2025-01-22 20:25:38 +08:00
// this.dotLoading = false;
2024-12-11 19:36:51 +08:00
return false;
}
}
if(currentType === 4){
2024-12-29 16:09:08 +08:00
const { bottomImageUrl, topImageUrl } = this.$refs.dressRef.form;
if(topImageUrl===''){
2024-12-11 19:36:51 +08:00
this.$refs.uToast.show({type:'error',title: "请选择更换上衣!"});
2025-01-22 20:25:38 +08:00
// this.dotLoading = false;
2024-12-10 10:25:46 +08:00
return false;
}
}
return true;
},
2024-12-03 09:34:24 +08:00
// 获取参数值
2024-12-10 10:25:46 +08:00
getParams({id, type, options, text, promt}){
2024-12-03 09:34:24 +08:00
let result,that = this;
2024-12-06 23:58:58 +08:00
switch(type){
case 0 :
2024-12-03 09:34:24 +08:00
result = {
2024-12-10 10:25:46 +08:00
serviceId: id,
2024-12-29 16:09:08 +08:00
imageUrl: that.uploadFile,
2024-12-03 09:34:24 +08:00
}
break;
2024-12-10 10:25:46 +08:00
case 1 :
result = {
serviceId: id,
option: options[that.selectElementIndex].optionKey,
text: text,
}
if(this.selectSizeIndex !== '') result.size = that.form.id === 4 ? that.aliDimensions[that.selectSizeIndex].name : that.volcengineDimensions[that.selectSizeIndex].name;
2024-12-10 10:25:46 +08:00
break;
case 2 :
result = {
serviceId: id,
2024-12-29 16:09:08 +08:00
imageUrl: that.uploadFile,
2024-12-10 10:25:46 +08:00
option: options[that.selectElementIndex].optionKey
}
break;
case 3 :
result = {
serviceId: id,
option: options[that.selectElementIndex].optionKey,
text: text,
promt: promt
}
break;
2024-12-11 19:36:51 +08:00
case 4 :
2024-12-29 16:09:08 +08:00
const { bottomImageUrl, topImageUrl } = this.$refs.dressRef.form;
2024-12-11 19:36:51 +08:00
result = {
serviceId: id,
2024-12-29 16:09:08 +08:00
bottomImageUrl: bottomImageUrl,
topImageUrl: topImageUrl,
2025-01-22 20:25:38 +08:00
imageUrl: that.getImagePath(that.uploadFile),
2024-12-11 19:36:51 +08:00
};
2024-12-29 16:09:08 +08:00
if(bottomImageUrl === '') delete result.bottomImageUrl;
2025-01-22 20:25:38 +08:00
else result.bottomImageUrl = that.getImagePath(bottomImageUrl);
2024-12-29 16:09:08 +08:00
if(topImageUrl === '') delete result.topImageUrl;
2025-01-22 20:25:38 +08:00
else result.topImageUrl = that.getImagePath(topImageUrl);
2024-12-11 19:36:51 +08:00
break;
2024-12-03 09:34:24 +08:00
}
return result;
},
2025-01-22 20:25:38 +08:00
// 获取图片格式化路径
getImagePath(path){
return path?.includes('://') ? path : encodeURI(this.ip+path);
},
2024-12-03 09:34:24 +08:00
// 判断是否在微信内置浏览器打开
// #ifndef APP || MP
2024-12-03 09:34:24 +08:00
isMpWeb(){
if(navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){
this.$refs.uToast.show({type:'warning',title: "请在浏览器打开进行下载,或长按图片保存到相册!"});
return true;
}else{
return false;
}
},
// #endif
// 图片下载
async download(){
let that = this;
// #ifndef APP || MP
2024-12-03 09:34:24 +08:00
if(this.isMpWeb()) return;
// #endif
this.functionLoading = true;
if(this.resultFile==='') {
this.$refs.uToast.show({type:'error',title: "暂无结果图片可下载!"});
this.functionLoading = false;
return;
}
2025-01-22 20:25:38 +08:00
// 判断是否为异步生图 ×
// 现在均为异步的,均作以下判断 √
if(this.asyncPollTime !== -1){
this.$refs.uToast.show({type:'warning',title: "图片生成中,请前往我的作品查看下载!"});
this.functionLoading = false;
return;
} else if(!this.asyncResult){
this.$refs.uToast.show({type:'error',title: "图片生成失败,请重试!"});
this.functionLoading = false;
return;
2024-12-29 16:09:08 +08:00
}
// 下载地址
2024-12-30 19:01:03 +08:00
// #ifdef H5
2024-12-29 16:09:08 +08:00
let downloadUrl = await that.resultFile.replace(that.aliIp, "/ossUpload");
2025-01-22 20:25:38 +08:00
downloadUrl = await downloadUrl.replace(that.otherAliIp, "/otherOssUpload");
downloadUrl = await downloadUrl.replace(that.anotherAliIp, "/anotherOssUpload");
2024-12-30 19:01:03 +08:00
// #endif
// #ifndef H5
let downloadUrl = that.resultFile;
// #endif
2024-12-03 09:34:24 +08:00
// #ifdef H5
uni.request({
2024-12-29 16:09:08 +08:00
url: downloadUrl,
2024-12-03 09:34:24 +08:00
method: 'GET',
header: { 'token' : that.$store.state.vuex_token },
responseType: 'arraybuffer',
success(res) {
const arrayBuffer = res.data;
const blob = new Blob([arrayBuffer], {type: 'image/png'}); // 创建 Blob 对象
const imageUrl = URL.createObjectURL(blob); // 通过 Blob 对象创建图片 URL
let a = document.createElement('a'); //创建一个 a 标签
a.href = imageUrl; //把路径赋到a标签的href上
a.download = 'pixel.png';
a.click();
URL.revokeObjectURL(imageUrl);
a = null;
that.$refs.uToast.show({type:'success',title: "图片下载成功!"});
},
fail() {
that.$refs.uToast.show({type:'error',title: "图片下载失败,请重试!"});
},
complete() {
that.functionLoading = false;
}
});
// #endif
// #ifndef H5
uni.downloadFile({
2024-12-29 16:09:08 +08:00
url: downloadUrl,
2024-12-03 09:34:24 +08:00
header: { 'token': that.$store.state.vuex_token },
success: (res) => {
if (res.statusCode === 200) {
//文件保存到本地
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //临时路径
success: function(resp) {
that.$refs.uToast.show({type:'success',title: "下载成功,请前往手机相册查看!"});
},
fail: function(err) {
that.$refs.uToast.show({type:'error',title: "暂不支持下载,请长按保存!"});
2024-12-03 09:34:24 +08:00
}
});
}else{
that.$refs.uToast.show({type:'error',title: "下载失败,请重试!"});
}
},
fail() {
that.$refs.uToast.show({type:'error',title: "暂不支持下载,请长按保存!"});
},
complete() {
that.functionLoading = false;
}
});
// #endif
},
2024-12-29 16:09:08 +08:00
// 重新绘制
redraw(){
let that = this;
// 判断是否为异步生图
2025-01-22 20:25:38 +08:00
if(this.asyncPollTime !== -1){
2024-12-29 16:09:08 +08:00
uni.showModal({
title: '提示',
content: `图片生成中,是否确认重新绘制?`,
confirmColor: '#94d500',
success: (res) => {if (res.confirm) that.realRedraw();}
});
} else this.realRedraw();
},
// 真正重绘方法
realRedraw(){
if(this.form.type===0){
this.selectImage();
}else if(this.form.type){
this.resultFile = '';
this.uploadFile = '';
}else if(this.form.type === 4){
this.resultFile = '';
this.uploadFile = '';
this.$refs.dressRef.resetForm();
};
2025-01-22 20:25:38 +08:00
this.errorTips = '';
2024-12-29 16:09:08 +08:00
this.asyncPollTime = -1;
2025-01-06 00:54:54 +08:00
setTimeout(()=>{this.dealPercent = 100;});
2024-12-29 16:09:08 +08:00
},
// 使用教程
showTutorial(){
if(this.form.exampleUrl){
2025-01-22 20:25:38 +08:00
if(this.UniPlatform === 'web'){
window.open(encodeURI(this.form.exampleUrl));
}else{
uni.navigateTo({
url: `/pages/index/webview?src=${encodeURI(this.form.exampleUrl)}`
})
}
2024-12-29 16:09:08 +08:00
}else{
this.$refs.uToast.show({type:'warning',title: "暂无使用教程,请自求多福!"});
}
},
2024-12-03 09:34:24 +08:00
// 切换操作按钮
changeFunction(){
this.transition = true;
const keys = Object.keys(this.resultFunction);
this.index = (this.index+1) % keys.length;
this.currentType = keys[this.index];
setTimeout(()=>{
this.transition = false;
},500)
2024-12-10 10:25:46 +08:00
},
2025-01-22 20:25:38 +08:00
// 增强提示词
async strengthenTip({input, deal}){
if(input === null || input === ''){
2025-01-22 20:25:38 +08:00
this.$refs.uToast.show({type:'warning',title: "请提供部分词句!"});
deal();
return;
}else{
let res = await this.$api.createTip(input);
if(res.success){
deal(res.data);
}else{
this.$refs.uToast.show({type:'error',title: "提示词强化失败!"});
deal();
return;
}
}
},
2024-12-10 10:25:46 +08:00
// 元素选择
selectElement(index){
2024-12-29 16:09:08 +08:00
this.selectElementIndex = this.selectElementIndex === index ? '' : index;
},
// 尺寸选择
selectSize(index){
this.selectSizeIndex = this.selectSizeIndex === index ? '' : index;
2024-12-10 10:25:46 +08:00
},
2024-12-03 09:34:24 +08:00
}
}
</script>
<style scoped lang="scss">
.mobile-workshops{
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 100vh;
background-size: cover;
2025-02-08 13:39:32 +08:00
// #ifdef APP || MP
2024-12-30 19:01:03 +08:00
.app-top{
width: 100%;
position: fixed;
z-index: 81;
top: 0;
}
// #endif
2024-12-03 09:34:24 +08:00
.mwt-top{
2025-02-08 13:39:32 +08:00
// #ifdef APP || MP
2024-12-03 09:34:24 +08:00
.app-top{
width: 100%;
position: fixed;
z-index: 81;
top: 0;
}
// #endif
.mobile-logo{
width: 100%;
display: flex;
justify-content: center;
position: fixed;
z-index: 81;
padding: 15rpx 0;
image{
width: 200rpx;
height: 45rpx;
}
}
.mw-title{
color: #fff;
font-size: 35rpx;
line-height: 35rpx;
font-weight: bold;
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin: 80rpx 40rpx 32rpx;
height: 40rpx;
.back{
position: absolute;
left: 0;
&:active{
filter: opacity(0.8);
}
}
}
.mw-upload{
display: flex;
flex-direction: column;
margin: 15rpx 100rpx;
2024-12-10 10:25:46 +08:00
.mwu-promt{
height: 100rpx;
margin-top: 120rpx;
display: flex;
align-items: center;
2024-12-30 19:01:03 +08:00
width: calc(100% + 100rpx);
margin-left: -50rpx;
border-radius: 20rpx;
box-shadow: 0 0 10rpx #eee;
border: 2rpx solid #858585;
2024-12-10 10:25:46 +08:00
}
2024-12-03 09:34:24 +08:00
.mwu-cover{
width: 100%;
height: 550rpx;
background-color: #626262;
border-radius: 35rpx;
border: 2rpx solid #858585;
display: flex;
2024-12-29 16:09:08 +08:00
flex-direction: column;
2024-12-03 09:34:24 +08:00
align-items: center;
justify-content: center;
&:active{
filter: opacity(0.8);
}
2024-12-29 16:09:08 +08:00
.mwuc-tips{
font-size: 28rpx;
margin: 30rpx 0 -70rpx;
color: #f9f9f9;
text{
color: rgba(229, 64, 70, 1);
}
}
2024-12-03 09:34:24 +08:00
}
.center-image{
border-radius: 35rpx;
width: 100%;
min-height: 650rpx;
display: flex;
align-items: center;
image{
width: 100%;
border-radius: 35rpx;
2024-12-29 16:09:08 +08:00
border: 2rpx solid #858585;
2024-12-03 09:34:24 +08:00
}
}
.selections{
margin-top: 20rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
.selections-item{
margin-left: 20rpx;
width: 150rpx;
height: 48rpx;
line-height: 50rpx;
border: 56rpx;
color: #fff;
font-weight: bold;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
}
}
.mw-editor{
2024-12-10 10:25:46 +08:00
margin: 50rpx 46rpx 12rpx;
2024-12-03 09:34:24 +08:00
display: flex;
flex-direction: column;
.slot{
color: #fff;
font-size: 32rpx;
font-weight: bold;
}
2024-12-10 10:25:46 +08:00
.section-options{
// margin-top: 40rpx;
2024-12-10 10:25:46 +08:00
display: grid;
2024-12-29 16:09:08 +08:00
grid-gap: 26rpx;
grid-template-columns: repeat(4,1fr);
.section-tags{
height: 200rpx;
width: 150rpx;
background-color: #2a243d;
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
color: #b3a0da;
text{
width: 90%;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
image{
opacity: 0.7;
border-radius: 20rpx;
width: 130rpx;
height: 130rpx;
}
}
.section-tags-select{
border: 2rpx solid #ff55f5;
image{
opacity: 1;
}
}
2024-12-10 10:25:46 +08:00
.u-tag{
width: 200rpx;
height: 80rpx;
font-size: 28rpx;
display: flex;
color: rgba(41,121,255,0.6);
background-color: rgba(236,245,255,0.8);
align-items: center;
justify-content: center;
&:active{
opacity: 0.8;
}
}
.u-tag-select{
box-shadow: 0 0 15rpx #eee;
color: #2979ff;
background-color: rgba(236,245,255,1);
}
}
/deep/.u-section{
margin-bottom: 40rpx;
}
.dimensional-drawing{
height: 180rpx;
// margin-top: 40rpx;
display: flex;
.dimensional-item{
min-width: 160rpx;
height: 100%;
padding: 0 20rpx 18rpx;
background-color: #2a243d;
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
color: #b3a0da;
margin-right: 30rpx;
&:nth-last-child(1){
margin-right: 0;
}
text{
width: 100%;
text-align: center;
margin-top: 20rpx;
}
view{
opacity: 0.7;
border-radius: 10rpx;
width: 60rpx;
border: 4rpx solid #aea4ee;
aspect-ratio: 1/1;
}
}
.dimensional-item-select{
border: 2rpx solid #ff55f5;
view{
opacity: 1;
box-shadow: 0 0 10rpx #aea4ee;
}
text{
text-shadow: 0 0 2rpx #aea4ee;
}
}
}
2024-12-03 09:34:24 +08:00
}
.workshops-tip{
2025-01-06 00:54:54 +08:00
margin-top: 50rpx;
2024-12-29 16:09:08 +08:00
justify-content: center;
align-items: center;
display: flex;
2024-12-03 09:34:24 +08:00
font-size: 28rpx;
2024-12-29 16:09:08 +08:00
color: #c2fc3b;
2025-01-06 00:54:54 +08:00
.tip-content{
justify-content: center;
align-items: center;
display: flex;
.u-icon{
margin-right: 15rpx;
}
}
.tip-progress{
display: flex;
align-items: center;
width: calc(100% - 200rpx);
.progress-title{
margin-right: 20rpx;
white-space: nowrap;
}
.progress-deal{
margin-left: 20rpx;
}
text{
background-image: linear-gradient(to right, #d3e7e7 0%, #a7b6b8 100%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
// #ifdef MP
.uline-progress{
width: 100%;
}
// #endif
2025-01-06 00:54:54 +08:00
::v-deep .u-active{
border-top-right-radius: 100rpx;
border-bottom-right-radius: 100rpx;
box-shadow: 0 0 20rpx #d3e7e7;
background: linear-gradient(to right, #96a3a5 0%, #d3e7e7 100%);
}
2024-12-29 16:09:08 +08:00
}
2024-12-03 09:34:24 +08:00
}
}
.workshops-btn{
display: flex;
2025-01-22 20:25:38 +08:00
flex-direction: column;
2024-12-03 09:34:24 +08:00
align-items: center;
justify-content: center;
margin: 80rpx 0 40rpx;
2025-01-22 20:25:38 +08:00
// 价格提示
.price-tips{
text-align: center;
font-size: 24rpx;
color: #b2d210;
width: 65%;
margin-bottom: 6rpx;
text{
margin: 0 10rpx;
color: red;
}
}
2024-12-29 16:09:08 +08:00
// 保存图片
.wbu-dbtn{
margin: 0 10rpx;
// #ifndef MP
2024-12-29 16:09:08 +08:00
padding: 50rpx 70rpx;
// #endif
2024-12-29 16:09:08 +08:00
border: none;
height: 100rpx;
color: rgba(42, 35, 61, 0.9);
font-size: 32rpx;
font-weight: bold;
background-size: 200% auto;
transition: 0.5s;
animation-duration: 1s;
animation-fill-mode: both;
background-image: linear-gradient(to right, #c2fc3b 0%, #c2ffd8 51%, #c2fc3b 100%);
&:active {
background-position: right center;
color: #fff;
text-decoration: none;
// #ifdef MP
/deep/.u-btn--default{
color: #fff;
}
// #endif
}
// #ifdef MP
border-radius: 56rpx;
/deep/.u-btn--default{
padding: 50rpx 70rpx;
background-color: #ffffff00;
border: none;
color: rgba(42, 35, 61, 0.9);
width: 100%;
height: 100rpx;
border-radius: 56rpx;
2024-12-29 16:09:08 +08:00
}
// #endif
/deep/.u-icon{
2024-12-29 16:09:08 +08:00
margin-right: 10rpx;
}
}
// 重新制图
.wbu-odbtn{
padding: 4rpx;
background: #1a1929;
display: flex;
justify-content: center;
align-items: center;
border-radius: 56rpx;
overflow: hidden;
box-sizing: border-box;
background: linear-gradient(90deg, #2dc5da, #e313ee) !important;
.wbud-btn{
width: 100%;
height: 92rpx;
// #ifndef MP
2024-12-29 16:09:08 +08:00
padding: 0 70rpx;
// #endif
2024-12-29 16:09:08 +08:00
background: #1a1929;
border: none;
/deep/.u-icon{
2024-12-29 16:09:08 +08:00
margin-right: 10rpx;
}
text{
background-image: linear-gradient(to right, #aea4ee 0%, #e26afd 100%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
// #ifdef MP
border-radius: 56rpx;
/deep/.u-btn--default{
background-color: #ffffff00;
border: none;
// color: rgba(42, 35, 61, 0.9);
width: 100%;
height: 92rpx;
border-radius: 56rpx;
}
// #endif
2024-12-29 16:09:08 +08:00
}
}
2024-12-03 09:34:24 +08:00
.wbu-btn{
margin: 0;
border: none;
width: 70%;
height: 100rpx;
color: rgba(42, 35, 61, 0.9);
font-size: 35rpx;
font-weight: bold;
background-size: 200% auto;
transition: 0.5s;
animation-duration: 1s;
animation-fill-mode: both;
background-image: linear-gradient(to right, #c2fc3b 0%, #c2ffd8 51%, #c2fc3b 100%);
&:active {
background-position: right center;
color: #fff;
text-decoration: none;
// #ifdef MP
/deep/.u-btn--default{
color: #fff;
}
// #endif
2024-12-03 09:34:24 +08:00
}
/deep/.u-icon{
2024-12-03 09:34:24 +08:00
margin-right: 10rpx;
}
// #ifdef MP
border-radius: 56rpx;
/deep/.u-btn--default{
background-color: #ffffff00;
border: none;
color: rgba(42, 35, 61, 0.9);
width: 100%;
height: 100rpx;
border-radius: 56rpx;
}
// #endif
2024-12-03 09:34:24 +08:00
}
.transition{
animation-name: fadeIn;
}
.wb-change{
color: #fff;
margin-left: 20rpx;
margin-right: -70rpx;
&:active{
filter: opacity(0.6);
}
}
}
}
2024-12-10 10:25:46 +08:00
.options-popup{
.op-content{
background-color: #2D3240;
2024-12-29 16:09:08 +08:00
padding: 10rpx 25rpx 20rpx;
2024-12-10 10:25:46 +08:00
display: flex;
flex-direction: column;
.op-top{
height: 80rpx;
display: flex;
align-items: center;
}
.options-list{
height: 800rpx;
color: #a7b6b8;
width: 100%;
2024-12-29 16:09:08 +08:00
margin-top: 10rpx;
2024-12-10 10:25:46 +08:00
.section-options{
display: grid;
2024-12-29 16:09:08 +08:00
grid-gap: 26rpx;
grid-template-columns: repeat(4,1fr);
.section-tags{
height: 200rpx;
width: 150rpx;
background-color: #2a243d;
border-radius: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
color: #b3a0da;
text{
width: 90%;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
image{
opacity: 0.7;
border-radius: 20rpx;
width: 130rpx;
height: 130rpx;
}
}
.section-tags-select{
border: 2rpx solid #ff55f5;
image{
opacity: 1;
}
}
2024-12-10 10:25:46 +08:00
.u-tag{
width: 200rpx;
height: 80rpx;
font-size: 28rpx;
display: flex;
color: rgba(41,121,255,0.6);
background-color: rgba(236,245,255,0.8);
align-items: center;
justify-content: center;
&:active{
opacity: 0.8;
}
}
.u-tag-select{
box-shadow: 0 0 15rpx #eee;
color: #2979ff;
background-color: rgba(236,245,255,1);
}
}
}
}
}
2024-12-03 09:34:24 +08:00
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>