app-shop.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="app-shop">
  3. <view class="app-item dir-left-nowrap main-between cross-center" v-for="(item, index) in list" :key="index">
  4. <view class="app-left dir-left-nowrap main-left cross-top">
  5. <app-jump-button form backgroundColor="white" arrangement="left" open_type="navigate" :url="`/pages/store/detail?id=${item.id}`">
  6. <image class="app-image" :style="{backgroundImage: `url(${item.pic_url})`}"></image>
  7. <view class="app-content dir-top-nowrap main-right" :class="{'main-center': !showName || !showScore || !showTel}">
  8. <text class="app-text t-omit" v-if="showName">{{item.name}}</text>
  9. <view class="app-score dir-left-nowrap main-left" v-if="showScore">
  10. <text>评分: </text>
  11. <view class="app-love">
  12. <image
  13. class="navPicUrl app-icon image-no-rep image-cover"
  14. v-for="(score) in item.score"
  15. :key="score"
  16. :src="scorePicUrl ? scorePicUrl : '../../../static/image/icon/store-score.png'"
  17. ></image>
  18. </view>
  19. </view>
  20. <text class="app-phone" v-if="showTel">电话: {{item.mobile}}</text>
  21. <text class="app-distance" v-if="item.distance">距离: {{item.distance}}</text>
  22. </view>
  23. </app-jump-button>
  24. </view>
  25. <view class="app-jump">
  26. <app-jump-button open_type="map" arrangement="column" form backgroundColor="white" :latitude="item.latitude" :longitude="item.longitude">
  27. <image :src="navPicUrl ? navPicUrl : '../../../static/image/icon/navigation.png'" class="scorePicUrl app-icon image-no-rep image-cover"></image>
  28. <text class="app-text">一键导航</text>
  29. </app-jump-button>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'app-shop',
  37. props: {
  38. list: {
  39. type: Array,
  40. default: function() {
  41. return [
  42. ]
  43. }
  44. },
  45. navPicUrl: {
  46. type: String,
  47. default: function() {
  48. return "";
  49. }
  50. },
  51. scorePicUrl: {
  52. type: String,
  53. default: function() {
  54. return "";
  55. }
  56. },
  57. showName: {
  58. type: Boolean,
  59. default: function() {
  60. return true;
  61. }
  62. },
  63. showScore: {
  64. type: Boolean,
  65. default: function() {
  66. return true;
  67. }
  68. },
  69. showTel: {
  70. type: Boolean,
  71. default: function() {
  72. return true;
  73. }
  74. },
  75. scrollTop: {
  76. type: Number,
  77. default: function() {
  78. return 0;
  79. }
  80. },
  81. value: {
  82. type: Boolean,
  83. default: function() {
  84. return true;
  85. }
  86. }
  87. },
  88. data() {
  89. return {
  90. height: 0,
  91. request: true
  92. }
  93. },
  94. created() {
  95. let that = this;
  96. wx.getSystemInfo({
  97. success: function(response) {
  98. that.height = response.windowHeight;
  99. }
  100. })
  101. },
  102. methods: {
  103. autoEnd() {
  104. this.$lazyLoadingData('app-shop').then(response => {
  105. if (response[0].height + response[0].top < this.height) {
  106. this.request = false;
  107. this.$emit('input', this.request);
  108. }
  109. });
  110. },
  111. },
  112. watch: {
  113. scrollTop: {
  114. handler: function(n,o) {
  115. if (n > o && this.request) this.autoEnd();
  116. }
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .app-item {
  123. height: #{219rpx};
  124. width: #{750rpx};
  125. border-bottom: #{1rpx} solid #e2e2e2;
  126. background-color: white;
  127. overflow: hidden;
  128. .app-left {
  129. margin-left: #{24rpx};
  130. height: #{219rpx};
  131. width: #{619rpx};
  132. .app-image {
  133. height: #{150rpx};
  134. width: #{150rpx};
  135. border-radius: 50%;
  136. background-size: 100% auto;
  137. margin-top: #{35rpx};
  138. }
  139. }
  140. .app-jump {
  141. height: #{219rpx};
  142. width: #{131rpx};
  143. padding-right: #{20rpx};
  144. .app-icon {
  145. width: #{50rpx};
  146. height: #{50rpx};
  147. }
  148. .app-text {
  149. font-size: #{22rpx};
  150. color: #999999;
  151. margin-top: #{16rpx};
  152. }
  153. }
  154. .app-content {
  155. margin-left: #{20rpx};
  156. margin-top: #{20rpx};
  157. width: #{449upx};
  158. .app-text {
  159. font-size: #{28rpx};
  160. color: #353535;
  161. font-weight: bold;
  162. margin-bottom: #{18rpx};
  163. }
  164. .app-phone {
  165. font-size: #{26rpx};
  166. color: #999999;
  167. margin-bottom: #{15rpx};
  168. }
  169. .app-distance {
  170. font-size: #{26rpx};
  171. color: #999999;
  172. margin-bottom: #{15rpx};
  173. }
  174. .app-score {
  175. height: #{26rpx};
  176. margin-bottom: #{15rpx};
  177. line-height: #{26rpx};
  178. >text {
  179. font-size: #{26rpx};
  180. color: #999999;
  181. }
  182. .app-love {
  183. margin-left: #{4rpx};
  184. .app-icon {
  185. width: #{20rpx};
  186. height: #{18rpx};
  187. margin-right: #{4rpx};
  188. }
  189. }
  190. }
  191. }
  192. }
  193. </style>