index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. <u-toast ref="ulogin" />
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. request
  49. } from '../../common/request/request'
  50. require("promise.prototype.finally").shim()
  51. export default {
  52. data() {
  53. return {
  54. bannersList: [],
  55. noticebarList: [],
  56. loading: true, // 是否显示骨架屏组件
  57. };
  58. },
  59. onLoad() {
  60. uni.$on('login', (data) => {
  61. this.loginStatus=data.msg
  62. })
  63. },
  64. onReady() {
  65. // if (this.loginStatus="登录成功") {
  66. // this.$refs.ulogin.show({
  67. // title:"登录成功",
  68. // })
  69. // }
  70. },
  71. created() {
  72. this.getBanners();
  73. this.getTiceList()
  74. },
  75. methods: {
  76. //轮播图
  77. getBanners() {
  78. uni.showLoading({
  79. title: '加载中...'
  80. });
  81. request({
  82. url: '/homepage/getBanners',
  83. method: 'post',
  84. data: {
  85. "storeId": '1000',
  86. "showPosition": 0, //门店0
  87. }
  88. }).then(res => {
  89. this.list = res.data.data
  90. this.bannersList = this.list.map(t => t.imgPath)
  91. }).catch(err => {
  92. console.log(err)
  93. })
  94. .finally(() => {
  95. setTimeout(() => {
  96. uni.hideLoading();
  97. this.loading = false;
  98. }, 300)
  99. })
  100. },
  101. //消息文字跑马灯
  102. getTiceList() {
  103. uni.showLoading({
  104. title: '加载中...'
  105. });
  106. request({
  107. url: '/homepage/noticeList',
  108. method: 'post',
  109. data: {
  110. "storeId": "1000",
  111. "contentType": "1" //门店1
  112. }
  113. }).then(res => {
  114. this.list = res.data.data
  115. this.noticebarList = this.list.map(t => t.msgContent)
  116. }).catch(err => {
  117. console.log(err)
  118. })
  119. .finally(() => {
  120. setTimeout(() => {
  121. uni.hideLoading();
  122. this.loading = false;
  123. }, 300)
  124. })
  125. },
  126. scancodeIn() {
  127. this.$u.route({
  128. url: 'pages/home/scancode/index',
  129. })
  130. },
  131. scancodeOut() {
  132. this.$u.route({
  133. url: 'pages/home/scancode/index',
  134. })
  135. },
  136. inStock() {
  137. this.$u.route({
  138. url: 'pages/home/my-stock/my-stock',
  139. })
  140. },
  141. inMonthlyPolicy: function(){
  142. this.$u.route({
  143. url: 'pages/home/monthly-policy/monthly-policy',
  144. })
  145. },
  146. inInlineshop() {
  147. this.$u.route({
  148. url: 'pages/home/inline-shop/inline_shop',
  149. })
  150. },
  151. inIntegral() {
  152. this.$u.route({
  153. url: 'pages/home/integral-mall/integral_mall',
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .status_bar {
  161. height: var(--status-bar-height);
  162. width: 100%;
  163. background-color: #FFF;
  164. }
  165. </style>