index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="content">
  3. <view class="backg3 flex" style="padding-top: 23rpx" v-if="isWoman" @click="clickMan">
  4. <view style="margin-left: 40rpx">
  5. <view style="color: #000000; font-size: 32rpx; font-weight: 500">女生专区</view>
  6. <image style="width: 48rpx; height: 9rpx; margin-left: 20rpx" src="https://mxys.chuanghai-tech.com/wmfile/20250811/5f75606616aa4c7f8c304368f8663a39.png"></image>
  7. </view>
  8. <view style="margin-left: 73rpx">男生专区</view>
  9. </view>
  10. <view class="backg3 flex" style="padding-top: 23rpx" v-else @click="clickMan">
  11. <view style="margin-left: 40rpx">女生专区</view>
  12. <view style="margin-left: 73rpx">
  13. <view style="color: #000000; font-size: 32rpx; font-weight: 500">男生专区</view>
  14. <image style="width: 48rpx; height: 9rpx; margin-left: 20rpx" src="https://mxys.chuanghai-tech.com/wmfile/20250811/5f75606616aa4c7f8c304368f8663a39.png"></image>
  15. </view>
  16. </view>
  17. <view @click="toXiang(item.id)" v-for="(item, index) in dataList" :key="item.id" :class="index == 0 ? 'backg1' : 'backg2'">
  18. <image :src="item.imgs" style="width: 289rpx; height: 319rpx; margin: 31rpx 0 0 20rpx; background-color: #000" mode="aspectFill"></image>
  19. <view style="margin: 31rpx 0 0 26rpx; width: 400rpx">
  20. <view style="font-size: 32rpx; color: #000000; font-weight: 500; margin-top: 7rpx">{{ item.name }}</view>
  21. <view style="margin-top: 7rpx">{{ item.subName }}</view>
  22. <view style="display: flex; flex-wrap: wrap">
  23. <view class="lijia" v-for="(ele, ind) in item.serviceTag.split(',')" :key="ind">{{ ele }}</view>
  24. </view>
  25. <view class="q_time">
  26. <view style="line-height: 30px">时间</view>
  27. <view class="q_line"></view>
  28. <view style="width: 300rpx; margin-left: 13rpx">{{ item.startTime }}—{{ item.endTime }}</view>
  29. </view>
  30. <view class="jiage">¥{{ item.price }}</view>
  31. </view>
  32. </view>
  33. <empty v-if="!dataList.length"></empty>
  34. </view>
  35. </template>
  36. <script>
  37. import empty from '@/components/empty.vue'
  38. export default {
  39. components: {
  40. empty
  41. },
  42. data() {
  43. return {
  44. isWoman: true, //true是。false不是
  45. currentPage: 1,
  46. totalCount: 0,
  47. dataList: []
  48. }
  49. },
  50. onLoad() {
  51. this.getData()
  52. },
  53. methods: {
  54. getData() {
  55. let data = {
  56. page: this.currentPage,
  57. limit: 6,
  58. suitSex: this.isWoman ? 2 : 1
  59. }
  60. this.$Request.getT('/app/lover-set/page', data).then((res) => {
  61. console.log(res, 966)
  62. this.dataList = [...this.dataList, ...res.data.list]
  63. this.totalCount = res.data.totalCount
  64. })
  65. },
  66. //切换男女专区
  67. clickMan() {
  68. this.isWoman = !this.isWoman
  69. this.currentPage = 1
  70. this.dataList = []
  71. this.getData()
  72. },
  73. //跳转到详情页
  74. toXiang(id) {
  75. uni.navigateTo({
  76. url: `/my/qinglv/xiang?id=${id}`
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style>
  83. .content {
  84. width: 100%;
  85. height: 100%;
  86. background-color: #f2f2f2;
  87. }
  88. .backg3 {
  89. display: flex;
  90. width: 750rpx;
  91. height: 100%;
  92. background-color: #ffe9ca;
  93. }
  94. .backg1 {
  95. display: flex;
  96. width: 750rpx;
  97. height: 100%;
  98. margin-bottom: 20rpx;
  99. /* background-color: #FFE9CA; */
  100. background: linear-gradient(180deg, #ffe9ca 0%, #ffffff 28.17%, #ffffff 32.53%, #f2f3f5 100%);
  101. }
  102. .backg2 {
  103. display: flex;
  104. margin-top: 20rpx;
  105. width: 750rpx;
  106. height: 100%;
  107. background-color: #ffffff;
  108. }
  109. .lijia {
  110. margin-top: 7rpx;
  111. margin-right: 8rpx;
  112. width: 125rpx;
  113. height: 51rpx;
  114. opacity: 1;
  115. border-radius: 73rpx;
  116. border: 1rpx solid #ff8d1a;
  117. font-size: 24rpx;
  118. line-height: 51rpx;
  119. color: rgba(255, 141, 26, 1);
  120. text-align: center;
  121. }
  122. .q_time {
  123. display: flex;
  124. margin-top: 15rpx;
  125. }
  126. .q_line {
  127. margin: 12rpx 0 0 13rpx;
  128. width: 1rpx;
  129. height: 47rpx;
  130. background-color: #808080;
  131. }
  132. .jiage {
  133. margin-top: 27rpx;
  134. font-size: 40rpx;
  135. font-weight: 500;
  136. color: rgba(255, 91, 26, 1);
  137. }
  138. </style>