gbOrderList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <view class="container">
  3. <navbar :config="config" backColor="#666"></navbar>
  4. <view class="topview" :style="{ top: tabTop + 'px' }">
  5. <!--订单类型选择-->
  6. <scroll-view scroll-x="true" class="scrollbox">
  7. <view class="order-type u-flex-center">
  8. <view class="type-name u-font26 u-181818" :class="{ active: isChange == index }"
  9. v-for="(item, index) in orderType" :key="index" @click="clickBtn(index)">
  10. {{ item }}
  11. </view>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <view class="plrbottom">
  16. <!--订单列表-->
  17. <view class="order-list" v-for="item in orderList" :key="item.id">
  18. <view class="u-bg-fff order-item" @click="goGbOrderDetails(item)">
  19. <view class="u-shop-teile-pd">
  20. <view class="u-text1 viewWidthTitle">
  21. <text class="iconfont2 u-font34 u-bold " style="color: #FA6138;">&#xe611;</text>
  22. <text class="u-1A1A1A u-font30 u-ml15">{{ item.shop_name }}</text>
  23. <text class="u-CCC right-icon iconfont">&#xe6c7;</text>
  24. </view>
  25. <text class="u-FF0000 u-font28" v-if="item.pay_status == 0">待付款</text>
  26. <text class="u-FF0000 u-font28" v-if="
  27. item.pay_status == 5 && (item.status == 0 || item.status == 1)
  28. ">待成团</text>
  29. <text class="u-FF0000 u-font28" v-if="item.pay_status == 5 && item.status == 2">组团成功</text>
  30. <text class="u-FF0000 u-font28" v-if="item.status == 3 || item.status == 4">组团失败</text>
  31. </view>
  32. <view class="u-border-one-one"></view>
  33. <view v-if="orderList.length>0">
  34. <!-- <ldgoods :value="item" :isGroup="true" @click.native="goProductDetails(item)"></ldgoods> -->
  35. <view class="details-top">
  36. <view class="details-left">
  37. <image :src="item.goods_cover" v-if="item.goods_cover" class="u-goods200 u-ml15" mode=""></image>
  38. <image :src="item.goods_img" v-if="item.goods_img" class="u-goods200 u-ml15" mode=""></image>
  39. </view>
  40. <view class="details-right">
  41. <view class="right-top">
  42. {{item.goods_title}}
  43. </view>
  44. <view class="specifications">
  45. 规格:{{item.sku_set_name}}
  46. </view>
  47. <view class="amount-of-money">
  48. <view style="font-size: 26rpx;" v-if="item.real_price%1===0">
  49. ¥{{item.real_price}}.00
  50. </view>
  51. <view style="font-size: 26rpx;" v-else>
  52. ¥{{item.real_price}}0
  53. </view>
  54. <text class="group">{{item.group_people_num}}人拼</text>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="u-text-right u-plr30 u-mt20">
  59. <view class="u-flex" style="justify-content: flex-end;">
  60. <view class="u-text-right">
  61. 共{{item.number}}件商品, 总金额
  62. </view>
  63. <view class="u-FF0000">
  64. <rich-text :nodes="$mUtil.priceBigSmall(item.total_amount)"></rich-text>
  65. </view>
  66. <text v-if="item.total_point>0">,总积分:{{item.total_point}}</text>
  67. </view>
  68. <view class="u-mt10">含运费¥{{ item.real_freight }}</view>
  69. <view class="u-flex-column-end u-mt30">
  70. <view class="u-flex">
  71. <!--去付款-->
  72. <view class="u-flex-center">
  73. <view v-if="item.pay_status == 0"> <text class="iconfont">&#xe681;</text> 支付剩余({{item|dateFilter}})</view>
  74. <view class="btn-item u-text-center u-FF0000 br-FF0000"
  75. v-if="item.pay_status == 0" @click="goGbOrderDetails(item)">去付款</view>
  76. <view class="btn-item u-text-center u-060606 br-999" v-if="item.pay_status!=0"
  77. @click="goGbOrderDetails(item)">查看详情</view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <loadMore v-if="orderList.length>0" :status="status"></loadMore>
  86. <nodata v-else :config="{ top: 15, content: '暂无订单~' }"></nodata>
  87. </view>
  88. <!--页面加载动画-->
  89. <ldLoading isFullScreen :active="loading"></ldLoading>
  90. </view>
  91. </template>
  92. <script>
  93. import ldgoodsbalck from "../../../components/ld-goods/ld-goods-black.vue";
  94. import ldgoods from "../../../components/ld-goods/ld-goods.vue";
  95. import ldshop from "../../../components/ld-shop/ld-shop.vue";
  96. import loadMore from "../../../components/uni-load-more/uni-load-more.vue"
  97. var app = getApp();
  98. let vObj
  99. export default {
  100. components: {
  101. ldgoodsbalck,
  102. ldgoods,
  103. ldshop,
  104. },
  105. beforeCreate() {
  106. vObj = this
  107. },
  108. data() {
  109. return {
  110. list: 1,
  111. config: {
  112. back: true, //false是tolbar页面 是则不写
  113. title: "全部订单",
  114. color: "#1a1a1a",
  115. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  116. backgroundColor: [1, "#fff"],
  117. statusBarFontColor: "#1A1A1A",
  118. backPage: '/pages/index/personal'
  119. // backTabPage: '/pages/index/personal'
  120. },
  121. isChange: 0,
  122. timeCount:0,
  123. timer:null,
  124. orderType: ["全部订单", "待付款", "待成团", "组团成功", "组团失败"],
  125. shopStatus: true, //发货状态
  126. loading: true,
  127. orderList: [], //全部订单,待支付
  128. orderListOther: [], //待发货,待收货,待评价
  129. orderListblack: [],
  130. status: "more", //more|loading|noMore
  131. noData: false,
  132. parmas: {
  133. page: 1,
  134. limit: 10,
  135. },
  136. orderid: null,
  137. currentKey: null,
  138. tabTop: 0,
  139. };
  140. },
  141. onUnload() {
  142. console.log(66666666)
  143. // uni.switchTab({
  144. // url:"../../index/personal"
  145. // })
  146. },
  147. onReachBottom(e) {
  148. this.status = "loading";
  149. this.parmas.page++;
  150. this.getOrderList();
  151. },
  152. onPullDownRefresh() {
  153. this.rest();
  154. this.getOrderList();
  155. },
  156. onLoad(options) {
  157. let that = this
  158. that.timer = setInterval(()=>{
  159. that.timeCount++
  160. },1000)
  161. this.tabTop = app.globalData.barHeight + 44;
  162. if (options.keys) {}
  163. this.getOrderList();
  164. },
  165. beforeDestroy(){
  166. clearInterval(this.timer)
  167. },
  168. filters: {
  169. dateFilter(item){
  170. // console.log(item.expired_pay_time)
  171. let time = item.pay_expire_time - item.now_millis - vObj.timeCount*1000;
  172. let str = vObj.$mUtil.countDownClock(time)
  173. return str
  174. },
  175. payStatus(val) {
  176. switch (val) {
  177. case 0:
  178. return "待支付";
  179. break;
  180. case 1:
  181. return "待发货";
  182. break;
  183. case 2:
  184. return "部分发货";
  185. break;
  186. case 3:
  187. return "待收货";
  188. break;
  189. case 4:
  190. return "已收货";
  191. break;
  192. case 5:
  193. return "待评价";
  194. break;
  195. case 6:
  196. return "关闭";
  197. break;
  198. default:
  199. break;
  200. }
  201. },
  202. payStatusRight(val) {
  203. //退款
  204. //维权订单操作状态(0申请,1同意,2买家已发货,3商家已收到退货商品,4商家发起退款支付,5已支付退款,6拒绝,7自动关闭,8主动撤消
  205. switch (val) {
  206. case 0:
  207. return "申请退款中";
  208. break;
  209. case 1:
  210. return "商家同意";
  211. break;
  212. case 4:
  213. return "商家发起退款支付";
  214. break;
  215. case 5:
  216. return "退款成功";
  217. break;
  218. case 6:
  219. return "商家拒绝";
  220. break;
  221. default:
  222. break;
  223. }
  224. },
  225. payStatusRights(val) {
  226. //退款退货
  227. //维权订单操作状态(0申请,1同意,2买家已发货,3商家已收到退货商品,4商家发起退款支付,5已支付退款,6拒绝,7自动关闭,8主动撤消
  228. switch (val) {
  229. case 0:
  230. return "申请退款/退货中";
  231. break;
  232. case 1:
  233. return "等待买家发货";
  234. break;
  235. case 2:
  236. return "待商家收货";
  237. break;
  238. case 3:
  239. return "商家已收货";
  240. break;
  241. case 4:
  242. return "商家待打款";
  243. break;
  244. case 5:
  245. return "退款/退货成功";
  246. break;
  247. case 6:
  248. return "商家拒绝";
  249. break;
  250. case 7:
  251. return "自动关闭";
  252. break;
  253. case 8:
  254. return "撤销";
  255. break;
  256. default:
  257. break;
  258. }
  259. },
  260. },
  261. methods: {
  262. goGbOrderDetails(item) {
  263. if (item.pay_status == 0) {
  264. uni.navigateTo({
  265. url: `./gbOrderDetails?id=${item.pay_order_id}&status=waitpay`,
  266. });
  267. } else {
  268. uni.navigateTo({
  269. url: `./gbOrderDetails?id=${item.order_id}&groupId=${item.id}&status=pay`,
  270. });
  271. }
  272. },
  273. goProductDetails(item) {
  274. uni.navigateTo({
  275. url: "/pages/product/goods/puzzleGoods?id=" + item.group_buy_goods_id,
  276. });
  277. },
  278. goPhone(phone) {
  279. if (phone) {
  280. uni.makePhoneCall({
  281. phoneNumber: phone, //仅为示例
  282. });
  283. }
  284. },
  285. // 物流//type:1普通订单,2维权订单
  286. lookLoginsList(orderid, num, img, type) {
  287. uni.navigateTo({
  288. url: "../logistics?id=" +
  289. orderid +
  290. "&num=" +
  291. num +
  292. "&img=" +
  293. img +
  294. "&type=" +
  295. type,
  296. });
  297. },
  298. //申请售后
  299. goRefundType(i, code, time, list, orderid, childid) {
  300. //i:1未发货,退款,2收到货退款/退货
  301. uni.setStorageSync("blackgoodsList", list);
  302. if (i == 1) {
  303. uni.navigateTo({
  304. url: "applicationDrawback?keystatus=" +
  305. i +
  306. "&title=申请退款" +
  307. "&orderid=" +
  308. orderid,
  309. });
  310. } else {
  311. uni.navigateTo({
  312. url: "refundType?order_code=" +
  313. code +
  314. "&format_order_time=" +
  315. time +
  316. "&keystatus=" +
  317. i +
  318. "&orderid=" +
  319. orderid +
  320. "&childid=" +
  321. childid,
  322. });
  323. }
  324. },
  325. //确认收货
  326. sureGetOrder(id, k) {
  327. uni.showModal({
  328. title: "提示",
  329. content: "确定已经收到了该商品?",
  330. success: (res) => {
  331. if (res.confirm) {
  332. this.$http.post("/order/receipt", {
  333. order_id: id
  334. }).then((res) => {
  335. if (res && res.code == 200) {
  336. this.$mUtil.toast("收货成功");
  337. this.rest();
  338. if (k == 1) {
  339. this.getOrderList();
  340. } else if (k == 2) {
  341. this.otherPay(this.currentKey);
  342. }
  343. }
  344. });
  345. } else if (res.cancel) {}
  346. },
  347. });
  348. },
  349. //选完地址回选
  350. otherFun(object) {
  351. if (!!object) {
  352. console.log(object.addressid);
  353. this.$http
  354. .put("/order/update-receipt/" + this.orderid + "/" + object.addressid)
  355. .then((res) => {
  356. if (res && res.code == 200) {
  357. this.$mUtil.toast("修改成功");
  358. }
  359. });
  360. }
  361. },
  362. //修改地址
  363. changeAddress(id) {
  364. this.orderid = id;
  365. uni.navigateTo({
  366. url: "/pages/user/address/addressList",
  367. });
  368. },
  369. rest() {
  370. this.parmas.page = 1;
  371. this.orderList = [];
  372. },
  373. getOrderList() {
  374. this.$http.get("/groupbuy/team/my", this.parmas).then((res) => {
  375. this.loading = false;
  376. if (res && res.code == 200) {
  377. uni.stopPullDownRefresh();
  378. this.orderList = this.orderList.concat(res.page.list);
  379. if (this.orderList.length == 0) {
  380. this.noData = true;
  381. } else {
  382. this.noData = false;
  383. }
  384. if (res.page.totalPage <= res.page.currPage) {
  385. this.status = "noMore";
  386. } else {
  387. this.status = "more";
  388. }
  389. }
  390. });
  391. },
  392. clickBtn(index) {
  393. this.rest();
  394. this.isChange = index;
  395. //维权订单操作状态(0申请,1同意,2买家已发货,3商家已收到退货商品,4商家发起退款支付,5已支付退款,6拒绝,7自动关闭,8主动撤消
  396. if (index > 0) {
  397. this.parmas.status = index;
  398. } else {
  399. delete this.parmas.status;
  400. }
  401. this.getOrderList();
  402. },
  403. //支付
  404. waitpayOrder(id, total_amount, expired_pay_time) {
  405. uni.navigateTo({
  406. url: "../../order/pay?id=" +
  407. id +
  408. "&total_amount=" +
  409. total_amount +
  410. "&expired_pay_time=" +
  411. expired_pay_time,
  412. });
  413. },
  414. //详情页
  415. goOrderDetails(id) {
  416. uni.navigateTo({
  417. url: "orderDetails?id=" + id + "&status=pay",
  418. });
  419. },
  420. gotoBalckDetail(id, shopid, type, status) {
  421. uni.navigateTo({
  422. url: "orderblackDetails?id=" +
  423. id +
  424. "&shopid=" +
  425. shopid +
  426. "&type=" +
  427. type +
  428. "&status=" +
  429. status,
  430. });
  431. },
  432. //支付订单
  433. goOrderDetailsPay(id) {
  434. uni.navigateTo({
  435. url: "orderDetails?id=" + id + "&status=waitpay",
  436. });
  437. },
  438. },
  439. };
  440. </script>
  441. <style>
  442. page {
  443. background-color: #f5f5f5;
  444. }
  445. </style>
  446. <style lang="scss" scoped>
  447. .u-border-one-one{
  448. border-top: 3rpx solid #e7e7e7;
  449. margin-bottom: 30rpx;
  450. }
  451. .right-icon {
  452. font-size: 25rpx;
  453. }
  454. .details-top{
  455. display: flex;
  456. .details-right{
  457. margin-left: 30rpx;
  458. display: flex;
  459. flex-direction: column;
  460. justify-content: space-between;
  461. .right-top{
  462. font-size: 28rpx;
  463. color: #1A1A1A;
  464. font-weight: 400;
  465. }
  466. .specifications{
  467. font-size: 22rpx;
  468. color: #999999;
  469. font-weight: 400;
  470. margin-top: 40rpx;
  471. margin-left: 2rpx;
  472. }
  473. .amount-of-money{
  474. display: flex;
  475. font-size: 26rpx;
  476. color: #1A1A1A;
  477. font-weight: 400;
  478. .group{
  479. margin-left: 20rpx;
  480. color: #999999;
  481. font-weight: 400;
  482. font-size: 26rpx;
  483. }
  484. }
  485. }
  486. }
  487. .shop-icon{
  488. font-size: 40rpx;
  489. color: #0B844A;
  490. }
  491. .order-list {
  492. margin-bottom: 30rpx;
  493. }
  494. .order-list .order-item {
  495. padding-bottom: 20px;
  496. }
  497. .u-shop-teile-pd {
  498. display: flex;
  499. justify-content: space-between;
  500. }
  501. .plrbottom {
  502. padding: 110rpx 30rpx 0;
  503. }
  504. .topview {
  505. background-color: #f5f5f5;
  506. height: 110rpx;
  507. width: 100%;
  508. position: fixed;
  509. left: 0;
  510. box-sizing: border-box;
  511. padding: 0 30rpx;
  512. z-index: 66;
  513. }
  514. .scrollbox {
  515. white-space: nowrap;
  516. }
  517. .pt-pb {
  518. padding: 30rpx;
  519. }
  520. .pt15-pb24 {
  521. padding-top: 24rpx;
  522. padding-bottom: 24rpx;
  523. }
  524. .br-FF0000 {
  525. border: 1px solid #ff0000;
  526. }
  527. .br-999 {
  528. border: 1px solid #999999;
  529. }
  530. .order-type {
  531. margin-top: 30rpx;
  532. margin-bottom: 26rpx;
  533. display: inline-block;
  534. .active {
  535. background: #FA6138;
  536. color: #ffffff;
  537. }
  538. .type-name {
  539. border-radius: 30px;
  540. padding: 12rpx 18rpx;
  541. display: inline-block;
  542. }
  543. }
  544. .listImg {
  545. padding: 20rpx 0 0 16rpx;
  546. }
  547. .listimgGroup {
  548. width: 200rpx;
  549. height: 200rpx;
  550. margin: 0 25rpx 25rpx 0;
  551. }
  552. .order-item {
  553. .btn-type {
  554. padding-bottom: 25rpx;
  555. .pay-time {
  556. line-height: 70rpx;
  557. margin-left: auto;
  558. }
  559. }
  560. .btn-item {
  561. width: 200rpx;
  562. height: 70rpx;
  563. line-height: 68rpx;
  564. border-radius: 35px;
  565. margin-left: 22rpx;
  566. }
  567. }
  568. .childBox {
  569. background-color: #ffffff;
  570. border-radius: 20rpx;
  571. margin-bottom: 30rpx;
  572. }
  573. </style>