shopList.vue 13 KB

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