jiuyiUniapp/jiuyi2/components/public/jy-commodity-address/index.vue

85 lines
1.5 KiB
Vue
Raw Normal View History

2025-01-11 03:51:29 +08:00
<script setup>
//
import util from '@/common/js/util.js'
//
import {
ref,
reactive,
computed,
watch,
onMounted,
onUnmounted
} from 'vue'
const props = defineProps({
shopEdit: {
type: Boolean,
default: true
},
address: {
type: Object,
default: () => ({})
}
})
onMounted(() => {
// 开启监听
addListener()
})
onUnmounted(() => {
// 移除监听
removeListener()
})
// 开启监听
function addListener() {
// 选择收货地址
uni.$on('selectAddress', (event) => {
emit('update:value', event.target.value);
})
}
// 移除监听
function removeListener() {
// 移除收货地址
uni.$off('selectAddress')
}
// 跳转
function link(url) {
uni.navigateTo({
url
})
}
</script>
2024-12-18 15:46:27 +08:00
<template>
<view class="address df aic jcc">
<!-- 图标 -->
<view class="icon mr20">
<image class="wh45" src="/static/address.png" mode="aspectFill" />
</view>
<!-- 收获地址 姓名电话 -->
<view class="info f1">
<!-- 收获地址 -->
<view class="location f30">
<text class="c333">收货地址收货地址收货地址收货地址收货地址收货地址收货地址</text>
</view>
<!-- 姓名电话 -->
<view class="name">
<text class="c999 f26">张三 123456789</text>
</view>
</view>
<!-- 选择地址 -->
2025-01-11 03:51:29 +08:00
<view v-if="shopEdit" class="btn ti warmHollow plr20 ml20" @click="link('/pages/mine/delivery-address/index')">
2024-12-18 15:46:27 +08:00
<text class="cFF9B27">选择地址</text>
</view>
</view>
</template>
2025-01-11 03:51:29 +08:00
<style lang="scss" scoped>
//
2024-12-18 15:46:27 +08:00
</style>