mallOrderDetail.vue 16 KB

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