index.vue 3.8 KB

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