feat: 电话更新
parent
8ea064eba4
commit
c35933f251
|
|
@ -38,7 +38,7 @@
|
|||
<view class="px-[168rpx] pt-[48rpx]">
|
||||
<image
|
||||
class="w-[352rpx] h-[352rpx]"
|
||||
src="https://api.static.ycymedu.com/images/kf.jpg"
|
||||
:src="qrCodeUrl"
|
||||
:show-menu-by-longpress="true"
|
||||
></image>
|
||||
|
||||
|
|
@ -56,13 +56,28 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import Navbar from '@/pages-sub/components/navbar/Navbar.vue'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const phoneNumber = '18724728603'
|
||||
const userStore = useUserStore()
|
||||
|
||||
const contact = {
|
||||
'310000': {
|
||||
phone: '18516500555',
|
||||
qrCode: 'https://api-static-zhiy.oss-cn-shanghai.aliyuncs.com/images/shkf.jpg',
|
||||
},
|
||||
'370000': {
|
||||
phone: '18724728603',
|
||||
qrCode: 'https://api.static.ycymedu.com/images/kf.jpg',
|
||||
},
|
||||
}
|
||||
|
||||
const phoneNumber = ref('18516500555')
|
||||
const qrCodeUrl = ref('https://api-static-zhiy.oss-cn-shanghai.aliyuncs.com/images/shkf.jpg')
|
||||
|
||||
const makePhoneCall = () => {
|
||||
uni
|
||||
.makePhoneCall({
|
||||
phoneNumber: phoneNumber,
|
||||
phoneNumber: phoneNumber.value,
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
|
|
@ -72,6 +87,11 @@ const makePhoneCall = () => {
|
|||
const handleBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
phoneNumber.value = contact[userStore.userInfo.city.code]?.phone || phoneNumber.value
|
||||
qrCodeUrl.value = contact[userStore.userInfo.city.code]?.qrCode || qrCodeUrl.value
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue