card.vue 3.3 KB

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