index.vue 7.5 KB

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