门店首页支持强制选择门店

master
gongfuxiang 2024-11-07 22:08:12 +08:00
parent 469722260f
commit 5814c71ed8
9 changed files with 320 additions and 81 deletions

View File

@ -209,6 +209,9 @@
// //
cache_search_history_key: 'cache_search_history_key', cache_search_history_key: 'cache_search_history_key',
//
cache_realstore_detail_choice_key: 'cache_realstore_detail_choice_key',
// //
default_user_head_src: '/static/images/common/user.png', default_user_head_src: '/static/images/common/user.png',

View File

@ -2,12 +2,12 @@
<view :class="theme_view"> <view :class="theme_view">
<view v-if="(data_list || null) != null && data_list.length > 0" class="plugins-realstore-data-list oh"> <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"> <block v-for="(item, index) in data_list" :key="index">
<view class="item bg-white padding-top-xl padding-bottom-sm padding-horizontal-main border-radius-main pr spacing-mb" :class="item.status_info.type === 2 ? 'opacity' : ''" :data-value="item.url+propRealstoreDetailQuery" @tap="url_event"> <view class="item bg-white padding-top-xl padding-bottom-sm padding-horizontal-main border-radius-main pr spacing-mb" :class="item.status_info.type === 2 ? 'opacity' : ''" :data-index="index" :data-value="item.url+propRealstoreDetailQuery" @tap="realstore_item_event">
<view class="base oh flex-row"> <view class="base oh flex-row">
<!-- 基础内容 --> <!-- 基础内容 -->
<image :src="item.logo" mode="widthFix" class="logo circle br"></image> <image :src="item.logo" mode="widthFix" class="logo circle br"></image>
<view class="base-right flex-1 flex-width"> <view class="base-right flex-1 flex-width">
<view class="title fw-b text-size single-text"> <view class="title fw-b text-size single-text tl">
<text v-if="(item.alias || null) != null" class="va-m title-icon border-radius-sm br-main cr-main text-size-xs padding-horizontal-xs margin-right-xs">{{ item.alias }}</text> <text v-if="(item.alias || null) != null" class="va-m title-icon border-radius-sm br-main cr-main text-size-xs padding-horizontal-xs margin-right-xs">{{ item.alias }}</text>
<text class="va-m">{{ item.name }}</text> <text class="va-m">{{ item.name }}</text>
</view> </view>
@ -24,7 +24,7 @@
</view> </view>
<view class="flex-row jc-sb align-c br-t-dashed margin-top-main padding-top-sm"> <view class="flex-row jc-sb align-c br-t-dashed margin-top-main padding-top-sm">
<!-- 地址 --> <!-- 地址 -->
<view class="address-content single-text cr-base margin-left-xs dis-inline-block text-size-xs oh cp" :data-value="item.province_name + item.city_name + item.county_name + item.address" @tap.stop="text_copy_event"> <view class="address-content single-text cr-base margin-left-xs dis-inline-block text-size-xs oh cp tl" :data-value="item.province_name + item.city_name + item.county_name + item.address" @tap.stop="text_copy_event">
<view class="dis-inline-block va-m cr-grey-9 margin-top-sm"> <view class="dis-inline-block va-m cr-grey-9 margin-top-sm">
<iconfont name="icon-index-zxmd-dress"></iconfont> <iconfont name="icon-index-zxmd-dress"></iconfont>
</view> </view>
@ -64,6 +64,14 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
propIsChoice: {
type: Boolean,
default: false,
},
propIsChoiceBackType: {
type: String,
default: 'back',
},
propData: { propData: {
type: Object, type: Object,
default: () => { default: () => {
@ -177,20 +185,43 @@ export default {
// //
address_map_event(e) { address_map_event(e) {
var info = this.data_list[e.currentTarget.dataset.index]; var info = this.data_list[e.currentTarget.dataset.index] || {};
if (info.lat == 0 || info.lng == 0) { if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3')); app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
return false; return false;
} }
//
var address = (info.province_name || "") + (info.city_name || "") + (info.county_name || "") + (info.address || ""); var address = (info.province_name || "") + (info.city_name || "") + (info.county_name || "") + (info.address || "");
app.globalData.open_location(info.lng, info.lat, info.name, address); app.globalData.open_location(info.lng, info.lat, info.name, address);
}, },
// url //
url_event(e) { realstore_item_event(e) {
app.globalData.url_event(e); //
if(this.propIsChoice) {
//
var data = this.data_list[e.currentTarget.dataset.index];
uni.setStorageSync(app.globalData.data.cache_realstore_detail_choice_key, {
data: data,
status: 1
});
//
this.$emit('onChoiceEvent', data);
//
switch(this.propIsChoiceBackType) {
//
case 'back' :
app.globalData.page_back_prev_event();
break;
//
case 'realstore-detail' :
app.globalData.url_open('/pages/plugins/realstore/detail/detail?id='+data.id, true);
break;
}
} else {
app.globalData.url_event(e);
}
} }
} }
}; };

View File

@ -1674,7 +1674,10 @@
"47h2a0": "Request failed, please try again!", "47h2a0": "Request failed, please try again!",
"miv944": "start", "miv944": "start",
"20epzm": "Product data incorrect", "20epzm": "Product data incorrect",
"8tzr7l": "Incorrect store info" "8tzr7l": "Incorrect store info",
"87tty2": "Choice store",
"76rfgh": "Choose another store",
"r67uyg": "Enter store"
} }
}, },
"share-popup": { "share-popup": {

View File

@ -1657,7 +1657,10 @@
"47h2a0": "请求失败,请重试!", "47h2a0": "请求失败,请重试!",
"miv944": "起步", "miv944": "起步",
"20epzm": "商品数据有误", "20epzm": "商品数据有误",
"8tzr7l": "门店信息有误" "8tzr7l": "门店信息有误",
"87tty2": "选择门店",
"76rfgh": "选择其他门店",
"r67uyg": "进入门店"
} }
}, },
"share-popup": { "share-popup": {

View File

@ -13,12 +13,6 @@ page {
.header-content .address-content { .header-content .address-content {
max-width: calc(100% - 100rpx); max-width: calc(100% - 100rpx);
} }
.header-content .navigation {
width: 68rpx;
height: 28rpx;
line-height: 28rpx;
border: 2rpx solid #52C41A;
}
.header-content .icon-list { .header-content .icon-list {
right: 20rpx; right: 20rpx;
bottom: 20rpx; bottom: 20rpx;
@ -44,11 +38,11 @@ page {
.header-content .logo { .header-content .logo {
width: 100rpx; width: 100rpx;
} }
.header-content .base-right {
padding-left: 14rpx;
}
.header-content .base-right .title-length-limit { .header-content .base-right .title-length-limit {
width: calc(100% - 110rpx); max-width: calc(100% - 100rpx);
}
.header-content .base-right .title-length-limit .title-content.switch {
max-width: calc(100% - 44rpx);
} }
.header-content .base-right .use-type-icon { .header-content .base-right .use-type-icon {
border-top-left-radius: 8rpx; border-top-left-radius: 8rpx;

View File

@ -42,24 +42,29 @@
<view class="base flex-row"> <view class="base flex-row">
<!-- 基础内容 --> <!-- 基础内容 -->
<image :src="info.logo" mode="widthFix" class="logo border-radius-sm fl br" :data-value="info.logo" @tap="image_show_event"></image> <image :src="info.logo" mode="widthFix" class="logo border-radius-sm fl br" :data-value="info.logo" @tap="image_show_event"></image>
<view class="base-right flex-1 flex-width"> <view class="base-right padding-left-sm flex-1 flex-width">
<view v-if="is_base_mode != 1 && (info.buy_use_type_list || null) != null && info.buy_use_type_list.length > 0" class="use-type-icon pa text-size-xs cr-white bg-main" @tap="buy_use_type_event"> <view v-if="is_base_mode != 1 && (info.buy_use_type_list || null) != null && info.buy_use_type_list.length > 0" class="use-type-icon pa text-size-xs cr-white bg-main tl" @tap="buy_use_type_event">
<text class="va-m margin-right-xs">{{ info.buy_use_type_list[buy_use_type_index]['name'] }}</text> <text class="va-m margin-right-xs">{{ info.buy_use_type_list[buy_use_type_index]['name'] }}</text>
<view class="dis-inline-block va-m pr"> <view class="dis-inline-block va-m pr">
<iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont> <iconfont name="icon-arrow-bottom" size="24rpx" color="#fff"></iconfont>
</view> </view>
</view> </view>
<view :class="'title fw-b text-size single-text ' + (is_base_mode != 1 && (info.buy_use_type_list || null) != null && info.buy_use_type_list.length > 0 ? 'title-length-limit' : '')"> <view :class="'title ' + (is_base_mode != 1 && (info.buy_use_type_list || null) != null && info.buy_use_type_list.length > 0 ? 'title-length-limit' : '')" @tap="realstore_switch_event">
<text v-if="(info.alias || null) != null" class="va-m title-icon border-radius-sm br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{ info.alias }}</text> <view class="dis-inline-block va-m single-text title-content" :class="is_realstore_switch == 1 ? 'switch' : ''">
<text class="va-m">{{ info.name }}</text> <text v-if="(info.alias || null) != null" class="va-m title-icon border-radius-sm br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{ info.alias }}</text>
<text class="va-m fw-b text-size">{{ info.name }}</text>
</view>
<view v-if="is_realstore_switch == 1" class="dis-inline-block va-m margin-left-xs">
<iconfont name="icon-transfer" size="36rpx" color="#666"></iconfont>
</view>
</view> </view>
<view class="margin-top-xs text-size-xs cr-grey"> <view class="margin-top-xs text-size-xss cr-grey tl">
<view v-if="(info.status_info.time || null) != null">{{$t('detail.detail.dor2v9')}}{{ info.status_info.time }}</view> <view v-if="(info.status_info.time || null) != null">{{$t('detail.detail.dor2v9')}}{{ info.status_info.time }}</view>
<view v-if="(info.distance || null) != null">{{$t('extraction-address.extraction-address.42v8tv')}}{{ info.distance }}</view> <view v-if="(info.distance || null) != null">{{$t('extraction-address.extraction-address.42v8tv')}}{{ info.distance }}</view>
</view> </view>
</view> </view>
</view> </view>
<view class="margin-top-main cp br-t-dashed padding-top-sm"> <view class="margin-top-sm cp br-t-dashed padding-top-sm">
<view class="flex-row jc-sb align-c"> <view class="flex-row jc-sb align-c">
<!-- 地址 --> <!-- 地址 -->
<view class="flex-row align-c flex-1 flex-width"> <view class="flex-row align-c flex-1 flex-width">
@ -68,7 +73,7 @@
{{ info.province_name }}{{ info.city_name }}{{ info.county_name }}{{ info.address }} {{ info.province_name }}{{ info.city_name }}{{ info.county_name }}{{ info.address }}
</view> </view>
<!-- #ifndef MP-KUAISHOU --> <!-- #ifndef MP-KUAISHOU -->
<view v-if="info.lat != 0 && info.lng != 0" class="dis-inline-block tc cp border-radius-sm text-size-xss cr-green navigation margin-left-xs" @tap="address_map_event">{{$t('detail.detail.688i26')}}</view> <view v-if="info.lat != 0 && info.lng != 0" class="dis-inline-block tc cp border-radius-sm text-size-xss cr-green br-green padding-horizontal-xs margin-left-xs" @tap="address_map_event">{{$t('detail.detail.688i26')}}</view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- 右侧操作 --> <!-- 右侧操作 -->
@ -387,6 +392,10 @@
status: 0, status: 0,
count: 0, count: 0,
}, },
//
is_service_info: 0,
//
is_realstore_switch: 0,
// //
share_info: {}, share_info: {},
// //
@ -428,6 +437,9 @@
// //
app.globalData.page_event_onshow_handle(); app.globalData.page_event_onshow_handle();
//
this.realstore_choice_init();
// //
this.init_config(); this.init_config();
@ -465,6 +477,32 @@
} }
}, },
//
realstore_choice_init() {
var key = app.globalData.data.cache_realstore_detail_choice_key;
var res = uni.getStorageSync(key) || null;
if(res != null && (res.data || null) != null && res.status == 1) {
uni.setStorageSync(key, {
data: res.data,
status: 0
});
this.setData({
params: {...this.params, ...{id: res.data.id}},
info: res.data,
is_first: 1,
data_list: [],
data_total: 0,
data_page: 1,
data_page_total: 0,
data_is_loading: 0,
data_list_loding_status: 1,
data_bottom_line_status: false
});
this.source_goods_remove();
this.reset_scroll();
}
},
// - // -
get_detail_init(params = {}) { get_detail_init(params = {}) {
// //
@ -492,6 +530,7 @@
this.setData({ this.setData({
is_service_info: parseInt(data_base.is_service_info || 0), is_service_info: parseInt(data_base.is_service_info || 0),
is_realstore_switch: parseInt(data_base.is_realstore_switch || 0),
is_base_mode: parseInt(data.is_base_mode || 0), is_base_mode: parseInt(data.is_base_mode || 0),
is_base_mode_show_type: parseInt(data.is_base_mode_show_type || 0), is_base_mode_show_type: parseInt(data.is_base_mode_show_type || 0),
is_cart_nav: true, is_cart_nav: true,
@ -870,13 +909,11 @@
// //
address_map_event(e) { address_map_event(e) {
var info = this.info; var info = this.info || {};
if (info.lat == 0 || info.lng == 0) { if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3')); app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
return false; return false;
} }
//
var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || ''); var address = (info.province_name || '') + (info.city_name || '') + (info.county_name || '') + (info.address || '');
app.globalData.open_location(info.lng, info.lat, info.name, address); app.globalData.open_location(info.lng, info.lat, info.name, address);
}, },
@ -1011,6 +1048,13 @@
} }
}, },
//
realstore_switch_event (e) {
if(this.is_realstore_switch == 1) {
app.globalData.url_open('/pages/plugins/realstore/search/search?is_choice_mode=1&show_type_mode=1');
}
},
// //
popup_service_open_event(e) { popup_service_open_event(e) {
this.setData({ this.setData({

View File

@ -38,6 +38,19 @@ page {
right: 20rpx; right: 20rpx;
} }
/**
*
*/
.user-choice-realstore .logo {
width: 100rpx;
}
.user-choice-realstore .base-right .title {
max-width: calc(100% - 180rpx);
}
.user-choice-realstore .address-content {
max-width: calc(100% - 100rpx);
}
/** /**
* *

View File

@ -1,43 +1,102 @@
<template> <template>
<view :class="theme_view"> <view :class="theme_view">
<view v-if="(data_base || null) != null" class="realstore-nav-bg"> <block v-if="(data_base || null) != null">
<!-- 背景图片 --> <!-- 强制选择一个门店模式 -->
<image :src="realstore_static_url + 'title-bg'+(screen_width > 960 ? '-pc' : '')+'.png'" mode="widthFix" class="wh-auto pa bg-img" /> <view v-if="is_force_choice_realstore == 1" class="padding-main tc">
<!-- 顶部 --> <!-- 位置展示 -->
<view class="spacing-mb pr z-i cr-white"> <component-choice-location ref="choice_location" propBaseColor="#333" @onBack="user_back_choice_location"></component-choice-location>
<!-- 位置 --> <!-- 提示信息 -->
<view class="nav-location single-text dis-inline-block bs-bb pr padding-left-main padding-right-xl margin-top"> <view class="padding-bottom-xxxxl margin-top-sm">
<component-choice-location ref="choice_location" @onBack="user_back_choice_location"></component-choice-location> <block v-if="(user_choice_realstore || null) == null">
<image src="../../../../static/images/common/user.png" mode="aspectFit"></image>
<view class="cr-grey margin-top-xl">请先选择门店</view>
<view class="padding-horizontal-xxxl">
<button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="realstore_choice_event">{{$t('realstore-cart.realstore-cart.87tty2')}}</button>
</view>
</block>
<!-- 已选择的门店 -->
<block v-else>
<view class="padding-main border-radius-main bg-white pr box-shadow user-choice-realstore">
<view class="base flex-row pr">
<!-- 基础内容 -->
<image :src="user_choice_realstore.logo" mode="widthFix" class="logo border-radius-sm fl br"></image>
<view class="base-right padding-left-sm flex-1 flex-width tl">
<view class="title single-text">
<view class="dis-inline-block va-m">
<text v-if="(user_choice_realstore.alias || null) != null" class="va-m title-icon border-radius-sm br-main cr-main text-size-xs padding-left-sm padding-right-sm margin-right-xs">{{ user_choice_realstore.alias }}</text>
<text class="va-m fw-b text-size">{{ user_choice_realstore.name }}</text>
</view>
</view>
<view class="margin-top-xs text-size-xss cr-grey">
<view v-if="(user_choice_realstore.status_info.time || null) != null">{{$t('detail.detail.dor2v9')}}{{ user_choice_realstore.status_info.time }}</view>
<view v-if="(user_choice_realstore.distance || null) != null">{{$t('extraction-address.extraction-address.42v8tv')}}{{ user_choice_realstore.distance }}</view>
</view>
<button type="default" size="mini" class="bg-white br-main cr-main text-size-xss round pa top-lg right-0" hover-class="none" :data-value="user_choice_realstore.url" @tap="url_event">{{$t('realstore-cart.realstore-cart.r67uyg')}}</button>
</view>
</view>
<view class="margin-top-sm cp br-t-dashed padding-top-sm">
<view class="flex-row jc-sb align-c">
<!-- 地址 -->
<view class="flex-row align-c flex-1 flex-width">
<iconfont name="icon-index-zxmd-dress" size="28rpx" propClass="pr top-xs"></iconfont>
<view class="address-content single-text cr-base margin-left-xs text-size-sm" :data-value="user_choice_realstore.province_name + user_choice_realstore.city_name + user_choice_realstore.county_name + user_choice_realstore.address" @tap="text_copy_event">
{{ user_choice_realstore.province_name }}{{ user_choice_realstore.city_name }}{{ user_choice_realstore.county_name }}{{ user_choice_realstore.address }}
</view>
<!-- #ifndef MP-KUAISHOU -->
<view v-if="user_choice_realstore.lat != 0 && user_choice_realstore.lng != 0" class="dis-inline-block tc cp border-radius-sm text-size-xss cr-green br-green padding-horizontal-xs margin-left-xs" @tap="address_map_event">{{$t('detail.detail.688i26')}}</view>
<!-- #endif -->
</view>
</view>
</view>
</view>
<view class="cr-grey margin-top-xl">当前选择的门店</view>
<view class="padding-horizontal-xxxl">
<button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="realstore_choice_event">{{$t('realstore-cart.realstore-cart.76rfgh')}}</button>
</view>
</block>
</view> </view>
</view> </view>
<!-- 搜索 --> <block v-else>
<view class="nav-search padding-main"> <view class="realstore-nav-bg">
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c"></component-search> <!-- 背景图片 -->
</view> <image :src="realstore_static_url + 'title-bg'+(screen_width > 960 ? '-pc' : '')+'.png'" mode="widthFix" class="wh-auto pa bg-img" />
</view> <!-- 顶部 -->
<view class="spacing-mb pr z-i cr-white">
<!-- 位置展示 -->
<view class="nav-location single-text dis-inline-block bs-bb pr padding-left-main padding-right-xl margin-top">
<component-choice-location ref="choice_location" @onBack="user_back_choice_location"></component-choice-location>
</view>
</view>
<!-- 搜索 -->
<view class="nav-search padding-main">
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c"></component-search>
</view>
</view>
<!-- 轮播 --> <!-- 轮播 -->
<view v-if="slider_list.length > 0" class="padding-horizontal-main"> <view v-if="slider_list.length > 0" class="padding-horizontal-main">
<component-banner :propData="slider_list"></component-banner> <component-banner :propData="slider_list"></component-banner>
</view> </view>
<!-- 图标 --> <!-- 图标 -->
<view v-if="icon_list.length > 0" class="padding-horizontal-main spacing-mb"> <view v-if="icon_list.length > 0" class="padding-horizontal-main spacing-mb">
<view class="bg-white border-radius-main"> <view class="bg-white border-radius-main">
<component-icon-nav :propData="{...{data: icon_list}, ...{random: random_value}}"></component-icon-nav> <component-icon-nav :propData="{...{data: icon_list}, ...{random: random_value}}"></component-icon-nav>
</view> </view>
</view> </view>
</block>
<!-- 列表 --> <!-- 列表 -->
<block v-if="data_list.length > 0"> <block v-if="data_list.length > 0">
<view class="padding-horizontal-main"> <view class="padding-horizontal-main">
<!-- 导航 --> <!-- 导航 -->
<component-title :propTitle="data_base.home_data_list_title || $t('index.index.1vf378')" propMoreUrl="/pages/plugins/realstore/search/search"></component-title> <component-title :propTitle="data_base.home_data_list_title || $t('index.index.1vf378')" propMoreUrl="/pages/plugins/realstore/search/search"></component-title>
<!-- 数据列表 --> <!-- 数据列表 -->
<component-realstore-list :propData="{data: data_list}" :propFavorUser="favor_user"></component-realstore-list> <component-realstore-list :propData="{data: data_list}" :propFavorUser="favor_user"></component-realstore-list>
</view> </view>
<!-- 结尾 --> <!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line> <component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
</block>
<!-- 位置选择提示 --> <!-- 位置选择提示 -->
<view v-if="location_tips_close_status && (data_base.is_home_choice_location || 0) == 1 && ((data_base.home_choice_location_images || null) != null || (data_base.home_choice_location_msg || null) != null)" class="choice-location-tips pf wh-auto ht-auto tc bs-bb"> <view v-if="location_tips_close_status && (data_base.is_home_choice_location || 0) == 1 && ((data_base.home_choice_location_images || null) != null || (data_base.home_choice_location_msg || null) != null)" class="choice-location-tips pf wh-auto ht-auto tc bs-bb">
@ -48,9 +107,9 @@
</view> </view>
</view> </view>
<view class="padding-lg"> <view class="padding-lg">
<image v-if="(data_base.home_choice_location_images || null) != null" class="icon max-w margin-top-sm" :src="data_base.home_choice_location_images" mode="widthFix"></image> <image v-if="(data_base.home_choice_location_images || null) != null" class="icon max-w" :src="data_base.home_choice_location_images" mode="widthFix"></image>
<view v-if="(data_base.home_choice_location_msg || null) != null" class="cr-base margin-top-lg">{{ data_base.home_choice_location_msg }}</view> <view v-if="(data_base.home_choice_location_msg || null) != null" class="cr-base margin-top-lg">{{ data_base.home_choice_location_msg }}</view>
<button type="default" class="bg-green br-green cr-white text-size margin-top-xxl round" hover-class="none" @tap="choose_user_location_event">{{$t('index.index.t3d917')}}</button> <button type="default" class="bg-main br-main cr-white text-size-sm margin-top-xxl round" hover-class="none" @tap="choose_user_location_event">{{$t('index.index.t3d917')}}</button>
</view> </view>
</view> </view>
</view> </view>
@ -93,6 +152,14 @@
slider_list: [], slider_list: [],
icon_list: [], icon_list: [],
data_list: [], data_list: [],
//
user_choice_realstore: null,
//
is_force_choice_realstore: 0,
//
is_force_auto_choice_realstore: 0,
//
force_auto_choice_realstore_distance: 0,
// //
user_location: {}, user_location: {},
location_tips_close_status: false, location_tips_close_status: false,
@ -134,6 +201,9 @@
// //
app.globalData.page_event_onshow_handle(); app.globalData.page_event_onshow_handle();
//
this.realstore_choice_init();
// //
this.user_location_init(); this.user_location_init();
@ -191,6 +261,7 @@
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
var data_list = data.data_list || []; var data_list = data.data_list || [];
var data_base = data.base || {};
this.setData({ this.setData({
random_value: Math.random(), random_value: Math.random(),
data_base: data.base || null, data_base: data.base || null,
@ -198,7 +269,9 @@
slider_list: data.slider_list || [], slider_list: data.slider_list || [],
icon_list: data.icon_list || [], icon_list: data.icon_list || [],
data_list: data_list, data_list: data_list,
is_first: 0, is_force_choice_realstore: parseInt(data_base.is_home_force_choice_one_realstore_mode || 0),
is_force_auto_choice_realstore: parseInt(data_base.is_home_force_choice_one_realstore_mode_auto_lately_realstore || 0),
force_auto_choice_realstore_distance: parseFloat(data_base.home_force_choice_one_realstore_mode_auto_lately_distance || 0),
data_list_loding_status: data_list.length > 0 ? 3 : 0, data_list_loding_status: data_list.length > 0 ? 3 : 0,
data_bottom_line_status: true, data_bottom_line_status: true,
}); });
@ -219,6 +292,25 @@
title: this.data_base.application_name, title: this.data_base.application_name,
}); });
} }
//
if(this.is_first == 1 && (this.user_choice_realstore || null) == null && this.data_list.length > 0 && this.is_force_choice_realstore == 1 && this.is_force_auto_choice_realstore == 1) {
var status = true;
var temp_realstore = this.data_list[0];
//
if(this.force_auto_choice_realstore_distance > 0) {
if(temp_realstore.distance_value === undefined || temp_realstore.distance_value > this.force_auto_choice_realstore_distance) {
status = false;
}
}
if(status) {
//
this.setData({
location_tips_close_status: false
});
app.globalData.url_open(temp_realstore.url);
}
}
} }
} else { } else {
this.setData({ this.setData({
@ -227,6 +319,11 @@
}); });
} }
//
this.setData({
is_first: 0,
});
// //
app.globalData.page_share_handle(this.share_info); app.globalData.page_share_handle(this.share_info);
}, },
@ -262,6 +359,17 @@
this.get_data(); this.get_data();
}, },
//
realstore_choice_init() {
var key = app.globalData.data.cache_realstore_detail_choice_key;
var res = uni.getStorageSync(key) || null;
if(res != null && (res.data || null) != null) {
this.setData({
user_choice_realstore: res.data
});
}
},
// //
user_location_init() { user_location_init() {
var res = app.globalData.choice_user_location_init(); var res = app.globalData.choice_user_location_init();
@ -286,6 +394,32 @@
}); });
// #endif // #endif
}, },
//
realstore_choice_event(e) {
app.globalData.url_open('/pages/plugins/realstore/search/search?is_choice_mode=1&choice_mode_back_type=realstore-detail&show_type_mode=1');
},
// url
url_event(e) {
app.globalData.url_event(e);
},
//
text_copy_event(e) {
app.globalData.text_copy_event(e);
},
//
address_map_event(e) {
var info = this.user_choice_realstore || {};
if (info.lat == 0 || info.lng == 0) {
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
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);
},
}, },
}; };
</script> </script>

View File

@ -2,22 +2,22 @@
<view :class="theme_view"> <view :class="theme_view">
<block v-if="(data_base || null) != null"> <block v-if="(data_base || null) != null">
<!-- 顶部 --> <!-- 顶部 -->
<view class="bg-white padding-top-main padding-horizontal-main oh flex-row jc-sb align-c cr-grey" :class="show_type == 1 ? 'map padding-bottom' : ''"> <view class="bg-white padding-top-main padding-horizontal-main oh flex-row jc-sb align-c cr-grey" :class="show_type_mode == 1 ? 'map padding-bottom' : ''">
<!-- 位置 --> <!-- 位置 -->
<view v-if="show_type == 0" class="nav-location flex-row align-c single-text margin-right-sm"> <view v-if="show_type_mode == 0" class="nav-location flex-row align-c single-text margin-right-sm">
<component-choice-location ref="choice_location" propBaseColor="#666" propTextMaxWidth="180rpx" @onBack="user_back_choice_location"></component-choice-location> <component-choice-location ref="choice_location" propBaseColor="#666" propTextMaxWidth="180rpx" @onBack="user_back_choice_location"></component-choice-location>
</view> </view>
<!-- 搜索 --> <!-- 搜索 -->
<view class="nav-search" :class="show_type == 1 ? 'map' : ''"> <view class="nav-search" :class="show_type_mode == 1 ? 'map' : ''">
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propDefaultValue="search_keywords_value" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c" propBgColor="#f5f5f5"></component-search> <component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="false" :propDefaultValue="search_keywords_value" :propPlaceholder="$t('index.index.c5273j')" propPlaceholderClass="cr-grey-c" propBgColor="#f5f5f5"></component-search>
</view> </view>
<view v-if="is_search_map == 1" class="dis-inline-block margin-left" @tap="show_event"> <view v-if="is_search_map == 1" class="dis-inline-block margin-left" @tap="show_event">
<iconfont :name="show_type == 1 ? 'icon-list-dot' : 'icon-map-location'" color="#666" size="38rpx"></iconfont> <iconfont :name="show_type_mode == 1 ? 'icon-list-dot' : 'icon-map-location'" color="#666" size="38rpx"></iconfont>
</view> </view>
</view> </view>
<!-- 地图 --> <!-- 地图 -->
<view v-show="show_type == 1" class="map-container pr"> <view v-show="show_type_mode == 1" class="map-container pr">
<map class="wh-auto ht-auto" <map class="wh-auto ht-auto"
:enable-zoom="true" :enable-zoom="true"
:enable-scroll="true" :enable-scroll="true"
@ -41,13 +41,13 @@
</scroll-view> </scroll-view>
<!-- 列表 --> <!-- 列表 -->
<scroll-view :scroll-y="true" :scroll-top="scroll_top" :scroll-with-animation="true" class="scroll-box scroll-box-ece-nav" :class="show_type == 1 ? 'map' : ''" @scrolltolower="scroll_lower" lower-threshold="60"> <scroll-view :scroll-y="true" :scroll-top="scroll_top" :scroll-with-animation="true" class="scroll-box scroll-box-ece-nav" :class="show_type_mode == 1 ? 'map' : ''" @scrolltolower="scroll_lower" lower-threshold="60">
<view v-if="(data_list || null) != null && data_list.length > 0" class="padding-top-main padding-horizontal-main"> <view v-if="(data_list || null) != null && data_list.length > 0" class="padding-top-main padding-horizontal-main">
<component-realstore-list :propData="{data: data_list}" :propRealstoreDetailQuery="realstore_detail_query" :propFavorUser="favor_user"></component-realstore-list> <component-realstore-list :propData="{data: data_list}" :propRealstoreDetailQuery="realstore_detail_query" :propFavorUser="favor_user" :propIsChoice="is_choice_mode == 1" :propIsChoiceBackType="choice_mode_back_type"></component-realstore-list>
</view> </view>
<view v-else> <view v-else>
<!-- 提示信息 --> <!-- 提示信息 -->
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" :propLoadingLogoTop="show_type == 1 ? '20%' : ''"></component-no-data> <component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" :propLoadingLogoTop="show_type_mode == 1 ? '20%' : ''"></component-no-data>
</view> </view>
<!-- 结尾 --> <!-- 结尾 -->
@ -87,8 +87,12 @@
nav_active_value: 0, nav_active_value: 0,
favor_user: [], favor_user: [],
realstore_detail_query: '', realstore_detail_query: '',
// 01 // 01
show_type: 0, is_choice_mode: 0,
// backrealstore-detail
choice_mode_back_type: 'back',
// 01
show_type_mode: 0,
// //
is_search_map: 0, is_search_map: 0,
map_location_icon: plugins_static_url+'app/map/location-icon.png', map_location_icon: plugins_static_url+'app/map/location-icon.png',
@ -127,6 +131,9 @@
// //
this.setData({ this.setData({
params: params, params: params,
is_choice_mode: parseInt(params.is_choice_mode || 0),
choice_mode_back_type: (params.choice_mode_back_type === undefined) ? 'back' : (params.choice_mode_back_type || ''),
show_type_mode: parseInt(params.show_type_mode || 0),
search_keywords_value: params.keywords || "", search_keywords_value: params.keywords || "",
nav_active_value: params.category_id || 0, nav_active_value: params.category_id || 0,
realstore_detail_query: (params.goods_id || null) == null ? '' : '&source_goods_id='+params.goods_id realstore_detail_query: (params.goods_id || null) == null ? '' : '&source_goods_id='+params.goods_id
@ -147,6 +154,13 @@
if ((this.$refs.common || null) != null) { if ((this.$refs.common || null) != null) {
this.$refs.common.on_show(); this.$refs.common.on_show();
} }
//
if(this.is_choice_mode == 1) {
uni.setNavigationBarTitle({
title: this.$t('realstore-cart.realstore-cart.87tty2')
});
}
}, },
// //
@ -402,7 +416,7 @@
// //
show_event(e) { show_event(e) {
this.setData({ this.setData({
show_type: (this.show_type == 1) ? 0 : 1 show_type_mode: (this.show_type_mode == 1) ? 0 : 1
}); });
}, },
@ -469,8 +483,8 @@
}); });
} }
} }
}, }
}, }
}; };
</script> </script>
<style> <style>