wangxy vor 2 Wochen
Ursprung
Commit
b6c58b86f8
1 geänderte Dateien mit 83 neuen und 2 gelöschten Zeilen
  1. 83 2
      pages/admin/Hetong/Hetong.vue

+ 83 - 2
pages/admin/Hetong/Hetong.vue

@@ -2,15 +2,96 @@
 	<view class="phone-zjzgs-page">
 		<view class="icon-title-navBar-box">
 			<view @click="goUpPage" class="nav-bar-icon"></view>
-			<text class="nav-bar-title">子家政公司</text>
+			<text class="nav-bar-title">合同</text>
 		</view>
+		<template v-if="info.id">
+			<!-- -->
+			<!-- 	<web-view class="dljt-pdf-view" :src="pdfUrl1" v-if="show"
+				webview-styles="height: 50vh;margin-top: 75px"></web-view> -->
+		</template>
+		<template v-else>
+			暂无合同
+		</template>
+
+		<view @click="handleQianming" v-if="info.id">合同签名</view>
+
+		<uni-popup ref="popupRef" type="bottom" background-color="#fff" :is-mask-click="false" :mask-click="false"
+			style="height: 100vh">
+			<view style="height: 100vh;">
+				<view>
+					<view @click="goback2" class="nav-bar-icon">
+						<< /view>
+							<text class="nav-bar-title">签名</text>
+					</view>
+					<writeSign @getBase64="getBase64"></writeSign>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script setup>
+	import {
+		ref
+	} from "vue";
+	import * as httpApi from "@/api/hetong.js"
+	import {
+		onLoad
+	} from "@dcloudio/uni-app"
+	import writeSign from "@/components/writeSign/index.vue"
+
+	const pdfUrl1 = ref('');
+	const info = ref({})
+	const show = ref(false)
+	const popupRef = ref(null)
+
+	function goUpPage() {
+		uni.navigateBack()
+	}
+
+	onLoad(() => {
+		init()
+	})
+
+	function init() {
+		httpApi.getHetongLast().then(res => {
+			info.value = res.data;
+			pdfUrl1.value = `/hybrid/html/web/viewer.html?file=${encodeURIComponent(res.data.pdfUrl)}`;
+			// let pdfUrl2 = `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURIComponent(res.data.pdfUrl)}`
+
+			setTimeout(() => {
+				console.log('xianshi')
+				show.value = true;
+			}, 3000)
+		})
+	}
+
+	function handleQianming() {
+		popupRef.value.open()
+	}
+
+	function getBase64(img) {
+		httpApi.getHetongQianming({
+			id: info.id,
+			fuzeren: img
+		}).then(res => {
+			if (res.data) {
+				uni.showToast({
+					title: "签名成功",
+					duration: 2000,
+					success() {
+						goUpPage()
+					}
+				})
+			}
+		})
+	}
 
+	function goback2() {
+		popupRef.value.close()
+	}
 </script>
 
 <style>
 
-</style>
+</style>