Browse Source

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

feature-1.0
‘‘ 4 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未填内容 checkPrompt: undefined, //true填了内容;false未填内容
checkStyleBox: undefined, //true选了创作风格;false未选创作风格 checkStyleBox: undefined, //true选了创作风格;false未选创作风格
checkSize: undefined, //true选了画布大小;false未选画布大小 checkSize: undefined, //true选了画布大小;false未选画布大小
//checkCanPaint: false, //true已达到最大绘画上限;false未达最高上限 checkCanPaint: false, //true已达到最大绘画上限;false未达最高上限
}, },
userInfo: {}, userInfo: {},
noClick:true, //防止重复提交 noClick:true, //防止重复提交
@ -151,7 +151,7 @@
this.style_active = 0; this.style_active = 0;
this.prompt_active = 0; this.prompt_active = 0;
this.checkLogin(); this.checkLogin();
//this.checkUserCanAiPaint(); this.checkUserCanAiPaint();
}, },
methods: { methods: {
@ -189,12 +189,12 @@
const that = this; const that = this;
//console.log('that.checkData.checkCanPaint',that.checkData.checkCanPaint) //console.log('that.checkData.checkCanPaint',that.checkData.checkCanPaint)
//判断是否可进行ai绘画 TODO 暂时关闭校验 //判断是否可进行ai绘画 TODO 暂时关闭校验
// if(that.checkData.checkCanPaint === true){ if(that.checkData.checkCanPaint === true){
// return uni.showToast({ return uni.showToast({
// title: '当日绘画次数已用完,请明日再来!', title: '当日绘画次数已用完,请明日再来!',
// icon: 'none' icon: 'none'
// }) })
// } }
//判断必填项是否都填了 //判断必填项是否都填了
//console.log('创作prompt为:',that.formData.promptText) //console.log('创作prompt为:',that.formData.promptText)
@ -236,7 +236,7 @@
painterId: that.userInfo.id, painterId: that.userInfo.id,
painterName: that.userInfo.username, painterName: that.userInfo.username,
appType: 0, appType: 0,
platform: 0 platform: 1
} }
uni.navigateTo({ uni.navigateTo({
url: './paintDetail?data='+JSON.stringify(data) url: './paintDetail?data='+JSON.stringify(data)
@ -326,28 +326,28 @@
}, },
//判断是否达到免费AI绘画次数上限 //判断是否达到免费AI绘画次数上限
// async checkUserCanAiPaint(){ async checkUserCanAiPaint(){
// let that = this; let that = this;
// const data = { const data = {
// userId: that.userInfo.id, userId: that.userInfo.id,
// platform: 0, platform: 0,
// appType: 0 appType: 0
// } }
// const res = await checkUserCanAiPaint(data); const res = await checkUserCanAiPaint(data);
// //console.log('res绘画',res) //console.log('res绘画',res)
// if(res.data.code === 200){ if(res.data.code === 200){
// if(res.data.data === true){ if(res.data.data === true){
// that.checkData.checkCanPaint = true; that.checkData.checkCanPaint = true;
// }else{ }else{
// that.checkData.checkCanPaint = false; that.checkData.checkCanPaint = false;
// } }
// }else{ }else{
// return uni.showModal({ return uni.showModal({
// content: '检查绘画上限失败!', content: '检查绘画上限失败!',
// showCancel: false showCancel: false
// }); });
// } }
// }, },
//获取绘画风格 //获取绘画风格
async getPaintStyleList() { async getPaintStyleList() {

Loading…
Cancel
Save