index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <view class="content">
  3. <!-- <img class="top_image_bg" :src="mine_bg1" /> -->
  4. <custom-layout ref="layout" :showBottom="true" :back="{show:false,logoShow:true}" v-model="dataList"
  5. @layoutquery="onQueryList" @scroll="onScroll">
  6. <template #navBarLeft>
  7. <text class="ml10 nav_bar_title">专属机壳 秀出好心情</text>
  8. </template>
  9. <template #content>
  10. <!-- 头部样式 -->
  11. <view class="top_card mt10">
  12. <view class="top_card_l">
  13. <view class="top_card_l_t">
  14. <view class="top_card_l_t_l">
  15. <image class="l_t_l_icon" mode="aspectFit" :src="qing"></image>
  16. <text class="l_t_l_text">智能小印</text>
  17. </view>
  18. <view class="top_card_l_t_r"></view>
  19. </view>
  20. <view class="top_card_l_b">
  21. <up-icon custom-prefix="iconfont" name="icon-icon_aifilter" size="30"></up-icon>
  22. <view class="top_card_l_b_c">
  23. AI漫画风
  24. </view>
  25. <view class="l_b_button">
  26. 一键生成
  27. </view>
  28. </view>
  29. </view>
  30. <view class="top_card_r">
  31. <view class="top_card_r_t">
  32. <view class="">
  33. <up-icon custom-prefix="iconfont" name="icon-icon_picture" size="30"></up-icon>
  34. </view>
  35. <view class="top_card_r_i">
  36. <view class="top_card_r_i_text">导入图片</view>
  37. <up-icon custom-prefix="iconfont" name="icon-icon_next" size="50rpx"></up-icon>
  38. </view>
  39. </view>
  40. <view class="top_card_r_b">
  41. <view class="">
  42. <up-icon custom-prefix="iconfont" name="icon-icon_cutout" size="30"></up-icon>
  43. </view>
  44. <view class="top_card_r_i">
  45. <view class="top_card_r_i_text">背景分离</view>
  46. <up-icon custom-prefix="iconfont" name="icon-icon_next" size="50rpx"></up-icon>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <up-sticky offset-top="0" customNav-height="0" :bg-color="scrollTop > 170 ? bgColor:''">
  52. <view class="tabs_list_box">
  53. <view class="tabs_list">
  54. <up-tabs :list="tabs" :line-height="0"
  55. :active-style="{'fontSize':'30rpx','fontWeight':'600'}"></up-tabs>
  56. </view>
  57. <view class="tabs-rigth-fixed" @click="onNavigateTo('/pages/index/fortune')">
  58. <up-icon custom-prefix="iconfont" name="icon-huoyan" size="34rpx"
  59. color="rgba(237, 100, 100, 1)"></up-icon>
  60. <text>运势UP!</text>
  61. <up-icon name="arrow-right" size="24rpx"></up-icon>
  62. </view>
  63. </view>
  64. </up-sticky>
  65. <view class="demo-uni-row">
  66. <view class="demo-uni-col" v-for="(item,index) in dataList" :key="index"
  67. @click="onNavigateTo('/pages/index/canvas_edit')"></view>
  68. </view>
  69. </template>
  70. </custom-layout>
  71. </view>
  72. </template>
  73. <script setup>
  74. import {
  75. onLoad
  76. } from '@dcloudio/uni-app'
  77. import {
  78. ref,
  79. reactive,
  80. computed
  81. } from 'vue'
  82. import useSystemStore from "~@/store/system.js"
  83. import qing from '~@/static/images/qing.png'
  84. import iconNext from '~@/static/images/icon_next.svg'
  85. const {
  86. bgColor
  87. } = useSystemStore()
  88. const tabs = ref([{
  89. state: -1,
  90. name: '热门新款',
  91. },
  92. {
  93. state: 1,
  94. name: '简约'
  95. },
  96. {
  97. state: 2,
  98. name: '卡通'
  99. },
  100. {
  101. state: 3,
  102. name: '复古'
  103. },
  104. {
  105. state: 4,
  106. name: '运动'
  107. },
  108. {
  109. state: 5,
  110. name: '艺术'
  111. },
  112. {
  113. state: 6,
  114. name: '运动'
  115. },
  116. {
  117. state: 7,
  118. name: '艺术'
  119. },
  120. ])
  121. const dataList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, ])
  122. const num = ref(1)
  123. const layout = ref()
  124. const onQueryList = (event) => {
  125. const {
  126. pageNo,
  127. pageSize
  128. } = event
  129. if (pageNo > 1) {
  130. if (num.value < 2) {
  131. num.value++
  132. layout.value.complete(dataList.value);
  133. } else {
  134. layout.value.complete([]);
  135. }
  136. } else {
  137. num.value = 2
  138. layout.value.complete(dataList.value);
  139. }
  140. }
  141. // 页面跳转
  142. const onNavigateTo = (event) => {
  143. uni.navigateTo({
  144. url: event,
  145. })
  146. }
  147. // 检测页面滚动
  148. const scrollTop = ref(0)
  149. const onScroll = (event) => {
  150. scrollTop.value = event
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .nav_bar_title {
  155. font-family: SmileySans-Oblique-2;
  156. color: rgba(128, 128, 128, 1);
  157. font-size: 24rpx;
  158. }
  159. // ===头部卡片样式===
  160. .top_card {
  161. width: 100%;
  162. height: 300rpx;
  163. padding: 0 26rpx;
  164. box-sizing: border-box;
  165. display: flex;
  166. align-items: flex-start;
  167. .top_card_l {
  168. width: 46%;
  169. height: 100%;
  170. z-index: -1;
  171. .top_card_l_t {
  172. height: 100rpx;
  173. display: flex;
  174. align-items: flex-start;
  175. position: relative;
  176. .top_card_l_t_l {
  177. height: calc(100%);
  178. width: calc(76%);
  179. background: linear-gradient(153.36deg, rgba(144, 252, 205, 1) 0%, rgba(176, 242, 255, 1) 100%);
  180. position: relative;
  181. top: 20rpx;
  182. bottom: 60rpx;
  183. border-radius: 20rpx 0 0 0;
  184. display: flex;
  185. &::after {
  186. position: absolute;
  187. content: '';
  188. width: 20rpx;
  189. height: 20rpx;
  190. background-image: radial-gradient(20rpx at 0rpx 0rpx, rgba(176, 242, 255, 1) 20rpx, #fff 20rpx);
  191. bottom: 20rpx;
  192. right: 0;
  193. }
  194. .l_t_l_icon {
  195. position: absolute;
  196. top: -42rpx;
  197. left: -20rpx;
  198. z-index: 20;
  199. width: 160rpx;
  200. height: 160rpx;
  201. }
  202. .l_t_l_text {
  203. font-size: 24rpx;
  204. font-weight: 500;
  205. letter-spacing: 0rpx;
  206. color: rgba(53, 161, 171, 1);
  207. text-align: right;
  208. vertical-align: top;
  209. word-break: keep-all;
  210. position: absolute;
  211. top: 24rpx;
  212. right: 16rpx;
  213. }
  214. }
  215. .top_card_l_t_r {
  216. background-color: #fff;
  217. height: 100%;
  218. width: 24%;
  219. border-radius: 20rpx 0 0 0;
  220. position: absolute;
  221. right: 0;
  222. }
  223. }
  224. .top_card_l_b {
  225. background-color: #fff;
  226. width: 100%;
  227. height: calc(100% - 100rpx);
  228. border-radius: 20rpx 0 0 20rpx;
  229. position: relative;
  230. display: flex;
  231. flex-direction: column;
  232. align-items: center;
  233. justify-content: center;
  234. .top_card_l_b_c {
  235. font-size: 24rpx;
  236. font-weight: bold;
  237. color: rgba(11, 17, 23, 1);
  238. margin: 4rpx 0 16rpx 0;
  239. }
  240. .l_b_button {
  241. width: fit-content;
  242. height: 34rpx;
  243. border-radius: 160rpx;
  244. background: rgba(17, 20, 7, 1);
  245. color: #fff;
  246. font-size: 18rpx;
  247. line-height: 34rpx;
  248. text-align: center;
  249. padding: 0 10rpx;
  250. box-sizing: border-box;
  251. }
  252. }
  253. }
  254. .top_card_r {
  255. width: 57%;
  256. border-left: 1rpx solid rgba(242, 245, 247, 1);
  257. height: 100%;
  258. background-color: #fff;
  259. border-radius: 0 20rpx 20rpx 0;
  260. .top_card_r_t {
  261. border-bottom: 1rpx solid rgba(242, 245, 247, 1);
  262. }
  263. .top_card_r_t,
  264. .top_card_r_b {
  265. width: 100%;
  266. height: 50%;
  267. display: flex;
  268. justify-content: space-between;
  269. padding: 20rpx;
  270. box-sizing: border-box;
  271. .top_card_r_i {
  272. display: flex;
  273. flex-direction: column;
  274. align-items: flex-end;
  275. .top_card_r_i_text {
  276. margin-bottom: 20rpx;
  277. font-size: 28rpx;
  278. font-weight: 600;
  279. }
  280. }
  281. }
  282. }
  283. }
  284. // ======导航标签right标签=======
  285. .tabs_list_box {
  286. display: flex;
  287. align-items: center;
  288. .tabs_list {
  289. width: calc(100% - 160rpx);
  290. }
  291. .tabs-rigth-fixed {
  292. background: rgba(149, 250, 213, 1);
  293. border-radius: 50rpx;
  294. height: 40rpx;
  295. line-height: 40rpx;
  296. display: flex;
  297. align-items: center;
  298. padding: 0 6rpx;
  299. box-sizing: border-box;
  300. font-size: 20rpx;
  301. font-family: SmileySans-Oblique-2;
  302. text {
  303. font-weight: 600;
  304. }
  305. }
  306. }
  307. // ======liet样式=======
  308. .demo-uni-row {
  309. width: 100%;
  310. padding: 0 26rpx;
  311. margin-top: 20rpx;
  312. box-sizing: border-box;
  313. display: flex;
  314. flex-wrap: wrap;
  315. .demo-uni-col {
  316. width: calc((100% / 3) - 8rpx);
  317. height: 400rpx;
  318. background-color: #ccc;
  319. border-radius: 13px;
  320. margin-bottom: 10rpx;
  321. &:nth-child(3n - 1) {
  322. margin-right: 10rpx;
  323. margin-left: 10rpx;
  324. }
  325. }
  326. }
  327. </style>