index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="orderGoods borRadius14">
  3. <!-- <view class="total"-->
  4. <!-- >共{{ orderProNum ? orderProNum : totalNmu }}件商品</view-->
  5. <!-- >-->
  6. <view class="total" @click="toMerchant(sbMerchant.id)"
  7. >
  8. <image class="merchantImg" :src="sbMerchant.merchantLogo"></image>
  9. <text>{{sbMerchant.merchantName}}</text>
  10. <uni-icons style="margin-left: 10rpx;" type="right" size="16" color="#999999"></uni-icons>
  11. </view>
  12. <view class="goodWrapper pad30">
  13. <view
  14. class="item acea-row row-between-wrapper"
  15. v-for="(item, index) in cartInfo"
  16. :key="index"
  17. @click="jumpCon(item.productId)"
  18. >
  19. <view class="pictrue">
  20. <image :src="item.image"></image>
  21. </view>
  22. <view class="text">
  23. <view class="acea-row row-between-wrapper">
  24. <view class="name line1">
  25. {{ item.productName ? item.productName : item.storeName }}
  26. </view>
  27. <view class="num">
  28. x {{ item.payNum ? item.payNum : item.cartNum }}
  29. </view>
  30. </view>
  31. <view class="attr line1" v-if="item.sku">属性: {{ item.sku }}</view>
  32. <view v-if="mallType === 0" class="money font-color">
  33. ¥{{ Number(item.storePrice).toFixed(2) }}
  34. </view>
  35. <view v-else class="money font-color">
  36. 贝币:{{ Number(item.storePrice).toFixed(2) }}
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script setup>
  44. import { ref, watch } from "vue";
  45. import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
  46. const props = defineProps({
  47. evaluate: {
  48. type: Number,
  49. default: 0,
  50. },
  51. mallType: {
  52. type: Number,
  53. default: 0, // 0: 水贝商城, 1: 贝币商城
  54. },
  55. cartInfo: {
  56. type: Array,
  57. default: () => [],
  58. },
  59. sbMerchant: {
  60. type: Object,
  61. default: () => {},
  62. },
  63. orderId: {
  64. type: String,
  65. default: "",
  66. },
  67. ids: {
  68. type: Number,
  69. default: 0,
  70. },
  71. jump: {
  72. type: Boolean,
  73. default: false,
  74. },
  75. orderProNum: {
  76. type: Number,
  77. default: 0,
  78. },
  79. productType: {
  80. type: Number,
  81. default: 0,
  82. },
  83. });
  84. const totalNmu = ref("");
  85. watch(
  86. () => props.cartInfo,
  87. (nVal) => {
  88. let num = 0;
  89. nVal.forEach((item) => {
  90. num += item.cartNum;
  91. });
  92. totalNmu.value = num;
  93. },
  94. { immediate: true }
  95. );
  96. function evaluateTap(item) {
  97. uni.navigateTo({
  98. url: `/pages/users/goods_comment_con/index?unique=${item.attrId}&orderId=${props.orderId}&id=${props.ids}`,
  99. });
  100. }
  101. function jumpCon(id) {
  102. let type = props.productType == 0 ? "normal" : "video";
  103. if (props.jump) {
  104. uni.navigateTo({
  105. url: `/pages/goods/goods_details/index?id=${id}&type=${type}`,
  106. });
  107. }
  108. }
  109. const toMerchant = (merchantId) => {
  110. uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+merchantId });
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. .orderGoods {
  115. background-color: #fff;
  116. margin-top: 15rpx;
  117. }
  118. .orderGoods .total {
  119. width: 100%;
  120. height: 86rpx;
  121. padding: 0 24rpx;
  122. border-bottom: 2rpx solid #f0f0f0;
  123. font-size: 30rpx;
  124. color: #282828;
  125. line-height: 86rpx;
  126. box-sizing: border-box;
  127. }
  128. .pictrue image {
  129. background: #f4f4f4;
  130. }
  131. .merchantImg{
  132. width: 60rpx;
  133. height: 60rpx;
  134. border-radius: 50%;
  135. }
  136. </style>