Selaa lähdekoodia

修改 首次注册用户,完善个人信息页,头像拍照后,回到完善个人信息页,没有显示。

xuchunyang 8 vuotta sitten
vanhempi
commit
0ec1cf682b
3 muutettua tiedostoa jossa 20 lisäystä ja 15 poistoa
  1. 16 0
      app/js/fillinfo.js
  2. 2 0
      app/js/picture-upload.js
  3. 2 15
      app/js/public/upload-avatar.js

+ 16 - 0
app/js/fillinfo.js

@ -110,6 +110,22 @@ mui.ready(function() {
110 110
		}
111 111
	}
112 112

113
	window.addEventListener('showimg', function(event) {
114
		showuserimg();
115
	});
116
	
117
	function showuserimg(){
118
		var userId = plus.storage.getItem('userid');
119
		var filPage = plus.webview.getWebviewById('../html/fillinfo.html');
120
		var dyPage = plus.webview.currentWebview();
121
		if(dyPage == filPage) {
122
			var imgvar = '<img src="'+ baseUrl + "/images/head/" + userId + '_l.jpg" style="width:100%"/>';
123
			//console.log(imgvar) 
124
			document.getElementById('imgshow').innerHTML = imgvar;
125
		}
126
	}
127
	
128

113 129
	mui.plusReady(function() {
114 130
		var self = plus.webview.currentWebview();
115 131
	

+ 2 - 0
app/js/picture-upload.js

@ -73,6 +73,8 @@ mui.plusReady(function() {
73 73
						var Pa = plus.webview.getWebviewById('resinforupdate.html');
74 74
						mui.fire(Pa, 'resourceMess');
75 75
					}
76
					var ifllimg = plus.webview.getWebviewById('../html/fillinfo.html');
77
					mui.fire(ifllimg, 'showimg');
76 78
					mui.currentWebview.close();
77 79
					mui.back();
78 80
				} else {

+ 2 - 15
app/js/public/upload-avatar.js

@ -4,10 +4,12 @@ var flag;
4 4
var headFlag;
5 5
var resouFlag;
6 6
mui.plusReady(function() {
7
	
7 8
	var ws = plus.webview.currentWebview();
8 9
	var resourceId = ws.resourceId;
9 10
	var web = plus.webview.getWebviewById("html/proinforupdate.html");
10 11
	var web1 = plus.webview.getWebviewById("resinforupdate.html");
12
	
11 13
	userimg.addEventListener("click", function() {
12 14
		flag = this.getAttribute("flag");
13 15
		headF = this.getAttribute("headFlag");
@ -47,13 +49,6 @@ mui.plusReady(function() {
47 49
		var c = plus.camera.getCamera();
48 50
		c.captureImage(function(e) {
49 51
			plus.io.resolveLocalFileSystemURL(e, function(entry) {
50
				var filPage = plus.webview.getWebviewById('../html/fillinfo.html');
51
				var dyPage = plus.webview.currentWebview();
52
				if(dyPage == filPage) {
53
					var imgvar = '<img src="' + entry.toLocalURL() + '" style="width:100%"/>';
54
					//console.log(imgvar) 
55
					document.getElementById('imgshow').innerHTML = imgvar;
56
				}
57 52
				mui.openWindow({
58 53
					url: '../html/picture-upload.html',
59 54
					id: 'html/picture-upload.html',
@ -92,14 +87,6 @@ mui.plusReady(function() {
92 87

93 88
	function changeToLocalUrl(path) {
94 89
		plus.io.resolveLocalFileSystemURL(path, function(entry) {
95
			var filPage = plus.webview.getWebviewById('../html/fillinfo.html');
96
			var dyPage = plus.webview.currentWebview();
97
			if(dyPage == filPage) {
98
				var imgvar = '<img src="' + entry.toLocalURL() + '" style="width:100%"/>';
99
				//console.log(imgvar) 
100
				document.getElementById('imgshow').innerHTML = imgvar;
101
			}
102

103 90
			mui.openWindow({
104 91
				url: '../html/picture-upload.html',
105 92
				id: 'html/picture-upload.html',