|
|
@ -134,7 +134,7 @@ |
|
|
<button type="default" @click="$noMultipleClicks(startPaint)" class="startPaint">开始创作<br/>消耗{{formData.goldNum}}点画意值</button> |
|
|
<button type="default" @click="$noMultipleClicks(startPaint)" class="startPaint">开始创作<br/>消耗{{formData.goldNum}}点画意值</button> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<view class="startPaint" @click="$noMultipleClicks(startPaint)"> |
|
|
<view class="startPaint" @click="$noMultipleClicks(startPaint)"> |
|
|
开始创作<br/>消耗{{formData.goldNum}}点画意值 |
|
|
开始创作<br/>消耗({{formData.goldNum}}点画意值) |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-forms> |
|
|
</uni-forms> |
|
|
@ -143,7 +143,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import base64ToImg from '@/utils/base64Utils'; |
|
|
import base64ToImg from '@/utils/base64Utils'; |
|
|
import {getPaintStyle, getPrompt, textToImg, checkUserCanAiPaint} from '@/api/paint.js'; |
|
|
import {getPaintStyle, getPrompt, textToImg} from '@/api/paint.js'; |
|
|
import {checkVip} from "@/api/paint"; |
|
|
import {checkVip} from "@/api/paint"; |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
@ -230,6 +230,7 @@ |
|
|
this.getPrompt(); |
|
|
this.getPrompt(); |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
onShow() { |
|
|
|
|
|
console.log('show') |
|
|
//进入页面清空原始属性 |
|
|
//进入页面清空原始属性 |
|
|
this.formData.height = undefined; |
|
|
this.formData.height = undefined; |
|
|
this.formData.width = undefined; |
|
|
this.formData.width = undefined; |
|
|
@ -244,29 +245,36 @@ |
|
|
this.formData.sfgScale = 7; |
|
|
this.formData.sfgScale = 7; |
|
|
this.formData.steps = 20; |
|
|
this.formData.steps = 20; |
|
|
this.formData.eta = 0; |
|
|
this.formData.eta = 0; |
|
|
this.formData.samplerIndex = "Euler a"; |
|
|
this.formData.samplerIndex = "DPM++ 2S a Karras"; |
|
|
this.size_active = 0; |
|
|
this.size_active = 0; |
|
|
this.style_active = 0; |
|
|
this.style_active = 0; |
|
|
this.prompt_active = 0; |
|
|
this.prompt_active = 0; |
|
|
this.checkLogin(); |
|
|
this.checkLogin(); |
|
|
this.checkUserCanAiPaint(); |
|
|
//this.checkUserCanAiPaint(); |
|
|
|
|
|
this.$forceUpdate(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
//高级绘画开关控制 |
|
|
openAdvancedSetting(e) { |
|
|
openAdvancedSetting(e) { |
|
|
console.log('e',e) |
|
|
console.log('e',e) |
|
|
|
|
|
let that = this; |
|
|
if (e.detail.value) { |
|
|
if (e.detail.value) { |
|
|
checkVip({userId: this.userInfo.id, userClientType: "10"}).then(res => { |
|
|
checkVip({userId: that.userInfo.id, userClientType: 10}).then(res => { |
|
|
if (res.data.code === 200) { |
|
|
if (res.data.code === 200) { |
|
|
if (res.data.data.isVip === "1") { |
|
|
if (res.data.data.isVip === "1") { |
|
|
this.advancedSetting = e.detail.value; |
|
|
that.advancedSetting = e.detail.value; |
|
|
} else { |
|
|
} else { |
|
|
this.advancedSetting = !e.detail.value; |
|
|
that.advancedSetting = !e.detail.value; |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: '提示', |
|
|
title: '你还不是VIP', |
|
|
content: '还不是会员,点击跳转开通会员', |
|
|
content: '点击确定解锁更多权益哟~', |
|
|
|
|
|
cancelText: '狠心拒绝', |
|
|
|
|
|
cancelColor: '#ff0000', |
|
|
|
|
|
confirmColor: '#0000ff', |
|
|
|
|
|
confirmText: '立刻前往', |
|
|
success(res){ |
|
|
success(res){ |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
//跳转登录界面 |
|
|
//跳转vip界面 |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:'/pages/userInfo/vip/vip' |
|
|
url:'/pages/userInfo/vip/vip' |
|
|
}) |
|
|
}) |
|
|
@ -276,14 +284,19 @@ |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
duration: 2000, |
|
|
duration: 2000, |
|
|
success() { |
|
|
success() { |
|
|
this.advancedSetting = false; |
|
|
that.advancedSetting = false; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
}else { |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
content: '网络错误,请稍后再试~', |
|
|
|
|
|
showCancel: false |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
this.advancedSetting = e.detail.value; |
|
|
this.advancedSetting = e.detail.value; |
|
|
@ -476,28 +489,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: 1, |
|
|
// platform: 1, |
|
|
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() { |
|
|
|