index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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;"
  29. @click="inMonthlyPolicy"></u-image>
  30. <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;"
  31. @click="inInlineshop"></u-image>
  32. <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;"
  33. @click="inIntegral"></u-image>
  34. </view>
  35. </view>
  36. <view class="u-flex u-row-center u-m-t-30">
  37. <u-image class="u-skeleton-fillet" width="680rpx" src="../../static/sailun/88reward.png" mode="widthFix"></u-image>
  38. </view>
  39. </view>
  40. <!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
  41. <!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
  42. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. request
  48. } from '../../common/request/request'
  49. require("promise.prototype.finally").shim()
  50. export default {
  51. data() {
  52. return {
  53. bannersList: [],
  54. noticebarList: [],
  55. loading: true, // 是否显示骨架屏组件
  56. };
  57. },
  58. created() {
  59. this.getBanners();
  60. this.getTiceList()
  61. },
  62. methods: {
  63. //轮播图
  64. getBanners() {
  65. uni.showLoading({
  66. title: '加载中...'
  67. });
  68. request({
  69. url: '/homepage/getBanners',
  70. method: 'post',
  71. data: {
  72. "storeId": '1000',
  73. "showPosition": 0, //门店0
  74. }
  75. }).then(res => {
  76. console.log(res)
  77. this.list = res.data.data
  78. this.bannersList = this.list.map(t => t.imgPath)
  79. }).catch(err => {
  80. console.log(err)
  81. })
  82. .finally(() => {
  83. setTimeout(() => {
  84. uni.hideLoading();
  85. this.loading = false;
  86. }, 1000)
  87. })
  88. },
  89. //消息文字跑马灯
  90. getTiceList() {
  91. uni.showLoading({
  92. title: '加载中...'
  93. });
  94. request({
  95. url: '/homepage/noticeList',
  96. method: 'post',
  97. data: {
  98. "storeId": "1000",
  99. "contentType": "1" //门店1
  100. }
  101. }).then(res => {
  102. this.list = res.data.data
  103. this.noticebarList = this.list.map(t => t.msgContent)
  104. }).catch(err => {
  105. console.log(err)
  106. })
  107. .finally(() => {
  108. setTimeout(() => {
  109. uni.hideLoading();
  110. this.loading = false;
  111. }, 1000)
  112. })
  113. },
  114. scancodeIn() {
  115. this.$u.route({
  116. url: 'pages/home/scancode/index',
  117. })
  118. },
  119. scancodeOut() {
  120. this.$u.route({
  121. url: 'pages/home/scancode/index',
  122. })
  123. },
  124. inStock() {
  125. this.$u.route({
  126. url: 'pages/home/my-stock/my-stock',
  127. })
  128. },
  129. inMonthlyPolicy: function(){
  130. this.$u.route({
  131. url: 'pages/home/monthly-policy/monthly-policy',
  132. })
  133. },
  134. inInlineshop() {
  135. this.$u.route({
  136. url: 'pages/home/inline-shop/inline_shop',
  137. })
  138. },
  139. inIntegral() {
  140. this.$u.route({
  141. url: 'pages/home/integral-mall/integral_mall',
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .status_bar {
  149. height: var(--status-bar-height);
  150. width: 100%;
  151. background-color: #FFF;
  152. }
  153. </style>