index.vue 13 KB

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