index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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' v-if="!isHeader">
  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. isHeader: {
  140. type: Boolean,
  141. default: false
  142. }
  143. },
  144. components: {
  145. PointsPrice
  146. },
  147. data() {
  148. return {
  149. hotPointsStyle: hotPointsStyle,
  150. totalNmu: '',
  151. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  152. ProductTypeEnum: ProductTypeEnum,
  153. };
  154. },
  155. watch: {
  156. cartInfo: function(nVal, oVal) {
  157. let num = 0
  158. nVal.forEach((item, index) => {
  159. num += item.cartNum
  160. })
  161. this.totalNmu = num
  162. }
  163. },
  164. methods: {
  165. // 普通商品、虚拟(开启可申请退款开关)、视频号可申请退款
  166. isRefund(item) {
  167. return (this.secondType === this.ProductTypeEnum.Normal || this
  168. .secondType === this.ProductTypeEnum.Video || (this.secondType === this.ProductTypeEnum.Fictitious && item.proRefundSwitch)) && this.orderData.status > 0 && this.orderData.status < 6;
  169. },
  170. // 退款数量
  171. getApplyRefundNum(item) {
  172. return Number(item.applyRefundNum) + Number(item.refundNum)
  173. },
  174. /**
  175. * 退款申请
  176. */
  177. goRefund(item) {
  178. item.groupBuyActivityId=this.orderData.groupBuyActivityId
  179. this.$Cache.set('productInfo', item)
  180. let url = '/pages/goods/after_sales_type/index?orderNo=' + this.orderNo + '&orderId=' + item.id
  181. uni.navigateTo({
  182. url: this.isHeader ? url + '&orderType=secondHand' : url
  183. })
  184. },
  185. jumpCon: function(item) {
  186. let type = item.hasOwnProperty('productMarketingType')?item.productMarketingType:item.hasOwnProperty('productType')?item.productType:item.type;
  187. if (this.jump) {
  188. goProductDetail(item.productId, type, '')
  189. }
  190. }
  191. }
  192. }
  193. </script>
  194. <style scoped lang="scss">
  195. .evaluateBox {
  196. position: relative;
  197. margin-top: 10rpx;
  198. .text {
  199. font-size: 20rpx;
  200. color: #868686;
  201. }
  202. }
  203. .evaluate {
  204. width: auto !important;
  205. border-radius: 20rpx !important;
  206. padding: 0 10rpx;
  207. font-size: 24rpx;
  208. }
  209. .pad24 {
  210. padding: 20rpx 24rpx 20rpx 24rpx;
  211. }
  212. .orderGoods {
  213. background-color: #fff;
  214. margin-top: 24rpx;
  215. }
  216. .money {
  217. @include price_color(theme);
  218. }
  219. .orderGoods .total {
  220. width: 100%;
  221. height: 86rpx;
  222. padding: 0 24rpx;
  223. border-bottom: 2rpx solid #f0f0f0;
  224. font-size: 30rpx;
  225. color: #282828;
  226. line-height: 86rpx;
  227. box-sizing: border-box;
  228. }
  229. .pictrue image {
  230. background: #f4f4f4;
  231. }
  232. .goodWrapper {
  233. .item {
  234. margin-bottom: 30rpx;
  235. }
  236. .item:nth-last-child(1) {
  237. margin-bottom: 0;
  238. }
  239. .name {
  240. width: 87%;
  241. }
  242. }
  243. </style>