index.vue 12 KB

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