Merge branch 'dev' into dev-yxl

master
于肖磊 2024-11-08 17:05:31 +08:00
commit ead49d2b3e
2 changed files with 43 additions and 22 deletions

15
App.vue
View File

@ -2822,8 +2822,11 @@
},
//
get_user_location() {
if(this.data.get_user_location_status == 1) {
// object
// method
// is_force
get_user_location(object = null, method = null, is_force = false) {
if(this.data.get_user_location_status == 1 || is_force) {
var cache_key = this.data.cache_userlocation_key;
var result = uni.getStorageSync(cache_key) || null;
if(result == null) {
@ -2873,13 +2876,17 @@
uni.getLocation({
type: 'wgs84',
success: function (res) {
uni.setStorageSync(cache_key, {
var address = {
name: i18n.t('shopxo-uniapp.app.tghyu3'),
address: '',
latitude: res.latitude || null,
longitude: res.longitude || null,
status: 1,
});
};
uni.setStorageSync(cache_key, address);
if (typeof object === 'object' && (method || null) != null) {
object[method](address);
}
}
});
clearInterval(self.data.get_user_location_timer);

View File

@ -24,9 +24,9 @@
<!-- 基础内容 -->
<image :src="user_choice_realstore.logo" mode="widthFix" class="logo circle fl br"></image>
<view class="base-right padding-left-sm flex-1 flex-width">
<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>
<view class="padding-right-lg">
<view class="single-text dis-inline-block va-m">
<text v-if="(user_choice_realstore.alias || null) != null" class="va-m 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>
@ -296,22 +296,30 @@
});
}
//
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(this.is_first == 1) {
//
if(app.globalData.data.get_user_location_status != 1 && parseInt(this.data_base.is_home_auto_user_location || 0) == 1) {
app.globalData.get_user_location(this, 'user_back_choice_location', true);
}
if(status) {
//
this.setData({
location_tips_close_status: false
});
app.globalData.url_open(temp_realstore.url);
//
if((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);
}
}
}
}
@ -355,10 +363,16 @@
//
user_back_choice_location(e) {
//
this.setData({
user_location: e,
location_tips_close_status: e.status != 1
});
//
if ((this.$refs.choice_location || null) != null) {
this.$refs.choice_location.init();
}
//
this.get_data();
},