index.vue 25 KB

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