index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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(nVal,JSON.stringify(nVal));
  253. let num = 0
  254. nVal.forEach((item, index) => {
  255. num += item.cart_num
  256. })
  257. this.totalNmu = num;
  258. // console.log(this.totalNmu,'this.totalNmu');
  259. },
  260. giveCartInfo:function(nVal, oVal){
  261. let num = 0
  262. nVal.forEach((item, index) => {
  263. num += item.cart_num
  264. })
  265. this.totaliveNmu = num
  266. },
  267. giveData(val) {
  268. console.log(val)
  269. }
  270. },
  271. methods: {
  272. evaluateTap: function(unique, orderId) {
  273. uni.navigateTo({
  274. url: "/pages/goods/goods_comment_con/index?unique=" + unique + "&uni=" + orderId
  275. })
  276. },
  277. jumpCon: function(id) {
  278. if (this.jump) {
  279. uni.navigateTo({
  280. url: `/pages/goods_details/index?id=${id}`
  281. })
  282. } else if (this.jumpDetail) {
  283. uni.navigateTo({
  284. url: `/pages/goods/order_details/index?order_id=${this.orderId}`
  285. })
  286. }
  287. },
  288. logistics(order_id) {
  289. uni.navigateTo({
  290. url: '/pages/goods/goods_logistics/index?orderId=' + order_id
  291. })
  292. },
  293. confirmOrder(orderId) {
  294. this.$emit('confirmOrder', orderId)
  295. },
  296. changeOperation() {
  297. this.operationModel = !this.operationModel
  298. },
  299. openSubcribe: function(item,productType) {
  300. let cartIds = [
  301. {
  302. cart_id:item.id,
  303. cart_num:parseInt(item.cart_num) - parseInt(item.refund_num)
  304. }
  305. ]
  306. cartIds = JSON.stringify(cartIds);
  307. let page = `/pages/goods/goods_return/index?orderId=`+this.orderId+ '&id=' + this.oid+ '&cartIds='+ cartIds+'&productType='+this.productType;
  308. // #ifdef MP
  309. uni.showLoading({
  310. title: '正在加载',
  311. })
  312. openOrderRefundSubscribe().then(res => {
  313. uni.hideLoading();
  314. uni.navigateTo({
  315. url: page,
  316. });
  317. }).catch(() => {
  318. uni.hideLoading();
  319. });
  320. // #endif
  321. // #ifndef MP
  322. uni.navigateTo({
  323. url: page
  324. })
  325. // #endif
  326. }
  327. }
  328. }
  329. </script>
  330. <style scoped lang="scss">
  331. .giveGoods{
  332. .item{
  333. padding: 14rpx 30rpx 14rpx 0;
  334. margin-left: 30rpx;
  335. border-bottom: 1px solid #eee;
  336. .picTxt{
  337. .pictrue{
  338. width: 76rpx;
  339. height: 76rpx;
  340. border-radius: 6rpx;
  341. background-color: #F5F5F5;
  342. color: var(--view-theme);
  343. .iconfont{
  344. font-size: 34rpx;
  345. }
  346. image{
  347. width: 100%;
  348. height: 100%;
  349. border-radius: 6rpx;
  350. }
  351. margin-right: 16rpx;
  352. }
  353. .texts{
  354. width: 360rpx;
  355. color: #999999;
  356. font-size: 20rpx;
  357. .name{
  358. color: #333;
  359. }
  360. .limit{
  361. font-size: 20rpx;
  362. margin-top: 4rpx;
  363. }
  364. }
  365. }
  366. .num{
  367. color: #999999;
  368. font-size: 20rpx;
  369. }
  370. }
  371. }
  372. .goodWrapper .list .button{
  373. margin-bottom: 16rpx;
  374. .bnt{
  375. font-size: 24rpx;
  376. color: #666;
  377. width: 140rpx;
  378. height: 48rpx;
  379. border-radius: 23rpx;
  380. border: 1rpx solid #CCCCCC;
  381. margin-left: 20rpx;
  382. }
  383. }
  384. .goodWrapper .item .text .posBnt{
  385. position: absolute;
  386. right: 0;
  387. bottom: -5rpx
  388. }
  389. .goodWrapper .item .text .refund{
  390. font-size: 24rpx;
  391. color: #E93323;
  392. margin-left: 20rpx;
  393. }
  394. .goodWrapper .item .text .writeOff{
  395. border: 0;
  396. width: unset;
  397. font-size: 20rpx;
  398. color: #1890FF;
  399. }
  400. .goodWrapper .item .text .writeOff .on{
  401. color: #999;
  402. }
  403. .fontcolor {
  404. color: var(--view-theme);
  405. }
  406. .orderGoods {
  407. background-color: #fff;
  408. margin-top: 12rpx;
  409. &.on{
  410. margin-top: 0;
  411. }
  412. }
  413. .orderGoods .total {
  414. display: flex;
  415. justify-content: space-between;
  416. align-items: center;
  417. width: 100%;
  418. // height: 86rpx;
  419. padding: 0 30rpx;
  420. border-bottom: 2rpx solid #f0f0f0;
  421. font-size: 30rpx;
  422. color: #282828;
  423. line-height: 86rpx;
  424. box-sizing: border-box;
  425. .rig-btn {
  426. display: flex;
  427. align-items: center;
  428. .refund {
  429. font-size: 26rpx;
  430. color: var(--view-theme);
  431. }
  432. .done {
  433. font-size: 26rpx;
  434. color: #F19D2F;
  435. }
  436. }
  437. .logistics {
  438. // height: 46rpx;
  439. line-height: 30rpx;
  440. color: #999999;
  441. font-size: 20rpx;
  442. border: 1px solid;
  443. border-radius: 30rpx;
  444. padding: 6rpx 12rpx;
  445. margin-left: 10rpx;
  446. }
  447. .sure {
  448. color: var(--view-theme);
  449. border: 1px solid var(--view-theme);
  450. }
  451. .navigator {
  452. font-size: 24rpx;
  453. color: #999999;
  454. .iconfont {
  455. margin-left: 10rpx;
  456. font-size: 24rpx;
  457. color: #999999;
  458. }
  459. }
  460. }
  461. .more-operation {
  462. display: flex;
  463. justify-content: center;
  464. align-items: center;
  465. padding: 10rpx 0;
  466. color: #bbb;
  467. }
  468. .b-top {
  469. margin-left: 30rpx;
  470. margin-right: 30rpx;
  471. border-top: 1px solid #f0f0f0
  472. }
  473. .fade-enter-active,
  474. .fade-leave-active {
  475. transition: all 0.1s;
  476. }
  477. .fade-enter,
  478. .fade-leave-to
  479. /* .fade-leave-active below version 2.1.8 */
  480. {
  481. opacity: 0;
  482. transform: translateY(-10px);
  483. }
  484. .op {
  485. opacity: 0.5;
  486. }
  487. .pic {
  488. display: flex;
  489. justify-content: space-between;
  490. }
  491. .valid {
  492. font-size: 24rpx;
  493. }
  494. </style>