123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <template>
- <view class="app-shop">
- <view class="app-item dir-left-nowrap main-between cross-center" v-for="(item, index) in list" :key="index">
- <view class="app-left dir-left-nowrap main-left cross-top">
- <app-jump-button form backgroundColor="white" arrangement="left" open_type="navigate" :url="`/pages/store/detail?id=${item.id}`">
- <image class="app-image" :style="{backgroundImage: `url(${item.pic_url})`}"></image>
- <view class="app-content dir-top-nowrap main-right" :class="{'main-center': !showName || !showScore || !showTel}">
- <text class="app-text t-omit" v-if="showName">{{item.name}}</text>
- <view class="app-score dir-left-nowrap main-left" v-if="showScore">
- <text>评分: </text>
- <view class="app-love">
- <image
- class="navPicUrl app-icon image-no-rep image-cover"
- v-for="(score) in item.score"
- :key="score"
- :src="scorePicUrl ? scorePicUrl : '../../../static/image/icon/store-score.png'"
- ></image>
- </view>
- </view>
- <text class="app-phone" v-if="showTel">电话: {{item.mobile}}</text>
- <text class="app-distance" v-if="item.distance">距离: {{item.distance}}</text>
- </view>
- </app-jump-button>
- </view>
- <view class="app-jump">
- <app-jump-button open_type="map" arrangement="column" form backgroundColor="white" :latitude="item.latitude" :longitude="item.longitude">
- <image :src="navPicUrl ? navPicUrl : '../../../static/image/icon/navigation.png'" class="scorePicUrl app-icon image-no-rep image-cover"></image>
- <text class="app-text">一键导航</text>
- </app-jump-button>
- </view>
- </view>
- </view>
- </template>
- <script>
-
- export default {
- name: 'app-shop',
- props: {
- list: {
- type: Array,
- default: function() {
- return [
- ]
- }
- },
- navPicUrl: {
- type: String,
- default: function() {
- return "";
- }
- },
- scorePicUrl: {
- type: String,
- default: function() {
- return "";
- }
- },
- showName: {
- type: Boolean,
- default: function() {
- return true;
- }
- },
- showScore: {
- type: Boolean,
- default: function() {
- return true;
- }
- },
- showTel: {
- type: Boolean,
- default: function() {
- return true;
- }
- },
- scrollTop: {
- type: Number,
- default: function() {
- return 0;
- }
- },
- value: {
- type: Boolean,
- default: function() {
- return true;
- }
- }
- },
- data() {
- return {
- height: 0,
- request: true
- }
- },
- created() {
- let that = this;
- wx.getSystemInfo({
- success: function(response) {
- that.height = response.windowHeight;
- }
- })
- },
- methods: {
- autoEnd() {
- this.$lazyLoadingData('app-shop').then(response => {
- if (response[0].height + response[0].top < this.height) {
- this.request = false;
- this.$emit('input', this.request);
- }
- });
- },
- },
- watch: {
- scrollTop: {
- handler: function(n,o) {
- if (n > o && this.request) this.autoEnd();
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .app-item {
- height: #{219rpx};
- width: #{750rpx};
- border-bottom: #{1rpx} solid #e2e2e2;
- background-color: white;
- overflow: hidden;
- .app-left {
- margin-left: #{24rpx};
- height: #{219rpx};
- width: #{619rpx};
- .app-image {
- height: #{150rpx};
- width: #{150rpx};
- border-radius: 50%;
- background-size: 100% auto;
- margin-top: #{35rpx};
- }
- }
- .app-jump {
- height: #{219rpx};
- width: #{131rpx};
- padding-right: #{20rpx};
- .app-icon {
- width: #{50rpx};
- height: #{50rpx};
- }
- .app-text {
- font-size: #{22rpx};
- color: #999999;
- margin-top: #{16rpx};
- }
- }
- .app-content {
- margin-left: #{20rpx};
- margin-top: #{20rpx};
- width: #{449upx};
- .app-text {
- font-size: #{28rpx};
- color: #353535;
- font-weight: bold;
- margin-bottom: #{18rpx};
- }
- .app-phone {
- font-size: #{26rpx};
- color: #999999;
- margin-bottom: #{15rpx};
- }
- .app-distance {
- font-size: #{26rpx};
- color: #999999;
- margin-bottom: #{15rpx};
- }
- .app-score {
- height: #{26rpx};
- margin-bottom: #{15rpx};
- line-height: #{26rpx};
- >text {
- font-size: #{26rpx};
- color: #999999;
- }
- .app-love {
- margin-left: #{4rpx};
- .app-icon {
- width: #{20rpx};
- height: #{18rpx};
- margin-right: #{4rpx};
- }
- }
- }
- }
- }
- </style>
|