therapist.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. <template>
  2. <view class="therapist">
  3. <view class="padding-lr padding-top-sm " style="position: fixed;top: 0rpx;z-index: 999;width: 100%;padding-bottom: 10rpx;">
  4. <view v-if="XCXIsSelect !='否'" class="flex margin-right-sm" @tap="showCityList" 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. <!-- <u-search style="width: 100%;" placeholder="搜索需要的师傅" :focus="true" v-model="keyword" :show-action="true"
  13. :animation="true" shape="square" bg-color="#F7F7F7" color="#1A1A1A" action-text="取消" @custom="goBack()"
  14. @search="doSearch(false)"></u-search> -->
  15. </view>
  16. <!-- <view class="bg flex justify-between padding">
  17. <view class="" v-for="(item,index) in tablist" :key="index" :class="tabIndex==item.id?'actve':''"
  18. @click="tanChange(item.id)">
  19. {{item.value}}
  20. </view>
  21. </view>
  22. <view class="bg flex align-center justify-between padding-lr padding-bottom">
  23. <view v-for="(item,index) in list" :key="index" @click="change(index)"
  24. :style="listIndex==index?'color:#20C675;font-size:30rpx;':''">
  25. {{item.name}}
  26. </view>
  27. </view> -->
  28. <view class="tabview1" v-if="XCXIsSelect != '否'">
  29. <view class="tabview" v-if="tablist && tablist.length > 1">
  30. <view v-for="(item,index) in tablist" :key="index" @tap="tanChange(index,item)"
  31. :class="tabIndex == item.id ? 'tabItem_sel' : 'tabItem'">
  32. <view>{{item.value}}</view>
  33. </view>
  34. </view>
  35. <!-- <view class="tabsx">
  36. <view v-for="(item,index) in list" :key="index" :class="listIndex==index?'active':''"
  37. @click="change(index)">{{item.name}}</view>
  38. </view> -->
  39. </view>
  40. <view v-if="orderList.length" class="list" :style="XCXIsSelect != '否' ? '' : 'margin-top: 114rpx;'">
  41. <view class="flex align-center margin-bottom-sm bg padding-sm radius margin-sm"
  42. v-for="(item,index) in orderList" :key='index' @click="goOrder(item)"
  43. style="box-shadow: 6rpx 10rpx 4px #F5F5F5;position: relative;">
  44. <view style="position: absolute;z-index: 99;top: 0rpx;left: 0;" v-if="item.isGoods == 1">
  45. <image
  46. src="/static/image/text_you.png"
  47. style="width: 42rpx;height: 36rpx;"></image>
  48. </view>
  49. <view style="width:160rpx;height:190upx;border-radius: 10rpx;display: flex;flex-direction: column;align-items: center;">
  50. <image :src="item.artificerImg?item.artificerImg: '../../static/logo.png'"
  51. @click.stop="saveImgs(item.artificerImg)"
  52. style="width: 160rpx;height: 160rpx;border-radius: 50%;" mode="aspectFill"></image>
  53. <image v-if="item.isHot == 1"
  54. src="/static/image/icon_fire.png"
  55. style="width: 30rpx;height: 36rpx;position: absolute;z-index: 99;top: 40rpx;left: 110rpx;">
  56. </image>
  57. <view class="kyy_view" v-if="item.state == 1">可服务</view>
  58. <view class="kfw_view" v-else-if="item.state == 2">可预约</view>
  59. <view class="byy_view" v-else>休息中</view>
  60. </view>
  61. <view class="margin-left flex flex-direction" style="width: 85%;">
  62. <view class="flex align-center justify-between">
  63. <view class="flex align-center">
  64. <view class="text-bold text-30 margin-right-xs jishi_name">{{item.artificerName}}</view>
  65. <!-- <image
  66. src="/static/image/icon_pao.png"
  67. style="width: 40rpx;height:40rpx;">
  68. </image> -->
  69. <view class="zpmore_view" v-if="item.lifePhoto" @click.stop="saveImgss(item.lifePhoto,0)">更多照片</view>
  70. </view>
  71. <view class="zz_view" v-if="item.status == 1 && item.time">
  72. <view class="zz_label">
  73. 最早可约
  74. </view>
  75. <view class="zz_value">
  76. {{item.time}}
  77. </view>
  78. </view>
  79. </view>
  80. <view class="flex justify-between " style="margin:15rpx 0rpx 20rpx">
  81. <view class="flex align-center">
  82. <view v-if="item.ordersScore" class="flex margin-right-sm">
  83. <text style="color: #FCAD3D;">{{item.ordersScore}}</text>
  84. <u-rate activeColor="#FCAD3D" size="20rpx" :count="5" v-model="item.ordersScore"></u-rate>
  85. </view>
  86. </view>
  87. <view class="flex align-center" style="font-size: 26rpx;color: #f49650;font-weight: bold;" v-if="item.tripWay == 3">
  88. 免出行费
  89. </view>
  90. </view>
  91. <view class="flex align-center" style="color: #AAAAAA;font-size: 24rpx;">
  92. <view class="flex align-center" >已服务:
  93. <view style="color: #FF6E98;margin-left: 8rpx;">
  94. {{item.ordersCount}}单
  95. </view>
  96. </view>
  97. <view class="flex align-center" style="margin-left: 24rpx;" v-if="item.tripWay != 3">
  98. 距您
  99. <view style="color: #FF6E98;margin-left: 8rpx;">{{item.distance}}</view>
  100. </view>
  101. </view>
  102. <view style="width: 100%;display: flex;justify-content: space-between;align-items: center;"
  103. v-if="XCXIsSelect !='否'">
  104. <view class="flex flex-wrap align-center" style="margin-top: 10rpx;">
  105. <image
  106. src="/static/image/icon_shang.png"
  107. style="width: 24rpx;height: 24rpx;"></image>
  108. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;margin-right: 24rpx;">商家</view>
  109. <image
  110. src="/static/image/icon_ping.png"
  111. style="width: 24rpx;height: 24rpx;"></image>
  112. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;margin-right: 24rpx;">
  113. {{item.commentCount ? item.commentCount : 0}}
  114. </view>
  115. <image
  116. src="/static/image/icon_cang.png"
  117. style="width: 24rpx;height: 24rpx;"></image>
  118. <view style="margin-left: 10rpx;color: #999;font-size: 24rpx;">
  119. {{item.collectCount ? item.collectCount : 0}}
  120. </view>
  121. </view>
  122. <view class="text-center text-sm" v-if="item.status == 1"
  123. style="background: linear-gradient( 313deg, #FFE6EE 0%, #FFBACA 100%);color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;"
  124. @click.stop="goOrder(item)">
  125. 立即预约
  126. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  127. </view>
  128. <view class="text-center text-sm" v-else
  129. style="background: #d9d9d9;color: #222222;width: 160rpx;border-radius: 36rpx;line-height: 64rpx;font-weight: bold;position: relative;">
  130. 立即预约
  131. <image style="position: absolute;width: 39rpx;height: 39rpx;top: -4rpx;right: -8rpx;" src="../../static/image/btn-icon.png" mode=""></image>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. <empty v-if="orderList.length == 0"></empty>
  138. <view style="position: fixed;z-index: 999;bottom: 160rpx;" v-if="showTP">
  139. <image
  140. src="/static/image/city_open.png"
  141. style="width: 690rpx;margin: 30rpx;height: 600rpx;"></image>
  142. <view
  143. style="position: absolute;bottom: 100rpx;width: 100%;text-align: center;display: flex;justify-content: center;">
  144. <view>
  145. <view style="color: #333333;font-size: 28rpx;"><text
  146. style="font-size: 44rpx;color:#ee6c54">{{tpCount}}</text>人已投票</view>
  147. <view class="tp_view" v-if="tpSel == 2" @tap="saveTP">投票</view>
  148. <view class="ytp_view" v-if="tpSel == 1">已投票</view>
  149. </view>
  150. </view>
  151. </view>
  152. <!-- 经验筛选 -->
  153. <u-select v-model="Cityshow" :list="cityList" @confirm="getCity"></u-select>
  154. <!-- <u-skeleton :loading="loading" :animation="true" elColor='#FFFFFF' bgColor='#FFFFFF'></u-skeleton> -->
  155. </view>
  156. </template>
  157. <script>
  158. import meTabs from "@/components/mescroll-uni/me-tabs/me-tabs.vue";
  159. import empty from '@/components/empty.vue'
  160. import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
  161. // 调用手机系统权限
  162. // #ifdef APP-PLUS
  163. import permision from "@/components/permission.js";
  164. // #endif
  165. export default {
  166. components: {
  167. meTabs,
  168. empty,
  169. RenDropdownFilter
  170. },
  171. data() {
  172. return {
  173. artificerName: '',
  174. tpSel: 0,
  175. tpCount: 0,
  176. showTP: false,
  177. Cityshow: false,
  178. loading: true, // 是否显示骨架屏组件
  179. defaultSelected: [],
  180. value1: '',
  181. value2: '',
  182. value3: '',
  183. game: [],
  184. defaultIndex: [0, 0, 0],
  185. filterData: [
  186. [{
  187. label: '推荐',
  188. value: '',
  189. }],
  190. [{
  191. label: '服务热度',
  192. value: '0',
  193. },
  194. {
  195. label: '从高到低',
  196. value: '1',
  197. },
  198. {
  199. label: '从低到高',
  200. value: '2',
  201. }
  202. ],
  203. [{
  204. label: '距离',
  205. value: '0',
  206. },
  207. {
  208. label: '从远到近',
  209. value: '2',
  210. },
  211. {
  212. label: '从近到远',
  213. value: '1',
  214. }
  215. ],
  216. ],
  217. list: [{
  218. name: '综合',
  219. id: 1
  220. }, {
  221. name: '距离',
  222. id: 2
  223. }, {
  224. name: '销量',
  225. id: 3
  226. }, {
  227. name: '好评',
  228. id: 4
  229. }],
  230. listIndex: 0,
  231. city: '请选择城市',
  232. latitude: '',
  233. longitude: '',
  234. orderList: [],
  235. page: 1,
  236. limit: 10,
  237. token: '',
  238. XCXIsSelect: '否',
  239. isVip: false,
  240. myId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : '',
  241. showModal: true,
  242. arr: [],
  243. tab: '',
  244. massageTypeId: '',
  245. cityList: [],
  246. tablist: [],
  247. tabIndex: 0,
  248. orderIndex: 0
  249. }
  250. },
  251. onLoad(e) {
  252. console.log(e.massageTypeId)
  253. let that = this
  254. that.massageTypeId = e.massageTypeId
  255. uni.getLocation({
  256. type: 'gcj02',
  257. geocode: true, //设置该参数为true可直接获取经纬度及城市信息
  258. success: function(res) {
  259. console.log(res, '地理位置')
  260. that.latitude = res.latitude
  261. that.longitude = res.longitude
  262. that.page = 1
  263. that.getTypeList();
  264. },
  265. fail: function() {
  266. console.log('获取地址失败')
  267. // #ifdef APP-PLUS
  268. that.checkPermission();
  269. // #endif
  270. }
  271. })
  272. // 获取邀请码保存到本地
  273. if (e.invitation) {
  274. that.$queue.setData('inviterCode', e.invitation);
  275. }
  276. if (this.myId) {
  277. that.$Request.getT('/app/common/type/235').then(res => { //报名成功通知
  278. if (res.code == 0) {
  279. if (res.data && res.data.value) {
  280. that.arr.push(res.data.value)
  281. }
  282. }
  283. })
  284. that.$Request.getT('/app/common/type/236').then(res => { //活动即将开始提醒
  285. if (res.code == 0) {
  286. if (res.data && res.data.value) {
  287. that.arr.push(res.data.value)
  288. }
  289. }
  290. })
  291. }
  292. },
  293. onShow() {
  294. let that = this
  295. that.getKTCityList();
  296. that.XCXIsSelect = this.$queue.getData("XCXIsSelect");
  297. that.city = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
  298. that.getTpCount();
  299. that.getTpMy();
  300. that.token = uni.getStorageSync('token')
  301. // if (uni.getStorageSync('token')) {
  302. if (that.latitude && that.longitude) {
  303. that.page = 1
  304. that.getlist()
  305. } else {
  306. uni.getLocation({
  307. type: 'gcj02',
  308. geocode: true, //设置该参数为true可直接获取经纬度及城市信息
  309. success: function(res) {
  310. console.log(res, '地理位置')
  311. that.latitude = res.latitude
  312. that.longitude = res.longitude
  313. that.getTypeList();
  314. },
  315. fail: function() {
  316. that.getTypeList();
  317. console.log('获取地址失败')
  318. }
  319. })
  320. }
  321. // }
  322. that.myId = uni.getStorageSync('userId')
  323. // console.log(that.showModal, '------', that.myId)
  324. // #ifdef MP-WEIXIN
  325. //订阅
  326. if (that.myId) {
  327. that.getIsVip()
  328. if (this.showModal) {
  329. // this.openMsg()
  330. }
  331. }
  332. // #endif
  333. },
  334. methods: {
  335. showCityList(){
  336. // #ifdef APP-PLUS
  337. if(this.latitude === '' || this.longitude === ''){
  338. this.checkPermission();
  339. return;
  340. }
  341. // #endif
  342. this.Cityshow = true;
  343. },
  344. async checkPermission() {
  345. let status = permision.isIOS ? await permision.requestIOS('location') : await permision.requestAndroid(
  346. 'android.permission.ACCESS_FINE_LOCATION');
  347. if (status === null || status === 1) {
  348. status = 1;
  349. } else if (status === 2) {
  350. uni.showModal({
  351. content: "系统定位已关闭",
  352. confirmText: "确定",
  353. showCancel: false,
  354. success: function(res) {}
  355. })
  356. } else if (status.code) {
  357. uni.showModal({
  358. content: status.message
  359. })
  360. } else {
  361. uni.showModal({
  362. title: '定位服务已关闭',
  363. content: "您需要打开定位权限,否则我们将无法获得到您附近的项目服务,导致我们无法为您提供服务,请到>设置>隐私>定位服务>中开启【上门服务】定位权限",
  364. confirmText: "设置",
  365. success: function(res) {
  366. if (res.confirm) {
  367. permision.gotoAppSetting();
  368. }
  369. }
  370. })
  371. }
  372. return status;
  373. },
  374. saveImgss(imgs, index) {
  375. console.log(imgs, index)
  376. // let that = this
  377. let imgArr = imgs
  378. // this.imgArr.push(imgs);
  379. // console.log(this.imgArr)
  380. // //预览图片
  381. uni.previewImage({
  382. urls: imgArr,
  383. current: imgArr[index]
  384. });
  385. },
  386. saveImgs(imgs) {
  387. let imgArr = [];
  388. imgArr.push(imgs);
  389. // //预览图片
  390. uni.previewImage({
  391. urls: imgArr,
  392. current: 0
  393. });
  394. },
  395. saveTP() {
  396. if (!this.token) {
  397. uni.navigateTo({
  398. url: '/pages/public/login'
  399. });
  400. return;
  401. }
  402. let userId = this.$queue.getData('userId');
  403. let userName = this.$queue.getData('userName');
  404. this.$queue.showLoading('投票中...');
  405. this.$Request.postJson('/app/message/insertMessage', {
  406. state: 11,
  407. content: this.city,
  408. userName: userName,
  409. userId: userId
  410. })
  411. .then(res => {
  412. if (res.code === 0) {
  413. uni.showToast({
  414. title: '投票成功!'
  415. });
  416. this.getTpCount();
  417. this.getTpMy();
  418. } else {
  419. uni.hideLoading();
  420. uni.showModal({
  421. showCancel: false,
  422. title: '投票失败',
  423. content: res.msg
  424. });
  425. }
  426. });
  427. },
  428. getTpMy() {
  429. this.$Request.getT('/app/message/selectMessageByUserId?page=1&limit=1&state=11').then(res => {
  430. if (res.code == 0) {
  431. if (res.data && res.data.list && res.data.list.length > 0) {
  432. this.tpSel = 1;
  433. } else {
  434. this.tpSel = 2;
  435. }
  436. }
  437. });
  438. },
  439. getTpCount() {
  440. this.$Request.getT('/app/message/selectCityCount?city=' + this.city).then(res => {
  441. if (res.code == 0) {
  442. this.tpCount = res.data ? res.data : 0;
  443. }
  444. });
  445. },
  446. getCity(e) {
  447. console.log(e[0].label);
  448. this.city = e[0].label;
  449. uni.setStorageSync('city', this.city)
  450. this.getKTCityList();
  451. this.page = 1
  452. this.getlist()
  453. },
  454. getKTCityList() {
  455. let cityName = uni.getStorageSync('city') ? uni.getStorageSync('city') : '请选择城市'
  456. // if (cityName === '请选择城市') {
  457. // return;
  458. // }
  459. this.$Request.getT('/app/trip/selectTripList').then(res => {
  460. if (res.code == 0) {
  461. this.cityList = [];
  462. let isOpen = false
  463. res.data.forEach((d, index) => {
  464. if (cityName === d.city) {
  465. isOpen = true;
  466. }
  467. let data = {}
  468. data.label = d.city
  469. data.value = index
  470. this.cityList.push(data);
  471. });
  472. if (!isOpen) {
  473. this.orderList = []
  474. this.showTP = true;
  475. // uni.showToast({
  476. // title: '当前城市暂未开通,请切换城市',
  477. // duration: 2000,
  478. // icon: 'none'
  479. // });
  480. } else {
  481. this.showTP = false;
  482. }
  483. }
  484. });
  485. },
  486. getTypeList() {
  487. this.$Request.get("/app/dict/list", {
  488. type: '服务类型'
  489. }).then(res => {
  490. if (res.code == 0) {
  491. if (res.data) {
  492. this.tablist = res.data
  493. this.tabIndex = res.data[0].id;
  494. this.page = 1;
  495. this.getlist()
  496. }
  497. }
  498. });
  499. },
  500. // selectCity(longitude, latitude) {
  501. // this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
  502. // if (res.code == 0) {
  503. // // this.city = res.data.city ? res.data.city : '未知'
  504. // // uni.setStorageSync('city', res.data.city)
  505. // let data = {
  506. // num: 1,
  507. // size: 10
  508. // }
  509. // this.getData(data)
  510. // }
  511. // });
  512. // },
  513. tanChange(index, item) {
  514. this.orderIndex = index
  515. this.tabIndex = item.id
  516. this.page = 1
  517. this.getlist()
  518. },
  519. // 开启订阅消息
  520. openMsg() {
  521. console.log('订阅消息')
  522. var that = this
  523. uni.getSetting({
  524. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  525. success(ret) {
  526. if (ret.subscriptionsSetting.itemSettings) {
  527. uni.setStorageSync('sendMsg', true)
  528. uni.openSetting({ // 打开设置页
  529. success(rea) {
  530. console.log(rea.authSetting)
  531. }
  532. });
  533. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  534. console.log(99999)
  535. uni.setStorageSync('sendMsg', false)
  536. uni.showModal({
  537. title: '提示',
  538. content: '为了更好的体验,请绑定消息推送',
  539. confirmText: '确定',
  540. cancelText: '取消',
  541. success: function(res) {
  542. if (res.confirm) {
  543. wx.requestSubscribeMessage({
  544. tmplIds: that.arr,
  545. success(re) {
  546. var datas = JSON.stringify(re);
  547. if (datas.indexOf("accept") != -1) {
  548. console.log(re)
  549. // uni.setStorageSync('sendMsg', true)
  550. }
  551. },
  552. fail: (res) => {
  553. console.log(res)
  554. }
  555. })
  556. // uni.setStorageSync('sendMsg', true)
  557. console.log('确认')
  558. that.showModal = false
  559. } else if (res.cancel) {
  560. console.log('取消')
  561. // uni.setStorageSync('sendMsg', false)
  562. that.showModal = true
  563. }
  564. }
  565. })
  566. }
  567. }
  568. })
  569. },
  570. getIsVip() {
  571. this.$Request.get("/app/UserVip/isUserVip").then(res => {
  572. if (res.code == 0) {
  573. this.isVip = res.data
  574. uni.setStorageSync('isVIP', res.data)
  575. }
  576. });
  577. },
  578. onSearch(e) {
  579. // this.artificerName = e;
  580. this.page = 1;
  581. this.getlist()
  582. },
  583. getlist() {
  584. let that=this
  585. if (that.city === '请选择城市') {
  586. return;
  587. }
  588. if(that.tabIndex == 0){
  589. return;
  590. }
  591. // let index = this.list[this.listIndex].id
  592. let index = 2
  593. let data = {
  594. // id: curTab,
  595. artificerName: that.artificerName,
  596. classifyId: that.tabIndex,
  597. page: that.page,
  598. limit: that.limit,
  599. // condition: this.value1, //智能优选
  600. // authentication: this.value2, //不限男女
  601. by: index, //价格
  602. latitude: that.latitude,
  603. longitude: that.longitude,
  604. city: that.city
  605. }
  606. // console.log(data)
  607. that.$Request.get("/app/artificer/selectArtificerList", data).then(res => {
  608. that.loading = false;
  609. if (res.code == 0) {
  610. if (that.page == 1) {
  611. that.orderList = []
  612. }
  613. for (var i = 0; i < res.data.list.length; i++) {
  614. if (res.data.list[i].lifePhoto) {
  615. res.data.list[i].lifePhoto = res.data.list[i].lifePhoto.split(',')
  616. }
  617. if (res.data.list[i].distance > 1000) {
  618. res.data.list[i].distance = (res.data.list[i].distance / 1000).toFixed(1) +
  619. 'km'
  620. } else {
  621. res.data.list[i].distance = (res.data.list[i].distance).toFixed(1) + 'm'
  622. }
  623. }
  624. if (that.page == 1) {
  625. that.orderList = res.data.list
  626. } else {
  627. that.orderList = [...that.orderList, ...res.data.list]
  628. }
  629. }
  630. uni.stopPullDownRefresh();
  631. })
  632. },
  633. // 切换菜单
  634. tabChange() {
  635. if (uni.getStorageSync('sendMsg')) {
  636. console.log('授权+1')
  637. wx.requestSubscribeMessage({
  638. tmplIds: this.arr,
  639. success(re) {
  640. console.log(JSON.stringify(re), 111111111111)
  641. var datas = JSON.stringify(re);
  642. if (datas.indexOf("accept") != -1) {
  643. // console.log(re)
  644. }
  645. },
  646. fail: (res) => {
  647. // console.log(res)
  648. }
  649. })
  650. }
  651. this.defaultIndex = [0, 0, 0]
  652. // this.$refs.uDropdown.close();
  653. this.page = 1
  654. this.getlist()
  655. },
  656. // 筛选
  657. change(index) {
  658. // this.value1 = e[0][0].value
  659. // this.value2 = e[1][0].value
  660. // this.value3 = e[2][0].value
  661. this.listIndex = index
  662. this.page = 1
  663. this.getlist()
  664. },
  665. // 选择城市
  666. goSelectCity() {
  667. // uni.navigateTo({
  668. // url: '/pages/index/citys/citys'
  669. // });
  670. let that = this
  671. uni.chooseLocation({
  672. success: function(res) {
  673. console.log('位置名称:' + res.name);
  674. console.log('详细地址:' + res.address);
  675. console.log('纬度:' + res.latitude);
  676. console.log('经度:' + res.longitude);
  677. that.latitude = res.latitude
  678. that.longitude = res.longitude
  679. uni.setStorageSync('latitude', res.latitude)
  680. uni.setStorageSync('longitude', res.longitude)
  681. that.selectCity(that.longitude, that.latitude);
  682. }
  683. });
  684. },
  685. selectCity(longitude, latitude) {
  686. this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
  687. if (res.code == 0) {
  688. this.city = res.data.city ? res.data.city : '未知'
  689. uni.setStorageSync('city', res.data.city)
  690. this.page = 1
  691. this.getlist()
  692. }
  693. });
  694. },
  695. // 乐享低价
  696. goLowTaking() {
  697. uni.navigateTo({
  698. url: '/pages/index/order/lowTaking'
  699. });
  700. },
  701. // 跳转游戏列表
  702. goNav(url) {
  703. console.log(url, '1111112333')
  704. if (uni.getStorageSync('sendMsg')) {
  705. console.log('授权+1')
  706. wx.requestSubscribeMessage({
  707. tmplIds: this.arr,
  708. success(re) {
  709. console.log(JSON.stringify(re), 111111111111)
  710. var datas = JSON.stringify(re);
  711. if (datas.indexOf("accept") != -1) {
  712. console.log(re)
  713. }
  714. },
  715. fail: (res) => {
  716. console.log(res)
  717. }
  718. })
  719. }
  720. if (url.indexOf('/pages/') !== -1) {
  721. uni.navigateTo({
  722. url
  723. });
  724. } else {
  725. //#ifndef H5
  726. uni.navigateTo({
  727. url: '/pages/index/webView?url=' + url
  728. });
  729. //#endif
  730. //#ifdef H5
  731. window.location.href = url;
  732. //#endif
  733. }
  734. },
  735. // 跳转搜索
  736. goSearch(index) {
  737. if (uni.getStorageSync('sendMsg')) {
  738. console.log('授权+1')
  739. wx.requestSubscribeMessage({
  740. tmplIds: this.arr,
  741. success(re) {
  742. // console.log(JSON.stringify(re), 111111111111)
  743. var datas = JSON.stringify(re);
  744. if (datas.indexOf("accept") != -1) {
  745. console.log(re)
  746. }
  747. },
  748. fail: (res) => {
  749. console.log(res)
  750. }
  751. })
  752. }
  753. uni.navigateTo({
  754. url: '/pages/index/search/index?index=' + index
  755. });
  756. },
  757. // 跳转订单
  758. goOrder(e) {
  759. console.log('授权', uni.getStorageSync('sendMsg'))
  760. if (uni.getStorageSync('sendMsg')) {
  761. console.log('授权+1')
  762. wx.requestSubscribeMessage({
  763. tmplIds: this.arr,
  764. success(re) {
  765. console.log(JSON.stringify(re), 111111111111)
  766. var datas = JSON.stringify(re);
  767. if (datas.indexOf("accept") != -1) {
  768. console.log(re)
  769. }
  770. },
  771. fail: (res) => {
  772. console.log(res)
  773. }
  774. })
  775. }
  776. if (this.token) {
  777. uni.navigateTo({
  778. url: '/pages/therapist/orderDetail?artificerId=' + e.artificerId
  779. });
  780. } else {
  781. uni.navigateTo({
  782. url: '/pages/public/login'
  783. });
  784. }
  785. },
  786. },
  787. onReachBottom: function() {
  788. this.page = this.page + 1;
  789. this.getlist()
  790. },
  791. onPullDownRefresh: function() {
  792. this.page = 1;
  793. this.getlist()
  794. },
  795. }
  796. </script>
  797. <style lang="scss">
  798. // page {
  799. // background: linear-gradient( 180deg, #FFE5ED 0%, #F6F6F6 500rpx);
  800. // overflow: hidden;
  801. // }
  802. .therapist{
  803. background: linear-gradient( 180deg, #FFE5ED 0%, #F6F6F6 500rpx);
  804. overflow: hidden;
  805. height: 100VH;
  806. }
  807. .list{
  808. max-height: 86vh;
  809. overflow: auto;
  810. margin-top: 30px;
  811. padding-bottom: 200rpx;
  812. }
  813. .search ::v-deep .u-content,.search ::v-deep input{
  814. background: #FFFFFF!important;
  815. }
  816. .jishi_name{
  817. max-width: 120rpx;
  818. text-overflow: ellipsis;
  819. white-space: nowrap;
  820. overflow: hidden;
  821. }
  822. .zz_view {
  823. display: flex;
  824. line-height: 40rpx;
  825. text-align: center;
  826. font-size: 24rpx;
  827. .zz_label{
  828. width: 120rpx;
  829. background: #4B2F20;
  830. border-radius: 32rpx 0 0 32rpx;
  831. color: #FFFFFF;
  832. }
  833. .zz_value{
  834. width: 88rpx;
  835. border-radius: 0 32rpx 32rpx 0;
  836. background: #EECEAC;
  837. color: #4B2F20;
  838. }
  839. }
  840. .zpmore_view {
  841. background: #07BF89;
  842. width: 128rpx;
  843. height: 40rpx;
  844. text-align: center;
  845. border-radius: 32rpx;
  846. line-height: 40rpx;
  847. font-size: 24rpx;
  848. color: #FFFFFF;
  849. margin-left: 10rpx;
  850. }
  851. .byy_view {
  852. background: #ebebeb;
  853. width: 120upx;
  854. text-align: center;
  855. border-radius: 50rpx;
  856. height: 46rpx;
  857. line-height: 46rpx;
  858. font-size: 24rpx;
  859. color: #000000;
  860. // border: 3upx solid #999999;
  861. margin-top: 6rpx;
  862. }
  863. .kfw_view {
  864. background: #ffaa00;
  865. width: 120upx;
  866. text-align: center;
  867. border-radius: 50rpx;
  868. height: 46rpx;
  869. line-height: 46rpx;
  870. font-size: 24rpx;
  871. color: #FFFFFF;
  872. margin-top: 6rpx;
  873. }
  874. .kyy_view {
  875. background: #DCFFEA;
  876. width: 120upx;
  877. text-align: center;
  878. border-radius: 36rpx;
  879. height: 40rpx;
  880. line-height: 40rpx;
  881. font-size: 24rpx;
  882. color: #54CC84;
  883. }
  884. .kyy_view,.kfw_view,.byy_view{
  885. margin-top: -10rpx;
  886. z-index: 9;
  887. }
  888. .bg {
  889. background: #FFFFFF;
  890. }
  891. .ytp_view {
  892. background: #e3e3e3;
  893. width: 400rpx;
  894. border-radius: 10rpx;
  895. font-size: 28rpx;
  896. text-align: center;
  897. height: 80rpx;
  898. line-height: 80rpx;
  899. color: #848484;
  900. margin-top: 40rpx;
  901. }
  902. .tp_view {
  903. background: #ee6c54;
  904. width: 400rpx;
  905. border-radius: 10rpx;
  906. font-size: 28rpx;
  907. text-align: center;
  908. height: 80rpx;
  909. line-height: 80rpx;
  910. color: #FFFFFF;
  911. margin-top: 40rpx;
  912. }
  913. .sticky-tabs {
  914. z-index: 990;
  915. position: sticky;
  916. top: var(--window-top);
  917. // background-color: #fff;
  918. }
  919. /* // 使用mescroll-uni,则top为0 */
  920. .mescroll-uni,
  921. /deep/.mescroll-uni {
  922. .sticky-tabs {
  923. top: 0;
  924. }
  925. }
  926. .demo-tip {
  927. padding: 18upx;
  928. font-size: 24upx;
  929. text-align: center;
  930. }
  931. .line_s {
  932. display: inline-flex;
  933. width: 10rpx;
  934. height: 10rpx;
  935. background: #1AD566;
  936. border-radius: 50%;
  937. margin-right: 10rpx;
  938. }
  939. .line_x {
  940. display: inline-flex;
  941. width: 10rpx;
  942. height: 10rpx;
  943. background: #000000;
  944. border-radius: 50%;
  945. margin-right: 10rpx;
  946. }
  947. .box {
  948. // border: 3rpx solid #005dff;
  949. background: #E8FAE1;
  950. color: #2FB57A;
  951. padding: 5rpx 15rpx;
  952. font-size: 26rpx;
  953. letter-spacing: 2rpx;
  954. border-radius: 8rpx;
  955. // margin-top: 10rpx;
  956. margin-right: 8upx;
  957. }
  958. .actve {
  959. font-size: 30rpx;
  960. font-family: PingFang SC;
  961. font-weight: 800;
  962. color: #20C675;
  963. }
  964. .tabview1 {
  965. padding: 20rpx 20rpx;
  966. // width: 686upx;
  967. // height: 100upx;
  968. margin-top: 60upx;
  969. // z-index: 99;
  970. // display: flex;
  971. // line-height: 100upx;
  972. .tabview {
  973. // width: 686upx;
  974. // // height: 100upx;
  975. background: #F2FFF9;
  976. border-radius: 24rpx 24rpx 0 0;
  977. // margin-top: -50upx;
  978. // z-index: 99;
  979. display: flex;
  980. line-height: 100upx;
  981. .tabItem_sel {
  982. font-size: 30upx;
  983. font-family: PingFang SC;
  984. font-weight: 800;
  985. color: #20C675;
  986. flex: 1;
  987. text-align: center;
  988. }
  989. .tabItem {
  990. font-size: 26upx;
  991. font-family: PingFang SC;
  992. font-weight: 500;
  993. color: #333333;
  994. flex: 1;
  995. text-align: center;
  996. }
  997. }
  998. .tabsx {
  999. width: 686upx;
  1000. border-radius: 24rpx;
  1001. padding-bottom: 10rpx;
  1002. display: flex;
  1003. align-items: center;
  1004. justify-content: space-between;
  1005. padding: 20rpx 30rpx;
  1006. font-size: 26rpx;
  1007. .active {
  1008. color: #20C675;
  1009. font-size: 30rpx;
  1010. font-weight: bold;
  1011. }
  1012. }
  1013. }
  1014. </style>