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" :style="{background:'#'+themeColor}">
  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. themeColor:'',
  149. }
  150. },
  151. onLoad(opt) {
  152. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  153. this.id = opt.id
  154. this.SheetType = opt.SheetType
  155. this.themeColor = uni.getStorageSync("themeColor");
  156. if (this.id) {
  157. this.getData()
  158. }
  159. },
  160. methods: {
  161. showMa() {
  162. this.isShowMa = !this.isShowMa
  163. },
  164. copy(txt) {
  165. uni.setClipboardData({
  166. data: txt,
  167. success: function() {
  168. uni.showToast({
  169. title: '复制成功',
  170. icon: 'none',
  171. duration: 2000
  172. });
  173. }
  174. });
  175. },
  176. cancelBespeak() {
  177. var that = this
  178. uni.showModal({
  179. title: '提示',
  180. content: '是否取消该订单',
  181. cancelText: '否',
  182. confirmText: '是',
  183. success: function(res) {
  184. if (res.confirm) {
  185. uni.showLoading({
  186. title: '加载中'
  187. })
  188. that.$http('openIntegralMall/cancelExchange', {
  189. id: that.id,
  190. }, 'POST').then(res => {
  191. uni.hideLoading();
  192. // var list = res.data.Items
  193. uni.showToast({
  194. title: '取消成功',
  195. icon: 'none',
  196. duration: 2000
  197. });
  198. //setTimeout(function() {
  199. that.getData();
  200. //}, 1000);
  201. })
  202. } else if (res.cancel) {
  203. }
  204. }
  205. });
  206. },
  207. map() {
  208. console.log("打开地图")
  209. var that = this;
  210. if (!that.orderData.shopInfo.lat || !that.orderData.shopInfo.lng) {
  211. uni.showToast({
  212. title: '该店铺未设置定位',
  213. icon: 'none',
  214. duration: 3000
  215. });
  216. } else {
  217. uni.openLocation({
  218. latitude: Number(that.orderData.shopInfo.lat),
  219. longitude: Number(that.orderData.shopInfo.lng),
  220. name: that.orderData.shopInfo.shopName,
  221. address: that.orderData.shopInfo.provinceName + that.orderData.shopInfo.cityName + that
  222. .orderData.shopInfo.areaName + that.orderData.shopInfo.address,
  223. success: function() {
  224. console.log('success');
  225. },
  226. fail(err) {
  227. console.log(err)
  228. }
  229. });
  230. }
  231. },
  232. call() {
  233. uni.makePhoneCall({
  234. phoneNumber: this.orderData.shopInfo.mobilePhone
  235. });
  236. },
  237. getData() {
  238. uni.showLoading({
  239. title: '加载中'
  240. });
  241. this.$http('openIntegralMall/exchangeDetail', {
  242. id: this.id,
  243. }, 'GET').then(res => {
  244. uni.hideLoading();
  245. this.orderData = res.data;
  246. })
  247. },
  248. goback() {
  249. uni.navigateBack({
  250. delta: 1
  251. })
  252. },
  253. gohome() {
  254. uni.switchTab({
  255. url: '../index/index'
  256. })
  257. },
  258. },
  259. onPullDownRefresh() {
  260. this.getData()
  261. setTimeout(function() {
  262. uni.stopPullDownRefresh();
  263. }, 1000);
  264. },
  265. }
  266. </script>
  267. <style scoped>
  268. .box {
  269. min-height: 100vh;
  270. background: #F4F5F7;
  271. padding-bottom: 135rpx;
  272. }
  273. .zdyNavBox {
  274. width: 100vw;
  275. background: #FFFFFF;
  276. position: fixed;
  277. top: 0;
  278. left: 0;
  279. z-index: 999;
  280. }
  281. .zdyNav {
  282. height: 44px;
  283. display: flex;
  284. justify-content: space-between;
  285. align-items: center;
  286. }
  287. .backImg {
  288. width: 50rpx;
  289. height: 50rpx;
  290. margin-left: 10rpx;
  291. margin-right: 20rpx;
  292. }
  293. .homeImg {
  294. width: 44rpx;
  295. height: 44rpx;
  296. }
  297. .zdyNavLeft {
  298. display: flex;
  299. align-items: center;
  300. }
  301. .zdyNavTitle {
  302. width: 100vw;
  303. height: 44px;
  304. background: #FFFFFF;
  305. text-align: center;
  306. font-size: 34rpx;
  307. line-height: 44px;
  308. }
  309. .top {
  310. height: 190rpx;
  311. background-color: #FF0000;
  312. }
  313. .orderState {
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. padding-top: 40rpx;
  318. }
  319. .SheetState {
  320. display: flex;
  321. justify-content: center;
  322. font-size: 36rpx;
  323. font-weight: 500;
  324. color: #FFFFFF;
  325. margin-left: 15rpx;
  326. }
  327. .orderTop {
  328. background: #FFFFFF;
  329. border-radius: 10rpx;
  330. margin: 20rpx 24rpx;
  331. margin-top: -60rpx;
  332. }
  333. .timeLeft {
  334. font-size: 30rpx;
  335. color: #3C3C3C;
  336. font-weight: 500;
  337. }
  338. .timeRight {
  339. font-size: 26rpx;
  340. color: #3F90F7;
  341. margin-right: 8rpx;
  342. }
  343. .rightShou {
  344. display: flex;
  345. justify-content: flex-start;
  346. align-items: center;
  347. }
  348. .maBox {
  349. display: flex;
  350. justify-content: space-between;
  351. padding: 26rpx 20rpx;
  352. }
  353. .querenMa {
  354. margin: 20rpx 0;
  355. padding-bottom: 30rpx;
  356. }
  357. .maBoximg {
  358. width: 308rpx;
  359. height: 308rpx;
  360. margin: 30rpx 197rpx;
  361. }
  362. .timeEditImg {
  363. width: 25rpx;
  364. height: 25rpx;
  365. padding-left: 20rpx;
  366. }
  367. .shopBoximg {
  368. width: 40rpx;
  369. height: 40rpx;
  370. }
  371. .shopRightImg {
  372. width: 44rpx;
  373. height: 45rpx;
  374. }
  375. .shopsx {
  376. width: 1px;
  377. height: 50rpx;
  378. background: #EEEEEE;
  379. margin-top: 30rpx;
  380. margin-left: 28rpx;
  381. }
  382. .shopBox {
  383. display: flex;
  384. padding: 30rpx 20rpx;
  385. margin: 0rpx 24rpx;
  386. background-color: #FFFFFF;
  387. border-radius: 10rpx;
  388. }
  389. .wuMa{
  390. margin-top: -60rpx;
  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 20rpx;
  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. padding-right: 20rpx;
  523. }
  524. .informationLine {
  525. display: flex;
  526. padding: 15rpx 20rpx;
  527. }
  528. .informationLine2 {
  529. display: flex;
  530. justify-content: space-between;
  531. font-size: 26rpx;
  532. padding: 0 20rpx;
  533. }
  534. .salePrice {
  535. font-size: 26rpx;
  536. font-weight: 500;
  537. color: #333333;
  538. line-height: 45rpx;
  539. }
  540. .informationTxt {
  541. width: 190rpx;
  542. font-size: 26rpx;
  543. color: #999999;
  544. }
  545. .line {
  546. height: 20rpx;
  547. background-color: #FFFFFF;
  548. border-bottom: 1rpx solid #EEEEEE;
  549. }
  550. .informationNum {
  551. color: #333333;
  552. font-size: 26rpx;
  553. }
  554. .codeCopy {
  555. width: 77rpx;
  556. height: 36rpx;
  557. background: #F4F5F7;
  558. border-radius: 22rpx;
  559. font-size: 24rpx;
  560. color: #333333;
  561. text-align: center;
  562. line-height: 33rpx;
  563. padding: 0 15rpx;
  564. margin-left: 20rpx;
  565. }
  566. .orderBottom {
  567. width: 750rpx;
  568. height: 98rpx;
  569. background: #FFFFFF;
  570. position: fixed;
  571. left: 0;
  572. bottom: 0;
  573. display: flex;
  574. justify-content: flex-end;
  575. }
  576. .bottom {
  577. display: flex;
  578. justify-content: flex-end;
  579. padding: 20rpx;
  580. background-color: #FFFFFF;
  581. align-items: center;
  582. height: 98rpx;
  583. width: 100vw;
  584. position: fixed;
  585. bottom: 0rpx;
  586. padding-bottom: constant(safe-area-inset-bottom);
  587. padding-bottom: env(safe-area-inset-bottom);
  588. }
  589. .cancel {
  590. color: #3C3C3C;
  591. font-size: 28rpx;
  592. width: 150rpx;
  593. height: 56rpx;
  594. border-radius: 36rpx;
  595. border: 1rpx solid #DDDDDD;
  596. text-align: center;
  597. line-height: 56rpx;
  598. margin-right: 40rpx;
  599. }
  600. .defer {
  601. color: #D53533;
  602. font-size: 28rpx;
  603. width: 150rpx;
  604. height: 56rpx;
  605. border-radius: 36rpx;
  606. border: 1rpx solid #D53533;
  607. text-align: center;
  608. line-height: 56rpx;
  609. margin-right: 40rpx;
  610. }
  611. .itemBox {
  612. margin: 20rpx;
  613. border-radius: 10rpx;
  614. border: 2rpx solid #EEEEEE;
  615. }
  616. .itemTop {
  617. padding: 18rpx 20rpx;
  618. padding-right: 0;
  619. background-color: #FFEFD5;
  620. display: flex;
  621. justify-content: space-between;
  622. align-content: center;
  623. }
  624. .topTitle {
  625. width: 104rpx;
  626. font-size: 26rpx;
  627. color: #333333;
  628. margin-right: 20rpx;
  629. text-align: right;
  630. }
  631. .leftItem {
  632. font-size: 26rpx;
  633. color: #333333;
  634. margin-right: 20rpx;
  635. flex-grow: 1;
  636. /* 隐藏文字显示 ...不换行 */
  637. overflow: hidden;
  638. text-overflow: ellipsis;
  639. white-space: nowrap;
  640. }
  641. .itemContent {
  642. padding: 20rpx;
  643. padding-right: 0;
  644. background-color: #FFFFFF;
  645. display: flex;
  646. justify-content: space-between;
  647. align-content: center;
  648. }
  649. </style>