使用用户generate使用次数每个只有两次

This commit is contained in:
X1627315083
2024-01-30 13:33:08 +08:00
parent f51465f7a9
commit 958e4958de
18 changed files with 153 additions and 86 deletions

View File

@@ -1,7 +1,7 @@
NODE_ENV = 'development' NODE_ENV = 'development'
VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' # VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk'
# VUE_APP_BASE_URL = 'https://api.aida.com.hk' # VUE_APP_BASE_URL = 'https://api.aida.com.hk'
# VUE_APP_BASE_URL = 'http://18.167.251.121:10086' VUE_APP_BASE_URL = 'http://18.167.251.121:10086'
# VUE_APP_BASE_URL = 'http://192.168.1.9:5567' # VUE_APP_BASE_URL = 'http://192.168.1.9:5567'
# VUE_APP_BASE_URL = 'http://192.168.1.6:7766' # VUE_APP_BASE_URL = 'http://192.168.1.6:7766'

View File

@@ -82,7 +82,7 @@
<div class="centent_div" v-if="current?.id" @click="openCurrent(1)"> <div class="centent_div" v-if="current?.id" @click="openCurrent(1)">
<img :src="current?.path" alt="" class="" @click="openCurrent(1)"> <img :src="current?.path" alt="" class="" @click="openCurrent(1)">
</div> </div>
<i v-else class="fi fi-rr-picture centent" @click="openCurrent(1)"></i> <i v-else class="fi fi-rr-picture centent clothes_item_icon" @click="openCurrent(1)"></i>
</div> </div>
<div class="clothes_detail_item clothes_detail_item_print" :class="[current.id?'':'hideCursor']"> <div class="clothes_detail_item clothes_detail_item_print" :class="[current.id?'':'hideCursor']">
@@ -91,7 +91,7 @@
<div>{{ $t('DesignDetail.CurrentPrint') }}</div> <div>{{ $t('DesignDetail.CurrentPrint') }}</div>
<i class="fi fi-rr-edit" @click.stop="openCurrent(2)"></i> <i class="fi fi-rr-edit" @click.stop="openCurrent(2)"></i>
</div> </div>
<div class="Guide_1_20" :class="[driver__.driver?'showEvents':'']"> <div class="Guide_1_20 clothes_item_icon" :class="[driver__.driver?'showEvents':'']">
<div class="centent_div" v-if="current?.printObject?.prints?.[0]?.path" @click="openCurrent(2)"> <div class="centent_div" v-if="current?.printObject?.prints?.[0]?.path" @click="openCurrent(2)">
<img :src="current?.printObject?.prints[0]?.path" alt=""> <img :src="current?.printObject?.prints[0]?.path" alt="">
</div> </div>
@@ -1270,6 +1270,7 @@ export default defineComponent({
} }
.clothes_detail_item{ .clothes_detail_item{
// margin-bottom: 5rem*1.2); // margin-bottom: 5rem*1.2);
position: relative;
flex: 1; flex: 1;
.centent_div{ .centent_div{
display: flex; display: flex;
@@ -1305,6 +1306,12 @@ export default defineComponent({
cursor: pointer; cursor: pointer;
} }
} }
}
.clothes_item_icon{
top: 50%;
position: absolute;
left: 50%;
transform: translate(-50%,-50%);
} }
img{ img{
width: calc(10rem*1.2); width: calc(10rem*1.2);

View File

@@ -511,12 +511,12 @@ export default defineComponent({
getgenerate(){ getgenerate(){
clearInterval(this.remGenerateTime) clearInterval(this.remGenerateTime)
this.remGenerate = false this.remGenerate = false
if(this.isTest){//试用用户禁止使用 // if(this.isTest){//试用用户禁止使用
message.info( // message.info(
this.t('isTest.available') // this.t('isTest.available')
); // );
return // return
} // }
if(this.loadingShow){ if(this.loadingShow){
return return
} }
@@ -550,20 +550,26 @@ export default defineComponent({
userId:this?.userInfo?.userId, userId:this?.userInfo?.userId,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
version:1,//为1就是Print version:1,//为1就是Print
isTestUser:this.driver__.driver?false:this.isTest,
gender:'', gender:'',
} }
this.loadingShow = true this.loadingShow = true
Https.axiosPost(Https.httpUrls.generatePrepare, data).then( Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
(rv) => { (rv) => {
if(rv){ if(data.isTestUser){
this.generateId = rv if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:this.t('collectionModal.Moodboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Moodboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate() this.setGenerate()
this.remGenerateTime = setTimeout(()=>{ this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true this.remGenerate = true
},10000) },10000)
}else{
// this.loadingShow = false
}
} }
).catch(res=>{ ).catch(res=>{
this.loadingShow = false this.loadingShow = false

View File

@@ -584,12 +584,12 @@ export default defineComponent({
getgenerate(){ getgenerate(){
clearInterval(this.remGenerateTime) clearInterval(this.remGenerateTime)
this.remGenerate = false this.remGenerate = false
if(this.isTest){//试用用户禁止使用 // if(this.isTest){//试用用户禁止使用
message.warning( // message.warning(
this.t('isTest.available') // this.t('isTest.available')
); // );
return // return
} // }
if(this.loadingShow){ if(this.loadingShow){
return return
} }
@@ -611,6 +611,7 @@ export default defineComponent({
text:`${generage.printModel.value},${this.captionGeneration}`, text:`${generage.printModel.value},${this.captionGeneration}`,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
userId:this?.userInfo?.userId, userId:this?.userInfo?.userId,
isTestUser:this.driver__.driver?false:this.isTest,
version:1,//为1就是Print version:1,//为1就是Print
gender:'', gender:'',
} }
@@ -671,15 +672,20 @@ export default defineComponent({
// Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data,{cancelToken: this.source?.token}).then( // Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data,{cancelToken: this.source?.token}).then(
Https.axiosPost(Https.httpUrls.generatePrepare, data).then( Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
(rv) => { (rv) => {
if(rv){ if(data.isTestUser){
this.generateId = rv if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:this.t('collectionModal.Printboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Printboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate() this.setGenerate()
this.remGenerateTime = setTimeout(()=>{ this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true this.remGenerate = true
},10000) },10000)
}else{
// this.loadingShow = false
}
} }
).catch(res=>{ ).catch(res=>{
this.loadingShow = false this.loadingShow = false

View File

@@ -293,20 +293,20 @@ export default defineComponent({
// } // }
}, },
} }
if(this.isTest){//试用用户禁止使用 // if(this.isTest){//试用用户禁止使用
// message.warning( // // message.warning(
// this.t('isTest.available') // // this.t('isTest.available')
// ); // // );
this.record.push({ // this.record.push({
state:1, // state:1,
str:this.t('isTest.src'), // str:this.t('isTest.src'),
src:'https://code-create.com.hk/aida/' // src:'https://code-create.com.hk/aida/'
}) // })
this.createTimer() // this.createTimer()
this.textScroll() // this.textScroll()
this.chatCentent = "" // this.chatCentent = ""
return // return
} // }
Https.axiosPost(Https.httpUrls.chatStreamTest, data).then( Https.axiosPost(Https.httpUrls.chatStreamTest, data).then(
// Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then( // Https.axiosPost(Https.httpUrls.pythonChatStream, data,interaction).then(
(rv) => { (rv) => {

View File

@@ -697,12 +697,12 @@ export default defineComponent({
this.remGenerate = false this.remGenerate = false
// this.sketchCatecoryList = this.store.state.Workspace.workspacePosition // this.sketchCatecoryList = this.store.state.Workspace.workspacePosition
let sketchCatecoryList = this.sketchCatecoryList let sketchCatecoryList = this.sketchCatecoryList
if(this.isTest){//试用用户禁止使用 // if(this.isTest){//试用用户禁止使用
message.warning( // message.warning(
this.t('isTest.available') // this.t('isTest.available')
); // );
return // return
} // }
if(this.loadingShow){ if(this.loadingShow){
return return
} }
@@ -717,6 +717,7 @@ export default defineComponent({
text:this.captionGeneration, text:this.captionGeneration,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
userId:this?.userInfo?.userId, userId:this?.userInfo?.userId,
isTestUser:this.driver__.driver?false:this.isTest,
version:1,//为1就是Print version:1,//为1就是Print
gender:this.workspace.sex, gender:this.workspace.sex,
} }
@@ -775,14 +776,21 @@ export default defineComponent({
this.loadingShow = true this.loadingShow = true
Https.axiosPost(Https.httpUrls.generatePrepare, data).then( Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
(rv) => { (rv) => {
if(rv){ if(data.isTestUser){
this.generateId = rv if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:this.t('collectionModal.Sketchboard')}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:this.t('collectionModal.Sketchboard')}));
this.loadingShow = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate() this.setGenerate()
this.remGenerateTime = setTimeout(()=>{ this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true this.remGenerate = true
},10000) },10000)
} }
}
).catch(res=>{ ).catch(res=>{
this.loadingShow = false this.loadingShow = false
}); });

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"请输入内容~", jsContent5:"请输入内容~",
jsContent6:"您最多可以选择8张图片", jsContent6:"您最多可以选择8张图片",
jsContent7:"上传失败", jsContent7:"上传失败",
jsContent8:"您{str}还有{num}次生成额度。",
jsContent9:"您的{str}生成额度已用完。",
}, },
collectionModal:{ collectionModal:{
Moodboard:'情绪板', Moodboard:'情绪板',

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"Please enter content", jsContent5:"Please enter content",
jsContent6:"You can select up to 8 images", jsContent6:"You can select up to 8 images",
jsContent7:"upload failed", jsContent7:"upload failed",
jsContent8:"You have {num} remaining opportunity to generate {str}.",
jsContent9:"You have exhausted your generation opportunities {str}.",
}, },
collectionModal:{ collectionModal:{
Moodboard:'Moodboard', Moodboard:'Moodboard',

View File

@@ -287,6 +287,8 @@ export default {
jsContent5:"Veuillez saisir le contenu", jsContent5:"Veuillez saisir le contenu",
jsContent6:"Vous pouvez sélectionner jusqu'à 8 images", jsContent6:"Vous pouvez sélectionner jusqu'à 8 images",
jsContent7:"échec du téléchargement", jsContent7:"échec du téléchargement",
jsContent8: "Il vous reste {num} opportunité(s) de génération {str}.",
jsContent9: "Vous avez épuisé toutes vos opportunités de génération {str}."
}, },
collectionModal:{ collectionModal:{
Moodboard:"Conseil d'humeur", Moodboard:"Conseil d'humeur",

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"Inserisci il contenuto", jsContent5:"Inserisci il contenuto",
jsContent6:"È possibile selezionare fino a 8 immagini", jsContent6:"È possibile selezionare fino a 8 immagini",
jsContent7:"caricamento fallito", jsContent7:"caricamento fallito",
jsContent8: "Hai {num} opportunità rimanenti per generare {str}.",
jsContent9: "Hai esaurito le tue opportunità di generazione {str}."
}, },
collectionModal:{ collectionModal:{
Moodboard:"Tavola d'atmosfera", Moodboard:"Tavola d'atmosfera",

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"内容を入力してください", jsContent5:"内容を入力してください",
jsContent6:"最大8枚の画像を選択できます", jsContent6:"最大8枚の画像を選択できます",
jsContent7:"アップロードに失敗しました", jsContent7:"アップロードに失敗しました",
jsContent8: "{num} 回の生成機会が残っています {str}。",
jsContent9: "生成機会を使い切りました {str}。"
}, },
collectionModal:{ collectionModal:{
Moodboard:'ムードボード', Moodboard:'ムードボード',

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"내용을 입력해주세요", jsContent5:"내용을 입력해주세요",
jsContent6:"최대 8개의 이미지를 선택할 수 있습니다.", jsContent6:"최대 8개의 이미지를 선택할 수 있습니다.",
jsContent7:"업로드 실패", jsContent7:"업로드 실패",
jsContent8: "생성 기회가 {num}번 남았습니다 {str}.",
jsContent9: "생성 기회를 모두 사용하셨습니다 {str}."
}, },
collectionModal:{ collectionModal:{
Moodboard:'무드보드', Moodboard:'무드보드',

View File

@@ -288,6 +288,8 @@ export default {
jsContent5:"Пожалуйста, введите содержание", jsContent5:"Пожалуйста, введите содержание",
jsContent6:"Вы можете выбрать до 8 изображений", jsContent6:"Вы можете выбрать до 8 изображений",
jsContent7:"Загрузка не удалась", jsContent7:"Загрузка не удалась",
jsContent8: "У вас осталось {num} возможность(ей) для генерации {str}.",
jsContent9: "Вы исчерпали все возможности генерации {str}."
}, },
collectionModal:{ collectionModal:{
Moodboard:'Мудборд', Moodboard:'Мудборд',

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"กรุณากรอกเนื้อหา", jsContent5:"กรุณากรอกเนื้อหา",
jsContent6:"คุณสามารถเลือกได้สูงสุด 8 ภาพ", jsContent6:"คุณสามารถเลือกได้สูงสุด 8 ภาพ",
jsContent7:"การอัพโหลดล้มเหลว", jsContent7:"การอัพโหลดล้มเหลว",
jsContent8: "คุณมีโอกาสสร้าง {num} ครั้งที่เหลืออยู่ {str}",
jsContent9: "คุณใช้โอกาสสร้างหมดแล้ว {str}"
}, },
collectionModal:{ collectionModal:{
Moodboard:'มูดบอร์ด', Moodboard:'มูดบอร์ด',

View File

@@ -286,6 +286,8 @@ export default {
jsContent5:"Vui lòng nhập nội dung", jsContent5:"Vui lòng nhập nội dung",
jsContent6:"Bạn có thể chọn tối đa 8 hình ảnh", jsContent6:"Bạn có thể chọn tối đa 8 hình ảnh",
jsContent7:"Tải lên thất bại", jsContent7:"Tải lên thất bại",
jsContent8: "Bạn còn {num} lần tạo ra cơ hội {str}.",
jsContent9: "Bạn đã sử dụng hết các cơ hội tạo ra {str}."
}, },
collectionModal:{ collectionModal:{
Moodboard:'Bảng tâm trạng', Moodboard:'Bảng tâm trạng',

View File

@@ -232,7 +232,8 @@ const openGuide = () =>{
// console.log(isBeginner); // console.log(isBeginner);
let isBeginnerNum = JSON.parse(getCookie('isBeginnerNum')?getCookie('isBeginnerNum'):'0') let isBeginnerNum = JSON.parse(getCookie('isBeginnerNum')?getCookie('isBeginnerNum'):'0')
// console.log(isBeginner); // console.log(isBeginner);
if(isBeginner && !isTest){ if(isBeginner){
// if(isBeginner && !isTest){
if(isBeginnerNum){ if(isBeginnerNum){
driverObj__.drive(isBeginnerNum); driverObj__.drive(isBeginnerNum);
}else{ }else{

View File

@@ -385,7 +385,8 @@ export default defineComponent({
let text = { let text = {
} }
if(!isTest && !isModalOne){//判断是否是试用用户 if(!isModalOne){//判断是否是试用用户
// if(!isTest && !isModalOne){//判断是否是试用用户
await new Promise(async (resolve) => { await new Promise(async (resolve) => {
await Https.axiosPost(Https.httpUrls.getExpiredTime,{}).then((rv: any) => { await Https.axiosPost(Https.httpUrls.getExpiredTime,{}).then((rv: any) => {
if (rv) { if (rv) {
@@ -400,6 +401,7 @@ export default defineComponent({
setTimeout(() => { setTimeout(() => {
let text = { let text = {
str:`${this.t('HomeView.jsContent4',{days:days,hours:hours,minutes:minutes})}<a href="https://code-create.com.hk/aida/" target="_blank"><i class="fi fi-br-link-alt"></i></a>`, str:`${this.t('HomeView.jsContent4',{days:days,hours:hours,minutes:minutes})}<a href="https://code-create.com.hk/aida/" target="_blank"><i class="fi fi-br-link-alt"></i></a>`,
title:`${this.t('HomeView.jsContent7')}`,
} }
this.affiche(text) this.affiche(text)
}, 500); }, 500);
@@ -414,12 +416,12 @@ export default defineComponent({
}) })
}) })
}else if(!isModalOne && isTest){ }else if(!isModalOne && isTest){
setTimeout(() => { // setTimeout(() => {
text = { // text = {
str:`${this.t('HomeView.jsContent7')}<br>${this.t('HomeView.jsContent5')}<a href="https://code-create.com.hk/aida/" target="_blank">https://code-create.com.hk/aida/</a>${this.t('HomeView.jsContent6')}`, // str:`${this.t('HomeView.jsContent7')}<br>${this.t('HomeView.jsContent5')}<a href="https://code-create.com.hk/aida/" target="_blank">https://code-create.com.hk/aida/</a>${this.t('HomeView.jsContent6')}`,
} // }
this.affiche(text) // this.affiche(text)
}, 500); // }, 500);
}else{ }else{

View File

@@ -759,10 +759,11 @@ export default defineComponent({
if(this.selectCode == 'Models'){ if(this.selectCode == 'Models'){
let reader = new FileReader(); let reader = new FileReader();
if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){ //试用用户上传限制
message.info(this.t('isTest.image')); // if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){
return // message.info(this.t('isTest.image'));
} // return
// }
reader.onload = (e:any) => { reader.onload = (e:any) => {
let data_new; let data_new;
if (typeof e.target.result === 'object') { if (typeof e.target.result === 'object') {
@@ -1039,10 +1040,11 @@ export default defineComponent({
if(this.selectCode == "Models"){ if(this.selectCode == "Models"){
return return
} }
if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){ //试用用户上传限制
message.info(this.t('isTest.image')); // if(this.imgList.length+this.currentUploadFileNum > 10 && this.isTest){
return // message.info(this.t('isTest.image'));
} // return
// }
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : '' let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
let new_data = { let new_data = {
file:event.file, file:event.file,
@@ -1244,12 +1246,12 @@ export default defineComponent({
getgenerate(){ getgenerate(){
clearInterval(this.remGenerateTime) clearInterval(this.remGenerateTime)
this.remGenerate = false this.remGenerate = false
if(this.isTest){//试用用户禁止使用 // if(this.isTest){//试用用户禁止使用
message.info( // message.info(
this.t('isTest.available') // this.t('isTest.available')
); // );
return // return
} // }
if(this.isShowMark){ if(this.isShowMark){
return return
} }
@@ -1266,6 +1268,7 @@ export default defineComponent({
level1Type:this.selectCode, level1Type:this.selectCode,
level2Type:this.selectCode == 'Sketchboard'?this.designType.value:'', level2Type:this.selectCode == 'Sketchboard'?this.designType.value:'',
userId:(this?.userInfo as any).userId, userId:(this?.userInfo as any).userId,
isTestUser:this.driver__.driver?false:this.isTest,
text:this.selectCode == 'Printboard'?`${arr[this.printModel.num-1]},${this.captionGeneration}`:this.captionGeneration, text:this.selectCode == 'Printboard'?`${arr[this.printModel.num-1]},${this.captionGeneration}`:this.captionGeneration,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone, timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
version:1,//为1就是Print version:1,//为1就是Print
@@ -1328,14 +1331,30 @@ export default defineComponent({
this.isGenerate = true this.isGenerate = true
Https.axiosPost(Https.httpUrls.generatePrepare, data).then( Https.axiosPost(Https.httpUrls.generatePrepare, data).then(
(rv) => { (rv) => {
if(rv){ if(data.isTestUser){
this.generateId = rv let str:any
if(this.selectCode == 'Moodboard'){
str = this.t('collectionModal.Moodboard')
}else if(this.selectCode == 'Printboard'){
str = this.t('collectionModal.Printboard')
}else if(this.selectCode == 'Sketchboard'){
str = this.t('collectionModal.Sketchboard')
}
if(rv.leftUsageCount >= 1){
message.warning(this.t('Generate.jsContent8',{num:rv.leftUsageCount-1,str:str}));
}else if(rv.leftUsageCount == 0){
message.warning(this.t('Generate.jsContent9',{str:str}));
this.isGenerate = false
this.isShowMark = false
return
}
}
this.generateId = rv.uniqueId
this.setGenerate() this.setGenerate()
this.remGenerateTime = setTimeout(()=>{ this.remGenerateTime = setTimeout(()=>{
this.remGenerate = true this.remGenerate = true
},10000) },10000)
} }
}
).catch(res=>{ ).catch(res=>{
this.isShowMark = false this.isShowMark = false
this.isGenerate = false this.isGenerate = false