index.vue 4.2 KB

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