recordDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <view class="box">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. <!-- <image src="../../static/img/nav_icon_home.png" mode="" class="homeImg" @click="gohome"></image> -->
  11. </view>
  12. <view class="zdyNavTitle">详情</view>
  13. <view style="width: 50px;"></view>
  14. </view>
  15. </view>
  16. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  17. <view style="height: 44px;"></view>
  18. <view class="top">
  19. <view class="orderState">
  20. <image src="../../static/img/icon_order_def.png" mode="" style="width: 44rpx;height: 44rpx;"></image>
  21. <view class="SheetState" v-if="orderData.data.sheetState == 1">未兑换</view>
  22. <view class="SheetState" v-if="orderData.data.sheetState == 2">已兑换</view>
  23. <view class="SheetState" v-if="orderData.data.sheetState == 3">已取消</view>
  24. </view>
  25. </view>
  26. <!-- 兑换码 -->
  27. <view class="orderTop">
  28. <view class="maBox">
  29. <view class="timeLeft">
  30. <span>兑换码</span>
  31. </view>
  32. <view style="text-decoration:line-through; color: #999999; font-size: 26rpx;"
  33. v-if="orderData.SheetState==5 && orderData.ServiceCode!=null">{{orderData.ServiceCode}}</view>
  34. <view class="rightShou" v-if="orderData.SheetState==4">
  35. <view class="timeRight" style="color: #FF2400;" @click="showMa">收起</view>
  36. <image src="../../static/img/icon_arrow_up_orange.png" style="width: 17rpx; height: 11rpx;">
  37. </image>
  38. </view>
  39. <view style="color: #999999; font-size: 26rpx;" v-if="orderData.SheetState==5">已使用</view>
  40. </view>
  41. <!-- 兑换码 -->
  42. <view class="querenMa" v-if="isShowMa==true && orderData.SheetState==4">
  43. <view style="color: #FF2400; font-size: 24rpx; text-align: center;">请到店出示券码即可开始服务</view>
  44. <view class="maBoximg">
  45. <tki-qrcode cid="qrcode1" ref="qrcode" :val="orderData.ServiceCode" :size="308" :unit="unit"
  46. :pdground="pdground" :icon="icon" :iconSize="iconsize" :lv="lv" :onval="onval"
  47. :loadMake="loadMake" :usingComponents="true" @result="qrR" />
  48. </view>
  49. <view style="color: #333333; font-size: 26rpx; font-weight: bold; text-align: center;">
  50. {{orderData.ServiceCode}}
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 店铺信息 -->
  55. <view class="shopBox">
  56. <image src="../../static/img/icon_store.png" mode="" class="shopBoximg"></image>
  57. <view class="shopCont">
  58. <view class="shopName">{{orderData.shopInfo.shopName}}</view>
  59. <view class="Address">
  60. {{orderData.shopInfo.provinceName}}{{orderData.shopInfo.cityName}}{{orderData.shopInfo.areaName}}{{orderData.shopInfo.address}}
  61. </view>
  62. </view>
  63. <view class="shopRightBox" @click="map">
  64. <image src="../../static/img/icon_ditu.png" mode="" class="shopRightImg"></image>
  65. <view class="shopRihgtTxt">地图</view>
  66. </view>
  67. <view class="shopsx"></view>
  68. <view class="shopRightBox" @click="call">
  69. <image src="../../static/img/icon_phone.png" mode="" class="shopRightImg"></image>
  70. <view class="shopRihgtTxt">电话</view>
  71. </view>
  72. </view>
  73. <!-- 商品明细 -->
  74. <view class="information">
  75. <view class="goodsBox">
  76. <image :src="item.url" mode="" style="width: 120rpx;height: 120rpx;"></image>
  77. <view class="goodsRight">
  78. <view class="goodsName">{{item.goodsName}}</view>
  79. <view class="goodsCount">
  80. <view class="jifen">{{item.integral}}<span
  81. style="font-size: 24rpx; color: #333333; margin-left: 5rpx;">积分</span>
  82. </view>
  83. <view class="count">x{{item.qty}}</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="sum">
  88. <span style="font-size: 24rpx; color: #666666; margin-right: 10rpx;">总计</span>
  89. <span style="font-size: 32rpx; color: #FF0000;
  90. font-weight: 500; margin-right: 5rpx;">553</span>
  91. <span style=" font-size: 24rpx; color: #FF0000;">积分</span>
  92. </view>
  93. </view>
  94. <!-- 订单信息 -->
  95. <view class="information">
  96. <view class="detailedTitle">订单信息</view>
  97. <view class="informationLine">
  98. <view class="informationTxt">申请单号:</view>
  99. <view class="informationNum">{{orderData.data.code}}<span class="codeCopy"
  100. @click="copy(orderData.data.code)">复制</span></view>
  101. </view>
  102. <view class="informationLine">
  103. <view class="informationTxt">手机号:</view>
  104. <view class="informationNum">{{orderData.data.userMobilePhone}}</view>
  105. </view>
  106. <view class="informationLine">
  107. <view class="informationTxt">申请时间:</view>
  108. <view class="informationNum">{{orderData.data.createTime}}</view>
  109. </view>
  110. </view>
  111. <view style="height: 50rpx;background-color: #F4F5F7;"></view>
  112. <view class="bottom" v-if="orderData.data.sheetState == 1">
  113. <view class="cancel" @click="cancelBespeak">取消订单</view>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
  119. export default {
  120. components: {
  121. tkiQrcode
  122. },
  123. data() {
  124. return {
  125. id: '',
  126. iStatusBarHeight: '',
  127. SheetType: '', //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  128. orderData: '',
  129. onval: true, // val值变化时自动重新生成二维码
  130. loadMake: true, // 组件加载完成后自动生成二维码
  131. size: 500,
  132. qrcodeShow: false,
  133. qrcodeTop: '-100vh',
  134. qrcodeTopVal: '',
  135. ifShow: false,
  136. val: '二维码', // 要生成的二维码值
  137. unit: 'upx', // 单位
  138. background: '#b4e9e2', // 背景色
  139. foreground: '#309286', // 前景色
  140. pdground: '#262637', // 角标色
  141. icon: '', // 二维码图标
  142. iconsize: 40, // 二维码图标大小
  143. lv: 3, // 二维码容错级别 , 一般不用设置,默认就行
  144. src: '', // 二维码生成后的图片地址或base64
  145. isShowMa: false,
  146. }
  147. },
  148. onLoad(opt) {
  149. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  150. this.id = opt.id
  151. this.SheetType = opt.SheetType
  152. if (this.id) {
  153. // this.getData()
  154. }
  155. },
  156. methods: {
  157. copy(txt) {
  158. uni.setClipboardData({
  159. data: txt,
  160. success: function() {
  161. uni.showToast({
  162. title: '复制成功',
  163. icon: 'none',
  164. duration: 2000
  165. });
  166. }
  167. });
  168. },
  169. cancelBespeak() {
  170. var that = this
  171. uni.showModal({
  172. title: '提示',
  173. content: '是否取消该订单',
  174. cancelText: '否',
  175. confirmText: '是',
  176. success: function(res) {
  177. if (res.confirm) {
  178. uni.showLoading({
  179. title: '加载中'
  180. })
  181. that.$http('openOrderManagement/updateSheetState', {
  182. id: that.id,
  183. }, 'POST').then(res => {
  184. uni.hideLoading();
  185. // var list = res.data.Items
  186. uni.showToast({
  187. title: '取消成功',
  188. icon: 'none',
  189. duration: 2000
  190. });
  191. setTimeout(function() {
  192. that.getData();
  193. }, 1000);
  194. })
  195. } else if (res.cancel) {
  196. }
  197. }
  198. });
  199. },
  200. map() {
  201. console.log("打开地图")
  202. var that = this;
  203. if (!that.orderData.shopInfo.lat || !that.orderData.shopInfo.lng) {
  204. uni.showToast({
  205. title: '该店铺未设置定位',
  206. icon: 'none',
  207. duration: 3000
  208. });
  209. } else {
  210. uni.openLocation({
  211. latitude: Number(that.orderData.shopInfo.lat),
  212. longitude: Number(that.orderData.shopInfo.lng),
  213. name: that.orderData.shopInfo.shopName,
  214. address: that.orderData.shopInfo.provinceName + that.orderData.shopInfo.cityName + that
  215. .orderData.shopInfo.areaName + that.orderData.shopInfo.address,
  216. success: function() {
  217. console.log('success');
  218. },
  219. fail(err) {
  220. console.log(err)
  221. }
  222. });
  223. }
  224. },
  225. call() {
  226. uni.makePhoneCall({
  227. phoneNumber: this.orderData.shopInfo.mobilePhone
  228. });
  229. },
  230. getData() {
  231. uni.showLoading({
  232. title: '加载中'
  233. });
  234. this.$http('openOrderManagement/queryOpenSheet', {
  235. id: this.id,
  236. }, 'GET').then(res => {
  237. uni.hideLoading();
  238. this.orderData = res.data;
  239. if (this.quanMaList) {
  240. this.quanMaList = [];
  241. }
  242. let maList = this.orderData.OpenSheetQRCode;
  243. if (maList) {
  244. maList.forEach(item => {
  245. if (item.writeoffState == 1) {
  246. this.quanMaList.push(item.qrCode);
  247. }
  248. })
  249. }
  250. console.log('可用券码--', this.quanMaList);
  251. })
  252. },
  253. goback() {
  254. uni.navigateBack({
  255. delta: 1
  256. })
  257. },
  258. gohome() {
  259. uni.switchTab({
  260. url: '../index/index'
  261. })
  262. },
  263. },
  264. onPullDownRefresh() {
  265. this.getData()
  266. setTimeout(function() {
  267. uni.stopPullDownRefresh();
  268. }, 1000);
  269. },
  270. }
  271. </script>
  272. <style scoped>
  273. .box {
  274. min-height: 100vh;
  275. background: #F4F5F7;
  276. padding-bottom: 135rpx;
  277. }
  278. .zdyNavBox {
  279. width: 100vw;
  280. background: #FFFFFF;
  281. position: fixed;
  282. top: 0;
  283. left: 0;
  284. z-index: 9999999;
  285. }
  286. .zdyNav {
  287. height: 44px;
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. }
  292. .backImg {
  293. width: 44rpx;
  294. height: 44rpx;
  295. margin-left: 10rpx;
  296. margin-right: 20rpx;
  297. }
  298. .homeImg {
  299. width: 44rpx;
  300. height: 44rpx;
  301. }
  302. .zdyNavLeft {
  303. display: flex;
  304. align-items: center;
  305. }
  306. .zdyNavTitle {
  307. width: 100vw;
  308. height: 44px;
  309. background: #FFFFFF;
  310. text-align: center;
  311. font-size: 34rpx;
  312. line-height: 44px;
  313. }
  314. .top {
  315. height: 190rpx;
  316. background-color: #FF0000;
  317. }
  318. .orderState {
  319. display: flex;
  320. justify-content: center;
  321. align-items: center;
  322. padding-top: 40rpx;
  323. }
  324. .SheetState {
  325. display: flex;
  326. justify-content: center;
  327. font-size: 36rpx;
  328. font-weight: 500;
  329. color: #FFFFFF;
  330. margin-left: 15rpx;
  331. }
  332. .orderTop {
  333. background: #FFFFFF;
  334. border-radius: 10rpx;
  335. margin: 20rpx 24rpx;
  336. }
  337. .timeLeft {
  338. font-size: 32rpx;
  339. color: #3C3C3C;
  340. }
  341. .timeRight {
  342. font-size: 26rpx;
  343. color: #3F90F7;
  344. }
  345. .rightShou {
  346. display: flex;
  347. justify-content: flex-start;
  348. align-items: center;
  349. }
  350. .maBox {
  351. display: flex;
  352. justify-content: space-between;
  353. padding: 24rpx 20rpx;
  354. }
  355. .querenMa {
  356. margin: 20rpx 0;
  357. padding-bottom: 30rpx;
  358. }
  359. .maBoximg {
  360. width: 308rpx;
  361. height: 308rpx;
  362. margin: 30rpx 197rpx;
  363. }
  364. .timeEditImg {
  365. width: 25rpx;
  366. height: 25rpx;
  367. padding-left: 20rpx;
  368. }
  369. .shopBoximg {
  370. width: 40rpx;
  371. height: 40rpx;
  372. }
  373. .shopRightImg {
  374. width: 44rpx;
  375. height: 45rpx;
  376. }
  377. .shopsx {
  378. width: 1px;
  379. height: 50rpx;
  380. background: #EEEEEE;
  381. margin-top: 30rpx;
  382. margin-left: 28rpx;
  383. }
  384. .shopBox {
  385. display: flex;
  386. padding: 30rpx 20rpx;
  387. margin: 0rpx 24rpx;
  388. margin-top: -60rpx;
  389. background-color: #FFFFFF;
  390. border-radius: 10rpx;
  391. }
  392. .shopCont {
  393. width: 405rpx;
  394. padding-left: 20rpx;
  395. }
  396. .shopName {
  397. font-size: 30rpx;
  398. font-weight: bold;
  399. color: #3C3C3C;
  400. line-height: 42rpx;
  401. }
  402. .Address {
  403. color: #999999;
  404. font-size: 24rpx;
  405. margin-top: 10rpx;
  406. }
  407. .shopRihgtTxt {
  408. color: #999999;
  409. font-size: 24rpx;
  410. }
  411. .shopRightBox {
  412. padding-left: 28rpx;
  413. }
  414. .detailedTitle {
  415. padding: 23rpx 20rpx;
  416. display: flex;
  417. text-align: center;
  418. align-content: flex-start;
  419. border-bottom: 1rpx solid #EEEEEE;
  420. font-size: 30rpx;
  421. font-weight: bold;
  422. color: #3C3C3C;
  423. }
  424. .detailedLine {
  425. display: flex;
  426. padding: 16rpx 20rpx;
  427. justify-content: space-between;
  428. align-items: center;
  429. }
  430. .detailedImg {
  431. width: 120rpx;
  432. height: 120rpx;
  433. border-radius: 10rpx;
  434. }
  435. .detailedName {
  436. display: flex;
  437. align-items: center;
  438. }
  439. .code {
  440. font-size: 26rpx;
  441. color: #333333;
  442. font-weight: bold;
  443. width: 180rpx
  444. }
  445. .old {
  446. color: #999999;
  447. font-weight: 400;
  448. text-decoration: line-through;
  449. }
  450. .redPoint {
  451. width: 10rpx;
  452. height: 10rpx;
  453. background: #FF0000;
  454. border-radius: 10rpx;
  455. margin-right: 10rpx;
  456. }
  457. .quanState {
  458. font-size: 22rpx;
  459. color: #F19D01;
  460. padding: 0 10rpx;
  461. border: 1rpx solid #F19D01;
  462. border-radius: 4rpx;
  463. margin-left: 20rpx;
  464. }
  465. .quanState2 {
  466. font-size: 22rpx;
  467. color: #999999;
  468. padding: 0 10rpx;
  469. border: 1rpx solid #DDDDDD;
  470. border-radius: 4rpx;
  471. margin-left: 20rpx;
  472. }
  473. .information {
  474. background: #FFFFFF;
  475. border-radius: 10rpx;
  476. margin: 20rpx 24rpx;
  477. padding-bottom: 15rpx;
  478. }
  479. .goodsBox {
  480. display: flex;
  481. padding: 30rpx 0;
  482. border-bottom: 1rpx solid #EEEEEE;
  483. }
  484. .goodsRight {
  485. margin-left: 20rpx;
  486. display: flex;
  487. flex-direction: column;
  488. justify-content: space-between;
  489. }
  490. .goodsName {
  491. width: 522rpx;
  492. font-size: 26rpx;
  493. font-weight: 400;
  494. color: #3C3C3C;
  495. line-height: 37rpx;
  496. margin-bottom: 15rpx;
  497. }
  498. .goodsCount {
  499. display: flex;
  500. justify-content: space-between;
  501. align-items: center;
  502. }
  503. .jifen {
  504. height: 45rpx;
  505. font-size: 32rpx;
  506. font-weight: 500;
  507. color: #333333;
  508. line-height: 45rpx;
  509. }
  510. .count {
  511. height: 33rpx;
  512. font-size: 24rpx;
  513. font-weight: 400;
  514. color: #999999;
  515. line-height: 33rpx;
  516. }
  517. .sum {
  518. margin-top: 34rpx;
  519. display: flex;
  520. justify-content: flex-end;
  521. align-items: center;
  522. }
  523. .informationLine {
  524. display: flex;
  525. padding: 15rpx 20rpx;
  526. }
  527. .informationLine2 {
  528. display: flex;
  529. justify-content: space-between;
  530. font-size: 26rpx;
  531. padding: 0 20rpx;
  532. }
  533. .salePrice {
  534. font-size: 26rpx;
  535. font-weight: 500;
  536. color: #333333;
  537. line-height: 45rpx;
  538. }
  539. .informationTxt {
  540. width: 190rpx;
  541. font-size: 26rpx;
  542. color: #999999;
  543. }
  544. .line {
  545. height: 20rpx;
  546. background-color: #FFFFFF;
  547. border-bottom: 1rpx solid #EEEEEE;
  548. }
  549. .goodsName {
  550. padding: 20rpx 20rpx 15rpx;
  551. color: #333333;
  552. font-size: 26rpx;
  553. }
  554. .informationNum {
  555. color: #333333;
  556. font-size: 26rpx;
  557. }
  558. .codeCopy {
  559. width: 77rpx;
  560. height: 36rpx;
  561. background: #F4F5F7;
  562. border-radius: 22rpx;
  563. font-size: 24rpx;
  564. color: #333333;
  565. text-align: center;
  566. line-height: 33rpx;
  567. padding: 0 15rpx;
  568. margin-left: 20rpx;
  569. }
  570. .orderBottom {
  571. width: 750rpx;
  572. height: 98rpx;
  573. background: #FFFFFF;
  574. position: fixed;
  575. left: 0;
  576. bottom: 0;
  577. display: flex;
  578. justify-content: flex-end;
  579. }
  580. .bottom {
  581. display: flex;
  582. justify-content: flex-end;
  583. padding: 20rpx;
  584. background-color: #FFFFFF;
  585. align-items: center;
  586. height: 98rpx;
  587. width: 100vw;
  588. position: fixed;
  589. bottom: 0rpx;
  590. padding-bottom: constant(safe-area-inset-bottom);
  591. padding-bottom: env(safe-area-inset-bottom);
  592. }
  593. .cancel {
  594. color: #3C3C3C;
  595. font-size: 28rpx;
  596. width: 150rpx;
  597. height: 56rpx;
  598. border-radius: 36rpx;
  599. border: 1rpx solid #DDDDDD;
  600. text-align: center;
  601. line-height: 56rpx;
  602. margin-right: 40rpx;
  603. }
  604. .defer {
  605. color: #D53533;
  606. font-size: 28rpx;
  607. width: 150rpx;
  608. height: 56rpx;
  609. border-radius: 36rpx;
  610. border: 1rpx solid #D53533;
  611. text-align: center;
  612. line-height: 56rpx;
  613. margin-right: 40rpx;
  614. }
  615. .itemBox {
  616. margin: 20rpx;
  617. border-radius: 10rpx;
  618. border: 2rpx solid #EEEEEE;
  619. }
  620. .itemTop {
  621. padding: 18rpx 20rpx;
  622. padding-right: 0;
  623. background-color: #FFEFD5;
  624. display: flex;
  625. justify-content: space-between;
  626. align-content: center;
  627. }
  628. .topTitle {
  629. width: 104rpx;
  630. font-size: 26rpx;
  631. color: #333333;
  632. margin-right: 20rpx;
  633. text-align: right;
  634. }
  635. .leftItem {
  636. font-size: 26rpx;
  637. color: #333333;
  638. margin-right: 20rpx;
  639. flex-grow: 1;
  640. /* 隐藏文字显示 ...不换行 */
  641. overflow: hidden;
  642. text-overflow: ellipsis;
  643. white-space: nowrap;
  644. }
  645. .itemContent {
  646. padding: 20rpx;
  647. padding-right: 0;
  648. background-color: #FFFFFF;
  649. display: flex;
  650. justify-content: space-between;
  651. align-content: center;
  652. }
  653. .maBox {
  654. width: 100%;
  655. height: 100vh;
  656. background: rgba(0, 0, 0, 0.4);
  657. position: fixed;
  658. left: 0;
  659. top: 0;
  660. z-index: 9999;
  661. }
  662. .querenMa {
  663. width: 578;
  664. height: 640rpx;
  665. background: #ffffff;
  666. margin: 0 86rpx;
  667. margin-top: 50%;
  668. border-radius: 24rpx;
  669. }
  670. .maTop {
  671. display: flex;
  672. justify-content: space-between;
  673. align-items: center;
  674. padding: 30rpx 20rpx 15rpx;
  675. }
  676. .maTitle {
  677. color: #666666;
  678. font-size: 26rpx;
  679. text-align: center;
  680. padding-left: 100rpx;
  681. }
  682. .swiper {
  683. width: 100%;
  684. height: 85%;
  685. background: #FFFFFF;
  686. }
  687. .swiper-item {
  688. width: 100%;
  689. height: 100%;
  690. }
  691. .maCode {
  692. font-size: 30rpx;
  693. font-weight: 500;
  694. color: #333333;
  695. line-height: 42rpx;
  696. margin-bottom: 40rpx;
  697. text-align: center;
  698. }
  699. .maBoximg {
  700. width: 400rpx;
  701. height: 400rpx;
  702. margin-left: 86rpx;
  703. }
  704. </style>