From 66d2c8d8c97e19fdbd969f97dd3d6a28f27c415f Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Wed, 01 Nov 2023 16:07:03 +0800
Subject: [PATCH] fix:小程序分享功能和秒级数据

---
 pages/actionChange/workOrderDetails/index.vue |   64 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/pages/actionChange/workOrderDetails/index.vue b/pages/actionChange/workOrderDetails/index.vue
index 2520f8d..3bfbe07 100644
--- a/pages/actionChange/workOrderDetails/index.vue
+++ b/pages/actionChange/workOrderDetails/index.vue
@@ -14,6 +14,8 @@
 				<u-button shape="square" type="primary" @click="submit"> ������ </u-button>
 			</view>
 		</view>
+		<u-overlay :show="show" :mask-click-able='false' opacity='0.8'>
+		</u-overlay>
 	</view>
 </template>
 <script>
@@ -28,27 +30,65 @@
 		},
 		data() {
 			return {
-				basicInfor: {}
+				basicInfor: {},
+				unitListL: [],
+				userInfor: null,
+				show: false
 			}
 		},
 		computed: {
 			pageState() {
 				return this.basicInfor.pageState
-			}
+			},
+		},
+		created() {
+			this.getUnitList()
 		},
 		onLoad: function(option) {
-			console.log('option', option)
 			//option���object������������������������������������������������
 			this.basicInfor = JSON.parse(option.infor)
-			this.share.title = '���������������'
-		},
-		onBackPress(e) {
-			uni.navigateBack({
-				delta: 1, //������������������������������������������2
-			})
-			return false
+			// let type = JSON.parse(option.type)
+			console.log('option', option)
+			this.userInfor = JSON.parse(uni.getStorageSync('userInfor') || 'null')
+			if (option.type === 'share' && this.userInfor) {
+				let params = {
+					allocationNum: this.basicInfor.allocationNum,
+					userId: this.userInfor.userId
+				}
+				this.$http.httpGet('/allocationApp/authority', params).then(res => {
+					res.data = false
+					if (!res.data) {
+						uni.showModal({
+							content: '���������������������������������������������',
+							showCancel: false,
+							confirmText: '������',
+							success: res => {
+								if (res.confirm) {
+									uni.reLaunch({
+										url: '/pages/index/index',
+									})
+								}
+							},
+						})
+					}
+				})
+			}
+			console.log('this.basicInfor ', this.basicInfor)
 		},
 		methods: {
+			closePop() {},
+			getUnitList() {
+				this.$http.httpGet('/allocation/unit').then(res => {
+					this.unitList = res.data
+					let data = ''
+					if (this.basicInfor.unitId && this.unitList.length > 0) {
+						data = this.unitList && this.unitList.find(a => Number(a.unitId) === Number(this.basicInfor
+							.unitId)).unitName
+						let time = this.basicInfor.time.slice(5)
+						this.share.title = `${data}-${time}������������`
+					}
+				})
+			},
 			radioGroupChange(e) {
 				console.log('radioGroupe���e', this.workForme.isChange)
 			},
@@ -59,8 +99,8 @@
 						showTabBar: true
 					}
 				})
-				uni.navigateBack({
-					delta: 1, //������������������������������������������2
+				uni.redirectTo({
+					url: '/pages/index/index',
 				})
 			},
 			refuse() {

--
Gitblit v1.8.0