|
@@ -1,10 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<view class="star-container">
|
|
<view class="star-container">
|
|
- <PageHeader title="" class="PageHeader" v-if="state == 1 && false">
|
|
|
|
|
|
+ <PageHeader title="" class="PageHeader" v-if="state == 1">
|
|
<template slot="center"> </template>
|
|
<template slot="center"> </template>
|
|
</PageHeader>
|
|
</PageHeader>
|
|
<!-- 星灵基因重组仓弹窗 -->
|
|
<!-- 星灵基因重组仓弹窗 -->
|
|
- <view class="gender-popup" v-if="!noteContent && !showInfo && state == 0">
|
|
|
|
|
|
+ <view class="gender-popup" v-if="state == 0">
|
|
<NicknamePopup title="星灵基因重组仓" subtitle="" class="openContentPopUpWindow" ref="openContentPopUpWindow">
|
|
<NicknamePopup title="星灵基因重组仓" subtitle="" class="openContentPopUpWindow" ref="openContentPopUpWindow">
|
|
<template slot="content">
|
|
<template slot="content">
|
|
<uv-textarea v-model="noteContent" maxlength="200" count autoHeight
|
|
<uv-textarea v-model="noteContent" maxlength="200" count autoHeight
|
|
@@ -15,51 +15,24 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 加载动画区域 -->
|
|
<!-- 加载动画区域 -->
|
|
- <view class="loading-area" v-if="isLoading">
|
|
|
|
|
|
+ <view class="loading-area" v-if="state == 2">
|
|
<image src="../../static/me/loadAnimation.gif" mode="widthFix"></image>
|
|
<image src="../../static/me/loadAnimation.gif" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 角色展示页面 -->
|
|
<!-- 角色展示页面 -->
|
|
- <view class="character-page" v-else-if="noteContent || true">
|
|
|
|
|
|
+ <view class="character-page" v-else-if="state == 1">
|
|
<view class="character-container">
|
|
<view class="character-container">
|
|
- <image :src="starImg||'https://e.zhichao.art/AI_images/b_3_92.png'" mode="aspectFit" class="character-image"></image>
|
|
|
|
|
|
+ <image :src="starImg || 'https://e.zhichao.art/AI_images/b_3_92.png'" mode="widthFix"
|
|
|
|
+ class="character-image">
|
|
|
|
+ </image>
|
|
</view>
|
|
</view>
|
|
<view class="bottom-button" @tap="goToSetProfile"> 设置星灵简介 </view>
|
|
<view class="bottom-button" @tap="goToSetProfile"> 设置星灵简介 </view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <!-- 角色信息展示页面 -->
|
|
|
|
- <view class="character-info" v-else-if="showInfo ">
|
|
|
|
- <view class="info-container">
|
|
|
|
- <!-- 角色立绘区域 -->
|
|
|
|
- <view class="character-portrait">
|
|
|
|
- <image :src="starInfo.image" mode="aspectFit" class="portrait-image"></image>
|
|
|
|
- <text class="character-name">{{ starInfo.name }}</text>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <!-- 角色信息板块 -->
|
|
|
|
- <view class="info-section">
|
|
|
|
- <view class="section-title">关于Ta</view>
|
|
|
|
|
|
|
|
- <!-- 人物简介 -->
|
|
|
|
- <view class="description-box">
|
|
|
|
- <text class="description-text">{{ starInfo.content }}</text>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <!-- 标签展示 -->
|
|
|
|
- <view class="tags-box">
|
|
|
|
- <view class="tag-item" v-for="tag in formData.tags" :key="tag">
|
|
|
|
- {{ tag }}
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <!-- 底部按钮 -->
|
|
|
|
- <view class="join-button" @tap="handleJoin"> 入驻星球 </view>
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
<!-- 表单页面 -->
|
|
<!-- 表单页面 -->
|
|
- <view class="form-page" v-else-if="showForm">
|
|
|
|
|
|
+ <view class="form-page" v-else-if="state == 4">
|
|
<PageHeader title="设置星灵简介" class="PageHeader">
|
|
<PageHeader title="设置星灵简介" class="PageHeader">
|
|
<template slot="center"> </template>
|
|
<template slot="center"> </template>
|
|
</PageHeader>
|
|
</PageHeader>
|
|
@@ -135,12 +108,70 @@
|
|
<view class="submit-button" @tap="submitStar"> 确定并提交 </view>
|
|
<view class="submit-button" @tap="submitStar"> 确定并提交 </view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <!-- 收藏内容区域 -->
|
|
|
|
- <view class="star-content" v-else>
|
|
|
|
- <view class="star-list">
|
|
|
|
- <!-- 这里放收藏列表内容 -->
|
|
|
|
|
|
+ <!-- 角色信息展示页面 -->
|
|
|
|
+ <view class="character-info" v-else-if="state == 5">
|
|
|
|
+
|
|
|
|
+ <view class="custom-navbar">
|
|
|
|
+ <view class="navbar-left" @click="goBack">
|
|
|
|
+ <text class="fa fa-angle-left" style="color: #000;"></text>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="navbar-right" @click="showShare = true">
|
|
|
|
+ <text class="fa fa-ellipsis-h"></text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <view class="info-container">
|
|
|
|
+ <!-- 角色立绘区域 -->
|
|
|
|
+ <view class="character-portrait">
|
|
|
|
+ <image :src="starInfo.image" mode="widthFix" class="portrait-image"></image>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <!-- 角色信息板块 -->
|
|
|
|
+ <view class="info-section">
|
|
|
|
+ <view class="character-name">
|
|
|
|
+ {{ starInfo.name }}
|
|
|
|
+ <image class="male" v-if="starInfo.sex == 0" src="../../static/me/wd_icon_nan.png"
|
|
|
|
+ mode="aspectFit">
|
|
|
|
+ </image>
|
|
|
|
+ <image class="female" v-else-if="starInfo.sex == 1" src="../../static/me/wd_icon_nv.png"
|
|
|
|
+ mode="aspectFit">
|
|
|
|
+ </image>
|
|
|
|
+ <image class="other" v-else src="../../static/me/wd_icon_qita.png" mode="aspectFit"></image>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="section-title">关于Ta</view> -->
|
|
|
|
+
|
|
|
|
+ <!-- 人物简介 -->
|
|
|
|
+ <view class="description-box">
|
|
|
|
+ <view class="description-title">
|
|
|
|
+ <view>Ta的设定</view>
|
|
|
|
+ <view v-if="false" class="edit-button">编辑<text class="fa fa-angle-right"
|
|
|
|
+ style="color: #000;"></text></view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="description-text"> <text>{{ starInfo.content }}</text> </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <!-- 标签展示 -->
|
|
|
|
+ <view class="description-box">
|
|
|
|
+ <view class="description-title">
|
|
|
|
+ <view>人物标签</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="tags-box">
|
|
|
|
+ <view class="tag-item" v-for="tag in starInfo.tags" :key="tag">
|
|
|
|
+ {{ tag }}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <!-- 底部按钮 -->
|
|
|
|
+ <view class="join-button" @tap="handleJoin"> 入驻星球 </view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <SharePopup :visible="showShare" :share-url="shareUrl" :share-title="shareTitle" :share-desc="shareDesc"
|
|
|
|
+ :share-img="shareImg" @close="showShare = false" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -180,15 +211,38 @@ export default {
|
|
starImg: "",
|
|
starImg: "",
|
|
noteContent: "",
|
|
noteContent: "",
|
|
starInfo: {},
|
|
starInfo: {},
|
|
- state: 1,
|
|
|
|
|
|
+ state: 5, //0 是用户输入星灵基因重组仓的状态 1 是用户已经完成了匹星灵展示页面 2是用户匹配中加载的状态 3是匹配到了待点击进入设置界面 (根据其它字段判断是否失败) 4是用户设置星灵信息的页面 5是用户查看星灵信息的页面 待入驻 6是用户已经已经入驻星球了
|
|
sex: "",
|
|
sex: "",
|
|
selectTags: [],
|
|
selectTags: [],
|
|
|
|
+ info: {
|
|
|
|
+ "id": 0,
|
|
|
|
+ "sso_id": 0,
|
|
|
|
+ "image_id": 0,
|
|
|
|
+ "image": "",
|
|
|
|
+ "nickname": "",
|
|
|
|
+ "user_content": "",
|
|
|
|
+ "content": "",
|
|
|
|
+ "sex_id": 0,
|
|
|
|
+ "tags": "",
|
|
|
|
+ "status": 0
|
|
|
|
+ },
|
|
|
|
+ showShare: false,
|
|
|
|
+ shareUrl: "https://your-share-url.com",
|
|
|
|
+ shareTitle: "分享标题",
|
|
|
|
+ shareDesc: "分享描述",
|
|
|
|
+ shareImg: "https://your-share-image.com/image.jpg",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.getStar("get");
|
|
this.getStar("get");
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 返回上一页
|
|
|
|
+ goBack() {
|
|
|
|
+ uni.navigateBack({
|
|
|
|
+ delta: 1
|
|
|
|
+ });
|
|
|
|
+ },
|
|
confirmGender() {
|
|
confirmGender() {
|
|
if (!this.noteContent) return;
|
|
if (!this.noteContent) return;
|
|
// this.selectedGender = this.noteContent;
|
|
// this.selectedGender = this.noteContent;
|
|
@@ -256,6 +310,92 @@ export default {
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
this.starInfo = res.data.info || {};
|
|
this.starInfo = res.data.info || {};
|
|
|
|
+ this.starInfo.tags = this.starInfo.tags.trim().split(",");
|
|
|
|
+ console.log("starInfo", this.starInfo);
|
|
|
|
+
|
|
|
|
+ this.formData.description = this.starInfo.content;
|
|
|
|
+ if (act == "make") {
|
|
|
|
+ // 模拟加载过程
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ that.isLoading = false;
|
|
|
|
+ }, 300);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error("请求失败:", err);
|
|
|
|
+ // 显示错误提示
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "网络请求失败,请重试",
|
|
|
|
+ icon: "none",
|
|
|
|
+ duration: 2000,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 重置加载状态
|
|
|
|
+ if (act === "make") {
|
|
|
|
+ that.isLoading = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 如果是网络超时,自动重试一次
|
|
|
|
+ if (err.errMsg.includes("timeout")) {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ console.log("请求超时,正在重试...");
|
|
|
|
+ that.getStar(act);
|
|
|
|
+ }, 1000);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ complete: () => {
|
|
|
|
+ // 确保在任何情况下都能重置加载状态
|
|
|
|
+ if (act === "make" && this.isLoading) {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 提交用户 开始创建的命令
|
|
|
|
+ apiPeiStar() {
|
|
|
|
+ if (!this.noteContent) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "请输入匹配条件",
|
|
|
|
+ icon: "none",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ uni.request({
|
|
|
|
+ url: this.$apiHost + "/AIpipei/start",
|
|
|
|
+ data: {
|
|
|
|
+ uuid: getApp().globalData.uuid,
|
|
|
|
+ content: this.noteContent,
|
|
|
|
+ },
|
|
|
|
+ header: {
|
|
|
|
+ "content-type": "application/json",
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
|
|
+ },
|
|
|
|
+ // 设置60秒超时
|
|
|
|
+ timeout: 60000,
|
|
|
|
+ methods: "POST",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log("开始AI匹配", res.data);
|
|
|
|
+ state
|
|
|
|
+ if (res.data.have == 0) {
|
|
|
|
+ this.showInfo = false;
|
|
|
|
+ this.starImg = res.data.image;
|
|
|
|
+ } else {
|
|
|
|
+ //首次进来获取到了
|
|
|
|
+ this.showInfo = true;
|
|
|
|
+ }
|
|
|
|
+ this.openContentPopUpWindow();
|
|
|
|
+ if (res.data.success === "yes") {
|
|
|
|
+ this.starImg = res.data.image;
|
|
|
|
+ }
|
|
|
|
+ if (res.data.info && res.data.info.tags != "") {
|
|
|
|
+ let tags = res.data.info.tags.split(",");
|
|
|
|
+ this.predefinedTags = tags.map(tag => ({
|
|
|
|
+ text: tag,
|
|
|
|
+ value: tag
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ this.starInfo = res.data.info || {};
|
|
|
|
+ this.starInfo.tags = this.starInfo.tags.trim().split(",");
|
|
console.log("starInfo", this.starInfo);
|
|
console.log("starInfo", this.starInfo);
|
|
|
|
|
|
this.formData.description = this.starInfo.content;
|
|
this.formData.description = this.starInfo.content;
|
|
@@ -296,20 +436,61 @@ export default {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 查询Ai匹配信息
|
|
|
|
+ aIpipeiGetinfo(act) {
|
|
|
|
+ uni.request({
|
|
|
|
+ url: this.$apiHost + "/AIpipei/getinfo",
|
|
|
|
+ data: {
|
|
|
|
+ uuid: getApp().globalData.uuid,
|
|
|
|
+ },
|
|
|
|
+ header: {
|
|
|
|
+ "content-type": "application/json",
|
|
|
|
+ sign: getApp().globalData.headerSign,
|
|
|
|
+ },
|
|
|
|
+ // 设置60秒超时
|
|
|
|
+ timeout: 60000,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log("查询到生成信息", res.data);
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error("请求失败:", err);
|
|
|
|
+ // 显示错误提示
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "网络请求失败,请重试",
|
|
|
|
+ icon: "none",
|
|
|
|
+ duration: 2000,
|
|
|
|
+ });
|
|
|
|
+ // 如果是网络超时,自动重试一次
|
|
|
|
+ if (err.errMsg.includes("timeout")) {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ console.log("请求超时,正在重试...");
|
|
|
|
+ that.aIpipeiGetinfo(act);
|
|
|
|
+ }, 6000);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ complete: () => {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 保存表单信息
|
|
submitStar() {
|
|
submitStar() {
|
|
|
|
+ this.formData.tags = this.selectTags.join(",");
|
|
|
|
+ this.state = 5
|
|
|
|
+ return
|
|
let that = this;
|
|
let that = this;
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
mask: true,
|
|
mask: true,
|
|
});
|
|
});
|
|
uni.request({
|
|
uni.request({
|
|
- url: this.$apiHost + "/Work/getStar",
|
|
|
|
|
|
+ url: this.$apiHost + "/AIpipei/save",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
sex: this.tempGender,
|
|
sex: this.tempGender,
|
|
// noteContent: this.noteContent,
|
|
// noteContent: this.noteContent,
|
|
name: this.formData.nickname,
|
|
name: this.formData.nickname,
|
|
content: this.formData.description,
|
|
content: this.formData.description,
|
|
- act: "submit",
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
@@ -326,7 +507,7 @@ export default {
|
|
});
|
|
});
|
|
if (res.data.success === "yes") {
|
|
if (res.data.success === "yes") {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- that.getStar("get");
|
|
|
|
|
|
+ that.aIpipeiGetinfo();
|
|
}, 300);
|
|
}, 300);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -398,8 +579,8 @@ export default {
|
|
|
|
|
|
::v-deep.checklist-box {
|
|
::v-deep.checklist-box {
|
|
|
|
|
|
-
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
|
+
|
|
|
|
+ border-radius: 16rpx !important;
|
|
border: 2rpx solid #1f1f1f !important;
|
|
border: 2rpx solid #1f1f1f !important;
|
|
background-color: #fff !important;
|
|
background-color: #fff !important;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -407,18 +588,79 @@ export default {
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
|
|
|
.checklist-text {
|
|
.checklist-text {
|
|
-
|
|
|
|
|
|
+
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
color: #1f1f1f;
|
|
color: #1f1f1f;
|
|
font-family: "PingFang SC-Bold" !important;
|
|
font-family: "PingFang SC-Bold" !important;
|
|
}
|
|
}
|
|
- &.is-checked{
|
|
|
|
|
|
+
|
|
|
|
+ &.is-checked {
|
|
background: #f7ffea !important;
|
|
background: #f7ffea !important;
|
|
border-color: #7ebc00 !important;
|
|
border-color: #7ebc00 !important;
|
|
|
|
+
|
|
.checklist-text {
|
|
.checklist-text {
|
|
- color:#1f1f1f !important;
|
|
|
|
|
|
+ color: #1f1f1f !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.star-container {
|
|
|
|
+
|
|
|
|
+ /* 自定义导航栏样式 */
|
|
|
|
+ .custom-navbar {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 90rpx;
|
|
|
|
+ padding: 0 20rpx;
|
|
|
|
+ padding-top: var(--status-bar-height);
|
|
|
|
+ background-color: transparent;
|
|
|
|
+ position: fixed;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ z-index: 100;
|
|
|
|
+ background: transparent;
|
|
|
|
+
|
|
|
|
+ &::before {
|
|
|
|
+ content: '';
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: var(--status-bar-height);
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ z-index: -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .navbar-left {
|
|
|
|
+ width: 80rpx;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+
|
|
|
|
+ .fa-angle-left {
|
|
|
|
+ font-size: 48rpx;
|
|
|
|
+ color: #333;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .navbar-right {
|
|
|
|
+ width: 80rpx;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ .fa-ellipsis-h {
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
+ color: #333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|