1.优惠券接口联调

sws 2024-09-03
v1.0.0
sws 2024-09-04 11:35:52 +08:00
parent 0e62f8e2d8
commit 4c73dd1715
4 changed files with 36 additions and 14 deletions

View File

@ -5,6 +5,7 @@
</div>
</template>
<script>
import { commonStore } from '@/store';
export default defineComponent({
props: {
modelValue: {
@ -26,11 +27,17 @@ export default defineComponent({
},
type: {
type: String,
default: '1', // 1./2./3./4.
default: 'baidu', // 1.tianditu/2.baidu/3.tencent/4.amap
},
},
emits: ['point'],
setup(props, context) {
const common_store = commonStore();
const common_amap_map_ak = common_store.common.config.common_amap_map_ak;
const common_amap_map_safety_ak = common_store.common.config.common_amap_map_safety_ak;
const common_baidu_map_ak = common_store.common.config.common_baidu_map_ak;
const common_tencent_map_ak = common_store.common.config.common_tencent_map_ak;
const common_tianditu_map_ak = common_store.common.config.common_tianditu_map_ak;
const map = ref(null);
const lng = ref(121.47894);
const lat = ref(31.223);
@ -51,16 +58,16 @@ export default defineComponent({
script.className = 'loadmap'; // script
if (props.type === '1') {
//
script.src = 'https://api.tianditu.gov.cn/api?v=4.0&tk=bf0676d6b99ee6f7f917640a54af0415';
script.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${common_tianditu_map_ak || 'bf0676d6b99ee6f7f917640a54af0415'}`;
} else if (props.type === '2') {
//
script.src = 'https://api.map.baidu.com/getscript?v=3.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA';
script.src = `https://api.map.baidu.com/getscript?v=3.0&ak=${common_baidu_map_ak || 'XSdiGjfg3wOHiKjpYEMG6CYA'}`;
} else if (props.type === '3') {
//
script.src = 'https://map.qq.com/api/js?v=2.exp&key=IMYBZ-QJ6C3-QPZ3Y-OUKL6-IVU5S-ZYBKA&callback=init';
script.src = `https://map.qq.com/api/js?v=2.exp&key=${common_tencent_map_ak || 'IMYBZ-QJ6C3-QPZ3Y-OUKL6-IVU5S-ZYBKA'}&callback=init`;
} else if (props.type === '4') {
//
script.src = 'https://webapi.amap.com/maps?v=2.0&key=3e92c6bfdd5ddb4aac39ed5e4d0db663';
script.src = `https://webapi.amap.com/maps?v=2.0&key=${common_amap_map_ak || '3e92c6bfdd5ddb4aac39ed5e4d0db663'}`;
}
// 使script.onload
if (props.type === '3') {
@ -82,7 +89,7 @@ export default defineComponent({
}
if (props.type === '4') {
window._AMapSecurityConfig = {
securityJsCode: '6d68c17c7b2a96a0616b1b8c371f391f',
securityJsCode: common_amap_map_safety_ak || '6d68c17c7b2a96a0616b1b8c371f391f',
};
}
document.body.appendChild(script);

View File

@ -33,7 +33,7 @@
<el-input v-model="form.address" class="link-input" placeholder="请输入地址" type="1" @change="address_change" />
</el-form-item>
<el-form-item label="经纬度">
<maps v-model="map_address" type="4" @point="map_point"></maps>
<maps v-model="map_address" :type="common_map_type" @point="map_point"></maps>
<!-- <t-map v-model="map_address" @point="map_point"></t-map> -->
<!-- <bd-map v-model="map_address" @point="map_point"></bd-map> -->
<!-- <gd-map v-model="map_address" @point="map_point"></gd-map> -->
@ -48,6 +48,9 @@
</template>
<script lang="ts" setup>
import type { FormInstance } from 'element-plus';
import { commonStore } from '@/store';
const common_store = commonStore();
const common_map_type = common_store.common.config.common_map_type || 'baidu';
const props = defineProps({
status: {
type: Boolean,

View File

@ -8,7 +8,7 @@
<div class="coupon-theme-1-content tc" :style="'background-image: url(' + theme_bg_img.url_1 + ');background-size: 100% 100%;'">
<div class="name text-line-1">{{ item.name }}</div>
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -22,7 +22,7 @@
<div v-for="item in data_list" :key="item" class="item" :style="'background-image: url(' + theme_bg_img.url_2 + ');background-size: 100% 100%;'">
<div class="tc">
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -38,7 +38,7 @@
<div v-for="item in data_list" :key="item" class="item">
<div class="left">
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol self-e"></span>
</div>
@ -64,7 +64,7 @@
<div v-for="item in data_list" :key="item" class="item">
<div class="type">通用券</div>
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -86,7 +86,7 @@
<div v-for="item in data_list" :key="item" class="item">
<div class="left" :style="'background-image: url(' + theme_bg_img.url_3 + ');background-size: 100% 100%;'">
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -103,7 +103,7 @@
<div v-for="item in data_list" :key="item" class="item">
<div class="top">
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -120,7 +120,7 @@
<div v-for="item in data_list" :key="item" class="item">
<div class="left">
<div class="price">
<span v-if="item.type == '0'" class="symbol">¥</span>
<span v-if="item.type == '0'" class="symbol">{{ currency_symbol }}</span>
<span class="number">{{ item.discount_value }}</span>
<span v-if="item.type == '1'" class="symbol"></span>
</div>
@ -140,6 +140,9 @@
import { common_styles_computer, gradient_computer, online_url } from '@/utils';
import { isEmpty, cloneDeep } from 'lodash';
import CouponAPI from '@/api/coupon';
import { commonStore } from '@/store';
const common_store = commonStore();
const currency_symbol = common_store.common.config.currency_symbol;
const props = defineProps({
value: {
type: Object,

View File

@ -12,6 +12,15 @@ export const commonStore = defineStore('common', () => {
module_list: [] as any[], //---- 模块列表
page_link_list: [] as any[], //---- 页面链接
plugins: {} as any, //---- 插件
config: {
common_amap_map_ak: '',
common_amap_map_safety_ak: '',
common_baidu_map_ak: '',
common_map_type: '',
common_tencent_map_ak: '',
common_tianditu_map_ak: '',
currency_symbol: '',
} as any, // 基础数据配置参数
});
// 存储链接数据
const set_common = (data: any) => {