card.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view>
  3. <navigator :url="'/pages/mine/order/detail?id='+item.id" hover-class="none" class="card" v-for="(item,index) in list" :key="index">
  4. <view class="top">
  5. <text>{{item.createTime}}</text>
  6. <text>{{item.goodsStatus}}</text>
  7. </view>
  8. <view class="content">
  9. <view class="">
  10. <image :src="item.goodsImgUrl" mode=""></image>
  11. </view>
  12. <view class="container">
  13. <view class="title">
  14. <text class="text-cut-1">{{item.goodsName}}</text>
  15. </view>
  16. <view class="data">
  17. <text>使用积分:{{item.usePoint}}</text>
  18. <text class="margin-left-30">现金支付:{{useCash(item)}}元</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="bottom">
  23. <u-button v-if="item.goodsStatus == '待收货' || item.goodsStatus == '已完成'" @click="queryLogistic(item)" :custom-style="customStyle1" shape="circle" size="mini">查看物流
  24. </u-button>
  25. <u-button open-type="contact" :custom-style="customStyle2" shape="circle" size="mini">咨询客服</u-button>
  26. <u-button @click="confirmReceipt(item)" v-if="item.goodsStatus == '待收货'" :custom-style="customStyle3" shape="circle" size="mini">确认订单</u-button>
  27. <u-button @click="exchange" v-else :custom-style="customStyle3" shape="circle" size="mini">再次兑换</u-button>
  28. </view>
  29. </navigator>
  30. <toast ref="toast"></toast>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. props: {
  36. list: Array
  37. },
  38. data() {
  39. return {
  40. customStyle1: {
  41. marginRight: '20rpx',
  42. color: '#353535',
  43. borderColor: '#999999'
  44. },
  45. customStyle2: {
  46. marginRight: '20rpx',
  47. color: '#353535',
  48. borderColor: '#999999'
  49. },
  50. customStyle3: {
  51. backgroundColor: "#E72226",
  52. color: '#fff'
  53. }
  54. }
  55. },
  56. computed:{
  57. useCash(){
  58. return data=>{
  59. if (data.cash==-1 || this.$isEmpty(data.cash)) {
  60. return 0
  61. }
  62. return data.cash
  63. }
  64. }
  65. },
  66. methods: {
  67. confirmReceipt(item){
  68. this.$emit("confirmReceipt",item.id)
  69. },
  70. exchange(){
  71. uni.switchTab({
  72. url:"/pages/shop/shop"
  73. })
  74. },
  75. queryLogistic(item) {
  76. uni.navigateTo({
  77. url: "/pages/mine/logistics/logistics?id=" + item.id,
  78. fail(err) {
  79. console.log(err);
  80. }
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. .card {
  88. background-color: #FFFFFF;
  89. margin: 20rpx 0;
  90. padding: 20rpx 30rpx;
  91. .top {
  92. display: flex;
  93. justify-content: space-between;
  94. font-family: PingFang-SC-Medium;
  95. font-size: 24rpx;
  96. color: #999999;
  97. }
  98. .content {
  99. padding: 30rpx 0;
  100. display: flex;
  101. width: 100%;
  102. image {
  103. width: 130rpx;
  104. height: 130rpx;
  105. border-radius: 10rpx;
  106. margin-right: 20rpx;
  107. }
  108. .container {
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: space-around;
  112. .title {
  113. font-weight: 800;
  114. color: #353535;
  115. font-family: PingFang-SC-Bold;
  116. font-size: 30rpx;
  117. }
  118. .data {
  119. color: #000000;
  120. font-weight: 300;
  121. font-size: 26rpx;
  122. }
  123. }
  124. }
  125. .bottom {
  126. padding-top: 20rpx;
  127. border-top: 1rpx solid #EEEEEE;
  128. display: flex;
  129. justify-content: flex-end;
  130. }
  131. }
  132. </style>