Commit 7cf40d06 authored by jtwu's avatar jtwu

123

parent 970699b8
No preview for this file type
...@@ -17,7 +17,9 @@ const { ...@@ -17,7 +17,9 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了 // 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.224.178:7777/pmall"; // const baseUrl = "http://172.16.224.178:7777/pmall";
// const baseUrl = "https://docs.dui88.com/mock/1956"; // const baseUrl = "https://docs.dui88.com/mock/1956";
let baseUrl = "https://momclub-uat.feihe.com/pmall"; // let baseUrl = "https://momclub-uat.feihe.com/pmall";
let baseUrl = "https://momclub.feihe.com/pmall";
const request = (options = {}) => { const request = (options = {}) => {
// 在这里可以对请求头进行一些设置 // 在这里可以对请求头进行一些设置
......
...@@ -43,8 +43,8 @@ export const myObj = { ...@@ -43,8 +43,8 @@ export const myObj = {
}, },
{ {
"bgUrl": "my/naming.png", "bgUrl": "my/naming.png",
"title": "AI互娱", "title": "星妈起名",
"desc": "AI互娱", "desc": "星妈起名",
"link": { "link": {
"type": 1, "type": 1,
"url": "/pages/naming/naming", "url": "/pages/naming/naming",
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
<view> <view>
<view class="naming_bg" :style="{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}"> <view class="naming_bg" :style="{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}">
<view class="page-top"> <view class="page-top">
<image @tap="backHandler" class="btnback" <image @tap="backHandler" class="btnback" :src="$baseUrl+'aiNaming/back_btn.png'"></image>
:src="$baseUrl+'aiNaming/back_btn.png'"></image> <view class="page_title">星妈起名</view>
<view class="page_title">AI-宝宝取名</view>
</view> </view>
<view class="top_con"> <view class="top_con">
...@@ -48,7 +47,7 @@ ...@@ -48,7 +47,7 @@
<view class="time-picker-container" @click="openPicker"> <view class="time-picker-container" @click="openPicker">
<!-- 隐藏的时间选择器 --> <!-- 隐藏的时间选择器 -->
<view class="datetime-picker" :style="{'margin-left': '0rpx', 'width':'480rpx'}"> <view class="datetime-picker" :style="{'margin-left': '0rpx', 'width':'480rpx'}">
<uni-datetime-picker ref="pickerRef" v-model="birthTime"> <uni-datetime-picker class="custom-picker" ref="pickerRef" v-model="birthTime">
<!-- 时间显示部分 --> <!-- 时间显示部分 -->
<view class="time-display"> <view class="time-display">
<text class="date_txt">{{ formattedDate }}</text> <text class="date_txt">{{ formattedDate }}</text>
...@@ -82,7 +81,7 @@ ...@@ -82,7 +81,7 @@
<view class="surname_box"> <view class="surname_box">
<view class="item_top"> <view class="item_top">
<span class="title_txt"><span :style="{color: '#b27c1e'}">*</span>姓氏</span> <span class="title_txt"><span :style="{color: '#b27c1e'}">*</span>姓氏</span>
<input class="name_input" placeholder="仅限2个汉字" v-model="surname" @input="setNameInput" <input class="name_input" v-model="surname" @input="setNameInput"
@blur="forceCorrection" /> @blur="forceCorrection" />
</view> </view>
<view class="item_line"></view> <view class="item_line"></view>
...@@ -125,7 +124,7 @@ ...@@ -125,7 +124,7 @@
<span class="title_txt"><span :style="{color: '#b27c1e'}">*</span>数字要求</span> <span class="title_txt"><span :style="{color: '#b27c1e'}">*</span>数字要求</span>
<view class="val_view"> <view class="val_view">
<view class="radio-group" :style="{display: 'flex'}"> <view class="radio-group" :style="{display: 'flex'}">
<!-- <label class="radio-item" :class="{ active: wordCount === '单字' }" <label class="radio-item" :class="{ active: wordCount === '单字' }"
@click="wordCount = '单字'"> @click="wordCount = '单字'">
<radio :style="{opacity: 0}" :checked="wordCount === '单字'" color="#4a90e2" /> <radio :style="{opacity: 0}" :checked="wordCount === '单字'" color="#4a90e2" />
<view class="custom-radio" :style="{display: 'flex','margin-top': '-41rpx'}"> <view class="custom-radio" :style="{display: 'flex','margin-top': '-41rpx'}">
...@@ -134,7 +133,7 @@ ...@@ -134,7 +133,7 @@
mode="aspectFit" /> mode="aspectFit" />
<text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">单字</text> <text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">单字</text>
</view> </view>
</label> --> </label>
<label class="radio-item" :class="{ active: wordCount === '双字' }" <label class="radio-item" :class="{ active: wordCount === '双字' }"
@click="wordCount = '双字'"> @click="wordCount = '双字'">
<radio :style="{opacity: 0}" :checked="wordCount === '双字'" color="#4a90e2" /> <radio :style="{opacity: 0}" :checked="wordCount === '双字'" color="#4a90e2" />
...@@ -145,7 +144,7 @@ ...@@ -145,7 +144,7 @@
<text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">双字</text> <text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">双字</text>
</view> </view>
</label> </label>
<label class="radio-item" :class="{ active: wordCount === '三字' }" <!-- <label class="radio-item" :class="{ active: wordCount === '三字' }"
@click="wordCount = '三字'"> @click="wordCount = '三字'">
<radio :style="{opacity: 0}" :checked="wordCount === '三字'" color="#4a90e2" /> <radio :style="{opacity: 0}" :checked="wordCount === '三字'" color="#4a90e2" />
<view class="custom-radio" :style="{display: 'flex','margin-top': '-41rpx'}"> <view class="custom-radio" :style="{display: 'flex','margin-top': '-41rpx'}">
...@@ -154,7 +153,7 @@ ...@@ -154,7 +153,7 @@
mode="aspectFit" /> mode="aspectFit" />
<text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">三字</text> <text class="radio-label" :style="{'margin': '-6rpx 0 0 10rpx'}">三字</text>
</view> </view>
</label> </label> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -309,11 +308,11 @@ ...@@ -309,11 +308,11 @@
const month = String(date.getMonth() + 1).padStart(2, '0') const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0') const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0') const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0') const minutes = String(date.getMinutes()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}` return `${year}-${month}-${day} ${hours}:${minutes}`
} }
//出生时间 //出生时间
const birthTime = ref(getDefaultTime()) // 默认时间 const birthTime = ref(getDefaultTime()) // 默认时间
const pickerRef = ref(null) const pickerRef = ref(null)
...@@ -371,7 +370,7 @@ ...@@ -371,7 +370,7 @@
const inputVal = e.detail.value const inputVal = e.detail.value
// 1. 移除非中文字符(包括标点、英文、数字等) // 1. 移除非中文字符(包括标点、英文、数字等)
const chineseOnly = inputVal.replace(/[^\u4e00-\u9fa5]/g, '').slice(0, 2); const chineseOnly = inputVal.replace(/[^\u4e00-\u9fa5]/g, '').slice(0, 17);
// 3. 更新实际值 // 3. 更新实际值
...@@ -412,7 +411,7 @@ ...@@ -412,7 +411,7 @@
const onNaming = (data) => { const onNaming = (data) => {
let param = { let param = {
birthStatus: birthStatus.value, birthStatus: birthStatus.value,
birthTime: birthTime.value, birthTime: birthTime.value.split(' ')[0],
surname: surname.value, surname: surname.value,
gender: gender.value, gender: gender.value,
wordCount: wordCount.value, wordCount: wordCount.value,
...@@ -443,7 +442,14 @@ ...@@ -443,7 +442,14 @@
let d = await aiNaming(param); let d = await aiNaming(param);
if (d) { if (d) {
let nameList = d?.data; let nameList = d?.data;
console.log('取名回调:', nameList) console.log('取名回调:', nameList)
if(nameList[0].meaning == "未获取解释"){
uni.showToast({
title: '生成失败,请检查你输入的内容',
icon: 'none'
})
return
}
// 隐藏 // 隐藏
uni.hideLoading() uni.hideLoading()
...@@ -455,19 +461,28 @@ ...@@ -455,19 +461,28 @@
}, 5000) }, 5000)
// 首页组件逻辑 // 首页组件逻辑
const backHandler = () => { const backHandler = () => {
if(!back_btn){ if (!back_btn) {
uni.navigateBack(); uni.navigateBack();
}else{ } else {
jump({ jump({
type: JumpType.INNER, type: JumpType.INNER,
url: `/pages/index/index` url: `/pages/index/index`
}) })
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
::v-deep .uni-datetime-picker--btn{
background-color: #d3a358 !important;
}
::v-deep .uni-calendar-item--checked{
background-color: #d3a358 !important;
}
::v-deep .uni-datetime-picker-btn-text{
color: #d3a358 !important;
}
.naming_bg { .naming_bg {
// position: absolute; // position: absolute;
width: 100%; width: 100%;
......
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
<view class="naming_result_bg" :style="{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}"> <view class="naming_result_bg" :style="{backgroundImage: `url(${$baseUrl}aiNaming/bg.jpg)`}">
<view class="page-top"> <view class="page-top">
<image @tap="backHandler" class="btnback" :src="$baseUrl+'aiNaming/back_btn.png'"></image> <image @tap="backHandler" class="btnback" :src="$baseUrl+'aiNaming/back_btn.png'"></image>
<view class="page_title">AI-宝宝取</view> <view class="page_title">星妈起</view>
</view> </view>
<view class="box"> <view class="box">
<view class="name_box" v-for="(item, index) in nameList" :key="index"> <view class="name_box" v-for="(item, index) in nameList" :key="index">
<view class="name_con"> <view class="name_con">
<view class="name_py">{{item.pinyin}}</view> <view class="name_py" :style="{'fontSize': item.pinyin.length>15?'20rpx':'30rpx'}">
<view class="name_txt">{{item.name}}</view> {{item.pinyin}}
</view>
<view class="name_txt" :style="{'fontSize': item.name.length>7?'30rpx':'54rpx'}">
{{item.name}}
</view>
</view> </view>
<view class="jt_box" @click="onJtClick(index)"> <view class="jt_box" @click="onJtClick(index)">
<image class="jt" <image class="jt"
...@@ -168,21 +172,23 @@ ...@@ -168,21 +172,23 @@
border-radius: 28rpx; border-radius: 28rpx;
.name_con { .name_con {
width: 380rpx; width: 480rpx;
margin-left: 0rpx; margin-left: 0rpx;
font-size: 30rpx;
letter-spacing: 10rpx; letter-spacing: 10rpx;
.name_py { .name_py {
width: 100%; // background: #20ffff;
text-align: center; width: 480rpx;
text-align: center;
word-break: break-all; /* 所有字符都可换行 */
} }
.name_txt { .name_txt {
// background: #fc0107;
margin-top: 5rpx; margin-top: 5rpx;
width: 100%; width: 480rpx;
font-size: 54rpx; text-align: center;
text-align: center; word-break: break-all; /* 所有字符都可换行 */
} }
} }
......
...@@ -253,6 +253,14 @@ const handleToolClick = async (item) => { ...@@ -253,6 +253,14 @@ const handleToolClick = async (item) => {
} }
}; };
// //跳转到ai取名页面
// const toAiNaming = () => {
// jump({
// type: JumpType.INNER,
// url: "/pages/naming/naming",
// })
// };
// 编辑个人资料 // 编辑个人资料
const handleEditProfile = () => { const handleEditProfile = () => {
if (!userStore.userInfo || JSON.stringify(userStore.userInfo) === "{}") { if (!userStore.userInfo || JSON.stringify(userStore.userInfo) === "{}") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment