Compare commits

...

17 Commits

  1. 25
      api/paint.js
  2. 28
      api/userInfo.js
  3. 2
      components/toTop/toTop.vue
  4. 6
      main.js
  5. 543
      package-lock.json
  6. 29
      pages.json
  7. 276
      pages/ai/paint/loverPainResult.vue
  8. 262
      pages/ai/paint/loverPaint.vue
  9. 378
      pages/ai/paint/paint.vue
  10. 111
      pages/ai/paint/paintDetail.vue
  11. 26
      pages/index/indexProto.vue
  12. 67
      pages/userInfo/aiPaint/aiPaint.vue
  13. 414
      pages/userInfo/aiPaint/aiPaintDetail.vue
  14. 44
      pages/userInfo/userInfo.vue
  15. 254
      pages/userInfo/vip/vip.vue
  16. 22
      static/icon/iconfont.css
  17. BIN
      static/icon/iconfont.ttf

25
api/paint.js

@ -29,6 +29,15 @@ export function textToImg(data) {
})
}
// 520情侣头像
export function textToImgLove(data) {
return request({
url: `${serviceTitle}${prefix}/textToImgLove`,
method: 'post',
data
})
}
// 获取绘画者ai绘画分页
export function getAiPaintPage(data) {
return request({
@ -38,6 +47,14 @@ export function getAiPaintPage(data) {
})
}
// 获取绘画者ai绘画详情
export function getAiPaintDetails(id) {
return request({
url: `${serviceTitle}${prefix}/getAiPaintDetails/${id}`,
method: 'get',
})
}
// 检查某平台用户当日ai绘画次数是否超标
export function checkUserCanAiPaint(data) {
return request({
@ -54,5 +71,13 @@ export function useCdk(data) {
data
})
}
//判断是否VIP vip是否过期
export function checkVip(data) {
return request({
url: `${serviceTitle}/img/mini/vipRecord/queryUserVipRecord `,
method: 'get',
config: {params: data}
})
}

28
api/userInfo.js

@ -1,6 +1,7 @@
import request from '@/utils/request'
const serviceTitle = '/img'
const prefix = '/img/mini/tiktok'
const prefix_vip = '/img/mini/vip'
//GET 传参需要用 params
//POST 传参需要用 data
@ -12,3 +13,30 @@ export function listTiktokCollection(data) {
data: data
})
}
//获取会员list
export function queryUserVipList() {
return request({
url: `${serviceTitle}${prefix_vip}/queryUserVipList`,
method: 'post',
data:{}
})
}
//获取会员orderid
export function addVipOrder(data) {
return request({
url: `/order/vip/addVipOrder`,
method: 'post',
data
})
}
//获取抖音token
export function unifiedOrder(data) {
return request({
url: `/pay/unified/unifiedOrder`,
method: 'post',
data
})
}

2
components/toTop/toTop.vue

@ -2,7 +2,7 @@
<!-- 返回顶部 -->
<view class="toTop_M">
<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>
</template>

6
main.js

@ -5,8 +5,10 @@ import common from './utils/common.js'
// const baseURL = 'http://localhost:7010'
// const baseURL = 'http://81.69.47.31:7010'
const baseURL = 'https://service.bnyer.cn'
//const baseURL = 'http://vaqc3e.natappfree.cc'
// const baseURL = 'https://service.bnyer.cn' //正式
const baseURL = 'http://47.108.66.163:7010' //测试
// const baseURL = 'http://jbsu95.natappfree.cc' //本地
Vue.prototype.baseURL = baseURL;
Vue.prototype.$noMultipleClicks = common.noMultipleClicks;

543
package-lock.json

@ -1,473 +1,15 @@
{
"name": "bnyer-cloud-tiktok",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"lockfileVersion": 1,
"dependencies": {
"axios": "^0.26.1",
"qs": "^6.10.3",
"vue-router": "^4.0.14",
"vuex": "^4.0.2"
}
},
"node_modules/@babel/parser": {
"version": "7.21.3",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.21.3.tgz",
"integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==",
"peer": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@vue/compiler-core": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.2.47.tgz",
"integrity": "sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==",
"peer": true,
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-dom": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.2.47.tgz",
"integrity": "sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==",
"peer": true,
"dependencies": {
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.2.47.tgz",
"integrity": "sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==",
"peer": true,
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-ssr": "3.2.47",
"@vue/reactivity-transform": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
}
},
"node_modules/@vue/compiler-ssr": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.2.47.tgz",
"integrity": "sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/devtools-api": {
"version": "6.1.4",
"resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.1.4.tgz",
"integrity": "sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ=="
},
"node_modules/@vue/reactivity": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.2.47.tgz",
"integrity": "sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==",
"peer": true,
"dependencies": {
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/reactivity-transform": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz",
"integrity": "sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==",
"peer": true,
"dependencies": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
}
},
"node_modules/@vue/runtime-core": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.2.47.tgz",
"integrity": "sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==",
"peer": true,
"dependencies": {
"@vue/reactivity": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/@vue/runtime-dom": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.2.47.tgz",
"integrity": "sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==",
"peer": true,
"dependencies": {
"@vue/runtime-core": "3.2.47",
"@vue/shared": "3.2.47",
"csstype": "^2.6.8"
}
},
"node_modules/@vue/server-renderer": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.2.47.tgz",
"integrity": "sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==",
"peer": true,
"dependencies": {
"@vue/compiler-ssr": "3.2.47",
"@vue/shared": "3.2.47"
},
"peerDependencies": {
"vue": "3.2.47"
}
},
"node_modules/@vue/shared": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.47.tgz",
"integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==",
"peer": true
},
"node_modules/axios": {
"version": "0.26.1",
"resolved": "https://registry.npmmirror.com/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"dependencies": {
"follow-redirects": "^1.14.8"
}
},
"node_modules/call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"dependencies": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
}
},
"node_modules/csstype": {
"version": "2.6.21",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-2.6.21.tgz",
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==",
"peer": true
},
"node_modules/estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"peer": true
},
"node_modules/follow-redirects": {
"version": "1.15.0",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.0.tgz",
"integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"node_modules/get-intrinsic": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
}
},
"node_modules/has": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dependencies": {
"function-bind": "^1.1.1"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/has-symbols": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/magic-string": {
"version": "0.25.9",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
"integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
"peer": true,
"dependencies": {
"sourcemap-codec": "^1.4.8"
}
},
"node_modules/nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"peer": true,
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/object-inspect": {
"version": "1.12.0",
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.12.0.tgz",
"integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g=="
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"peer": true
},
"node_modules/postcss": {
"version": "8.4.21",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.21.tgz",
"integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==",
"peer": true,
"dependencies": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/qs": {
"version": "6.10.3",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"dependencies": {
"side-channel": "^1.0.4"
},
"engines": {
"node": ">=0.6"
}
},
"node_modules/side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
}
},
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"deprecated": "Please use @jridgewell/sourcemap-codec instead",
"peer": true
},
"node_modules/vue": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.2.47.tgz",
"integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-sfc": "3.2.47",
"@vue/runtime-dom": "3.2.47",
"@vue/server-renderer": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"node_modules/vue-router": {
"version": "4.0.15",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.0.15.tgz",
"integrity": "sha512-xa+pIN9ZqORdIW1MkN2+d9Ui2pCM1b/UMgwYUCZOiFYHAvz/slKKBDha8DLrh5aCG/RibtrpyhKjKOZ85tYyWg==",
"dependencies": {
"@vue/devtools-api": "^6.0.0"
},
"peerDependencies": {
"vue": "^3.2.0"
}
},
"node_modules/vuex": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/vuex/-/vuex-4.0.2.tgz",
"integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==",
"dependencies": {
"@vue/devtools-api": "^6.0.0-beta.11"
},
"peerDependencies": {
"vue": "^3.0.2"
}
}
},
"dependencies": {
"@babel/parser": {
"version": "7.21.3",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.21.3.tgz",
"integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==",
"peer": true
},
"@vue/compiler-core": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.2.47.tgz",
"integrity": "sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==",
"peer": true,
"requires": {
"@babel/parser": "^7.16.4",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
}
},
"@vue/compiler-dom": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.2.47.tgz",
"integrity": "sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==",
"peer": true,
"requires": {
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"@vue/compiler-sfc": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.2.47.tgz",
"integrity": "sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==",
"peer": true,
"requires": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-ssr": "3.2.47",
"@vue/reactivity-transform": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
}
},
"@vue/compiler-ssr": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.2.47.tgz",
"integrity": "sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==",
"peer": true,
"requires": {
"@vue/compiler-dom": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"@vue/devtools-api": {
"version": "6.1.4",
"resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.1.4.tgz",
"integrity": "sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ=="
},
"@vue/reactivity": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.2.47.tgz",
"integrity": "sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==",
"peer": true,
"requires": {
"@vue/shared": "3.2.47"
}
},
"@vue/reactivity-transform": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz",
"integrity": "sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==",
"peer": true,
"requires": {
"@babel/parser": "^7.16.4",
"@vue/compiler-core": "3.2.47",
"@vue/shared": "3.2.47",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
}
},
"@vue/runtime-core": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.2.47.tgz",
"integrity": "sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==",
"peer": true,
"requires": {
"@vue/reactivity": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"@vue/runtime-dom": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.2.47.tgz",
"integrity": "sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==",
"peer": true,
"requires": {
"@vue/runtime-core": "3.2.47",
"@vue/shared": "3.2.47",
"csstype": "^2.6.8"
}
},
"@vue/server-renderer": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.2.47.tgz",
"integrity": "sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==",
"peer": true,
"requires": {
"@vue/compiler-ssr": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"@vue/shared": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.47.tgz",
"integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==",
"peer": true
},
"axios": {
"version": "0.26.1",
"resolved": "https://registry.npmmirror.com/axios/-/axios-0.26.1.tgz",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"requires": {
"follow-redirects": "^1.14.8"
@ -482,22 +24,10 @@
"get-intrinsic": "^1.0.2"
}
},
"csstype": {
"version": "2.6.21",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-2.6.21.tgz",
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==",
"peer": true
},
"estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"peer": true
},
"follow-redirects": {
"version": "1.15.0",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.0.tgz",
"integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ=="
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
},
"function-bind": {
"version": "1.1.1",
@ -527,43 +57,11 @@
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
},
"magic-string": {
"version": "0.25.9",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
"integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
"peer": true,
"requires": {
"sourcemap-codec": "^1.4.8"
}
},
"nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"peer": true
},
"object-inspect": {
"version": "1.12.0",
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.12.0.tgz",
"integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g=="
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"peer": true
},
"postcss": {
"version": "8.4.21",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.21.tgz",
"integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==",
"peer": true,
"requires": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
},
"qs": {
"version": "6.10.3",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.10.3.tgz",
@ -582,37 +80,6 @@
"object-inspect": "^1.9.0"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true
},
"source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"peer": true
},
"sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmmirror.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"peer": true
},
"vue": {
"version": "3.2.47",
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.2.47.tgz",
"integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==",
"peer": true,
"requires": {
"@vue/compiler-dom": "3.2.47",
"@vue/compiler-sfc": "3.2.47",
"@vue/runtime-dom": "3.2.47",
"@vue/server-renderer": "3.2.47",
"@vue/shared": "3.2.47"
}
},
"vue-router": {
"version": "4.0.15",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.0.15.tgz",

29
pages.json

@ -63,6 +63,20 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/ai/paint/loverPaint",
"style": {
"navigationBarTitleText": "专属情侣头像",
"enablePullDownRefresh": false
}
},
{
"path": "pages/ai/paint/loverPainResult",
"style": {
"navigationBarTitleText": "专属情侣头像",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/userInfo",
"style": {
@ -84,6 +98,14 @@
"enablePullDownRefresh": true
}
},
{
"path": "pages/userInfo/aiPaint/aiPaintDetail",
"style": {
"navigationBarTitleText": "创作工坊",
"enablePullDownRefresh": true
}
},
{
"path": "pages/userInfo/question/question",
@ -113,6 +135,13 @@
"enablePullDownRefresh": false
}
}, {
"path": "pages/userInfo/vip/vip",
"style": {
"navigationBarTitleText": "会员中心",
"enablePullDownRefresh": false
}
} ,{
"path": "pages/creator/banner",
"style": {

276
pages/ai/paint/loverPainResult.vue

@ -0,0 +1,276 @@
<template>
<view class="wrap">
<view class="top-box">
<view class="love-title">
</view>
<view class="top-img-box">
<view v-if="!finishDraw" class="loading">
<view class="loading-icon">
<uni-icons type="spinner-cycle" size="40"></uni-icons>
</view>
<view class="loading-tips">
Ai正在拼命绘制中.....
</view>
</view>
<view v-if="finishDraw" class="img-item-box">
<img class="img-item" :src="`data:image/png;base64,${resultImg[0]}`" >
<img class="img-item" :src="`data:image/png;base64,${resultImg[1]}`" >
<view class="heart-icon"></view>
</view>
</view>
<view v-if="finishDraw" class="button-box">
<view class="save-button" @click="clickSave(resultImg[0])"></view>
<view class="save-button" @click="clickSave(resultImg[1])"></view>
</view>
</view>
</view>
</template>
<script>
import base64ToImg from '@/utils/base64Utils';
import { textToImgLove} from '@/api/paint.js';
export default {
data() {
return {
resultImg: [],
finishDraw: false
}
},
onLoad(options) {
//
const paintData = JSON.parse(options.data);
// console.log('paintData',paintData);
// let paintData = {
// appType: 0,
// painterId: 1657690826066698200,
// painterName: "LangZ",
// platform: 1,
// prompt: "",
// scenePrompt: ""
// }
const that = this
textToImgLove(paintData).then(res =>{
if(res.data.code === 200){
uni.hideLoading();
console.log('res',res);
that.resultImg = res.data.data
that.finishDraw = true
console.log(that.resultImg);
}else{
uni.navigateBack({
success() {
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
}
})
}
});
},
methods: {
//base64
clickSave(url){
let str = "data:image/png;base64,"+url;
base64ToImg(str,res =>{
console.log('解析出的图片路径为:',res)
// this.saveUrl = res;
this.download(res)
//complatecss
});
},
//
download(url) {
// url = this.base64ToPath(url)
let that = this;
//console.log('',that.transImg)
uni.showLoading({
title: '正在保存图片...',
success() {
//
uni.getSetting({
success: (res) => {
//
if (!res.authSetting["scope.album"]) {
//
uni.authorize({
scope: "scope.album",
success: () => {
uni.saveImageToPhotosAlbum({
//
filePath: url,
success: (res) => {
},
fail: (res) => {
return uni.showToast({
title: res.errMsg,
icon: 'none'
});
},
complete: (res) => {
uni.hideLoading();
if (res.errMsg !== "saveImageToPhotosAlbum:ok") {
return uni.showToast({
title: "下载失败!",
icon: 'none'
});
} else {
return uni.showToast({
title: "保存成功!",
icon: 'none',
success() {
}
});
}
},
});
},
//
fail: () => {
uni.hideLoading();
uni.showModal({
title: "您已拒绝获取相册权限",
content: "是否进入权限管理,调整授权?",
success: (res) => {
if (res.confirm) {
//
uni.openSetting({
success: (res) => {
},
});
} else if (res.cancel) {
return uni.showToast({
title: "已取消!",
icon: 'none'
});
}
},
});
},
});
} else {
//
uni.saveImageToPhotosAlbum({
filePath: url,
success: (res) => {
console.log('有权限下载图片结果为',res)
console.log('333333')
},
fail: (res) => {
return uni.showToast({
title: res.errMsg,
icon: 'none'
});
},
//
complete: (res) => {
uni.hideLoading();
if (res.errMsg !== "saveImageToPhotosAlbum:ok") {
return uni.showToast({
title: "下载失败!",
icon: 'none'
});
}else{
return uni.showToast({
title: "保存成功!",
duration: 2000,
icon: 'none'
});
}
},
});
}
},
fail: (res) => {},
});
}
});
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 20px 0px;
width: 100%;
min-height: 100vh;
background-color: #faf0f3;
.top-box {
.love-title {
margin-top: 30rpx;
margin-left: 40rpx;
width: 677rpx;
height: 245rpx;
// border: 1px solid black;
background-image: url('https://vediocnd.corpring.com/520love/520_title.png');
background-size: 100% 100%;
// z-index: 10;
margin-bottom: -10px;
}
.top-img-box {
// margin-top: -10px;
width: 100%;
height: 750rpx;
background-image: url('https://vediocnd.corpring.com/520love/love_bg_1.gif');
background-size: 110% 110%;
background-position: center;
padding: 200rpx 30rpx;
box-sizing: border-box;
.loading {
margin-top: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #fc1f8d;
}
.img-item-box {
// margin-top: 100rpx;
display: flex;
justify-content: space-around;
position: relative;
.heart-icon {
position: absolute;
width: 70px;
height: 60px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-image: url('https://vediocnd.corpring.com/520love/heart_icon_1.png');
background-size: 100% 100%;
}
.img-item {
box-sizing: border-box;
border: 3px solid #faf0f3;
width: 300rpx;
height: 300rpx;
// background-color: #fff;
border-radius: 10px;
}
}
}
.button-box {
padding: 0rpx 30rpx;
box-sizing: border-box;
display: flex;
justify-content: space-around;
.save-button {
width: 250rpx;
height: 75rpx;
background-image: url('https://vediocnd.corpring.com/520love/save_button.png');
background-size: 100% 100%;
}
}
}
}
</style>

262
pages/ai/paint/loverPaint.vue

@ -0,0 +1,262 @@
<template>
<view class="wrap">
<view class="desc-box">
<text class="title">内容描述</text>
<textarea class="desc-input" v-model="contentDesc"
placeholder="请输入内容描述~" />
<!-- <view class="bottom-box">
<view class="keyTips" @click="clickRandomKey()"></view>
<view class="limit">{{drawDesc.length}}/50</view>
</view> -->
</view>
<view class="desc-box">
<text class="title">场景描述</text>
<textarea class="desc-input" v-model="sceneDesc"
placeholder="描述一下你们的场景吧~" />
<!-- <view class="bottom-box">
<view class="keyTips" @click="clickRandomKey()"></view>
<view class="limit">{{drawDesc.length}}/50</view>
</view> -->
</view>
<view class="type-box">
<text class="title">风格选择</text>
<view class="type-item-box">
<view class="type-item" v-for="(item, index) in paintStyle" @click="selectType(index)"
:style="{ backgroundImage: `url(${item.imgUrl})` }"
:class="curType == index? 'active' : ''">
<view class="title">
{{item.name}}
</view>
</view>
</view>
</view>
<view class="draw-button" @click="getDraw()">
生成图片
</view>
</view>
</template>
<script>
import {getPaintStyle, getPrompt, textToImg, checkUserCanAiPaint} from '@/api/paint.js';
export default {
data() {
return {
sceneDesc: '',
contentDesc: '',
paintStyle:[],
curType: 0,
userInfo: {},
checkData:{
checkCanPaint: false, //true;false
},
}
},
onLoad() {
this.getPaintStyleList();
// this.getPrompt();
},
onShow() {
this.checkLogin();
this.checkUserCanAiPaint();
},
methods: {
selectType(index) {
this.curType = index
},
//
async getPaintStyleList() {
const res = await getPaintStyle();
if (res.data.code === 200) {
this.paintStyle = res.data.data
//console.log('this.paintStyle',this.paintStyle)
}else {
uni.showModal({
content: '绘画风格加载失败!',
showCancel: false
});
}
},
//AI
async checkUserCanAiPaint(){
let that = this;
const data = {
userId: that.userInfo.id,
platform: 1,
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
});
}
},
//
checkLogin(){
let that = this;
that.userInfo = uni.getStorageSync('userInfo');
console.log('userInfo:',that.userInfo)
let token = uni.getStorageSync('token');
if((Object.keys(that.userInfo).length==0) && (Object.keys(token).length==0)){
console.error('尚未登录!');
uni.showModal({
title:'提示',
content:'您还没有登录!点击确定跳转登录界面以体验服务',
success(res) {
if (res.confirm) {
//
uni.switchTab({
url: '/pages/userInfo/userInfo'
});
}else if(res.cancel){
uni.showToast({
title:'登录获取更好的服务体验哟!',
duration: 2000
});
}
}
});
}
},
getDraw() {
// if(this.userInfo.isVip != 1) {
// uni.showModal({
// title:'VIP使',
// content: 'VIP',
// })
// return
// }
if(!this.contentDesc || !this.sceneDesc) {
uni.showToast({
title: '请输入描述~',
duration: 2000,
icon: 'none'
});
return
}
const that = this;
//
uni.showModal({
title: '温馨提示',
content: '任务创建完成,点击跳转生成内容!',
success(res) {
if(res.confirm){
const data = {
prompt: that.contentDesc,
scenePrompt: that.sceneDesc,
styleName: that.paintStyle[that.curType].styleName,
painterId: that.userInfo.id,
painterName: that.userInfo.username,
appType: 0,
platform: 1,
}
uni.navigateTo({
url: './loverPainResult?data='+JSON.stringify(data)
})
}
}
});
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 20px;
width: 100%;
min-height: 100vh;
background-color: #faf0f3;
.draw-button {
position: fixed;
left: 50%;
bottom: 50rpx;
transform: translateX(-50%);
background: linear-gradient(#fc1f8d, #d2158a);
width: 400rpx;
height: 100rpx;
border-radius: 50rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
font-size: 20px;
}
.desc-box {
margin-bottom: 10px;
.title {
color: #fff;
font-size: 18px;
// margin-bottom: 20px;
color: #fc1f8d;
font-weight: bold;
}
.desc-input {
border: 2px solid #fc1f8d;
margin-top: 5px;
width: 100%;
height: 200rpx;
background-color: #fff;
border-radius: 8px;
padding: 20rpx;
box-sizing: border-box;
// color: #fff;
}
}
.type-box {
.title {
color: #fff;
font-size: 18px;
// margin-bottom: 5px;
color: #fc1f8d;
font-weight: bold;
}
.type-item-box {
margin-top: 5px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.type-item {
width: 160rpx;
height: 160rpx;
background-size: 100% 100%;
border-radius: 5px;
box-sizing: border-box;
position: relative;
.title {
position: absolute;
bottom: 0px;
width: 100%;
background-color: rgba(255, 255, 255, 0.7);
color: #fc1f8d;
text-align: center;
font-size: 14px;
}
}
.active {
border: 4px solid #fc1f8d;
}
}
}
}
</style>

378
pages/ai/paint/paint.vue

@ -2,13 +2,17 @@
<view class="container">
<uni-forms :modelValue="formData" ref="form" validate-trigger='blur'>
<!-- 提示词 -->
<view class="promptText">
<view class="head">
<view class="title">绘画提示词</view>
<view class="left">
<view class="title">绘画关键词</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 class="checkPromptText" v-if="checkData.checkPrompt == false">
<text>请输入提示!</text>
<text>请输入关键!</text>
</view>
</view>
@ -66,6 +70,64 @@
<text>请选择画布大小!</text>
</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>
@ -79,6 +141,7 @@
<script>
import base64ToImg from '@/utils/base64Utils';
import {getPaintStyle, getPrompt, textToImg, checkUserCanAiPaint} from '@/api/paint.js';
import {checkVip} from "@/api/paint";
export default {
data() {
return {
@ -89,6 +152,13 @@
modelName: undefined,
styleName: undefined,
promptText: undefined,
negativePrompt: undefined, //
seed: -1, //
batchSize: 1, //
sfgScale: 7, //
steps: 20, //
eta: 0, //
samplerIndex: "Euler a", //
},
checkData:{
checkPrompt: undefined, //true;false
@ -123,6 +193,28 @@
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() {
@ -140,6 +232,15 @@
this.formData.modelName = undefined;
this.formData.styleName = 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.style_active = 0;
this.prompt_active = 0;
@ -147,7 +248,33 @@
this.checkUserCanAiPaint();
},
methods: {
openAdvancedSetting(e) {
if (e.detail.value) {
checkVip({userId: this.userInfo.id, userClientType: "10"}).then(res => {
if (res.data.code === 200) {
if (res.data.data.isVip === "1") {
this.advancedSetting = e.detail.value;
} else {
this.advancedSetting = !e.detail.value;
uni.showToast({
title: '还不是会员,开通会员后再尝试',
icon: 'none'
})
}
}
})
} else {
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 +353,13 @@
prompt: that.formData.promptText,
modelName: that.formData.modelName,
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,
painterName: that.userInfo.username,
appType: 0,
@ -394,36 +528,6 @@
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 {
display: flex;
@ -436,7 +540,13 @@
flex-direction: row;
align-items: center;
.title {
font-size: 28rpx;
.tip-vip-icon {
margin-left: 20rpx;
}
}
}
.right {
@ -446,57 +556,43 @@
.title {
margin-right: 15rpx;
font-size: 24rpx;
line-height: 48rpx;
color: $uni-primary;
}
.icon {
line-height: 48rpx;
}
}
}
.play {
width: 92%;
margin: 15rpx auto;
.size {
width: 100%;
.lists {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
.item {
background-color: #FFDEE0;
padding: 10rpx 30rpx;
background-color: $uni-white;
padding: 10rpx 20rpx;
border-radius: 10rpx;
height: 30rpx;
color: #F22E38;
border: 1rpx solid #F22E38;
color: $uni-base-color;
border: 1rpx solid $uni-border-4;
margin-bottom: 10rpx;
font-size: 24rpx;
}
margin-right: 20rpx;
}
.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;
.active {
color: $uni-white;
border: 1rpx solid $uni-primary;
background-color: $uni-primary-60; //# FFDEE0
}
}
.right {
display: flex;
flex-direction: row;
align-items: center;
.title {
margin-right: 15rpx;
}
}
}
}
.style {
@ -526,32 +622,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 {
@ -586,90 +656,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{
@ -724,6 +710,46 @@
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 {
width: calc(100% - 40rpx);
position: fixed;

111
pages/ai/paint/paintDetail.vue

@ -1,5 +1,5 @@
<template>
<view class="container" :style="{backgroundColor: 'black',width: 100 + '%',height: 100 + '%'}">
<view class="container" >
<!-- 图片绘制区域 -->
<view class="paint">
<view class="cover" v-if="successFlag === false">
@ -14,12 +14,13 @@
</view>
<!-- 绘制好的图替换默认图展示 -->
<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 class="complete" :style="{backgroundImage: 'url(' + transImg + ')'}"> -->
<view class="complete">
<view class="Multi-sheet-tips" v-if="batchSize > 1">此处仅展示第一张图其余请前往创作工坊查看</view>
<!-- prompt关键词 -->
<view class="keywords">
<view>
@ -54,33 +55,34 @@
</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>
<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)">
<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>
</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>
<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>
</view>
</template>
<script>
@ -100,6 +102,7 @@
paintId: undefined,
paintTime: undefined,
styleName: undefined,
batchSize: undefined,
//imgHeight: 512,
//imgWidth: 512,
}
@ -112,14 +115,27 @@
this.imgWidth = paintData.width;
this.prompt = paintData.prompt;
this.styleName = paintData.styleName;
this.batchSize = paintData.batchSize;
textToImg(paintData).then(res =>{
if(res.data.code === 200){
uni.hideLoading();
console.log('res',res);
this.base64ToPath(res.data.data.images);
this.base64ToPath(res.data.data.images[0]);
this.successFlag = true;
this.paintTime = res.data.data.paintTime;
this.paintId = res.data.data.paintId;
}else{
uni.switchTab({
url: '/pages/ai/paint/paint',
success() {
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
});
}
})
}
});
@ -406,10 +422,6 @@
</script>
<style lang="scss">
page {
background-color: #f4f4f4;
height: 100%;
}
@keyframes xing {
@ -440,14 +452,13 @@
margin-top: 30rpx;
}
.complete {
.action {
width: 100%;
position: fixed;
bottom: 0rpx;
left: 0rpx;
background-color: #fff;
padding: 30rpx 10rpx;
padding: 20rpx 10rpx;
.action-group {
width: 90%;
@ -456,6 +467,20 @@
flex-direction: row;
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{
width: 50%;
display: flex;
@ -469,24 +494,25 @@
align-items: center;
.grid-text {
font-size: 30rpx;
font-size: 28rpx;
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 {
@ -504,22 +530,21 @@
flex-direction: row;
align-items: flex-start;
margin-top: 30rpx;
color:#fff;
font-weight: bolder;
.i {
//background-color: #fff;
color: #1A96DB;
padding: 5rpx 10rpx;
font-size: 28rpx;
color: $uni-primary;
border-radius: 5rpx;
margin-right: 15rpx;
line-height: 38rpx;
}
.text {
font-size: 40rpx;
font-size: 26rpx;
line-height: 38rpx;
font-weight: bolder;
color: #fff;
background-color: #1A94BC1A;
color: $uni-base-color;
}
}
}
@ -527,26 +552,28 @@
.promptTitle{
text-align: center;
font-weight: bolder;
font-size: 40rpx;
color: #1A96DB;
font-size: 28rpx;
color: $uni-primary;
}
.keywords {
width: 90%;
margin: 0 auto;
//background-color: #1A94BC1A;
padding: 15rpx;
//padding: 15rpx;
border-radius: 10rpx;
margin-top: 15rpx;
font-weight: bolder;
.content {
margin-top: 20rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*这里设置几行*/
overflow: hidden;
color: #fff;
color: $uni-base-color;
font-size: 26rpx;
}
}
}
@ -583,12 +610,12 @@
.successCover {
width: 100%;
height: 720rpx;
height: auto;
border-radius: 10rpx;
.img{
width: 100%;
height: 720rpx;
height: auto;
border-radius: 10rpx;
}
}

26
pages/index/indexProto.vue

@ -38,6 +38,9 @@
<view>
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
</view>
<view class="love-icon" @click="goLoveDraw()">
</view>
</view>
</template>
@ -119,6 +122,11 @@
}
},
methods: {
goLoveDraw() {
uni.navigateTo({
url:'/pages/ai/paint/loverPaint'
})
},
changeSwiper(e){
this.current = e.detail.current;
},
@ -249,6 +257,24 @@
</script>
<style lang="scss" scoped>
.love-icon {
width: 140rpx;
height: 140rpx;
background-image: url('https://vediocnd.corpring.com/520love/520_icon.png');
background-size: 100% 100%;
position: fixed;
bottom: 40rpx;
right: 10rpx;
animation-name: breath ;
animation-duration: 2.5s;
animation-iteration-count: infinite;
animation-fill-mode: both;
}
@keyframes breath {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
.swiper-box {
height: 30vh;

67
pages/userInfo/aiPaint/aiPaint.vue

@ -5,6 +5,7 @@
<view>
<uni-load-more :status="loadStatus"></uni-load-more>
</view>
<toTop :toTopFlag="toTopFlag" :toTop="toTop"></toTop>
</view>
</template>
@ -13,9 +14,11 @@
getAiPaintPage
} from '@/api/paint.js'
import waterfallList from '@/components/waterfall-list/waterfall-list.vue'
import toTop from '@/components/toTop/toTop.vue'
export default {
components:{
waterfallList
waterfallList,
toTop
},
data() {
return {
@ -24,12 +27,13 @@
imgWidth: 0, //
imgHeight: 0, //
pageNum: 1,
pageSize: 4,
pageSize: 10,
loadStatus:'noMore', //more - loading - noMore -
isLoadMore:false, //
toTopFlag: false
}
},
onShow() {
created() {
let that = this;
that.userInfo = uni.getStorageSync('userInfo')
if (that.userInfo) {
@ -39,12 +43,12 @@
}
},
//
onPullDownRefresh() {
this.pageNum = 1
this.imgList = []
this.getImgList()
uni.stopPullDownRefresh()
},
// onPullDownRefresh() {
// this.pageNum = 1
// this.imgList = []
// this.getImgList()
// uni.stopPullDownRefresh()
// },
//
onReachBottom() {//
if(!this.isLoadMore) { //
@ -55,10 +59,21 @@
}
}
},
onPageScroll(e){
//
this.toTopFlag = e.scrollTop > 200; //
},
methods: {
toTop() {
uni.pageScrollTo({
scrollTop: 0,
duration: 100,
});
},
// ai
async getImgList() {
let that = this
that.loadStatus = 'loading';
const res = await getAiPaintPage({
painterId: that.userInfo.id,
source: '1',
@ -67,7 +82,17 @@
})
console.log('res',res)
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){ //
that.isLoadMore = true
that.loadStatus = 'noMore'
@ -89,28 +114,10 @@
//
targetDetail(item) {
if (item.id) {
console.log('图片为',item)
uni.setStorage({
key: 'detailId',
data: item.imgId,
success() {
uni.navigateTo({
url: '../../creator/imgDetail'
url: './aiPaintDetail?data='+JSON.stringify(item)
})
}
})
}
/*if (item.id) {
uni.setStorage({
key: 'detailId',
data: item.id,
success() {
uni.navigateTo({
url: '../creator/imgDetail'
})
}
})
}*/
},
},
// onload(e) {
@ -127,8 +134,6 @@
<style lang="scss">
.myCollection {
padding-right: 40rpx;
padding-top: 40rpx;
.uni-searchbar {
border: 1px solid #11A8FD;

414
pages/userInfo/aiPaint/aiPaintDetail.vue

@ -0,0 +1,414 @@
<template>
<!-- -->
<view class="aiPaintDetail_M">
<view class="paint">
<!-- 绘制好的图替换默认图展示 -->
<view class="successCover" v-if="transImg">
<image :src="transImg" mode="widthFix" class="img"/>
</view>
</view>
<view class="complete">
<!-- prompt关键词 -->
<view class="keywords">
<view>
<view class="promptTitle">关键词</view>
</view>
<view class="content">
<text>{{prompt}}</text>
</view>
</view>
<!-- 图画详细参数 -->
<view class="label">
<!-- <view class="style">
<view class="i">关键词</view>
<view class="text">{{ prompt }}</view>
</view> -->
<view class="style">
<view class="i">画布:</view>
<view class="text">{{ imgWidth }}x{{ imgHeight }}</view>
</view>
<view class="style">
<view class="i">创作风格:</view>
<view class="text">{{styleName}}</view>
</view>
<view class="style">
<view class="i">作品编号:</view>
<view class="text">{{paintId}}</view>
</view>
<view class="style">
<view class="i">创作时间:</view>
<view class="text">{{paintTime}}</view>
</view>
</view>
</view>
<!-- 底部操作栏(绘制成功替换告知图片保存在用户画册里) -->
<view class="action" >
<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>
<script>
export default {
name: "aiPaintDetail",
//import使
components: {},
//
mixins: [],
//
props: {},
data() {
//
return {
transImg: undefined,
imgHeight: undefined,
imgWidth: undefined,
prompt: undefined,
successFlag: false,
paintId: undefined,
paintTime: undefined,
styleName: undefined,
batchSize: undefined,
};
},
onLoad(options) {
//
const paintData = JSON.parse(options.data);
this.imgHeight = paintData.height;
this.imgWidth = paintData.width;
this.prompt = paintData['prompt'];
this.styleName = paintData.styleName;
this.batchSize = paintData.batchSize;
this.paintTime = paintData.createTime;
this.transImg = paintData.imgUrl;
this.paintId = paintData.id;
},
// data
computed: {},
//data
watch: {},
//
methods: {
//
onSaveImage(url){
let that = this;
that.download(url)
},
//
download(url) {
let that = this;
//console.log('',that.transImg)
uni.showLoading({
title: '正在保存图片...',
success() {
//
uni.getSetting({
success: (res) => {
//
if (!res.authSetting["scope.album"]) {
//
uni.authorize({
scope: "scope.album",
success: () => {
uni.saveImageToPhotosAlbum({
//
filePath: url,
success: (res) => {
},
fail: (res) => {
return uni.showToast({
title: res.errMsg,
icon: 'none'
});
},
complete: (res) => {
uni.hideLoading();
if (res.errMsg !== "saveImageToPhotosAlbum:ok") {
return uni.showToast({
title: "下载失败!",
icon: 'none'
});
} else {
return uni.showToast({
title: "保存成功!",
icon: 'none',
success() {
}
});
}
},
});
},
//
fail: () => {
uni.hideLoading();
uni.showModal({
title: "您已拒绝获取相册权限",
content: "是否进入权限管理,调整授权?",
success: (res) => {
if (res.confirm) {
//
uni.openSetting({
success: (res) => {
},
});
} else if (res.cancel) {
return uni.showToast({
title: "已取消!",
icon: 'none'
});
}
},
});
},
});
} else {
//
uni.saveImageToPhotosAlbum({
filePath: url,
success: (res) => {
console.log('有权限下载图片结果为',res)
console.log('333333')
},
fail: (res) => {
return uni.showToast({
title: res.errMsg,
icon: 'none'
});
},
//
complete: (res) => {
uni.hideLoading();
if (res.errMsg !== "saveImageToPhotosAlbum:ok") {
return uni.showToast({
title: "下载失败!",
icon: 'none'
});
}else{
return uni.showToast({
title: "保存成功!",
duration: 2000,
icon: 'none'
});
}
},
});
}
},
fail: (res) => {},
});
}
});
},
//
onCopyPrompt(){
let that = this;
//console.log('')
uni.setClipboardData({
data: that.prompt,
success() {
uni.showToast({
title: '复制关键词成功!'
});
}
})
},
},
created() {
}, // - 访this
mounted() {
}, // - 访DOM
beforeCreate() {
}, // -
beforeMount() {
}, // -
beforeUpdate() {
}, // -
updated() {
}, // -
beforeDestroy() {
}, // -
destroyed() {
}, // -
activated() {
} //keep-alive
}
</script>
<style scoped lang="scss">
.aiPaintDetail_M {
.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 {
width: 92%;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: left;
align-items: flex-start;
margin-top: 15rpx;
.style {
display: flex;
flex-direction: row;
align-items: flex-start;
margin-top: 30rpx;
font-weight: bolder;
.i {
font-size: 28rpx;
color: $uni-primary;
border-radius: 5rpx;
margin-right: 15rpx;
line-height: 38rpx;
}
.text {
font-size: 26rpx;
line-height: 38rpx;
font-weight: bolder;
color: $uni-base-color;
}
}
}
.promptTitle{
text-align: center;
font-weight: bolder;
font-size: 28rpx;
color: $uni-primary;
}
.keywords {
width: 90%;
margin: 0 auto;
//background-color: #1A94BC1A;
//padding: 15rpx;
border-radius: 10rpx;
margin-top: 15rpx;
font-weight: bolder;
.content {
margin-top: 20rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*这里设置几行*/
overflow: hidden;
color: $uni-base-color;
font-size: 26rpx;
}
}
}
.paint {
.successCover {
width: 100%;
height: auto;
border-radius: 10 rpx;
.img {
width: 100%;
height: auto;
border-radius: 10 rpx;
}
}
}
.action {
width: 100%;
position: fixed;
bottom: 0rpx;
left: 0rpx;
background-color: #fff;
padding: 20rpx 10rpx;
.action-group {
width: 90%;
margin: 0 auto;
display: flex;
flex-direction: row;
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{
width: 50%;
display: flex;
flex-direction: row;
justify-content: center;
//margin:0rpx 25rpx 0rpx 25rpx;
.grid {
display: flex;
flex-direction: column;
align-items: center;
.grid-text {
font-size: 28rpx;
margin-top: 10rpx;
}
}
}
}
}
}
</style>

44
pages/userInfo/userInfo.vue

@ -7,7 +7,10 @@
<image :src="userInfo.img" mode=""></image>
</view>
<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>
</view>
@ -20,21 +23,24 @@
<uni-icons custom-prefix="iconfont" type="icon-wodeshoucang" size="40" :color="primaryColor" />
</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-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 class="share-box">
<button title="兑换绘画次数" @click="$noMultipleClicks(useCdk)">
<view class="list-menu-item">
</view>
<view class="list-menu">
<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" />
<view class="text">兑换绘画次数</view>
<uni-icons class="list-menu-genduo" custom-prefix="iconfont" type="icon-gengduo"></uni-icons>
</view>
</button>
</view>
<view class="list-menu">
@ -81,6 +87,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
userInfo: {},
noClick:true, //,
primaryColor: "#1a94bc",
noVipColor: "#6a6a6a",
menus: [
{
title: "常见问题",
@ -219,12 +226,11 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
//
linkToUs(){
uni.showToast({
title: '关注次元意境抖音官方账号即可',
icon: 'none'
})
//tt.openAwemeUserProfile(options);
//console.log('options',options)
tt.openAwemeUserProfile({
success: (res) => {
console.log(res);
}
});
},
//
@ -331,8 +337,13 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
.username {
font-size: 26rpx;
line-height: 48rpx;
font-weight: 600;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.25);
.vip-icon {
margin-left: 20rpx;
}
}
}
@ -362,8 +373,8 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
align-items: center;
justify-content: space-between;
//width
//width: calc(50% - 10rpx);
width: 100%;
width: calc(50% - 10rpx);
//width: 100%;
height: 100%;
border-radius: 10rpx;
background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%);
@ -440,6 +451,7 @@ import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons
font-size: 26rpx;
text-align: left;
line-height: 14px;
padding: 0 10px;
}
}

254
pages/userInfo/vip/vip.vue

@ -0,0 +1,254 @@
<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" :class="{'item-active':active == index}" @click="change(index)"
v-for="(item,index) in vipList" :key="index">
<view class="title">
{{item.vipName}}
</view>
<view class="price">
<text class="price-unit">¥</text> {{item.price}}
</view>
<view class="o-price">
{{item.originPrice}}
</view>
<view class="save-box">
立省{{item.originPrice - item.price}}
</view>
</view>
</view>
<button class="sumbit-btn" @click="openVip" :disabled="disabled">
立即开通
</button>
</view>
</template>
<script>
import {
queryUserVipList,
addVipOrder,
unifiedOrder
} from '@/api/userInfo.js'
export default {
data() {
return {
userInfo: null,
vipList: [],
active: 0,
disabled: false
}
},
methods: {
async getVipList() {
const {
data
} = await queryUserVipList();
this.vipList = data.data
},
change(index) {
this.active = index
},
async openVip() {
let data = this.vipList[this.active];
let phone = this.userInfo
if (!Object.keys(data).length) return
this.disabled = true
uni.showLoading({
title: "加载中..."
});
const res_add = await addVipOrder({
vipId: data.id
})
let orderNo = res_add.data.data;
const res_uni = await unifiedOrder({
orderNo,
sceneCode: 1,
payType: 'dypay',
})
let {orderId,orderToken} = res_uni.data.data.dyThirdInOrderVo
this.tikPay(orderId,orderToken)
},
tikPay(order_id, order_token) {
tt.pay({
orderInfo: {
order_id,
order_token
},
service: 5,
success(res) {
if (res.code == 0) {
}
uni.hideLoading();
this.disabled = false
},
fail(res) {
uni.hideLoading();
this.disabled = false
},
})
}
},
onShow() {
this.userInfo = uni.getStorageSync('userInfo')
},
created() {
if (!this.userInfo) {
uni.navigateBack()
uni.showToast({
title: '请先登录',
icon: 'none'
})
}
this.getVipList()
}
}
</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: 30rpx;
}
.price {
font-weight: bold;
font-size: 48rpx;
color: #1991fd;
.price-unit {
font-size: 24rpx
}
}
.o-price {
color: #1991fd;
font-size: 26rpx;
text-decoration: line-through;
}
.save-box {
border-radius: 30rpx;
width: 150rpx;
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;
}
.o-price {
color: #eee;
}
.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-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 {
@ -11,6 +11,26 @@
-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 {
content: "\e62c";
}

BIN
static/icon/iconfont.ttf

Binary file not shown.
Loading…
Cancel
Save