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

109 lines
3.1 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
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" v-for="(item, index) in cardListData" :key="index">
  4. <view class="head">
  5. <text class="orderTime">下单时间{{item.orderTime}}</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.imgUrl" alt="">
  11. </view>
  12. <view class="right">
  13. <view class="detailed">
  14. <view class="title">{{item.title}}</view>
  15. <view class="date">{{item.time}}</view>
  16. <view class="address">{{item.address}}</view>
  17. </view>
  18. <view class="price"><text>总计</text>¥{{item.totalPrice}}</view>
  19. </view>
  20. </view>
  21. <view class="button-sp-area" v-if="Array.isArray(item.btnObj) && item.btnObj.length > 0">
  22. <button @click.stop="skip(val)" :style="{background: val.bgColor, color: val.color}" v-for="(val, i) in item.btnObj" :key="i" class="mini-btn" size="mini">{{val.btnTitle}}</button>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. cardListData : {
  31. type : Array,
  32. default : []
  33. },
  34. },
  35. data() {
  36. return {
  37. };
  38. },
  39. components: {
  40. },
  41. computed: {
  42. },
  43. watch: {
  44. },
  45. created() {
  46. },
  47. mounted() {
  48. },
  49. methods: {
  50. skip(val) {
  51. this.$emit('btnClick', val)
  52. },
  53. toOrderDetails(val) {
  54. this.$emit('toOrderDetails', val)
  55. }
  56. }
  57. };
  58. </script>
  59. <style scoped lang="scss">
  60. .cardList {
  61. padding: 10rpx 32rpx 250rpx;
  62. .container {
  63. margin-top: 31rpx;
  64. padding: 25rpx 0;
  65. border-radius: 20rpx;
  66. background: $uni-color-card-background;
  67. .head {
  68. display: flex;
  69. justify-content: space-between;
  70. padding: 0 35rpx 28rpx;
  71. border-bottom: 1px solid #2A2A2A;
  72. .orderTime {
  73. font-size: 25rpx;
  74. color: $uni-text-color-grey;
  75. }
  76. .orderStatus {
  77. font-size: 26rpx;
  78. color: #ccc;
  79. }
  80. }
  81. .content_border {
  82. border-bottom: 1px solid #2A2A2A;
  83. }
  84. .button-sp-area {
  85. text-align: right;
  86. padding-top: 20rpx;
  87. .mini-btn {
  88. width: 166rpx;
  89. height: 53rpx;
  90. line-height: 53rpx;
  91. font-size: 24rpx;
  92. border-radius: 50rpx;
  93. margin-left: 20rpx;
  94. background-color: #34312E;
  95. color: #AFAFAF;
  96. }
  97. }
  98. }
  99. }
  100. .active {
  101. color: $uni-color-primary!important;
  102. }
  103. </style>