therapistList.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. <template>
  2. <view class="therapistList">
  3. <view class="padding-lr padding-top-sm " style="width: 100%;padding-bottom: 10rpx;">
  4. <view class="flex margin-right-sm" @tap="Cityshow = true" style="line-height: 68rpx;">
  5. <image src="../../static/images/address.png" style="width: 40rpx;height: 40rpx;"
  6. class="margin-top-xs"></image>
  7. <view class="localName margin-left-sm">{{city}}</view>
  8. </view>
  9. <u-search class="flex-sub search" clearabled placeholder="请输入技师名字" :focus="false" v-model="artificerName"
  10. :show-action="true" :animation="true" bg-color="#F7F7F7" color="#1A1A1A" @search="onSearch()"
  11. action-text="搜索" @custom="onSearch()"></u-search>
  12. </view>
  13. <view style="padding-top: 1rpx;padding-bottom: 30rpx;">
  14. <view class="flex align-center margin-bottom-sm bg padding-sm radius margin-sm"
  15. v-for="(item,index) in orderList" :key='index' @click.stop="goOrderDetail(item)"
  16. style="position: relative;">
  17. <view style="position: absolute;z-index: 99;top: 0rpx;left: 0;" v-if="item.isGoods == 1">
  18. <image
  19. src="/static/image/text_you.png"
  20. style="width: 42rpx;height: 36rpx;"></image>
  21. </view>
  22. <view style="width:130upx;height:190upx;border-radius: 10rpx;">
  23. <image :src="item.artificerImg?item.artificerImg: '../../static/logo.png'"
  24. @click.stop="saveImgs(item.artificerImg)"
  25. style="width: 130upx;height: 130upx;border-radius: 50%;" mode="aspectFill"></image>
  26. <image v-if="item.isHot == 1"
  27. src="/static/image/icon_fire.png"
  28. style="width: 30rpx;height: 36rpx;position: absolute;z-index: 99;top: 40rpx;left: 110rpx;">
  29. </image>
  30. <view class="kyy_view" v-if="item.state == 1">可服务</view>
  31. <view class="kfw_view" v-else-if="item.state == 2">可预约</view>
  32. <view class="byy_view" v-else>休息中</view>
  33. </view>
  34. <view class="margin-left flex flex-direction" style="width: 85%;">
  35. <view class="flex align-center justify-between">
  36. <view class="flex align-center">
  37. <view class="text-bold text-30 margin-right-xs">{{item.artificerName}}</view>
  38. <image
  39. src="/static/image/icon_pao.png"
  40. style="width: 40rpx;height:40rpx;">
  41. </image>
  42. <view class="zpmore_view" v-if="item.lifePhoto" @click.stop="saveImgss(item.lifePhoto,0)">更多照片</view>
  43. </view>
  44. <view class="zz_view" v-if="item.status == 1 && item.time && numIndex == 1">
  45. <view class="zz_label">
  46. 最早可约
  47. </view>
  48. <view class="zz_value">
  49. {{item.time}}
  50. </view>
  51. </view>
  52. <view class="zz_view" v-if="numIndex == 3">可用余额:{{item.money ? item.money : 0}}</view>
  53. </view>
  54. <view class="flex align-center" style="margin:15rpx 0rpx 0rpx">
  55. <view v-if="item.ordersScore" class="flex margin-right-sm">
  56. <text style="color: #FCAD3D;">{{item.ordersScore}}</text>
  57. <u-rate activeColor="#FCAD3D" size="20rpx" :count="5" v-model="item.ordersScore"></u-rate>
  58. </view>
  59. </view>
  60. <view class="flex justify-between " style="margin:15rpx 0rpx 0rpx">
  61. <!-- <view class="flex align-center">
  62. <view v-if="item.ordersScore" class="margin-right-sm">
  63. <image src="../../static/images/start.png" style="width: 24upx;height: 22upx;">
  64. </image>
  65. <text class="margin-left-xs" style="color: #FF1200;">{{item.ordersScore}}</text>
  66. </view>
  67. <view style="color: #999999;">已服务:{{item.ordersCount}}单</view>
  68. </view> -->
  69. <view class="flex align-center" style="color: #AAAAAA;font-size: 24rpx;">
  70. <view class="flex align-center" >已服务:
  71. <view style="color: #FF6E98;margin-left: 8rpx;">
  72. {{item.ordersCount}}单
  73. </view>
  74. </view>
  75. <view class="flex align-center" style="margin-left: 24rpx;" v-if="item.tripWay != 3 && numIndex != 3">
  76. 距您
  77. <view style="color: #FF6E98;margin-left: 8rpx;">{{item.distance}}</view>
  78. </view>
  79. <view class="flex align-center" style="font-size: 26rpx;color: #f49650;font-weight: bold;"
  80. v-if="item.tripWay == 3">
  81. 免出行费
  82. </view>
  83. </view>
  84. <!-- <view class="flex align-center" v-if="item.tripWay != 3 && numIndex != 3">
  85. <image src="../../static/images/address.png" style="width: 24rpx;height: 29rpx;"></image>
  86. <view style="color: #333333;margin-left: 8rpx;">{{item.distance}}</view>
  87. </view>
  88. <view class="flex align-center" style="font-size: 26rpx;color: #f49650;font-weight: bold;"
  89. v-if="item.tripWay == 3">
  90. 免出行费
  91. </view> -->
  92. </view>
  93. <view style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
  94. <view class="flex flex-wrap align-center" style="margin-top: 10rpx;">
  95. <image
  96. src="/static/image/icon_shang.png"
  97. style="width: 34rpx;height: 36rpx;"></image>
  98. <view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">商家</view>
  99. <image
  100. src="/static/image/icon_ping.png"
  101. style="width: 40rpx;height: 32rpx;margin-left: 20rpx;"></image>
  102. <view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">
  103. {{item.commentCount ? item.commentCount : 0}}
  104. </view>
  105. <image
  106. src="/static/image/icon_cang.png"
  107. style="width: 40rpx;height: 36rpx;margin-left: 20rpx;"></image>
  108. <view style="margin-left: 10rpx;color: #999;font-size: 26rpx;">
  109. {{item.collectCount ? item.collectCount : 0}}
  110. </view>
  111. </view>
  112. <view v-if="numIndex == 1">
  113. <view class="text-center text-sm" @tap.stop="goOrder(item)" v-if="item.status == 1"
  114. style="background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;"
  115. @click.stop="goOrder(item)">
  116. 立即预约
  117. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  118. </view>
  119. <view class="text-center text-sm" v-else
  120. style="background: #d9d9d9;color: #ffffff;width: 135upx;border-radius: 16upx;line-height: 50upx;position: relative;">
  121. 立即预约
  122. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  123. </view>
  124. </view>
  125. <view v-if="numIndex == 2">
  126. <view class="text-center text-sm" @tap.stop="showPay(item)"
  127. style="background: #2FB57A;color: #ffffff;width: 135upx;border-radius: 16upx;line-height: 50upx;">
  128. 为TA充值
  129. </view>
  130. </view>
  131. <view v-if="numIndex == 3">
  132. <view class="text-center text-sm"
  133. style="background: #d9d9d9;color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;">
  134. 立即预约
  135. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <empty v-if="orderList.length == 0"></empty>
  143. <u-select v-model="Cityshow" :list="cityList" @confirm="getCityData"></u-select>
  144. <view style="position: fixed;z-index: 9999;bottom: 160rpx;" v-if="showTP">
  145. <image src="https://wap.quanmindaojia.com/file/uploadPath/2023/02/16/15ade225e9fa8a1d82b325c06dc2b653.png"
  146. style="width: 690rpx;margin: 30rpx;height: 600rpx;"></image>
  147. <view
  148. style="position: absolute;bottom: 100rpx;width: 100%;text-align: center;display: flex;justify-content: center;">
  149. <view>
  150. <view style="color: #333333;font-size: 28rpx;"><text
  151. style="font-size: 44rpx;color:#ee6c54">{{tpCount}}</text>人已投票</view>
  152. <view class="tp_view" v-if="tpSel == 2" @tap="saveTP">投票</view>
  153. <view class="ytp_view" v-if="tpSel == 1">已投票</view>
  154. </view>
  155. </view>
  156. </view>
  157. <!-- 支付方式 -->
  158. <u-popup v-model="showpay" mode="bottom">
  159. <view class="popup_pay">
  160. <view style="background-color: #fff;">
  161. <view style="padding: 0 20upx;margin-top: 60rpx;margin-bottom: 20rpx;">
  162. <view class="padding margin-top" style="background: #f4f4f4;">
  163. <view class="text-lg margin-bottom">充值金额</view>
  164. <input type="number" placeholder="请输入充值金额" v-model="price">
  165. <view style="width: 100%;height: 1rpx;background: #e8e8e8;margin-top: 15rpx;"></view>
  166. </view>
  167. <view
  168. style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
  169. v-for="(item,index) in openLists" :key='index'>
  170. <image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
  171. </image>
  172. <view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
  173. {{item.text}}
  174. </view>
  175. <radio-group name="openWay" style="margin-left: 45upx;" @tap='selectWay(item.id)'>
  176. <label class="tui-radio">
  177. <radio color="#2FB57A" :checked="openWay === item.id ? true : false" />
  178. </label>
  179. </radio-group>
  180. </view>
  181. </view>
  182. </view>
  183. <view class="pay_btn" @click="pay()">确认支付</view>
  184. </view>
  185. </u-popup>
  186. </view>
  187. <!-- <u-skeleton :loading="loading" :animation="true" elColor='#FFFFFF' bgColor='#FFFFFF'></u-skeleton> -->
  188. </view>
  189. </template>
  190. <script>
  191. import meTabs from "@/components/mescroll-uni/me-tabs/me-tabs.vue";
  192. import empty from '@/components/empty.vue'
  193. import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
  194. export default {
  195. components: {
  196. meTabs,
  197. empty,
  198. RenDropdownFilter
  199. },
  200. data() {
  201. return {
  202. Cityshow: false,
  203. cityList: [],
  204. tpSel: 0,
  205. tpCount: 0,
  206. showTP: false,
  207. showpay: false,
  208. price: '',
  209. numIndex: 1,
  210. classifyId: '',
  211. artificerName: '',
  212. loading: true, // 是否显示骨架屏组件
  213. defaultSelected: [],
  214. value1: '',
  215. value2: '',
  216. value3: '',
  217. game: [],
  218. defaultIndex: [0, 0, 0],
  219. filterData: [
  220. [{
  221. label: '智能优选',
  222. value: '',
  223. },
  224. {
  225. label: '距离优先',
  226. value: 3,
  227. },
  228. {
  229. label: '人气优先',
  230. value: 2,
  231. },
  232. {
  233. label: '同城',
  234. value: 1,
  235. }
  236. ],
  237. [{
  238. label: '服务',
  239. value: '0',
  240. },
  241. {
  242. label: '从高到低',
  243. value: '1',
  244. },
  245. {
  246. label: '从低到高',
  247. value: '2',
  248. }
  249. ],
  250. [{
  251. label: '距离',
  252. value: '0',
  253. },
  254. {
  255. label: '从远到近',
  256. value: '1',
  257. },
  258. {
  259. label: '从近到远',
  260. value: '2',
  261. }
  262. ],
  263. ],
  264. list: [{
  265. name: '综合',
  266. id: 1
  267. }, {
  268. name: '距离',
  269. id: 2
  270. }, {
  271. name: '销量',
  272. id: 3
  273. }, {
  274. name: '好评',
  275. id: 4
  276. }],
  277. listIndex: 0,
  278. city: '请选择城市',
  279. latitude: '',
  280. longitude: '',
  281. orderList: [],
  282. page: 1,
  283. limit: 10,
  284. token: '',
  285. XCXIsSelect: '否',
  286. isVip: false,
  287. myId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : '',
  288. showModal: true,
  289. arr: [],
  290. tab: '',
  291. artificerId:'',
  292. massageTypeId: '',
  293. openWay: 1,
  294. openLists: []
  295. }
  296. },
  297. onLoad(e) {
  298. if (e.index) {
  299. this.numIndex = e.index;
  300. if (e.index == 2) {
  301. uni.setNavigationBarTitle({
  302. title: '为TA充值'
  303. })
  304. } else {
  305. uni.setNavigationBarTitle({
  306. title: '我的技师'
  307. })
  308. }
  309. } else {
  310. uni.setNavigationBarTitle({
  311. title: '选择技师'
  312. })
  313. }
  314. uni.showLoading({
  315. title: '加载中...',
  316. });
  317. // #ifdef MP-WEIXIN
  318. this.openWay = 1;
  319. this.openLists = [{
  320. image: '../../my/static/icon_weixin.png',
  321. text: '微信',
  322. id: 1
  323. }, {
  324. image: '../../static/images/lingqian.png',
  325. text: '零钱支付',
  326. id: 3
  327. }]
  328. // #endif
  329. // #ifndef MP-WEIXIN
  330. this.openWay = 1;
  331. this.openLists = [{
  332. image: '../../my/static/icon_weixin.png',
  333. text: '微信',
  334. id: 1
  335. }, {
  336. image: '../../my/static/zhifubao.png',
  337. text: '支付宝',
  338. id: 2
  339. }, {
  340. image: '../../static/images/lingqian.png',
  341. text: '零钱支付',
  342. id: 3
  343. }]
  344. // #endif
  345. let that = this
  346. that.token = uni.getStorageSync('token')
  347. that.city = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
  348. if (e.massageTypeId) {
  349. that.massageTypeId = e.massageTypeId
  350. }
  351. if (e.classifyId) {
  352. that.classifyId = e.classifyId
  353. }
  354. uni.getLocation({
  355. type: 'gcj02',
  356. geocode: true, //设置该参数为true可直接获取经纬度及城市信息
  357. success: function(res) {
  358. console.log(res, '地理位置')
  359. that.latitude = res.latitude
  360. that.longitude = res.longitude
  361. // uni.setStorageSync('latitude', res.latitude)
  362. // uni.setStorageSync('longitude', res.longitude)
  363. that.page = 1
  364. that.getlist()
  365. },
  366. fail: function() {
  367. that.page = 1
  368. that.getlist()
  369. console.log('获取地址失败')
  370. }
  371. })
  372. // 获取邀请码保存到本地
  373. if (e.invitation) {
  374. that.$queue.setData('inviterCode', e.invitation);
  375. }
  376. if (this.myId) {
  377. that.$Request.getT('/app/common/type/235').then(res => { //报名成功通知
  378. if (res.code == 0) {
  379. if (res.data && res.data.value) {
  380. that.arr.push(res.data.value)
  381. }
  382. }
  383. })
  384. that.$Request.getT('/app/common/type/236').then(res => { //活动即将开始提醒
  385. if (res.code == 0) {
  386. if (res.data && res.data.value) {
  387. that.arr.push(res.data.value)
  388. }
  389. }
  390. })
  391. }
  392. },
  393. onShow() {
  394. let that = this
  395. that.city = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
  396. that.token = uni.getStorageSync('token')
  397. that.getKTCityList();
  398. that.getTpCount();
  399. that.getTpMy();
  400. if (uni.getStorageSync('token')) {
  401. that.getIsVip()
  402. }
  403. that.myId = uni.getStorageSync('userId')
  404. // #ifdef MP-WEIXIN
  405. //订阅
  406. if (that.myId) {
  407. if (this.showModal) {
  408. // this.openMsg()
  409. }
  410. }
  411. // #endif
  412. },
  413. methods: {
  414. getCityData(e) {
  415. console.log(e[0].label);
  416. this.city = e[0].label;
  417. uni.setStorageSync('city', this.city)
  418. this.getKTCityList();
  419. this.page = 1
  420. this.getlist()
  421. },
  422. saveTP() {
  423. if (!this.token) {
  424. uni.navigateTo({
  425. url: '/pages/public/login'
  426. });
  427. return;
  428. }
  429. let userId = this.$queue.getData('userId');
  430. let userName = this.$queue.getData('userName');
  431. this.$queue.showLoading('投票中...');
  432. this.$Request.postJson('/app/message/insertMessage', {
  433. state: 11,
  434. content: this.city,
  435. userName: userName,
  436. userId: userId
  437. })
  438. .then(res => {
  439. if (res.code === 0) {
  440. uni.showToast({
  441. title: '投票成功!'
  442. });
  443. this.getTpCount();
  444. this.getTpMy();
  445. } else {
  446. uni.hideLoading();
  447. uni.showModal({
  448. showCancel: false,
  449. title: '投票失败',
  450. content: res.msg
  451. });
  452. }
  453. });
  454. },
  455. getTpMy() {
  456. this.$Request.getT('/app/message/selectMessageByUserId?page=1&limit=1&state=11').then(res => {
  457. if (res.code == 0) {
  458. if (res.data && res.data.list && res.data.list.length > 0) {
  459. this.tpSel = 1;
  460. } else {
  461. this.tpSel = 2;
  462. }
  463. }
  464. });
  465. },
  466. getTpCount() {
  467. this.$Request.getT('/app/message/selectCityCount?city=' + this.city).then(res => {
  468. if (res.code == 0) {
  469. this.tpCount = res.data ? res.data : 0;
  470. }
  471. });
  472. },
  473. getKTCityList() {
  474. this.$Request.getT('/app/trip/selectTripList').then(res => {
  475. if (res.code == 0) {
  476. this.cityList = [];
  477. let isOpen = false
  478. let cityName = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
  479. res.data.forEach((d, index) => {
  480. if (cityName === d.city) {
  481. isOpen = true;
  482. }
  483. let data = {}
  484. data.label = d.city
  485. data.value = index
  486. this.cityList.push(data);
  487. });
  488. if (!isOpen) {
  489. this.orderList = []
  490. // this.showTP = true;
  491. } else {
  492. this.showTP = false;
  493. }
  494. }
  495. });
  496. },
  497. showPay(e){
  498. this.showpay = true
  499. this.artificerId = e.artificerId
  500. },
  501. selectWay: function(id) {
  502. this.openWay = id;
  503. },
  504. // 跳转订单
  505. goOrder(e) {
  506. uni.navigateTo({
  507. url: "/pages/index/order/orderDet?artificerId=" + e.artificerId + '&massageTypeId=' + this
  508. .massageTypeId + '&tripWay=' + e.tripWay
  509. })
  510. },
  511. saveImgss(imgs, index) {
  512. console.log(imgs, index)
  513. // let that = this
  514. let imgArr = imgs
  515. // this.imgArr.push(imgs);
  516. // console.log(this.imgArr)
  517. // //预览图片
  518. uni.previewImage({
  519. urls: imgArr,
  520. current: imgArr[index]
  521. });
  522. },
  523. saveImgs(imgs) {
  524. let imgArr = [];
  525. imgArr.push(imgs);
  526. // //预览图片
  527. uni.previewImage({
  528. urls: imgArr,
  529. current: 0
  530. });
  531. },
  532. onSearch(e) {
  533. // this.artificerName = e;
  534. this.page = 1;
  535. this.getlist()
  536. },
  537. // 开启订阅消息
  538. openMsg() {
  539. var that = this
  540. uni.getSetting({
  541. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  542. success(ret) {
  543. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  544. if (ret.subscriptionsSetting.itemSettings) {
  545. uni.setStorageSync('sendMsg', true)
  546. uni.openSetting({ // 打开设置页
  547. success(rea) {
  548. // console.log(rea.authSetting)
  549. }
  550. });
  551. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  552. uni.setStorageSync('sendMsg', false)
  553. uni.showModal({
  554. title: '提示',
  555. content: '为了更好的体验,请绑定消息推送',
  556. confirmText: '确定',
  557. cancelText: '取消',
  558. success: function(res) {
  559. if (res.confirm) {
  560. wx.requestSubscribeMessage({
  561. tmplIds: that.arr,
  562. success(re) {
  563. var datas = JSON.stringify(re);
  564. if (datas.indexOf("accept") != -1) {
  565. console.log(re)
  566. // uni.setStorageSync('sendMsg', true)
  567. }
  568. },
  569. fail: (res) => {
  570. console.log(res)
  571. }
  572. })
  573. // uni.setStorageSync('sendMsg', true)
  574. console.log('确认')
  575. that.showModal = false
  576. } else if (res.cancel) {
  577. console.log('取消')
  578. // uni.setStorageSync('sendMsg', false)
  579. that.showModal = true
  580. }
  581. }
  582. })
  583. }
  584. }
  585. })
  586. },
  587. getIsVip() {
  588. this.$Request.get("/app/UserVip/isUserVip").then(res => {
  589. if (res.code == 0) {
  590. this.isVip = res.data
  591. uni.setStorageSync('isVIP', res.data)
  592. }
  593. });
  594. },
  595. getlist() {
  596. let index = this.list[this.listIndex].id
  597. let data = {
  598. classifyId: this.classifyId,
  599. artificerName: this.artificerName,
  600. page: this.page,
  601. limit: this.limit,
  602. massageTypeId: this.massageTypeId,
  603. by: index, //价格
  604. latitude: this.latitude,
  605. longitude: this.longitude,
  606. city: this.city
  607. }
  608. if (this.token) {
  609. if (this.numIndex != 3) {
  610. this.$Request.get("/app/artificer/selectArtificerList", data).then(res => {
  611. this.loading = false;
  612. uni.hideLoading()
  613. if (res.code == 0) {
  614. if (this.page == 1) {
  615. this.orderList = [];
  616. }
  617. if (res.data.list.length > 0) {
  618. for (var i = 0; i < res.data.list.length; i++) {
  619. if (res.data.list[i].lifePhoto) {
  620. res.data.list[i].lifePhoto = res.data.list[i].lifePhoto.split(',')
  621. }
  622. if (res.data.list[i].distance > 1000) {
  623. res.data.list[i].distance = (res.data.list[i].distance / 1000).toFixed(1) + 'km'
  624. } else {
  625. res.data.list[i].distance = (res.data.list[i].distance).toFixed(1) + 'm'
  626. }
  627. }
  628. if (this.page == 1) {
  629. this.orderList = res.data.list
  630. } else {
  631. this.orderList = [...this.orderList, ...res.data.list]
  632. }
  633. } else {
  634. // this.orderList = []
  635. // uni.showToast({
  636. // title: '当前城市暂未开通,请切换城市',
  637. // duration: 2000,
  638. // icon: 'none'
  639. // });
  640. }
  641. uni.stopPullDownRefresh();
  642. }
  643. })
  644. } else {
  645. let userId = this.$queue.getData('userId')
  646. let data = {
  647. userId: userId,
  648. page: this.page,
  649. limit: this.limit
  650. }
  651. this.$Request.get("/app/userMoney/selectUserMoneyArtificer", data).then(res => {
  652. this.loading = false;
  653. uni.hideLoading()
  654. if (res.code == 0) {
  655. if (this.page == 1) {
  656. this.orderList = [];
  657. }
  658. res.data.list.forEach(d => {
  659. if (d.artificer.lifePhoto) {
  660. d.artificer.lifePhoto = d.artificer.lifePhoto.split(',')
  661. }
  662. d.artificer.money = d.money;
  663. this.orderList.push(d.artificer)
  664. });
  665. uni.stopPullDownRefresh();
  666. }
  667. })
  668. }
  669. } else {
  670. uni.hideLoading()
  671. }
  672. },
  673. // 筛选
  674. change(index) {
  675. this.listIndex = index
  676. // this.value1 = e[0][0].value
  677. // this.value2 = e[1][0].value
  678. // this.value3 = e[2][0].value
  679. this.page = 1
  680. this.getlist()
  681. },
  682. // 选择城市
  683. goSelectCity() {
  684. // uni.navigateTo({
  685. // url: '/pages/index/citys/citys'
  686. // });
  687. let that = this
  688. uni.chooseLocation({
  689. success: function(res) {
  690. console.log('位置名称:' + res.name);
  691. console.log('详细地址:' + res.address);
  692. console.log('纬度:' + res.latitude);
  693. console.log('经度:' + res.longitude);
  694. that.latitude = res.latitude
  695. that.longitude = res.longitude
  696. that.selectCity(that.longitude, that.latitude);
  697. }
  698. });
  699. },
  700. selectCity(longitude, latitude) {
  701. this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
  702. if (res.code == 0) {
  703. this.city = res.data.city ? res.data.city : '未知'
  704. uni.setStorageSync('city', res.data.city)
  705. this.page = 1
  706. this.getlist()
  707. }
  708. });
  709. },
  710. // 跳转游戏列表
  711. goNav(url) {
  712. console.log(url, '1111112333')
  713. if (uni.getStorageSync('sendMsg')) {
  714. console.log('授权+1')
  715. wx.requestSubscribeMessage({
  716. tmplIds: this.arr,
  717. success(re) {
  718. console.log(JSON.stringify(re), 111111111111)
  719. var datas = JSON.stringify(re);
  720. if (datas.indexOf("accept") != -1) {
  721. console.log(re)
  722. }
  723. },
  724. fail: (res) => {
  725. console.log(res)
  726. }
  727. })
  728. }
  729. if (url.indexOf('/pages/') !== -1) {
  730. uni.navigateTo({
  731. url
  732. });
  733. } else {
  734. //#ifndef H5
  735. uni.navigateTo({
  736. url: '/pages/index/webView?url=' + url
  737. });
  738. //#endif
  739. //#ifdef H5
  740. window.location.href = url;
  741. //#endif
  742. }
  743. },
  744. // 跳转搜索
  745. goSearch() {
  746. if (uni.getStorageSync('sendMsg')) {
  747. console.log('授权+1')
  748. wx.requestSubscribeMessage({
  749. tmplIds: this.arr,
  750. success(re) {
  751. // console.log(JSON.stringify(re), 111111111111)
  752. var datas = JSON.stringify(re);
  753. if (datas.indexOf("accept") != -1) {
  754. console.log(re)
  755. }
  756. },
  757. fail: (res) => {
  758. console.log(res)
  759. }
  760. })
  761. }
  762. uni.navigateTo({
  763. url: '/pages/index/search/index'
  764. });
  765. },
  766. // 跳转订单
  767. goOrder(e) {
  768. console.log('授权', uni.getStorageSync('sendMsg'))
  769. if (uni.getStorageSync('sendMsg')) {
  770. console.log('授权+1')
  771. wx.requestSubscribeMessage({
  772. tmplIds: this.arr,
  773. success(re) {
  774. console.log(JSON.stringify(re), 111111111111)
  775. var datas = JSON.stringify(re);
  776. if (datas.indexOf("accept") != -1) {
  777. console.log(re)
  778. }
  779. },
  780. fail: (res) => {
  781. console.log(res)
  782. }
  783. })
  784. }
  785. if (this.token) {
  786. uni.navigateTo({
  787. url: "/pages/index/order/orderDet?artificerId=" + e.artificerId + '&massageTypeId=' + this
  788. .massageTypeId
  789. })
  790. } else {
  791. uni.navigateTo({
  792. url: '/pages/public/login'
  793. });
  794. }
  795. },
  796. goOrderDetail(e) {
  797. if (this.numIndex == 1) {
  798. if (e.status != 1) {
  799. this.$queue.showToast('当前技师已下线,请预约其他技师!')
  800. return;
  801. }
  802. uni.navigateTo({
  803. url: "/pages/index/order/orderDetail?artificerId=" + e.artificerId + '&massageTypeId=' + this.massageTypeId
  804. })
  805. } else {
  806. uni.navigateTo({
  807. url: '/pages/therapist/orderDetail?artificerId=' + e.artificerId
  808. });
  809. }
  810. },
  811. pay() {
  812. this.showpay = false;
  813. if (this.price === '') {
  814. this.$queue.showToast('请输入充值金额!')
  815. return;
  816. }
  817. this.$queue.showLoading('支付中...')
  818. let that = this;
  819. if (this.openWay == 1) {
  820. // #ifdef MP-WEIXIN
  821. that.$Request.postT("/app/wxPay/payUserMoneyArtificer", {
  822. artificerId: that.artificerId,
  823. money: that.price,
  824. type: 3
  825. }).then(red => {
  826. if (red.code == 0) {
  827. uni.requestPayment({
  828. provider: 'wxpay',
  829. timeStamp: red.data.timestamp,
  830. nonceStr: red.data.noncestr,
  831. package: red.data.package,
  832. signType: red.data.signType,
  833. paySign: red.data.sign,
  834. success: function(redd) {
  835. uni.hideLoading();
  836. uni.showToast({
  837. title: '充值成功!'
  838. })
  839. },
  840. fail: function(err) {
  841. uni.hideLoading();
  842. that.$queue.showToast(
  843. '支付失败');
  844. }
  845. });
  846. } else {
  847. uni.showToast({
  848. title: red.msg,
  849. icon: 'none'
  850. })
  851. }
  852. });
  853. // #endif
  854. // #ifdef H5
  855. let ua = navigator.userAgent.toLowerCase();
  856. console.log(ua)
  857. if (ua.indexOf('micromessenger') !== -1) {
  858. that.$Request.post("/app/wxPay/payUserMoneyArtificer", {
  859. money: that.price,
  860. artificerId: that.artificerId,
  861. type: 2
  862. }).then(red => {
  863. if (red.code == 0) {
  864. that.callPay(red.data);
  865. } else {
  866. uni.showToast({
  867. title: red.msg,
  868. icon: 'none'
  869. })
  870. }
  871. });
  872. } else {
  873. that.$Request.post("/app/wxPay/payUserMoneyArtificer", {
  874. money: that.price,
  875. artificerId: that.artificerId,
  876. type: 4
  877. }).then(red => {
  878. if (red.code == 0) {
  879. const urlArr = window.location.href;
  880. const hostUrl = urlArr.split("/");
  881. const callBack = hostUrl[0] + "//" + hostUrl[2] + "/";
  882. const url = '&redirect_url=' + callBack + 'my/vip/index';
  883. window.location = red.data.mweb_url + url
  884. } else {
  885. uni.showToast({
  886. title: red.msg,
  887. icon: 'none'
  888. })
  889. }
  890. });
  891. }
  892. // #endif
  893. // #ifdef APP-PLUS
  894. that.$Request.post("/app/wxPay/payUserMoneyArtificer", {
  895. money: that.price,
  896. artificerId: that.artificerId,
  897. type: 1
  898. }).then(red => {
  899. if (red.code == 0) {
  900. console.log(JSON.stringify(red))
  901. that.setPayment('wxpay', JSON.stringify(red
  902. .data));
  903. } else {
  904. uni.showToast({
  905. title: red.msg,
  906. icon: 'none'
  907. })
  908. }
  909. });
  910. // #endif
  911. } else if (this.openWay == 2) {
  912. // #ifdef H5
  913. that.$Request.post("/app/aliPay/payUserMoneyArtificer", {
  914. money: that.price,
  915. artificerId: that.artificerId,
  916. classify: 2
  917. }).then(red => {
  918. if (red.code == 0) {
  919. const div = document.createElement('div')
  920. div.innerHTML = red.data //此处form就是后台返回接收到的数据
  921. document.body.appendChild(div)
  922. document.forms[0].submit()
  923. } else {
  924. uni.showToast({
  925. title: red.msg,
  926. icon: 'none'
  927. })
  928. }
  929. });
  930. // #endif
  931. // #ifdef APP-PLUS
  932. that.$Request.post("/app/aliPay/payUserMoneyArtificer", {
  933. money: that.price,
  934. artificerId: that.artificerId,
  935. classify: 1
  936. }).then(red => {
  937. if (red.code == 0) {
  938. that.setPayment('alipay', red.data);
  939. } else {
  940. uni.showToast({
  941. title: red.msg,
  942. icon: 'none'
  943. })
  944. }
  945. });
  946. // #endif
  947. } else if (this.openWay == 3) {
  948. uni.hideLoading();
  949. uni.showModal({
  950. title: '付款提示',
  951. content: '确认支付' + that.price + '元吗?',
  952. success: function(re) {
  953. if (re.confirm) {
  954. that.$queue.showLoading('支付中...')
  955. // console.log('用户点击确定');
  956. that.$Request.post("/app/userMoney/payUserMoneyArtificer", {
  957. money: that.price,
  958. artificerId: that.artificerId,
  959. classify: 1
  960. }).then(ret => {
  961. uni.hideLoading();
  962. if (ret.code == 0) {
  963. uni.showToast({
  964. title: '充值成功',
  965. icon: 'none'
  966. })
  967. } else {
  968. uni.showToast({
  969. title: ret.msg,
  970. icon: 'none'
  971. })
  972. }
  973. });
  974. }
  975. }
  976. })
  977. }
  978. },
  979. callPay: function(response) {
  980. if (typeof WeixinJSBridge === "undefined") {
  981. if (document.addEventListener) {
  982. document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
  983. } else if (document.attachEvent) {
  984. document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
  985. document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
  986. }
  987. } else {
  988. this.onBridgeReady(response);
  989. }
  990. },
  991. onBridgeReady: function(response) {
  992. let that = this;
  993. if (!response.package) {
  994. return;
  995. }
  996. WeixinJSBridge.invoke(
  997. 'getBrandWCPayRequest', {
  998. "appId": response.appid, //公众号名称,由商户传入
  999. "timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
  1000. "nonceStr": response.noncestr, //随机串
  1001. "package": response.package,
  1002. "signType": response.signType, //微信签名方式:
  1003. "paySign": response.sign //微信签名
  1004. },
  1005. function(res) {
  1006. if (res.err_msg === "get_brand_wcpay_request:ok") {
  1007. // 使用以上方式判断前端返回,微信团队郑重提示:
  1008. //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
  1009. uni.hideLoading();
  1010. uni.showToast({
  1011. title: '充值成功!'
  1012. })
  1013. } else {
  1014. uni.hideLoading();
  1015. }
  1016. WeixinJSBridge.log(response.err_msg);
  1017. }
  1018. );
  1019. },
  1020. setPayment(name, order) {
  1021. let that = this;
  1022. uni.requestPayment({
  1023. provider: name,
  1024. orderInfo: order, //微信、支付宝订单数据
  1025. success: function(res) {
  1026. uni.hideLoading();
  1027. uni.showToast({
  1028. title: '充值成功!'
  1029. })
  1030. },
  1031. fail: function(err) {
  1032. uni.hideLoading();
  1033. console.log(12)
  1034. }
  1035. });
  1036. }
  1037. },
  1038. onReachBottom: function() {
  1039. this.page = this.page + 1;
  1040. this.getlist()
  1041. },
  1042. onPullDownRefresh: function() {
  1043. this.page = 1;
  1044. this.getlist()
  1045. },
  1046. }
  1047. </script>
  1048. <style lang="scss">
  1049. .therapistList {
  1050. background: linear-gradient( 180deg, #FFE5ED 0%, #F6F6F6 500rpx);
  1051. height: 100VH;
  1052. overflow: hidden!important;
  1053. }
  1054. .search ::v-deep .u-content,.search ::v-deep input{
  1055. background: #FFFFFF!important;
  1056. }
  1057. .zz_view {
  1058. display: flex;
  1059. line-height: 40rpx;
  1060. text-align: center;
  1061. font-size: 24rpx;
  1062. .zz_label{
  1063. width: 120rpx;
  1064. background: #4B2F20;
  1065. border-radius: 32rpx 0 0 32rpx;
  1066. color: #FFFFFF;
  1067. }
  1068. .zz_value{
  1069. width: 88rpx;
  1070. border-radius: 0 32rpx 32rpx 0;
  1071. background: #EECEAC;
  1072. color: #4B2F20;
  1073. }
  1074. }
  1075. .zpmore_view {
  1076. background: #07BF89;
  1077. width: 128rpx;
  1078. height: 40rpx;
  1079. text-align: center;
  1080. border-radius: 32rpx;
  1081. line-height: 40rpx;
  1082. font-size: 24rpx;
  1083. color: #FFFFFF;
  1084. margin-left: 10rpx;
  1085. }
  1086. .byy_view {
  1087. background: #ebebeb;
  1088. width: 120upx;
  1089. text-align: center;
  1090. border-radius: 50rpx;
  1091. height: 46rpx;
  1092. line-height: 46rpx;
  1093. font-size: 24rpx;
  1094. color: #000000;
  1095. // border: 3upx solid #999999;
  1096. margin-top: 6rpx;
  1097. }
  1098. .kfw_view {
  1099. background: #ffaa00;
  1100. width: 120upx;
  1101. text-align: center;
  1102. border-radius: 50rpx;
  1103. height: 46rpx;
  1104. line-height: 46rpx;
  1105. font-size: 24rpx;
  1106. color: #FFFFFF;
  1107. margin-top: 6rpx;
  1108. }
  1109. .kyy_view {
  1110. background: #DCFFEA;
  1111. width: 120upx;
  1112. text-align: center;
  1113. border-radius: 36rpx;
  1114. height: 40rpx;
  1115. line-height: 40rpx;
  1116. font-size: 24rpx;
  1117. color: #54CC84;
  1118. }
  1119. .kyy_view,.kfw_view,.byy_view{
  1120. margin-top: -10rpx;
  1121. z-index: 9;
  1122. }
  1123. .bg {
  1124. background: #FFFFFF;
  1125. }
  1126. .ytp_view {
  1127. background: #e3e3e3;
  1128. width: 400rpx;
  1129. border-radius: 10rpx;
  1130. font-size: 28rpx;
  1131. text-align: center;
  1132. height: 80rpx;
  1133. line-height: 80rpx;
  1134. color: #848484;
  1135. margin-top: 40rpx;
  1136. }
  1137. .tp_view {
  1138. background: #ee6c54;
  1139. width: 400rpx;
  1140. border-radius: 10rpx;
  1141. font-size: 28rpx;
  1142. text-align: center;
  1143. height: 80rpx;
  1144. line-height: 80rpx;
  1145. color: #FFFFFF;
  1146. margin-top: 40rpx;
  1147. }
  1148. .sticky-tabs {
  1149. z-index: 990;
  1150. position: sticky;
  1151. top: var(--window-top);
  1152. // background-color: #fff;
  1153. }
  1154. /* // 使用mescroll-uni,则top为0 */
  1155. .mescroll-uni,
  1156. /deep/.mescroll-uni {
  1157. .sticky-tabs {
  1158. top: 0;
  1159. }
  1160. }
  1161. .demo-tip {
  1162. padding: 18upx;
  1163. font-size: 24upx;
  1164. text-align: center;
  1165. }
  1166. .line_s {
  1167. display: inline-flex;
  1168. width: 10rpx;
  1169. height: 10rpx;
  1170. background: #1AD566;
  1171. border-radius: 50%;
  1172. margin-right: 10rpx;
  1173. }
  1174. .line_x {
  1175. display: inline-flex;
  1176. width: 10rpx;
  1177. height: 10rpx;
  1178. background: #000000;
  1179. border-radius: 50%;
  1180. margin-right: 10rpx;
  1181. }
  1182. .box {
  1183. // border: 3rpx solid #005dff;
  1184. background: #E8FAE1;
  1185. color: #2FB57A;
  1186. padding: 5rpx 15rpx;
  1187. font-size: 26rpx;
  1188. letter-spacing: 2rpx;
  1189. border-radius: 8rpx;
  1190. // margin-top: 10rpx;
  1191. margin-right: 8upx;
  1192. }
  1193. </style>