shopList.vue 12 KB

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