|
@ -46,6 +46,7 @@ import com.wade.mobile.ui.view.FlipperLayout;
|
46
|
46
|
import com.wade.mobile.util.Constant;
|
47
|
47
|
import com.wade.mobile.util.Messages;
|
48
|
48
|
import org.json.JSONArray;
|
|
49
|
import org.json.JSONException;
|
49
|
50
|
|
50
|
51
|
import java.net.URLDecoder;
|
51
|
52
|
import java.text.ParseException;
|
|
@ -119,7 +120,36 @@ public class MobileUI extends Plugin {
|
119
|
120
|
}
|
120
|
121
|
}
|
121
|
122
|
|
122
|
|
openTemplate(pageAction, data, isAnimation);
|
|
123
|
openTemplate(pageAction, data, isAnimation,true);
|
|
124
|
}
|
|
125
|
|
|
126
|
/**
|
|
127
|
* 加载页面
|
|
128
|
*/
|
|
129
|
public void loadPage(String pageAction, IData param, boolean isAnimation)
|
|
130
|
throws Exception {
|
|
131
|
// TemplateManager.checkRelationRes(TemplateManager.getBaseWebUrl()+url);//检查资源文件是否被修改
|
|
132
|
/* 获取模板相对路径 */
|
|
133
|
String templatePath = ServerPageConfig.getTemplate(pageAction);
|
|
134
|
if (templatePath == null || "".equals(templatePath)) {
|
|
135
|
IpuMobileUtility.error(Messages.NO_TEMPLATE + ",Action:" + pageAction);
|
|
136
|
}
|
|
137
|
|
|
138
|
IData data = null;
|
|
139
|
/* 载入业务数据 */
|
|
140
|
String dataAction = ServerPageConfig.getData(pageAction);
|
|
141
|
if (dataAction != null) {
|
|
142
|
MobileNetWork MobileNetWork = wademobile.getPluginManager()
|
|
143
|
.getPlugin(MobileNetWork.class);
|
|
144
|
String result = MobileNetWork.dataRequest(dataAction, param);// 打开页面时请求业务数据
|
|
145
|
data = new DataMap(result);
|
|
146
|
if (data.getInt("X_RESULTCODE") < 0) {
|
|
147
|
error(data.toString());
|
|
148
|
return;
|
|
149
|
}
|
|
150
|
}
|
|
151
|
|
|
152
|
openTemplate(pageAction, data, isAnimation, false);
|
123
|
153
|
}
|
124
|
154
|
|
125
|
155
|
public void openPage(String pageAction, IData param) throws Exception {
|
|
@ -135,7 +165,19 @@ public class MobileUI extends Plugin {
|
135
|
165
|
.parseBoolean(param.getString(2));
|
136
|
166
|
}
|
137
|
167
|
openTemplate(pageAction, isNull(data) ? null : new DataMap(data),
|
138
|
|
isAnimation);
|
|
168
|
isAnimation,true);
|
|
169
|
}
|
|
170
|
|
|
171
|
public void loadTemplate(JSONArray param) throws Exception{
|
|
172
|
String pageAction = param.getString(0);
|
|
173
|
String data = param.getString(1);
|
|
174
|
boolean isAnimation = true;
|
|
175
|
if (param.length() > 2) {
|
|
176
|
isAnimation = isNull(param.getString(2)) ? true : Boolean
|
|
177
|
.parseBoolean(param.getString(2));
|
|
178
|
}
|
|
179
|
openTemplate(pageAction, isNull(data) ? null : new DataMap(data),
|
|
180
|
isAnimation,false);
|
139
|
181
|
}
|
140
|
182
|
|
141
|
183
|
/**
|
|
@ -143,7 +185,7 @@ public class MobileUI extends Plugin {
|
143
|
185
|
* 多视图模式是否使用动画效果
|
144
|
186
|
*/
|
145
|
187
|
public void openTemplate(final String pageAction, final Map<?, ?> data,
|
146
|
|
final boolean isAnimation) throws Exception {
|
|
188
|
final boolean isAnimation ,final boolean isNewTemplate) throws Exception {
|
147
|
189
|
/* 获取模板相对路径 */
|
148
|
190
|
final String templatePath = ServerPageConfig.getTemplate(pageAction);
|
149
|
191
|
if (templatePath == null || "".equals(templatePath)) {
|
|
@ -166,9 +208,12 @@ public class MobileUI extends Plugin {
|
166
|
208
|
|
167
|
209
|
dataTmp = tmp;
|
168
|
210
|
}
|
169
|
|
|
170
|
|
TemplateWebView webview = initFlipperPage(pageAction, isAnimation);
|
171
|
|
webview.loadTemplate(templatePath, dataTmp);
|
|
211
|
if(isNewTemplate){ //是否为新开视图
|
|
212
|
TemplateWebView webview = initFlipperPage(pageAction, isAnimation);
|
|
213
|
webview.loadTemplate(templatePath, dataTmp);
|
|
214
|
}else {
|
|
215
|
((TemplateWebView) getWebView()).loadTemplate(templatePath, dataTmp);
|
|
216
|
}
|
172
|
217
|
} catch (Exception e) {
|
173
|
218
|
IpuMobileLog.e(TAG, e.getMessage(), e);
|
174
|
219
|
HintUtil.tip(wademobile.getActivity(), e.getMessage());
|
|
@ -179,7 +224,7 @@ public class MobileUI extends Plugin {
|
179
|
224
|
|
180
|
225
|
public void openTemplate(String pageAction, Map<?, ?> data)
|
181
|
226
|
throws Exception {
|
182
|
|
openTemplate(pageAction, data, true);
|
|
227
|
openTemplate(pageAction, data, true, true);
|
183
|
228
|
}
|
184
|
229
|
|
185
|
230
|
/**
|
|
@ -791,7 +836,7 @@ public class MobileUI extends Plugin {
|
791
|
836
|
final String data = param.getString(1);
|
792
|
837
|
|
793
|
838
|
openTemplate(pageAction, isNull(data) ? null : new DataMap(data),
|
794
|
|
true);
|
|
839
|
true ,true);
|
795
|
840
|
}
|
796
|
841
|
|
797
|
842
|
/**
|