mallOrderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  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="quanState2">已使用</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" v-if="orderData.projectList">
  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="topTitle2">{{item.flowQty}}</view>
  74. <view class="topTitle">{{item.date}}</view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- 商品 -->
  79. <view class="itemBox" v-if="orderData.shopList">
  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="topTitle2">{{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: 0 20rpx 15rpx;
  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. .quanState2{
  438. font-size: 22rpx;
  439. color: #999999;
  440. padding: 0 10rpx;
  441. border: 1rpx solid #DDDDDD;
  442. border-radius: 4rpx;
  443. margin-left: 20rpx;
  444. }
  445. .information {
  446. background: #FFFFFF;
  447. border-radius: 10rpx;
  448. margin: 20rpx 24rpx;
  449. padding-bottom: 15rpx;
  450. }
  451. .informationLine {
  452. display: flex;
  453. padding: 15rpx 20rpx;
  454. }
  455. .informationLine2 {
  456. display: flex;
  457. justify-content: space-between;
  458. font-size: 26rpx;
  459. padding: 0 20rpx;
  460. }
  461. .salePrice {
  462. font-size: 32rpx;
  463. font-weight: 500;
  464. color: #333333;
  465. line-height: 45rpx;
  466. }
  467. .money {
  468. background: #FFFFFF;
  469. border-radius: 10rpx;
  470. margin: 20rpx 24rpx;
  471. display: flex;
  472. justify-content: space-between;
  473. font-size: 26rpx;
  474. padding: 30rpx 20rpx;
  475. }
  476. .informationTxt {
  477. width: 190rpx;
  478. font-size: 26rpx;
  479. color: #999999;
  480. }
  481. .line {
  482. height: 20rpx;
  483. background-color: #FFFFFF;
  484. border-bottom: 1rpx solid #EEEEEE;
  485. }
  486. .goodsName {
  487. padding: 20rpx 20rpx 15rpx;
  488. color: #333333;
  489. font-size: 26rpx;
  490. }
  491. .informationNum {
  492. color: #333333;
  493. font-size: 26rpx;
  494. }
  495. .codeCopy {
  496. width: 77rpx;
  497. height: 36rpx;
  498. background: #F4F5F7;
  499. border-radius: 22rpx;
  500. font-size: 24rpx;
  501. color: #333333;
  502. text-align: center;
  503. line-height: 33rpx;
  504. padding: 0 15rpx;
  505. }
  506. .orderBottom {
  507. width: 750rpx;
  508. height: 98rpx;
  509. background: #FFFFFF;
  510. position: fixed;
  511. left: 0;
  512. bottom: 0;
  513. display: flex;
  514. justify-content: flex-end;
  515. }
  516. .bottom {
  517. display: flex;
  518. justify-content: flex-end;
  519. padding: 20rpx;
  520. background-color: #FFFFFF;
  521. align-items: center;
  522. height: 98rpx;
  523. width: 100vw;
  524. position: fixed;
  525. bottom: 0rpx;
  526. padding-bottom: constant(safe-area-inset-bottom);
  527. padding-bottom: env(safe-area-inset-bottom);
  528. }
  529. .cancel {
  530. color: #3C3C3C;
  531. font-size: 28rpx;
  532. width: 150rpx;
  533. height: 56rpx;
  534. border-radius: 36rpx;
  535. border: 1rpx solid #DDDDDD;
  536. text-align: center;
  537. line-height: 56rpx;
  538. margin-right: 40rpx;
  539. }
  540. .defer {
  541. color: #D53533;
  542. font-size: 28rpx;
  543. width: 150rpx;
  544. height: 56rpx;
  545. border-radius: 36rpx;
  546. border: 1rpx solid #D53533;
  547. text-align: center;
  548. line-height: 56rpx;
  549. margin-right: 40rpx;
  550. }
  551. .itemBox {
  552. margin: 20rpx;
  553. border-radius: 10rpx;
  554. border: 2rpx solid #EEEEEE;
  555. }
  556. .itemTop {
  557. padding: 18rpx 20rpx;
  558. background-color: #FFEFD5;
  559. display: flex;
  560. justify-content: space-between;
  561. align-content: center;
  562. }
  563. .topTitle {
  564. font-size: 26rpx;
  565. color: #333333;
  566. margin-right: 10rpx;
  567. }
  568. .topTitle2{
  569. font-size: 26rpx;
  570. color: #333333;
  571. margin-right: 40rpx;
  572. }
  573. .leftItem {
  574. flex-grow: 1;
  575. }
  576. .itemContent {
  577. padding: 20rpx;
  578. background-color: #FFFFFF;
  579. display: flex;
  580. justify-content: space-between;
  581. align-content: center;
  582. }
  583. .maBox {
  584. width: 100%;
  585. height: 100vh;
  586. background: rgba(0, 0, 0, 0.4);
  587. position: fixed;
  588. left: 0;
  589. top: 0;
  590. z-index: 9999;
  591. }
  592. .querenMa {
  593. width: 578;
  594. height: 640rpx;
  595. background: #ffffff;
  596. margin: 0 86rpx;
  597. margin-top: 50%;
  598. border-radius: 24rpx;
  599. }
  600. .maTop {
  601. display: flex;
  602. justify-content: space-between;
  603. align-items: center;
  604. padding: 30rpx 20rpx 15rpx;
  605. }
  606. .maTitle {
  607. color: #666666;
  608. font-size: 26rpx;
  609. text-align: center;
  610. padding-left: 100rpx;
  611. }
  612. .maCode {
  613. font-size: 30rpx;
  614. font-weight: 500;
  615. color: #333333;
  616. line-height: 42rpx;
  617. margin-bottom: 40rpx;
  618. text-align: center;
  619. }
  620. .maBoximg {
  621. width: 400rpx;
  622. height: 400rpx;
  623. margin-left: 86rpx;
  624. }
  625. </style>