master
sws 2024-09-29 15:41:57 +08:00
parent 0afdc5dccf
commit 3e4cabb704
2 changed files with 62 additions and 39 deletions

View File

@ -1,61 +1,84 @@
<template>
<view :class="theme_view">
<view v-if="propIsShowAddressChoice" class="choice-location padding-right-xxxl pr" @tap="choose_user_location">
<template>
<view :class="theme_view">
<view v-if="propIsShowAddressChoice" class="choice-location pr" @tap="choose_user_location">
<view class="dis-inline-block va-m lh">
<iconfont name="icon-location" :size="propIconLocationSize" propClass="lh" :color="propIconLocationColor"></iconfont>
<iconfont name="icon-location" :size="propIconLocationSize" propClass="lh" :color="propIconLocationColor || propBaseColor"></iconfont>
</view>
<view class="va-m dis-inline-block margin-left-xs text-size-md single-text text" :style="'max-width:'+propTextMaxWidth+';'">{{ location.text || '' }}</view>
<view class="va-m dis-inline-block margin-left-xs text-size-md single-text text" :style="'max-width:' + propTextMaxWidth + ';color:' + (propTextColor || propBaseColor) + ';'">{{ location.text || '' }}</view>
<view class="va-m lh dis-inline-block margin-left-xs">
<iconfont name="icon-arrow-bottom" :size="propIconArrowSize" propClass="lh-xs" :color="propIconArrowColor"></iconfont>
<iconfont name="icon-arrow-bottom" :size="propIconArrowSize" propClass="lh-xs" :color="propIconArrowColor || propBaseColor"></iconfont>
</view>
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view(),
location: {},
cloice_location_timer: null
};
},
cloice_location_timer: null,
};
},
props: {
propIsShowAddressChoice: {
type: Boolean,
default: true,
},
propBaseColor: {
type: String,
default: '#fff',
},
propTextDefaultName: {
type: String,
default: '',
},
propTextColor: {
type: String,
default: '',
},
propTextMaxWidth: {
type: String,
default: '100%',
},
propIconLocationColor: {
type: String,
default: '#fff',
default: '',
},
propIconLocationSize: {
type: String,
default: '32rpx',
default: '28rpx',
},
propIconArrowColor: {
type: String,
default: '#fff',
default: '',
},
propIconArrowSize: {
type: String,
default: '24rpx',
},
},
//
created: function () {
this.init();
},
propIsIconArrow: {
type: Boolean,
default: true,
},
},
//
created: function () {
this.init();
},
methods: {
//
init() {
let location = app.globalData.choice_user_location_init();
if ((this.propTextDefaultName || null) != null) {
var default_name = this.$t('shopxo-uniapp.app.4v6q86');
if (location.text == default_name) {
location.text = this.propTextDefaultName;
}
}
this.setData({
location: app.globalData.choice_user_location_init()
location: location,
});
},
@ -66,9 +89,9 @@
var self = this;
var timer = setInterval(function () {
var result = app.globalData.choice_user_location_init() || null;
if(result != null && (result.status == 1 || result.status == 3)) {
if (result != null && (result.status == 1 || result.status == 3)) {
self.setData({
location: result
location: result,
});
clearInterval(self.cloice_location_timer);
@ -77,18 +100,18 @@
}
}, 1000);
this.setData({
cloice_location_timer: timer
cloice_location_timer: timer,
});
//
app.globalData.choose_user_location_event();
}
}
};
</script>
<style scoped>
},
},
};
</script>
<style scoped>
.choice-location {
height: 56rpx;
line-height: 56rpx;
}
</style>
}
</style>

View File

@ -22,9 +22,7 @@
</view>
<view v-else-if="['4', '5'].includes(form.content.theme)" class="flex-1 flex-row align-c h gap-10 padding-left-main">
<view class="flex-row align-c gap-2" @tap="go_map_event">
<iconfont name="icon-location" size="12" color="0"></iconfont>
<text class="size-14 cr-3 text-line-1">{{ form.content.positioning_name }}</text>
<iconfont v-if="form.content.is_arrows_show == '1'" name="icon-arrow-right" size="24rpx" color="#000"></iconfont>
<component-choice-location propBaseColor="#666" :propTextDefaultName="form.content.positioning_name" :propIsIconArrow="form.content.is_arrows_show == '1'" @onback="user_back_choice_location"></component-choice-location>
</view>
<template v-if="['5'].includes(form.content.theme)">
<view class="flex-1">
@ -66,6 +64,7 @@
import componentDiySearch from '@/components/diy/search';
import imageEmpty from '@/components/diy/modules/image-empty';
import hotWordList from '@/components/diy/modules/hot-word-list';
import componentChoiceLocation from '@/components/choice-location/choice-location';
import { isEmpty, background_computer, gradient_computer } from '@/common/js/common/common.js';
//
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
@ -87,6 +86,7 @@
componentDiySearch,
imageEmpty,
hotWordList,
componentChoiceLocation,
},
data() {
return {