liukun 2 miesięcy temu
rodzic
commit
46075b6d21
5 zmienionych plików z 59 dodań i 24 usunięć
  1. 1 8
      App.vue
  2. 14 1
      components/myTable/myTable.vue
  3. 2 1
      pages.json
  4. 41 13
      pages/login/login.vue
  5. 1 1
      utils/request.js

+ 1 - 8
App.vue

@@ -1,14 +1,7 @@
 <script>
 	export default {
 		onLaunch: function() {
-			// uni.setTabBarBadge({
-			// 	index: 2,
-			// 	text: 56
-			// })
-			// uni.showTabBarRedDot({
-			// 	index: 4
-			// })
-			
+			// console.log(plus);
 			// let loginValue = uni.getStorageSync("isLogin");
 			// if (!isLogin) {
 			// 	uni.reLaunch({

+ 14 - 1
components/myTable/myTable.vue

@@ -21,7 +21,7 @@
 			<uni-td align="center" width="180">
 				<view class="uni-group">
 					<button class="uni-button" size="mini" type="primary" @click="handleBL(item)">办理</button>
-					<button class="uni-button" size="mini" type="warn">删除</button>
+					<button class="uni-button" size="mini" type="warn" @click="handleDel(item)">删除</button>
 				</view>
 			</uni-td>
 		</uni-tr>
@@ -77,6 +77,19 @@
 			url: props.blUrl + '&name=' + item.name
 		})
 	}
+	
+	function handleDel(item){
+		uni.showModal({
+			title: "提示",
+			content: "再次确认是否删除",
+			confirmColor: "#ff1919",
+			success: (e)=>{
+				if(e.confirm){
+					console.log(item);
+				}
+			}
+		})
+	}
 </script>
 
 <style lang="scss" scope>

+ 2 - 1
pages.json

@@ -59,7 +59,8 @@
 		"navigationBarTitleText": "住建OA",
 		"navigationBarBackgroundColor": "rgb(238,238,238)",
 		"backgroundColor": "#F8F8F8",
-		"navigationStyle": "custom"
+		"navigationStyle": "custom",
+		"pageOrientation": "landscape"
 	},
 	"tabBar": {
 		"color": "#999",

+ 41 - 13
pages/login/login.vue

@@ -10,33 +10,61 @@
 		<view class="operation">
 			<uni-easyinput prefixIcon="person-filled" v-model="username" placeholder="请输入登录账号" ></uni-easyinput>
 			<uni-easyinput prefixIcon="locked-filled" v-model="password" placeholder="请输入登录密码" type="password"></uni-easyinput>
-			<button type="primary" @click="handleLogin" :loading="loading" :disabled="loading">登录</button>
+			<button type="primary" :loading="loading" :disabled="loading" @click="handleLogin">登录</button>
 		</view>
-		
 	</view>
+	
+	<u-top-tips ref="uTips" navbar-height="0"></u-top-tips>
 </template>
 
 <script setup>
 	import {ref} from "vue";
+	import {ApiRequest} from "@/utils/request.js"
 
+	const uTips = ref()
 	const username = ref('')
 	const password = ref('')
 	const loading = ref(false)
 
 
 	function handleLogin(){
-		loading.value = true
-		console.log(username.value)
-		console.log(password.value)
-		uni.showToast({
-			title: "登录中...",
-			icon: "loading",
-			mask: true
-		})
-		uni.switchTab({url: "/pages/handleFile/handleFile"})
-
+		if(!username.value){
+			uTips.value.show({
+				title: '请输入登录账号',
+				type: 'error',
+				duration: '2300'
+			})
+		}else if(!password.value){
+			uTips.value.show({
+				title: '请输入登录密码',
+				type: 'error',
+				duration: '2300'
+			})
+		}else{
+			// ApiRequest({
+			// 	url: "/connect/token",
+			// 	method: "POST",
+			// 	data: {
+			// 		client_id: "androidclient",
+			// 		grant_type: "password",
+			// 		scope: "openid profile email RefineAPI",
+			// 		username: username.value,
+			// 		password: password.value
+			// 	}
+			// }).then(res=>{
+			// 	uni.setStorageSync('GlWorkPlatform-AccessToken','')
+			// })
+			
+			uni.setStorageSync('token','666')
+			loading.value = true
+			uni.showToast({
+				title: "登录中...",
+				icon: "loading",
+				mask: true
+			})
+			uni.switchTab({url: "/pages/handleFile/handleFile"})
+		}
 	}
-
 </script>
 
 <style lang="scss">

+ 1 - 1
utils/request.js

@@ -1,4 +1,4 @@
-const BASE_URL = 'http://localhost:5173'
+const BASE_URL = 'http://192.168.3.152:8088/glwork'
 
 export function ApiRequest(config = {}){
 	let {