mallOrderDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  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. pay(){
  204. this.$http('openMallOrder/unifiedPay', {
  205. sheetId:this.id
  206. },'POST').then(res => {
  207. if(res.code==0){
  208. this.requestPayment(res.data)
  209. }else{
  210. uni.showToast({
  211. title: res.msg,
  212. icon: 'none',
  213. duration: 3000
  214. });
  215. }
  216. })
  217. },
  218. requestPayment(res){
  219. var payInfo=res;
  220. //console.log(payInfo)
  221. //console.log(String(Date.now()))
  222. var that=this;
  223. uni.requestPayment({
  224. provider: 'wxpay',
  225. //timeStamp: String(Date.now()),
  226. timeStamp: payInfo.timeStamp,
  227. nonceStr: payInfo.nonceStr,
  228. package:payInfo.package,
  229. signType: payInfo.signType,
  230. paySign: payInfo.paySign,
  231. appid:payInfo.appId,
  232. success: function (res) {
  233. console.log('success:' + JSON.stringify(res));
  234. uni.showToast({
  235. title: '支付成功',
  236. icon:'none',
  237. duration: 2000
  238. });
  239. that.getData()
  240. },
  241. fail: function (err) {
  242. console.log(err)
  243. uni.showToast({
  244. title: '支付失败',
  245. icon:'none',
  246. duration: 2000
  247. });
  248. }
  249. });
  250. },
  251. copy(txt) {
  252. uni.setClipboardData({
  253. data: txt,
  254. success: function() {
  255. uni.showToast({
  256. title: '复制成功',
  257. icon: 'none',
  258. duration: 2000
  259. });
  260. }
  261. });
  262. },
  263. upTime() {
  264. uni.showLoading({
  265. title: '加载中'
  266. })
  267. var that = this
  268. this.$http('openreservation/carOwner/updateTimeOfAppointment', {
  269. id: this.id,
  270. shopId: this.orderData.shopInfo.id,
  271. billDate: this.billDate
  272. }, 'POST').then(res => {
  273. uni.hideLoading();
  274. // var list = res.data.Items
  275. var list = res.data
  276. console.log("result+=", res.data);
  277. uni.showToast({
  278. title: '延期成功',
  279. icon: 'none',
  280. duration: 2000
  281. });
  282. setTimeout(function() {
  283. that.getData();
  284. }, 1000);
  285. })
  286. },
  287. cancelBespeak() {
  288. uni.showLoading({
  289. title: '加载中'
  290. })
  291. var that = this
  292. this.$http('openOrderManagement/updateSheetState', {
  293. id: this.id,
  294. }, 'POST').then(res => {
  295. uni.hideLoading();
  296. // var list = res.data.Items
  297. var list = res.data
  298. uni.showToast({
  299. title: '取消成功',
  300. icon: 'none',
  301. duration: 2000
  302. });
  303. setTimeout(function() {
  304. that.getData();
  305. }, 1000);
  306. })
  307. },
  308. map() {
  309. console.log("打开地图")
  310. var that = this;
  311. if (!that.orderData.shopInfo.lat || !that.orderData.shopInfo.lng) {
  312. uni.showToast({
  313. title: '该店铺未设置定位',
  314. icon: 'none',
  315. duration: 3000
  316. });
  317. } else {
  318. uni.openLocation({
  319. latitude: Number(that.orderData.shopInfo.lat),
  320. longitude: Number(that.orderData.shopInfo.lng),
  321. name: that.orderData.shopInfo.shopName,
  322. address: that.orderData.shopInfo.provinceName + that.orderData.shopInfo.cityName + that
  323. .orderData.shopInfo.areaName + that.orderData.shopInfo.address,
  324. success: function() {
  325. console.log('success');
  326. },
  327. fail(err) {
  328. console.log(err)
  329. }
  330. });
  331. }
  332. },
  333. call() {
  334. uni.makePhoneCall({
  335. phoneNumber: this.orderData.shopInfo.mobilePhone
  336. });
  337. },
  338. getData() {
  339. uni.showLoading({
  340. title: '加载中'
  341. });
  342. this.$http('openOrderManagement/queryOpenSheet', {
  343. id: this.id,
  344. }, 'GET').then(res => {
  345. uni.hideLoading();
  346. this.orderData = res.data;
  347. })
  348. },
  349. goback() {
  350. uni.navigateBack({})
  351. },
  352. },
  353. onPullDownRefresh() {
  354. this.getData()
  355. setTimeout(function() {
  356. uni.stopPullDownRefresh();
  357. }, 1000);
  358. },
  359. }
  360. </script>
  361. <style scoped>
  362. .box {
  363. min-height: 100vh;
  364. background: #F4F5F7;
  365. padding-bottom: 135rpx;
  366. }
  367. .top {
  368. height: 190rpx;
  369. background-color: #FF0000;
  370. }
  371. .orderState {
  372. display: flex;
  373. justify-content: center;
  374. align-items: center;
  375. padding-top: 40rpx;
  376. }
  377. .SheetState {
  378. display: flex;
  379. justify-content: center;
  380. font-size: 36rpx;
  381. font-weight: 500;
  382. color: #FFFFFF;
  383. margin-left: 15rpx;
  384. }
  385. .timeEditImg {
  386. width: 25rpx;
  387. height: 25rpx;
  388. padding-left: 20rpx;
  389. }
  390. .shopBoximg {
  391. width: 40rpx;
  392. height: 40rpx;
  393. }
  394. .shopRightImg {
  395. width: 44rpx;
  396. height: 45rpx;
  397. }
  398. .shopsx {
  399. width: 1px;
  400. height: 50rpx;
  401. background: #EEEEEE;
  402. margin-top: 30rpx;
  403. margin-left: 28rpx;
  404. }
  405. .shopBox {
  406. display: flex;
  407. padding: 30rpx 20rpx;
  408. margin: 0rpx 24rpx;
  409. margin-top: -60rpx;
  410. background-color: #FFFFFF;
  411. border-radius: 10rpx;
  412. }
  413. .shopCont {
  414. width: 405rpx;
  415. padding-left: 20rpx;
  416. }
  417. .shopName {
  418. font-size: 30rpx;
  419. font-weight: bold;
  420. color: #3C3C3C;
  421. line-height: 42rpx;
  422. }
  423. .Address {
  424. color: #999999;
  425. font-size: 24rpx;
  426. margin-top: 10rpx;
  427. }
  428. .shopRihgtTxt {
  429. color: #999999;
  430. font-size: 24rpx;
  431. }
  432. .shopRightBox {
  433. padding-left: 28rpx;
  434. }
  435. .detailedTitle {
  436. padding: 23rpx 20rpx;
  437. display: flex;
  438. text-align: center;
  439. align-content: flex-start;
  440. border-bottom: 1rpx solid #EEEEEE;
  441. font-size: 30rpx;
  442. font-weight: bold;
  443. color: #3C3C3C;
  444. }
  445. .detailedLine {
  446. display: flex;
  447. padding: 0 20rpx 15rpx;
  448. justify-content: space-between;
  449. align-items: center;
  450. }
  451. .detailedImg {
  452. width: 120rpx;
  453. height: 120rpx;
  454. border-radius: 10rpx;
  455. }
  456. .detailedName {
  457. display: flex;
  458. align-items: center;
  459. }
  460. .code {
  461. font-size: 26rpx;
  462. color: #333333;
  463. font-weight: bold;
  464. }
  465. .old {
  466. color: #999999;
  467. font-weight: 400;
  468. text-decoration: line-through;
  469. }
  470. .redPoint {
  471. width: 10rpx;
  472. height: 10rpx;
  473. background: #FF0000;
  474. border-radius: 10rpx;
  475. margin-right: 10rpx;
  476. }
  477. .quanState {
  478. font-size: 22rpx;
  479. color: #F19D01;
  480. padding: 0 10rpx;
  481. border: 1rpx solid #F19D01;
  482. border-radius: 4rpx;
  483. margin-left: 20rpx;
  484. }
  485. .quanState2{
  486. font-size: 22rpx;
  487. color: #999999;
  488. padding: 0 10rpx;
  489. border: 1rpx solid #DDDDDD;
  490. border-radius: 4rpx;
  491. margin-left: 20rpx;
  492. }
  493. .information {
  494. background: #FFFFFF;
  495. border-radius: 10rpx;
  496. margin: 20rpx 24rpx;
  497. padding-bottom: 15rpx;
  498. }
  499. .informationLine {
  500. display: flex;
  501. padding: 15rpx 20rpx;
  502. }
  503. .informationLine2 {
  504. display: flex;
  505. justify-content: space-between;
  506. font-size: 26rpx;
  507. padding: 0 20rpx;
  508. }
  509. .salePrice {
  510. font-size: 32rpx;
  511. font-weight: 500;
  512. color: #333333;
  513. line-height: 45rpx;
  514. }
  515. .money {
  516. background: #FFFFFF;
  517. border-radius: 10rpx;
  518. margin: 20rpx 24rpx;
  519. display: flex;
  520. justify-content: space-between;
  521. font-size: 26rpx;
  522. padding: 30rpx 20rpx;
  523. }
  524. .informationTxt {
  525. width: 190rpx;
  526. font-size: 26rpx;
  527. color: #999999;
  528. }
  529. .line {
  530. height: 20rpx;
  531. background-color: #FFFFFF;
  532. border-bottom: 1rpx solid #EEEEEE;
  533. }
  534. .goodsName {
  535. padding: 20rpx 20rpx 15rpx;
  536. color: #333333;
  537. font-size: 26rpx;
  538. }
  539. .informationNum {
  540. color: #333333;
  541. font-size: 26rpx;
  542. }
  543. .codeCopy {
  544. width: 77rpx;
  545. height: 36rpx;
  546. background: #F4F5F7;
  547. border-radius: 22rpx;
  548. font-size: 24rpx;
  549. color: #333333;
  550. text-align: center;
  551. line-height: 33rpx;
  552. padding: 0 15rpx;
  553. }
  554. .orderBottom {
  555. width: 750rpx;
  556. height: 98rpx;
  557. background: #FFFFFF;
  558. position: fixed;
  559. left: 0;
  560. bottom: 0;
  561. display: flex;
  562. justify-content: flex-end;
  563. }
  564. .bottom {
  565. display: flex;
  566. justify-content: flex-end;
  567. padding: 20rpx;
  568. background-color: #FFFFFF;
  569. align-items: center;
  570. height: 98rpx;
  571. width: 100vw;
  572. position: fixed;
  573. bottom: 0rpx;
  574. padding-bottom: constant(safe-area-inset-bottom);
  575. padding-bottom: env(safe-area-inset-bottom);
  576. }
  577. .cancel {
  578. color: #3C3C3C;
  579. font-size: 28rpx;
  580. width: 150rpx;
  581. height: 56rpx;
  582. border-radius: 36rpx;
  583. border: 1rpx solid #DDDDDD;
  584. text-align: center;
  585. line-height: 56rpx;
  586. margin-right: 40rpx;
  587. }
  588. .defer {
  589. color: #D53533;
  590. font-size: 28rpx;
  591. width: 150rpx;
  592. height: 56rpx;
  593. border-radius: 36rpx;
  594. border: 1rpx solid #D53533;
  595. text-align: center;
  596. line-height: 56rpx;
  597. margin-right: 40rpx;
  598. }
  599. .itemBox {
  600. margin: 20rpx;
  601. border-radius: 10rpx;
  602. border: 2rpx solid #EEEEEE;
  603. }
  604. .itemTop {
  605. padding: 18rpx 20rpx;
  606. background-color: #FFEFD5;
  607. display: flex;
  608. justify-content: space-between;
  609. align-content: center;
  610. }
  611. .topTitle {
  612. font-size: 26rpx;
  613. color: #333333;
  614. margin-right: 10rpx;
  615. }
  616. .topTitle2{
  617. font-size: 26rpx;
  618. color: #333333;
  619. margin-right: 40rpx;
  620. }
  621. .leftItem {
  622. flex-grow: 1;
  623. }
  624. .itemContent {
  625. padding: 20rpx;
  626. background-color: #FFFFFF;
  627. display: flex;
  628. justify-content: space-between;
  629. align-content: center;
  630. }
  631. .maBox {
  632. width: 100%;
  633. height: 100vh;
  634. background: rgba(0, 0, 0, 0.4);
  635. position: fixed;
  636. left: 0;
  637. top: 0;
  638. z-index: 9999;
  639. }
  640. .querenMa {
  641. width: 578;
  642. height: 640rpx;
  643. background: #ffffff;
  644. margin: 0 86rpx;
  645. margin-top: 50%;
  646. border-radius: 24rpx;
  647. }
  648. .maTop {
  649. display: flex;
  650. justify-content: space-between;
  651. align-items: center;
  652. padding: 30rpx 20rpx 15rpx;
  653. }
  654. .maTitle {
  655. color: #666666;
  656. font-size: 26rpx;
  657. text-align: center;
  658. padding-left: 100rpx;
  659. }
  660. .maCode {
  661. font-size: 30rpx;
  662. font-weight: 500;
  663. color: #333333;
  664. line-height: 42rpx;
  665. margin-bottom: 40rpx;
  666. text-align: center;
  667. }
  668. .maBoximg {
  669. width: 400rpx;
  670. height: 400rpx;
  671. margin-left: 86rpx;
  672. }
  673. </style>