shopList.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. }
  79. },
  80. // 下拉刷新
  81. onPullDownRefresh() {
  82. this.getqueryShopList()
  83. setTimeout(function() {
  84. uni.stopPullDownRefresh();
  85. }, 1000);
  86. },
  87. }
  88. </script>
  89. <style scoped>
  90. .box {
  91. min-height: 100vh;
  92. background-color: #F4F5F7;
  93. padding-top: 20rpx;
  94. padding-bottom: 60rpx;
  95. }
  96. .shopline {
  97. margin: 0rpx 24rpx 20rpx;
  98. padding: 20rpx;
  99. background-color: #FFFFFF;
  100. border-radius: 10rpx;
  101. display: flex;
  102. }
  103. .nodataImg {
  104. width: 400rpx;
  105. padding-top: 100rpx;
  106. }
  107. .noTxt {
  108. font-size: 36rpx;
  109. color: #999999;
  110. padding-top: 50rpx;
  111. }
  112. .nodataBox {
  113. text-align: center;
  114. }
  115. .shopImg {
  116. width: 154rpx;
  117. height: 154rpx;
  118. border-radius: 10rpx;
  119. }
  120. .shopBox {
  121. padding-top: 30rpx;
  122. display: flex;
  123. }
  124. .flex {
  125. display: flex;
  126. justify-content: space-between;
  127. }
  128. .shopCont {
  129. padding-left: 22rpx;
  130. width: 520rpx;
  131. }
  132. .span1 {
  133. color: #FF4F00;
  134. font-size: 36rpx;
  135. }
  136. .span2 {
  137. color: #FF4F00;
  138. font-size: 22rpx;
  139. }
  140. .span3 {
  141. color: #333333;
  142. font-size: 22rpx;
  143. padding-left: 22rpx;
  144. }
  145. .shopBq {
  146. color: #FF4F00;
  147. font-size: 22rpx;
  148. border-radius: 4rpx;
  149. border: 1px solid #FF4F00;
  150. line-height: 30rpx;
  151. height: 30rpx;
  152. padding: 0rpx 5rpx;
  153. margin-top: 10rpx;
  154. }
  155. .brandsBg {
  156. display: flex;
  157. align-items: center;
  158. padding: 5rpx 0rpx;
  159. /* 隐藏文字显示 ...不换行 */
  160. overflow: hidden;
  161. text-overflow: ellipsis;
  162. white-space: nowrap;
  163. }
  164. .brands {
  165. border-radius: 4rpx;
  166. padding: 0 5rpx;
  167. color: #F19D01;
  168. height: 28rpx;
  169. border: 1px solid #F19D01;
  170. font-size: 20rpx;
  171. line-height: 28rpx;
  172. margin: 5rpx 10rpx 5rpx 0rpx;
  173. }
  174. .timeBg {
  175. display: flex;
  176. }
  177. .shopTime {
  178. color: #666666;
  179. font-size: 24rpx;
  180. }
  181. .addressBox {
  182. color: #666666;
  183. font-size: 22rpx;
  184. }
  185. .shopNameSearchInput {
  186. width: 500rpx;
  187. }
  188. .colorCS {
  189. color: #FF4F00;
  190. }
  191. .shopbox {
  192. padding: 0 16rpx;
  193. }
  194. .shopCallImg {
  195. width: 38rpx;
  196. height: 46rpx;
  197. }
  198. .shopTop {
  199. display: flex;
  200. justify-content: space-between;
  201. }
  202. .shopright {
  203. padding-left: 20rpx;
  204. width: 510rpx;
  205. }
  206. .shopName {
  207. font-size: 28rpx;
  208. font-weight: bold;
  209. color: #333333;
  210. line-height: 40rpx;
  211. width: 450rpx;
  212. white-space: nowrap;
  213. overflow: hidden;
  214. text-overflow: ellipsis;
  215. }
  216. .shopScore1 {
  217. font-size: 36rpx;
  218. font-weight: bold;
  219. color: #FF4F00;
  220. height: 50rpx;
  221. line-height: 50rpx;
  222. }
  223. .shopScore11 {
  224. font-size: 22rpx;
  225. color: #FF4F00;
  226. margin-right: 14rpx;
  227. }
  228. .shopScore2 {
  229. font-size: 22rpx;
  230. color: #666666;
  231. margin-right: 14rpx;
  232. padding: 8rpx 0;
  233. }
  234. .shopScore3 {
  235. font-size: 22rpx;
  236. color: #333333;
  237. padding-left: 20rpx;
  238. }
  239. .Btn {
  240. width: 104rpx;
  241. height: 56rpx;
  242. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  243. border-radius: 6rpx;
  244. font-size: 26rpx;
  245. text-align: center;
  246. color: #FFFFFF;
  247. line-height: 56rpx;
  248. }
  249. .shopBottom {
  250. display: flex;
  251. }
  252. .shopBottomLeft {
  253. font-size: 25rpx;
  254. color: #666666;
  255. line-height: 30rpx;
  256. padding-top: 10rpx;
  257. display: flex;
  258. justify-content: space-between;
  259. padding-right: 10rpx;
  260. }
  261. .shopaddress {
  262. width: 400rpx;
  263. /* 隐藏文字显示 ...不换行 */
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. }
  268. .noMore {
  269. text-align: center;
  270. line-height: 50rpx;
  271. color: #999999;
  272. font-size: 28rpx;
  273. }
  274. </style>