orderDet.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240
  1. <template>
  2. <view class="orderDet" style="padding-bottom: 200upx;" v-if="XCXIsSelect !='否'">
  3. <view class="padding-sm">
  4. <view class="bg u--fillet-skeleton" style="border-radius:24rpx;position: relative;">
  5. <image style="width: 100%;height: 30rpx;position: absolute;left: 0;bottom: -10rpx;"
  6. src="@/static/img/line.png" mode=""></image>
  7. <view class="flex align-center padding" @click="getAddressList()">
  8. <view class="u-flex-1 margin-left-xs">
  9. <view v-if="!detailaddress">请选择地址</view>
  10. <view v-else>
  11. <view style="color: #333333;font-size: 32rpx;font-weight: bold;">{{name}}<text
  12. class="margin-left-sm">{{mobile}}</text>
  13. </view>
  14. <view class="" style="color: #999999;margin-top: 8rpx;">
  15. {{province}}/{{city}}/{{district}}/{{detailaddress}}
  16. </view>
  17. </view>
  18. </view>
  19. <u-icon name="arrow-right" color="#999999"></u-icon>
  20. </view>
  21. </view>
  22. <view class="bg radius margin-top u-skeleton-fillet" style="padding: 16rpx;">
  23. <view class="flex justify-around align-center">
  24. <view class="" style="width: 200rpx;height: 200rpx;">
  25. <image :src="artificerlist.massageImg" style="width: 100%;height: 100%;border-radius: 24upx;">
  26. </image>
  27. </view>
  28. <view class="u-flex-1 margin-left-sm">
  29. <view class="text-lg text-bold">
  30. {{artificerlist.title}}
  31. </view>
  32. <view class="flex justify-between margin-tb" style="color: #999999;">
  33. <view>
  34. <!-- <image src="../../../static/time.png"
  35. style="width: 26rpx;height: 26rpx;margin-right: 8rpx;"></image> -->
  36. 时长:{{artificerlist.duration}}分钟
  37. </view>
  38. <view>已售{{artificerlist.sales}}</view>
  39. </view>
  40. <!-- <view class="flex justify-between">
  41. <view class=" text-df" style="color: #FF1200;">
  42. ¥<text class=" text-xl text-bold">{{artificerlist.price}}</text>
  43. <text v-if="hyCheck != '否'">/</text><text v-if="hyCheck != '否'"
  44. class="text-sm">会员价:¥{{artificerlist.memberPrice}}</text>
  45. </view>
  46. <view>
  47. <u-number-box v-model="number" @change="valChange" :min="1" :max="100"></u-number-box>
  48. </view>
  49. </view> -->
  50. </view>
  51. </view>
  52. <view class="flex justify-between"
  53. style="padding: 20rpx 0;border-top: 1rpx solid #F0F0F0;margin-top: 24rpx;">
  54. <view style="font-weight: bold;font-size: 40rpx;color: #FF6E98;x">
  55. <text v-if="hyCheck != '否'"><text style="font-size: 28rpx;">
  56. 会员价:¥</text>{{artificerlist.memberPrice}}</text>
  57. <text class=" text-xl text-bold"
  58. style="font-size: 24rpx;color: #AAAAAA;text-decoration: line-through;font-weight: 400;">原价¥{{artificerlist.price}}</text>
  59. </view>
  60. <!-- <view>¥{{price}}</view> -->
  61. <view>
  62. <u-number-box v-model="number" @change="valChange" :min="1" :max="100"></u-number-box>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="padding-sm bg radius u-skeleton-fillet margin-top-sm">
  67. <view class="flex justify-between align-center" style="padding: 0rpx 10rpx;line-height: 106upx;">
  68. <view class="text-30" style="width: 30%;">
  69. 服务技师
  70. </view>
  71. <view class="flex align-center">
  72. <text class="margin-right-xs">{{order.artificerName}}</text>
  73. <image :src="order.artificerImg" style="width: 48upx;height: 48upx;border-radius: 50%;"></image>
  74. </view>
  75. </view>
  76. <view class="xian"></view>
  77. <view class="flex align-center justify-between"
  78. style="height: 100rpx;line-height: 100rpx;padding: 0rpx 10rpx;">
  79. <view class="text-30" style="color: #1E1F31;width: 240upx;">预约时间</view>
  80. <view class="flex justify-between margin-tb-sm" @click="openData()">
  81. <view v-if="startTime">{{startTime}}</view>
  82. <view class="tetx-sm" style="color:#999999;" v-else>请选择预约时间</view>
  83. <u-icon name="arrow-right" color="#999999"></u-icon>
  84. </view>
  85. </view>
  86. <view class="xian" v-if="cxSel"></view>
  87. <view class="flex justify-between align-center" v-if="cxSel"
  88. style="height: 100rpx;line-height: 100rpx;padding: 0rpx 10rpx;">
  89. <view class="text-30" style="width: 30%;">
  90. 出行方式
  91. </view>
  92. <view class="flex align-center" style="color: #333333;font-size: 26rpx;align-items: center;">
  93. <view style="font-size: 28rpx;">
  94. <text v-if="tripWay == 1">公交</text>
  95. <text v-if="tripWay == 2">出租</text>
  96. <text v-if="tripWay == 3">免费</text>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- <view class="xian"></view> -->
  101. <view style="font-size: 24rpx;color: #AAAAAA;margin-left: 5rpx;" v-if="distances && cxSel">
  102. 全程{{distances}}公里,起步{{tripNum}}公里,起步价{{tripPrice}}元,超出每公里{{xuMoney}}元
  103. </view>
  104. <view class="flex justify-between align-center"
  105. style="height: 100rpx;line-height: 100rpx;padding: 0rpx 10rpx;"
  106. v-if="cheFei && cheFei > 0 && cxSel">
  107. <view class="text-30" style="width: 30%;">
  108. 车费
  109. </view>
  110. <view class="flex align-center" style="color: #999999;font-size: 22rpx;">
  111. <view class="text-bold" style="color: #FF6E98;font-size: 28rpx;">{{cheFei}}元</view>
  112. </view>
  113. </view>
  114. <view class="xian" v-if="CouponIssueList.length > 0"></view>
  115. <view class="flex align-center justify-between" v-if="CouponIssueList.length > 0"
  116. style="height: 100rpx;line-height: 100rpx;padding: 0rpx 10rpx;">
  117. <view class="text-30" style="color: #1E1F31;width: 240upx;">优惠券</view>
  118. <view class="flex justify-between margin-tb-sm" @click="showCoup">
  119. <view v-if="couponName">{{couponName}}</view>
  120. <view class="tetx-sm" style="color:#999999;" v-else>请选择优惠券</view>
  121. <u-icon name="arrow-right" color="#999999"></u-icon>
  122. </view>
  123. </view>
  124. <view class="xian"></view>
  125. <view class="margin-top-sm" style="padding: 0rpx 10rpx;">
  126. <view class="text-30">
  127. 备注
  128. </view>
  129. <view style="color: #999999;font-size: 22rpx;">
  130. <!-- <input v-model="beizhu" type="textarea" placeholder="请输入备注" maxlength="300" v-if="isTrues" />
  131. <input v-model="beizhu" type="textarea" placeholder="请输入备注" maxlength="300" :disabled="true"
  132. v-else /> -->
  133. <u-input v-model="beizhu" type="textarea" placeholder="请输入备注" :clearable="false" maxlength="300"
  134. :custom-style="boxStyle" />
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <!-- <view class="footer" style="font-size: 26upx;" @tap="isShowAgree">
  140. <view style="font-size: 26upx;display: flex;align-items: center;" class="cuIcon"
  141. :class="showAgree?'cuIcon-radiobox':'cuIcon-round'">
  142. <text>我已阅读并同意</text>
  143. <navigator url="/my/setting/about?id=391&name=下单协议" open-type="navigate">《下单协议》</navigator>
  144. </view>
  145. </view> -->
  146. <view class="text-white flex justify-between cu-bar foot bg"
  147. style="padding: 16rpx 32rpx;box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.09);border-radius: 32rpx 32rpx 0rpx 0rpx;"
  148. v-if="cxSel">
  149. <view style="color: #999999;">
  150. 合计:<text style="color: #FF6E98;font-size: 40rpx;font-weight: bold;">¥{{(price + cheFei).toFixed(2)}}</text>
  151. </view>
  152. <view class="">
  153. <u-button :custom-style="customStyle" @click="openpay()" shape="circle" :hair-line="false">确认预约
  154. </u-button>
  155. </view>
  156. </view>
  157. <!-- <view class="">
  158. {{dataRes}}
  159. </view> -->
  160. <u-skeleton :loading="loading" :animation="true" elColor='#FFFFFF' bgColor='#FFFFFF'></u-skeleton>
  161. <u-popup v-model="isTrue" mode="bottom">
  162. <view>
  163. <scroll-view scroll-y="true">
  164. <its-calendar :sta_num="0" :end_num="24" :int_num="msTimeDate" :msTimeList="msTimeList"
  165. @getTime="TimeData">
  166. </its-calendar>
  167. </scroll-view>
  168. </view>
  169. </u-popup>
  170. <!-- 支付方式 -->
  171. <u-popup v-model="showpay" mode="center" :closeable="closeable" width="560rpx" border-radius="14">
  172. <view class="popup_pay">
  173. <view style="background-color: #fff;">
  174. <view style="padding: 0 20upx;margin-bottom: 20rpx;margin-top: 60rpx;">
  175. <view
  176. style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
  177. v-for="(item,index) in openLists" :key='index'>
  178. <image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
  179. </image>
  180. <view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
  181. {{item.text}}
  182. </view>
  183. <radio-group name="openWay" style="margin-left: 45upx;" @tap.stop='selectWay(item)'>
  184. <label class="tui-radio">
  185. <radio color="#FF6E98" :checked="openWay === item.id ? true : false" />
  186. </label>
  187. </radio-group>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="pay_btn" @click="pay()">确认支付</view>
  192. </view>
  193. <!-- </view> -->
  194. </u-popup>
  195. <u-popup v-model="showCoupon" mode="bottom" border-radius="14" :closeable="true">
  196. <view
  197. style="width: 100%;height: 1000rpx;background: #f8f8f8;border-top-left-radius: 20upx;border-top-right-radius: 20upx;padding: 40upx;">
  198. <view style="width: 100%;text-align: center;font-size: 32rpx;color: #1a1a1a;">我的优惠券</view>
  199. <scroll-view scroll-y="true" style="height: 900rpx;">
  200. <view class="flex align-center justify-end">
  201. <view class="btnyouhui" @click="quxiao()">取消使用</view>
  202. </view>
  203. <view v-for="(item,index) in CouponIssueList" :key="index" class="bg padding radius"
  204. style="margin: 24upx 0upx;">
  205. <view class="flex justify-between">
  206. <view class="text-lg text-bold">{{item.couponName}}</view>
  207. <view class="text-lg" style="color: #FF130A;">¥<text
  208. class="text-df text-xxl">{{item.money}}</text>
  209. </view>
  210. </view>
  211. <view>{{item.endDate}}</view>
  212. <view style="width: 638upx;height: 2upx;border: 2upx dashed #E6E6E6;margin: 29upx auto;"></view>
  213. <view class="flex justify-between">
  214. <view style="color: #999999;">满{{item.minMoney}}元可用</view>
  215. <view class="btn" @tap="goFaBu(item)">立即使用</view>
  216. </view>
  217. </view>
  218. <!-- <view style="width: 100%;text-align: center;" v-for='(item,index) in CouponIssueList' :key='index'>
  219. <view
  220. style="background: #fcf3e8;width: 100%;height: 130rpx;border-radius: 10rpx;margin-top: 20rpx;">
  221. <view style="display: flex;color: #1a1a1a;width: 100%;">
  222. <view
  223. style="line-height: 130rpx;margin-left: 0rpx;font-size: 40rpx;color: #1a1a1a;font-weight: 600;width: 150rpx;">
  224. <text style="font-size: 20upx;">¥</text>{{item.money}}
  225. </view>
  226. <view style="margin-left: 20rpx;width: 50%;text-align: left;">
  227. <view style="margin-top: 25rpx;">
  228. {{item.couponName}}</view>
  229. <view style="margin-top: 10rpx;font-size: 26rpx;">满{{item.minMoney}}减{{item.money}}</view>
  230. </view>
  231. <view
  232. style="height: 105rpx;width: 2rpx;background: #1a1a1a;margin-left: 20rpx;margin-top: 15rpx;">
  233. </view>
  234. <view
  235. style="color: #1a1a1a;line-height: 130rpx;height: 130rpx;width: 145rpx;font-weight: 600;"
  236. @tap='goFaBu(item)'>立即使用</view>
  237. </view>
  238. </view>
  239. </view> -->
  240. </scroll-view>
  241. </view>
  242. </u-popup>
  243. <!-- <u-popup v-model="showpay" mode="bottom" :closeable="closeable" style="position: fixed;bottom: 0;"> -->
  244. <!-- <view style="width: 100%;height: 100vh;background: rgba(0,0,0,0.8);z-index: 991;position: absolute;top: 0;left: 0;" v-if="showpay" @touchmove.stop.prevent="moveHandle">
  245. <view class="popup_pay" >
  246. <view style="background-color: #fff;">
  247. <view style="width: 90%;margin: 0 auto;text-align: end;margin-top: 15px;" @tap.stop='close()'>
  248. <u-icon name="close-circle" size="40" color="#CCCCCC"></u-icon>
  249. </view>
  250. <view style="padding: 0 20upx;margin-bottom: 20rpx;">
  251. <view
  252. style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
  253. v-for="(item,index) in openLists" :key='index'>
  254. <image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
  255. </image>
  256. <view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
  257. {{item.text}}
  258. </view>
  259. <radio-group name="openWay" style="margin-left: 45upx;" @tap.stop='selectWay(item)'>
  260. <label class="tui-radio">
  261. <radio color="#2FB57A" :checked="openWay === item.id ? true : false" />
  262. </label>
  263. </radio-group>
  264. </view>
  265. </view>
  266. </view>
  267. <view class="pay_btn" @click="pay()">确认支付</view>
  268. </view>
  269. </view> -->
  270. <!-- </u-popup> -->
  271. <!-- <u-picker v-model="addshow" mode="region" @confirm="addData"></u-picker> -->
  272. </view>
  273. </template>
  274. <script>
  275. import itsCalendar from '@/components/its-calendar/its-calendar.vue';
  276. export default {
  277. components: {
  278. itsCalendar
  279. },
  280. data() {
  281. return {
  282. msTimeDate: 0,
  283. showAgree: true,
  284. hyCheck: '否',
  285. cxSel: true,
  286. CouponIssueList: [],
  287. couponName: '',
  288. couponId: '',
  289. couponMoney: 0,
  290. showCoupon: false,
  291. cheFei: 0,
  292. loading: true, // 是否显示骨架屏组件
  293. customStyle: {
  294. width: '214rpx',
  295. height: '100rpx',
  296. color: '#FFFFFF',
  297. background: "#FF6E98",
  298. border: '60rpx'
  299. },
  300. boxStyle: {
  301. height: '180rpx',
  302. color: '#000000',
  303. background: '#F6F6F6',
  304. padding: '20rpx 0 0 0',
  305. borderRadius: '16rpx',
  306. marginTop: '28rpx',
  307. padding: '24rpx'
  308. },
  309. value: '',
  310. remark: '',
  311. artificerId: '',
  312. order: [],
  313. isVip: false,
  314. // addshow: false,
  315. startTime: '',
  316. address: '',
  317. // detailAddress: '',
  318. name: '',
  319. phone: '',
  320. beizhu: '',
  321. price: 0,
  322. money: 0,
  323. number: 1,
  324. isTrue: false,
  325. artificerlist: [],
  326. latitude: '',
  327. longitude: '',
  328. massageTypeId: '',
  329. isVIP: false,
  330. showpay: false,
  331. openLists: [],
  332. openWay: 1,
  333. closeable: true,
  334. isTrues: true,
  335. XCXIsSelect: '否',
  336. tripWay: 0,
  337. msTimeList: [],
  338. detailaddress: '',
  339. province: '',
  340. city: '',
  341. district: '',
  342. name: '',
  343. mobile: '',
  344. addressId: '',
  345. chuxing: '',
  346. distances: '',
  347. tripNum: '',
  348. xuMoney: '',
  349. tripPrice: '',
  350. artificerMoney: 0,
  351. dataRes:null,
  352. }
  353. },
  354. onLoad(option) {
  355. if (this.$queue.getData('msTimeDate')) {
  356. this.msTimeDate = parseInt(this.$queue.getData('msTimeDate'));
  357. } else {
  358. this.msTimeDate = 60;
  359. }
  360. this.hyCheck = this.$queue.getData('hyCheck');
  361. console.log(option)
  362. this.artificerId = option.artificerId
  363. this.massageTypeId = option.massageTypeId
  364. if (option.tripWay) {
  365. this.tripWay = option.tripWay;
  366. }
  367. this.isVIP = uni.getStorageSync('isVIP')
  368. this.getDet()
  369. this.getordertherapist()
  370. this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
  371. var date = new Date();
  372. var year = date.getFullYear();
  373. let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt(
  374. date.getMonth()) + 1) // 当前月份
  375. let days = (date.getDate()) > 9 ? date.getDate() : "0" + date.getDate() //当前日期
  376. let fullDate = `${month}-${days}`
  377. let Time = year + '-' + fullDate
  378. this.yearsDate = Time;
  379. this.getMsTime(Time);
  380. this.getMoneyJiShi();
  381. // #ifdef APP
  382. this.openLists = [{
  383. image: '../../../static/images/icon_weixin.png',
  384. text: '微信支付',
  385. id: 2
  386. }, {
  387. image: '../../../static/images/zhifubao.png',
  388. text: '支付宝支付',
  389. id: 3
  390. }, {
  391. image: '../../../static/images/lingqian.png',
  392. text: '零钱支付',
  393. id: 1
  394. }],
  395. this.openWay = 2;
  396. // #endif
  397. // #ifdef MP-WEIXIN
  398. this.openLists = [{
  399. image: '../../../static/images/icon_weixin.png',
  400. text: '微信支付',
  401. id: 2
  402. }, {
  403. image: '../../../static/images/lingqian.png',
  404. text: '零钱支付',
  405. id: 1
  406. }],
  407. this.openWay = 2;
  408. // #endif
  409. // #ifdef H5
  410. this.openLists = [{
  411. image: '../../../static/images/icon_weixin.png',
  412. text: '微信支付',
  413. id: 2
  414. },
  415. // {
  416. // image: '../../../static/images/zhifubao.png',
  417. // text: '支付宝支付',
  418. // id: 3
  419. // }, {
  420. // image: '../../../static/images/lingqian.png',
  421. // text: '零钱支付',
  422. // id: 1
  423. // },
  424. ],
  425. this.openWay = 2;
  426. // #endif
  427. },
  428. onShow() {
  429. this.addressId = this.$queue.getData('EditAddress');
  430. if (this.addressId) {
  431. this.getAddressList(this.addressId);
  432. } else {
  433. this.addressMy()
  434. }
  435. },
  436. methods: {
  437. isShowAgree() {
  438. //是否选择协议
  439. this.showAgree = !this.showAgree;
  440. },
  441. getMoneyJiShi() {
  442. this.$Request.getT('/app/userMoney/selectUserMoneyArtificer?page=1&limit=1&artificerId=' + this
  443. .artificerId).then(res => {
  444. if (res.code == 0 && res.data) {
  445. if (res.data.list && res.data.list.length > 0) {
  446. this.artificerMoney = res.data.list[0].money ? res.data.list[0].money : 0
  447. }
  448. }
  449. });
  450. },
  451. getMsTime(artificerDate) {
  452. this.$Request.getT('/app/artificerTime/selectArtificerTimeListByArtificerId?artificerId=' + this
  453. .artificerId + '&artificerDate=' + artificerDate).then(res => {
  454. if (res.code == 0) {
  455. this.msTimeList = res.data;
  456. }
  457. })
  458. },
  459. quxiao() { //取消使用
  460. this.showCoupon = false;
  461. this.couponId = ''
  462. this.couponName = ''
  463. this.price = parseFloat(this.money) * parseFloat(this.number);
  464. },
  465. goFaBu(item) {
  466. this.showCoupon = false;
  467. this.couponName = '¥-' + item.money;
  468. this.couponMoney = item.money
  469. this.couponId = item.id;
  470. let money = parseFloat(this.money) * parseFloat(this.number);
  471. this.price = parseFloat(money) - parseFloat(item.money);
  472. },
  473. showCoup() {
  474. this.showCoupon = true;
  475. },
  476. getYHQList() {
  477. this.$Request.getT('/app/coupon/selectUserCouponList?page=1&limit=50&minMoney=' + this.price).then(res => {
  478. if (res.code == 0) {
  479. this.CouponIssueList = res.data.list;
  480. }
  481. });
  482. },
  483. getChuXing() {
  484. this.$Request.getT('/app/artificer/selectTaxiMoney?artificerId=' + this.artificerId + '&latitude=' + this
  485. .latitude + '&longitude=' + this.longitude).then(res => {
  486. // this.dataRes = res
  487. if (res.code == 0) {
  488. this.cheFei = res.data.taxiMoney ? res.data.taxiMoney : 0;
  489. // this.price = parseInt(this.price)+parseInt(this.cheFei).toFixed(2)
  490. this.distances = res.data.distances
  491. this.tripNum = res.data.tripNum
  492. this.xuMoney = res.data.xuMoney
  493. this.tripPrice = res.data.tripPrice
  494. this.cxSel = true;
  495. } else {
  496. this.cxSel = false;
  497. uni.showToast({
  498. title: '当前城市暂未开通,请切换城市',
  499. duration: 2000,
  500. icon: 'none'
  501. });
  502. }
  503. });
  504. },
  505. // 根据地址id查询地址
  506. getAddressList(addressId) {
  507. if (addressId) {
  508. this.$Request.getT('/app/address/selectAddressByAddressId?addressId=' + this.addressId).then(res => {
  509. console.log(res)
  510. if (res.code == 0) {
  511. this.name = res.data.name;
  512. this.mobile = res.data.phone;
  513. this.cityaddress = res.data.province + res.data.city + res.data.district;
  514. this.detailaddress = res.data.detailsAddress;
  515. this.isDefault = res.data.isDefault;
  516. this.userId = res.data.userId;
  517. this.latitude = res.data.latitude;
  518. this.longitude = res.data.longitude;
  519. this.province = res.data.province
  520. this.city = res.data.city
  521. this.district = res.data.district
  522. this.getChuXing();
  523. }
  524. // uni.hideLoading();
  525. });
  526. } else {
  527. uni.navigateTo({
  528. url: '../../../my/address/address?id=' + 1
  529. })
  530. }
  531. },
  532. // 获取默认地址
  533. addressMy() {
  534. this.$Request.getT('/app/address/selectAddressById').then(res => {
  535. console.log(res)
  536. if (res.code == 0) {
  537. this.name = res.data.name;
  538. this.mobile = res.data.phone;
  539. this.cityaddress = res.data.province + res.data.city + res.data.district;
  540. this.detailaddress = res.data.detailsAddress;
  541. this.isDefault = res.data.isDefault;
  542. this.userId = res.data.userId;
  543. this.latitude = res.data.latitude;
  544. this.longitude = res.data.longitude;
  545. this.province = res.data.province
  546. this.city = res.data.city
  547. this.district = res.data.district
  548. this.addressId = res.data.addressId
  549. this.getChuXing();
  550. // this.$queue.setData('EditAddress', res.data.addressId);
  551. }
  552. });
  553. },
  554. moveHandle() {},
  555. //关闭弹框
  556. close() {
  557. this.showpay = false
  558. this.isTrues = true
  559. },
  560. //支付选择
  561. selectWay: function(item) {
  562. this.openWay = item.id;
  563. },
  564. openData() {
  565. this.isTrue = true
  566. },
  567. // 时间段数据
  568. TimeData(e) {
  569. console.log(e, e.days)
  570. var date = new Date();
  571. var year = date.getFullYear();
  572. // if(this.msTimeList.length > 0){
  573. // let startTime = year + '-' + e.days + ' ' + e.hours
  574. // for (var i = 0; i < this.msTimeList.length; i++) {
  575. // let msTime = this.msTimeList[i].artificerDate + ' ' + this.msTimeList[i].artificerTime
  576. // if(startTime === msTime){
  577. // this.isTrue = false
  578. // uni.showModal({
  579. // title: '温馨提示',
  580. // content: '当前时段已被预约,请更换预约时段!',
  581. // showCancel: true,
  582. // cancelText: '取消',
  583. // confirmText: '确定',
  584. // success: res => {
  585. // if(res.confirm){
  586. // this.isTrue = true
  587. // }
  588. // }
  589. // });
  590. // return;
  591. // }
  592. // }
  593. // }else{
  594. this.startTime = year + '-' + e.days + ' ' + e.hours
  595. this.isTrue = false
  596. // }
  597. },
  598. valChange(e) {
  599. console.log('当前值为: ' + e.value)
  600. this.couponId = ''
  601. this.couponName = ''
  602. this.number = e.value
  603. this.price = parseFloat(parseFloat(parseFloat(e.value) * parseFloat(this.money)).toFixed(2));
  604. // this.money = e.value * this.price
  605. },
  606. //获取省市区
  607. city(latitude, longitude) {
  608. this.$Request.get("/app/Login/selectCity", {
  609. lat: latitude,
  610. lng: longitude
  611. }).then(res => {
  612. console.log(res)
  613. this.address = res.data.province + res.data.city + res.data.district
  614. console.log(this.address)
  615. });
  616. },
  617. bindData(index) {
  618. let that = this
  619. uni.chooseLocation({
  620. success: function(res) {
  621. console.log('位置名称:' + res.name);
  622. console.log('详细地址:' + res.address);
  623. console.log('纬度:' + res.latitude);
  624. console.log('经度:' + res.longitude);
  625. that.latitude = res.latitude
  626. that.longitude = res.longitude
  627. that.city(res.latitude, res.longitude)
  628. that.detailAddress = res.name
  629. }
  630. });
  631. },
  632. //服务项目详情
  633. getordertherapist() {
  634. let hyCheck = this.$queue.getData('hyCheck');
  635. if (hyCheck != '否') {
  636. this.isVip = uni.getStorageSync('isVIP')
  637. } else {
  638. this.isVip = false
  639. }
  640. this.$Request.get("/app/artificer/selectMassageTypeById", {
  641. massageTypeId: this.massageTypeId
  642. }).then(res => {
  643. if (res.code == 0) {
  644. console.log(this.isVip)
  645. if (this.isVip == false) {
  646. this.price = res.data.price
  647. this.money = res.data.price
  648. console.log(this.price, 1111111111)
  649. } else {
  650. this.price = res.data.memberPrice
  651. this.money = res.data.memberPrice
  652. console.log(this.price, 2222)
  653. }
  654. console.log(this.price)
  655. this.artificerlist = res.data
  656. this.getYHQList();
  657. }
  658. });
  659. },
  660. // 技师详情
  661. getDet() {
  662. this.$Request.get("/app/artificer/selectArtificerById", {
  663. artificerId: this.artificerId,
  664. }).then(res => {
  665. this.loading = false;
  666. if (res.code == 0) {
  667. this.order = res.data
  668. this.tripWay = res.data.tripWay
  669. } else {
  670. uni.showToast({
  671. title: res.msg,
  672. duration: 1000,
  673. icon: 'none'
  674. });
  675. }
  676. });
  677. },
  678. openpay() {
  679. console.log(5555555);
  680. if (!this.startTime) {
  681. uni.showToast({
  682. title: '请选择预约时间',
  683. icon: 'none',
  684. duration: 1000
  685. })
  686. return
  687. }
  688. if (!this.detailaddress) {
  689. uni.showToast({
  690. title: '请选择服务地址',
  691. icon: 'none',
  692. duration: 1000
  693. })
  694. return
  695. }
  696. // if (!this.detailAddress) {
  697. // uni.showToast({
  698. // title: '请输入门牌号',
  699. // icon: 'none',
  700. // duration: 1000
  701. // })
  702. // return
  703. // }
  704. if (!this.name) {
  705. uni.showToast({
  706. title: '请输入预定人真实姓名',
  707. icon: 'none',
  708. duration: 1000
  709. })
  710. return
  711. }
  712. if (!this.mobile) {
  713. uni.showToast({
  714. title: '请输入联系电话',
  715. icon: 'none',
  716. duration: 1000
  717. })
  718. return
  719. }
  720. let glsNum = this.$queue.getData('glsNum');
  721. if (parseFloat(this.distances) > parseFloat(glsNum)) {
  722. this.$queue.showToast('当前最大接单范围为' + glsNum + '公里,请重新选择地址信息!');
  723. return;
  724. }
  725. if (!this.showAgree) {
  726. this.$queue.showToast('请阅读并同意《下单协议》');
  727. return;
  728. }
  729. let that = this;
  730. if (this.artificerMoney && parseFloat(this.artificerMoney) >= parseFloat((this.price + this.cheFei))) {
  731. uni.showModal({
  732. title: '温馨提示',
  733. content: '是否从预存金额中直接扣除?',
  734. showCancel: true,
  735. cancelText: '取消',
  736. confirmText: '确认',
  737. success: res => {
  738. if (res.confirm) {
  739. let data = {
  740. address: that.province + '' + that.city + '' + that.district + '' +
  741. that.detailaddress,
  742. artificerId: that.artificerId,
  743. tripWay: that.tripWay,
  744. km: that.distances,
  745. ordersMassageList: [{
  746. massageId: that.massageTypeId,
  747. num: that.number,
  748. }],
  749. city: uni.getStorageSync('city'),
  750. price: that.money,
  751. couponId: that.couponId,
  752. payMoney: (that.price + that.cheFei),
  753. userId: uni.getStorageSync('userId'),
  754. serveTime: that.startTime,
  755. userName: that.name,
  756. phone: that.mobile,
  757. remark: that.beizhu,
  758. latitude: that.latitude,
  759. longitude: that.longitude
  760. }
  761. that.$Request.postJson("/app/artificer/insertOrders", data).then(res => {
  762. if (res.code == 0) {
  763. that.$queue.showLoading('支付中...')
  764. that.$Request.post("/app/artificer/payOrders", {
  765. ordersId: res.data.ordersId,
  766. }).then(ret => {
  767. uni.hideLoading();
  768. if (ret.code == 0) {
  769. uni.showToast({
  770. title: '支付成功',
  771. icon: 'none'
  772. })
  773. setTimeout(function() {
  774. uni.switchTab({
  775. url: '/pages/order/index'
  776. })
  777. }, 1000)
  778. } else {
  779. uni.showToast({
  780. title: ret.msg,
  781. icon: 'none'
  782. })
  783. }
  784. });
  785. } else {
  786. that.showpay = true
  787. that.isTrues = false
  788. }
  789. });
  790. } else {
  791. that.showpay = true
  792. that.isTrues = false
  793. }
  794. }
  795. });
  796. } else {
  797. that.showpay = true
  798. that.isTrues = false
  799. }
  800. },
  801. pay() {
  802. let that = this
  803. let data = {
  804. address: that.province + '' + that.city + '' + that.district + '' + that.detailaddress,
  805. artificerId: that.artificerId,
  806. ordersMassageList: [{
  807. massageId: that.massageTypeId,
  808. num: that.number,
  809. }],
  810. city: uni.getStorageSync('city'),
  811. price: that.money,
  812. tripWay: that.tripWay,
  813. km: that.distances,
  814. couponId: that.couponId,
  815. payMoney: (that.price + that.cheFei),
  816. userId: uni.getStorageSync('userId'),
  817. serveTime: that.startTime,
  818. userName: that.name,
  819. phone: that.mobile,
  820. remark: that.beizhu,
  821. latitude: that.latitude,
  822. longitude: that.longitude
  823. }
  824. that.$Request.postJson("/app/artificer/insertOrders", data).then(res => {
  825. that.showpay = false
  826. if (res.code == 0) {
  827. if (that.openWay == 1) { //零钱支付
  828. uni.showModal({
  829. title: '付款提示',
  830. content: '确认支付' + (that.price + that.cheFei) + '元吗?',
  831. success: function(re) {
  832. if (re.confirm) {
  833. that.$queue.showLoading('支付中...')
  834. // console.log('用户点击确定');
  835. that.$Request.post("/app/artificer/payOrders", {
  836. ordersId: res.data.ordersId,
  837. }).then(ret => {
  838. uni.hideLoading();
  839. if (ret.code == 0) {
  840. uni.showToast({
  841. title: '支付成功',
  842. icon: 'none'
  843. })
  844. setTimeout(function() {
  845. uni.switchTab({
  846. url: '/pages/order/index'
  847. })
  848. }, 1000)
  849. } else {
  850. uni.showToast({
  851. title: ret.msg,
  852. icon: 'none'
  853. })
  854. }
  855. });
  856. } else if (re.cancel) {
  857. uni.redirectTo({
  858. url: '/my/order/pay?ordersId=' + res.data.ordersId
  859. })
  860. }
  861. }
  862. })
  863. } else if (that.openWay == 2) { //微信支付
  864. // #ifdef MP-WEIXIN
  865. let data = {
  866. ordersId: res.data.ordersId,
  867. type: 3
  868. }
  869. that.$Request.post('/app/wxPay/payOrder', data).then(ret => {
  870. console.log(ret)
  871. if (ret.code == 0) {
  872. this.showpay = false
  873. uni.requestPayment({
  874. provider: 'wxpay',
  875. timeStamp: ret.data.timestamp,
  876. nonceStr: ret.data.noncestr,
  877. package: ret.data.package,
  878. signType: ret.data.signType,
  879. paySign: ret.data.sign,
  880. success: function(ret) {
  881. console.log(ret)
  882. uni.showToast({
  883. title: '支付成功',
  884. icon: 'none'
  885. })
  886. setTimeout(function() {
  887. uni.switchTab({
  888. url: '/pages/order/index'
  889. })
  890. }, 1000)
  891. // this.$queue.showToast('支付成功');
  892. // uni.switchTab({
  893. // url: '/pages/my/index'
  894. // })
  895. },
  896. fail: function(err) {
  897. // this.$queue.showToast('支付失败');
  898. uni.showToast({
  899. title: '支付失败',
  900. icon: 'nones'
  901. });
  902. uni.redirectTo({
  903. url: '/my/order/pay?ordersId=' + res
  904. .data.ordersId
  905. })
  906. }
  907. });
  908. }
  909. });
  910. // #endif
  911. // #ifdef H5
  912. let ua = navigator.userAgent.toLowerCase();
  913. if (ua.indexOf('micromessenger') != -1) {
  914. console.log(11111111)
  915. let data = {
  916. ordersId: res.data.ordersId,
  917. type: 2
  918. }
  919. that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
  920. that.showpay = false
  921. if (rea.code == 0) {
  922. that.callPay(rea.data);
  923. } else {
  924. uni.showToast({
  925. title: rea.msg,
  926. icon: 'none'
  927. })
  928. }
  929. });
  930. } else {
  931. // uni.switchTab({
  932. // url: "/pages/order/index"
  933. // });
  934. let data = {
  935. ordersId: res.data.ordersId,
  936. // type: 4
  937. type: 2
  938. }
  939. that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
  940. that.showpay = false
  941. if (rea.code == 0) {
  942. const urlArr = window.location.href;
  943. const hostUrl = urlArr.split("/");
  944. const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
  945. const url = '&redirect_url=' + callBack + 'pages/order/index';
  946. // window.location = rea.data.mweb_url + url
  947. // window.location = callBack+'pages/order/index'
  948. uni.switchTab({
  949. url: "/pages/order/index"
  950. });
  951. } else {
  952. uni.showToast({
  953. title: rea.msg,
  954. icon: 'none'
  955. })
  956. }
  957. // const urlArr = window.location.href;
  958. // const hostUrl = urlArr.split("/");
  959. // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
  960. // const url = '&redirect_url=' + callBack + 'pages/order/index';
  961. // window.location = rea.mweb_url + url
  962. });
  963. }
  964. // #endif
  965. // #ifdef APP
  966. console.log(res.data.ordersId, '9999999')
  967. let data = {
  968. ordersId: res.data.ordersId,
  969. type: 1
  970. }
  971. that.$Request.post('/app/wxPay/payOrder', data).then(rea => {
  972. console.log(rea)
  973. that.showpay = false
  974. if (rea.code == 0) {
  975. that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data));
  976. }
  977. });
  978. // #endif
  979. } else if (that.openWay == 3) { //支付宝支付
  980. // #ifdef H5
  981. let data = {
  982. ordersId: res.data.ordersId,
  983. type: 2
  984. }
  985. that.$Request.post('/app/aliPay/payOrder', data).then(
  986. rea => {
  987. that.showpay = false
  988. const div = document.createElement('div')
  989. div.innerHTML = rea.data //此处form就是后台返回接收到的数据
  990. document.body.appendChild(div)
  991. document.forms[0].submit()
  992. });
  993. // #endif
  994. // #ifdef APP-PLUS
  995. let data = {
  996. ordersId: res.data.ordersId,
  997. type: 1
  998. }
  999. that.$Request.post('/app/aliPay/payOrder', data).then(
  1000. rea => {
  1001. that.showpay = false
  1002. that.setPayment('alipay', rea.data);
  1003. });
  1004. // #endif
  1005. }
  1006. } else {
  1007. that.$queue.showToast(res.msg)
  1008. }
  1009. });
  1010. },
  1011. callPay: function(response) {
  1012. if (typeof WeixinJSBridge === "undefined") {
  1013. if (document.addEventListener) {
  1014. document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
  1015. } else if (document.attachEvent) {
  1016. document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
  1017. document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
  1018. }
  1019. } else {
  1020. this.onBridgeReady(response);
  1021. }
  1022. },
  1023. onBridgeReady: function(response) {
  1024. let that = this;
  1025. if (!response.package) {
  1026. return;
  1027. }
  1028. WeixinJSBridge.invoke(
  1029. 'getBrandWCPayRequest', {
  1030. "appId": response.appid, //公众号名称,由商户传入
  1031. "timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
  1032. "nonceStr": response.noncestr, //随机串
  1033. "package": response.package,
  1034. "signType": response.signType, //微信签名方式:
  1035. "paySign": response.sign //微信签名
  1036. },
  1037. function(res) {
  1038. if (res.err_msg === "get_brand_wcpay_request:ok") {
  1039. // 使用以上方式判断前端返回,微信团队郑重提示:
  1040. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  1041. uni.hideLoading();
  1042. uni.showToast({
  1043. title: '支付成功',
  1044. icon: 'none'
  1045. })
  1046. setTimeout(function() {
  1047. uni.switchTab({
  1048. url: '/pages/order/index'
  1049. })
  1050. }, 1000)
  1051. } else {
  1052. uni.hideLoading();
  1053. }
  1054. WeixinJSBridge.log(response.err_msg);
  1055. }
  1056. );
  1057. },
  1058. isCheckPay(code, name, order) {
  1059. if (code == 0) {
  1060. console.log('999999999999')
  1061. this.setPayment(name, order);
  1062. } else {
  1063. uni.hideLoading();
  1064. uni.showToast({
  1065. title: '支付信息有误'
  1066. });
  1067. }
  1068. },
  1069. setPayment(name, order) {
  1070. console.log(777777777, name, order)
  1071. uni.requestPayment({
  1072. provider: name,
  1073. orderInfo: order, //微信、支付宝订单数据
  1074. success: function(res) {
  1075. uni.hideLoading();
  1076. uni.showToast({
  1077. title: '支付成功',
  1078. icon: 'none'
  1079. })
  1080. setTimeout(function() {
  1081. uni.switchTab({
  1082. url: '/pages/order/index'
  1083. })
  1084. }, 1000)
  1085. },
  1086. fail: function(err) {
  1087. uni.hideLoading();
  1088. },
  1089. complete() {
  1090. uni.hideLoading();
  1091. }
  1092. });
  1093. }
  1094. },
  1095. computed: {
  1096. }
  1097. }
  1098. </script>
  1099. <style lang="scss">
  1100. textarea::-webkit-input-placeholder {
  1101. color: red;
  1102. }
  1103. page {
  1104. background-color: #F5F5F5;
  1105. }
  1106. .bg {
  1107. background-color: #FFFFFF;
  1108. }
  1109. .orderDet {}
  1110. .orderDet ::v-deep .u-icon-plus {
  1111. background: #FF6E98 !important;
  1112. width: 40rpx;
  1113. height: 40rpx;
  1114. font-size: 30rpx !important;
  1115. }
  1116. .box {
  1117. border: 1px solid #2FB57A;
  1118. border-radius: 4rpx;
  1119. color: #2FB57A;
  1120. padding: 0rpx 8rpx;
  1121. font-size: 22rpx;
  1122. margin-top: 10rpx;
  1123. }
  1124. .btn {
  1125. width: 140upx;
  1126. height: 55upx;
  1127. border: 2upx solid #FF130A;
  1128. border-radius: 30upx;
  1129. text-align: center;
  1130. line-height: 55upx;
  1131. color: #FF130A;
  1132. font-size: 24upx;
  1133. }
  1134. /* 底部 */
  1135. .footer {
  1136. display: flex;
  1137. flex-direction: row;
  1138. font-size: 28upx;
  1139. margin-top: 10upx;
  1140. color: rgba(0, 0, 0, 0.7);
  1141. text-align: center;
  1142. height: 40upx;
  1143. line-height: 40upx;
  1144. margin-left: 30rpx;
  1145. }
  1146. .footer text {
  1147. color: #333333;
  1148. font-size: 24upx;
  1149. margin-left: 10rpx;
  1150. margin-right: 15upx;
  1151. }
  1152. .xian {
  1153. width: 100%;
  1154. height: 1rpx;
  1155. background: #f8f8f8;
  1156. /* border: 1rpx solid #f8f8f8; */
  1157. }
  1158. .popup_pay {
  1159. /* height: 160px; */
  1160. /* #ifndef MP-WEIXIN */
  1161. /* height: 130px; */
  1162. /* #endif */
  1163. width: 100%;
  1164. padding-bottom: 45rpx;
  1165. /* background: #ffffff;
  1166. position: fixed;
  1167. bottom: 0px;
  1168. left: 0;
  1169. right: 0;
  1170. z-index: 999; */
  1171. }
  1172. .pay_btn {
  1173. width: 90%;
  1174. margin: 0 auto;
  1175. text-align: center;
  1176. background: #FF6E98;
  1177. height: 80rpx;
  1178. border-radius: 16rpx;
  1179. color: #ffffff;
  1180. line-height: 80rpx;
  1181. }
  1182. .btnyouhui {
  1183. border: 1rpx solid #FF130A;
  1184. color: #FF130A;
  1185. border-radius: 24rpx;
  1186. width: 130rpx;
  1187. height: 55rpx;
  1188. text-align: center;
  1189. line-height: 55rpx;
  1190. font-size: 24rpx;
  1191. }
  1192. </style>