logs.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <template>
  2. <block>
  3. <scroll-view class="scrollView" :scroll-x="true" style="width: 100%">
  4. <view class="navs">
  5. <text :class="'nav ' + (nowIndex == index ? 'bold' : '')" @tap="navChange" :data-index="index"
  6. :data-id="item.id" v-for="(item, index) in navs" :key="index">
  7. {{ item.name }}
  8. </text>
  9. <text class="borderLine"
  10. :style="'width: ' + (width + 'rpx') + ';left: ' + (45 + nowIndex * 150 + 'rpx')"></text>
  11. </view>
  12. </scroll-view>
  13. <view class="content" v-if="list.length > 0">
  14. <view class="lists" @tap="toPage" :data-order_id="item.id"
  15. data-url="/pages/operate/order_detail/order_detail" :data-index="index" v-for="(item, index) in list"
  16. :key="index">
  17. <!-- <view class="iflexC">
  18. <text style="letter-spacing: 0px">订单编号: {{item.order_no}}</text>
  19. <text class="lists-time">下单时间: {{item.create_time}}</text>
  20. </view> -->
  21. <text class="lists-status" v-if="item.order_status == 0 && item.receive_type == 2">待发货</text>
  22. <text class="lists-status" v-if="item.order_status == 0 && item.receive_type == 1">待核销</text>
  23. <text class="lists-status" v-else-if="item.order_status == 1">审核通过</text>
  24. <text class="lists-status" v-else-if="item.order_status == 2">已退款</text>
  25. <text class="lists-status" v-else-if="item.order_status == 3">拒绝退款</text>
  26. <text class="lists-status" v-else-if="item.order_status == 4">已核销</text>
  27. <text class="lists-status" v-else-if="item.order_status == 5">已发货</text>
  28. <text class="lists-status" v-else-if="item.order_status == 6">已完成</text>
  29. <text class="lists-status" v-else-if="item.order_status == 7">退款待审</text>
  30. <view :class="'iflexC lists-content ' + (item.order_status == 6 ? 'borderNone' : '')">
  31. <image class="lists-img" :src="item.goods_pic" mode="aspectFill"></image>
  32. <text class="lists-title over_2">{{ item.goods_name }}</text>
  33. <!-- <view class="lists-num">
  34. <view class="lists-num1">数量: 1</view>
  35. <view class="goDetail" catchtap="goMovie" wx:if="{{item.order_status== 6&&item.is_film==1}}">查看电影票</view>
  36. <view class="goDetail" wx:else>查看详情</view>
  37. </view> -->
  38. <text class="lists-money">
  39. 价格:
  40. <text class="red" v-if="item.pay_money != '0.00'">¥{{ item.pay_money }}+</text>
  41. <text class="red">{{ item.integral }}</text>
  42. {{ unit }} {{ item.sku ? '(' + item.sku + ')' : '' }}
  43. </text>
  44. <text class="lists-time">下单时间:{{ item.create_time }}</text>
  45. </view>
  46. <!-- <view class="iflexC" style="border-bottom:1px solid #eee;" wx:if="{{item.deliver_no}}">
  47. <text class="lists-time1" style="padding-bottom:0">快递名称:{{item.send_comp}}</text>
  48. <text class="lists-time1">物流单号:{{item.deliver_no}} </text>
  49. </view> -->
  50. <view class="iflex l-btns" style="flex-direction: row-reverse">
  51. <button class="lists-btn btn2" @tap.stop.prevent="hexiao" :data-index="index"
  52. v-if="(item.order_status == 3 && item.receive_type == 1 && !item.is_film == 1) || (item.order_status == 0 && item.receive_type == 1 && !item.is_film == 1)">
  53. 核销码
  54. </button>
  55. <button class="lists-btn btn2" @tap.stop.prevent="getMovie" :data-id="id"
  56. v-if="item.order_status == 0 && item.is_film == 1">点击领取</button>
  57. <!-- <button class="lists-btn btn2" catchtap="confirm" data-order_id="{{item.id}}" wx:if="{{item.order_status==4}}">确认已核销</button> -->
  58. <button class="lists-btn btn2" @tap.stop.prevent="confirm" :data-order_id="item.id"
  59. v-if="item.order_status == 5">确认收货</button>
  60. <button class="lists-btn btn1" @tap.stop.prevent="refundConfirm" :data-id="item.id"
  61. :data-area_code="item.ssq_code" data-type="99" v-if="item.order_status == 0">
  62. 申请退款
  63. </button>
  64. <button class="lists-btn btn2" v-if="item.receive_type == 2 && item.order_status == 5"
  65. :data-phone="item.receiver_mobile" :data-no="item.deliver_no" @tap.stop.prevent="lookOrder">
  66. 查看物流
  67. </button>
  68. </view>
  69. </view>
  70. </view>
  71. <view v-if="!list.length && loaded" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>
  72. 暂无数据
  73. </view>
  74. <!-- <msg status="2" v-if="list.length && loaded"></msg> -->
  75. <!-- 去掉跳转同城运营中心的tabbar -->
  76. <!-- <tabbar active='1'></tabbar> -->
  77. <!-- <view class="mask" v-if="flag">
  78. <view class="qrcode">
  79. <image mode="widthFix" :src="qr_img"></image>
  80. <view class="close" @tap="close">关闭</view>
  81. \
  82. </view>
  83. </view> -->
  84. </block>
  85. </template>
  86. <script>
  87. var app = getApp();
  88. export default {
  89. data() {
  90. return {
  91. list: [{
  92. create_time: "2022-03-26 15:45:59",
  93. deliver_no: "",
  94. goods_id: 1520,
  95. goods_name: "寒铁10件套美容工具IRON-0100 IRON-0100",
  96. goods_pic: "https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2487/f04456f1d7360742a070f36b0901e0a7.png",
  97. id: 1182,
  98. integral: "0.00",
  99. is_deliver: 0,
  100. is_film: 0,
  101. order_no: "31038957705405027625933",
  102. order_status: 0,
  103. pay_money: "0.00",
  104. pay_time: "2022-03-26 15:45:59",
  105. receive_type: 2,
  106. receiver_mobile: "18779615160",
  107. send_comp: "",
  108. sku: "中号型",
  109. ssq_code: "360702",
  110. },
  111. {
  112. create_time: "2022-03-26 15:45:41",
  113. deliver_no: "",
  114. goods_id: 1520,
  115. goods_name: "寒铁10件套美容工具IRON-0100 IRON-0100",
  116. goods_pic: "https://ymyun-oss.oss-cn-hangzhou.aliyuncs.com/yidu_tc/public/upload/12/2487/f04456f1d7360742a070f36b0901e0a7.png",
  117. id: 1181,
  118. integral: "0.00",
  119. is_deliver: 0,
  120. is_film: 0,
  121. order_no: "31038957690909207348985",
  122. order_status: 0,
  123. pay_money: "0.00",
  124. pay_time: "2022-03-26 15:45:42",
  125. receive_type: 1,
  126. receiver_mobile: "18779615160",
  127. send_comp: "",
  128. sku: "中号型",
  129. ssq_code: "360702",
  130. }
  131. ],
  132. page: 1,
  133. loaded: false,
  134. nowIndex: 0,
  135. width: 60,
  136. navs: [{
  137. id: 0,
  138. name: '全部'
  139. },
  140. {
  141. id: 2,
  142. name: '待发货'
  143. },
  144. {
  145. id: 3,
  146. name: '待收货'
  147. },
  148. {
  149. id: 5,
  150. name: '已完成'
  151. }
  152. ],
  153. is_deliver: 4,
  154. unit: '积分',
  155. flag: false,
  156. qr_img: '',
  157. show: false,
  158. id: ''
  159. };
  160. },
  161. onLoad: function() {
  162. var that = this;
  163. that.getlist();
  164. },
  165. onPullDownRefresh: function() {
  166. this.list= [],
  167. this.page= 1,
  168. this.loaded= false
  169. this.getlist();
  170. },
  171. onReachBottom: function() {
  172. this.loaded || this.getlist();
  173. },
  174. methods: {
  175. lookOrder(e) {
  176. var phone = e.currentTarget.dataset.phone;
  177. var no = e.currentTarget.dataset.no;
  178. uni.navigateTo({
  179. url: `/pages/other/logistics/logistics?phone=${phone}&no=${no}`
  180. });
  181. },
  182. getMovie(e) {
  183. var id = e.currentTarget.dataset.id;
  184. uni.navigateTo({
  185. url: `/pages/movie/pages/receive/index?id=${id}&channel=integral`
  186. });
  187. },
  188. hexiao(e) {
  189. //点击核销弹出
  190. var index = e.currentTarget.dataset.index;
  191. var order_id = this.list[index].id;
  192. uni.navigateTo({
  193. url: '/pages/other/orderCode/orderCode?id=' + order_id + '&type=2'
  194. }); // var that = this;
  195. // wx.showLoading({
  196. // title: '加载中',
  197. // })
  198. // a.get('regionintegral/qrcode',
  199. // { uid: app.getCache('userinfo').uid, order_id: order_id},
  200. // function (res) {
  201. // if (res.code == 0) {
  202. // that.setData({
  203. // qr_img:res.info,
  204. // flag:true
  205. // })
  206. // wx.hideLoading({
  207. // complete: (res) => {},
  208. // })
  209. // }else{
  210. // a.toast(res.msg)
  211. // }
  212. // }
  213. // )
  214. },
  215. close() {
  216. this.flag=false
  217. },
  218. confirm(e) {
  219. // 确认收货
  220. const that = this;
  221. const order_id = e.currentTarget.dataset.order_id;
  222. a.get(
  223. 'regionintegral/confirm', {
  224. uid: app.globalData.getCache('userinfo').uid,
  225. order_id: order_id
  226. },
  227. function(res) {
  228. // const res1 = res ? JSON.parse(res.info) : ''
  229. console.log(res);
  230. if (res.code == 0) {
  231. a.toast(res.msg, 'none');
  232. setTimeout(function() {
  233. that.initData();
  234. that.getlist();
  235. }, 1000);
  236. } else {
  237. a.toast(res.msg, 'none');
  238. }
  239. }
  240. );
  241. },
  242. navChange(e) {
  243. if (this.nowIndex != e.currentTarget.dataset.index) {
  244. this.nowIndex=e.currentTarget.dataset.index,
  245. this.initData();
  246. this.getlist();
  247. }
  248. },
  249. initData() {
  250. this.page = 1
  251. this.loaded = false
  252. this.list = []
  253. },
  254. async getlist() {
  255. var that = this;
  256. var res = await this.$api.request('/order/getOrders', 'GET', {
  257. type: 1 ,
  258. page: this.page,
  259. pagesize: 10,
  260. state:this.navs[this.nowIndex].id
  261. });
  262. console.log(res)
  263. if (res) {
  264. if (res.length > 0) {
  265. this.list = this.list.concat(res);
  266. this.page++;
  267. } else {
  268. this.loaded = true
  269. this.$api.msg('没有更多数据');
  270. }
  271. }
  272. },
  273. toPage(e) {
  274. let index = e.currentTarget.dataset.index;
  275. if (this.list[index].order_status == 6 && this.list[index].is_film == 1) {
  276. e.currentTarget.dataset.url = '/pages/movie/pages/myMovie/index';
  277. }
  278. app.globalData.toPage(e);
  279. }
  280. }
  281. };
  282. </script>
  283. <style>
  284. page {
  285. background: #f2f2f2;
  286. padding-bottom: 140rpx;
  287. }
  288. .scrollView {
  289. position: fixed;
  290. top: 0;
  291. left: 0;
  292. width: 100%;
  293. z-index: 100;
  294. }
  295. .navs {
  296. display: flex;
  297. width: 100%;
  298. position: relative;
  299. border-top: 1px solid #e4e4e4;
  300. background: white;
  301. }
  302. .lists-time1 {
  303. font-size: 24rpx;
  304. color: #666;
  305. padding: 10rpx 0 16rpx;
  306. }
  307. .navs .nav {
  308. flex: 1;
  309. flex-shrink: 0;
  310. text-align: center;
  311. padding: 26rpx 0;
  312. font-size: 28rpx;
  313. color: #333;
  314. }
  315. .borderNone {
  316. border-bottom: none !important;
  317. }
  318. .bold {
  319. font-weight: bold;
  320. color: #FB4C6F !important;
  321. }
  322. .borderLine {
  323. width: 60rpx;
  324. height: 4rpx;
  325. background: rgba(234, 63, 51, 1);
  326. opacity: 1;
  327. display: block;
  328. position: absolute;
  329. bottom: 0;
  330. transition: left 0.3s;
  331. opacity: 0;
  332. }
  333. .content {
  334. margin-top: 116rpx;
  335. }
  336. .lists {
  337. background: white;
  338. margin: 0 20rpx 20rpx;
  339. padding: 22rpx;
  340. border-radius: 15rpx;
  341. font-size: 28rpx;
  342. position: relative;
  343. }
  344. .lists-status {
  345. position: absolute;
  346. top: 22rpx;
  347. right: 22rpx;
  348. font-size: 26rpx;
  349. color: #8E8E8E;
  350. }
  351. .lists-content {
  352. padding: 0 0 0 156rpx;
  353. position: relative;
  354. min-height: 132rpx;
  355. }
  356. .lists-img {
  357. height: 132rpx;
  358. width: 132rpx;
  359. position: absolute;
  360. top: 0;
  361. left: 0;
  362. border-radius: 6rpx;
  363. }
  364. .lists-time {
  365. font-size: 22rpx;
  366. color: #666;
  367. }
  368. .lists-title {
  369. font-size: 32rpx;
  370. width: 410rpx;
  371. line-height: 1.2;
  372. }
  373. .lists-num {
  374. padding: 12rpx 0 24rpx;
  375. display: flex;
  376. align-items: center;
  377. justify-content: space-between;
  378. }
  379. .lists-num1 {
  380. color: #666;
  381. }
  382. .goDetail {
  383. width: 150rpx;
  384. height: 65rpx;
  385. color: #f62e2e;
  386. border: 1px solid #f62e2e;
  387. border-radius: 40rpx;
  388. font-size: 24rpx;
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. }
  393. .lists-money {
  394. font-size: 26rpx;
  395. padding: 6rpx 0 26rpx;
  396. }
  397. .lists-btn,
  398. .btn1 {
  399. position: relative;
  400. z-index: 1;
  401. width: 140rpx;
  402. height: 50rpx;
  403. line-height: 50rpx;
  404. opacity: 1;
  405. border-radius: 24rpx;
  406. margin: 12rpx 0 0 14rpx;
  407. border: none;
  408. font-size: 24rpx;
  409. font-weight: 400;
  410. padding: 0;
  411. background: #FB4C6F;
  412. color: white;
  413. /* */
  414. overflow: inherit;
  415. }
  416. /* .lists-btn::before{
  417. position: absolute;
  418. content: '';
  419. height: 1rpx;
  420. width: 666rpx;
  421. background-color: RGBA(220, 220, 220, 0.6);
  422. display: block;
  423. top: -12rpx;
  424. z-index: 21;
  425. left: -360rpx;
  426. } */
  427. .l-btns {
  428. border-top: 1rpx solid RGBA(220, 220, 220, 0.6);
  429. margin-top: 18rpx;
  430. }
  431. .btn1 {
  432. line-height: 46rpx;
  433. border: 1rpx solid #999999;
  434. color: #333;
  435. background: white;
  436. }
  437. /* .btn1::after{
  438. border: none
  439. } */
  440. .integral {
  441. background: #fff;
  442. padding: 30rpx;
  443. box-sizing: border-box;
  444. width: 100%;
  445. font-family: 微软雅黑;
  446. margin: 0 auto 0;
  447. font-size: 30rpx;
  448. color: #333;
  449. border-bottom: 1rpx solid #e5e5e5;
  450. display: flex;
  451. flex-direction: row;
  452. justify-content: space-between;
  453. align-items: center;
  454. }
  455. .integral-left {
  456. display: flex;
  457. flex-direction: row;
  458. justify-content: flex-start;
  459. }
  460. .integral-left1 {
  461. display: flex;
  462. flex-direction: column;
  463. justify-content: center;
  464. }
  465. .integral-left image {
  466. width: 180rpx;
  467. height: 120rpx;
  468. margin-right: 30rpx;
  469. }
  470. .integral-left view:nth-child(1) {
  471. color: #333;
  472. }
  473. .integral-left view:nth-child(2) {
  474. margin-top: 5rpx;
  475. color: #999;
  476. font-size: 25rpx;
  477. }
  478. .integral-right {
  479. font-weight: bold;
  480. font-size: 40rpx;
  481. }
  482. .integral-right1 {
  483. font-weight: 100;
  484. font-size: 26rpx;
  485. margin-left: 5rpx;
  486. }
  487. .vice {
  488. color: #999;
  489. font-size: 25rpx;
  490. }
  491. .mask {
  492. width: 100%;
  493. height: 100vh;
  494. position: fixed;
  495. top: 0;
  496. left: 0;
  497. background: rgba(0, 0, 0, 0.5);
  498. z-index: 999;
  499. }
  500. .qrcode {
  501. width: 80%;
  502. height: auto;
  503. position: absolute;
  504. top: 50%;
  505. left: 50%;
  506. transform: translate(-50%, -50%);
  507. }
  508. .close {
  509. margin: 30rpx auto;
  510. width: 200rpx;
  511. height: 70rpx;
  512. background: #fff;
  513. border-radius: 20rpx;
  514. text-align: center;
  515. line-height: 70rpx;
  516. }
  517. .qrcode image {
  518. width: 100%;
  519. height: auto;
  520. border-radius: 10rpx;
  521. }
  522. .over_2 {
  523. overflow: hidden;
  524. text-overflow: ellipsis;
  525. display: -webkit-box;
  526. -webkit-box-orient: vertical;
  527. -webkit-line-clamp: 2;
  528. }
  529. .iflex {
  530. display: flex;
  531. }
  532. .iflexC {
  533. display: flex;
  534. flex-direction: column
  535. }
  536. </style>