index.vue 27 KB

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