orderDet.vue 37 KB

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