index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="orderGoods borRadius14">
  3. <navigator v-if="orderInfo.merName" :url="`/pages/merchant/home/index?merId=`+ orderInfo.merId" hover-class="none">
  4. <view class='total'>
  5. <text class="mr10 iconfont icon-shangjiadingdan"></text>
  6. <text class="mr10">{{orderInfo.merName}}</text>
  7. <text class="iconfont icon-xiangyou" style="font-size: 20rpx;"></text>
  8. </view>
  9. </navigator>
  10. <view v-show="orderData.secondType ===1" class='total'>
  11. <text class="mr10 iconfont icon-zhuanti"></text>
  12. <text class="mr10">积分商品兑换</text>
  13. </view>
  14. <view class='goodWrapper pad24'>
  15. <view class="item" v-for="(item,index) in cartInfo" :key="index">
  16. <view class='acea-row row-between-wrapper' @click="jumpCon(item)">
  17. <view class='pictrue'>
  18. <image :src='item.image'></image>
  19. </view>
  20. <view class='text'>
  21. <view class='acea-row row-between-wrapper'>
  22. <view class='name line1'>{{item.productName}}</view>
  23. <view class='num line-heightOne' v-if="item.payNum">x {{item.payNum}}</view>
  24. </view>
  25. <view class='attr' v-if="item.sku">{{item.sku}}</view>
  26. <!-- 积分价格 -->
  27. <PointsPrice v-if="secondType === ProductTypeEnum.Integral" :pointsPrice="item"
  28. :pointsGoodsStyle="hotPointsStyle" class="mt-20"></PointsPrice>
  29. <!-- 其他价格 -->
  30. <view v-else class='acea-row justify-between' style="align-items: baseline;">
  31. <view class="acea-row">
  32. <view class='money line-heightOne'>¥{{item.price || item.productPrice}}</view>
  33. </view>
  34. <view
  35. v-if="(item.deliveryMethod == 1 || !orderInfo.takeTheirSwitch) && !jump && Number(item.productType)==0"
  36. class="font-color">不支持自提</view>
  37. <view v-if="item.deliveryMethod == 2 && !jump && Number(item.productType)==0"
  38. class="font-color">不支持配送</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  43. <view v-if="isShowBtn" class="acea-row evaluateBox">
  44. <view v-show="getApplyRefundNum(item)>0" class="text">申请售后(
  45. 数量:{{(getApplyRefundNum(item))}} )</view>
  46. <view class='evaluate'
  47. v-if="isRefund(item) && getApplyRefundNum(item)< item.payNum"
  48. @click.stop="goRefund(item)"><text class="line-heightOne">申请退款</text>
  49. </view>
  50. <!-- 虚拟商品退款需要判断是否开启退款按钮 -->
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. // +----------------------------------------------------------------------
  58. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  59. // +----------------------------------------------------------------------
  60. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  61. // +----------------------------------------------------------------------
  62. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  63. // +----------------------------------------------------------------------
  64. // | Author: CRMEB Team <admin@crmeb.com>
  65. // +----------------------------------------------------------------------
  66. import * as filters from '@/filters'
  67. import {
  68. goProductDetail
  69. } from "../../../../libs/order";
  70. import {
  71. ProductTypeEnum,
  72. ProductMarketingTypeEnum
  73. } from "@/enums/productEnums";
  74. import PointsPrice from '@/components/PointsPrice.vue';
  75. /**
  76. * 积分商品推荐样式
  77. */
  78. const hotPointsStyle = {
  79. iconStyle: {
  80. width: '28rpx',
  81. height: '28rpx'
  82. },
  83. priceStyle: {
  84. fontSize: '26rpx',
  85. },
  86. unitStyle: {
  87. fontSize: '24rpx',
  88. },
  89. }
  90. export default {
  91. props: {
  92. //订单详情
  93. orderData: {
  94. type: Object,
  95. default: function() {
  96. return {};
  97. }
  98. },
  99. //商品信息
  100. cartInfo: {
  101. type: Array,
  102. default: function() {
  103. return [];
  104. }
  105. },
  106. orderNo: {
  107. type: String,
  108. default: '',
  109. },
  110. jump: {
  111. type: Boolean,
  112. default: false,
  113. },
  114. orderProNum: {
  115. type: Number,
  116. default: function() {
  117. return 0;
  118. }
  119. },
  120. //商户整条对象信息
  121. orderInfo: {
  122. type: Object,
  123. default: function() {
  124. return {};
  125. }
  126. },
  127. //是否显示操作按钮
  128. isShowBtn: {
  129. type: Boolean,
  130. default: true,
  131. },
  132. //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  133. secondType: {
  134. type: Number,
  135. default: function() {
  136. return 0;
  137. }
  138. }
  139. },
  140. components: {
  141. PointsPrice
  142. },
  143. data() {
  144. return {
  145. hotPointsStyle: hotPointsStyle,
  146. totalNmu: '',
  147. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  148. ProductTypeEnum: ProductTypeEnum,
  149. };
  150. },
  151. watch: {
  152. cartInfo: function(nVal, oVal) {
  153. let num = 0
  154. nVal.forEach((item, index) => {
  155. num += item.cartNum
  156. })
  157. this.totalNmu = num
  158. }
  159. },
  160. methods: {
  161. // 普通商品、虚拟(开启可申请退款开关)、视频号可申请退款
  162. isRefund(item) {
  163. return (this.secondType === this.ProductTypeEnum.Normal || this
  164. .secondType === this.ProductTypeEnum.Video || (this.secondType === this.ProductTypeEnum.Fictitious && item.proRefundSwitch)) && this.orderData.status > 0 && this.orderData.status < 6;
  165. },
  166. // 退款数量
  167. getApplyRefundNum(item) {
  168. return Number(item.applyRefundNum) + Number(item.refundNum)
  169. },
  170. /**
  171. * 退款申请
  172. */
  173. goRefund(item) {
  174. item.groupBuyActivityId=this.orderData.groupBuyActivityId
  175. this.$Cache.set('productInfo', item)
  176. uni.navigateTo({
  177. url: '/pages/goods/after_sales_type/index?orderNo=' + this.orderNo + '&orderId=' + item.id
  178. })
  179. },
  180. jumpCon: function(item) {
  181. let type = item.hasOwnProperty('productMarketingType')?item.productMarketingType:item.hasOwnProperty('productType')?item.productType:item.type;
  182. if (this.jump) {
  183. goProductDetail(item.productId, type, '')
  184. }
  185. }
  186. }
  187. }
  188. </script>
  189. <style scoped lang="scss">
  190. .evaluateBox {
  191. position: relative;
  192. margin-top: 10rpx;
  193. .text {
  194. font-size: 20rpx;
  195. color: #868686;
  196. }
  197. }
  198. .evaluate {
  199. width: auto !important;
  200. border-radius: 20rpx !important;
  201. padding: 0 10rpx;
  202. font-size: 24rpx;
  203. }
  204. .pad24 {
  205. padding: 20rpx 24rpx 20rpx 24rpx;
  206. }
  207. .orderGoods {
  208. background-color: #fff;
  209. margin-top: 24rpx;
  210. }
  211. .money {
  212. @include price_color(theme);
  213. }
  214. .orderGoods .total {
  215. width: 100%;
  216. height: 86rpx;
  217. padding: 0 24rpx;
  218. border-bottom: 2rpx solid #f0f0f0;
  219. font-size: 30rpx;
  220. color: #282828;
  221. line-height: 86rpx;
  222. box-sizing: border-box;
  223. }
  224. .pictrue image {
  225. background: #f4f4f4;
  226. }
  227. .goodWrapper {
  228. .item {
  229. margin-bottom: 30rpx;
  230. }
  231. .item:nth-last-child(1) {
  232. margin-bottom: 0;
  233. }
  234. .name {
  235. width: 87%;
  236. }
  237. }
  238. </style>