ckshopList.vue 6.1 KB

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