-----------------------------html--------------------------- button open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo"请登录/button!--登录弹出来对话框--view catchtouchmove="preventTouchMove" wx:if="{{showModal}}"/view view wx:if="{{showModal}}" view viewimage src='../images/show.png' /image/view view关系手机上上号/view view请先关系手机上上号在进行此具体实际操作/view button open-type='getPhoneNumber' bindgetphonenumber="getPhoneNumber" image src='../images/showWx.png' /image手机上手机微信顾客一键关系 /button /view/view------------------------------js-----------------------------Page({ /** * 网页页面网页页面的初始数据信息信息内容 */ data: { openid: "", loginstate: "0", openid: "", userEntity: null, terminal: "", osVersion: "", phoneNumber:"", showModal: false,//定义登录弹出来对话框 },//在网页页面网页页面加载的状况下,辨别缓存文件文档中不是是有内容,倘若有,存进入相符合的字段名名里 onLoad:function(){ var that = this; wx.getStorage({ key: 'openid', success: function (res) { that.setData({ openid: res.data }); }, fail: function (res) { that.getcode(); } }); wx.getStorage({ key: 'userEntity', success: function (res) { that.setData({ userEntity: res.data }); }, fail: function (res) { console.log("fail1"); } }); wx.getStorage({ key: 'loginstate', success: function (res) { that.setData({ loginstate: res.data }); }, fail: function (res) { console.log("fail2"); } }); }, onGotUserInfo: function (e) { var that = this; if (e.detail.errMsg == "getUserInfo:ok") { wx.setStorage({ key: "userinfo", data: e.detail.userInfo }) this.setData({ userInfo: e.detail.userInfo }); that.showDialogBtn();//开启一键得到手机上上号弹出来对话框(本身写的) } }, // 显示信息信息内容一键得到手机上上号弹出来对话框 showDialogBtn: function () { this.setData({ showModal: true//修改弹出来对话框状况为true,即显示信息信息内容 }) }, // 隐藏一键得到手机上上号弹出来对话框 hideModal: function () { this.setData({ showModal: false//修改弹出来对话框状况为false,即隐藏 }); }, onshow: function (openid, userInfo, phoneNumber) { var that = this; wx.getSystemInfo({ success: function (res) { that.setData({ terminal: res.model }); that.setData({ osVersion: res.system }); } }) wx.request({ url: '登录插孔', method: 'POST', header: { 'content-type': 'application/json' // 默认设置设定值 }, data: { username: phoneNumber, parentuser: 'xudeihai', wximg: userInfo.avatarUrl, nickname: userInfo.nickName, identity: "", terminal: that.data.terminal, osVersion: that.data.system, logintype: "10",//手机上手机微信登录 openid: that.data.openid, }, success(res) { if (res.data.r == "T") { that.setData({ userEntity: res.data.d }); wx.setStorage({ key: "userEntity", data: res.data.d }) that.setData({ loginstate: "1" }); wx.setStorage({ key: "loginstate", data: "1" }) wx.setStorage({ key: 'userinfo', data: "1" }) } else { return; } }, fail(res) { console.log(res); } }) }, //关系手机上上 getPhoneNumber: function (e) { var that = this; that.hideModal(); wx.checkSession({ success: function () { wx.login({ success: res = { wx.request({ url: '本身的登录插孔', //仅为案例,其实不是真实的插孔详尽详细地址 data: { account: '1514382701', jscode: res.code }, method: "POST", header: { 'content-type': 'application/json' // 默认设置设定值 }, success(res) { if (res.data.r == "T") { wx.setStorage({ key: "openid", data: res.data.openid }) wx.setStorage({ key: "sessionkey", data: res.data.sessionkey }) wx.setStorageSync("sessionkey", res.data.sessionkey); wx.request({ url: '本身的解密插孔',//本身的解密详尽详细地址 data: { encryptedData: e.detail.encryptedData, iv: e.detail.iv, code: wx.getStorageSync("sessionkey") }, method: "post", header: { 'content-type': 'application/json' }, success: function (res) { if (res.data.r == "T") { that.onshow(that.data.openid, that.data.userInfo, res.data.d.phoneNumber);//开启onshow方法,并传输三个关键主要参数 console.log("登录获得取得成功") console.log(res.data.d.phoneNumber)//获得取得成功后打印手机上手机微信手机上上号 } else { console.log(res); } } }) } } }) } }) }, fail: function () { wx.login({ success: res = { wx.request({ url: '本身的登录插孔', //仅为案例,其实不是真实的插孔详尽详细地址 data: { account: '1514382701', jscode: res.code }, method: "POST", header: { 'content-type': 'application/json' // 默认设置设定值 }, success(res) { if (res.data.r == "T") { wx.setStorage({ key: "openid", data: res.data.openid }) wx.setStorage({ key: "sessionkey", data: res.data.sessionkey }) wx.request({ url: '本身的解密插孔',//本身的解密详尽详细地址 data: { encryptedData: e.detail.encryptedData, iv: e.detail.iv, code: res.data.sessionkey }, method: "post", header: { 'content-type': 'application/json' }, success: function (res) { that.onshow(that.data.openid, that.data.userInfo, res.data.d.phoneNumber);//开启onshow方法,并传输三个关键主要参数 } }) } } }) } }) } }) },})-------------------------wxss--------------------------/* ---弹出来对话框css--- */ .modal-mask { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: #000; opacity: 0.5; overflow: hidden; color: #fff;}.modal-dialog { width: 72%; position: absolute; top: 30%; left: 14%; background: #fff; border-radius: 12rpx;}.modal-content{ text-align: center;}.modal-content .show{ width: 450rpx; height: 323rpx; display: block; margin: 0 auto; margin-top: -118rpx; z-index: 10000;}.iconWx{ width:52rpx; height: 41rpx; padding-right: 20rpx;}.iconPhone{ width:56rpx; height: 56rpx; padding-right: 15rpx;}.modal-content view:nth-of-type(2){ font-size: 38rpx; color: #333333; line-height: 1;}.modal-content view:nth-of-type(3){ font-size: 26rpx; color: #9c9c9c; margin: 18rpx 0 29rpx; line-height: 1;}.modal-content button:nth-of-type(1){ width: 80%; height: 80rpx; border-radius: 60rpx; margin: 0 auto 80rpx; font-size: 30rpx; color: #fff; background: #31cc32; display: flex; flex-direction: row; align-items: center; justify-content: center; padding: 0; box-sizing: border-box;}.modal-content button:nth-of-type(1)::after{ border: none;}.modal-content .wxLogin{ font-size: 26rpx; color: #424242; display: flex; flex-direction: row; align-items: center; justify-content: center; margin: 38rpx 0 80rpx;}button::after{ border: none;} 点一下登录功能键,弹出来来手机上手机微信内嵌的不是是允许授权弹出来来框,倘若点一下的是允许,从缓存文件文档中加载顾客信息内容內容,并把顾客信息内容內容存储起来,同时开启弹出来来得到手机上上号的弹出来对话框(这一弹出来对话框时本身写的),在wxml里用wx:if="{{showModal}}"辨别得到手机上上号的隐藏状况,当为true的状况下显示信息信息内容,注意在两层view里写了两遍wx:if="{{showModal}}",为什么写两遍呢,因为第一层时弹出来来框的深深灰色蒙版状况,第二层是弹出来来框的内容,两层控制了所有弹出来对话框框不是是显示信息信息内容。经典著作权声明 即速应用倡导高度重视与维护保养技术专业专业知识产权年限期限。 弥勒供电系统系统软件与手机上手机微信手机微信微信小程序促进智能化化交费协议书便签署 弥勒供电系统系统软件局邀请手机上手机微信手机微信微信小程序“融e电”开发设计设计方案商在我国工商局局金融业组织相关工作中中工作中工作人员学员学生就业实干际实际操作流程进行学习培训学习培训 1605581535 2020双十一,手机上手机微信手机微信微信小程序如何杀出重围占据生产制造制造行业盈利? 双十一即将到来,各种各样商家早已在十月中就早就摩拳擦掌了,相对性性能比过去双十一的盛况,今年手机微信微信小程序才华横溢变为电子器件商务接待生产制造制造行业重要的比赛场。根据阿拉丁指数值值报告预测分析剖析大伙儿能够看到,今年双十一手机微信微信小程序的广告宣传宣传策划运营经营规模将呈现爆发式提升,有去年18亿到今年的4六亿,提升做到250%。手机微信微信小程序电子器件商务接待将变为流量争夺的重要方法。 1605581327 在我国邮政于百度搜索检索App公布集寄件、查询非常于一身的著名知名品牌卡功效 一年一度的双11购物快乐按期而至,大伙儿在“抢货”的同时,无可避免导致由于退货货要想寄快递公司企业的规定。便于考虑到顾客在双十一前后左右上下猛增的快递公司企业规定,在我国邮政于百度搜索检索App公布集寄件、查询非常于一身的著名知名品牌卡功效,该功效由百度搜索检索智能化化手机微信微信小程序载重。 1604628430 |