index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <!-- 订单商品 -->
  3. <view class="orderGoods" :class="product_type?'on':''">
  4. <view class='total' v-if="!split && totalNmu>0">共{{totalNmu}}件商品</view>
  5. <view class='total' v-if="split">
  6. <text>订单包裹{{index + 1}}</text>
  7. <view class="rig-btn" v-if="status_type === 2">
  8. <view class="logistics sure" @click="confirmOrder(orderId)">确认收货</view>
  9. <view v-if="delivery_type === 'express'" class="logistics" @click="logistics(orderId)">查看物流</view>
  10. </view>
  11. <view class="rig-btn" v-else-if="status_type === -1">
  12. <view class="refund">申请退款中</view>
  13. </view>
  14. <view class="rig-btn" v-else-if="status_type === -2">
  15. <view class="refund">已退款</view>
  16. </view>
  17. <view class="rig-btn" v-else-if="status_type === 4">
  18. <view class="done">已完成</view>
  19. </view>
  20. </view>
  21. <view class='goodWrapper'>
  22. <view class='list' :class="{op:!item.is_valid}"
  23. v-for="(item,index) in cartInfo" :key="index" @click="jumpCon(item.product_id)">
  24. <view class="item acea-row row-between-wrapper">
  25. <view class='pictrue'>
  26. <image :src='item.productInfo.attrInfo.image' v-if="item.productInfo.attrInfo"></image>
  27. <image :src='item.productInfo.image' v-else></image>
  28. </view>
  29. <view class='text'>
  30. <view class='acea-row row-between-wrapper'>
  31. <view class='name line1'>{{item.productInfo.store_name}}</view>
  32. <view class='num'>x {{item.cart_num}}</view>
  33. </view>
  34. <view class='attr line1' v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  35. <view class='money font-color pic'>
  36. <text>
  37. ¥{{item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price}}
  38. </text>
  39. <text class="valid" v-if="!item.is_valid">{{shippingType==0?'不送达':'不支持自提'}}</text>
  40. </view>
  41. <view class="posBnt acea-row row-middle">
  42. <view class="evaluate writeOff" v-if="(statusType==5 || statusType==1 || statusType==2 || statusType==3) && (deliveryType==2 || sendType=='send')">
  43. <text class="on" v-if="item.is_writeoff">已核销</text>
  44. <text class="on" v-if="!item.is_writeoff && item.surplus_num<item.cart_num">已核销{{parseInt(item.cart_num)-parseInt(item.surplus_num)}}件</text>
  45. <text v-if="!item.is_writeoff && item.surplus_num==item.cart_num">未核销</text>
  46. </view>
  47. <!-- #ifdef H5 || APP-PLUS -->
  48. <slot name="bottom" :item="item"></slot>
  49. <!-- #endif -->
  50. <!-- #ifdef MP -->
  51. <slot name="bottom{{index}}"></slot>
  52. <!-- #endif -->
  53. <text class="refund" v-if="item.refund_num && statusType !=-2">{{item.refund_num}}件退款中</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="button acea-row row-right">
  58. <view class="bnt acea-row row-center-wrapper" v-if="refund_status === 0 && item.refund_num !=item.cart_num && paid && item.is_support_refund" @click.stop="openSubcribe(item,productType)">申请退款</view>
  59. <view class='bnt acea-row row-center-wrapper' v-if='evaluate==3 && item.is_reply==0 && pid != -1'
  60. @click.stop="evaluateTap(item.unique,orderId)">评价</view>
  61. <view class='bnt acea-row row-center-wrapper' v-else-if="evaluate==3 && item.is_reply==1">已评价</view>
  62. </view>
  63. <!-- #ifdef H5 || APP-PLUS -->
  64. <slot name="footer" :item="item"></slot>
  65. <!-- #endif -->
  66. <!-- #ifdef MP -->
  67. <slot name="footer{{index}}"></slot>
  68. <!-- #endif -->
  69. </view>
  70. <view class="giveGoods">
  71. <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveCartInfo" :key="item.id">
  72. <view class="picTxt acea-row row-middle">
  73. <view class="pictrue">
  74. <image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo"></image>
  75. <image :src="item.productInfo.image" v-else></image>
  76. </view>
  77. <view class="texts">
  78. <view class="name line1">[赠品]{{item.productInfo.store_name}}</view>
  79. <view class="limit line1" v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
  80. </view>
  81. </view>
  82. <view class="num">x{{item.cart_num}}</view>
  83. </view>
  84. <view class="item acea-row row-between-wrapper" v-for="(item,index) in giveData.give_coupon" :key="item.id" v-if="giveData.give_coupon.length">
  85. <view class="picTxt acea-row row-middle">
  86. <view class="pictrue acea-row row-center-wrapper">
  87. <text class="iconfont icon-pc-youhuiquan"></text>
  88. </view>
  89. <view class="texts">
  90. <view class="line1">[赠品]{{item.coupon_title}}</view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="item acea-row row-between-wrapper" v-if="giveData.give_integral>0">
  95. <view class="picTxt acea-row row-middle">
  96. <view class="pictrue acea-row row-center-wrapper">
  97. <text class="iconfont icon-pc-jifen"></text>
  98. </view>
  99. <view class="texts">
  100. <view class="line1">[赠品]{{giveData.give_integral}}积分</view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="more-operation" v-if="split && refund_status === 0" @click="changeOperation">
  106. {{operationModel?'关闭':'更多操作'}}
  107. </view>
  108. <transition name="fade" mode="out-in" v-if="split && operationModel && refund_status === 0">
  109. <!-- #ifdef MP -->
  110. <view>
  111. <view class="more-operation b-top" @click="openSubcribe">
  112. 申请退款
  113. </view>
  114. </view>
  115. <!-- #endif -->
  116. <!-- #ifndef MP -->
  117. <navigator hover-class="none" :url="'/pages/goods/goods_return/index?orderId='+ orderId"
  118. class='more-operation b-top'>申请退款
  119. </navigator>
  120. <!-- #endif -->
  121. </transition>
  122. </view>
  123. </view>
  124. </template>
  125. <script>
  126. import {
  127. openOrderRefundSubscribe
  128. } from '@/utils/SubscribeMessage.js';
  129. export default {
  130. props: {
  131. productType:{
  132. type: Number,
  133. default: 0,
  134. },
  135. product_type:{
  136. type: Number,
  137. default: 0,
  138. },
  139. evaluate: {
  140. type: Number,
  141. default: 0,
  142. },
  143. paid: {
  144. type: Number,
  145. default: 0
  146. },
  147. // 订单状态
  148. statusType: {
  149. type: Number,
  150. default: 0,
  151. },
  152. // 配送方式
  153. deliveryType: {
  154. type: Number,
  155. default: 0,
  156. },
  157. // 送货方式
  158. sendType: {
  159. type: String,
  160. default: '',
  161. },
  162. cartInfo: {
  163. type: Array,
  164. default: function() {
  165. return [];
  166. }
  167. },
  168. giveData:{
  169. type:Object,
  170. default: function() {
  171. return [];
  172. }
  173. },
  174. giveCartInfo:{
  175. type: Array,
  176. default: function() {
  177. return [];
  178. }
  179. },
  180. orderId: {
  181. type: String,
  182. default: '',
  183. },
  184. delivery_type: {
  185. type: String,
  186. default: '',
  187. },
  188. shippingType: {
  189. type: Number,
  190. default: 0,
  191. },
  192. id:{
  193. type: Number,
  194. default: 0,
  195. },
  196. oid:{
  197. type: Number,
  198. default: 0,
  199. },
  200. jump: {
  201. type: Boolean,
  202. default: false,
  203. },
  204. split: {
  205. type: Boolean,
  206. default: false,
  207. },
  208. jumpDetail: {
  209. type: Boolean,
  210. default: false,
  211. },
  212. index: {
  213. type: Number,
  214. default: 0,
  215. },
  216. pid: {
  217. type: Number,
  218. default: 0,
  219. },
  220. refund_status: {
  221. type: Number,
  222. default: -1,
  223. },
  224. status_type: {
  225. type: Number,
  226. default: 0,
  227. }
  228. },
  229. data() {
  230. return {
  231. totalNmu: '',
  232. operationModel: false,
  233. status: ""
  234. };
  235. },
  236. watch: {
  237. cartInfo: function(nVal, oVal) {
  238. let num = 0
  239. nVal.forEach((item, index) => {
  240. num += item.cart_num
  241. })
  242. this.totalNmu = num
  243. }
  244. },
  245. methods: {
  246. evaluateTap: function(unique, orderId) {
  247. uni.navigateTo({
  248. url: "/pages/goods/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  249. })
  250. },
  251. jumpCon: function(id) {
  252. if (this.jump) {
  253. uni.navigateTo({
  254. url: `/pages/goods_details/index?id=${id}`
  255. })
  256. } else if (this.jumpDetail) {
  257. uni.navigateTo({
  258. url: `/pages/goods/order_details/index?order_id=${this.orderId}`
  259. })
  260. }
  261. },
  262. logistics(order_id) {
  263. uni.navigateTo({
  264. url: '/pages/goods/goods_logistics/index?orderId=' + order_id
  265. })
  266. },
  267. confirmOrder(orderId) {
  268. this.$emit('confirmOrder', orderId)
  269. },
  270. changeOperation() {
  271. this.operationModel = !this.operationModel
  272. },
  273. openSubcribe: function(item,productType) {
  274. let cartIds = [
  275. {
  276. cart_id:item.id,
  277. cart_num:parseInt(item.cart_num) - parseInt(item.refund_num)
  278. }
  279. ]
  280. cartIds = JSON.stringify(cartIds);
  281. let page = `/pages/goods/goods_return/index?orderId=`+this.orderId+ '&id=' + this.oid+ '&cartIds='+ cartIds+'&productType='+this.productType;
  282. // #ifdef MP
  283. uni.showLoading({
  284. title: '正在加载',
  285. })
  286. openOrderRefundSubscribe().then(res => {
  287. uni.hideLoading();
  288. uni.navigateTo({
  289. url: page,
  290. });
  291. }).catch(() => {
  292. uni.hideLoading();
  293. });
  294. // #endif
  295. // #ifndef MP
  296. uni.navigateTo({
  297. url: page
  298. })
  299. // #endif
  300. }
  301. }
  302. }
  303. </script>
  304. <style scoped lang="scss">
  305. .giveGoods{
  306. .item{
  307. padding: 14rpx 30rpx 14rpx 0;
  308. margin-left: 30rpx;
  309. border-bottom: 1px solid #eee;
  310. .picTxt{
  311. .pictrue{
  312. width: 76rpx;
  313. height: 76rpx;
  314. border-radius: 6rpx;
  315. background-color: #F5F5F5;
  316. color: var(--view-theme);
  317. .iconfont{
  318. font-size: 34rpx;
  319. }
  320. image{
  321. width: 100%;
  322. height: 100%;
  323. border-radius: 6rpx;
  324. }
  325. margin-right: 16rpx;
  326. }
  327. .texts{
  328. width: 360rpx;
  329. color: #999999;
  330. font-size: 20rpx;
  331. .name{
  332. color: #333;
  333. }
  334. .limit{
  335. font-size: 20rpx;
  336. margin-top: 4rpx;
  337. }
  338. }
  339. }
  340. .num{
  341. color: #999999;
  342. font-size: 20rpx;
  343. }
  344. }
  345. }
  346. .goodWrapper .list .button{
  347. margin-bottom: 16rpx;
  348. .bnt{
  349. font-size: 24rpx;
  350. color: #666;
  351. width: 140rpx;
  352. height: 48rpx;
  353. border-radius: 23rpx;
  354. border: 1rpx solid #CCCCCC;
  355. margin-left: 20rpx;
  356. }
  357. }
  358. .goodWrapper .item .text .posBnt{
  359. position: absolute;
  360. right: 0;
  361. bottom: -5rpx
  362. }
  363. .goodWrapper .item .text .refund{
  364. font-size: 24rpx;
  365. color: #E93323;
  366. margin-left: 20rpx;
  367. }
  368. .goodWrapper .item .text .writeOff{
  369. border: 0;
  370. width: unset;
  371. font-size: 20rpx;
  372. color: #1890FF;
  373. }
  374. .goodWrapper .item .text .writeOff .on{
  375. color: #999;
  376. }
  377. .fontcolor {
  378. color: var(--view-theme);
  379. }
  380. .orderGoods {
  381. background-color: #fff;
  382. margin-top: 12rpx;
  383. &.on{
  384. margin-top: 0;
  385. }
  386. }
  387. .orderGoods .total {
  388. display: flex;
  389. justify-content: space-between;
  390. align-items: center;
  391. width: 100%;
  392. // height: 86rpx;
  393. padding: 0 30rpx;
  394. border-bottom: 2rpx solid #f0f0f0;
  395. font-size: 30rpx;
  396. color: #282828;
  397. line-height: 86rpx;
  398. box-sizing: border-box;
  399. .rig-btn {
  400. display: flex;
  401. align-items: center;
  402. .refund {
  403. font-size: 26rpx;
  404. color: var(--view-theme);
  405. }
  406. .done {
  407. font-size: 26rpx;
  408. color: #F19D2F;
  409. }
  410. }
  411. .logistics {
  412. // height: 46rpx;
  413. line-height: 30rpx;
  414. color: #999999;
  415. font-size: 20rpx;
  416. border: 1px solid;
  417. border-radius: 30rpx;
  418. padding: 6rpx 12rpx;
  419. margin-left: 10rpx;
  420. }
  421. .sure {
  422. color: var(--view-theme);
  423. border: 1px solid var(--view-theme);
  424. }
  425. }
  426. .more-operation {
  427. display: flex;
  428. justify-content: center;
  429. align-items: center;
  430. padding: 10rpx 0;
  431. color: #bbb;
  432. }
  433. .b-top {
  434. margin-left: 30rpx;
  435. margin-right: 30rpx;
  436. border-top: 1px solid #f0f0f0
  437. }
  438. .fade-enter-active,
  439. .fade-leave-active {
  440. transition: all 0.1s;
  441. }
  442. .fade-enter,
  443. .fade-leave-to
  444. /* .fade-leave-active below version 2.1.8 */
  445. {
  446. opacity: 0;
  447. transform: translateY(-10px);
  448. }
  449. .op {
  450. opacity: 0.5;
  451. }
  452. .pic {
  453. display: flex;
  454. justify-content: space-between;
  455. }
  456. .valid {
  457. font-size: 24rpx;
  458. }
  459. </style>