ソースを参照

page.json加了两行,改变标题颜色,修改注册页面上传组件

YUPENG-SHI 3 年 前
コミット
df9da45f10
2 ファイル変更44 行追加3 行削除
  1. 3 2
      app/pages.json
  2. 41 1
      app/pages/enterprise-reg/enterprise-reg.vue

+ 3 - 2
app/pages.json

@@ -128,7 +128,8 @@
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",
 		"navigationBarBackgroundColor": "#F8F8F8",
-		"backgroundColor": "#F8F8F8"
-
+		"backgroundColor": "#F8F8F8",
+		"navigationBarBackgroundColor": "#0080ff",
+		"navigationBarTextStyle":"white"
 	}
 }

+ 41 - 1
app/pages/enterprise-reg/enterprise-reg.vue

@@ -42,7 +42,18 @@
 				<view class="l">营业执照:</view>
 				<view class="r">
 					<view class="img">
-						<u-upload max-count="1" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300" height="200"></u-upload>
+						<!-- <u-upload max-count="1" ref="license" :file-list="imgList" :action="uploadImageUrl" width="300" height="200"></u-upload> -->
+						<uni-file-picker
+						    v-model="imageValue" 
+						    fileMediatype="image" 
+						    mode="grid" 
+							limit="1"
+						    @select="select" 
+						    @progress="progress" 
+						    @success="success" 
+						    @fail="fail" 
+							:image-styles="imageStyles"
+						/>
 					</view>
 				</view>
 			</view>
@@ -56,6 +67,17 @@
 	export default {
 		data() {
 			return {
+				imageValue:[],
+				imageStyles:{
+					width:150,
+					height:100,
+					border:{
+						color:"#eee",
+						width:1,
+						style:'dashed',
+						radius:'5px'
+					}
+				},
 				imgList:[],
 				uploadImageUrl: request.server + '/upload/image',
 				form:{
@@ -68,6 +90,24 @@
 			}
 		},
 		methods: {
+			// 获取上传状态
+			select(e){
+				console.log('选择文件:',e)
+			},
+			// 获取上传进度
+			progress(e){
+				console.log('上传进度:',e)
+			},
+			
+			// 上传成功
+			success(e){
+				console.log('上传成功')
+			},
+			
+			// 上传失败
+			fail(e){
+				console.log('上传失败:',e)
+			},
 			payChange(e){
 				this.form.payType=e.detail.value
 			},