下面这段代码及js可以正常执行,现在需要在页面上增加一个按钮"邀TA且沟通服务",见下面粉色部分:
页面代码:
Dim e As RequestEventArgs = args(0) '详情页面
Dim wb As New weui
wb.AddTopTips("","toptip1","") '用于显示动态错误提示
With wb.AddTabBar("", "tb1",0) '使用TabBar,增加4个按钮(注:页面可以增加,但不考虑)
.AddButton("bt1","首页","./images/a.png","/index.htm")
.AddButton("bt2","设置","./images/b.png","/per_chakanshezhi.htm")
.Addpage("bt3","当前","./images/c.png")
.AddButton("bt4","我的","./images/d.png","/personal.htm")
'.Attribute = "style='height:55px'"
End With
'-------下面代码主要用于:用getvalues方式,获得需要查看的会员编号--------------------------------------------
Dim bianh As String '定义,被查看会员的编号
Dim dr As DataRow '定义会员编号所在的行
For Each key As String In e.GetValues.Keys '取被查看会员编号
'msgbox(8)
If key = "bh" Then '如果取得被查看会员编号,则赋值
bianh = e.GetValues(key)
Else '如果没有取得被查看会员编号,则跳转到登录页面
msgbox("没有查看对象,将跳转到登录页面!")
wb.InsertHTML("<meta http-equiv='Re-fresh' cont-ent='0; ur-l=/login.htm'>") '那么直接跳转到登录页面
End If
Next
'-------下面代码主要用于:用获得的会员编号,将被查找会员的信息,找到会员所在行,并将会员信息赋值,为下段代码生成展示会员新的页面做准备--------------------------------------------
'为了下段代码查找做准备,定义变量(以下代码均可用)
Dim shouj As String '= dr("手机") '定义,手机
Dim zhansz As String '= dr("展示照") '定义,展示照
Dim nial As String '= dr("年龄") '定义,年龄
Dim xuel As String '= dr("学历") '定义,学历
Dim huny As String '= dr("婚姻状况") '定义,婚姻状况
Dim suozqx As String '= dr("所在区县") '定义,所在区县
Dim suozshi As String '= dr("所在市") '定义,所在市
Dim suozs As String '= dr("所在省") '定义,所在省
Dim jiaxqx As String '= dr("家乡区县") '定义,家乡省
Dim jiaxshi As String '= dr("家乡市") '定义,家乡市
Dim jiaxs As String '= dr("家乡省") '定义,家乡省
Dim nic As String '= dr("昵称") '定义,昵称
Dim xingb As String '= dr("性别") '定义,性别
Dim sheng As String '= dr("身高") '定义,性别
Dim tix As String '= dr("体型") '定义,性别
Dim yuex As String '= dr("月薪") '定义,性别
dr = DataTables("会员资料").SQLFind("会员编号 = '" & bianh & "'")
If dr IsNot Nothing Then
shouj = dr("手机") '定义,手机
zhansz = dr("展示照") '定义,展示照
nial = dr("年龄") '定义,年龄
xuel = dr("学历") '定义,学历
huny = dr("婚姻状况") '定义,婚姻状况
suozqx = dr("所在区县") '定义,所在区县
suozshi = dr("所在市") '定义,所在市
suozs = dr("所在省") '定义,所在省
jiaxqx = dr("家乡区县") '定义,家乡省
jiaxshi = dr("家乡市") '定义,家乡市
jiaxs = dr("家乡省") '定义,家乡省
nic = dr("昵称") '定义,昵称
xingb = dr("性别") '定义,性别
sheng = dr("身高") '定义,性别
tix = dr("体型") '定义,性别
yuex = dr("月薪") '定义,性别
Else
msgbox("没有找到TA!")
End If
'将本次被报名人的信息,添加到cookie,以便下个页面调用
e.AppendCookie("tbh",bianh) '被报名人编号写入cookie,准备在valid_details.htm页面,保存信息时调用,为防止下次错误调用(注:此cookie在details.htm页面,底部创建,在index.htm|indexb.htm|details.htm3个页面,删除此cookie)
'-------下面代码主要用于:生成展示会员信息的页面--------------------------------------------
With wb.AddArticle("bt3","ar1")
.AddImage("./" & zhansz)
.Attribute = "style='padding:0.5em;'"
End With
wb.AddForm("bt3","form1","valid_details.htm")
With wb.AddInputGroup("form1","ipg1","TA的资料")
With .AddInput("jcxx","有关于TA","text")
.Value = xingb & "_" & nial & "岁_" & xuel & "_" & huny
.Readonly = True
End With
With .AddInput("szd","所在城市","text")
.Value = suozqx & "_" & suozshi & "_" & suozs
.Readonly = True
End With
With .AddInput("jxd","家乡城市","text")
.Value = jiaxqx & "_" & jiaxshi & "_" & jiaxs
.Readonly = True
End With
.AddHiddenValue("gtfw","123")
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1s1", "邀TA加微信", "button").Attr-ibute= "on-click='validit_details()'"
ElseIf idengj = "中级会员" Then
.Add("btn2s4", "邀TA且沟通服务", "button").Attr-ibute= "on-click='validit_details(“123”)'"
End If
当点击按钮"邀TA加微信"或"邀TA且沟通服务",怎么样在处理信息页面“valid_details.htm”,区分这2个按钮?
End With
End With
wb.AppendHTML("<script src='./lib/ajaxform_details.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '在客户端,生成网页
js代码:
function validit_details(){
document.getElementById("gtfw").value = idx
var result = submitAjaxForm('form1','',false);
if (result =='OK') {show('dlg1')}
else if (result =='您尚未登录!') {show('dlg2')}
else if (result =='未找到TA的账号!') {show('dlg3')}
else if (result =='您已经邀请她了!') {show('dlg4')}
}
[此贴子已经被作者于2017/4/27 16:16:32编辑过]