使用用户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

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

View File

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

View File

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

View File

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

View File

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