therapist.vue 30 KB

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