index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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.priceSl || item.productPriceSl}}</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. import { rmbToLgns } from "@/utils";
  83. /**
  84. * 积分商品推荐样式
  85. */
  86. const hotPointsStyle = {
  87. iconStyle: {
  88. width: '28rpx',
  89. height: '28rpx'
  90. },
  91. priceStyle: {
  92. fontSize: '26rpx',
  93. },
  94. unitStyle: {
  95. fontSize: '24rpx',
  96. },
  97. }
  98. export default {
  99. props: {
  100. //订单详情
  101. orderData: {
  102. type: Object,
  103. default: function() {
  104. return {};
  105. }
  106. },
  107. //商品信息
  108. cartInfo: {
  109. type: Array,
  110. default: function() {
  111. return [];
  112. }
  113. },
  114. orderNo: {
  115. type: String,
  116. default: '',
  117. },
  118. jump: {
  119. type: Boolean,
  120. default: false,
  121. },
  122. orderProNum: {
  123. type: Number,
  124. default: function() {
  125. return 0;
  126. }
  127. },
  128. //商户整条对象信息
  129. orderInfo: {
  130. type: Object,
  131. default: function() {
  132. return {};
  133. }
  134. },
  135. //是否显示操作按钮
  136. isShowBtn: {
  137. type: Boolean,
  138. default: true,
  139. },
  140. //订单二级类型:0-普通订单,1-积分订单,2-虚拟订单,4-视频号订单,5-云盘订单,6-卡密订单
  141. secondType: {
  142. type: Number,
  143. default: function() {
  144. return 0;
  145. }
  146. }
  147. },
  148. components: {
  149. PointsPrice
  150. },
  151. data() {
  152. return {
  153. hotPointsStyle: hotPointsStyle,
  154. totalNmu: '',
  155. ProductMarketingTypeEnum: ProductMarketingTypeEnum,
  156. ProductTypeEnum: ProductTypeEnum,
  157. };
  158. },
  159. watch: {
  160. cartInfo: function(nVal, oVal) {
  161. let num = 0
  162. nVal.forEach((item, index) => {
  163. num += item.cartNum
  164. })
  165. this.totalNmu = num
  166. }
  167. },
  168. methods: {
  169. rmbToLgnsHandle(rmb){
  170. return rmbToLgns(rmb)
  171. },
  172. handleSetClipboard,
  173. // 普通商品、虚拟(开启可申请退款开关)、视频号可申请退款
  174. isRefund(item) {
  175. return (this.secondType === this.ProductTypeEnum.Normal || this.secondType === this.ProductTypeEnum.Reservation ||
  176. this.secondType === this.ProductTypeEnum.Video ||
  177. (this.secondType === this.ProductTypeEnum.Fictitious && item.proRefundSwitch)) && this.orderData.status > 0 && this.orderData.status < 6;
  178. },
  179. // 退款数量
  180. getApplyRefundNum(item) {
  181. return Number(item.applyRefundNum) + Number(item.refundNum)
  182. },
  183. /**
  184. * 退款申请
  185. */
  186. goRefund(item) {
  187. item.groupBuyActivityId=this.orderData.groupBuyActivityId
  188. this.$Cache.set('productInfo', item)
  189. if(this.secondType === this.ProductTypeEnum.Reservation){
  190. uni.navigateTo({
  191. url: `/pages/goods/goods_return/index?orderNo=${this.orderNo}&orderId=${item.id}&afterSalesType=1`
  192. })
  193. }else{
  194. uni.navigateTo({
  195. url: `/pages/goods/after_sales_type/index?orderNo=${this.orderNo}&orderId=${item.id}`
  196. })
  197. }
  198. },
  199. jumpCon: function(item) {
  200. let type = item.hasOwnProperty('productMarketingType')?item.productMarketingType:item.hasOwnProperty('productType')?item.productType:item.type;
  201. if (this.jump) {
  202. goProductDetail(item.productId, type, '')
  203. }
  204. }
  205. }
  206. }
  207. </script>
  208. <style scoped lang="scss">
  209. .copy-btn{
  210. color: #2291F8FF;
  211. }
  212. .evaluateBox {
  213. position: relative;
  214. margin-top: 10rpx;
  215. .text {
  216. font-size: 20rpx;
  217. color: #868686;
  218. }
  219. }
  220. .evaluate {
  221. width: auto !important;
  222. border-radius: 40rpx !important;
  223. }
  224. .pad24 {
  225. padding: 32rpx 0 0;
  226. }
  227. .orderGoods {
  228. background-color: #fff;
  229. }
  230. .money {
  231. @include price_color(theme);
  232. }
  233. .orderGoods .total {
  234. width: 100%;
  235. padding: 32rpx 0 0 0;
  236. font-size: 30rpx;
  237. color: #282828;
  238. box-sizing: border-box;
  239. .icon-ic_rightarrow{
  240. font-size: 28rpx;
  241. }
  242. }
  243. .pictrue image {
  244. background: #f4f4f4;
  245. }
  246. .goodWrapper {
  247. .item {
  248. margin-bottom: 30rpx;
  249. }
  250. .item:nth-last-child(1) {
  251. margin-bottom: 0;
  252. }
  253. .name {
  254. width: 87%;
  255. }
  256. }
  257. </style>