shopList.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <view class="box">
  3. <view class="shopline" v-for="(item,index) in queryShopList" @click="goDetail(item)">
  4. <view class="shoplineLeft">
  5. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  6. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  7. </view>
  8. <view class="shopright">
  9. <view class="shopTop">
  10. <view class="shopName">{{item.shopName}}</view>
  11. </view>
  12. <view class="brandsBg" v-if="item.brands">
  13. <view class="brands" v-for="(v,index2) in item.brands.split(',')">{{v}}</view>
  14. </view>
  15. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  16. v-if="item.endTime">{{item.endTime}}</span> </view>
  17. <view class="shopBottomLeft">
  18. <span class="shopaddress"
  19. v-if="item.address">{{item.provinceName}}{{item.cityName}}{{item.areaName}}{{item.address}}</span>
  20. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 上拉 加载更多 -->
  25. <view class="noMore" v-if="noMoreShow && (queryShopList.length!=0)">没有更多数据</view>
  26. <!-- 无数据空白页 -->
  27. <nodata v-if="queryShopList.length==0"></nodata>
  28. </view>
  29. </template>
  30. <script>
  31. import nodata from '../../components/nodata/nodata.vue'
  32. export default {
  33. components: {
  34. nodata,
  35. },
  36. data() {
  37. return {
  38. location: {
  39. lng: '',
  40. lat: '',
  41. },
  42. queryShopList: '',
  43. noMoreShow: false,
  44. }
  45. },
  46. onLoad() {
  47. var that = this;
  48. uni.getLocation({
  49. type: 'gcj02',
  50. success: function(res) {
  51. console.log(res)
  52. that.location.lat = res.latitude
  53. that.location.lng = res.longitude
  54. that.getqueryShopList() //获取全部门店列表
  55. },
  56. fail(err) {
  57. }
  58. });
  59. },
  60. methods: {
  61. getqueryShopList() {
  62. uni.showLoading({
  63. title: '加载中'
  64. })
  65. this.$http('opencarOwnerHome/queryShopInfoList', {
  66. lat: this.location.lat ? this.location.lat : '',
  67. lng: this.location.lng ? this.location.lng : '',
  68. }, 'GET').then(res => {
  69. uni.hideLoading();
  70. this.queryShopList = res.data
  71. console.log('list+=', this.queryShopList);
  72. })
  73. },
  74. goDetail(item) {
  75. // uni.navigateTo({
  76. // url: '../shop/shopDetail?id=' + item.shopId
  77. // })
  78. uni.navigateTo({
  79. url:'onlineBooking?naShopId='+item.shopId
  80. })
  81. }
  82. },
  83. // 下拉刷新
  84. onPullDownRefresh() {
  85. this.getqueryShopList()
  86. setTimeout(function() {
  87. uni.stopPullDownRefresh();
  88. }, 1000);
  89. },
  90. }
  91. </script>
  92. <style scoped>
  93. .box {
  94. min-height: 100vh;
  95. background-color: #F4F5F7;
  96. padding-top: 20rpx;
  97. padding-bottom: 60rpx;
  98. }
  99. .shopline {
  100. margin: 0rpx 24rpx 20rpx;
  101. padding: 20rpx;
  102. background-color: #FFFFFF;
  103. border-radius: 10rpx;
  104. display: flex;
  105. }
  106. .nodataImg {
  107. width: 400rpx;
  108. padding-top: 100rpx;
  109. }
  110. .noTxt {
  111. font-size: 36rpx;
  112. color: #999999;
  113. padding-top: 50rpx;
  114. }
  115. .nodataBox {
  116. text-align: center;
  117. }
  118. .shopImg {
  119. width: 154rpx;
  120. height: 154rpx;
  121. border-radius: 10rpx;
  122. }
  123. .shopBox {
  124. padding-top: 30rpx;
  125. display: flex;
  126. }
  127. .flex {
  128. display: flex;
  129. justify-content: space-between;
  130. }
  131. .shopCont {
  132. padding-left: 22rpx;
  133. width: 520rpx;
  134. }
  135. .span1 {
  136. color: #FF4F00;
  137. font-size: 36rpx;
  138. }
  139. .span2 {
  140. color: #FF4F00;
  141. font-size: 22rpx;
  142. }
  143. .span3 {
  144. color: #333333;
  145. font-size: 22rpx;
  146. padding-left: 22rpx;
  147. }
  148. .shopBq {
  149. color: #FF4F00;
  150. font-size: 22rpx;
  151. border-radius: 4rpx;
  152. border: 1px solid #FF4F00;
  153. line-height: 30rpx;
  154. height: 30rpx;
  155. padding: 0rpx 5rpx;
  156. margin-top: 10rpx;
  157. }
  158. .brandsBg {
  159. display: flex;
  160. align-items: center;
  161. padding: 5rpx 0rpx;
  162. flex-wrap: wrap;
  163. height: 36rpx;
  164. /* 隐藏文字显示 ...不换行 */
  165. overflow: hidden;
  166. text-overflow: ellipsis;
  167. white-space: nowrap;
  168. }
  169. .brands {
  170. border-radius: 4rpx;
  171. padding: 0 5rpx;
  172. color: #F19D01;
  173. height: 28rpx;
  174. border: 1px solid #F19D01;
  175. font-size: 20rpx;
  176. line-height: 28rpx;
  177. margin: 5rpx 10rpx 5rpx 0rpx;
  178. }
  179. .timeBg {
  180. display: flex;
  181. }
  182. .shopTime {
  183. color: #666666;
  184. font-size: 24rpx;
  185. }
  186. .addressBox {
  187. color: #666666;
  188. font-size: 22rpx;
  189. }
  190. .shopNameSearchInput {
  191. width: 500rpx;
  192. }
  193. .colorCS {
  194. color: #FF4F00;
  195. }
  196. .shopbox {
  197. padding: 0 16rpx;
  198. }
  199. .shopCallImg {
  200. width: 38rpx;
  201. height: 46rpx;
  202. }
  203. .shopTop {
  204. display: flex;
  205. justify-content: space-between;
  206. }
  207. .shopright {
  208. padding-left: 20rpx;
  209. width: 510rpx;
  210. }
  211. .shopName {
  212. font-size: 28rpx;
  213. font-weight: bold;
  214. color: #333333;
  215. line-height: 40rpx;
  216. width: 450rpx;
  217. white-space: nowrap;
  218. overflow: hidden;
  219. text-overflow: ellipsis;
  220. }
  221. .shopScore1 {
  222. font-size: 36rpx;
  223. font-weight: bold;
  224. color: #FF4F00;
  225. height: 50rpx;
  226. line-height: 50rpx;
  227. }
  228. .shopScore11 {
  229. font-size: 22rpx;
  230. color: #FF4F00;
  231. margin-right: 14rpx;
  232. }
  233. .shopScore2 {
  234. font-size: 22rpx;
  235. color: #666666;
  236. margin-right: 14rpx;
  237. padding: 8rpx 0;
  238. }
  239. .shopScore3 {
  240. font-size: 22rpx;
  241. color: #333333;
  242. padding-left: 20rpx;
  243. }
  244. .Btn {
  245. width: 104rpx;
  246. height: 56rpx;
  247. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  248. border-radius: 6rpx;
  249. font-size: 26rpx;
  250. text-align: center;
  251. color: #FFFFFF;
  252. line-height: 56rpx;
  253. }
  254. .shopBottom {
  255. display: flex;
  256. }
  257. .shopBottomLeft {
  258. font-size: 25rpx;
  259. color: #666666;
  260. line-height: 30rpx;
  261. padding-top: 10rpx;
  262. display: flex;
  263. justify-content: space-between;
  264. padding-right: 10rpx;
  265. }
  266. .shopaddress {
  267. width: 400rpx;
  268. /* 隐藏文字显示 ...不换行 */
  269. overflow: hidden;
  270. text-overflow: ellipsis;
  271. white-space: nowrap;
  272. }
  273. .noMore {
  274. text-align: center;
  275. line-height: 50rpx;
  276. color: #999999;
  277. font-size: 28rpx;
  278. }
  279. </style>