3
0

index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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">
  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="onFortune">
  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"></view>
  67. </view>
  68. </template>
  69. </custom-layout>
  70. </view>
  71. </template>
  72. <script setup>
  73. import {
  74. onLoad
  75. } from '@dcloudio/uni-app'
  76. import {
  77. ref,
  78. reactive,
  79. computed
  80. } from 'vue'
  81. import {
  82. storeToRefs
  83. } from 'pinia'
  84. import {
  85. useSystemStore
  86. } from "@/store/index.js"
  87. const store = useSystemStore()
  88. import qing from '~@/static/images/qing.png'
  89. import iconNext from '~@/static/images/icon_next.svg'
  90. const {
  91. bgColor
  92. } = storeToRefs(store)
  93. const tabs = ref([{
  94. state: -1,
  95. name: '热门新款',
  96. },
  97. {
  98. state: 1,
  99. name: '简约'
  100. },
  101. {
  102. state: 2,
  103. name: '卡通'
  104. },
  105. {
  106. state: 3,
  107. name: '复古'
  108. },
  109. {
  110. state: 4,
  111. name: '运动'
  112. },
  113. {
  114. state: 5,
  115. name: '艺术'
  116. },
  117. {
  118. state: 6,
  119. name: '运动'
  120. },
  121. {
  122. state: 7,
  123. name: '艺术'
  124. },
  125. ])
  126. const dataList = ref([{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, ])
  127. const num = ref(1)
  128. const layout = ref()
  129. const onQueryList = (event) => {
  130. const {
  131. pageNo,
  132. pageSize
  133. } = event
  134. if (pageNo > 1) {
  135. if (num.value < 2) {
  136. num.value++
  137. layout.value.complete(dataList.value);
  138. } else {
  139. layout.value.complete([]);
  140. }
  141. } else {
  142. num.value = 2
  143. layout.value.complete(dataList.value);
  144. }
  145. }
  146. // 页面跳转
  147. const onFortune = () => {
  148. uni.navigateTo({
  149. url: '/pages/index/fortune',
  150. })
  151. }
  152. // 检测页面滚动
  153. const scrollTop = ref(0)
  154. const onScroll = (event) => {
  155. scrollTop.value = event
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. @import url('~@/static/font/SmileySans-Oblique-2.css');
  160. .nav_bar_title {
  161. font-family: SmileySans-Oblique-2;
  162. color: rgba(128, 128, 128, 1);
  163. font-size: 24rpx;
  164. }
  165. // ===头部卡片样式===
  166. .top_card {
  167. width: 100%;
  168. height: 300rpx;
  169. padding: 0 26rpx;
  170. box-sizing: border-box;
  171. display: flex;
  172. align-items: flex-start;
  173. margin-top: 10rpx;
  174. .top_card_l {
  175. width: 46%;
  176. height: 100%;
  177. z-index: -1;
  178. .top_card_l_t {
  179. height: 100rpx;
  180. display: flex;
  181. align-items: flex-start;
  182. position: relative;
  183. .top_card_l_t_l {
  184. height: calc(100%);
  185. width: calc(76%);
  186. background: linear-gradient(153.36deg, rgba(144, 252, 205, 1) 0%, rgba(176, 242, 255, 1) 100%);
  187. position: relative;
  188. top: 20rpx;
  189. bottom: 60rpx;
  190. border-radius: 20rpx 0 0 0;
  191. display: flex;
  192. &::after {
  193. position: absolute;
  194. content: '';
  195. width: 20rpx;
  196. height: 20rpx;
  197. background-image: radial-gradient(20rpx at 0rpx 0rpx, rgba(176, 242, 255, 1) 20rpx, #fff 20rpx);
  198. bottom: 20rpx;
  199. right: 0;
  200. }
  201. .l_t_l_icon {
  202. position: absolute;
  203. top: -42rpx;
  204. left: -20rpx;
  205. z-index: 20;
  206. width: 160rpx;
  207. height: 160rpx;
  208. }
  209. .l_t_l_text {
  210. font-size: 24rpx;
  211. font-weight: 500;
  212. letter-spacing: 0rpx;
  213. color: rgba(53, 161, 171, 1);
  214. text-align: right;
  215. vertical-align: top;
  216. word-break: keep-all;
  217. position: absolute;
  218. top: 24rpx;
  219. right: 16rpx;
  220. }
  221. }
  222. .top_card_l_t_r {
  223. background-color: #fff;
  224. height: 100%;
  225. width: 24%;
  226. border-radius: 20rpx 0 0 0;
  227. position: absolute;
  228. right: 0;
  229. }
  230. }
  231. .top_card_l_b {
  232. background-color: #fff;
  233. width: 100%;
  234. height: calc(100% - 100rpx);
  235. border-radius: 20rpx 0 0 20rpx;
  236. position: relative;
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. justify-content: center;
  241. .top_card_l_b_c {
  242. font-size: 24rpx;
  243. font-weight: bold;
  244. color: rgba(11, 17, 23, 1);
  245. margin: 4rpx 0 16rpx 0;
  246. }
  247. .l_b_button {
  248. width: fit-content;
  249. height: 34rpx;
  250. border-radius: 160rpx;
  251. background: rgba(17, 20, 7, 1);
  252. color: #fff;
  253. font-size: 18rpx;
  254. line-height: 34rpx;
  255. text-align: center;
  256. padding: 0 10rpx;
  257. box-sizing: border-box;
  258. }
  259. }
  260. }
  261. .top_card_r {
  262. width: 57%;
  263. border-left: 1rpx solid rgba(242, 245, 247, 1);
  264. height: 100%;
  265. background-color: #fff;
  266. border-radius: 0 20rpx 20rpx 0;
  267. .top_card_r_t {
  268. border-bottom: 1rpx solid rgba(242, 245, 247, 1);
  269. }
  270. .top_card_r_t,
  271. .top_card_r_b {
  272. width: 100%;
  273. height: 50%;
  274. display: flex;
  275. justify-content: space-between;
  276. padding: 20rpx;
  277. box-sizing: border-box;
  278. .top_card_r_i {
  279. display: flex;
  280. flex-direction: column;
  281. align-items: flex-end;
  282. .top_card_r_i_text {
  283. margin-bottom: 20rpx;
  284. font-size: 28rpx;
  285. font-weight: 600;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. // ======导航标签right标签=======
  292. .tabs_list_box {
  293. display: flex;
  294. align-items: center;
  295. .tabs_list {
  296. width: calc(100% - 160rpx);
  297. }
  298. .tabs-rigth-fixed {
  299. background: rgba(149, 250, 213, 1);
  300. border-radius: 50rpx;
  301. height: 40rpx;
  302. line-height: 40rpx;
  303. display: flex;
  304. align-items: center;
  305. padding: 0 6rpx;
  306. box-sizing: border-box;
  307. font-size: 20rpx;
  308. font-family: SmileySans-Oblique-2;
  309. text {
  310. font-weight: 600;
  311. }
  312. }
  313. }
  314. // ======liet样式=======
  315. .demo-uni-row {
  316. width: 100%;
  317. padding: 0 26rpx;
  318. margin-top: 20rpx;
  319. box-sizing: border-box;
  320. display: flex;
  321. flex-wrap: wrap;
  322. .demo-uni-col {
  323. width: calc((100% / 3) - 8rpx);
  324. height: 400rpx;
  325. background-color: #ccc;
  326. border-radius: 13px;
  327. margin-bottom: 10rpx;
  328. &:nth-child(3n - 1) {
  329. margin-right: 10rpx;
  330. margin-left: 10rpx;
  331. }
  332. }
  333. }
  334. </style>