| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <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 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>
- </template>
- <script setup>
- import { reactive } from "vue"
- import { onLoad } from "@dcloudio/uni-app";
- import * as httpApi from '@/api/haibao.js'
- const data = reactive({
- img: '',
- id: '',
- menuId: '',
- jzName: '',
- realName: '',
- tel: '',
- })
- 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' })
- })
- }
- onLoad((options) => {
- data.id = options.cardId || ''
- data.menuId = options.menuId || ''
- if (data.id) {
- getHaibaoOpsZhiyeData(data.id)
- }
- })
- </script>
|