接口调用

main
123456 2 months ago
parent 34bd1742dd
commit 1de1a6f8da
  1. 7
      api/index.js
  2. 2
      pages.json
  3. 4
      pages/login/login.vue
  4. 173
      pages/user/common.vue
  5. 2
      unpackage/dist/build/web/index.html
  6. 1
      unpackage/dist/build/web/static/js/index.e2aac900.js
  7. 1
      unpackage/dist/build/web/static/js/index.e9ad178a.js
  8. 2
      unpackage/dist/build/web/static/js/pages-exercises-cuowuti-cuowuti~pages-exercises-index~pages-index-detail~pages-index-index~pages-que~b13a08d1.3157a317.js
  9. 1
      unpackage/dist/build/web/static/js/pages-login-login.2e123484.js
  10. 1
      unpackage/dist/build/web/static/js/pages-login-login.cdf4c947.js
  11. 1
      unpackage/dist/build/web/static/js/pages-shijie-edit.22c488e9.js
  12. 1
      unpackage/dist/build/web/static/js/pages-shijie-index.84c6f6b7.js
  13. 1
      unpackage/dist/build/web/static/js/pages-user-common.98971dcd.js
  14. 1
      unpackage/dist/build/web/static/js/pages-user-common.c30d76b4.js

@ -1,5 +1,12 @@
import { request } from './request'
const api = {
wxPublicLogin(data) {
return request({
url: 'api/wxPublicLogin',
method: 'post',
data
})
},
simulationErrorList(data) {
return request({
url: 'api/user/simulationError',

@ -190,7 +190,7 @@
"path" : "pages/user/common",
"style" :
{
"navigationBarTitleText" : "登录中"
"navigationBarTitleText" : ""
}
},
{

@ -26,7 +26,7 @@
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="btn">手机号快捷登录
<view class="btn">微信登录
<button @click="openPage(4)"></button>
</view>
<!-- #endif -->
@ -79,7 +79,7 @@
};
},
onLoad(option) {
this.recommend_id = option.id;
this.recommend_id = option.id?option.id:"";
console.log(option)
const that = this;
uni.login({

@ -1,25 +1,188 @@
<template>
<view>
<view class="login">
<view class="login-form" v-if="isShow">
<u--form labelPosition="left" :model="model" :rules="rules" ref="uForm" labelWidth="80" labelAlign="center">
<u-form-item label="手机号" prop="mobile" borderBottom>
<u--input v-model="model.mobile" border="none" maxlength="11" placeholder="请输入账号"></u--input>
</u-form-item>
<u-form-item label="验证码" prop="code" borderBottom>
<view class="verify">
<view class="l">
<u--input v-model="model.code" border="none" maxlength="6" placeholder="请输入验证码"></u--input>
</view>
<view class="r">
<u-code :seconds="seconds" ref="uCode" @change="codeChange"></u-code>
<button @tap="getCode">{{tips}}</button>
</view>
</view>
</u-form-item>
</u--form>
</view>
<view class="btn" v-if="isShow" @click="toLogin()">立即绑定
</view>
</view>
</template>
<script>
export default {
data() {
return {
isShow: false,
tips: '',
id: "",
code: "",
seconds: 10,
model: {
mobile: '',
code: '',
},
rules: {
'mobile': {
type: 'string',
required: true,
message: '请填写手机号',
trigger: ['blur']
},
'code': {
type: 'string',
required: true,
message: '请填写验证码',
trigger: ['blur']
},
},
}
},
onLoad(o) {
console.log(o)
this.id = o.id?o.id:""
this.code = o.code
this.getInit();
},
methods: {
async getInit() {
const res = await this.$api.wxPublicLogin({
code: this.code,
recommend_id: this.id
})
console.log(res)
},
async getCode() {
if (this.$refs.uCode.canGetCode) {
if (this.model.mobile.length > 0) {
uni.showLoading({
title: '正在获取验证码'
})
const {
code,
data,
msg
} = await this.$api.sendSms({
mobile: this.model.mobile,
note: 'bind'
})
if (code == 200) {
uni.hideLoading();
// this.start()
uni.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
} else {
uni.showToast({
icon: "none",
title: msg
})
}
} else {
uni.$u.toast('请输入手机号');
}
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
codeChange(text) {
this.tips = text.replace('秒重新获取', '秒');
},
}
}
</script>
<style lang="scss" scoped>
page{
background-color: #fff;
}
.login {
overflow: hidden;
&-form {
width: 90%;
margin: 240rpx auto 0;
.verify{
display: flex;
justify-content: space-between;
.l {
width: calc(100% - 180rpx);
}
.r {
width: 160rpx;
button {
width: 100%;
padding: 0;
font-size: 20rpx;
text-align: center;
}
}
}
}
.logo{
width: 650rpx;
height: 650rpx;
display: block;
margin: 0 auto;
}
.btn {
width: 580rpx;
line-height: 98rpx;
background: #2B62B2;
border-radius: 98rpx;
position: relative;
font-size: 30rpx;
color: #fff;
text-align: center;
margin: 220rpx auto 0;
<style>
button {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 2;
opacity: 0;
}
}
.tip {
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #333333;
width: 100%;
position: absolute;
left: 0;
bottom: 80rpx;
z-index: 2;
.txt {
margin-bottom: 8px;
text {
color: #2B62B2;
padding: 0 10rpx;
}
}
}
}
</style>

@ -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>题库</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.19a89cf7.js></script><script src=/static/js/index.e9ad178a.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.19a89cf7.js></script><script src=/static/js/index.e2aac900.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

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-user-common"],{"57f2":function(n,t,e){"use strict";e.r(t);var u=e("97e2"),o=e.n(u);for(var r in u)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(r);t["default"]=o.a},"97e2":function(n,t,e){"use strict";e("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u={data:function(){return{}},onLoad:function(n){console.log(n)},methods:{}};t.default=u},df00:function(n,t,e){"use strict";e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return o})),e.d(t,"a",(function(){}));var u=function(){var n=this.$createElement,t=this._self._c||n;return t("v-uni-view")},o=[]},fc46:function(n,t,e){"use strict";e.r(t);var u=e("df00"),o=e("57f2");for(var r in o)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(r);var f=e("828b"),i=Object(f["a"])(o["default"],u["b"],u["c"],!1,null,"58dce5d8",null,!1,u["a"],void 0);t["default"]=i.exports}}]);

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save