| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <view class="phone-haibao-info-page">
- <view class="phone-navBar-box">
- <view @click="goUpPage" class="nav-bar-icon"></view>
- <text class="nav-bar-title">职业海报</text>
- <view @click="getUUid" class="text-btn">分享</view>
- </view>
- <view class="haibao-info-body-box">
- <view v-if="data.img" class="img-box">
- <img :src="data.img" class="haibao-image" />
- <view class="info-text-box">
- <view class="haibao-info-text">
- <icon class="jz-icon"></icon>{{data.jzName}}
- </view>
- <view class="haibao-info-text">
- <icon class="tel-icon"></icon>{{data.realName}}({{data.tel}})
- </view>
- </view>
- </view>
- <view v-else class="loading-text">暂无数据</view>
- </view>
- </view>
- <share-popup ref="sharePopupRef" title="海报" desc="请点击查看海报详情" :link=haibaoUrl type="0" @success="onShareSuccess" />
- </template>
- <script setup>
- import {
- reactive,
- ref
- } from "vue"
- import {
- onLoad
- } from "@dcloudio/uni-app";
- import * as httpApi from '@/api/haibao.js'
- import SharePopup from '@/components/sharePopUp/index.vue'
- import config from "../../../config"
- const data = reactive({
- img: '',
- id: '',
- menuId: '',
- jzName: '',
- realName: '',
- tel: '',
- uuid: ''
- })
- const haibaoUrl = ref('')
- const sharePopupRef = ref(null)
- function onShareSuccess(e){
- console.log('分享成功', e.scene)
- }
- function goUpPage() {
- uni.redirectTo({
- url: `/pages/admin/haibao/index?menuId=${data.menuId}`
- })
- }
- function getHaibaoOpsZhiyeData(id) {
- httpApi.getHaibaoInfo({
- id
- }).then(res => {
- data.img = res.data.image;
- data.jzName = res.data.jzName;
- data.realName = res.data.realName;
- data.tel = res.data.tel;
- }).catch(err => {
- console.error('加载海报失败:', err)
- uni.showToast({
- title: '加载失败',
- icon: 'none'
- })
- })
- }
- function getUUid() {
- httpApi.haibaoShare({
- id: data.id
- }).then(res => {
- if (res.code == 0) {
- data.uuid = res.data.uuid
- haibaoUrl.value = `${config.haibaoUrl}?uuid=${data.uuid}`
- sharePopupRef.value.open()
- }
- }).catch(err => {
- uni.showToast({
- title: '获得uuid失败',
- icon: 'none'
- })
- })
- }
- onLoad((options) => {
- data.id = options.cardId || ''
- data.menuId = options.menuId || ''
- if (data.id) {
- getHaibaoOpsZhiyeData(data.id)
- }
- })
- </script>
|