推广小程序前端代码
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.

131 lines
3.2 KiB

5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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. <img :src="getImage(item)" 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,4)" v-if="item.state == 0" :style="{background: '#492623;', color: '#FF3E3F',margin:'0 30rpx 0 0'}"
  23. class="mini-btn" size="mini">立即支付</button>
  24. <button @click.stop="skip(item,0)" v-if="item.state == 1" :style="{background: '#34312E;', color: '#AFAFAF',margin:'0 30rpx 0 0'}"
  25. class="mini-btn" size="mini">取消活动</button>
  26. <button @click.stop="skip(item,1)" v-if="item.state == 1" :style="{background: '#492623;', color: '#FF3E3F',margin:'0 30rpx 0 0'}"
  27. class="mini-btn" size="mini">活动签到</button>
  28. <button @click.stop="skip(item,2)" v-if="item.state == 2 && item.isPj == 'N'" :style="{background: '#492623;', color: '#FF3E3F',margin:'0 30rpx 0 0'}"
  29. class="mini-btn" size="mini">评价活动</button>
  30. <button @click.stop="skip(item,3)" v-if="item.state == 2" :style="{background: '#49361D;', color: '#FFB245',margin:'0 30rpx 0 0'}"
  31. class="mini-btn" size="mini">开具发票</button>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. cardListData: {
  40. type: Array,
  41. default: []
  42. },
  43. },
  44. data() {
  45. return {
  46. };
  47. },
  48. components: {
  49. },
  50. computed: {},
  51. watch: {
  52. },
  53. created() {
  54. },
  55. mounted() {},
  56. methods: {
  57. skip(val, type) {
  58. this.$emit('btnClick', val, type)
  59. },
  60. toOrderDetails(val) {
  61. this.$emit('toOrderDetails', val)
  62. },
  63. getImage(){
  64. return item.image && item.image.split(',')[0]
  65. },
  66. }
  67. };
  68. </script>
  69. <style scoped lang="scss">
  70. .cardList {
  71. padding: 10rpx 32rpx 0;
  72. .container {
  73. margin-top: 31rpx;
  74. padding: 25rpx 0;
  75. border-radius: 20rpx;
  76. background: $uni-color-card-background;
  77. .head {
  78. display: flex;
  79. justify-content: space-between;
  80. padding: 0 35rpx 28rpx;
  81. border-bottom: 1px solid #2A2A2A;
  82. .orderTime {
  83. font-size: 25rpx;
  84. color: $uni-text-color-grey;
  85. }
  86. .orderStatus {
  87. font-size: 26rpx;
  88. color: #ccc;
  89. }
  90. }
  91. .content_border {
  92. border-bottom: 1px solid #2A2A2A;
  93. }
  94. .button-sp-area {
  95. text-align: right;
  96. padding-top: 20rpx;
  97. .mini-btn {
  98. width: 166rpx;
  99. height: 53rpx;
  100. line-height: 53rpx;
  101. font-size: 24rpx;
  102. border-radius: 50rpx;
  103. margin-left: 20rpx;
  104. background-color: #34312E;
  105. color: #AFAFAF;
  106. }
  107. }
  108. }
  109. }
  110. .active {
  111. color: $uni-color-primary !important;
  112. }
  113. </style>