index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="orderGoods">
  3. <view class='total'>共{{totalNmu}}件商品</view>
  4. <view class='goodWrapper'>
  5. <view class='item acea-row row-between-wrapper' v-for="(item,index) in cartInfo" :key="index" @click="jumpCon(item.product_id)">
  6. <view class='pictrue'>
  7. <image :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  8. <image :src='item.productInfo.image' v-else></image>
  9. </view>
  10. <view class='text'>
  11. <view class='acea-row row-between-wrapper'>
  12. <view class='name line1'>{{item.productInfo.store_name}}</view>
  13. <view class='num'>x {{item.cart_num}}</view>
  14. </view>
  15. <view class='attr line1' v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  16. <view class='money font-color' v-if="item.productInfo.attrInfo">¥{{item.productInfo.attrInfo.price}}</view>
  17. <view class='money font-color' v-else>¥{{item.productInfo.price}}</view>
  18. <view class='evaluate' v-if='item.is_reply==0 && evaluate==3' @click.stop="evaluateTap(item.unique,orderId)">评价</view>
  19. <view class='evaluate' v-else-if="item.is_reply==1 && evaluate==3">已评价</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. evaluate: {
  29. type: Number,
  30. default: 0,
  31. },
  32. cartInfo: {
  33. type: Array,
  34. default: function() {
  35. return [];
  36. }
  37. },
  38. orderId: {
  39. type: String,
  40. default: '',
  41. },
  42. jump: {
  43. type: Boolean,
  44. default: false,
  45. }
  46. },
  47. data() {
  48. return {
  49. totalNmu:''
  50. };
  51. },
  52. watch:{
  53. cartInfo:function(nVal,oVal){
  54. let num = 0
  55. nVal.forEach((item,index)=>{
  56. num += item.cart_num
  57. })
  58. this.totalNmu = num
  59. }
  60. },
  61. methods: {
  62. evaluateTap:function(unique,orderId){
  63. uni.navigateTo({
  64. url:"/pages/users/goods_comment_con/index?unique="+unique+"&uni="+orderId
  65. })
  66. },
  67. jumpCon:function(id){
  68. if(this.jump){
  69. uni.navigateTo({
  70. url: `/pages/goods_details/index?id=${id}`
  71. })
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. .orderGoods {
  79. background-color: #fff;
  80. margin-top: 12rpx;
  81. }
  82. .orderGoods .total {
  83. width: 100%;
  84. height: 86rpx;
  85. padding: 0 30rpx;
  86. border-bottom: 2rpx solid #f0f0f0;
  87. font-size: 30rpx;
  88. color: #282828;
  89. line-height: 86rpx;
  90. box-sizing: border-box;
  91. }
  92. </style>