shopList.vue 13 KB

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