Browse Source

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

xuchunyang 8 years ago
parent
commit
0ec1cf682b
3 changed files with 20 additions and 15 deletions
  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
		}
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
	mui.plusReady(function() {
129
	mui.plusReady(function() {
114
		var self = plus.webview.currentWebview();
130
		var self = plus.webview.currentWebview();
115
	
131
	

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

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

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

4
var headFlag;
4
var headFlag;
5
var resouFlag;
5
var resouFlag;
6
mui.plusReady(function() {
6
mui.plusReady(function() {
7
	
7
	var ws = plus.webview.currentWebview();
8
	var ws = plus.webview.currentWebview();
8
	var resourceId = ws.resourceId;
9
	var resourceId = ws.resourceId;
9
	var web = plus.webview.getWebviewById("html/proinforupdate.html");
10
	var web = plus.webview.getWebviewById("html/proinforupdate.html");
10
	var web1 = plus.webview.getWebviewById("resinforupdate.html");
11
	var web1 = plus.webview.getWebviewById("resinforupdate.html");
12
	
11
	userimg.addEventListener("click", function() {
13
	userimg.addEventListener("click", function() {
12
		flag = this.getAttribute("flag");
14
		flag = this.getAttribute("flag");
13
		headF = this.getAttribute("headFlag");
15
		headF = this.getAttribute("headFlag");
47
		var c = plus.camera.getCamera();
49
		var c = plus.camera.getCamera();
48
		c.captureImage(function(e) {
50
		c.captureImage(function(e) {
49
			plus.io.resolveLocalFileSystemURL(e, function(entry) {
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
				mui.openWindow({
52
				mui.openWindow({
58
					url: '../html/picture-upload.html',
53
					url: '../html/picture-upload.html',
59
					id: 'html/picture-upload.html',
54
					id: 'html/picture-upload.html',
92

87

93
	function changeToLocalUrl(path) {
88
	function changeToLocalUrl(path) {
94
		plus.io.resolveLocalFileSystemURL(path, function(entry) {
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
			mui.openWindow({
90
			mui.openWindow({
104
				url: '../html/picture-upload.html',
91
				url: '../html/picture-upload.html',
105
				id: 'html/picture-upload.html',
92
				id: 'html/picture-upload.html',