Browse Source

Merge branch 'feature-1.1-dev' of http://182.42.100.27:10113/bnyer/bnyer-cloud-tiktok into feature-1.1-dev

feature-1.1
langz 3 years ago
parent
commit
3f8a77f17e
  1. 8
      api/paint.js
  2. 2
      components/toTop/toTop.vue
  3. 7
      pages.json
  4. 366
      pages/ai/paint/paint.vue
  5. 99
      pages/ai/paint/paintDetail.vue
  6. 35
      pages/userInfo/aiPaint/aiPaint.vue
  7. 34
      pages/userInfo/userInfo.vue
  8. 222
      pages/userInfo/vip/vip.vue
  9. 22
      static/icon/iconfont.css
  10. BIN
      static/icon/iconfont.ttf

8
api/paint.js

@ -47,6 +47,14 @@ export function getAiPaintPage(data) {
}) })
} }
// 获取绘画者ai绘画详情
export function getAiPaintDetails(id) {
return request({
url: `${serviceTitle}${prefix}/getAiPaintDetails/${id}`,
method: 'get',
})
}
// 检查某平台用户当日ai绘画次数是否超标 // 检查某平台用户当日ai绘画次数是否超标
export function checkUserCanAiPaint(data) { export function checkUserCanAiPaint(data) {
return request({ return request({

2
components/toTop/toTop.vue

@ -2,7 +2,7 @@
<!-- 返回顶部 --> <!-- 返回顶部 -->
<view class="toTop_M"> <view class="toTop_M">
<view class="btn" @tap="toTop" :style="{'display':(toTopFlag === false ? 'none' : 'block')}"> <view class="btn" @tap="toTop" :style="{'display':(toTopFlag === false ? 'none' : 'block')}">
<uni-icons class="list-menu-icon" custom-prefix="iconfont" :type="'icon-shouye'" size="20" :color="iconColor"></uni-icons> <uni-icons class="list-menu-icon" custom-prefix="iconfont" type="icon-toTop" size="20" :color="iconColor"></uni-icons>
</view> </view>
</view> </view>
</template> </template>

7
pages.json

@ -128,6 +128,13 @@
} }
}, { }, {
"path": "pages/userInfo/vip/vip",
"style": {
"navigationBarTitleText": "会员中心",
"enablePullDownRefresh": false
}
} ,{
"path": "pages/creator/banner", "path": "pages/creator/banner",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",

366
pages/ai/paint/paint.vue

@ -2,13 +2,17 @@
<view class="container"> <view class="container">
<uni-forms :modelValue="formData" ref="form" validate-trigger='blur'> <uni-forms :modelValue="formData" ref="form" validate-trigger='blur'>
<!-- 提示词 --> <!-- 提示词 -->
<view class="promptText">
<view class="head"> <view class="head">
<view class="title">绘画提示词</view> <view class="left">
<view class="title">绘画关键词</view>
</view>
</view>
<view> <view>
<uni-easyinput type="textarea" autoHeight v-model="formData.promptText" placeholder="请输入想生成画的提示词" class="promptInput" @blur="checkPrompt(formData.promptText)"></uni-easyinput> <uni-easyinput type="textarea" autoHeight v-model="formData.promptText" placeholder="请输入想生成画的关键词" class="promptInput" @blur="checkPrompt(formData.promptText)"></uni-easyinput>
</view> </view>
<view class="checkPromptText" v-if="checkData.checkPrompt == false"> <view class="checkPromptText" v-if="checkData.checkPrompt == false">
<text>请输入提示!</text> <text>请输入关键!</text>
</view> </view>
</view> </view>
@ -66,6 +70,64 @@
<text>请选择画布大小!</text> <text>请选择画布大小!</text>
</view> </view>
</view> </view>
<view>
<view class="head">
<view class="left">
<view class="title">高级设置<uni-icons class="tip-vip-icon" custom-prefix="iconfont" type="icon-tipvip" size="14" color="#f3a73f"/></view>
</view>
<view class="right">
<switch :checked="advancedSetting" :color="primaryColor" style="transform:scale(0.7)" @change="openAdvancedSetting"/>
</view>
</view>
<view class="advanced-setting" v-if="advancedSetting">
<view class="form-item">
<view class="form-label">反向词</view>
<uni-easyinput type="textarea" autoHeight v-model="formData.negativePrompt" placeholder="请输入我不想生成的词" class="promptInput" ></uni-easyinput>
</view>
<view class="form-item">
<view class="form-label">种子(随机种子为-1)</view>
<input class="uni-input" v-model="formData.seed" type="number" placeholder="请输入种子" />
</view>
<view class="form-item">
<view class="form-label">生成数量</view>
<uni-number-box v-model="formData.batchSize" :step="1" :min="1" :max="4" />
</view>
<view class="form-item">
<view class="form-label display-flex-sb">
<view class="left-title">关键词相关性</view>
<view class="right-title">{{formData.sfgScale ?? 7}}</view>
</view>
<slider :step="1" :min="0" :max="80" :block-size="12" :activeColor="primaryColor"
@change="(e) => {this.formData.sfgScale = (e.detail.value * 0.1 + 7).toFixed(1)}"
@changing="(e) => {this.formData.sfgScale = (e.detail.value * 0.1 + 7).toFixed(1)}"
/>
</view>
<view class="form-item">
<view class="form-label display-flex-sb">
<view class="left-title">绘画步骤</view>
<view class="right-title">{{formData.steps ?? 20}}</view>
</view>
<slider :step="1" :min="20" :max="30" :block-size="12" :activeColor="primaryColor"
@change="(e) => {this.formData.steps = e.detail.value}"
@changing="(e) => {this.formData.steps = e.detail.value}"
/>
</view>
<view class="form-item">
<view class="form-label display-flex-sb">
<view class="left-title">差异强度</view>
<view class="right-title">{{formData.eta ?? 0}}</view>
</view>
<slider :step="1" :min="0" :max="10" :block-size="12" :activeColor="primaryColor"
@change="(e) => {this.formData.eta = (e.detail.value * 0.1).toFixed(1)}"
@changing="(e) => {this.formData.eta = (e.detail.value * 0.1).toFixed(1)}"
/>
</view>
<view class="form-item">
<view class="form-label">采样方法</view>
<uni-data-checkbox mode="button" v-model="formData.samplerIndex" :localdata="samplerIndexArr" :selectedColor="primaryColor" :selectedTextColor="primaryColor"></uni-data-checkbox>
</view>
</view>
</view>
<view class="bottom"> <view class="bottom">
<view> <view>
@ -89,6 +151,13 @@
modelName: undefined, modelName: undefined,
styleName: undefined, styleName: undefined,
promptText: undefined, promptText: undefined,
negativePrompt: undefined, //
seed: -1, //
batchSize: 1, //
sfgScale: 7, //
steps: 20, //
eta: 0, //
samplerIndex: "Euler a", //
}, },
checkData:{ checkData:{
checkPrompt: undefined, //true;false checkPrompt: undefined, //true;false
@ -123,6 +192,28 @@
width: 512 width: 512
} }
], ],
advancedSetting: false,
samplerIndexArr: [
{text:"Euler a", value:"Euler a"},
{text:"Euler", value:"Euler"},
{text:"LMS", value:"LMS"},
{text:"Heun", value:"Heun"},
{text:"DPM2", value:"DPM2"},
{text:"DPM2 a", value:"DPM2 a"},
{text:"DPM++ 2S a", value:"DPM++ 2S a"},
{text:"DPM++ 2M", value:"DPM++ 2M"},
{text:"DPM++ SDE", value:"DPM++ SDE"},
{text:"DPM fast", value:"DPM fast"},
{text:"DPM adaptive", value:"DPM adaptive"},
{text:"LMS Karras", value:"LMS Karras"},
{text:"DPM2 Karras", value:"DPM2 Karras"},
{text:"DPM2 a Karras", value:"DPM2 a Karras"},
{text:"DPM++ 2S a Karras", value:"DPM++ 2S a Karras"},
{text:"DPM++ 2M Karras", value:"DPM++ 2M Karras"},
{text:"DPM++ SDE Karras", value:"DPM++ SDE Karras"},
{text:"DDIM", value:"DDIM"},
{text:"PLMS", value:"PLMS"}
],
} }
}, },
created() { created() {
@ -140,6 +231,15 @@
this.formData.modelName = undefined; this.formData.modelName = undefined;
this.formData.styleName = undefined; this.formData.styleName = undefined;
this.formData.promptText = undefined; this.formData.promptText = undefined;
this.advancedSetting = false;
this.formData.sfgScale = undefined;
this.formData.negativePrompt = undefined;
this.formData.seed = -1;
this.formData.batchSize = 1;
this.formData.sfgScale = 7;
this.formData.steps = 20;
this.formData.eta = 0;
this.formData.samplerIndex = "Euler a";
this.size_active = 0; this.size_active = 0;
this.style_active = 0; this.style_active = 0;
this.prompt_active = 0; this.prompt_active = 0;
@ -147,7 +247,18 @@
this.checkUserCanAiPaint(); this.checkUserCanAiPaint();
}, },
methods: { methods: {
openAdvancedSetting(e) {
//TODO VIP
this.advancedSetting = e.detail.value;
this.formData.sfgScale = undefined;
this.formData.negativePrompt = undefined;
this.formData.seed = -1;
this.formData.batchSize = 1;
this.formData.sfgScale = 7;
this.formData.steps = 20;
this.formData.eta = 0;
this.formData.samplerIndex = `Euler a`;
},
// //
// //
@ -226,6 +337,13 @@
prompt: that.formData.promptText, prompt: that.formData.promptText,
modelName: that.formData.modelName, modelName: that.formData.modelName,
styleName: that.formData.styleName, styleName: that.formData.styleName,
negativePrompt: that.formData.negativePrompt, //
seed: that.formData.seed, //
batchSize: that.formData.batchSize, //
sfgScale: that.formData.sfgScale, //
steps: that.formData.steps, //
eta: that.formData.eta, //
samplerIndex: that.formData.samplerIndex, //
painterId: that.userInfo.id, painterId: that.userInfo.id,
painterName: that.userInfo.username, painterName: that.userInfo.username,
appType: 0, appType: 0,
@ -394,38 +512,8 @@
padding: 0 10px; padding: 0 10px;
} }
.title {
font-size: 28rpx;
line-height: 48rpx;
}
.size {
width: 100%;
.lists {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
.item {
background-color: $uni-white;
padding: 10rpx 20rpx;
border-radius: 10rpx;
color: $uni-base-color;
border: 1rpx solid $uni-border-4;
margin-bottom: 10rpx;
font-size: 24rpx;
margin-right: 20rpx;
}
.active {
color: $uni-white;
border: 1rpx solid $uni-primary;
background-color: $uni-primary-60; //# FFDEE0
}
}
.head { .head {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
@ -436,7 +524,13 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.title {
font-size: 28rpx;
.tip-vip-icon {
margin-left: 20rpx;
}
}
} }
.right { .right {
@ -446,57 +540,43 @@
.title { .title {
margin-right: 15rpx; margin-right: 15rpx;
font-size: 24rpx;
line-height: 48rpx;
color: $uni-primary;
} }
.icon {
line-height: 48rpx;
} }
} }
} }
.play { .size {
width: 92%; width: 100%;
margin: 15rpx auto;
.lists { .lists {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
.item { .item {
background-color: #FFDEE0; background-color: $uni-white;
padding: 10rpx 30rpx; padding: 10rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
height: 30rpx; color: $uni-base-color;
color: #F22E38; border: 1rpx solid $uni-border-4;
border: 1rpx solid #F22E38;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 24rpx; font-size: 24rpx;
margin-right: 20rpx;
} }
}
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 30rpx;
.left { .active {
display: flex; color: $uni-white;
flex-direction: row; border: 1rpx solid $uni-primary;
align-items: center; background-color: $uni-primary-60; //# FFDEE0
.title {
font-size: 28rpx;
} }
} }
.right {
display: flex;
flex-direction: row;
align-items: center;
.title {
margin-right: 15rpx;
}
}
}
} }
.style { .style {
@ -526,32 +606,6 @@
} }
} }
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 20rpx;
.left {
display: flex;
flex-direction: row;
align-items: center;
.title {
font-size: 28rpx;
}
}
.right {
display: flex;
flex-direction: row;
align-items: center;
.title {
margin-right: 15rpx;
}
}
}
} }
.keywords { .keywords {
@ -586,90 +640,6 @@
} }
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 15rpx;
.left {
display: flex;
flex-direction: row;
align-items: center;
.title {
font-size: 28rpx;
}
}
.right {
display: flex;
flex-direction: row;
align-items: center;
.title {
margin-right: 15rpx;
font-size: 24rpx;
line-height: 48rpx;
color: $uni-primary;
}
.icon {
line-height: 48rpx;
}
}
}
}
.btn-action {
width: 90%;
position: fixed;
bottom: 0rpx;
left: 4%;
height: 120rpx;
.btn-group {
display: flex;
flex-direction: row;
justify-content: space-between;
.rand {
width: 40%;
.u-button {
height: 100rpx;
}
}
.start {
width: 55%;
.btn-normal {
height: 100rpx;
line-height: normal;
font-size: 28rpx;
border-radius: 50rpx;
background-color: #f22e38;
border: none;
color: #f4f4f5;
display: flex;
flex-direction: column;
justify-content: center;
box-shadow: 3rpx 3rpx 10rpx #dd6161;
.title {
font-weight: bolder;
}
.small {
font-size: 24rpx;
}
}
.btn-normal::after {
border: initial;
}
}
}
} }
.styleBox{ .styleBox{
@ -724,6 +694,46 @@
bottom: 0; bottom: 0;
} }
} }
.advanced-setting {
margin-top: 20rpx;
padding-bottom: 100rpx;
.form-item {
input {
color: rgb(51, 51, 51);
}
.uni-input {
border: 2rpx solid $uni-border-1;
border-radius: 10rpx;
border-color: rgb(229, 229, 229);
font-size: 28rpx;
padding: 10rpx 20rpx;
}
.form-label {
font-size: 28rpx;
margin: 10rpx 0;
line-height: 38rpx;
}
.display-flex-sb {
display: flex;
justify-content: space-between;
.right-title {
color: $uni-primary;
}
}
}
}
.bottom { .bottom {
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
position: fixed; position: fixed;

99
pages/ai/paint/paintDetail.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="container" :style="{backgroundColor: 'black',width: 100 + '%',height: 100 + '%'}"> <view class="container" >
<!-- 图片绘制区域 --> <!-- 图片绘制区域 -->
<view class="paint"> <view class="paint">
<view class="cover" v-if="successFlag === false"> <view class="cover" v-if="successFlag === false">
@ -14,12 +14,13 @@
</view> </view>
<!-- 绘制好的图替换默认图展示 --> <!-- 绘制好的图替换默认图展示 -->
<view class="successCover" @click="onPreviewImage" v-if="successFlag === true"> <view class="successCover" @click="onPreviewImage" v-if="successFlag === true">
<image :src="transImg" mode="aspectFill" class="img"></image> <image :src="transImg" mode="widthFix" class="img"/>
</view> </view>
</view> </view>
<!-- <view class="complete" :style="{backgroundImage: 'url(' + transImg + ')'}"> --> <!-- <view class="complete" :style="{backgroundImage: 'url(' + transImg + ')'}"> -->
<view class="complete"> <view class="complete">
<view class="Multi-sheet-tips" v-if="batchSize > 1">此处仅展示第一张图其余请前往创作工坊查看</view>
<!-- prompt关键词 --> <!-- prompt关键词 -->
<view class="keywords"> <view class="keywords">
<view> <view>
@ -54,33 +55,34 @@
</view> </view>
</view> </view>
</view>
<!-- 底部操作栏(绘制成功替换告知图片保存在用户画册里) --> <!-- 底部操作栏(绘制成功替换告知图片保存在用户画册里) -->
<view class="action" v-if="successFlag === true"> <view class="action" v-if="successFlag === true">
<view class="action-group"> <view class="action-group">
<view class="actionBtn"> <view class="actionBtn">
<view class="grid" @click="onCopyPrompt"> <view class="grid" @click="onCopyPrompt">
<uni-icons type="paperplane-filled" size="30"></uni-icons> <view><uni-icons type="link" size="24"></uni-icons></view>
<text class="grid-text">复制关键词</text> <text class="grid-text">复制关键词</text>
</view> </view>
</view> </view>
<view class="actionBtn"> <view class="actionBtn">
<view class="grid" @click="onSaveImage(transImg)"> <view class="grid" @click="onSaveImage(transImg)">
<uni-icons type="cloud-download-filled" size="30"></uni-icons> <view><uni-icons type="cloud-download" size="24"></uni-icons></view>
<text class="grid-text">保存作品</text> <text class="grid-text">保存作品</text>
</view> </view>
</view> </view>
<view class="actionBtn"> <button open-type="share" size="mini" class="actionBtn" plain="true" type="default">
<view class="grid" @click="onShareImage"> <view class="grid" >
<uni-icons type="pyq" size="30"></uni-icons> <view><uni-icons type="paperplane" size="24"></uni-icons></view>
<button open-type="share" size="mini" plain="true" type="default">分享好友</button> <text class="grid-text">分享好友</text>
</view>
</view> </view>
</button>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
@ -100,6 +102,7 @@
paintId: undefined, paintId: undefined,
paintTime: undefined, paintTime: undefined,
styleName: undefined, styleName: undefined,
batchSize: undefined,
//imgHeight: 512, //imgHeight: 512,
//imgWidth: 512, //imgWidth: 512,
} }
@ -112,11 +115,12 @@
this.imgWidth = paintData.width; this.imgWidth = paintData.width;
this.prompt = paintData.prompt; this.prompt = paintData.prompt;
this.styleName = paintData.styleName; this.styleName = paintData.styleName;
this.batchSize = paintData.batchSize;
textToImg(paintData).then(res =>{ textToImg(paintData).then(res =>{
if(res.data.code === 200){ if(res.data.code === 200){
uni.hideLoading(); uni.hideLoading();
console.log('res',res); console.log('res',res);
this.base64ToPath(res.data.data.images); this.base64ToPath(res.data.data.images[0]);
this.successFlag = true; this.successFlag = true;
this.paintTime = res.data.data.paintTime; this.paintTime = res.data.data.paintTime;
this.paintId = res.data.data.paintId; this.paintId = res.data.data.paintId;
@ -418,10 +422,6 @@
</script> </script>
<style lang="scss"> <style lang="scss">
page {
background-color: #f4f4f4;
height: 100%;
}
@keyframes xing { @keyframes xing {
@ -452,14 +452,13 @@
margin-top: 30rpx; margin-top: 30rpx;
} }
.complete {
.action { .action {
width: 100%; width: 100%;
position: fixed; position: fixed;
bottom: 0rpx; bottom: 0rpx;
left: 0rpx; left: 0rpx;
background-color: #fff; background-color: #fff;
padding: 30rpx 10rpx; padding: 20rpx 10rpx;
.action-group { .action-group {
width: 90%; width: 90%;
@ -468,6 +467,20 @@
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
button {
background-color: transparent;
border: 0;
outline: 0;
font-size: 28rpx;
padding: 0;
line-height: inherit;
}
button::after{
border: none;
outline: 0;
}
.actionBtn{ .actionBtn{
width: 50%; width: 50%;
display: flex; display: flex;
@ -481,24 +494,25 @@
align-items: center; align-items: center;
.grid-text { .grid-text {
font-size: 30rpx; font-size: 28rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
button {
background-color: transparent;
border: 0;
outline: 0;
font-size: 30rpx;
}
button::after{
border: none;
outline: 0;
} }
} }
} }
} }
.complete {
padding-bottom: 200rpx;
.Multi-sheet-tips {
width: 92%;
margin: 0 auto;
font-size: 24rpx;
line-height: 38rpx;
color: $uni-base-color;
border-bottom: 1rpx solid $uni-border-2;
} }
.label { .label {
@ -516,22 +530,21 @@
flex-direction: row; flex-direction: row;
align-items: flex-start; align-items: flex-start;
margin-top: 30rpx; margin-top: 30rpx;
color:#fff;
font-weight: bolder; font-weight: bolder;
.i { .i {
//background-color: #fff; font-size: 28rpx;
color: #1A96DB; color: $uni-primary;
padding: 5rpx 10rpx;
border-radius: 5rpx; border-radius: 5rpx;
margin-right: 15rpx; margin-right: 15rpx;
line-height: 38rpx;
} }
.text { .text {
font-size: 40rpx; font-size: 26rpx;
line-height: 38rpx;
font-weight: bolder; font-weight: bolder;
color: #fff; color: $uni-base-color;
background-color: #1A94BC1A;
} }
} }
} }
@ -539,26 +552,28 @@
.promptTitle{ .promptTitle{
text-align: center; text-align: center;
font-weight: bolder; font-weight: bolder;
font-size: 40rpx; font-size: 28rpx;
color: #1A96DB; color: $uni-primary;
} }
.keywords { .keywords {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
//background-color: #1A94BC1A; //background-color: #1A94BC1A;
padding: 15rpx; //padding: 15rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 15rpx; margin-top: 15rpx;
font-weight: bolder; font-weight: bolder;
.content { .content {
margin-top: 20rpx;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
/*这里设置几行*/ /*这里设置几行*/
overflow: hidden; overflow: hidden;
color: #fff; color: $uni-base-color;
font-size: 26rpx;
} }
} }
} }
@ -595,12 +610,12 @@
.successCover { .successCover {
width: 100%; width: 100%;
height: 720rpx; height: auto;
border-radius: 10rpx; border-radius: 10rpx;
.img{ .img{
width: 100%; width: 100%;
height: 720rpx; height: auto;
border-radius: 10rpx; border-radius: 10rpx;
} }
} }

35
pages/userInfo/aiPaint/aiPaint.vue

@ -5,6 +5,7 @@
<view> <view>
<uni-load-more :status="loadStatus"></uni-load-more> <uni-load-more :status="loadStatus"></uni-load-more>
</view> </view>
<toTop :toTopFlag="toTopFlag" :toTop="toTop"></toTop>
</view> </view>
</template> </template>
@ -13,9 +14,11 @@
getAiPaintPage getAiPaintPage
} from '@/api/paint.js' } from '@/api/paint.js'
import waterfallList from '@/components/waterfall-list/waterfall-list.vue' import waterfallList from '@/components/waterfall-list/waterfall-list.vue'
import toTop from '@/components/toTop/toTop.vue'
export default { export default {
components:{ components:{
waterfallList waterfallList,
toTop
}, },
data() { data() {
return { return {
@ -24,9 +27,10 @@
imgWidth: 0, // imgWidth: 0, //
imgHeight: 0, // imgHeight: 0, //
pageNum: 1, pageNum: 1,
pageSize: 4, pageSize: 10,
loadStatus:'noMore', //more - loading - noMore - loadStatus:'noMore', //more - loading - noMore -
isLoadMore:false, // isLoadMore:false, //
toTopFlag: false
} }
}, },
onShow() { onShow() {
@ -55,10 +59,21 @@
} }
} }
}, },
onPageScroll(e){
//
this.toTopFlag = e.scrollTop > 200; //
},
methods: { methods: {
toTop() {
uni.pageScrollTo({
scrollTop: 0,
duration: 100,
});
},
// ai // ai
async getImgList() { async getImgList() {
let that = this let that = this
that.loadStatus = 'loading';
const res = await getAiPaintPage({ const res = await getAiPaintPage({
painterId: that.userInfo.id, painterId: that.userInfo.id,
source: '1', source: '1',
@ -67,7 +82,17 @@
}) })
console.log('res',res) console.log('res',res)
if (res.data.code === 200) { if (res.data.code === 200) {
that.$refs.waterfallRef.addData(res.data.rows); let imgData = res.data.rows?.map?.(item => {
if (item.width == 1024 && item.height == 512) {
item.typeId = 4;
} else if (item.width == 512 && item.height == 1024) {
item.typeId = 3;
} else {
item.typeId = 1;
}
return item;
});
that.$refs.waterfallRef.addData(imgData);
if(res.data.rows.length < that.pageSize){ // if(res.data.rows.length < that.pageSize){ //
that.isLoadMore = true that.isLoadMore = true
that.loadStatus = 'noMore' that.loadStatus = 'noMore'
@ -92,7 +117,7 @@
console.log('图片为',item) console.log('图片为',item)
uni.setStorage({ uni.setStorage({
key: 'detailId', key: 'detailId',
data: item.imgId, data: item.id,
success() { success() {
uni.navigateTo({ uni.navigateTo({
url: '../../creator/imgDetail' url: '../../creator/imgDetail'
@ -127,8 +152,6 @@
<style lang="scss"> <style lang="scss">
.myCollection { .myCollection {
padding-right: 40rpx;
padding-top: 40rpx;
.uni-searchbar { .uni-searchbar {
border: 1px solid #11A8FD; border: 1px solid #11A8FD;

34
pages/userInfo/userInfo.vue

@ -7,7 +7,10 @@
<image :src="userInfo.img" mode=""></image> <image :src="userInfo.img" mode=""></image>
</view> </view>
<view class="right"> <view class="right">
<view class="username" v-if="userInfo.username">{{userInfo.username}}</view> <view class="username" v-if="userInfo.username">
{{userInfo.username}}
<uni-icons class="vip-icon" custom-prefix="iconfont" type="icon-VIP" size="14" :color="userInfo.isVip === '1' ? primaryColor : noVipColor "/>
</view>
<view class="login-btn uni-primary" v-else @click="$noMultipleClicks(getUserInfoLogin)">点击登录</view> <view class="login-btn uni-primary" v-else @click="$noMultipleClicks(getUserInfoLogin)">点击登录</view>
</view> </view>
</view> </view>
@ -17,24 +20,27 @@
<view class="prominent-menu-item collect-menu" @click="toLinkAuth('/pages/userInfo/myCollection/myCollection')"> <view class="prominent-menu-item collect-menu" @click="toLinkAuth('/pages/userInfo/myCollection/myCollection')">
<view class="prominent-menu-title">我的收藏</view> <view class="prominent-menu-title">我的收藏</view>
<view class="prominent-menu-icon"> <view class="prominent-menu-icon">
<uni-icons custom-prefix="iconfont" type="icon-wodeshoucang"size="40" :color="primaryColor" /> <uni-icons custom-prefix="iconfont" type="icon-wodeshoucang" size="40" :color="primaryColor" />
</view> </view>
</view> </view>
<!-- <view class="prominent-menu-item collect-menu" @click="toLinkAuth('/pages/userInfo/aiPaint/aiPaint')"> <view class="prominent-menu-item collect-menu" @click="toLinkAuth('/pages/userInfo/aiPaint/aiPaint')">
<view class="prominent-menu-title">创作工坊</view> <view class="prominent-menu-title">创作工坊</view>
<view class="prominent-menu-icon"> <view class="prominent-menu-icon">
<uni-icons custom-prefix="iconfont" type="icon-wodeshoucang"size="40" :color="primaryColor" /> <uni-icons custom-prefix="iconfont" type="icon-chuangzuozhongxin" size="40" :color="primaryColor" />
</view> </view>
</view> -->
</view> </view>
<view class="share-box"> </view>
<button title="兑换绘画次数" @click="$noMultipleClicks(useCdk)"> <view class="list-menu">
<view class="list-menu-item"> <view class="list-menu-item" @click="toLink('/pages/userInfo/vip/vip')">
<uni-icons class="list-menu-icon" type="vip" size="20" :color="primaryColor" />
<view class="text">我的会员</view>
<uni-icons class="list-menu-genduo" custom-prefix="iconfont" type="icon-gengduo"></uni-icons>
</view>
<view class="list-menu-item" @click="$noMultipleClicks(useCdk)">
<uni-icons class="list-menu-icon" custom-prefix="iconfont" type="icon-gengduo" size="20" :color="primaryColor" /> <uni-icons class="list-menu-icon" custom-prefix="iconfont" type="icon-gengduo" size="20" :color="primaryColor" />
<view class="text">兑换绘画次数</view> <view class="text">兑换绘画次数</view>
<uni-icons class="list-menu-genduo" custom-prefix="iconfont" type="icon-gengduo"></uni-icons> <uni-icons class="list-menu-genduo" custom-prefix="iconfont" type="icon-gengduo"></uni-icons>
</view> </view>
</button>
</view> </view>
<view class="list-menu"> <view class="list-menu">
@ -81,6 +87,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
userInfo: {}, userInfo: {},
noClick:true, //, noClick:true, //,
primaryColor: "#1a94bc", primaryColor: "#1a94bc",
noVipColor: "#6a6a6a",
menus: [ menus: [
{ {
title: "常见问题", title: "常见问题",
@ -331,8 +338,13 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
.username { .username {
font-size: 26rpx; font-size: 26rpx;
line-height: 48rpx;
font-weight: 600; font-weight: 600;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.25); text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.25);
.vip-icon {
margin-left: 20rpx;
}
} }
} }
@ -362,8 +374,8 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
//width //width
//width: calc(50% - 10rpx); width: calc(50% - 10rpx);
width: 100%; //width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx; border-radius: 10rpx;
background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%); background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%);

222
pages/userInfo/vip/vip.vue

@ -0,0 +1,222 @@
<template>
<view class="container">
<view class="header">
<view class="vip-info">
<image :src="userInfo.img" mode="" class="vip-info__avatar"></image>
<div>
<div class="vip-info__name">{{userInfo.username}}</div>
<div class="vip-info__tips">你还不是会员,开通立享 9 项特权</div>
</div>
</view>
<view class="vip-explan">
会员说明
<uni-icons type="help" size="20" color="#eee" />
</view>
</view>
<view class="vip-box">
<view class="vip-box__item item-active">
<view class="title">
1
</view>
<view class="price">
<text class="price-unit">¥</text> 189
</view>
<view class="o-price">
¥388
</view>
<view class="save-box">
立省60元
</view>
</view>
<view class="vip-box__item">
<view class="title">
1
</view>
<view class="price">
<text class="price-unit">¥</text> 189
</view>
<view class="o-price">
¥388
</view>
<view class="save-box">
立省60元
</view>
</view>
<view class="vip-box__item">
<view class="title">
1
</view>
<view class="price">
<text class="price-unit">¥</text> 189
</view>
<view class="o-price">
¥388
</view>
<view class="save-box">
立省60元
</view>
</view>
</view>
<button class="sumbit-btn">
立即开通
</button>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: null
}
},
methods: {
},
onShow() {
this.userInfo = uni.getStorageSync('userInfo')
},
created() {
if (this.userInfo) {
uni.navigateTo({
url: url
});
} else {
uni.navigateBack()
uni.showToast({
title: '请先登录',
icon: 'none'
})
}
}
}
</script>
<style lang="scss" scoped>
@mixin flex($center: center, $content: center) {
display: flex;
align-items: $center;
justify-content: $content;
}
.container {
padding: 30rpx;
background: #fff;
.vip-box {
margin: 30px 0;
@include flex(center,space-between);
.vip-box__item {
width: 30%;
height: 300rpx;
padding: 20rpx;
@include flex;
flex-direction: column;
color: #000;
border: 1px solid #eee;
border-radius: 30rpx;
&>view {
margin-bottom: 15rpx;
}
.title {
font-weight: bold;
font-size: 38rpx;
}
.price {
font-weight: bold;
font-size: 48rpx;
color: #1991fd;
.price-unit{
font-size: 24rpx
}
}
.o-price{
color: #eee;
font-size: 26rpx;
text-decoration:line-through;
}
.save-box{
border-radius: 30rpx;
width: 140rpx;
height: 50rpx;
background-color: #e8f4ff;
font-size: 24rpx;
color: #68c2ff;
@include flex;
}
}
.item-active {
border: none;
background: linear-gradient(to bottom right, #68c2ff, #0684fe);
.price,.title{
color: #fff;
}
.save-box{
color: #fff;
background-color: rgba(255,255,255,.1);
}
}
}
.sumbit-btn {
margin-top: 60rpx;
height: 88rpx;
@include flex;
font-size: 26rpx;
color: #fff;
background: linear-gradient(to bottom right, #68c2ff, #0684fe);
}
.header {
height: 200rpx;
background-color: gray;
padding: 20rpx;
@include flex(center,space-between);
border-radius: 20rpx;
.vip-explan {
color: #eee;
font-size: 24rpx;
@include flex(center,flex-start);
}
.vip-info {
@include flex(center,flex-start);
.vip-info__avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.vip-info__name {
color: #fff;
font-size: 30rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.vip-info__tips {
color: #eee;
font-size: 24rpx
}
}
}
}
</style>

22
static/icon/iconfont.css

@ -1,6 +1,6 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 3946003 */ font-family: "iconfont"; /* Project id 3946003 */
src: url('/static/icon/iconfont.ttf?t=1678976128744') format('truetype'); src: url('/static/icon/iconfont.ttf?t=1684048739520') format('truetype');
} }
.iconfont { .iconfont {
@ -11,6 +11,26 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-VIP:before {
content: "\e68e";
}
.icon-tipvip:before {
content: "\e665";
}
.icon-chuangzuozhongxin:before {
content: "\e608";
}
.icon-huabi:before {
content: "\e648";
}
.icon-toTop:before {
content: "\e629";
}
.icon-tuichu:before { .icon-tuichu:before {
content: "\e62c"; content: "\e62c";
} }

BIN
static/icon/iconfont.ttf

Binary file not shown.
Loading…
Cancel
Save