Browse Source

修改

feature-1.1
helming 3 years ago
parent
commit
44c49581bc
  1. 2
      components/toTop/toTop.vue
  2. 402
      pages/ai/paint/paint.vue
  3. 131
      pages/ai/paint/paintDetail.vue
  4. 35
      pages/userInfo/aiPaint/aiPaint.vue
  5. 17
      pages/userInfo/userInfo.vue
  6. 22
      static/icon/iconfont.css
  7. BIN
      static/icon/iconfont.ttf

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>

402
pages/ai/paint/paint.vue

@ -2,15 +2,19 @@
<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="head"> <view class="promptText">
<view class="title">绘画提示词</view> <view class="head">
<view> <view class="left">
<uni-easyinput type="textarea" autoHeight v-model="formData.promptText" placeholder="请输入想生成画的提示词" class="promptInput" @blur="checkPrompt(formData.promptText)"></uni-easyinput> <view class="title">绘画关键词</view>
</view> </view>
<view class="checkPromptText" v-if="checkData.checkPrompt == false"> </view>
<text>请输入提示词!</text> <view>
</view> <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">
<text>请输入关键词!</text>
</view>
</view>
<view class="keywords"> <view class="keywords">
<view class="head"> <view class="head">
@ -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,7 +192,29 @@
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() {
//this.base64ToPath(); //this.base64ToPath();
@ -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,10 +512,44 @@
padding: 0 10px; padding: 0 10px;
} }
.title {
font-size: 28rpx; .head {
line-height: 48rpx; 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;
.tip-vip-icon {
margin-left: 20rpx;
}
}
}
.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;
}
}
} }
.size { .size {
width: 100%; width: 100%;
@ -425,78 +577,6 @@
} }
} }
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 15rpx;
.left {
display: flex;
flex-direction: row;
align-items: center;
}
.right {
display: flex;
flex-direction: row;
align-items: center;
.title {
margin-right: 15rpx;
}
}
}
}
.play {
width: 92%;
margin: 15rpx auto;
.lists {
display: flex;
flex-direction: row;
.item {
background-color: #FFDEE0;
padding: 10rpx 30rpx;
border-radius: 10rpx;
height: 30rpx;
color: #F22E38;
border: 1rpx solid #F22E38;
margin-bottom: 10rpx;
font-size: 24rpx;
}
}
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 30rpx;
.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;
}
}
}
} }
.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;

131
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 class="action" v-if="successFlag === true">
<view class="action-group">
<view class="actionBtn">
<view class="grid" @click="onCopyPrompt">
<uni-icons type="paperplane-filled" size="30"></uni-icons>
<text class="grid-text">复制关键词</text>
</view>
</view>
<view class="actionBtn">
<view class="grid" @click="onSaveImage(transImg)">
<uni-icons type="cloud-download-filled" size="30"></uni-icons>
<text class="grid-text">保存作品</text>
</view>
</view>
<view class="actionBtn">
<view class="grid" @click="onShareImage">
<uni-icons type="pyq" size="30"></uni-icons>
<button open-type="share" size="mini" plain="true" type="default">分享好友</button>
</view>
</view>
</view>
</view>
</view> </view>
</view>
<!-- 底部操作栏(绘制成功替换告知图片保存在用户画册里) -->
<view class="action" v-if="successFlag === true">
<view class="action-group">
<view class="actionBtn">
<view class="grid" @click="onCopyPrompt">
<view><uni-icons type="link" size="24"></uni-icons></view>
<text class="grid-text">复制关键词</text>
</view>
</view>
<view class="actionBtn">
<view class="grid" @click="onSaveImage(transImg)">
<view><uni-icons type="cloud-download" size="24"></uni-icons></view>
<text class="grid-text">保存作品</text>
</view>
</view>
<button open-type="share" size="mini" class="actionBtn" plain="true" type="default">
<view class="grid" >
<view><uni-icons type="paperplane" size="24"></uni-icons></view>
<text class="grid-text">分享好友</text>
</view>
</button>
</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,26 +494,27 @@
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 {
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
@ -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;

17
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,13 +20,13 @@
<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>
@ -81,6 +84,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: "常见问题",
@ -157,7 +161,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
force: true, force: true,
success: (res) => { success: (res) => {
uni.getUserInfo({ uni.getUserInfo({
withCredentials: true, withCredentials: true,
success: (userInfo) => { success: (userInfo) => {
this.loginFunc(res, userInfo) this.loginFunc(res, userInfo)
}, },
@ -331,8 +335,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;
}
} }
} }

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