Browse Source

no message

WIN-8NDK4S1KEGQ\Administrator 3 years ago
parent
commit
24fa9c824d
2 changed files with 18 additions and 14 deletions
  1. 17 13
      components/en-utils/en-head-img.vue
  2. 1 1
      pages.json

+ 17 - 13
components/en-utils/en-head-img.vue

@@ -1,20 +1,22 @@
 <template>
 	<view>
-		<view class="box" @click="editImg()">
+		<view class="box" @click="isShowPop()">
 			<image class="left" :src="value" mode="aspectFill"></image>
 			<view class="right">
 				<text>{{label}}</text>
 				<image src="@/static/img/toRight.png" mode=""></image>
 			</view>
 		</view>
-		<uni-popup ref="popup" type="bottom">
-			111
+		<uni-popup ref="popup" type="bottom"  background-color="#fff">
+			<view class="pop-box" @click="this.editImg(2)">使用相机拍一张</view>
+			<view class="pop-box" @click="this.editImg(1)">从相册选择一张</view>
 		</uni-popup>
 	</view>
 </template>
 
 <script>
 	import { upLoadingFileOss } from "@/common/js/upLoadingFile";
+	import tools from '@/common/js/tools.js'
 	
 	export default {
 		props:{
@@ -33,15 +35,16 @@
 			}
 		},
 		methods:{
-			showsdasa(){
+			isShowPop(){
 				let isH5=false
 				// #ifdef H5
 				isH5=true
 				// #endif
+
 				if(isH5){
 					this.editImg(1)
 				}else{
-					this.$refs.popup.open('top')
+					this.$refs.popup.open('bottom')
 				}
 			},
 			editImg(type){
@@ -54,7 +57,7 @@
 							tools.showLoading()
 							this.upLoadOss(res.tempFiles[0].path)
 						}else{
-							// tools.error('头像选择失败')
+							tools.error('头像选择失败')
 						}
 					}
 				})
@@ -62,16 +65,10 @@
 			
 			upLoadOss(path){
 				 upLoadingFileOss(path).then((res)=>{
-					 if(res.code===1){
-						 
-					 }else{
-						 
-					 }
+					 console.log(res);
 				 }).catch(()=>{
 					 tools.hideLoading()
 				 })
-				
-				
 			},
 		},
 	}
@@ -106,4 +103,11 @@
 			}
 		}
 	}
+	.pop-box{
+		height: 130rpx;
+		background-color: #fff;
+		text-align: center;
+		line-height: 130rpx;
+		font-size: 30rpx;
+	}
 </style>

+ 1 - 1
pages.json

@@ -31,7 +31,7 @@
 		"current": 0,
 		"list": [{
 			"name": "",
-			"path": "/pages/text/index",
+			"path": "",
 			"query": ""
 		}]
 	}