21 changed files with 176 additions and 69 deletions
@ -0,0 +1,48 @@ |
|||
import API from '@/common/js/api.js' |
|||
const wxApi = { |
|||
/** |
|||
* [wxRegister 微信Api初始化] |
|||
*/ |
|||
wxRegister(callback) { |
|||
let _this = this, |
|||
signUrl = encodeURIComponent(location.href.split("#")[0]), |
|||
jsApiList = ["chooseInvoiceTitle"]; |
|||
console.log(signUrl); |
|||
console.log(location.href.split("#")[0]); |
|||
// 接口请求传入路径
|
|||
// App._post_form("&do=getJssdk", {
|
|||
// sign_url: signUrl
|
|||
// }, (res) => {
|
|||
// let data = res.data;
|
|||
jWeixin.config({ |
|||
beta: true,//用于方法未对外公开的情况
|
|||
debug: false, // 开启调试模式
|
|||
appId: data.appId, // 必填,公众号的唯一标识
|
|||
timestamp: data.timestamp, // 必填,生成签名的时间戳
|
|||
nonceStr: data.nonceStr, // 必填,生成签名的随机串
|
|||
signature: data.signature, // 必填,签名
|
|||
jsApiList: jsApiList // 必填,需要使用的JS接口列表
|
|||
// openTagList:['wx-open-launch-weapp','wx-open-subscribe']
|
|||
}); |
|||
// jWeixin.ready(() => {
|
|||
// // jWeixin.hideMenuItems({
|
|||
// // menuList: ["menuItem:copyUrl"] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮
|
|||
// // });
|
|||
// callback && callback();
|
|||
// });
|
|||
// // _this.configData = {
|
|||
// // ...data,
|
|||
// // url: signUrl
|
|||
// // }
|
|||
// jWeixin.error((optinos) => {
|
|||
// // config信息验证失败会执行error函数,
|
|||
// //如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,
|
|||
// //也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
|||
// console.log(optinos, 'optinos',_this.configData.url)
|
|||
// // App.showError(optinos.errMsg)
|
|||
// });
|
|||
// });
|
|||
} |
|||
} |
|||
|
|||
export default wxApi |
|||
@ -1,2 +1,2 @@ |
|||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>Waterinvoice_uiapp</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
|||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.410d4646.js></script><script src=./static/js/index.864dc96b.js></script></body></html> |
|||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.410d4646.js></script><script src=./static/js/index.22aa64e5.js></script></body></html> |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wxlogin-registerphone"],{"275a":function(n,e,t){"use strict";t("7a82");var i=t("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,t("ac1f"),t("00b4");var o=i(t("4d55")),a={data:function(){return{mobile:"",pucode:"",snsCode:"439764",styles:{width:"100px"}}},methods:{onInput:function(n){!/^1[3-9]\d{9}$/.test(n.detail.value)&&n.detail.value?(uni.showToast({title:"您输入的手机号格式有误",icon:"none"}),this.mobile=""):this.mobile=n.detail.value},register:function(){var n=this;if(this.mobile)if(this.pucode)if(this.snsCode){var e={mobile:this.mobile,pucode:this.pucode,snsCode:this.snsCode};o.default.request("/wechat/wechat/savePuCode",e,(function(e){1==e.code&&(uni.setStorageSync("AccessToken",e.data.token),uni.setStorageSync("mobile",n.mobile),uni.showToast({title:"手机号绑定成功",icon:"none"}),setTimeout((function(){uni.navigateTo({url:"/pages/index/index"})}),1e3))}))}else uni.showToast({title:"请输入短信验证码",icon:"none"});else uni.showToast({title:"请输入用户编号",icon:"none"});else uni.showToast({title:"请输入手机号",icon:"none"})}}};e.default=a},"5ab7":function(n,e,t){"use strict";t.d(e,"b",(function(){return o})),t.d(e,"c",(function(){return a})),t.d(e,"a",(function(){return i}));var i={uniEasyinput:t("98d9").default},o=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("v-uni-view",{staticClass:"box"},[t("v-uni-view",[t("uni-easyinput",{attrs:{prefixIcon:"phone-filled",placeholder:"请输入手机号"},on:{blur:function(e){arguments[0]=e=n.$handleEvent(e),n.onInput.apply(void 0,arguments)}},model:{value:n.mobile,callback:function(e){n.mobile=e},expression:"mobile"}})],1),t("v-uni-view",{staticStyle:{"margin-top":"10px"}},[t("uni-easyinput",{attrs:{prefixIcon:"contact-filled",placeholder:"请输入用户编号"},model:{value:n.pucode,callback:function(e){n.pucode=e},expression:"pucode"}})],1),t("v-uni-view",{staticClass:"input"},[t("uni-easyinput",{staticStyle:{width:"100px","margin-right":"10px"},attrs:{placeholder:"请输入内容"},on:{input:function(e){arguments[0]=e=n.$handleEvent(e),n.input.apply(void 0,arguments)}},model:{value:n.snsCode,callback:function(e){n.snsCode=e},expression:"snsCode"}}),t("v-uni-button",{staticClass:"mini-btn",attrs:{type:"primary",size:"mini"}},[n._v("获取验证码")])],1),t("v-uni-view",[t("v-uni-button",{staticStyle:{width:"180px","margin-top":"20px"},attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=n.$handleEvent(e),n.register.apply(void 0,arguments)}}},[n._v("绑定手机号")])],1)],1)},a=[]},9433:function(n,e,t){var i=t("24fb");e=i(!1),e.push([n.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.box[data-v-3921ab67]{padding:40px}.input[data-v-3921ab67]{display:flex;align-items:center;margin-top:10px}',""]),n.exports=e},"9ded":function(n,e,t){"use strict";var i=t("d26c"),o=t.n(i);o.a},c448:function(n,e,t){"use strict";t.r(e);var i=t("275a"),o=t.n(i);for(var a in i)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(a);e["default"]=o.a},d26c:function(n,e,t){var i=t("9433");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);var o=t("4f06").default;o("6bc99f18",i,!0,{sourceMap:!1,shadowMode:!1})},d468:function(n,e,t){"use strict";t.r(e);var i=t("5ab7"),o=t("c448");for(var a in o)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(a);t("9ded");var s=t("f0c5"),u=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"3921ab67",null,!1,i["a"],void 0);e["default"]=u.exports}}]); |
|||
@ -1 +0,0 @@ |
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wxlogin-wxlogin"],{"0601":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){}));var a=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view")},o=[]},"16f6":function(t,e,n){"use strict";n.r(e);var a=n("31af"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=o.a},"31af":function(t,e,n){"use strict";n("7a82");var a=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("4d55")),i={data:function(){return{code:"",state:"",state1:"",appId:"",redirectUri:""}},onLoad:function(t){this.checkWeChatCode()},methods:{checkWeChatCode:function(){var t=this;o.default.getWxCode({},(function(e){1==e.code&&(t.redirectUri=e.data.redirectUri,t.appId=e.data.appId,t.state=e.data.state,t.getCode())}))},getCode:function(){var t=encodeURIComponent("https://intp.xingtongworld.com/wechat/");window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+this.appId+"&redirect_uri="+t+"&response_type=code&scope=snsapi_userinfo&state="+this.state+"#wechat_redirect"}}};e.default=i},"4d55":function(t,e,n){"use strict";n("7a82");var a=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("5530")),i="https://intp.xingtongworld.com",c={baseUrl:i,getWxCode:function(t,e,n){c.sendRequest("get",t,"/wechat/login/getWxCode",e,n)},wx:function(t,e,n){c.sendRequest("get",t,"/wechat/login/wx",e,n)},request:function(t,e,n,a){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];c.sendRequest("post",e,t,n,a,o)},sendRequest:function(t,e,n,a,c,d){var r="";r="POST"==t?"application/x-www-form-urlencoded":"application/json";var u={};d&&(u.header={"Content-Type":r,Accept:"application/json, text/javascript, */*; q=0.01",token:uni.getStorageSync("AccessToken")||""}),uni.request((0,o.default)((0,o.default)({url:i+n,method:t,data:e},u),{},{success:function(t){1!=t.data.code?uni.showToast({title:t.data.msg||t.msg,icon:"none"}):a&&a(t.data)}}))}},d=c;e.default=d},"6a49":function(t,e,n){"use strict";n.r(e);var a=n("0601"),o=n("16f6");for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);var c=n("f0c5"),d=Object(c["a"])(o["default"],a["b"],a["c"],!1,null,"44bf1784",null,!1,a["a"],void 0);e["default"]=d.exports}}]); |
|||
@ -0,0 +1 @@ |
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-wxlogin-wxlogin"],{"0601":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){}));var a=function(){var e=this.$createElement,t=this._self._c||e;return t("v-uni-view")},o=[]},"16f6":function(e,t,n){"use strict";n.r(t);var a=n("31af"),o=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);t["default"]=o.a},"31af":function(e,t,n){"use strict";n("7a82");var a=n("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n("4d55")),i={data:function(){return{code:"",state:"",state1:"",appId:"",redirectUri:""}},onLoad:function(e){this.checkWeChatCode()},methods:{checkWeChatCode:function(){var e=this;o.default.getWxCode({},(function(t){1==t.code&&(e.redirectUri=t.data.redirectUri,e.appId=t.data.appId,e.state=t.data.state,e.getCode())}))},getCode:function(){var e=encodeURIComponent("https://intp.xingtongworld.com/wechat/");window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+this.appId+"&redirect_uri="+e+"&response_type=code&scope=snsapi_userinfo&state="+this.state+"#wechat_redirect"}}};t.default=i},"4d55":function(e,t,n){"use strict";n("7a82");var a=n("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n("5530")),i="https://intp.xingtongworld.com",d={baseUrl:i,getWxCode:function(e,t,n){d.sendRequest("get",e,"/wechat/login/getWxCode",t,n)},wx:function(e,t,n){d.sendRequest("get",e,"/wechat/login/wx",t,n)},request:function(e,t,n,a){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];d.sendRequest("post",t,e,n,a,o)},sendRequest:function(e,t,n,a,d,c){var u="";u="POST"==e?"application/x-www-form-urlencoded":"application/json";var r={};c&&(r.header={"Content-Type":u,Accept:"application/json, text/javascript, */*; q=0.01",token:uni.getStorageSync("AccessToken")||""}),uni.request((0,o.default)((0,o.default)({url:i+n,method:e,data:t},r),{},{success:function(e){1!=e.data.code?(-14==e.data.code&&uni.navigateTo({url:"/pages/wxlogin/wxlogin"}),uni.showToast({title:e.data.msg||e.msg,icon:"none"})):a&&a(e.data)}}))}},c=d;t.default=c},"6a49":function(e,t,n){"use strict";n.r(t);var a=n("0601"),o=n("16f6");for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var d=n("f0c5"),c=Object(d["a"])(o["default"],a["b"],a["c"],!1,null,"44bf1784",null,!1,a["a"],void 0);t["default"]=c.exports}}]); |
|||
Loading…
Reference in new issue