index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="home" >
  3. <!-- 头部 -->
  4. <navbar :back="false" title="首页" :bgcolor="backgroundColor" color="#fff" fixed zIndex="1010" :center="true" :custom='true' @getTop="getTop"/>
  5. <image :src="bgimg" class="homebg"></image>
  6. <view class="hometop">
  7. <swiper class="swiper" circular :indicator-active-color="activecolor" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  8. :duration="duration">
  9. <swiper-item>
  10. <image :src="swpimga" class="swiperimg"></image>
  11. </swiper-item>
  12. <swiper-item>
  13. <image :src="swpimga" class="swiperimg"></image>
  14. </swiper-item>
  15. <swiper-item>
  16. <image :src="swpimga" class="swiperimg"></image>
  17. </swiper-item>
  18. </swiper>
  19. </view>
  20. <view class="flexcj mainus">
  21. <view class="mainuse flex" @click="getUse">
  22. <view class="mainusea">
  23. <view class="mainuseb">使用指南</view>
  24. <view class="mainusec overtwo">查看使用指南了 解核销操作方法</view>
  25. </view>
  26. <image :src="znimg" class="mainused flex0"></image>
  27. </view>
  28. <view class="mainuse flex" @click="getRecord">
  29. <view class="mainusea">
  30. <view class="mainuseb">核销记录</view>
  31. <view class="mainusec overtwo">查看核销记录了 解核销记录信息</view>
  32. </view>
  33. <image :src="znhimg" class="mainused flex0" style="height: 82rpx;"></image>
  34. </view>
  35. </view>
  36. <view class="hgbox">
  37. <view class="flex1">
  38. <view class="hgboxtit">核销操作</view>
  39. <view class="hgboxtxt">扫描用户出示的二维码即可实现核销</view>
  40. </view>
  41. <image :src="rimg" class="flex0"></image>
  42. </view>
  43. <!-- 底部 导航栏 currentPage 当前页面ID -->
  44. <tab-bar :currentPage="0"></tab-bar>
  45. </view>
  46. </template>
  47. <script>
  48. import url from "@/util/url";
  49. let {host} = url
  50. //导入组件
  51. import tabBar from '@/components/tabbar/tabbar.vue'
  52. export default {
  53. data() {
  54. return {
  55. padtop:this.$http._GET.customBarH||0,
  56. backgroundColor: 'transparent',
  57. bgimg:require('@/static/image/bg.png'),
  58. swpimga:require("@/static/image/swipera.png"),
  59. indicatorDots: true,
  60. autoplay: false,
  61. activecolor:'#ffffff',
  62. interval: 2000,
  63. duration: 500,
  64. rimg:require("@/static/image/wrimg.png"),
  65. znimg: require('static/image/use.png'),
  66. znhimg: require('static/image/hicon.png'),
  67. };
  68. },
  69. components:{
  70. tabBar
  71. },
  72. methods: {
  73. getTop(e){
  74. this.padtop=e;
  75. },
  76. checkLogin() {
  77. var token = uni.getStorageSync('token')
  78. // var token = "df057579-73c8-4bdd-8312-f64db8efd699"
  79. if (token == undefined || token == '') {
  80. uni.reLaunch({
  81. url: '/pages/login/login'
  82. })
  83. return false
  84. }
  85. return true
  86. },
  87. getRecord(){
  88. // 判断是否能核销
  89. this.$http.routePage('/pages/index/record','nav')
  90. // if (!this.checkLogin()) {
  91. // return
  92. // }
  93. // var businessId=uni.getStorageSync('businessId')
  94. // if(businessId&&businessId=='-1'){
  95. // uni.showToast({
  96. // title:'暂无核销记录',
  97. // icon:"none"
  98. // })
  99. // }else{
  100. // this.$http.routePage('/pages/index/record','nav')
  101. // }
  102. },
  103. },
  104. onPageScroll(res) {
  105. var scrolltop=res.scrollTop;
  106. if(scrolltop>0){
  107. this.backgroundColor='linear-gradient(60deg, #6A6BF1, #CB4BFA)'
  108. }else{
  109. this.backgroundColor='transparent'
  110. }
  111. },
  112. };
  113. </script>
  114. <style scoped lang="scss">
  115. .home{min-height: 100vh;background: #FFFFFF;overflow: auto;
  116. .homebg{width: 100%;height: 376rpx;}
  117. .hometop{margin-top:-208rpx;}
  118. .swiper{height: 260rpx;margin: 0 34rpx 28rpx;
  119. .swiperimg{width: 100%;height: 100%;}
  120. }
  121. .hgbox{margin:0rpx 32rpx 16rpx;background:linear-gradient(60deg, #a254da,#606efe);;border-radius: 14rpx;padding: 28rpx 32rpx 24rpx 36rpx;display: flex;align-items: center;justify-content: space-between;min-height: 128rpx;box-sizing: border-box;
  122. .hgboxtit{font-size: 34rpx;font-weight: bold;color: #FFFFFF;margin-bottom: 8rpx;}
  123. .hgboxtxt{font-size: 24rpx;color: #CBB8E8;}
  124. image{width: 16rpx;height: 28rpx;margin-left: 12rpx;}
  125. }
  126. }
  127. .flexcj{display: flex;align-items: center;justify-content: space-between;}
  128. .overtwo{word-break: break-all;text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;white-space: normal;}
  129. .mainus{
  130. margin:0rpx 32rpx 28rpx;
  131. }
  132. .mainuse{min-height: 170rpx;background: #F8F8F8;border-radius: 6rpx;padding: 30rpx 18rpx 30rpx 26rpx;box-sizing: border-box;width: 328rpx;}
  133. .mainuseb{font-size: 22rpx;font-weight: bold;position: relative;margin-bottom: 20rpx;color: #A04CFF;}
  134. .mainuseb::after{width: 22rpx;height: 2rpx;background: #E1E1E1;content: "";position: absolute;left: 0;bottom: -15rpx;}
  135. .mainusec{font-size: 24rpx;color: #3F3F3F;}
  136. .mainused{width: 84rpx;height: 76rpx;margin-top: 16rpx;margin-left: 28rpx;}
  137. </style>