index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view :style="{ height: windowHeight + 'px'}">
  3. <view style="display: flex;justify-content: flex-end;">
  4. <view class="view0 step1"></view>
  5. </view>
  6. <view class="view1 step2"></view>
  7. <view class="view2 step3"></view>
  8. <view class="view3 step4"></view>
  9. <view class="view4 step5"></view>
  10. <view class="view5 step6"></view>
  11. <view style="display: flex;justify-content: flex-end;">
  12. <view class="view6 step7"></view>
  13. </view>
  14. <image src="@/static/image/white-bg.png" :style="{ height: windowHeight + 'px',width:'750rpx'}"></image>
  15. <z-paging ref="paging" v-model="dataList" @query="queryList" :style="{ height: windowHeight - 50 + 'px'}"
  16. :show-scrollbar="false">
  17. <template #top>
  18. <page-navbar>
  19. <template #navLeft>
  20. <view style="display:flex;flex-direction: row;justify-content: center; align-items: center;">
  21. <image src="@/static/icon/loacltion.png" style="width: 30rpx; height: 38rpx;"></image>
  22. <text style="margin-left:10rpx;font-size: 28rpx;">
  23. 杭州
  24. </text>
  25. <image src="@/static/icon/down.png" style="width: 30rpx; height: 16rpx;"></image>
  26. </view>
  27. </template>
  28. <template #navCenter>
  29. <view style="width: 520rpx;height: 50rpx;margin-left:126rpx;">
  30. <uv-input placeholder="“潮玩大作战” 派对季重磅开启!" border="none"
  31. :custom-style="{background:'#8BDB67',paddingLeft:'20rpx'}" shape="circle">
  32. <template #prefix>
  33. <image src="@/static/icon/fiery.png" style="width: 14px;height: 18px;"></image>
  34. </template>
  35. <template #suffix>
  36. <view style="width: 77rpx;height: 42rpx;
  37. background-color: #57A335;border-radius: 20rpx;
  38. margin-right: 5rpx;display: flex;align-items: center;justify-content: center;">
  39. <image src="@/static/icon/search.png" style="width: 32rpx;height: 32rpx;">
  40. </image>
  41. </view>
  42. </template>
  43. </uv-input>
  44. </view>
  45. </template>
  46. </page-navbar>
  47. </template>
  48. <z-paging-cell>
  49. <sortble :default-sorts="['uvSwiper','classModel','uvSwiperCard']">
  50. <template #uvSwiper>
  51. <uv-swiper :list="bannerList" :autoplay="true" circular :interval="5000" indicator
  52. indicator-mode="dot" height='380' radius='0'></uv-swiper>
  53. </template>
  54. <template #classModel>
  55. <view class="classModel">
  56. <view class="classModel-bg classModel-bg1" ref="classModel1">
  57. <image class="classModel-img" src="@/static/zhHans-text-icon/text-2.png" mode="">
  58. </image>
  59. </view>
  60. <view class="classModel-bg classModel-bg2" ref="classModel2">
  61. <image class="classModel-img" src="@/static/zhHans-text-icon/text-3.png" mode="">
  62. </image>
  63. </view>
  64. <view class="classModel-bg" ref="classModel3">
  65. <image class="classModel-img" src="@/static/zhHans-text-icon/text-4.png" mode="">
  66. </image>
  67. </view>
  68. </view>
  69. </template>
  70. <template #uvSwiperCard>
  71. <view style="background: #fff;padding: 30rpx 0;">
  72. <image src="/static/zhHans-text-icon/text-1.png" ref="classModel4"
  73. style="width: 432rpx;height: 34rpx;margin-left: 28rpx;margin-bottom: 43rpx"></image>
  74. <swiper-card :width="257" :height="290">
  75. <template v-for="(item,index) in cardList" :slot="`card-${index}`">
  76. <view style="position: relative;align-items: center;"
  77. :style="{width:`${257}rpx`,height:`${290}rpx`}">
  78. <image style="position: absolute;top:15px;" :src="item.img"
  79. :style="{width:`${257}rpx`,height:`${290}rpx`}">
  80. </image>
  81. <image style="position: absolute;" :src="item.bgimg"
  82. :style="{width:`${257}rpx`,height:`${290}rpx`}"></image>
  83. </view>
  84. </template>
  85. </swiper-card>
  86. </view>
  87. </template>
  88. </sortble>
  89. </z-paging-cell>
  90. <z-paging-cell>
  91. <w-waterfall :data="list">
  92. <template v-slot:content="{item,width}">
  93. <card :item="item" :width="width" :custom-style="{background:'#fff'}" textColor="#000"></card>
  94. </template>
  95. </w-waterfall>
  96. </z-paging-cell>
  97. </z-paging>
  98. <tabbar-vue :tabbars="tabbars" :currentIndex="0" ref="tabbar"></tabbar-vue>
  99. <novice-guidance :step="step"></novice-guidance>
  100. </view>
  101. </template>
  102. <script>
  103. import sortble from "@/components/sortble/sortble.vue";
  104. import tabbarVue from "@/components/tabbar/tabbar.vue";
  105. import pageNavbar from "@/components/page-navbar/page-navbar.vue";
  106. import wWaterfall from "@/components/w-waterfall/w-waterfall.vue";
  107. import tabbar from "@/mixins/tabbar";
  108. import card from "@/components/card/card.vue";
  109. // import noviceGuidance from "@/components/novice-guidance/index.vue";
  110. export default {
  111. components: {
  112. sortble,
  113. tabbarVue,
  114. pageNavbar,
  115. wWaterfall,
  116. // noviceGuidance
  117. },
  118. mixins: [tabbar],
  119. data() {
  120. return {
  121. step: {
  122. name: 'workbenchSet5',
  123. guideList: [{
  124. el: '.step1',
  125. tips: '这里是第一步的介绍~',
  126. next: '下一步',
  127. }, {
  128. el: '.step2',
  129. tips: '这里是第二步的介绍~',
  130. next: '下一步',
  131. }, {
  132. el: '.step3',
  133. tips: '这里是第三步的介绍~',
  134. next: '下一步',
  135. }, {
  136. el: '.step4',
  137. tips: '这里是第四步的介绍~',
  138. next: '下一步',
  139. }, {
  140. el: '.step5',
  141. tips: '这里是第五步的介绍~',
  142. next: '下一步',
  143. }, {
  144. el: '.step6',
  145. tips: '这里是第六步的介绍~',
  146. next: '下一步',
  147. }, {
  148. el: '.step7',
  149. tips: '最后一步啦~',
  150. next: '完成',
  151. }]
  152. },
  153. windowHeight: uni.getWindowInfo().windowHeight,
  154. bannerList: [
  155. 'https://e.zhichao.art/AI_images/a_1112_10.png',
  156. 'https://e.zhichao.art/AI_images/a_1112_108.png',
  157. 'https://e.zhichao.art/AI_images/a_1112_113.png',
  158. ],
  159. cardList: [{
  160. img: '/static/img/img-1.png',
  161. bgimg: '/static/image/bg-2.png'
  162. }, {
  163. img: '/static/img/img-3.png',
  164. bgimg: '/static/image/bg-3.png'
  165. }, {
  166. img: '/static/img/img-2.png',
  167. bgimg: '/static/image/bg-1.png'
  168. }, ],
  169. list: [], // 瀑布流全部数据
  170. dataList: [],
  171. }
  172. },
  173. onLoad() {
  174. let that = this;
  175. // this.$nextTick(() => {
  176. // let step = [{
  177. // el: '.step1',
  178. // tips: '这里是第一步的介绍~',
  179. // next: '下一步',
  180. // }, {
  181. // el: '.step2',
  182. // tips: '这里是第二步的介绍~',
  183. // next: '下一步',
  184. // }, {
  185. // el: '.step3',
  186. // tips: '这里是第三步的介绍~',
  187. // next: '下一步',
  188. // }, {
  189. // el: '.step4',
  190. // tips: '这里是第四步的介绍~',
  191. // next: '下一步',
  192. // }, {
  193. // el: '.step5',
  194. // tips: '这里是第五步的介绍~',
  195. // next: '下一步',
  196. // }, {
  197. // el: '.step6',
  198. // tips: '这里是第六步的介绍~',
  199. // next: '下一步',
  200. // }, {
  201. // el: '.step7',
  202. // tips: '最后一步啦~',
  203. // next: '完成',
  204. // }]
  205. // for (var i = 0; i < step.length; i++) {
  206. // that.step.guideList.push(step[i])
  207. // }
  208. // setTimeout(() => {
  209. // // that.$refs.guidance.start(that.step)
  210. // }, 1000)
  211. // })
  212. this.getData().then(res => {
  213. this.list = res.data;
  214. });
  215. },
  216. // 下拉刷新数据
  217. methods: {
  218. queryList() {
  219. this.getData().then(res => {
  220. this.list = res.data;
  221. this.$refs.paging.complete(this.list);
  222. });
  223. },
  224. async init() {
  225. const {
  226. data
  227. } = await this.getData();
  228. this.list.push.apply(this.list, data);
  229. },
  230. // 模拟的后端数据
  231. getData() {
  232. return new Promise((resolve) => {
  233. const imgs = [{
  234. url: 'https://e.zhichao.art/AI_images/a_1112_10.png',
  235. },
  236. {
  237. url: 'https://e.zhichao.art/AI_images/a_1112_108.png',
  238. },
  239. {
  240. url: 'https://e.zhichao.art/AI_images/a_1112_113.png',
  241. },
  242. {
  243. url: 'https://e.zhichao.art/AI_images/a_1112_13.png',
  244. },
  245. {
  246. url: 'https://e.zhichao.art/AI_images/a_1112_137.png',
  247. },
  248. {
  249. url: 'https://e.zhichao.art/AI_images/a_1112_141.png',
  250. },
  251. {
  252. url: 'https://e.zhichao.art/AI_images/a_1114__562.png',
  253. },
  254. {
  255. url: 'https://e.zhichao.art/AI_images/a_1114__568.png',
  256. },
  257. {
  258. url: 'https://e.zhichao.art/AI_images/a_1114__569.png',
  259. },
  260. {
  261. url: 'https://e.zhichao.art/AI_images/a_1114__570.png',
  262. },
  263. {
  264. url: 'https://e.zhichao.art/AI_images/a_1114__571.png',
  265. },
  266. {
  267. url: 'https://e.zhichao.art/AI_images/a_1114__575.png',
  268. },
  269. ];
  270. let list = [];
  271. const doFn = (i) => {
  272. const randomIndex = Math.floor(Math.random() * 10);
  273. return {
  274. allowEdit: i == 0,
  275. image: imgs[randomIndex].url,
  276. w: imgs[randomIndex].width,
  277. h: imgs[randomIndex].height,
  278. title: i % 2 == 0 ? `玛丽` : `凌音`,
  279. desc: i % 2 == 0 ?
  280. `欢迎使用uv-ui,uni-app生态专用的UI框架` : `开发者编写一套代码, 可发布到iOS、Android、H5、以及各种小程序`
  281. }
  282. };
  283. // 模拟异步
  284. setTimeout(() => {
  285. for (let i = 0; i < 20; i++) {
  286. list.push(doFn(i));
  287. }
  288. resolve({
  289. data: list
  290. });
  291. }, 200)
  292. })
  293. }
  294. }
  295. }
  296. </script>
  297. <style lang="scss">
  298. .classModel {
  299. width: 750rpx;
  300. height: 110rpx;
  301. // #ifndef APP-NVUE
  302. display: flex;
  303. // #endif
  304. // #ifdef APP-NVUE
  305. flex-direction: row;
  306. // #endif
  307. justify-content: space-around;
  308. margin-bottom: 20rpx;
  309. .classModel-bg {
  310. width: 210rpx;
  311. height: 90rpx;
  312. background-color: #3F4141;
  313. border-radius: 60rpx;
  314. box-shadow: 3px 3px 2px rgba(174, 230, 93, 1);
  315. .classModel-img {
  316. width: 175rpx;
  317. height: 75rpx;
  318. }
  319. }
  320. }
  321. </style>