Skip to content

Commit a578e32

Browse files
author
xiechun
committed
对新增功能进行调整
1 parent a4bf952 commit a578e32

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var form = new seeditForm({
6161
+ activityAPI: `string` 活动提交信息接口API
6262
+ $: `string` jquery,可选,没有值时默认使用全局$, 也可以外部传入jquery
6363
+ uid: `string|number` 论坛用户uid,默认自动读取用户信息,一般不需要填写
64-
+ html `html` 显示在最外层页面
6564
+ subTips `string` 提交地址页顶部提示语
6665
+ addTips `string` 添加地址页顶部提示语
6766
+ addrEditTips `string` 修改地址页顶部提示语
@@ -94,7 +93,8 @@ var form = new seeditForm({
9493
+ onError: `function` 提交资料失败回调
9594
+ onClose: `function` 返回按钮的回调事件
9695
+ onSubmit: `function` 提交按钮的回调事件
97-
+ editJson: `function` 外部修改提交的json
96+
+ editJson: `function` 外部修改提交的json,参数num控制在哪个环节修改数据
97+
+ indexHtml `function` 外部插入html代码,显示在最外层页面
9898

9999
## 初始化参数的`list`下的`name`值介绍
100100
+ `realname` 真实姓名

index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ seeditForm.prototype.format = function(options){
5858
this.params.list = options.list || [];
5959
// 实际需要的地址信息
6060
this.params.addr = options.addr || [];
61-
// 外部传入的html代码,显示在最外层页面
62-
this.params.html = options.html || '';
6361
// 提交地址顶部提示语
6462
this.params.subTips = options.subTips || '请确认您的收件信息';
6563
// 添加地址顶部提示语
@@ -150,6 +148,10 @@ seeditForm.prototype.format = function(options){
150148
alert("收件信息提交成功");
151149
_this.close();
152150
}
151+
// 外部传入的html代码,显示在最外层页面
152+
this.indexHtml = options.indexHtml || function(){
153+
return ''
154+
};
153155
/*
154156
* 基本构造数据
155157
* @params showname 表单左侧显示文案
@@ -509,7 +511,7 @@ seeditForm.prototype.defaultAddr = function(data,num){
509511
.replace('{{id}}', this.params.id || '' )
510512
.replace('{{subTips}}', this.params.subTips || '' )
511513
.replace('{{tips}}', this.params.tips || '' )
512-
.replace('{{html}}', this.params.html || '' )
514+
.replace('{{html}}', this.indexHtml())
513515
.replace('{{subBtn}}', this.params.subBtn || '' )
514516
.replace('{{closeBtn}}', this.params.closeBtn|| '' );
515517
if(!!num){
@@ -530,7 +532,7 @@ seeditForm.prototype.defaultAddr = function(data,num){
530532
return this;
531533
}
532534
// 提交地址信息
533-
// 参数为1提交到活动用户
535+
// 不带参数提交到活动用户
534536
// 参数为2提交到地址管理
535537
seeditForm.prototype.submit = function(num){
536538
var _this = this;
@@ -561,7 +563,7 @@ seeditForm.prototype.submit = function(num){
561563
}
562564
}
563565
// 外部修改json
564-
this.editJson(json);
566+
this.editJson(json,num);
565567
// 格式化数据
566568
json = this.params.formatValue(json);
567569
if( !!this.params.unionid ) json.unionid = this.params.unionid;

0 commit comments

Comments
 (0)