menchuang 1 anno fa
parent
commit
f9e9f65480
5 ha cambiato i file con 84 aggiunte e 12 eliminazioni
  1. 41 4
      components/bottomSheet/bottomSheet.vue
  2. 2 2
      config.js
  3. 12 4
      pages/login.vue
  4. 3 1
      store/modules/user.js
  5. 26 1
      utils/auth.js

+ 41 - 4
components/bottomSheet/bottomSheet.vue

@@ -178,6 +178,27 @@
 								<view class="uni-media-list-text-top">
 									<view class="tit-text">施工时间:</view>{{value.constructTime}}
 								</view>
+								
+								<view class="uni-media-list-text-top">
+									<view class="uni-common-mt" style="width: 100%;">
+										<text class="uni-title uni-common-pl" style=" font-size: 13px;color:
+											#000;margin-top: 5px;">施工内容:</text>
+										<view style="width: 100%;padding-right: 20rpx;box-sizing: border-box;">
+											<textarea class="textarea" maxlength="255" :disabled="true"
+												placeholder-style="padding: 10rpx;"
+												style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
+												auto-height>{{value.zEngineeringMaterialBo[0].remark}}</textarea>
+										</view>
+									</view>
+								</view>
+								
+								<view class="uni-media-list-text-top">
+								
+									<view class="tit-text">施工位置:</view>
+									<text style="margin-right: 10px;">{{value.constructAddre}}</text>
+									第{{value.zEngineeringMaterialBo[0].number}}根
+								</view>
+								
 								<view class="uni-media-list-text-top">
 
 									<view class="tit-text">负责人:</view>
@@ -188,10 +209,26 @@
 									<view class="tit-text">负责人联系电话:</view>
 									<text>{{value.constructPhone}}</text>
 								</view>
-								<view class="uni-media-list-text-top">
-
-									<view class="tit-text">米数:</view>
-									<text>{{value.zEngineeringMaterialBo[0].number}}</text>
+							
+								<view class="uni-common-mt" style="width: 100%;">
+									<text class="uni-title uni-common-pl" style=" font-size: 13px;color:
+											#000;margin-top: 5px; margin-left: 8px;">沟上部分照片:</text>
+								</view>
+								<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
+									<view v-for="(item,index) in value.onTheDitch" :key="index"
+										style="position: relative;">
+										<view
+											v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'  || item.substring(item.length - 3) == 'jpeg'">
+											<image :src="item" mode=""
+												style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
+												@click="showPhoto(index,value.onTheDitch)">
+											</image>
+										</view>
+										<view v-else>
+											<video :src="item"
+												style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
+										</view>
+									</view>
 								</view>
 								<view class="uni-common-mt" style="width: 100%;">
 									<text class="uni-title uni-common-pl" style=" font-size: 13px;color:

+ 2 - 2
config.js

@@ -2,8 +2,8 @@
 module.exports = {
 	 // baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
 	// baseUrl: 'http://192.168.4.6:8080',
-	// baseUrl: 'http://192.168.4.20:8080',
-	baseUrl: 'http://192.168.4.11:8080',
+	baseUrl: 'http://192.168.4.20:8080',
+	// baseUrl: 'http://192.168.4.11:8080',
 	// baseUrl: 'http://192.168.4.23:8080',
 	// baseUrl: 'http://192.168.4.14:8089',
 	baseIconUrl: 'https://www.xcx.cczdsz.cn/app/images/',

+ 12 - 4
pages/login.vue

@@ -23,7 +23,7 @@
 				</view>
 				<input v-model="loginForm.password" type="password" class="input" placeholder="密码" maxlength="20" />
 			</view>
-		<!-- 	<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
+			<!-- 	<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
 				<view class="iconfont icon-code icon"></view>
 				<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
 				<view class="login-code">
@@ -44,6 +44,10 @@
 		getCodeImg
 	} from '@/api/login'
 
+	import {
+		getUserName,
+		getPassword
+	} from '@/utils/auth'
 	export default {
 		data() {
 			return {
@@ -53,8 +57,8 @@
 				register: false,
 				globalConfig: getApp().globalData.config,
 				loginForm: {
-					username: "010401001",
-					password: "123456",
+					username: "",
+					password: "",
 					code: "",
 					uuid: '',
 					type: 'app'
@@ -64,6 +68,10 @@
 		created() {
 			//this.getCode()
 		},
+		onLoad() {
+			this.loginForm.username = getUserName()
+			this.loginForm.password = getPassword()
+		},
 		methods: {
 
 			// 获取图形验证码
@@ -82,7 +90,7 @@
 					this.$modal.msgError("请输入您的账号")
 				} else if (this.loginForm.password === "") {
 					this.$modal.msgError("请输入您的密码")
-				} 
+				}
 				// else if (this.loginForm.code === "" && this.captchaEnabled) {
 				// 	this.$modal.msgError("请输入验证码")
 				// } 

+ 3 - 1
store/modules/user.js

@@ -2,7 +2,7 @@ import config from '@/config'
 import storage from '@/utils/storage'
 import constant from '@/utils/constant'
 import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken, setUserRole,removeUserRole} from '@/utils/auth'
+import { getToken, setToken, removeToken, setUserRole,removeUserRole,setPassword, setUserName} from '@/utils/auth'
 
 const baseUrl = config.baseUrl
 
@@ -53,6 +53,8 @@ const user = {
       return new Promise((resolve, reject) => {
         login(username, password, code, uuid,type).then(res => {
           setToken(res.data.token)
+		  setUserName(username)
+		  setPassword(password)
           commit('SET_TOKEN', res.data.token)
           resolve()
         }).catch(error => {

+ 26 - 1
utils/auth.js

@@ -1,6 +1,7 @@
 const TokenKey = 'App-Token'
 const UserRole = 'App-UserRole'
-
+const UserNameKey = 'App-UserName'
+const PasswordKey = 'App-Password'
 export function getToken() {
   return uni.getStorageSync(TokenKey)
 }
@@ -24,3 +25,27 @@ export function setUserRole(role) {
 export function removeUserRole() {
   return uni.removeStorageSync(UserRole)
 }
+
+export function getUserName() {
+  return uni.getStorageSync(UserNameKey)
+}
+
+export function setUserName(userName) {
+  return uni.setStorageSync(UserNameKey, userName)
+}
+
+export function removeUserName() {
+  return uni.removeStorageSync(UserNameKey)
+}
+
+export function getPassword() {
+  return uni.getStorageSync(PasswordKey)
+}
+
+export function setPassword(password) {
+  return uni.setStorageSync(PasswordKey, password)
+}
+
+export function removePassword() {
+  return uni.removeStorageSync(PasswordKey)
+}