ckshopList.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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/timg/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. goodsId:'',
  45. }
  46. },
  47. onLoad(opt) {
  48. var that = this;
  49. this.goodsId=opt.goodsId;
  50. uni.getLocation({
  51. type: 'gcj02',
  52. success: function(res) {
  53. console.log(res)
  54. that.location.lat = res.latitude
  55. that.location.lng = res.longitude
  56. that.getqueryShopList() //获取全部门店列表
  57. },
  58. fail(err) {
  59. }
  60. });
  61. },
  62. methods: {
  63. getqueryShopList() {
  64. uni.showLoading({
  65. title: '加载中'
  66. })
  67. this.$http('openMall/openStoreList', {
  68. goodsId:this.goodsId,
  69. lat: this.location.lat ? this.location.lat : '',
  70. lng: this.location.lng ? this.location.lng : '',
  71. }, 'GET').then(res => {
  72. uni.hideLoading();
  73. this.queryShopList = res.data
  74. //console.log('list+=', this.queryShopList);
  75. })
  76. },
  77. goDetail(item) {
  78. this.$store.commit('mutationsckshopInfo', item)
  79. uni.navigateBack({
  80. delta:-1
  81. })
  82. // uni.navigateTo({
  83. // url: '../shop/shopDetail?id=' + item.shopId
  84. // })
  85. }
  86. },
  87. // 下拉刷新
  88. onPullDownRefresh() {
  89. this.getqueryShopList()
  90. setTimeout(function() {
  91. uni.stopPullDownRefresh();
  92. }, 1000);
  93. },
  94. }
  95. </script>
  96. <style scoped>
  97. .box {
  98. min-height: 100vh;
  99. background-color: #F4F5F7;
  100. padding-top: 20rpx;
  101. padding-bottom: 60rpx;
  102. }
  103. .shopline {
  104. margin: 0rpx 24rpx 20rpx;
  105. padding: 20rpx;
  106. background-color: #FFFFFF;
  107. border-radius: 10rpx;
  108. display: flex;
  109. }
  110. .nodataImg {
  111. width: 400rpx;
  112. padding-top: 100rpx;
  113. }
  114. .noTxt {
  115. font-size: 36rpx;
  116. color: #999999;
  117. padding-top: 50rpx;
  118. }
  119. .nodataBox {
  120. text-align: center;
  121. }
  122. .shopImg {
  123. width: 146rpx;
  124. height: 146rpx;
  125. border-radius: 6rpx;
  126. }
  127. .shopBox {
  128. padding-top: 30rpx;
  129. display: flex;
  130. }
  131. .flex {
  132. display: flex;
  133. justify-content: space-between;
  134. }
  135. .shopCont {
  136. padding-left: 22rpx;
  137. width: 520rpx;
  138. }
  139. .shopName {
  140. color: #333333;
  141. font-size: 26rpx;
  142. font-weight: 600;
  143. }
  144. .span1 {
  145. color: #FF4F00;
  146. font-size: 36rpx;
  147. }
  148. .span2 {
  149. color: #FF4F00;
  150. font-size: 22rpx;
  151. }
  152. .span3 {
  153. color: #333333;
  154. font-size: 22rpx;
  155. padding-left: 22rpx;
  156. }
  157. .shopBq {
  158. color: #FF4F00;
  159. font-size: 22rpx;
  160. border-radius: 4rpx;
  161. border: 1px solid #FF4F00;
  162. line-height: 30rpx;
  163. height: 30rpx;
  164. padding: 0rpx 5rpx;
  165. margin-top: 10rpx;
  166. }
  167. .brandsBg {
  168. display: flex;
  169. height: 38rpx;
  170. flex-wrap: wrap;
  171. align-items: center;
  172. overflow: hidden;
  173. padding: 5rpx 0rpx;
  174. }
  175. .brands {
  176. border-radius: 4rpx;
  177. padding: 0 5rpx;
  178. color: #F19D01;
  179. height: 28rpx;
  180. border: 1px solid #F19D01;
  181. font-size: 20rpx;
  182. line-height: 28rpx;
  183. margin: 5rpx 10rpx 5rpx 0rpx;
  184. }
  185. .timeBg {
  186. display: flex;
  187. }
  188. .shopTime {
  189. color: #666666;
  190. font-size: 22rpx;
  191. }
  192. .addressBox {
  193. color: #666666;
  194. font-size: 22rpx;
  195. }
  196. .shopNameSearchInput {
  197. width: 500rpx;
  198. }
  199. .colorCS {
  200. color: #FF4F00;
  201. }
  202. .shopbox {
  203. padding: 0 16rpx;
  204. }
  205. .shopImg {
  206. width: 146rpx;
  207. height: 146rpx;
  208. border-radius: 10rpx;
  209. }
  210. .shopCallImg {
  211. width: 38rpx;
  212. height: 46rpx;
  213. }
  214. .shopTop {
  215. display: flex;
  216. justify-content: space-between;
  217. width: 510rpx;
  218. }
  219. .shopright {
  220. padding-left: 20rpx;
  221. }
  222. .shopName {
  223. font-size: 26rpx;
  224. color: #333333;
  225. line-height: 37rpx;
  226. width: 450rpx;
  227. white-space: nowrap;
  228. overflow: hidden;
  229. text-overflow: ellipsis;
  230. }
  231. .shopScore1 {
  232. font-size: 36rpx;
  233. font-weight: bold;
  234. color: #FF4F00;
  235. height: 50rpx;
  236. line-height: 50rpx;
  237. }
  238. .shopScore11 {
  239. font-size: 22rpx;
  240. color: #FF4F00;
  241. margin-right: 14rpx;
  242. }
  243. .shopScore2 {
  244. font-size: 22rpx;
  245. color: #666666;
  246. margin-right: 14rpx;
  247. padding: 8rpx 0;
  248. }
  249. .shopScore3 {
  250. font-size: 22rpx;
  251. color: #333333;
  252. padding-left: 20rpx;
  253. }
  254. .Btn {
  255. width: 104rpx;
  256. height: 56rpx;
  257. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  258. border-radius: 6rpx;
  259. font-size: 26rpx;
  260. text-align: center;
  261. color: #FFFFFF;
  262. line-height: 56rpx;
  263. }
  264. .shopBottom {
  265. display: flex;
  266. }
  267. .shopBottomLeft {
  268. font-size: 25rpx;
  269. color: #666666;
  270. line-height: 30rpx;
  271. padding-top: 10rpx;
  272. display: flex;
  273. justify-content: space-between;
  274. padding-right: 10rpx;
  275. }
  276. .shopaddress {
  277. width: 400rpx;
  278. /* 隐藏文字显示 ...不换行 */
  279. overflow: hidden;
  280. text-overflow: ellipsis;
  281. white-space: nowrap;
  282. }
  283. .noMore {
  284. text-align: center;
  285. line-height: 50rpx;
  286. color: #999999;
  287. font-size: 28rpx;
  288. }
  289. </style>