商品详情新增相关门店列表、门店页面数据列表统一组件优化

master
gongfuxiang 2022-03-31 23:17:02 +08:00
parent 6a0bb75b11
commit 76a345ef78
12 changed files with 317 additions and 360 deletions

View File

@ -42,6 +42,10 @@ iframe,
.bottom-fixed {
right: 0 !important;
}
.web-html-content iframe {
width: 100% !important;
max-height: 500rpx !important;
}
/**
*
*/

View File

@ -178,4 +178,45 @@
.plugins-blog-grid-list .item .blog-img {
width: 100%;
height: 230rpx !important;
}
/**
* -
*/
.plugins-realstore-data-list .item .address-content {
width: calc(100% - 220rpx);
}
.plugins-realstore-data-list .item .icon-list {
right: 20rpx;
bottom: 20rpx;
}
.plugins-realstore-data-list .item .icon-list .icon-item {
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
}
.plugins-realstore-data-list .item .icon-item .badge-icon {
top: -10px;
right: 2px;
}
.plugins-realstore-data-list .item .icon-list .icon-item:not(:last-child) {
margin-right: 15rpx;
}
.plugins-realstore-data-list .item .logo {
width: 110rpx;
height: 110rpx !important;
}
.plugins-realstore-data-list .item .base-right {
width: calc(100% - 130rpx);
}
.plugins-realstore-data-list .item .base-right .title {
width: calc(100% - 110rpx);
}
.plugins-realstore-data-list .item .base-right .status-icon {
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
top: 20rpx;
right: -1px;
padding: 5rpx 20rpx;
box-shadow: -1px 1px 3px rgb(0 0 0 / 10%);
}

View File

@ -4,14 +4,14 @@
<view v-if="propIsGoods == true" class="goods-chat-container item fl cp">
<block v-if="is_chat == 1">
<view @tap="chat_event">
<image :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<text class="dis-block text-size-xs cr-gray">客服</text>
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<text class="text dis-block text-size-xs cr-gray">客服</text>
</view>
</block>
<block v-else>
<!-- #ifdef MP-WEIXIN || MP-TOUTIAO || MP-BAIDU -->
<button open-type="contact" :show-message-card="propCard" :send-message-title="propTitle" :send-message-path="propPath" :send-message-img="propImg">
<image :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<button open-type="contact">
@ -19,9 +19,9 @@
<!-- #endif -->
<!-- #ifdef H5 || APP -->
<button type="default" @tap="call_event">
<image :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<image class="icon" :src="common_static_url+'chat-icon.png'" mode="scaleToFill"></image>
<!-- #endif -->
<text class="dis-block text-size-xs cr-gray">客服</text>
<text class="text dis-block text-size-xs cr-gray">客服</text>
</button>
</block>
</view>
@ -31,13 +31,13 @@
<movable-view direction="all" :x="x" :y="y" :animation="false" class="online-service-event-submit">
<block v-if="is_chat == 1">
<button type="default" :class="common_ent" @tap="chat_event">
<image :src="common_static_url+'online-service-icon.png'" class="dis-block"></image>
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
</button>
</block>
<block v-else>
<!-- #ifdef MP-WEIXIN || MP-TOUTIAO || MP-BAIDU -->
<button open-type="contact" :class="common_ent" :show-message-card="propCard" :send-message-title="propTitle" :send-message-path="propPath" :send-message-img="propImg">
<image :src="common_static_url+'online-service-icon.png'" class="dis-block"></image>
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
</button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
@ -47,7 +47,7 @@
<!-- #endif -->
<!-- #ifdef H5 || APP -->
<button type="default" :class="common_ent" @tap="call_event">
<image :src="common_static_url+'online-service-icon.png'" class="dis-block"></image>
<image class="icon dis-block" :src="common_static_url+'online-service-icon.png'"></image>
</button>
<!-- #endif -->
</block>
@ -253,7 +253,7 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
background: rgba(0, 0, 0, 0.6);
}
.online-service-event-submit image {
.online-service-event-submit .icon {
width: 21px !important;
height: 21px !important;
}
@ -270,12 +270,12 @@
font-size: 24rpx;
background: transparent;
}
.goods-chat-container image {
.goods-chat-container .icon {
width: 40rpx;
height: 40rpx;
margin: 10rpx 0 5rpx 0;
}
.goods-chat-container .dis-block {
.goods-chat-container .text {
margin-top: -10rpx;
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<view>
<view v-if="(data_list || null) != null && data_list.length > 0" class="plugins-realstore-data-list oh">
<block v-for="(item, index) in data_list" :key="index">
<view class="item bg-white padding-main border-radius-main pr spacing-mb" :data-value="'/pages/plugins/realstore/detail/detail?id='+item.id" @tap="url_event">
<view class="base oh">
<!-- 基础内容 -->
<image :src="item.logo" mode="widthFix" class="logo circle fl br"></image>
<view class="base-right fr">
<view :class="'status-icon pa text-size-xs '+((item.status_info.status == 1) ? 'bg-main cr-white' : 'bg-gray cr-gray')">{{item.status_info.msg}}</view>
<view class="title fw-b text-size single-text">
<text v-if="(item.alias || null) != null" class="va-m title-icon round br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{item.alias}}</text>
<text class="va-m">{{item.name}}</text>
</view>
<view class="margin-top-xs text-size-xs cr-grey">
<view v-if="(item.status_info.time || null) != null">{{item.status_info.time}}</view>
<view v-if="(item.distance || null) != null">{{item.distance}}</view>
</view>
</view>
</view>
<!-- 地址 -->
<view class="margin-top-sm oh cp">
<view class="dis-inline-block va-m">
<uni-icons type="location-filled" size="12" color="#8d8d8d"></uni-icons>
</view>
<view class="address-content single-text cr-base margin-left-xs dis-inline-block text-size-xs va-m" :data-value="item.province_name+item.city_name+item.county_name+item.address" @tap.stop="text_copy_event">{{item.province_name}}{{item.city_name}}{{item.county_name}}{{item.address}}</view>
</view>
<!-- 右侧操作 -->
<view class="icon-list pa">
<view v-if="(item.lat != 0 && item.lng != 0)" class="icon-item bg-green circle dis-inline-block tc cp" :data-index="index" @tap.stop="address_map_event">
<uni-icons type="paperplane-filled" size="12" color="#fff"></uni-icons>
</view>
<view v-if="(item.service_tel || null) != null" class="icon-item bg-yellow circle dis-inline-block tc cp" :data-value="item.service_tel" @tap.stop="tel_event">
<uni-icons type="phone-filled" size="12" color="#fff"></uni-icons>
</view>
<view v-if="propIsFavor" :class="'icon-item circle dis-inline-block tc cp pr '+((item.is_favor || 0) == 1 ? 'bg-red' : 'bg-gray')" :data-index="index" @tap.stop="favor_event">
<uni-icons type="heart-filled" size="12" color="#fff"></uni-icons>
</view>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
data_list: [],
favor_user: []
};
},
components: {},
props: {
propIsFavor: {
type: Boolean,
default: true
},
propDataList: {
type: Array,
default: () => []
},
propFavorUser: {
type: Array,
default: () => []
}
},
//
created: function(e) {
this.setData({
data_list: this.propDataList,
favor_user: this.propFavorUser
});
},
methods: {
//
favor_event(e) {
if(!app.globalData.is_single_page_check()) {
return false;
}
var user = app.globalData.get_user_info(this, 'favor_event');
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.navigateTo({
url: "/pages/login/login?event_callback=favor_event"
});
return false;
} else {
var index = e.currentTarget.dataset.index;
var info = this.data_list[index];
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("reversal", "favor", "realstore"),
method: 'POST',
data: {
"id": info.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data = this.data_list;
var temp_favor = this.favor_user;
temp_data[index]['is_favor'] = res.data.data.status;
if(res.data.data.status == 1) {
if(temp_favor.indexOf(info.id) == -1) {
temp_favor.push(info.id);
}
} else {
if(temp_favor.indexOf(info.id) != -1) {
temp_favor.splice(index, 1);
}
}
this.setData({
data_list: temp_data,
favor_user: temp_favor
})
app.globalData.showToast(res.data.msg, "success");
} else {
if (app.globalData.is_login_check(res.data, this, 'favor_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
}
},
//
search_button_event(e) {
var params = (e || null) == null ? '' : '?keywords='+e;
uni.navigateTo({
url: '/pages/plugins/realstore/search/search'+params
})
},
//
choose_location_event(e) {
uni.navigateTo({
url: '/pages/common/open-setting-location/open-setting-location'
});
},
//
text_copy_event(e) {
app.globalData.text_copy_event(e);
},
//
address_map_event(e) {
var info = this.data_list[e.currentTarget.dataset.index];
if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast("地址有误");
return false;
}
//
var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || '');
app.globalData.open_location(info.lng, info.lat, info.name, address);
},
//
tel_event(e) {
app.globalData.call_tel(e.currentTarget.dataset.value || null);
},
// url
url_event(e) {
app.globalData.url_event(e);
}
}
};
</script>
<style>
</style>

View File

@ -14,7 +14,7 @@
</view>
</view>
</view>
<view class="padding-main border-radius-main bg-white oh spacing-mb">
<view class="padding-main border-radius-main bg-white oh web-html-content spacing-mb">
<mp-html :content="data.content" />
</view>

View File

@ -699,4 +699,14 @@
.plugins-intellectstools-content-top-container .panel-title,
.plugins-intellectstools-content-top-container .panel-content .item:not(:last-child) {
border-bottom: 1px solid #c8e4fb !important;
}
/**
* -
*/
.plugins-realstore-popup {
max-height: 60vh;
overflow-y: scroll;
overflow-x: hidden;
margin-top: 20rpx;
}

View File

@ -199,9 +199,17 @@
</block>
</view>
</view>
</view>
<view class="padding-horizontal-main">
<!-- 门店 -->
<view v-if="plugins_realstore_data != null" class="plugins-realstore-container">
<view class="spacing-nav-title">
<text class="line"></text>
<text class="text-wrapper">相关门店</text>
<navigator url="/pages/plugins/realstore/index/index" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
</view>
<component-realstore-list :propDataList="plugins_realstore_data" :propIsFavor="false"></component-realstore-list>
</view>
<!-- 多商户 -->
<view v-if="plugins_shop_data != null" class="plugins-shop-container oh border-radius-main padding-main bg-white arrow-right spacing-mb">
<navigator :url="'/pages/plugins/shop/detail/detail?id=' + plugins_shop_data.id" hover-class="none">
@ -299,7 +307,7 @@
</view>
</block>
<!-- web详情 -->
<view v-if="common_app_is_use_mobile_detail == 0" class="padding-main">
<view v-if="common_app_is_use_mobile_detail == 0" class="padding-main web-html-content">
<mp-html :content="goods.content_web" />
</view>
<!-- 手机独立详情 -->
@ -519,6 +527,25 @@
</view>
</view>
</component-popup>
<!-- 门店弹层 -->
<component-popup :propShow="popup_realstore_status" propPosition="bottom" @onclose="popup_realstore_close_event">
<view class="padding-horizontal-main padding-top-main bg-base">
<view class="close oh">
<view class="fr" @tap.stop="popup_realstore_close_event">
<icon type="clear" size="20"></icon>
</view>
</view>
<view class="plugins-realstore-popup">
<block v-if="(plugins_realstore_data || null) != null && plugins_realstore_data.length > 0">
<component-realstore-list :propDataList="plugins_realstore_data" :propIsFavor="false"></component-realstore-list>
</block>
<block v-else>
<view class="cr-grey tc padding-top-xl padding-bottom-xxxl">无相关门店信息</view>
</block>
</view>
</view>
</component-popup>
<!-- 购买记录 -->
<view v-if="(plugins_salerecords_tips_content || null) != null" :class="'plugins-salerecords-tips' + plugins_salerecords_tips_ent">
@ -544,6 +571,7 @@
import componentNoData from "../../components/no-data/no-data";
import componentBottomLine from "../../components/bottom-line/bottom-line";
import componentOnlineService from "../../components/online-service/online-service";
import componentRealstoreList from "../../components/realstore-list/realstore-list";
var common_static_url = app.globalData.get_static_url('common');
var system_info = app.globalData.get_system_info() || {};
@ -659,6 +687,9 @@
plugins_intellectstools_data: null,
//
plugins_chat_data: null,
//
plugins_realstore_data: null,
popup_realstore_status: false
};
},
@ -670,7 +701,8 @@
componentNoData,
componentTrnNav,
componentBottomLine,
componentOnlineService
componentOnlineService,
componentRealstoreList
},
onLoad(params) {
@ -826,7 +858,8 @@
plugins_wholesale_data: ((data.plugins_wholesale_data || null) == null) ? null : data.plugins_wholesale_data,
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data,
plugins_intellectstools_data: data.plugins_intellectstools_data || null,
plugins_chat_data: data.plugins_chat_data || null
plugins_chat_data: data.plugins_chat_data || null,
plugins_realstore_data: data.plugins_realstore_data || null,
};
//
if ((data.nav_home_button_info || null) != null) {
@ -1005,7 +1038,7 @@
case 'show':
app.globalData.call_tel(value || this.common_app_customer_service_tel);
break;
//
//
case 'buy':
case 'cart':
this.setData({
@ -1013,7 +1046,13 @@
buy_event_type: type
});
break;
//
//
case 'plugins-realstore' :
this.setData({
popup_realstore_status: true
});
break;
//
default:
app.globalData.showToast('事件未处理');
}
@ -1698,6 +1737,13 @@
}
},
//
popup_realstore_close_event(e) {
this.setData({
popup_realstore_status: false
});
},
//
comment_images_show_event(e) {
var index = e.currentTarget.dataset.index;

View File

@ -14,7 +14,7 @@
</view>
</view>
</view>
<view class="padding-main border-radius-main bg-white oh spacing-mb">
<view class="padding-main border-radius-main bg-white oh web-html-content spacing-mb">
<view v-if="(data.video_url || null) != null && (data.is_live_play || 0) == 0">
<video :src="data.video_url" class="wh-auto" :autoplay="false" :controls="true"></video>
</view>

View File

@ -9,45 +9,4 @@
}
.nav-search {
width: calc(100% - 210rpx);
}
/**
*
*/
.data-list .item .address-content {
width: calc(100% - 220rpx);
}
.data-list .item .icon-list {
right: 20rpx;
bottom: 20rpx;
}
.data-list .item .icon-list .icon-item {
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
}
.data-list .item .icon-item .badge-icon {
top: -10px;
right: 2px;
}
.data-list .item .icon-list .icon-item:not(:last-child) {
margin-right: 15rpx;
}
.data-list .item .logo {
width: 110rpx;
height: 110rpx !important;
}
.data-list .item .base-right {
width: calc(100% - 130rpx);
}
.data-list .item .base-right .title {
width: calc(100% - 110rpx);
}
.data-list .item .base-right .status-icon {
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
top: 20rpx;
right: -1px;
padding: 5rpx 20rpx;
box-shadow: -1px 1px 3px rgb(0 0 0 / 10%);
}

View File

@ -49,46 +49,7 @@
</view>
<!-- 数据列表 -->
<view class="data-list oh">
<block v-for="(item, index) in data_list" :key="index">
<view class="item bg-white padding-main border-radius-main pr spacing-mb" :data-value="'/pages/plugins/realstore/detail/detail?id='+item.id" @tap="url_event">
<view class="base oh">
<!-- 基础内容 -->
<image :src="item.logo" mode="widthFix" class="logo circle fl br"></image>
<view class="base-right fr">
<view :class="'status-icon pa text-size-xs '+((item.status_info.status == 1) ? 'bg-main cr-white' : 'bg-gray cr-gray')">{{item.status_info.msg}}</view>
<view class="title fw-b text-size single-text">
<text v-if="(item.alias || null) != null" class="va-m title-icon round br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{item.alias}}</text>
<text class="va-m">{{item.name}}</text>
</view>
<view class="margin-top-xs text-size-xs cr-grey">
<view v-if="(item.status_info.time || null) != null">{{item.status_info.time}}</view>
<view v-if="(item.distance || null) != null">{{item.distance}}</view>
</view>
</view>
</view>
<!-- 地址 -->
<view class="margin-top-sm oh cp">
<view class="dis-inline-block va-m">
<uni-icons type="location-filled" size="12" color="#8d8d8d"></uni-icons>
</view>
<view class="address-content single-text cr-base margin-left-xs dis-inline-block text-size-xs va-m" :data-value="item.province_name+item.city_name+item.county_name+item.address" @tap.stop="text_copy_event">{{item.province_name}}{{item.city_name}}{{item.county_name}}{{item.address}}</view>
</view>
<!-- 右侧操作 -->
<view class="icon-list pa">
<view v-if="(item.lat != 0 && item.lng != 0)" class="icon-item bg-green circle dis-inline-block tc cp" :data-index="index" @tap.stop="address_map_event">
<uni-icons type="paperplane-filled" size="12" color="#fff"></uni-icons>
</view>
<view v-if="(item.service_tel || null) != null" class="icon-item bg-yellow circle dis-inline-block tc cp" :data-value="item.service_tel" @tap.stop="tel_event">
<uni-icons type="phone-filled" size="12" color="#fff"></uni-icons>
</view>
<view :class="'icon-item circle dis-inline-block tc cp pr '+((item.is_favor || 0) == 1 ? 'bg-red' : 'bg-gray')" :data-index="index" @tap.stop="favor_event">
<uni-icons type="heart-filled" size="12" color="#fff"></uni-icons>
</view>
</view>
</view>
</block>
</view>
<component-realstore-list :propDataList="data_list" :propFavorUser="favor_user"></component-realstore-list>
</view>
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
@ -105,7 +66,8 @@
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
import componentSearch from "../../../../components/search/search";
import componentBanner from "../../../../components/slider/slider";
import componentIconNav from "../../../../components/icon-nav/icon-nav";
import componentIconNav from "../../../../components/icon-nav/icon-nav";
import componentRealstoreList from "../../../../components/realstore-list/realstore-list";
export default {
data() {
@ -134,7 +96,8 @@
componentBottomLine,
componentSearch,
componentBanner,
componentIconNav
componentIconNav,
componentRealstoreList
},
props: {},
@ -235,67 +198,6 @@
});
},
//
favor_event(e) {
if(!app.globalData.is_single_page_check()) {
return false;
}
var user = app.globalData.get_user_info(this, 'favor_event');
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.navigateTo({
url: "/pages/login/login?event_callback=favor_event"
});
return false;
} else {
var index = e.currentTarget.dataset.index;
var info = this.data_list[index];
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("reversal", "favor", "realstore"),
method: 'POST',
data: {
"id": info.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data = this.data_list;
var temp_favor = this.favor_user;
temp_data[index]['is_favor'] = res.data.data.status;
if(res.data.data.status == 1) {
if(temp_favor.indexOf(info.id) == -1) {
temp_favor.push(info.id);
}
} else {
if(temp_favor.indexOf(info.id) != -1) {
temp_favor.splice(index, 1);
}
}
this.setData({
data_list: temp_data,
favor_user: temp_favor
})
app.globalData.showToast(res.data.msg, "success");
} else {
if (app.globalData.is_login_check(res.data, this, 'favor_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
}
},
//
search_button_event(e) {
var params = (e || null) == null ? '' : '?keywords='+e;
@ -326,34 +228,6 @@
this.setData({
user_location: data
});
},
//
text_copy_event(e) {
app.globalData.text_copy_event(e);
},
//
address_map_event(e) {
var info = this.data_list[e.currentTarget.dataset.index];
if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast("地址有误");
return false;
}
//
var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || '');
app.globalData.open_location(info.lng, info.lat, info.name, address);
},
//
tel_event(e) {
app.globalData.call_tel(e.currentTarget.dataset.value || null);
},
// url
url_event(e) {
app.globalData.url_event(e);
}
}
};

View File

@ -16,41 +16,4 @@
*/
.scroll-box {
height: calc(100vh - 180rpx);
}
.data-list .item .address-content {
width: calc(100% - 220rpx);
}
.data-list .item .icon-list {
right: 20rpx;
bottom: 20rpx;
}
.data-list .item .icon-list .icon-item {
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
}
.data-list .item .icon-item .badge-icon {
top: -10px;
right: 2px;
}
.data-list .item .icon-list .icon-item:not(:last-child) {
margin-right: 15rpx;
}
.data-list .item .logo {
width: 110rpx;
height: 110rpx !important;
}
.data-list .item .base-right {
width: calc(100% - 130rpx);
}
.data-list .item .base-right .title {
width: calc(100% - 110rpx);
}
.data-list .item .base-right .status-icon {
border-top-left-radius: 50rpx;
border-bottom-left-radius: 50rpx;
top: 20rpx;
right: -1px;
padding: 5rpx 20rpx;
box-shadow: -1px 1px 3px rgb(0 0 0 / 10%);
}

View File

@ -29,46 +29,9 @@
<!-- 列表 -->
<scroll-view :scroll-y="true" class="scroll-box scroll-box-ece-nav" @scrolltolower="scroll_lower" lower-threshold="30">
<view v-if="(data_list || null) != null && data_list.length > 0" class="data-list padding-horizontal-main padding-top-main oh">
<block v-for="(item, index) in data_list" :key="index">
<view class="item bg-white padding-main border-radius-main pr spacing-mb" :data-value="'/pages/plugins/realstore/detail/detail?id='+item.id" @tap="url_event">
<view class="base oh">
<!-- 基础内容 -->
<image :src="item.logo" mode="widthFix" class="logo circle fl br"></image>
<view class="base-right fr">
<view :class="'status-icon pa text-size-xs '+((item.status_info.status == 1) ? 'bg-main cr-white' : 'bg-gray cr-gray')">{{item.status_info.msg}}</view>
<view class="title fw-b text-size single-text">
<text v-if="(item.alias || null) != null" class="va-m title-icon round br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{item.alias}}</text>
<text class="va-m">{{item.name}}</text>
</view>
<view class="margin-top-xs text-size-xs cr-grey">
<view v-if="(item.status_info.time || null) != null">{{item.status_info.time}}</view>
<view v-if="(item.distance || null) != null">{{item.distance}}</view>
</view>
</view>
</view>
<!-- 地址 -->
<view class="margin-top-sm oh cp">
<view class="dis-inline-block va-m">
<uni-icons type="location-filled" size="12" color="#8d8d8d"></uni-icons>
</view>
<view class="address-content single-text cr-base margin-left-xs dis-inline-block text-size-xs va-m" :data-value="item.province_name+item.city_name+item.county_name+item.address" @tap.stop="text_copy_event">{{item.province_name}}{{item.city_name}}{{item.county_name}}{{item.address}}</view>
</view>
<!-- 右侧操作 -->
<view class="icon-list pa">
<view v-if="(item.lat != 0 && item.lng != 0)" class="icon-item bg-green circle dis-inline-block tc cp" :data-index="index" @tap.stop="address_map_event">
<uni-icons type="paperplane-filled" size="12" color="#fff"></uni-icons>
</view>
<view v-if="(item.service_tel || null) != null" class="icon-item bg-yellow circle dis-inline-block tc cp" :data-value="item.service_tel" @tap.stop="tel_event">
<uni-icons type="phone-filled" size="12" color="#fff"></uni-icons>
</view>
<view :class="'icon-item circle dis-inline-block tc cp pr '+((item.is_favor || 0) == 1 ? 'bg-red' : 'bg-gray')" :data-index="index" @tap.stop="favor_event">
<uni-icons type="heart-filled" size="12" color="#fff"></uni-icons>
</view>
</view>
</view>
</block>
</view>
<block v-if="(data_list || null) != null && data_list.length > 0">
<component-realstore-list :propDataList="data_list" :propFavorUser="favor_user"></component-realstore-list>
</block>
<view v-else>
<!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
@ -85,6 +48,7 @@
import componentNoData from "../../../../components/no-data/no-data";
import componentBottomLine from "../../../../components/bottom-line/bottom-line";
import componentSearch from "../../../../components/search/search";
import componentRealstoreList from "../../../../components/realstore-list/realstore-list";
export default {
data() {
@ -112,7 +76,8 @@
components: {
componentNoData,
componentBottomLine,
componentSearch
componentSearch,
componentRealstoreList
},
props: {},
@ -293,68 +258,6 @@
}
});
},
//
favor_event(e) {
if(!app.globalData.is_single_page_check()) {
return false;
}
var user = app.globalData.get_user_info(this, 'favor_event');
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.navigateTo({
url: "/pages/login/login?event_callback=favor_event"
});
return false;
} else {
var index = e.currentTarget.dataset.index;
var info = this.data_list[index];
uni.showLoading({
title: '处理中...'
});
uni.request({
url: app.globalData.get_request_url("reversal", "favor", "realstore"),
method: 'POST',
data: {
"id": info.id
},
dataType: 'json',
success: res => {
uni.hideLoading();
if (res.data.code == 0) {
var temp_data = this.data_list;
var temp_favor = this.favor_user;
temp_data[index]['is_favor'] = res.data.data.status;
if(res.data.data.status == 1) {
if(temp_favor.indexOf(info.id) == -1) {
temp_favor.push(info.id);
}
} else {
var fi = temp_favor.indexOf(info.id);
if(fi != -1) {
temp_favor.splice(fi, 1);
}
}
this.setData({
data_list: temp_data,
favor_user: temp_favor
})
app.globalData.showToast(res.data.msg, "success");
} else {
if (app.globalData.is_login_check(res.data, this, 'favor_event')) {
app.globalData.showToast(res.data.msg);
}
}
},
fail: () => {
uni.hideLoading();
app.globalData.showToast('服务器请求出错');
}
});
}
}
},
//
scroll_lower(e) {
@ -401,34 +304,6 @@
this.setData({
user_location: data
});
},
//
text_copy_event(e) {
app.globalData.text_copy_event(e);
},
//
address_map_event(e) {
var info = this.data_list[e.currentTarget.dataset.index];
if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast("地址有误");
return false;
}
//
var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || '');
app.globalData.open_location(info.lng, info.lat, info.name, address);
},
//
tel_event(e) {
app.globalData.call_tel(e.currentTarget.dataset.value || null);
},
// url
url_event(e) {
app.globalData.url_event(e);
}
}
};