diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..8ae452a --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,9 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "playground" : "standard", + "type" : "uni-app:app-android" + } + ] +} diff --git a/api/auth.js b/api/auth.js index d4374aa..dc5fef4 100644 --- a/api/auth.js +++ b/api/auth.js @@ -146,5 +146,19 @@ export function bindInvitationCode(params) { data: params, }); } +// 微信一键登录 +export function wechatLogin(params) { + return request({ + url: `/auth/loginByWechat?wechatCode=${params.wechatCode}&isValid=${params.isValid}`, + method: "post" + }); +} - +// 支付宝一键登录 +export function alipayLogin(params) { + return request({ + url: "/auth/loginByAlipay", + method: "post", + data: params, + }); +} diff --git a/common.scss b/common.scss index 8cd6fae..bb39f80 100644 --- a/common.scss +++ b/common.scss @@ -299,8 +299,8 @@ font-size: 26rpx; color: #999999; position: fixed; - bottom: 0; - height: 210rpx; + bottom: 24rpx; + // height: 210rpx; width: calc(100% - 80rpx); .policy_a_warp{ color: $app-policy-color; diff --git a/manifest.json b/manifest.json index 788a6ac..b468157 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,8 @@ /* 模块配置 */ "modules" : { "Payment" : {}, - "Camera" : {} + "Camera" : {}, + "OAuth" : {} }, /* 应用发布信息 */ "distribute" : { @@ -76,6 +77,12 @@ "appid" : "wx7a5902cd556d9396", "UniversalLinks" : "https://app.tbmall.xin/uni-universallinks/__UNI__4910728/" } + }, + "oauth" : { + "weixin" : { + "appid" : "wx7a5902cd556d9396", + "UniversalLinks" : "https://app.tbmall.xin/uni-universallinks/__UNI__4910728/" + } } }, "icons" : { @@ -117,6 +124,22 @@ /*忽略版本提示*/ "compatible" : { "ignoreVersion" : true + }, + "nativePlugins" : { + "Hyy-Alipay" : { + "__plugin_info__" : { + "name" : "【免费开源】支付宝,授权,授权登录", + "description" : "用过支付宝原生sdk,原生授权登录,更安全,有问题请联系作者", + "platforms" : "Android", + "url" : "https://ext.dcloud.net.cn/plugin?id=11931", + "android_package_name" : "", + "ios_bundle_id" : "", + "isCloud" : true, + "bought" : 1, + "pid" : "11931", + "parameters" : {} + } + } } }, /* 快应用特有相关 */ diff --git a/pages.json b/pages.json index dbd2c58..6e27754 100644 --- a/pages.json +++ b/pages.json @@ -416,6 +416,11 @@ "style": { "navigationStyle": "custom" } + },{ + "path": "bind-phone/bind-phone", + "style": { + "navigationStyle": "custom" + } }, { "path": "register/register", "style": { @@ -544,5 +549,15 @@ "bottom": "env(safe-area-inset-bottom)" } } + }, + "condition" : { //模式配置,仅开发期间生效 + "current": 0, //当前激活的模式(list 的索引项) + "list": [ + { + "name": "", //模式名称 + "path": "", //启动页面,必选 + "query": "" //启动参数,在页面的onLoad函数里面得到 + } + ] } } \ No newline at end of file diff --git a/pages/login_package/bind-phone/bind-phone.vue b/pages/login_package/bind-phone/bind-phone.vue new file mode 100644 index 0000000..84774f6 --- /dev/null +++ b/pages/login_package/bind-phone/bind-phone.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/pages/login_package/login/login.vue b/pages/login_package/login/login.vue index a7ac7d9..72a594e 100644 --- a/pages/login_package/login/login.vue +++ b/pages/login_package/login/login.vue @@ -1,279 +1,496 @@ diff --git a/static/login/WXICON.png b/static/login/WXICON.png new file mode 100644 index 0000000..6ccb391 Binary files /dev/null and b/static/login/WXICON.png differ diff --git a/static/login/ZFB.png b/static/login/ZFB.png new file mode 100644 index 0000000..e08ae47 Binary files /dev/null and b/static/login/ZFB.png differ diff --git a/utils/enumUtils.js b/utils/enumUtils.js index 6f6304c..debfe8f 100644 --- a/utils/enumUtils.js +++ b/utils/enumUtils.js @@ -23,6 +23,7 @@ export const SMS_TYPE = { "PASSWD": "passwd", "LOGIN": "login", "REGISTER": "register", + "WECHAT": "wechatValid" } // 图片类型 图片分类:COMMON-公共,CATEGORY-商品类目图标,BRAND-品牌LOGO,SHOP-店铺LOGO,GOODS-商品图片,SPECS-商品规格图片 diff --git a/utils/request.js b/utils/request.js index 4efd934..e818328 100644 --- a/utils/request.js +++ b/utils/request.js @@ -48,7 +48,7 @@ function request(options) { success: (res) => { if (isShowLoading) { // 请求之前做一些事 - uni.hideToast(); + uni.hideToast(); } let data = res.data; @@ -64,7 +64,8 @@ function request(options) { }); return; } - if (data.bizcode === 100) { + // 601 微信登录没注册 + if (data.bizcode === 100 || data.bizcode === 601) { resolve(data); // 成功时返回数据 } else if (data.bizcode === 201) { if ([201, 200].includes(data.errcode)) { @@ -107,7 +108,7 @@ function request(options) { fail: (error) => { if (isShowLoading) { // 请求之前做一些事 - uni.hideToast(); + uni.hideToast(); } uni.showToast({ title: "服务器异常,稍后再试",