Browse Source

feature-tiktok-1.0:新增兑换AI绘画次数

feature-1.0
‘‘ 3 years ago
parent
commit
b2c030c4b3
  1. 62
      pages/ai/paint/paint.vue

62
pages/ai/paint/paint.vue

@ -101,7 +101,7 @@
checkPrompt: undefined, //true;false
checkStyleBox: undefined, //true;false
checkSize: undefined, //true;false
//checkCanPaint: false, //true;false
checkCanPaint: false, //true;false
},
userInfo: {},
noClick:true, //
@ -151,7 +151,7 @@
this.style_active = 0;
this.prompt_active = 0;
this.checkLogin();
//this.checkUserCanAiPaint();
this.checkUserCanAiPaint();
},
methods: {
@ -189,12 +189,12 @@
const that = this;
//console.log('that.checkData.checkCanPaint',that.checkData.checkCanPaint)
//ai TODO
// if(that.checkData.checkCanPaint === true){
// return uni.showToast({
// title: ',!',
// icon: 'none'
// })
// }
if(that.checkData.checkCanPaint === true){
return uni.showToast({
title: '当日绘画次数已用完,请明日再来!',
icon: 'none'
})
}
//
//console.log('prompt',that.formData.promptText)
@ -236,7 +236,7 @@
painterId: that.userInfo.id,
painterName: that.userInfo.username,
appType: 0,
platform: 0
platform: 1
}
uni.navigateTo({
url: './paintDetail?data='+JSON.stringify(data)
@ -326,28 +326,28 @@
},
//AI
// async checkUserCanAiPaint(){
// let that = this;
// const data = {
// userId: that.userInfo.id,
// platform: 0,
// appType: 0
// }
// const res = await checkUserCanAiPaint(data);
// //console.log('res',res)
// if(res.data.code === 200){
// if(res.data.data === true){
// that.checkData.checkCanPaint = true;
// }else{
// that.checkData.checkCanPaint = false;
// }
// }else{
// return uni.showModal({
// content: '',
// showCancel: false
// });
// }
// },
async checkUserCanAiPaint(){
let that = this;
const data = {
userId: that.userInfo.id,
platform: 0,
appType: 0
}
const res = await checkUserCanAiPaint(data);
//console.log('res',res)
if(res.data.code === 200){
if(res.data.data === true){
that.checkData.checkCanPaint = true;
}else{
that.checkData.checkCanPaint = false;
}
}else{
return uni.showModal({
content: '检查绘画上限失败!',
showCancel: false
});
}
},
//
async getPaintStyleList() {

Loading…
Cancel
Save