record.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="intro-page common">
  3. <view class="top-class"></view>
  4. <view class="title">
  5. 扫码记录
  6. </view>
  7. <view class="head">
  8. <u-row class="row-class" justify="flex-end">
  9. <u-col span="4">
  10. <image class="logo-rules" @click="openDetail" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/qilang/common/rules.png" />
  11. </u-col>
  12. </u-row>
  13. </view>
  14. <!-- 公司简介内容卡片 -->
  15. <view class="content">
  16. <view class="content_text">
  17. <view class="filter-btn-group">
  18. <view class="row-text">发放状态:</view>
  19. <view v-for="(item, idx) in filterOptions" :key="idx"
  20. :class="['filter-btn', filterStatus === item.value ? 'active' : '']"
  21. @click="onFilterChange(item.value)">
  22. {{ item.label }}
  23. </view>
  24. </view>
  25. <view class="filter-btn-group list-title">
  26. <view class="son">
  27. 奖品名称
  28. </view>
  29. <view class="son">
  30. 中奖时间
  31. </view>
  32. <view class="son">
  33. 兑换状态
  34. </view>
  35. <view>
  36. 操作
  37. </view>
  38. </view>
  39. <view class="content-list">
  40. <image v-if="list == null || list.length == 0 " style="height: 240rpx;margin-top: 140rpx"
  41. src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/qilang/noData.png"
  42. mode="heightFix"></image>
  43. <template v-for="(item, index) in list">
  44. <view class="row-one" :key="index">
  45. <view class="filter-btn-group">
  46. <view class="son" v-if="item.prize_type === 2">
  47. 再来一包
  48. </view>
  49. <view class="son" v-else-if="item.prize_type === 4">
  50. {{item.prize_detail}}积分
  51. </view>
  52. <view class="son" v-else>
  53. {{ item.prize_name }}
  54. </view>
  55. <view class="son">
  56. {{ item.zhongjiang_time }}
  57. </view>
  58. <view class="son">
  59. {{ item.duijiang_status }}
  60. </view>
  61. <view class="detail-btn" @click="toggleDetail(index)">
  62. 详情
  63. </view>
  64. </view>
  65. <!-- 只有当 detailVisible 为 true 时才显示 detail 部分 -->
  66. <view class="detail" v-if="item.detailVisible">
  67. <view class="text-one">
  68. 详情:{{item.prize_detail}}
  69. </view>
  70. <view class="text-two">
  71. 发放时间:{{ item.send_time != undefined ? item.send_time : '--' }} <!-- 这里可以填入合适的数据 -->
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. </view>
  77. </view>
  78. <view class="return_view">
  79. <view class="return-button" @click="goBack">返回</view>
  80. </view>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. scanQuery
  87. } from '@/api/scan'
  88. import recordMixin from '@/mixins/recordMixin.js'
  89. export default {
  90. mixins: [recordMixin],
  91. onLoad() {
  92. this.scanCode = uni.getStorageSync('scanCode');
  93. // 调用 mixin 中的通用方法
  94. this.baseInitGetlist(scanQuery);
  95. },
  96. methods: {
  97. onFilterChange(val) {
  98. this.filterStatus = val;
  99. this.baseInitGetlist(scanQuery);
  100. },
  101. initGetlist() {
  102. // 调用 mixin 中的通用方法
  103. this.baseInitGetlist(scanQuery);
  104. },
  105. openDetail() {
  106. uni.navigateTo({
  107. url: '/pages/qilang/index/rules'
  108. });
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. @import url('../../../static/scss/common_qilang.css');
  115. .row-class {
  116. height: 80rpx;
  117. }
  118. .cardTop{
  119. background-image:
  120. url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/smjl.png");
  121. }
  122. .theme-text {
  123. height: 10vh;
  124. text-align: center;
  125. line-height: 11vh;
  126. .textImage {
  127. height: 80rpx;
  128. width: 400rpx;
  129. }
  130. }
  131. .content {
  132. height: 68vh;
  133. padding: 10rpx 24rpx;
  134. overflow: auto;
  135. align-items: center;
  136. justify-content: center;
  137. border-radius: 48px;
  138. background: #FDE2B1;
  139. border: 6px solid #FB911b;
  140. margin: 10vh 40rpx 0rpx;
  141. }
  142. .filter-btn-group {
  143. display: flex;
  144. justify-content: flex-start;
  145. align-items: center;
  146. gap: 24rpx;
  147. margin: 10rpx 0 10rpx 0;
  148. }
  149. .filter-btn {
  150. padding: 4rpx 20rpx;
  151. border: 2rpx solid #F94C28;
  152. color: #F94C28;
  153. font-size: 28rpx;
  154. transition: all 0.2s;
  155. }
  156. .filter-btn.active {
  157. background: #F94C28;
  158. color: #fff;
  159. border: 2rpx solid #F94C28;
  160. }
  161. .row-text {
  162. font-weight: bold;
  163. font-size: 14px;
  164. color: #493D3E ;
  165. }
  166. .list-title {
  167. font-weight: bold;
  168. font-size: 28rpx;
  169. color: #493D3E ;
  170. }
  171. .son {
  172. width: 140rpx;
  173. }
  174. .row-one {
  175. font-weight: 400;
  176. font-size: 28rpx;
  177. color: #4A3D3E ;
  178. }
  179. .detail {
  180. background-image: url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/qilang/detailImg.png");
  181. background-size: cover;
  182. /* 确保背景图片自适应填充整个容器 */
  183. background-position: inherit;
  184. /* 背景图片居中显示 */
  185. background-repeat: no-repeat;
  186. /* 防止背景图重复 */
  187. height: 134rpx;
  188. .text-one {
  189. height: 70rpx;
  190. line-height: 90rpx;
  191. text-align: left;
  192. margin-left: 20rpx;
  193. }
  194. .text-two {
  195. text-align: left;
  196. height: 60rpx;
  197. line-height: 60rpx;
  198. margin-left: 20rpx;
  199. }
  200. }
  201. .detail-btn {
  202. color: #F94C28;
  203. }
  204. .content-list {
  205. overflow: auto;
  206. text-align: center;
  207. height: calc(100% - 160rpx);
  208. }
  209. </style>