goods.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <!-- 商品信息 -->
  3. <view class="goods-news flex" @click="toGoodDetail">
  4. <image :src="imgSrc" class="goods-img br16" width="200" height="200" mode="aspectFill"></image>
  5. <view class="news-dec flex fdc jcsb">
  6. <view>
  7. <text class="dec-text ellipsis-1">{{goodsName}}</text>
  8. <view class="dec-describe flex jcsb">
  9. <text class="goods-dec ellipsis-2">{{ goodsDec }}</text>
  10. <text v-if="status === 0 && ashStatus !== 1" :class="[ashStatus === 2? 'list-refund':'ash-refund']">{{ashStatus === 2?'退款中':ashStatus === 3?'退款失败':ashStatus===4?'退款成功':''}}</text>
  11. <text v-if="status === 1 && ashStatus !== 1" :class="[ashStatus === 2? 'detail-refund':'ash-derefund']" @click="toAudit">{{ashStatus === 2?'退款中':ashStatus === 3?'退款失败':ashStatus===4?'退款成功':''}}</text>
  12. </view>
  13. </view>
  14. <view class="dec-number flex jcsb aic">
  15. <text class="dec-money">¥{{ numFix(goodsMoney || 0) }}</text>
  16. <view v-if="goodsQuantity" class="dec-num flex fdc fs32 aife">
  17. <text>x{{ goodsQuantity }}</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { numFixtwo } from '@/utils/utils.js'
  25. export default {
  26. props: {
  27. id:[String,Number],
  28. imgSrc: {
  29. type: String,
  30. default: ''
  31. },
  32. goodsName: {
  33. type: String,
  34. default: ''
  35. },
  36. goodsDec:{
  37. type: String,
  38. default: ''
  39. },
  40. goodsMoney: {
  41. type: [String,Number],
  42. default: ''
  43. },
  44. goodsQuantity:{
  45. type:[String,Number],
  46. default: ''
  47. },
  48. status:{
  49. type: [String,Number],
  50. default: -1
  51. },
  52. ashStatus:{
  53. type: [String,Number],
  54. default: 1
  55. },
  56. statusText:{
  57. type:String,
  58. default:''
  59. },
  60. jump:{
  61. type: Boolean,
  62. default:false
  63. },
  64. refundId:{
  65. type: [String,Number],
  66. default: ''
  67. }
  68. },
  69. methods:{
  70. // 保留两位或保留整数
  71. numFix(num){
  72. return numFixtwo(num)
  73. },
  74. // 跳转到商品详情
  75. toGoodDetail(){
  76. if(!this.jump) return
  77. uni.navigateTo({
  78. url:'/pages/shop/detail?id='+this.id
  79. })
  80. },
  81. //跳转到退款详情
  82. toAudit(){
  83. uni.navigateTo({
  84. url: '/pages/afterSales/audit?id='+this.refundId
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .goods-news{
  92. .goods-img{
  93. width: 200rpx;
  94. height: 200rpx;
  95. border-radius: 16rpx;
  96. // margin-right: 20rpx;
  97. background: #f5f5f5;
  98. }
  99. .news-dec {
  100. width: calc(100% - 200rpx);
  101. margin-left: 20rpx;
  102. .dec-text {
  103. font-size: 32rpx;
  104. margin-bottom: 14rpx;
  105. }
  106. .dec-describe{
  107. color: #707476;
  108. font-size: 24rpx;
  109. // align-items: flex-end;
  110. // height: 72rpx;
  111. .goods-dec{
  112. height:100%;
  113. margin-right: 32rpx;
  114. flex-flow: 1;
  115. }
  116. .list-refund{
  117. margin-top: 36rpx;
  118. flex-shrink: 0;
  119. color: $color-orange;
  120. }
  121. .ash-refund{
  122. margin-top: 36rpx;
  123. color:$color-text-g;
  124. flex-shrink: 0;
  125. }
  126. .detail-refund{
  127. height: 40rpx;
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. background: #FFE0D7;
  132. border-radius: 4rpx;
  133. border: 2rpx solid $color-orange;
  134. padding: 4rpx 10rpx;
  135. color: $color-orange;
  136. flex-shrink: 0;
  137. margin-top: 36rpx;
  138. }
  139. .ash-derefund{
  140. height:40rpx;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. background: #fff;
  145. border-radius: 4rpx;
  146. border: 2rpx solid $color-text-g;
  147. padding: 4rpx 10rpx;
  148. color: $color-text-g;
  149. flex-shrink: 0;
  150. margin-top: 36rpx;
  151. }
  152. }
  153. .dec-number {
  154. .dec-money {
  155. font-size: 40rpx;
  156. color: $color-orange;
  157. }
  158. .dec-num {
  159. margin-left: 8rpx;
  160. color: $color-text-g;
  161. }
  162. }
  163. }
  164. }
  165. </style>