index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view style="background-color: #FFFFFF;height: 100%;" class="u-skeleton">
  3. <view class="status_bar">
  4. <!-- 这里是状态栏 -->
  5. </view>
  6. <view class="u-page" style="margin-bottom: 20rpx;">
  7. <view class="u-m-t-20">
  8. <u-swiper :list="bannersList" :height="310" :effect3d="true" border-radius="20" effect3d-previous-margin="20"
  9. bg-color="#FFF" class="u-skeleton-fillet"></u-swiper>
  10. </view>
  11. <view class="u-flex u-m-t-20 u-m-l-20 u-m-r-20 u-skeleton-fillet" style="width:710rpx;">
  12. <!-- <view class="u-flex u-row-center" style="width: 150rpx; height: 70rpx;border-radius: 50rpx;background: rgba(52,140,245,0.1);font-size: 20rpx;color: #348CF5; font-size: 500;">
  13. <u-image width="45rpx" height="35rpx" src="../../static/sailun/speaker.png" style="margin:10rpx;"></u-image>公告
  14. <u-notice-bar mode="horizontal" :list="noticebarList" :volume-icon="false" bg-color="#FFF" color="#2B2B2B" padding="18rpx 12rpx" :is-circular="false"></u-notice-bar> -->
  15. <u-notice-bar mode="vertical" :list="noticebarList" style="width: 710rpx;" type="primary"></u-notice-bar>
  16. </view>
  17. <view class="u-flex u-m-t-20 u-row-around u-m-l-10 u-m-r-10">
  18. <u-image width="350rpx" src="../../static/sailun/scan_in.png" @click="scancodeIn" mode="widthFix" class="u-skeleton-fillet"></u-image>
  19. <u-image width="350rpx" src="../../static/sailun/scan_out.png" @click="scancodeOut" mode="widthFix" class="u-skeleton-fillet"></u-image>
  20. </view>
  21. <view class="u-m-t-20">
  22. <view class="u-m-l-30" style="font-size: 34rpx;">
  23. 快捷服务
  24. </view>
  25. <view class="u-flex u-flex-wrap u-row-center">
  26. <u-image class="u-skeleton-fillet" width="350rpx" height="212rpx" src="../../static/sailun/1.png" style="margin: 10rpx;box-shadow:0rpx 0rpx 20rpx rgba(0,0,0,0.2);border-radius: 30rpx;"
  27. @click="inStock"></u-image>
  28. <u-image class="u-skeleton-fillet" width="350rpx" height="212rpx" src="../../static/sailun/2.png" style="margin: 10rpx;box-shadow:0rpx 0rpx 20rpx rgba(0,0,0,0.2);border-radius: 30rpx;"></u-image>
  29. <u-image class="u-skeleton-fillet" width="350rpx" height="212rpx" src="../../static/sailun/3.png" style="margin: 10rpx;box-shadow:0rpx 0rpx 20rpx rgba(0,0,0,0.2);border-radius: 30rpx;"
  30. @click="inInlineshop"></u-image>
  31. <u-image class="u-skeleton-fillet" width="350rpx" height="212rpx" src="../../static/sailun/4.png" style="margin: 10rpx;box-shadow:0rpx 0rpx 20rpx rgba(0,0,0,0.2);border-radius: 30rpx;"
  32. @click="inIntegral"></u-image>
  33. </view>
  34. </view>
  35. <view class="u-flex u-row-center u-m-t-30">
  36. <u-image class="u-skeleton-fillet" width="680rpx" src="../../static/sailun/88reward.png" mode="widthFix"></u-image>
  37. </view>
  38. </view>
  39. <!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
  40. <!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
  41. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. request
  47. } from '../../common/request/request'
  48. require("promise.prototype.finally").shim()
  49. export default {
  50. data() {
  51. return {
  52. bannersList: [],
  53. noticebarList: [],
  54. loading: true, // 是否显示骨架屏组件
  55. };
  56. },
  57. created() {
  58. this.getBanners();
  59. this.getTiceList()
  60. },
  61. methods: {
  62. //轮播图
  63. getBanners() {
  64. uni.showLoading({
  65. title: '加载中...'
  66. });
  67. request({
  68. url: '/homepage/getBanners',
  69. method: 'post',
  70. data: {
  71. "storeId": '1000',
  72. "showPosition": 0, //门店0
  73. }
  74. }).then(res => {
  75. console.log(res)
  76. this.list = res.data.data
  77. this.bannersList = this.list.map(t => t.imgPath)
  78. }).catch(err => {
  79. console.log(err)
  80. })
  81. .finally(() => {
  82. setTimeout(() => {
  83. uni.hideLoading();
  84. this.loading = false;
  85. }, 1000)
  86. })
  87. },
  88. //消息文字跑马灯
  89. getTiceList() {
  90. uni.showLoading({
  91. title: '加载中...'
  92. });
  93. request({
  94. url: '/homepage/noticeList',
  95. method: 'post',
  96. data: {
  97. "storeId": "1000",
  98. "contentType": "1" //门店1
  99. }
  100. }).then(res => {
  101. this.list = res.data.data
  102. this.noticebarList = this.list.map(t => t.msgContent)
  103. }).catch(err => {
  104. console.log(err)
  105. })
  106. .finally(() => {
  107. setTimeout(() => {
  108. uni.hideLoading();
  109. this.loading = false;
  110. }, 1000)
  111. })
  112. },
  113. scancodeIn() {
  114. this.$u.route({
  115. url: 'pages/home/scancode/index',
  116. })
  117. },
  118. scancodeOut() {
  119. this.$u.route({
  120. url: 'pages/home/scancode/index',
  121. })
  122. },
  123. inStock() {
  124. this.$u.route({
  125. url: 'pages/home/my-stock/my-stock',
  126. })
  127. },
  128. inInlineshop() {
  129. this.$u.route({
  130. url: 'pages/home/inline-shop/inline_shop',
  131. })
  132. },
  133. inIntegral() {
  134. this.$u.route({
  135. url: 'pages/home/integral-mall/integral_mall',
  136. })
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .status_bar {
  143. height: var(--status-bar-height);
  144. width: 100%;
  145. background-color: #FFF;
  146. }
  147. </style>