|
|
@@ -1,61 +1,99 @@
|
|
|
<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 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 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>
|
|
|
+ <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 } 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)
|
|
|
- }
|
|
|
-})
|
|
|
+ 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 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>
|