shopList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <view class="box">
  3. <view class="allShop">
  4. <view class="topView">
  5. <view class="search">
  6. <!-- 120rpx -->
  7. <view class="searchVIew">
  8. <image src="../../static/img/icon_search.png" mode="" class="searchIMg"></image>
  9. <input type="text" value="" placeholder-style="color:#999999" placeholder="请输入门店名称"
  10. class="searchInput" v-model="shopName" @confirm="searchList" />
  11. <image src="../../static/img/icon_search_del.png" v-show="shopName" mode="" class="ssScImg"
  12. @click="searchSc"></image>
  13. </view>
  14. </view>
  15. <view class="screen">
  16. <view class="screenLine">
  17. <view class="screenLineTxt" @click="showCity=true,comprehensiveShow=false,levelShow=false">
  18. {{cityname}}
  19. </view>
  20. <image src="../../static/img/icon_arrow_gray.png" mode="" v-show="!showCity" class="screenJt">
  21. </image>
  22. </view>
  23. <view class="screenLine" @click="juli" :class="{colorCS:comprehensiveShow}">
  24. <view class="screenLineTxt" v-if="comprehensive==0">综合排序</view>
  25. <view class="screenLineTxt" v-if="comprehensive==1">距离最近</view>
  26. <view class="screenLineTxt" v-if="comprehensive==2">评分最高</view>
  27. <image src="../../static/img/icon_arrow_gray.png" mode="" v-show="!comprehensiveShow"
  28. class="screenJt"></image>
  29. </view>
  30. <!-- 综合排序 -->
  31. <view class="shoplevelBox " v-show="comprehensiveShow" @click="comprehensiveShow=false">
  32. <view class="shoplevelCont ">
  33. <view class="comprehensivebox">
  34. <view class="comprehensiveLine" :class="{comprehensiveACtive:comprehensive==0}"
  35. @click.stop="comprehensiveClick(0)">综合排序</view>
  36. <view class="comprehensiveLine" :class="{comprehensiveACtive:comprehensive==1}"
  37. @click.stop="comprehensiveClick(1)">距离最近</view>
  38. <view class="comprehensiveLine" :class="{comprehensiveACtive:comprehensive==2}"
  39. @click.stop="comprehensiveClick(2)">评分最高</view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 综合排序 -->
  44. </view>
  45. </view>
  46. <view class="shopLineBox">
  47. <view class="shopline" v-for="(item,index) in queryShopList" @click="goDetail(item)">
  48. <view class="shoplineLeft">
  49. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  50. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  51. </view>
  52. <view class="shopright">
  53. <view class="shopTop">
  54. <view class="shopName">{{item.shopName}}</view>
  55. <!-- <image src="../../static/img/shopcall.png" mode="" class="shopCallImg"></image> -->
  56. </view>
  57. <view class="brandsBg">
  58. <span class="shopScore1" v-if="item.shopScore">{{item.shopScore}}</span>
  59. <span class="shopScore2" v-if="item.shopScore">分</span>
  60. <span class="shopScore2" v-if="!item.shopScore">暂无评分</span>
  61. <view class="brands" v-if="item.brands" v-for="(barnd,index2) in item.brands.split(',')">
  62. {{barnd}}</view>
  63. </view>
  64. <view class="timeBg">
  65. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  66. v-if="item.endTime">{{item.endTime}}</span> </view>
  67. <span class="shopScore3">服务次数 {{item.sheetSum}}</span>
  68. </view>
  69. <view class="shopBottom">
  70. <view class="shopBottomLeft">
  71. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  72. <span class="shopaddress">{{item.address}}</span>
  73. </view>
  74. <!-- <view class="Btn" @click="ckshop(item)">确定</view> -->
  75. </view>
  76. </view>
  77. </view>
  78. <view v-if="queryShopList==''" class="nodataBox">
  79. <image src="../../static/img/nodata.png" mode="widthFix" class="nodataImg"></image>
  80. <view class="noTxt">暂无数据</view>
  81. </view>
  82. </view>
  83. </view>
  84. <chose-city @selectCity="selectCity" v-if="showCity" @closeModal="closeModal"></chose-city>
  85. </view>
  86. </template>
  87. <script>
  88. import choseCity from "@/components/chose-city/chose-city"
  89. export default {
  90. components: {
  91. choseCity
  92. },
  93. data() {
  94. return {
  95. location: '',
  96. cityname: '上海市',
  97. queryShopList: '',
  98. shopName: '',
  99. level: '',
  100. comprehensive: 1,
  101. shopLevel: [{
  102. name: '洗剪点',
  103. ckeck: false
  104. }, {
  105. name: 'VIIIP',
  106. ckeck: false
  107. }],
  108. levelShow: false,
  109. comprehensiveShow: false,
  110. showCity: false,
  111. uid: '',
  112. }
  113. },
  114. onShow() {
  115. this.showCity = false;
  116. this.levelShow = false;
  117. this.comprehensiveShow = false;
  118. // this.$common.isUserId();
  119. this.location = uni.getStorageSync("location");
  120. if (this.location) {
  121. this.cityname = this.location.cityname
  122. }
  123. // this.uid = uni.getStorageSync("logodata").uid;
  124. // if (this.uid) {
  125. this.getqueryShopList() //获取全部门店列表
  126. // this.getqueryBShopLevel() //查询门店等级
  127. // }
  128. },
  129. onLoad() {
  130. },
  131. methods: {
  132. mdlx() {
  133. this.levelShow = !this.levelShow;
  134. this.comprehensiveShow = false;
  135. this.showCity = false
  136. },
  137. juli() {
  138. this.comprehensiveShow = !this.comprehensiveShow;
  139. this.levelShow = false;
  140. this.showCity = false
  141. },
  142. searchList() {
  143. this.getqueryShopList() //获取全部门店列表
  144. },
  145. searchSc() {
  146. this.shopName = '';
  147. this.getqueryShopList() //获取全部门店列表
  148. },
  149. selectCity(item) {
  150. console.log('-您选择的城市-', item)
  151. this.location.cityname = item.name;
  152. this.location.cityCode = item.citycode;
  153. this.cityname = item.name;
  154. console.log(this.location)
  155. uni.setStorage({
  156. key: 'location',
  157. data: this.location,
  158. success: function() {}
  159. });
  160. this.showCity = false;
  161. this.getqueryShopList() //获取全部门店列表
  162. },
  163. closeModal() {
  164. this.showCity = false
  165. },
  166. getqueryShopList() {
  167. uni.showLoading({});
  168. this.$http('worldKeepCar/worldHome/getWorldShopInfoList', {
  169. name: this.shopName,
  170. lat: this.location.lat ? this.location.lat : '',
  171. lng: this.location.lng ? this.location.lng : '',
  172. cityCode: this.location.cityCode ? this.location.cityCode : '',
  173. comprehensive: this.comprehensive,
  174. }, 'GET').then(res => {
  175. uni.hideLoading();
  176. this.queryShopList = res.data
  177. // 处理 undefined和null转为空白字符串
  178. this.queryShopList.forEach((item, index) => {
  179. for (const key in item) {
  180. item[key] = this.$praseStrEmpty(item[key])
  181. }
  182. })
  183. })
  184. },
  185. getqueryBShopLevel() {
  186. this.$http('miniAppShopInfoController/queryBShopLevel', {
  187. }, 'GET').then(res => {
  188. res.data.forEach(item => {
  189. item.ckeck = false;
  190. })
  191. this.shopLevel = res.data
  192. })
  193. },
  194. levelClick(item) {
  195. item.ckeck = !item.ckeck
  196. },
  197. shoplevelReset() {
  198. this.shopLevel.forEach(item => {
  199. item.ckeck = false;
  200. })
  201. // this.getqueryShopList()
  202. //this.levelShow=false;
  203. },
  204. shoplevelsbu() {
  205. var arr = []
  206. this.shopLevel.forEach(item => {
  207. if (item.ckeck) {
  208. arr.push(item.id)
  209. }
  210. })
  211. this.level = arr.join(',')
  212. console.log(this.level)
  213. this.levelShow = false;
  214. this.getqueryShopList()
  215. },
  216. comprehensiveClick(num) {
  217. this.comprehensive = num;
  218. this.comprehensiveShow = false;
  219. this.getqueryShopList()
  220. },
  221. goDetail(item) {
  222. uni.navigateTo({
  223. url: '../shop/shopDetail?id=' + item.shopId
  224. })
  225. }
  226. }
  227. }
  228. </script>
  229. <style scoped>
  230. .box {
  231. min-height: 100vh;
  232. background: #F4F5F7;
  233. }
  234. .allShop {
  235. /* background: #FFFFFF; */
  236. }
  237. .topView {
  238. position: fixed;
  239. width: 100%;
  240. height: 170rpx;
  241. background-color: #FFFFFF;
  242. z-index: 11;
  243. }
  244. .searchIMg {
  245. width: 40rpx;
  246. height: 40rpx;
  247. margin-top: 16rpx;
  248. margin-left: 20rpx;
  249. }
  250. .ssScImg {
  251. width: 40rpx;
  252. height: 40rpx;
  253. margin-top: 16rpx;
  254. }
  255. .search {
  256. padding: 24rpx;
  257. background: #FFFFFF;
  258. }
  259. .searchVIew {
  260. display: flex;
  261. background: #F4F5F7;
  262. border-radius: 36rpx;
  263. height: 72rpx;
  264. }
  265. .searchInput {
  266. color: #333333;
  267. font-size: 28rpx;
  268. padding-left: 16rpx;
  269. height: 72rpx;
  270. line-height: 72rpx;
  271. width: 570rpx;
  272. }
  273. .screenJt {
  274. width: 24rpx;
  275. height: 24rpx;
  276. margin-top: 7rpx;
  277. margin-left: 5rpx;
  278. }
  279. .screen {
  280. display: flex;
  281. justify-content: space-around;
  282. padding: 0 24rpx 16rpx 24rpx;
  283. border-bottom: 2rpx solid #EEEEEE;
  284. position: relative;
  285. background: #FFFFFF;
  286. height: 60rpx;
  287. }
  288. .screenLine {
  289. display: flex;
  290. color: #333333;
  291. font-size: 28rpx;
  292. }
  293. .shopLineBox {
  294. padding: 190rpx 0rpx 25rpx;
  295. }
  296. .shopBox2 {
  297. margin-top: 20rpx;
  298. padding-bottom: 30rpx;
  299. background: #FFFFFF;
  300. border-radius: 10rpx;
  301. padding-left: 20rpx;
  302. padding-right: 20rpx;
  303. }
  304. .shoplevelBox {
  305. position: fixed;
  306. left: 0;
  307. width: 750rpx;
  308. top: 196rpx;
  309. background: rgba(0, 0, 0, 0.4);
  310. z-index: 11;
  311. border-top: 1px solid #EEEEEE;
  312. border-bottom: 1px solid #EEEEEE;
  313. height: calc(100vh - 196rpx);
  314. }
  315. /* #ifdef H5 */
  316. .shoplevelBox {
  317. top: calc(196rpx + 44px);
  318. }
  319. /* #endif */
  320. .shoplevelCont {
  321. display: flex;
  322. flex-wrap: wrap;
  323. background: #FFFFFF;
  324. padding: 24rpx;
  325. }
  326. .shoplevelLine {
  327. color: #333333;
  328. line-height: 64rpx;
  329. padding: 0 40rpx;
  330. height: 64rpx;
  331. background: #F4F5F7;
  332. border-radius: 32rpx;
  333. margin-right: 20rpx;
  334. margin-bottom: 30rpx;
  335. }
  336. .shoplevelBottom {
  337. display: flex;
  338. justify-content: space-between;
  339. padding-top: 60rpx;
  340. padding-right: 24rpx;
  341. background: #FFFFFF;
  342. padding: 24rpx;
  343. }
  344. .shoplevelReset {
  345. width: 320rpx;
  346. height: 74rpx;
  347. border-radius: 37rpx;
  348. border: 2rpx solid #FF4F00;
  349. text-align: center;
  350. line-height: 74rpx;
  351. font-size: 30rpx;
  352. font-family: PingFangSC-Medium, PingFang SC;
  353. font-weight: 500;
  354. color: #FF4F00;
  355. }
  356. .shoplevelsbu {
  357. width: 320rpx;
  358. height: 74rpx;
  359. background: #FF4F00;
  360. border-radius: 37rpx;
  361. font-size: 30rpx;
  362. font-family: PingFangSC-Medium, PingFang SC;
  363. font-weight: 500;
  364. color: #FFFFFF;
  365. text-align: center;
  366. line-height: 74rpx;
  367. border: 2rpx solid #FF4F00;
  368. }
  369. .shoplevalActive {
  370. color: #FF4F00;
  371. background: rgba(255, 79, 0, 0.08);
  372. }
  373. .comprehensiveLine {
  374. /* width: 200rpx;
  375. height: 60rpx;
  376. line-height: 60rpx;
  377. text-align: center;
  378. border: 1px solid rgb(228, 228, 228);
  379. border-radius: 10rpx; */
  380. font-size: 26rpx;
  381. font-family: PingFangSC-Regular, PingFang SC;
  382. font-weight: 400;
  383. color: #333333;
  384. padding: 25rpx 0;
  385. }
  386. .comprehensivebox {
  387. /* display: flex;justify-content: space-around; */
  388. }
  389. .comprehensiveACtive {
  390. color: #FF4F00;
  391. }
  392. .nodataImg {
  393. width: 400rpx;
  394. padding-top: 100rpx;
  395. }
  396. .noTxt {
  397. font-size: 36rpx;
  398. color: #999999;
  399. padding-top: 50rpx;
  400. }
  401. .nodataBox {
  402. text-align: center;
  403. }
  404. .shopImg {
  405. width: 146rpx;
  406. height: 146rpx;
  407. border-radius: 6rpx;
  408. }
  409. .shopBox {
  410. padding-top: 30rpx;
  411. display: flex;
  412. }
  413. .flex {
  414. display: flex;
  415. justify-content: space-between;
  416. }
  417. .shopCont {
  418. padding-left: 22rpx;
  419. width: 520rpx;
  420. }
  421. .shopName {
  422. color: #333333;
  423. font-size: 26rpx;
  424. font-weight: 600;
  425. }
  426. .span1 {
  427. color: #FF4F00;
  428. font-size: 36rpx;
  429. }
  430. .span2 {
  431. color: #FF4F00;
  432. font-size: 22rpx;
  433. }
  434. .span3 {
  435. color: #333333;
  436. font-size: 22rpx;
  437. padding-left: 22rpx;
  438. }
  439. .shopBq {
  440. color: #FF4F00;
  441. font-size: 22rpx;
  442. border-radius: 4rpx;
  443. border: 1px solid #FF4F00;
  444. line-height: 30rpx;
  445. height: 30rpx;
  446. padding: 0rpx 5rpx;
  447. margin-top: 10rpx;
  448. }
  449. .brandsBg {
  450. display: flex;
  451. flex-wrap: wrap;
  452. align-items: center;
  453. }
  454. .brands {
  455. border-radius: 4rpx;
  456. line-height: 30rpx;
  457. padding: 0 8rpx;
  458. color: #FF5800;
  459. height: 30rpx;
  460. border: 1px solid #FF5800;
  461. margin-right: 14rpx;
  462. font-size: 24rpx;
  463. line-height: 30rpx;
  464. }
  465. .timeBg {
  466. display: flex;
  467. align-items: center;
  468. padding-top: 10rpx;
  469. }
  470. .shopTime {
  471. color: #666666;
  472. font-size: 22rpx;
  473. }
  474. .addressBox {
  475. color: #666666;
  476. font-size: 22rpx;
  477. }
  478. .shopNameSearchInput {
  479. width: 500rpx;
  480. }
  481. .colorCS {
  482. color: #FF4F00;
  483. }
  484. .shopbox {
  485. padding: 0 16rpx;
  486. }
  487. .shopline {
  488. padding: 20rpx;
  489. background: #FFFFFF;
  490. border-radius: 10rpx;
  491. margin-top: 20rpx;
  492. display: flex;
  493. }
  494. .shopImg {
  495. width: 146rpx;
  496. height: 146rpx;
  497. border-radius: 10rpx;
  498. }
  499. .shopCallImg {
  500. width: 38rpx;
  501. height: 46rpx;
  502. }
  503. .shopTop {
  504. display: flex;
  505. justify-content: space-between;
  506. width: 510rpx;
  507. }
  508. .shopright {
  509. padding-left: 20rpx;
  510. }
  511. .shopName {
  512. font-size: 26rpx;
  513. color: #333333;
  514. line-height: 37rpx;
  515. width: 450rpx;
  516. white-space: nowrap;
  517. overflow: hidden;
  518. text-overflow: ellipsis;
  519. }
  520. .shopScore1 {
  521. font-size: 36rpx;
  522. color: #FF4F00;
  523. }
  524. .shopScore2 {
  525. font-size: 22rpx;
  526. color: #FF4F00;
  527. margin-right: 14rpx;
  528. }
  529. .shopScore3 {
  530. font-size: 22rpx;
  531. color: #333333;
  532. padding-left: 20rpx;
  533. }
  534. .Btn {
  535. width: 104rpx;
  536. height: 56rpx;
  537. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  538. border-radius: 6rpx;
  539. font-size: 26rpx;
  540. text-align: center;
  541. color: #FFFFFF;
  542. line-height: 56rpx;
  543. }
  544. .shopBottom {
  545. display: flex;
  546. }
  547. .shopBottomLeft {
  548. width: 500rpx;
  549. font-size: 22rpx;
  550. color: #666666;
  551. line-height: 30rpx;
  552. padding-top: 10rpx;
  553. }
  554. .shopaddress {
  555. padding-left: 10rpx;
  556. }
  557. </style>