shopList.vue 12 KB

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