Ver Fonte

优化代码

wuhb há 3 meses atrás
pai
commit
d866505995
4 ficheiros alterados com 28 adições e 33 exclusões
  1. 1 16
      App.uvue
  2. 1 11
      pages/login/index.uvue
  3. 24 4
      pages/out/detail.uvue
  4. 2 2
      utils/request.uts

+ 1 - 16
App.uvue

@@ -1,7 +1,4 @@
 <script lang="uts">
-	let firstBackTime = 0
-	let timer = 0;
-	
 	export default {
 		onLaunch: function (options: OnLaunchOptions) {
 			console.log('App Launch')
@@ -56,19 +53,7 @@
 			console.log('App Exit')
 		},
 		methods:{
-			startTimer() {
-			  console.log("==========")
-			  timer = setInterval(() => {
-				console.log('定时器运行');
-				// 这里写你的定时任务
-			  }, 10000); // 每1000毫秒运行一次
-			},
-			stopTimer() {
-			  if (timer > 0) {
-				clearInterval(timer);
-				timer = 0;
-			  }
-			}
+			
 		}
 	}
 </script>

+ 1 - 11
pages/login/index.uvue

@@ -224,11 +224,6 @@
 		}
 
 		// 跳转到首页
-		/*setTimeout(() => {
-		    uni.redirectTo({
-		        url: '/pages/index/index'
-		    })
-		}, 1000)*/
 		setTimeout(() => {
             uni.redirectTo({
                 url: '/pages/index/index'
@@ -288,11 +283,6 @@
 	
 	const handleLoginSSO = async (apptoken:string): Promise<void> => {
 		try {
-			/* const resultKey = await getIsKey();
-			const resultKeyObj = resultKey as UTSJSONObject
-			const isKey = resultKeyObj["data"] as string |'0'
-			saveStoreIsKey(isKey); */
-			
 			let result = await loginSSO(apptoken)
 			console.log('自动登录:', result)
 			loginSuccess(result);
@@ -424,7 +414,7 @@
 		const versionJSON = await getVersion() as UTSJSONObject
 		versionServer.value = versionJSON['msg'] as string
 		const hasNewVersion = compareVersion(versionServer.value, version.value) // true
-		console.log("versionServer:"+versionServer.value)
+		console.log("versionServer:"+versionServer.value+",app:" + version.value)
 		console.log("hasNewVersion:"+hasNewVersion)
 		if(hasNewVersion){
 			installApkWithProgress();

+ 24 - 4
pages/out/detail.uvue

@@ -57,14 +57,17 @@
                         <view class="material-divider"></view>
                         <view class="material-footer">
                             <view class="quantity-info">
-                                <view class="detail-row">
-                                    <text class="quantity-label">数量:</text>
-                                    <text class="quantity-value">{{ getQuantity(item) }} {{ getMeasureName(item) }}</text>
-                                </view>
                                 <view class="detail-row">
                                     <text class="quantity-label">领料人:</text>
                                     <text class="quantity-value">{{ getReceiverUser(item) }}</text>
                                 </view>
+                                <view class="detail-row">
+                                    <text class="quantity-label">签收人:</text>
+                                    <text class="quantity-value">{{ getReceiverSigner(item) }}</text>
+                                </view>
+                            </view>
+                            <view class="right-info">
+                                <text class="quantity-num">{{ getQuantity(item) }} {{ getMeasureName(item) }}</text>
                             </view>
                             <view v-if="status == 'FINISHED' && getLineStatus(item) != 'Y'" class="receive-btn-wrap">
                                 <button class="receive-btn" @click="handleSignReceive(item)">签收</button>
@@ -139,6 +142,12 @@
 	    const val = item['receiverUser']
 	    return val != null ? val.toString() : ''
 	}
+	
+	const getReceiverSigner = (item: UTSJSONObject): string => {
+	    if (item == null) return ''
+	    const val = item['receiverSigner']
+	    return val != null ? val.toString() : ''
+	}
 
     const getLineStatusText = (item: UTSJSONObject): string => {
         const s = getLineStatus(item)
@@ -401,6 +410,17 @@
         flex: 1;
     }
 
+    .right-info {
+        justify-content: center;
+        margin-right: 24rpx;
+    }
+
+    .quantity-num {
+        font-size: 32rpx;
+        color: #007aff;
+        font-weight: bold;
+    }
+
     .detail-row {
         flex-direction: row;
         margin-bottom: 8rpx;

+ 2 - 2
utils/request.uts

@@ -14,9 +14,9 @@ export type RequestConfig = {
 
 // 基础 URL
 // const BASE_URL = "http://192.168.2.23:83";
-// const BASE_URL = "http://192.168.189.43:83";
+const BASE_URL = "http://192.168.189.43:83";
 // const BASE_URL = "http://222.243.138.146:8150/prod-api" //测试服务器;
-const BASE_URL = "http://222.243.138.146:880/prod-api" //正式服务器;
+// const BASE_URL = "http://222.243.138.146:880/prod-api" //正式服务器;
 
 /**
  * 获取基础 URL