activity.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="box">
  3. <view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.id)">
  4. <image :src="item.img" mode="" class="itemImg"></image>
  5. <view class="timeBox">
  6. <image src="../../static/img/bg_huangse.png" mode="" class="state"></image>
  7. <view class="time">{{item.CreateTime}}</view>
  8. </view>
  9. <view class="name">{{item.PlateNumber}}</view>
  10. </view>
  11. <!-- 上拉 加载更多 -->
  12. <view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
  13. <!-- 无数据空白页 -->
  14. <nodata v-if="itemData.length==0"></nodata>
  15. <!-- 手机号授权 -->
  16. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  17. <view class="authorizCont" @click.stop="">
  18. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  19. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  20. <button class="authorizContbutton" type="default" open-type="getPhoneNumber"
  21. @getphonenumber="decryptPhoneNumber">授权</button>
  22. </view>
  23. <view style="text-align: center;padding-top: 56rpx;">
  24. <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script scoped>
  30. import nodata from '../../components/nodata/nodata.vue'
  31. export default {
  32. components: {
  33. nodata,
  34. },
  35. data() {
  36. return {
  37. userInfo: '',
  38. authorizShow: false,
  39. code: '',
  40. wxOpenData: '',
  41. page: 1,
  42. itemData: [1,2,3,4],
  43. noMoreShow: false,
  44. }
  45. },
  46. onLoad() {
  47. this.userInfo = this.$store.state.userInfo;
  48. this.wxOpenData = this.$store.state.wxOpenData
  49. this.page = 1
  50. // this.myOrderCoupon()
  51. },
  52. methods: {
  53. goDetail(id) {
  54. uni.navigateTo({
  55. url: 'reportDetail?id=' + id
  56. })
  57. },
  58. myOrderCoupon() {
  59. uni.showLoading({
  60. title: '加载中'
  61. })
  62. this.$http('opencheckSheet/getTestList', {
  63. // page: this.page,
  64. // limit: 10,
  65. }, 'GET').then(res => {
  66. uni.hideLoading();
  67. // var list = res.data.Items
  68. var list = res.data
  69. // 处理 undefined和null转为空白字符串
  70. // list.forEach((item, index) => {
  71. // for (const key in item) {
  72. // item[key] = this.$praseStrEmpty(item[key])
  73. // }
  74. // })
  75. if (this.page == 1) {
  76. this.itemData = list
  77. } else {
  78. this.itemData = this.itemData.concat(list)
  79. }
  80. if (list.length < 10) {
  81. this.noMoreShow = true
  82. } else {
  83. this.noMoreShow = false
  84. }
  85. })
  86. },
  87. },
  88. // 下拉刷新 上拉加载更多
  89. onPullDownRefresh() {
  90. this.page = 1
  91. this.myOrderCoupon()
  92. setTimeout(function() {
  93. uni.stopPullDownRefresh();
  94. }, 1000);
  95. },
  96. onReachBottom() {
  97. // this.page++;
  98. this.myOrderCoupon()
  99. },
  100. }
  101. </script>
  102. <style scoped lang="less">
  103. .box {
  104. background: #F4F5F7;
  105. min-height: 100vh;
  106. padding-top: 20rpx;
  107. }
  108. .authorizBox {
  109. width: 100vw;
  110. height: 100vh;
  111. background: rgba(0, 0, 0, 0.5);
  112. position: fixed;
  113. top: 0;
  114. left: 0;
  115. }
  116. .authorizCont {
  117. margin-top: 30vh;
  118. width: 564rpx;
  119. height: 408rpx;
  120. background: #FFFFFF;
  121. border-radius: 24rpx;
  122. margin-left: 93rpx;
  123. position: relative;
  124. }
  125. .authorizCloseImg {
  126. width: 62rpx;
  127. height: 62rpx;
  128. }
  129. .sqLogoBox {
  130. width: 180rpx;
  131. height: 180rpx;
  132. background: #FFFFFF;
  133. border-radius: 90rpx;
  134. text-align: center;
  135. position: absolute;
  136. top: -50rpx;
  137. left: 192rpx;
  138. }
  139. .authorizName {
  140. color: #333333;
  141. line-height: 42rpx;
  142. font-size: 30rpx;
  143. text-align: center;
  144. padding-top: 58rpx;
  145. }
  146. .authorizMs {
  147. color: #999999;
  148. line-height: 36rpx;
  149. font-size: 26rpx;
  150. width: 452rpx;
  151. padding-top: 24rpx;
  152. text-align: center;
  153. margin-left: 56rpx;
  154. }
  155. .authorizContbutton {
  156. width: 422rpx;
  157. height: 88rpx;
  158. background: #D53533;
  159. border-radius: 44rpx;
  160. line-height: 88rpx;
  161. text-align: center;
  162. font-size: 30rpx;
  163. color: #FFFFFF;
  164. margin-top: 62rpx;
  165. margin-left: 71rpx;
  166. }
  167. .itemHistory {
  168. margin: 0rpx 24rpx 20rpx;
  169. background-color: #FFFFFF;
  170. border-radius: 10rpx;
  171. }
  172. .itemImg {
  173. height: 280rpx;
  174. }
  175. .timeBox {
  176. display: flex;
  177. margin-top: -53rpx;
  178. align-items: flex-end;
  179. }
  180. .state{
  181. width: 102rpx;
  182. height: 53rpx;
  183. }
  184. .time {
  185. padding: 5rpx 10rpx;
  186. color: #FFFFFF;
  187. font-size: 24rpx;
  188. background: #000000;
  189. border-radius: 0 10rpx 0 0;
  190. }
  191. .name {
  192. padding: 24rpx 20rpx;
  193. color: #333333;
  194. font-size: 28rpx;
  195. background: #FFFFFF;
  196. border-radius: 0 0 10rpx 10rpx;
  197. }
  198. .noMore {
  199. text-align: center;
  200. line-height: 50rpx;
  201. color: #999999;
  202. font-size: 28rpx;
  203. }
  204. </style>