shopList.vue 13 KB

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