推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.9 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="cardList">
  3. <view class="container" @click="toOrderDetails(item)" v-for="(item, index) in cardListData" :key="index">
  4. <view class="head">
  5. <text class="orderTime">下单时间{{item.createTime}}</text>
  6. <text class="orderStatus" :class="item.state === 'U' ? 'active' : ''">{{item.stateText}}</text>
  7. </view>
  8. <view class="content cardStyle_" :class="['U','S'].includes(item.state) ? 'content_border' : ''">
  9. <view class="left">
  10. <image :src="item.image" alt="">
  11. </view>
  12. <view class="right">
  13. <view class="detailed">
  14. <view class="title">{{item.title}}</view>
  15. <view class="date">{{item.startTime}}</view>
  16. <view class="address">{{item.address}}</view>
  17. </view>
  18. <view class="price"><text>总计</text>¥{{item.price}}</view>
  19. </view>
  20. </view>
  21. <view class="button-sp-area">
  22. <button @click.stop="skip(item,0)" v-if="item.state == 1" :style="{background: '#34312E;', color: '#AFAFAF',margin:'0 30rpx 0 0'}"
  23. class="mini-btn" size="mini">取消活动</button>
  24. <button @click.stop="skip(item,1)" v-if="item.state == 1" :style="{background: '#492623;', color: '#FF3E3F',margin:'0 30rpx 0 0'}"
  25. class="mini-btn" size="mini">活动签到</button>
  26. <button @click.stop="skip(item,2)" v-if="item.state == 2" :style="{background: '#492623;', color: '#FF3E3F',margin:'0 30rpx 0 0'}"
  27. class="mini-btn" size="mini">评价活动</button>
  28. <button @click.stop="skip(item,3)" v-if="item.state == 2" :style="{background: '#49361D;', color: '#FFB245',margin:'0 30rpx 0 0'}"
  29. class="mini-btn" size="mini">开具发票</button>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. props: {
  37. cardListData: {
  38. type: Array,
  39. default: []
  40. },
  41. },
  42. data() {
  43. return {
  44. };
  45. },
  46. components: {
  47. },
  48. computed: {},
  49. watch: {
  50. },
  51. created() {
  52. },
  53. mounted() {},
  54. methods: {
  55. skip(val) {
  56. this.$emit('btnClick', val)
  57. },
  58. toOrderDetails(val) {
  59. this.$emit('toOrderDetails', val)
  60. }
  61. }
  62. };
  63. </script>
  64. <style scoped lang="scss">
  65. .cardList {
  66. padding: 10rpx 32rpx 0;
  67. .container {
  68. margin-top: 31rpx;
  69. padding: 25rpx 0;
  70. border-radius: 20rpx;
  71. background: $uni-color-card-background;
  72. .head {
  73. display: flex;
  74. justify-content: space-between;
  75. padding: 0 35rpx 28rpx;
  76. border-bottom: 1px solid #2A2A2A;
  77. .orderTime {
  78. font-size: 25rpx;
  79. color: $uni-text-color-grey;
  80. }
  81. .orderStatus {
  82. font-size: 26rpx;
  83. color: #ccc;
  84. }
  85. }
  86. .content_border {
  87. border-bottom: 1px solid #2A2A2A;
  88. }
  89. .button-sp-area {
  90. text-align: right;
  91. padding-top: 20rpx;
  92. .mini-btn {
  93. width: 166rpx;
  94. height: 53rpx;
  95. line-height: 53rpx;
  96. font-size: 24rpx;
  97. border-radius: 50rpx;
  98. margin-left: 20rpx;
  99. background-color: #34312E;
  100. color: #AFAFAF;
  101. }
  102. }
  103. }
  104. }
  105. .active {
  106. color: $uni-color-primary !important;
  107. }
  108. </style>