当前位置:网站首页>VFP develops a official account to receive coupons, and users will jump to various target pages after registration, and a set of standard processes will be sent to you
VFP develops a official account to receive coupons, and users will jump to various target pages after registration, and a set of standard processes will be sent to you
2022-06-25 11:44:00 【VFP of Garfield】
Recently, I was designing a coupon system for a famous supermarket in Fujian , I met such a demand . The member registration in the supermarket system is based on the mobile phone number , The coupon distribution system in the official account needs to implement wechat ID Binding with mobile number , Then jump to the coupon receiving page .
There is also a process , The original login is to jump to the member center , Now it is required to directly jump to the coupon page .
The process is as follows :
To implement this process, you need to use the Qiyou three-tier framework ( Cat frame ) It's also very simple .
Membership center portal website
ctl_user.fsp?proc=usercenterhtml
Procedure usercenterhtml
Local cOpenid,lcCode,url,cTitle
*cOpenid=This.ReGetOpenId() && If you want to call OPENID The place of , You need to execute this acquisition openid
cWorkhtml=getwwwRootPath("")+"tmpl\usercenter.html"
cReghtml=getwwwRootPath("")+"tmpl\reg.html"
cOpenid=HttpQueryParams("openid")
If Empty(cOpenid)
This.ReGetOpenId()
Else
* write in cookie
httpSetcookie("openid",cOpenid,Datetime()+2*3600)
This.openid=cOpenid
Endif
*-- Validate users openid Whether the data table exists , If it exists, it is bound
If !Empty(This.openid)
oDBSQLhelper=Newobject("MSSQLHelper","MSSQLHelper.prg")
TEXT TO lcSQLCmd NOSHOW TEXTMERGE
SELECT COUNT(*) FROM wxuser_ck WHERE wxid=?this.openid
ENDTEXT
nRow=oDBSQLhelper.GetSingle(lcSQLCmd)
If Isnull(nRow) And !Empty(oDBSQLhelper.errmsg)
Error oDBSQLhelper.errmsg
Endif
Do Case
Case nRow==0 && There is no record , Jump to the login page
Private lcmyurl
lcmyurl="ctl_user.fsp?proc=usercenterhtml&appuser=bluesky"
cHtml=FWS_MergeFile(cReghtml) && Need to register
Case nRow==1
cHtml=Filetostr(cWorkhtml) && Registered , User center page
Otherwise
Error " User repeated registration "
Endcase
Endif
Return cHtml
Endproc
There is a sentence worth paying attention to lcmyurl, Save the jump after login URL
The login page HTML Code
<form id="form">
<div class="weui_cells weui_cells_form">
<div class="weui_cell weui_vcode">
<div class="weui_cell_hd"><label class="weui_label"><i class="icon icon-90 f20 query-color"></i> cell-phone number </label></div>
<div class="weui_cell_bd weui_cell_primary">
<input id="txtphone" class="weui_input" type="tel" required pattern="[0-9]{11}" maxlength="11"placeholder=" Please enter your mobile number " tips=" Please enter your mobile number " notMatchTips=" Please input the correct mobile number ">
</div>
<div class="weui_cell_ft">
<i class="weui_icon_warn"></i>
<a id="btnyzm" href="javascript:;" class="weui-vcode-btn query-color"> Get verification code </a>
</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label"><i class="icon icon-71 f20 query-color"></i> Verification Code </label></div>
<div class="weui_cell_bd weui_cell_primary">
<input id="txtyzm" class="weui_input" type="number" required placeholder=" Please enter the verification code " emptyTips=" Please enter the verification code ">
</div>
<div class="weui_cell_ft">
<i class="weui_icon_warn"></i>
</div>
</div>
</div>
<div class="weui_btn_area">
<a id="formSubmitBtn" href="javascript:" class="weui_btn query-bg-color"> notes book </a>
</div>
</form>
Login button binding click event
$("#formSubmitBtn").on("click",function(){
var cphone=$("#txtphone").val();
var yzm=$("#txtyzm").val();
$.post("ctl_user.fsp?proc=userbind&appuser=bluesky",{
phone:cphone,
code:yzm
},function(data){
console.log(data);
var odata=JSON.parse(data);
if(odata.errno!=0){
$.alert(odata.errmsg);
return;
}
$.alert(" Binding success , Start jumping ");
setTimeout(function(){
window.location.href="<%=u(lcmyurl)%>"
},3000)
})
})
In this way, arbitrary URL, Jump to the landing page first , Then jump to the function of the target page .
边栏推荐
- Idea uses the fast request interface for debugging
- Thingspanel releases Internet of things mobile client (multiple pictures)
- SQL注入漏洞(绕过篇)
- Explain websocket protocol in detail
- 時創能源沖刺科創板:擬募資11億 年營收7億淨利反降36%
- Ladder Side-Tuning:预训练模型的“过墙梯”
- Comparison between relu and SIGMOD
- What are the ways to simulate and burn programs? (including common tools and usage)
- Database Series: MySQL index optimization summary (comprehensive version)
- Presto Web UI introduction
猜你喜欢

翌圣生物冲刺科创板:25%收入来自新冠产品销售 拟募资11亿

Crawler scheduling framework of scratch+scratch+grammar

按钮多次点击造成结果

芯片的发展史和具体用途以及结构是什么样的

Translation of meisai C topic in 2022 + sharing of ideas

Whole process of web page request

Shichuang Energy sprint Technology Innovation Board: le chiffre d'affaires annuel prévu de 1,1 milliard de RMB est de 0,7 milliard de RMB, en baisse de 36%

What is the development history, specific uses and structure of the chip

Capacity expansion mechanism of Dict Of redis (rehash)

How TCP handles exceptions during three handshakes and four waves
随机推荐
Spark history server and event log details
Spark runs wordcount (case 2)
基于OpenStreetMap+PostGIS的地理位置系统 论文文档+参考论文文献+项目源码及数据库文件
过拟合原因及解决
Arrays.asList()
How to use the markdown editor
Flink partition policy
Detailed explanation of Flink checkpoint specific operation process and summary of error reporting and debugging methods
2022 PMP project management examination agile knowledge points (2)
JSON format processing
Vulnérabilité à l'injection SQL (contournement)
Thingspanel releases Internet of things mobile client (multiple pictures)
Niuke.com: Candy distribution
Big Endian 和 Little Endian
交易期货沪镍产品网上怎么开户
Comparable的使用(用于Arrays.sort)
Introduction to JVM principle
TCP如何處理三次握手和四次揮手期間的异常
Niuke: rotation array
Bayes