card.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="">
  3. <view @click="goDetail(item)" class="data" v-for="(item, index) in list" :key="index">
  4. <view class="top">
  5. <view class="left">
  6. <view class="title">
  7. <text>工单编号:{{item.repairNo}}</text>
  8. <text @click.stop="copy(item.repairNo)" class="padding-left-20">复制</text>
  9. </view>
  10. </view>
  11. <view class="right">
  12. <text class="text-red" v-if="item.handleStatus==-1">已取消</text>
  13. <text class="text-orange" v-if="item.handleStatus==0">待处理</text>
  14. <text class="" v-if="item.handleStatus==1">已完成</text>
  15. <text class="text-orange" v-if="item.handleStatus==2">待评价</text>
  16. </view>
  17. </view>
  18. <view class="item">
  19. <view class="left">
  20. <view style="padding: 0 30rpx;">
  21. <view class="content">
  22. <text class="padding-right-10">所在小区:</text>
  23. <text >{{item.residentialName}}</text>
  24. </view>
  25. <view class="content">
  26. <text class="padding-right-10">维修位置:</text>
  27. <text>{{item.reportPosition}}</text>
  28. </view>
  29. <view class="content">
  30. <text class="padding-right-10">故障描述:</text>
  31. <text style="line-height: 50rpx;">{{item.reportDetail}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="bottom" >
  37. <button @click.stop="" class="cu-btn sm round line-black margin-right-20"
  38. open-type="contact"
  39. session-from="weapp"
  40. :send-message-title="'订单编号为:'+item.repairNo"
  41. >
  42. 联系客服
  43. </button>
  44. <!-- 待处理,显示取消工单 -->
  45. <view v-if="item.handleStatus==0" class="cu-btn sm round bg-red" @click.stop="cancel(item)">
  46. 取消工单
  47. </view>
  48. <!-- 已取消,显示删除订单 -->
  49. <view v-if="item.handleStatus==-1||item.handleStatus==1" class="cu-btn sm round bg-red" @click.stop="deleteItem(item)">
  50. 删除工单
  51. </view>
  52. <!-- 已完成,显示写评价 -->
  53. <view v-if="dataDetail.handleStatus==1&&dataDetail.estimateStatus==0" class="cu-btn sm round bg-red" @click.stop="comment(item)">
  54. 写评价
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. name: 'card',
  63. props:{
  64. list:{
  65. type:Array,
  66. default:()=>{
  67. []
  68. }
  69. }
  70. },
  71. data() {
  72. return {
  73. };
  74. },
  75. onLoad() {
  76. },
  77. methods:{
  78. copy(data){
  79. uni.setClipboardData({
  80. data:data
  81. })
  82. },
  83. goDetail(item){
  84. uni.navigateTo({
  85. url:"../detail?id="+item.id
  86. })
  87. },
  88. cancel(item){
  89. this.$emit('cancel',item)
  90. },
  91. comment(item){
  92. getApp().globalData.dataDetail=item
  93. uni.navigateTo({
  94. url:"../comment"
  95. })
  96. },
  97. deleteItem(item){
  98. this.$emit('deleteItem',item)
  99. },
  100. }
  101. };
  102. </script>
  103. <style lang="scss">
  104. .data {
  105. width: 710rpx;
  106. background-color: #ffffff;
  107. margin: 20rpx auto;
  108. border-radius: 6rpx;
  109. box-sizing: border-box;
  110. padding: 20rpx;
  111. font-size: 28rpx;
  112. .top {
  113. display: flex;
  114. justify-content: space-between;
  115. padding-bottom: 20rpx;
  116. border-bottom: 1rpx solid $dt-border-color-sm;
  117. .left {
  118. display: flex;
  119. align-items: center;
  120. .title {
  121. margin: 0 10rpx;
  122. font-size: 30rpx;
  123. }
  124. }
  125. .right{
  126. margin-right: 10rpx;
  127. }
  128. }
  129. .item {
  130. margin: 5rpx 0 20rpx 0;
  131. .content {
  132. border-bottom: 1rpx dashed #DDDDDD;
  133. padding: 30rpx 0;
  134. }
  135. }
  136. .bottom {
  137. display: flex;
  138. margin-top: 30rpx;
  139. justify-content: flex-end;
  140. align-items: center;
  141. }
  142. }
  143. </style>