recordDetail.vue 16 KB

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