lowTaking.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view>
  3. <view class="margin-lr-sm margin-top-sm" v-if="dataList.length">
  4. <view class="flex justify-between margin-bottom radius bg padding-sm" @click="goOrder(item)"
  5. v-for="(item,index) in dataList" :key='index'>
  6. <image :src="item.homepageImg?item.homepageImg: '../../../static/logo.png'"
  7. style="width: 200rpx;height: 200rpx;border-radius: 10rpx;"></image>
  8. <view class="flex-sub margin-left text-white flex flex-direction justify-between">
  9. <view class="flex justify-between">
  10. <view class="flex">
  11. <image src="../../../static/images/geren.png"
  12. style="width: 35rpx;height: 35rpx;margin-left: 10rpx;"></image>
  13. <view class="margin-right-xs u-line-1"
  14. style="display: inline-block;margin-left: 10rpx;width: 400rpx;margin-top: -2px;">
  15. {{item.myLevel}}
  16. </view>
  17. </view>
  18. </view>
  19. <view class="flex radius" style="line-height: 34upx;">
  20. <view style="width: 100%;position: relative;line-height: 40rpx;color: #999999;">
  21. <text v-for="(item,index) in item.gameName" class="margin-right-sm">{{item}}</text>
  22. </view>
  23. </view>
  24. <view class="flex" style="align-items: center;font-size: 24rpx;padding: 5rpx;" v-if="item.salesNum">
  25. <view style="color: #999999;background: #F2F2F2; padding: 5rpx 10rpx;">已售{{item.salesNum}}
  26. </view>
  27. </view>
  28. <view style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
  29. <view style="color:#FF1200;font-size: 31rpx;">
  30. ¥{{isVip? item.memberMoney :item.money}}元/<text>{{item.unit}}</text>
  31. </view>
  32. <view style="background: #557EFD;color: #ffffff;padding: 15rpx 25rpx;border-radius: 45rpx;">
  33. 预约服务
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <empty v-if="!dataList.length"></empty>
  40. </view>
  41. </template>
  42. <script>
  43. import empty from '@/components/empty.vue'
  44. export default {
  45. components: {
  46. empty
  47. },
  48. data() {
  49. return {
  50. page: 1,
  51. limit: 10,
  52. dataList: [],
  53. isVip: false,
  54. myId: ''
  55. }
  56. },
  57. onLoad() {
  58. let hyCheck = this.$queue.getData('hyCheck');
  59. if(hyCheck != '否'){
  60. this.isVip = uni.getStorageSync('isVIP') ? uni.getStorageSync('isVIP') : false
  61. }
  62. this.myId = uni.getStorageSync('userId')
  63. this.getDataList()
  64. },
  65. methods: {
  66. getDataList() {
  67. this.$Request.get("/app/orderTaking/queryLowTaking", {
  68. page: this.page,
  69. limit: this.limit,
  70. }).then(res => {
  71. if (res.code == 0) {
  72. if (this.page == 1) {
  73. this.dataList = res.data.list
  74. for (let i = 0; i < this.dataList.length; i++) {
  75. this.dataList[i].gameName = this.dataList[i].gameName.split(",");
  76. }
  77. } else {
  78. this.dataList = [...this.dataList, ...res.data.list]
  79. for (let i = 0; i < this.dataList.length; i++) {
  80. this.dataList[i].gameName = this.dataList[i].gameName.split(",");
  81. }
  82. }
  83. }
  84. uni.stopPullDownRefresh();
  85. });
  86. },
  87. // 跳转订单
  88. goOrder(e) {
  89. let token = uni.getStorageSync('token')
  90. if (token) {
  91. uni.navigateTo({
  92. url: '/pages/index/order/order?id=' + e.id
  93. });
  94. } else {
  95. uni.navigateTo({
  96. url: '/pages/public/login'
  97. });
  98. }
  99. },
  100. },
  101. onReachBottom: function() {
  102. this.page = this.page + 1;
  103. this.getDataList();
  104. },
  105. onPullDownRefresh: function() {
  106. this.page = 1;
  107. this.getDataList();
  108. },
  109. }
  110. </script>
  111. <style>
  112. page {
  113. background-color: #f7f7f7;
  114. }
  115. .bg {
  116. background: #ffffff;
  117. }
  118. </style>