wangguoyu há 3 dias atrás
pai
commit
c7a75dae33
4 ficheiros alterados com 104 adições e 54 exclusões
  1. 12 0
      api/haibao.js
  2. 2 0
      config.js
  3. 89 51
      pages/admin/haibao/haibaoInfo.vue
  4. 1 3
      pages/admin/mianshi/index.vue

+ 12 - 0
api/haibao.js

@@ -34,3 +34,15 @@ export function getHaibaoInfo(data = {}) {
     timeout: 20000
   })
 }
+
+export function haibaoShare(data = {}) {
+  return request({
+    url: '/app/haibao/share',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 2 - 0
config.js

@@ -8,6 +8,8 @@ const devKey = 'MZRBZ-Q6PKQ-THS5E-BOGKN-ZH4MQ-6YFWC'
 const proKey = 'VLOBZ-Q7XWB-YR4UP-NO4PH-EM7FS-G3BLR'
 export default   {
   mianshiUrl: `https://kf1.mtavip.com/h5/room`, // 面试外链地址
+  haibaoUrl: `https://kf1.mtavip.com/h5/share/haibao`, // 海报外链地址
+  jianliUrl: `https://kf1.mtavip.com/h5/share/jianli`, // 建立外链地址
   baseUrl: isPro?proUrl:devUrl,
   mapKey:isPro?proKey:devKey,
   // 应用信息

+ 89 - 51
pages/admin/haibao/haibaoInfo.vue

@@ -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>

+ 1 - 3
pages/admin/mianshi/index.vue

@@ -68,9 +68,7 @@
 	const roomUrl = ref('')
 
 	const sharePopupRef = ref(null)
-	function closePopup() {
-		sharePopupRef.value.close()
-	}
+
 	function onShareSuccess(e){
 		 console.log('分享成功', e.scene)
 	}