shop-activity.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="content">
  3. <view class="item" v-if="!$isEmpty(list)">
  4. <view class="card" @click="goDetail(item.id)" v-for="(item,index) in list" :key="index">
  5. <view class="left">
  6. <image :src="item.pic" mode=""></image>
  7. </view>
  8. <view class="right">
  9. <view class="title text-cut-1">
  10. <text class="">{{item.title}}</text>
  11. </view>
  12. <view class="data">
  13. <view class="">
  14. <view style="display: flex;">
  15. <u-icon name="bag" size="30"></u-icon>
  16. <view class="" style="margin-right: 20rpx;font-size: 26rpx;">
  17. <text class="text-red" style="margin: 0 10rpx;">{{item.supplyPrice/10}}</text>
  18. <text>折优惠</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="flex justify-start"
  24. style="margin-top: 18rpx;width: 100%;color: #999;font-size: 26rpx;">
  25. <view class="center margin-right-10" >
  26. <text class="cuIcon-time"></text>
  27. </view>
  28. <view class=" flex flex-direction justify-end">{{item.beginTime | date('mm/dd hh:MM')}}</view>
  29. <view class="" style="padding: 0 20rpx;">至</view>
  30. <view class=" flex flex-direction justify-end">{{item.endTime | date('mm/dd hh:MM')}}</view>
  31. </view>
  32. <view class="text-cut-2" style="width: 100%;height: 32rpx;margin-top: 14rpx;">
  33. <view v-for="(item1,index1) in item.labelNames.split(',')" :key="index1" class="cu-tag sm "
  34. style="background-color: #fff0d9;color: #ff7001;">
  35. {{item1}}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view style="margin-top: 300rpx;" v-else>
  42. <u-empty icon-size="300" text="暂无活动" src="/static/agent/empty.png"></u-empty>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. props:{
  49. shopId: String
  50. },
  51. data() {
  52. return {
  53. list:[]
  54. }
  55. },
  56. created() {
  57. this.fetchList()
  58. },
  59. methods: {
  60. fetchList(){
  61. let params={
  62. sponsorId:this.shopId,
  63. sponsorType:2,
  64. auditStatus:1
  65. }
  66. this.$api.activity.list(params).then(res=>{
  67. this.list=res.data.records
  68. })
  69. },
  70. goDetail(id){
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .item {
  77. background-color: #FFFFFF;
  78. padding:20rpx 30rpx;
  79. display: flex;
  80. flex-direction: column;
  81. margin-top: 20rpx;
  82. .card {
  83. margin-bottom: 20rpx;
  84. display: flex;
  85. border-bottom: 1rpx solid #ececec;
  86. padding-bottom: 20rpx;
  87. .left {
  88. width: 30%;
  89. image {
  90. width: 100%;
  91. border-radius: 12rpx;
  92. height: 180rpx;
  93. }
  94. }
  95. .right {
  96. margin-left: 20rpx;
  97. display: flex;
  98. width: 70%;
  99. flex-direction: column;
  100. .title {
  101. font-size: 30rpx;
  102. font-weight: 800;
  103. }
  104. .data {
  105. margin-top: 20rpx;
  106. display: flex;
  107. justify-content: space-between;
  108. font-size: 24rpx;
  109. color: #666666;
  110. }
  111. .label {
  112. margin-top: 10rpx;
  113. }
  114. }
  115. }
  116. .card:last-child {
  117. border: none;
  118. margin-bottom: 0;
  119. padding-bottom: 0;
  120. }
  121. }
  122. </style>