wipe.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <template>
  2. <view class="wipe-wrapper">
  3. <view class="wipe-top flex">
  4. <view class="top-left" @click="smsh">
  5. <image src="../../static/icon/sm.png" mode=""></image>
  6. 扫码核销
  7. </view>
  8. <view class="top-right" @click="srhx">
  9. <image src="../../static/icon/sr.png" mode=""></image>
  10. 输入核销
  11. </view>
  12. <view class="top-jg"></view>
  13. </view>
  14. <scroll-view scroll-y="true" @scrolltolower="loadData" class="good-content" :style="{'height': height}">
  15. <view>
  16. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  17. <empty v-if="goodList.length === 0"></empty>
  18. <view class="good" v-for="item in goodList">
  19. <view class="good-top">
  20. <view class="top-num">订单编号:{{ item.order_id }}</view>
  21. <view class="top-status">待核销</view>
  22. </view>
  23. <view class="goods-box-single" v-for="itemt in item._info">
  24. <image class="goods-img" :src="itemt.cart_info.productInfo.image" mode="scaleToFill"></image>
  25. <view class="right">
  26. <view class="flex-start">
  27. <text class="title clamp">{{ itemt.cart_info.productInfo.store_name }}</text>
  28. <text class="price"
  29. style="flex-grow: 1;text-align: right;color: #901B21;font-size: 30rpx;font-weight: bold;">
  30. {{ itemt.cart_info.productInfo.price }}
  31. </text>
  32. </view>
  33. <view class="row flex">
  34. <!-- <text class="row_title">{{ goodsItem.productInfo.attrInfo ? '商品退款' : '押金退款' }}</text> -->
  35. <text class="attr-box">x {{ itemt.cart_info.cart_num}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="fh-btn-wrap" style="padding-bottom:10rpx;">
  40. <view class="fh-btn-tit">
  41. 自提信息
  42. </view>
  43. <view class="fh-btn-info">
  44. <view class="">
  45. 自提人:<text>{{item.real_name}}</text>
  46. </view>
  47. <view class="">
  48. 联系方式:<text>{{item.user_phone}}</text>
  49. </view>
  50. <view class="">
  51. 自提时间:<text>{{item.time_area}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="fh-btn-wrap" style="padding-bottom:10rpx;" v-if="item.point.name">
  56. <view class="fh-btn-tit">
  57. 自提点信息
  58. </view>
  59. <view class="fh-btn-info">
  60. <view class="">
  61. 自提点:<text>{{item.point.name}}</text>
  62. </view>
  63. <view class="">
  64. 详细地址:<text>{{item.point.detailed_address}}}</text>
  65. </view>
  66. <view class="">
  67. 联系方式:<text>{{item.point.phone}}</text>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="good-hj">一共{{ item.total_num }}件商品
  72. 实付:¥{{ (item.total_price*1 + item.deposit*1).toFixed(2) }}
  73. </view>
  74. </view>
  75. <uni-load-more :status="loadingType"></uni-load-more>
  76. </view>
  77. </scroll-view>
  78. <uni-popup ref="popuphx" class="agree-wrapper">
  79. <view class="hx-wrapper">
  80. <view class="hx-img">
  81. <image src="../../static/img/hxbg.png" mode=""></image>
  82. </view>
  83. <view class="hx-body">
  84. <view class="hx-title">
  85. 输入核销码核销
  86. </view>
  87. <input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
  88. <view class="hx-btn" @click="qhx">
  89. 立即核销
  90. </view>
  91. </view>
  92. <view class="hx-close" @click="close">
  93. <image src="../../static/icon/close.png" mode=""></image>
  94. </view>
  95. </view>
  96. </uni-popup>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. orderData,
  102. getUserInfo,
  103. getSpreadCount,
  104. bindAdmin,
  105. orderVerific,
  106. getAllList,
  107. exchangeOrderVerific
  108. } from '@/api/user.js';
  109. import empty from '@/components/empty';
  110. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  111. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  112. export default {
  113. components: {
  114. empty,
  115. uniPopup
  116. },
  117. data() {
  118. return {
  119. height: '',
  120. code: '',
  121. limit: 10,
  122. page: 1,
  123. goodList: [], //待核销商品,
  124. loadingType: 'more',
  125. loaded: '',
  126. };
  127. },
  128. onLoad() {
  129. this.loadData()
  130. },
  131. onReady(res) {
  132. var _this = this;
  133. uni.getSystemInfo({
  134. success: resu => {
  135. const query = uni.createSelectorQuery();
  136. query.select('.good-content').boundingClientRect();
  137. query.exec(function(res) {
  138. console.log(res, 'ddddddddddddd');
  139. _this.height = resu.windowHeight - res[0].top + 'px';
  140. console.log('打印页面的剩余高度', _this.height);
  141. });
  142. },
  143. fail: res => {}
  144. });
  145. },
  146. methods: {
  147. loadData() {
  148. let obj = this
  149. if (obj.loadingType == 'loading') {
  150. return
  151. }
  152. if (obj.loadingType == 'noMore') {
  153. return
  154. }
  155. obj.loadingType = 'loading'
  156. getAllList({
  157. status: 5,
  158. limit: obj.limit,
  159. page: obj.page
  160. }).then(({
  161. data
  162. }) => {
  163. obj.page++
  164. obj.goodList = obj.goodList.concat(data)
  165. console.log(data.length)
  166. if (obj.limit == data.length) {
  167. obj.loadingType = 'more'
  168. } else {
  169. obj.loadingType = 'noMore'
  170. }
  171. })
  172. },
  173. srhx() {
  174. this.$refs.popuphx.open()
  175. },
  176. close() {
  177. this.$refs.popuphx.close()
  178. },
  179. smsh() {
  180. // #ifdef H5
  181. let wx = require('jweixin-module');
  182. wx.scanQRCode({
  183. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  184. scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
  185. success: function(res) {
  186. var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
  187. orderVerific({
  188. verify_code: this.code,
  189. is_confirm: 1,
  190. }).then(res => {
  191. console.log(res, '++++++++++++++++++++++++++++++')
  192. this.$refs.popuphx.close()
  193. this.code = ''
  194. uni.showToast({
  195. title: '核销成功',
  196. duration: 2000
  197. });
  198. }).catch(err => {
  199. console.log('dddd')
  200. })
  201. }
  202. });
  203. // #endif
  204. // #ifndef H5
  205. uni.scanCode({
  206. success: (res) => {
  207. this.code = res.result
  208. this.srhx()
  209. // orderVerific({
  210. // verify_code: this.code,
  211. // is_confirm: 1,
  212. // }).then( res => {
  213. // this.$api.msg(res.msg)
  214. // console.log(res,'++++++++++++++++++++++++++++++')
  215. // this.$refs.popuphx.close()
  216. // this.code = ''
  217. // }).catch( err => {
  218. // console.log('dddd')
  219. // })
  220. }
  221. })
  222. // #endif
  223. },
  224. qhx() {
  225. if (this.code == '') {
  226. return this.$api.msg('请输入核销码')
  227. }
  228. uni.showLoading({
  229. title: '核销中...',
  230. mask: true
  231. })
  232. if (this.code.indexOf('ticket:') != -1) {
  233. exchangeOrderVerific({
  234. verify_code: this.code,
  235. is_confirm: 1,
  236. }).then(res => {
  237. uni.hideLoading()
  238. // this.$api.msg(res.msg)
  239. console.log(res, '++++++++++++++++++++++++++++++')
  240. this.$refs.popuphx.close()
  241. this.code = ''
  242. this.page = 1
  243. this.loadingType = 'more'
  244. this.goodList = []
  245. uni.showToast({
  246. title: '核销成功',
  247. duration: 2000
  248. });
  249. this.loadData()
  250. }).catch(err => {
  251. console.log('dddd')
  252. })
  253. } else {
  254. orderVerific({
  255. verify_code: this.code,
  256. is_confirm: 1,
  257. }).then(res => {
  258. uni.hideLoading()
  259. // this.$api.msg(res.msg)
  260. console.log(res, '++++++++++++++++++++++++++++++')
  261. this.$refs.popuphx.close()
  262. this.code = ''
  263. this.page = 1
  264. this.loadingType = 'more'
  265. this.goodList = []
  266. uni.showToast({
  267. title: '核销成功',
  268. duration: 2000
  269. });
  270. this.loadData()
  271. }).catch(err => {
  272. console.log('dddd')
  273. })
  274. }
  275. }
  276. }
  277. };
  278. </script>
  279. <style lang="scss" scoped>
  280. page {
  281. height: 100%;
  282. background-color: #f8f6f6;
  283. }
  284. .wipe-wrapper {
  285. .wipe-top {
  286. justify-content: space-around;
  287. width: 750rpx;
  288. height: 80rpx;
  289. background: #ffffff;
  290. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
  291. font-size: 28rpx;
  292. font-weight: 500;
  293. color: #ef041f;
  294. line-height: 80rpx;
  295. text-align: center;
  296. position: relative;
  297. z-index: 10;
  298. .top-left {
  299. vertical-align: middle;
  300. width: 50%;
  301. image {
  302. width: 27rpx;
  303. height: 25rpx;
  304. margin-right: 10rpx;
  305. }
  306. }
  307. .top-right {
  308. vertical-align: middle;
  309. width: 50%;
  310. image {
  311. width: 27rpx;
  312. height: 25rpx;
  313. margin-right: 10rpx;
  314. }
  315. }
  316. .top-jg {
  317. width: 2rpx;
  318. height: 80rpx;
  319. background: #f0f0f0;
  320. position: absolute;
  321. // background: red;
  322. }
  323. }
  324. }
  325. .good-content {
  326. height: 100%;
  327. padding-top: 20rpx;
  328. }
  329. .good {
  330. width: 702rpx;
  331. // height: 304rpx;
  332. background: #ffffff;
  333. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.06);
  334. border-radius: 10rpx;
  335. padding: 0 30rpx;
  336. padding-bottom: 20rpx;
  337. margin: 0 auto 20rpx;
  338. position: relative;
  339. .goods-box-single {
  340. display: flex;
  341. padding: 20rpx 0;
  342. .goods-img {
  343. display: block;
  344. width: 120rpx;
  345. height: 120rpx;
  346. }
  347. .right {
  348. flex: 1;
  349. display: flex;
  350. flex-direction: column;
  351. padding: 0 30rpx 0 24rpx;
  352. overflow: hidden;
  353. .row {
  354. margin-top: 10rpx;
  355. justify-content: flex-end;
  356. }
  357. .row_title {
  358. padding: 5rpx 10rpx;
  359. background-color: #dddddd;
  360. border-radius: 10rpx;
  361. font-size: 22rpx;
  362. color: #ffffff;
  363. background: #ffeee9;
  364. border-radius: 5rpx;
  365. color: #f55e5c;
  366. }
  367. .title {
  368. font-size: $font-base + 2rpx;
  369. color: $font-color-dark;
  370. line-height: 1;
  371. width: 80%;
  372. }
  373. .attr-box {
  374. display: flex;
  375. justify-content: flex-end;
  376. font-size: $font-sm + 2rpx;
  377. color: $font-color-light;
  378. }
  379. .price {
  380. display: inline;
  381. font-size: $font-base + 2rpx;
  382. color: $font-color-dark;
  383. &:before {
  384. content: '¥';
  385. font-size: $font-sm;
  386. }
  387. }
  388. }
  389. }
  390. .good-top {
  391. height: 85rpx;
  392. font-size: 24rpx;
  393. font-weight: 400;
  394. color: #666666;
  395. line-height: 85rpx;
  396. display: flex;
  397. justify-content: space-between;
  398. .top-status {
  399. font-size: 28rpx;
  400. font-weight: 500;
  401. color: #EF041F;
  402. }
  403. }
  404. .goods-buttom {
  405. height: 160rpx;
  406. display: flex;
  407. .good-img {
  408. width: 160rpx;
  409. height: 160rpx;
  410. // overflow: hidden;
  411. image {
  412. width: 160rpx;
  413. height: 160rpx;
  414. }
  415. }
  416. .good-title {
  417. width: 350rpx;
  418. padding-top: 6rpx;
  419. font-size: 26rpx;
  420. font-weight: 500;
  421. color: #3F454B;
  422. line-height: 1;
  423. padding-left: 10rpx;
  424. }
  425. .shop-info {
  426. padding-top: 11rpx;
  427. font-size: 24rpx;
  428. font-weight: 500;
  429. color: #DCB876;
  430. line-height: 1;
  431. // padding-left: 10rpx;
  432. image {
  433. width: 24rpx;
  434. height: 24rpx;
  435. margin-left: 14rpx;
  436. margin-right: 4rpx;
  437. }
  438. }
  439. .good-tag {
  440. display: inline-block;
  441. height: 36rpx;
  442. background: #ffeee9;
  443. // opacity: 0.2;
  444. border-radius: 5rpx;
  445. font-size: 20rpx;
  446. font-weight: 500;
  447. color: #F23030;
  448. padding: 0 9rpx;
  449. line-height: 36rpx;
  450. margin-top: 15rpx;
  451. margin-left: 10rpx;
  452. }
  453. }
  454. .good-hj {
  455. line-height: 1;
  456. height: 26rpx;
  457. font-size: 26rpx;
  458. font-weight: 500;
  459. color: #333333;
  460. text-align: right;
  461. }
  462. .good-price {
  463. text-align: left;
  464. font-size: 26rpx;
  465. font-weight: 500;
  466. line-height: 1;
  467. color: #333333;
  468. position: absolute;
  469. right: 31rpx;
  470. top: 98rpx;
  471. }
  472. .good-num {
  473. text-align: left;
  474. font-size: 26rpx;
  475. font-weight: 500;
  476. line-height: 1;
  477. color: #333333;
  478. position: absolute;
  479. right: 31rpx;
  480. top: 136rpx;
  481. }
  482. }
  483. .hx-wrapper {
  484. width: 536rpx;
  485. height: 630rpx;
  486. position: relative;
  487. // background-color: #fff;
  488. .hx-img {
  489. width: 536rpx;
  490. height: 281rpx;
  491. image {
  492. width: 536rpx;
  493. height: 281rpx;
  494. }
  495. }
  496. .hx-close {
  497. position: absolute;
  498. left: 243rpx;
  499. bottom: -80rpx;
  500. width: 52rpx;
  501. height: 52rpx;
  502. image {
  503. width: 52rpx;
  504. height: 52rpx;
  505. }
  506. }
  507. .hx-body {
  508. width: 536rpx;
  509. height: 349rpx;
  510. background-color: #fff;
  511. border-radius: 0 0 10rpx 10rpx;
  512. .hx-title {
  513. width: 536rpx;
  514. font-size: 36rpx;
  515. font-weight: 500;
  516. color: #333333;
  517. line-height: 1;
  518. padding-top: 42rpx;
  519. text-align: center;
  520. }
  521. input {
  522. width: 439rpx;
  523. height: 68rpx;
  524. background: #eeddde;
  525. border-radius: 10rpx;
  526. margin: 39rpx auto 0;
  527. padding-left: 26rpx;
  528. .hx-placeholder {
  529. font-size: 26rpx;
  530. font-weight: 500;
  531. color: #901b21;
  532. }
  533. }
  534. .hx-btn {
  535. margin: 44rpx auto 0;
  536. width: 353rpx;
  537. height: 71rpx;
  538. background: #901b21;
  539. border-radius: 34rpx;
  540. font-size: 36rpx;
  541. font-weight: 500;
  542. color: #F8F9F9;
  543. line-height: 71rpx;
  544. text-align: center;
  545. }
  546. }
  547. }
  548. .navbar {
  549. display: flex;
  550. height: 40px;
  551. padding: 0 5px;
  552. background: #fff;
  553. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  554. position: relative;
  555. z-index: 10;
  556. .nav-item {
  557. flex: 1;
  558. display: flex;
  559. justify-content: center;
  560. align-items: center;
  561. height: 100%;
  562. font-size: 15px;
  563. color: $font-color-dark;
  564. position: relative;
  565. &.current {
  566. color: $base-color;
  567. &:after {
  568. content: '';
  569. position: absolute;
  570. left: 50%;
  571. bottom: 0;
  572. transform: translateX(-50%);
  573. width: 44px;
  574. height: 0;
  575. border-bottom: 2px solid $base-color;
  576. }
  577. }
  578. }
  579. }
  580. .fh-btn-wrap {
  581. display: flex;
  582. // height: 55rpx;
  583. flex-direction: column;
  584. // justify-content: flex-end;
  585. // width: ;
  586. font-size: 28rpx;
  587. color: #999999;
  588. .fh-btn-tit {
  589. color: #000000;
  590. font-weight: bold;
  591. }
  592. .fh-btn-info {
  593. padding-left: 20rpx;
  594. }
  595. .fh-btn {
  596. margin-top: 10rpx;
  597. align-self: flex-end;
  598. width: 144rpx;
  599. height: 55rpx;
  600. border: 1px solid #901b21;
  601. border-radius: 28rpx;
  602. font-size: 26rpx;
  603. font-family: PingFang SC;
  604. font-weight: 500;
  605. color: #901b21;
  606. line-height: 55rpx;
  607. text-align: center;
  608. }
  609. }
  610. </style>