logs.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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-id="item.order_id"
  15. data-url="/pages/intergalShop/orderDetail" 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.state == 2">待发货</text>
  22. <text class="lists-status" v-else-if="item.state == 3">待收货</text>
  23. <text class="lists-status" v-else-if="item.state == 5">已完成</text>
  24. <view class="iflexC lists-content">
  25. <image class="lists-img" :src="item.products[0].image" mode="aspectFill"></image>
  26. <text class="lists-title over_2">{{ item.products[0].title }}</text>
  27. <!-- <view class="lists-num">
  28. <view class="lists-num1">数量: 1</view>
  29. <view class="goDetail" catchtap="goMovie" wx:if="{{item.order_status== 6&&item.is_film==1}}">查看电影票</view>
  30. <view class="goDetail" wx:else>查看详情</view>
  31. </view> -->
  32. <text class="lists-money">
  33. 价格:
  34. <text class="red">{{ item.products[0].price }}</text>
  35. </text>
  36. <text class="lists-time">下单时间:{{ item.createtime }}</text>
  37. </view>
  38. <!-- <view class="iflexC" style="border-bottom:1px solid #eee;" wx:if="{{item.deliver_no}}">
  39. <text class="lists-time1" style="padding-bottom:0">快递名称:{{item.send_comp}}</text>
  40. <text class="lists-time1">物流单号:{{item.deliver_no}} </text>
  41. </view> -->
  42. <view class="iflex l-btns" style="flex-direction: row-reverse">
  43. <button class="lists-btn btn2"
  44. v-if="item.state == 5" @click.stop="buyNext(item.products[0].id)">再次购买</button>
  45. <button @click.stop="confirm(item.order_id)" class="lists-btn btn2" v-if="item.state == 3">确认收货</button>
  46. <!-- <button class="lists-btn btn2" @tap.stop.prevent="getMovie" :data-id="id"
  47. v-if="item.order_status == 0 && item.is_film == 1">点击领取</button>
  48. <button class="lists-btn btn2" @tap.stop.prevent="confirm" :data-order_id="item.id"
  49. v-if="item.order_status == 5">确认收货</button>
  50. <button class="lists-btn btn1" @tap.stop.prevent="refundConfirm" :data-id="item.id"
  51. :data-area_code="item.ssq_code" data-type="99" v-if="item.order_status == 0">
  52. 申请退款
  53. </button>
  54. <button class="lists-btn btn2" v-if="item.receive_type == 2 && item.order_status == 5"
  55. :data-phone="item.receiver_mobile" :data-no="item.deliver_no" @tap.stop.prevent="lookOrder">
  56. 查看物流
  57. </button> -->
  58. </view>
  59. </view>
  60. </view>
  61. <view v-if="!list.length && loaded" style='color:#999;text-align:center;margin:150rpx 0;font-size:30rpx'>
  62. 暂无数据
  63. </view>
  64. <!-- <msg status="2" v-if="list.length && loaded"></msg> -->
  65. <!-- 去掉跳转同城运营中心的tabbar -->
  66. <!-- <tabbar active='1'></tabbar> -->
  67. <!-- <view class="mask" v-if="flag">
  68. <view class="qrcode">
  69. <image mode="widthFix" :src="qr_img"></image>
  70. <view class="close" @tap="close">关闭</view>
  71. \
  72. </view>
  73. </view> -->
  74. </block>
  75. </template>
  76. <script>
  77. var app = getApp();
  78. export default {
  79. data() {
  80. return {
  81. list: [
  82. ],
  83. page: 1,
  84. loaded: false,
  85. nowIndex: 0,
  86. width: 60,
  87. navs: [{
  88. id: 0,
  89. name: '全部'
  90. },
  91. {
  92. id: 2,
  93. name: '待发货'
  94. },
  95. {
  96. id: 3,
  97. name: '待收货'
  98. },
  99. {
  100. id: 5,
  101. name: '已完成'
  102. }
  103. ],
  104. is_deliver: 4,
  105. unit: '积分',
  106. flag: false,
  107. qr_img: '',
  108. show: false,
  109. id: ''
  110. };
  111. },
  112. onLoad: function() {
  113. var that = this;
  114. that.getlist();
  115. },
  116. onPullDownRefresh: function() {
  117. this.list= [],
  118. this.page= 1,
  119. this.loaded= false
  120. this.getlist();
  121. },
  122. onReachBottom: function() {
  123. this.loaded || this.getlist();
  124. },
  125. methods: {
  126. buyNext(id) {
  127. uni.navigateTo({
  128. url: `/pages/intergalShop/goodsDetail?id=${id}`
  129. });
  130. },
  131. async confirm(id) {
  132. // 确认收货
  133. let that = this;
  134. let [error, res] = await uni.showModal({
  135. title: '确认收货?'
  136. });
  137. if (res.confirm == true) {
  138. let res = await that.$api.request('/order/received', 'GET', {
  139. order_id: id,
  140. type:1
  141. });
  142. if (res) {
  143. // 已确认收货
  144. that.initData()
  145. that.getlist()
  146. }
  147. return true;
  148. }
  149. this.$api.msg('收货失败');
  150. return false;
  151. },
  152. navChange(e) {
  153. if (this.nowIndex != e.currentTarget.dataset.index) {
  154. this.nowIndex=e.currentTarget.dataset.index,
  155. this.initData();
  156. this.getlist();
  157. }
  158. },
  159. initData() {
  160. this.page = 1
  161. this.loaded = false
  162. this.list = []
  163. },
  164. async getlist() {
  165. var that = this;
  166. var res = await this.$api.request('/order/getOrders', 'GET', {
  167. type: 1 ,
  168. page: this.page,
  169. pagesize: 10,
  170. state:this.navs[this.nowIndex].id
  171. });
  172. console.log(res)
  173. if (res) {
  174. if (res.length > 0) {
  175. this.list = this.list.concat(res);
  176. this.page++;
  177. } else {
  178. this.loaded = true
  179. this.$api.msg('没有更多数据');
  180. }
  181. }
  182. },
  183. toPage(e) {
  184. let index = e.currentTarget.dataset.index;
  185. app.globalData.toPage(e);
  186. }
  187. }
  188. };
  189. </script>
  190. <style>
  191. page {
  192. background: #f2f2f2;
  193. padding-bottom: 140rpx;
  194. }
  195. .scrollView {
  196. position: fixed;
  197. top: 0;
  198. left: 0;
  199. width: 100%;
  200. z-index: 100;
  201. }
  202. .navs {
  203. display: flex;
  204. width: 100%;
  205. position: relative;
  206. border-top: 1px solid #e4e4e4;
  207. background: white;
  208. }
  209. .lists-time1 {
  210. font-size: 24rpx;
  211. color: #666;
  212. padding: 10rpx 0 16rpx;
  213. }
  214. .navs .nav {
  215. flex: 1;
  216. flex-shrink: 0;
  217. text-align: center;
  218. padding: 26rpx 0;
  219. font-size: 28rpx;
  220. color: #333;
  221. }
  222. .borderNone {
  223. border-bottom: none !important;
  224. }
  225. .bold {
  226. font-weight: bold;
  227. color: #FB4C6F !important;
  228. }
  229. .borderLine {
  230. width: 60rpx;
  231. height: 4rpx;
  232. background: rgba(234, 63, 51, 1);
  233. opacity: 1;
  234. display: block;
  235. position: absolute;
  236. bottom: 0;
  237. transition: left 0.3s;
  238. opacity: 0;
  239. }
  240. .content {
  241. margin-top: 116rpx;
  242. }
  243. .lists {
  244. background: white;
  245. margin: 0 20rpx 20rpx;
  246. padding: 22rpx;
  247. border-radius: 15rpx;
  248. font-size: 28rpx;
  249. position: relative;
  250. }
  251. .lists-status {
  252. position: absolute;
  253. top: 22rpx;
  254. right: 22rpx;
  255. font-size: 26rpx;
  256. color: #8E8E8E;
  257. }
  258. .lists-content {
  259. padding: 0 0 0 156rpx;
  260. position: relative;
  261. min-height: 132rpx;
  262. }
  263. .lists-img {
  264. height: 132rpx;
  265. width: 132rpx;
  266. position: absolute;
  267. top: 0;
  268. left: 0;
  269. border-radius: 6rpx;
  270. }
  271. .lists-time {
  272. font-size: 22rpx;
  273. color: #666;
  274. }
  275. .lists-title {
  276. font-size: 32rpx;
  277. width: 410rpx;
  278. line-height: 1.2;
  279. }
  280. .lists-num {
  281. padding: 12rpx 0 24rpx;
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. }
  286. .lists-num1 {
  287. color: #666;
  288. }
  289. .goDetail {
  290. width: 150rpx;
  291. height: 65rpx;
  292. color: #f62e2e;
  293. border: 1px solid #f62e2e;
  294. border-radius: 40rpx;
  295. font-size: 24rpx;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. }
  300. .lists-money {
  301. font-size: 26rpx;
  302. padding: 6rpx 0 26rpx;
  303. }
  304. .lists-btn,
  305. .btn1 {
  306. position: relative;
  307. z-index: 1;
  308. width: 140rpx;
  309. height: 50rpx;
  310. line-height: 50rpx;
  311. opacity: 1;
  312. border-radius: 24rpx;
  313. margin: 12rpx 0 0 14rpx;
  314. border: none;
  315. font-size: 24rpx;
  316. font-weight: 400;
  317. padding: 0;
  318. background: #FB4C6F;
  319. color: white;
  320. /* */
  321. overflow: inherit;
  322. }
  323. /* .lists-btn::before{
  324. position: absolute;
  325. content: '';
  326. height: 1rpx;
  327. width: 666rpx;
  328. background-color: RGBA(220, 220, 220, 0.6);
  329. display: block;
  330. top: -12rpx;
  331. z-index: 21;
  332. left: -360rpx;
  333. } */
  334. .l-btns {
  335. border-top: 1rpx solid RGBA(220, 220, 220, 0.6);
  336. margin-top: 18rpx;
  337. }
  338. .btn1 {
  339. line-height: 46rpx;
  340. border: 1rpx solid #999999;
  341. color: #333;
  342. background: white;
  343. }
  344. /* .btn1::after{
  345. border: none
  346. } */
  347. .integral {
  348. background: #fff;
  349. padding: 30rpx;
  350. box-sizing: border-box;
  351. width: 100%;
  352. font-family: 微软雅黑;
  353. margin: 0 auto 0;
  354. font-size: 30rpx;
  355. color: #333;
  356. border-bottom: 1rpx solid #e5e5e5;
  357. display: flex;
  358. flex-direction: row;
  359. justify-content: space-between;
  360. align-items: center;
  361. }
  362. .integral-left {
  363. display: flex;
  364. flex-direction: row;
  365. justify-content: flex-start;
  366. }
  367. .integral-left1 {
  368. display: flex;
  369. flex-direction: column;
  370. justify-content: center;
  371. }
  372. .integral-left image {
  373. width: 180rpx;
  374. height: 120rpx;
  375. margin-right: 30rpx;
  376. }
  377. .integral-left view:nth-child(1) {
  378. color: #333;
  379. }
  380. .integral-left view:nth-child(2) {
  381. margin-top: 5rpx;
  382. color: #999;
  383. font-size: 25rpx;
  384. }
  385. .integral-right {
  386. font-weight: bold;
  387. font-size: 40rpx;
  388. }
  389. .integral-right1 {
  390. font-weight: 100;
  391. font-size: 26rpx;
  392. margin-left: 5rpx;
  393. }
  394. .vice {
  395. color: #999;
  396. font-size: 25rpx;
  397. }
  398. .mask {
  399. width: 100%;
  400. height: 100vh;
  401. position: fixed;
  402. top: 0;
  403. left: 0;
  404. background: rgba(0, 0, 0, 0.5);
  405. z-index: 999;
  406. }
  407. .qrcode {
  408. width: 80%;
  409. height: auto;
  410. position: absolute;
  411. top: 50%;
  412. left: 50%;
  413. transform: translate(-50%, -50%);
  414. }
  415. .close {
  416. margin: 30rpx auto;
  417. width: 200rpx;
  418. height: 70rpx;
  419. background: #fff;
  420. border-radius: 20rpx;
  421. text-align: center;
  422. line-height: 70rpx;
  423. }
  424. .qrcode image {
  425. width: 100%;
  426. height: auto;
  427. border-radius: 10rpx;
  428. }
  429. .over_2 {
  430. overflow: hidden;
  431. text-overflow: ellipsis;
  432. display: -webkit-box;
  433. -webkit-box-orient: vertical;
  434. -webkit-line-clamp: 2;
  435. }
  436. .iflex {
  437. display: flex;
  438. }
  439. .iflexC {
  440. display: flex;
  441. flex-direction: column
  442. }
  443. </style>