添加测评登录
This commit is contained in:
parent
d3d59409e0
commit
6126ea916b
|
@ -6,6 +6,8 @@ export default {
|
|||
baseUrl: 'https://syjk.yhy.ren/xcx-api/', // 生产
|
||||
// baseUrl:'http://192.171.1.17:8082/',
|
||||
// baseUrl1:'http://syjk.yhy.ren/prod-api',//大屏
|
||||
//baseUrl:'http://192.171.1.17:9206/',
|
||||
|
||||
|
||||
post(url, param) {
|
||||
return this.ajax('post', url, param)
|
||||
|
|
|
@ -120,7 +120,14 @@ export default { // 所有接口
|
|||
|
||||
//http://192.171.1.22:9206/ytj-report/testReportDetails?userId=15&familyId=1
|
||||
testReportDetails: (param) => ajax.get(`ytj-report/testReportDetails`, param),
|
||||
|
||||
//登录
|
||||
sendTheVerificationCodeXcx: (param) => ajax.get('sysUser/sendTheVerificationCodeXcx', param), // 发送手机号验证码
|
||||
xcxLogin: (param) => ajax.get('userLogin/login/xcxLogin', param), // 小程序登录
|
||||
wechatScanCodeLogin: (param) => ajax.get('userLogin/login/wechatScanCodeLogin', param), // 微信扫码登录
|
||||
perfectTheInformationXcx: (param) => ajax.post('sysUser/perfectTheInformationXcx', param), // 个人用户登录(注册)or web未使用手机号注册企业用户登录(绑定)小程序专用
|
||||
completeInformation: (param) => ajax.get('/sysUser/completeInformation', param), //查询用户基本信息
|
||||
customerDropDownBox: (param) => ajax.get('sysUser/customerDropDownBox', param), // 客户列表
|
||||
perfectTheInformation: (param) => ajax.post('sysUser/perfectTheInformationXcx?application=true', param), // 注册或者保存信息
|
||||
|
||||
|
||||
queryLargeScreenData: (param) => ajax1.get(`dataDetection/facilityChart/queryLargeScreenData`, param), //数据大屏
|
||||
|
|
|
@ -4224,6 +4224,27 @@
|
|||
"whatwg-fetch": "^3.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/vue-loader-v15": {
|
||||
"version": "npm:vue-loader@15.11.1",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
|
||||
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/component-compiler-utils": "^3.1.0",
|
||||
"hash-sum": "^1.0.2",
|
||||
"loader-utils": "^1.1.0",
|
||||
"vue-hot-reload-api": "^2.3.0",
|
||||
"vue-style-loader": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"hash-sum": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
|
||||
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"acorn": {
|
||||
"version": "8.10.0",
|
||||
"resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.10.0.tgz",
|
||||
|
@ -4479,19 +4500,6 @@
|
|||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.3.4.tgz",
|
||||
"integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ=="
|
||||
},
|
||||
"@vue/vue-loader-v15": {
|
||||
"version": "npm:vue-loader@15.11.1",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
|
||||
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/component-compiler-utils": "^3.1.0",
|
||||
"hash-sum": "^1.0.2",
|
||||
"loader-utils": "^1.1.0",
|
||||
"vue-hot-reload-api": "^2.3.0",
|
||||
"vue-style-loader": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"@vue/web-component-wrapper": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
|
||||
|
@ -5564,15 +5572,6 @@
|
|||
"resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="
|
||||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"bl": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/bl/-/bl-4.1.0.tgz",
|
||||
|
@ -8746,12 +8745,6 @@
|
|||
"escape-string-regexp": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"optional": true
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz",
|
||||
|
@ -9038,7 +9031,7 @@
|
|||
},
|
||||
"fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"optional": true
|
||||
},
|
||||
|
@ -18518,11 +18511,10 @@
|
|||
},
|
||||
"fsevents": {
|
||||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-1.2.13.tgz",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
|
||||
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
"nan": "^2.12.1"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -16,6 +16,8 @@ Vue.prototype.$preventClick = function(times = 2000) { // 防抖
|
|||
this._CLICK = true
|
||||
setTimeout(() => this._CLICK = false, times)
|
||||
}
|
||||
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
|
|
|
@ -143,6 +143,13 @@
|
|||
"backgroundColor":"#3AAFB8"
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path" : "pages/login/ImproveInformation/ImproveInformation",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
@ -53,10 +53,12 @@
|
|||
<view class="flex align-center" style="margin-top: 36px;">
|
||||
<image :src="item.imgAddress" class="imgAddress"></image>
|
||||
<view>
|
||||
|
||||
<view class="titleInter">{{item.dishName}}</view>
|
||||
<view v-if="item.tags" class="flex flex-wrap">
|
||||
<view v-for="(item2,index2) in item.tags.split('、')" class="tag">{{item2}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
|
|
@ -0,0 +1,549 @@
|
|||
<template>
|
||||
<view class="pageBox">
|
||||
<view class="contioner">
|
||||
<view class="flex-contion">
|
||||
<view class="themColor text-df text-bold marginRight-xs" @click="perfectIndex=0" v-if="perfectIndex==1">
|
||||
上一步</view>
|
||||
<progress :percent="percent" activeColor="#3AAFB8" border-radius="50" class="flex-sub" />
|
||||
</view>
|
||||
<block v-if="perfectIndex==0">
|
||||
<view class="text-four marginTop text-center">生理性别和激素会影响我的身体代谢食物的方式</view>
|
||||
|
||||
<view class="text-bold marginTop-xl"># 你的姓名</view>
|
||||
<view class="marginTop flex-align">
|
||||
<input v-model="realName" maxlength="10" style="border: 1rpx solid #eee;padding: 5rpx; width: 100%;" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="text-bold marginTop-xl"># 选择你的性别</view>
|
||||
<view class="marginTop flex-align">
|
||||
<view class="flex-conter flex-direction text-sm" @click="tabClick(0)">
|
||||
<image src="https://shayu5qny.yhy.ren/login-boy.png" class="img"></image>
|
||||
<view :class="genIndex==0?'tagShaw':''">男性</view>
|
||||
</view>
|
||||
<view class="flex-conter flex-direction text-sm" @click="tabClick(1)">
|
||||
<image src="https://shayu5qny.yhy.ren/login-gilr.png" class="img"></image>
|
||||
<view :class="genIndex==1?'tagShaw':''">女性</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-bold marginTop-xl"># 选择你的出生年月</view>
|
||||
<!-- 时间选择器 -->
|
||||
<picker-view class="picker-view" indicator-class="city-picker" mask-style="background:#E6EFF1;opacity:0"
|
||||
:value="value" :indicator-style="indicatorStyle" @change="bindChange($event)">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item2,index2) in years" :key="index2"
|
||||
:class="value[0]==index2?'pickerSelected':''">
|
||||
{{item2}}年
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item3,index3) in months" :key="index3"
|
||||
:class="value[1]==index3?'pickerSelected':''">
|
||||
{{item3}}月
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item4,index4) in days" :key="index4"
|
||||
:class="value[2]==index4?'pickerSelected':''">
|
||||
{{item4}}日
|
||||
</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="text-center">
|
||||
<image
|
||||
:src="genIndex==0?'https://shayu5qny.yhy.ren/login-boy.png':'https://shayu5qny.yhy.ren/login-gilr.png'"
|
||||
class="boyGirl"></image>
|
||||
</view>
|
||||
<view class="text-four">身高体重信息对发现或筛查某些疾病有重要的参考价值</view>
|
||||
<view class="text-bold marginTop-xl"># 选择你的身高</view>
|
||||
<view class="text-center text-bold margin-bottom-xs marginTop-sm">{{height}}CM</view>
|
||||
<scale :min="0" :max="300" :int="true" :single="10" :h="40" :active="height" :styles="styles"
|
||||
@value="heightSelect" ref="height" />
|
||||
<view class="text-bold marginTop-xl"># 选择你的体重</view>
|
||||
<view class="text-center text-bold margin-bottom-xs marginTop-sm">{{weight}}KG</view>
|
||||
<scale :min="0" :max="300" :int="true" :single="10" :h="40" :active="weight" :styles="styles"
|
||||
@value="weightSelect" ref="weight" />
|
||||
</block>
|
||||
<view class="flex-conter" @click="next">
|
||||
<view class="btn">{{perfectIndex==0?'下一步':'完成'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 检测企业 未注册企业弹框 -->
|
||||
<uni-popup type="center" ref="detection" :is-mask-click="false">
|
||||
<view class="detectionCard">
|
||||
<uni-icons type="closeempty" size="28" class="closeempty" @click="closeDetection"></uni-icons>
|
||||
<view class="text-center">
|
||||
<image src="https://shayu5qny.yhy.ren/corporateConnections.png" class="corporateConnections">
|
||||
</image>
|
||||
</view>
|
||||
<!-- 检测企业内容 -->
|
||||
<block v-if="type==1">
|
||||
<view class="fourSix text-bold text-center">检测到您是非企业用户</view>
|
||||
<view class="fourSix text-bold text-center marginBottom-xl">是否立即加入企业</view>
|
||||
<view class="btnTk" @click="changeType">立即加入</view>
|
||||
<view class="btnTk whiteShaw" @click="personalLogin">个人用户登录</view>
|
||||
</block>
|
||||
<!-- 未注册企业内容 -->
|
||||
<block v-else>
|
||||
<view class="fourSix text-bold text-center">未查询到您的数据</view>
|
||||
<view class="fourSix text-bold text-center marginBottom-xl">请联系企业注册</view>
|
||||
<view class="btnTk">去联系</view>
|
||||
<view class="btnTk tranform">取消</view>
|
||||
</block>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 加入企业弹框 -->
|
||||
<uni-popup type="center" ref="join" :is-mask-click="false">
|
||||
<view class="detectionCard">
|
||||
<uni-icons type="closeempty" size="28" class="closeempty" @click="closeJoin"></uni-icons>
|
||||
<view class="fourSix text-bold text-center marginBottom-xl">加入企业</view>
|
||||
<input v-model="key" placeholder="请输入激活码" class="inputClass marginBottom-xl marginTop-xl" />
|
||||
<view class="btnTk" @click="joinNow">立即加入</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
debounce,
|
||||
formatTime
|
||||
// preventClick,
|
||||
} from "/tool/index.js"
|
||||
import config from '/api/config.js'
|
||||
export default {
|
||||
data() {
|
||||
const date = new Date()
|
||||
const years = []
|
||||
const months = []
|
||||
const days = []
|
||||
var yearIndex = 0
|
||||
for (let i = 1900; i <= date.getFullYear(); i++) {
|
||||
if (i <= 2000) {
|
||||
yearIndex++;
|
||||
}
|
||||
|
||||
years.push(i)
|
||||
}
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
months.push(i)
|
||||
}
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
days.push(i)
|
||||
}
|
||||
return {
|
||||
realName:"",
|
||||
percent: 50, //进度
|
||||
perfectIndex: 0, //步骤索引
|
||||
genIndex: 0, //0男 1女
|
||||
years, //年
|
||||
months, //月
|
||||
days, //日
|
||||
yearIndex,
|
||||
monthIndex: 0,
|
||||
datIndex: 0,
|
||||
value: [], //年月日索引
|
||||
height: 170, //身高
|
||||
weight: 50, //体重
|
||||
type: 1, //检测企业弹框内容 2未注册企业弹框内容
|
||||
enterprise: 0, //下拉框选中索引
|
||||
phone: '', //手机号
|
||||
code: '', //验证码
|
||||
// 企业下拉框数据
|
||||
range: [],
|
||||
indicatorStyle: `height: 50px;`,
|
||||
styles: {
|
||||
line: '#96d0d6',
|
||||
bginner: '#fff',
|
||||
bgoutside: '#d4e7ea',
|
||||
font: '#3AAFB8',
|
||||
fontColor: '#3AAFB8',
|
||||
fontSize: 12,
|
||||
paddingLeft: '345rpx'
|
||||
},
|
||||
year: '',
|
||||
month: '',
|
||||
day: '',
|
||||
dateIndex: '2000-01-01',
|
||||
userId: null,
|
||||
yesNoEnterpriseUser: null,
|
||||
keyName: '',
|
||||
key: '',
|
||||
currDate: formatTime(new Date()).split(" ")[0],
|
||||
}
|
||||
},
|
||||
onLoad(opt) {
|
||||
//是否企业用户 0是 1否
|
||||
this.yesNoEnterpriseUser = opt.flag
|
||||
this.userId = opt.userId
|
||||
this.phone = opt.phone
|
||||
if ("null" != opt.userId) {
|
||||
this.$API.completeInformation({
|
||||
data: {
|
||||
userId: this.userId
|
||||
}
|
||||
}).then((res) => {
|
||||
var user = res.data
|
||||
if (null != user && null != user.sex) {
|
||||
this.genIndex = user.sex
|
||||
}
|
||||
if (null != user && null != user.birtyday) {
|
||||
var useryear = user.birtyday.split("-")[0];
|
||||
var usermonth = user.birtyday.split("-")[1];
|
||||
var userday = user.birtyday.split("-")[2];
|
||||
this.dateIndex = useryear + '-' + usermonth + '-' + userday
|
||||
var yearUserIndex = 0;
|
||||
var monthUserIndex = 0;
|
||||
var dayUserIndex = 0;
|
||||
const date = new Date()
|
||||
for (let i = 1900; i <= date.getFullYear(); i++) {
|
||||
if (i <= useryear) {
|
||||
yearUserIndex++;
|
||||
}
|
||||
}
|
||||
this.yearIndex = yearUserIndex;
|
||||
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
if (i < parseInt(usermonth)) {
|
||||
monthUserIndex++;
|
||||
}
|
||||
}
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
if (i < parseInt(userday)) {
|
||||
dayUserIndex++;
|
||||
}
|
||||
}
|
||||
//设置出生年月
|
||||
this.value = [yearUserIndex - 1, monthUserIndex, dayUserIndex]
|
||||
}
|
||||
//身高体重
|
||||
if (null != user && null != user.height) {
|
||||
this.height = parseInt(user.height)
|
||||
}
|
||||
if (null != user && null != user.weight) {
|
||||
this.weight = parseInt(user.weight)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.value = [this.yearIndex - 1, 0, 0]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//个人用户登录
|
||||
personalLogin() {
|
||||
if (this.$preventClick()) return
|
||||
var rsq = {
|
||||
sex: this.genIndex,
|
||||
birthday: this.dateIndex,
|
||||
height: this.height,
|
||||
weight: this.weight,
|
||||
phone: this.phone,
|
||||
type: 0
|
||||
}
|
||||
this.saveInfoAndLogin(rsq)
|
||||
},
|
||||
changeType() {
|
||||
var that = this
|
||||
//查询客户列表
|
||||
this.$API.customerDropDownBox({
|
||||
data: {}
|
||||
}).then((res) => {
|
||||
if (null != res.data) {
|
||||
res.data.forEach(function(item, index, array) {
|
||||
that.range.push({
|
||||
value: item.userId,
|
||||
text: item.nickName
|
||||
})
|
||||
})
|
||||
}
|
||||
this.$refs.join.open()
|
||||
})
|
||||
},
|
||||
//性别选择
|
||||
tabClick(index) {
|
||||
this.genIndex = index
|
||||
},
|
||||
// 出生年月选择器
|
||||
bindChange: function(e) {
|
||||
this.value = e.detail.value
|
||||
this.year = this.years[this.value[0]]
|
||||
this.month = this.months[this.value[1]]
|
||||
this.day = this.days[this.value[2]]
|
||||
|
||||
if (this.month < 10) {
|
||||
this.month = 0 + "" + this.month
|
||||
}
|
||||
|
||||
if (this.day < 10) {
|
||||
this.day = 0 + "" + this.day
|
||||
}
|
||||
|
||||
this.dateIndex = this.year + '-' + this.month + '-' + this.day
|
||||
},
|
||||
// 下一步 完成操作
|
||||
async next() {
|
||||
// console.log(this.dateIndex);
|
||||
// return
|
||||
if (this.$preventClick()) return
|
||||
var that = this
|
||||
if (this.perfectIndex == 0) {
|
||||
if (this.dateIndex > this.currDate) return toast('出生日期不能大于当前日期')
|
||||
this.perfectIndex = 1
|
||||
this.percent = 100
|
||||
} else {
|
||||
//完成
|
||||
var rsq = {
|
||||
userId: that.userId,
|
||||
sex: that.genIndex,
|
||||
birthday: that.dateIndex,
|
||||
height: that.height,
|
||||
weight: that.weight,
|
||||
phone: that.phone
|
||||
}
|
||||
//是否企业用户 0是 1否
|
||||
if (this.yesNoEnterpriseUser == 1) {
|
||||
this.$refs.detection.open()
|
||||
} else {
|
||||
//直接登录
|
||||
this.saveInfoAndLogin(rsq)
|
||||
}
|
||||
}
|
||||
},
|
||||
//个人用户登录:sysUser/perfectTheInformation 不要传userId
|
||||
//立即加入企业:sysUser/perfectTheInformation 不要传userId
|
||||
//有用户信息的保存基本信息:sysUser/perfectTheInformation 传userId
|
||||
async saveInfoAndLogin(data) {
|
||||
showLoading('请稍等...')
|
||||
var that = this
|
||||
//let openId = await this.$store.dispatch(types.GET_OPEN_ID)
|
||||
//data.openId = openId
|
||||
data.realName = that.realName
|
||||
let ret1 = this.$API.perfectTheInformation({
|
||||
data: data,
|
||||
}).then((res) => {
|
||||
if (res.code != 200) {
|
||||
return toast(res.msg)
|
||||
}else{
|
||||
hideLoading()
|
||||
let userInfo = res.data
|
||||
let token = openId
|
||||
let data = res.data
|
||||
uni.setStorageSync('userInfo',res.data);
|
||||
//进入到主界面
|
||||
}
|
||||
})
|
||||
},
|
||||
//身高尺子选择
|
||||
heightSelect(msg) {
|
||||
setTimeout(() => {
|
||||
this.height = msg;
|
||||
}, 0)
|
||||
},
|
||||
//体重尺子选择
|
||||
weightSelect(msg) {
|
||||
setTimeout(() => {
|
||||
this.weight = msg;
|
||||
}, 0)
|
||||
},
|
||||
// 关闭弹框
|
||||
closeDetection() {
|
||||
this.$refs.detection.close()
|
||||
},
|
||||
// 加入企业关闭弹框
|
||||
closeJoin() {
|
||||
this.$refs.join.close()
|
||||
this.clearJoin()
|
||||
},
|
||||
// 清空数据
|
||||
clearJoin() {
|
||||
this.enterprise = 0
|
||||
this.keyName = ''
|
||||
this.key = ''
|
||||
},
|
||||
// 企业下拉框选择器
|
||||
changeEnterprise(e) {
|
||||
console.log("e:", e);
|
||||
},
|
||||
// 立即加入企业
|
||||
joinNow() {
|
||||
if (this.$preventClick()) return
|
||||
if ('' == this.key) {
|
||||
return toast('请填写激活码')
|
||||
}
|
||||
var rsq = {
|
||||
sex: this.genIndex,
|
||||
birthday: this.dateIndex,
|
||||
height: this.height,
|
||||
weight: this.weight,
|
||||
phone: this.phone,
|
||||
key: this.key,
|
||||
type: 1
|
||||
}
|
||||
this.saveInfoAndLogin(rsq)
|
||||
},
|
||||
// 进入首页
|
||||
goHome() {
|
||||
uni.reLaunch({
|
||||
url: "/pages/tabBar/home/home"
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.themColor {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.fourSix {
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
.contioner {
|
||||
padding: 26rpx 80rpx;
|
||||
color: #3F4040;
|
||||
|
||||
.img {
|
||||
$wh: 160rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.tagShaw {
|
||||
width: 140rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background: $uni-color;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
height: 450upx;
|
||||
overflow: hidden;
|
||||
font-size: 40rpx;
|
||||
color: #909292;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.pickerSelected {
|
||||
color: $uni-color;
|
||||
}
|
||||
|
||||
.item {
|
||||
//line-height: 100rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.city-picker {
|
||||
border-top: 2rpx solid $uni-color;
|
||||
border-bottom: 2rpx solid $uni-color;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 48rpx;
|
||||
width: 622rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
background: $uni-color;
|
||||
border-radius: 50rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 28rpx;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.boyGirl {
|
||||
$wh: 80rpx;
|
||||
width: $wh;
|
||||
height: $wh;
|
||||
margin-top: 42rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detectionCard {
|
||||
width: 600rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 21rpx;
|
||||
padding: 62rpx 30rpx;
|
||||
position: relative;
|
||||
|
||||
.corporateConnections {
|
||||
width: 310rpx;
|
||||
height: 186rpx;
|
||||
padding-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.btnTk {
|
||||
margin: 0 auto;
|
||||
width: 500rpx;
|
||||
line-height: 103rpx;
|
||||
text-align: center;
|
||||
background: $uni-color;
|
||||
border-radius: 10rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 41rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.whiteShaw {
|
||||
background: #FFFFFF;
|
||||
color: $uni-color;
|
||||
border: 3rpx solid #3AAFB8;
|
||||
}
|
||||
|
||||
.closeempty {
|
||||
position: absolute;
|
||||
top: 41rpx;
|
||||
right: 41rpx;
|
||||
}
|
||||
|
||||
.tranform {
|
||||
background: #FFFFFF;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
::v-deep .uni-select__input-placeholder {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-select {
|
||||
border-radius: 22rpx;
|
||||
background: #F7F7F7;
|
||||
height: 103rpx;
|
||||
font-size: 36rpx;
|
||||
color: #17191A;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
padding-left: 40rpx;
|
||||
}
|
||||
|
||||
.inputClass {
|
||||
border-radius: 22rpx;
|
||||
background: #F7F7F7;
|
||||
height: 103rpx;
|
||||
font-size: 36rpx;
|
||||
color: #17191A;
|
||||
font-weight: bold;
|
||||
padding-left: 40rpx;
|
||||
}
|
||||
|
||||
.rightTitle {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,4 @@
|
|||
<template>
|
||||
|
||||
<view class="pageBox">
|
||||
<image src="https://sharkbaby.yhy.ren/login/loginScrew.png" class="backImg"></image>
|
||||
<image class="iconClass" src="https://sharkbaby.yhy.ren/login/loginIcon.png"></image>
|
||||
|
@ -11,21 +10,38 @@
|
|||
<view class="titleOne2" @click="click(0)">「健康风险评估」</view>
|
||||
</view>
|
||||
<image class="backImg" src="https://sharkbaby.yhy.ren/login/loginSubtract.png"></image>
|
||||
<view class="qrImg" id="codeBox" @click="updateWx()"></view>
|
||||
</view>
|
||||
|
||||
<view class="phoneBox" v-show="statusIndex == 0 ? false : true">
|
||||
<view class="title">完善信息</view>
|
||||
<view class="title" v-show="statusIndex == 1 ? true : false">完善信息</view>
|
||||
<image class="phomeIcon" src="https://sharkbaby.yhy.ren/login/loginShark.png" v-show="statusIndex == 1 ? false : true"></image>
|
||||
<view class="titleOne" v-show="statusIndex == 1 ? false : true">
|
||||
<view class="titleOne1">登陆你的账号,邀您参与</view>
|
||||
<view class="titleOne2" @click="click(0)">「健康风险评估」</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="titleOneOther" v-show="statusIndex == 1 ? true : false">为保证您的账号安全,请补全您的手机号码</view>
|
||||
|
||||
<input class="phoneClass" type="number" placeholder="输入手机号码" @input="clearInput"/>
|
||||
|
||||
|
||||
<view class="phoneClass">
|
||||
<input class="phoneInput" type="number" maxlength="11" placeholder="输入手机号码" v-model="phone" />
|
||||
<image class="phoneImg" @click="clearClick()" src="https://sharkbaby.yhy.ren/login/loginClear.png" v-show="phone == ''?false:true"></image>
|
||||
</view>
|
||||
<view class="codeClass">
|
||||
<!-- 验证码输入框 -->
|
||||
<input type="text" class="codeInput" maxlength="6" v-model="code" placeholder="输入验证码" />
|
||||
<!-- 获取验证码 -->
|
||||
<view class="codeGet" @click="isResend ? '' : getCode()">{{isResend?''+(time)+'s':'获取验证码'}}</view>
|
||||
</view>
|
||||
|
||||
<view :class="['loginClass',phone == ''||code==''?'loginClass1':'loginClass2']" @click="phone == ''||code=='' ? '' : click(1)">立即登录</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="login" @click="click(4)">{{(statusIndex == 0 || statusIndex == 1) ? '手机号登录' : '扫码登录'}}</view>
|
||||
<view class="login" @click="click(2)">{{(statusIndex == 0 || statusIndex == 1) ? '手机号登录' : '扫码登录'}}</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
@ -33,42 +49,254 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
toast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
debounce,
|
||||
formatTime
|
||||
// preventClick,
|
||||
} from "/tool/index.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
//状态,0为微信扫码,1为微信扫码完善信息,2为手机号登录
|
||||
statusIndex:1,
|
||||
statusIndex:0,
|
||||
phone: '', //手机号
|
||||
informationPhone: '', //完善信息的手机号
|
||||
code: '', //验证码
|
||||
correctCode: '', //正确的验证码
|
||||
time: 60, //秒
|
||||
timer: null, //定时器
|
||||
isResend: false, //是否显示重新发送
|
||||
unionid: '',//微信unionId
|
||||
yesNoEnterpriseUser:'',
|
||||
userId:'',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
onLoad(options) {
|
||||
console.log('login + options');
|
||||
console.log(options);
|
||||
var that = this;
|
||||
setTimeout(() => {
|
||||
that.updateWx();
|
||||
}, 1500);
|
||||
//that.wechatLogin();
|
||||
|
||||
},
|
||||
|
||||
mounted(){
|
||||
const s = document.createElement('script');
|
||||
s.scr = "https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"
|
||||
document.body.appendChild(s);
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js';
|
||||
document.body.appendChild(script);
|
||||
console.log('mounted');
|
||||
const wxCode = this.getQueryVariable('code');
|
||||
console.log('wxCode');
|
||||
console.log(wxCode);
|
||||
if(wxCode){
|
||||
this.wechatLogin(wxCode);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 进入完善资料
|
||||
goInfo() {
|
||||
clearInterval(this.timer)
|
||||
this.isResend = false
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/ImproveInformation/ImproveInformation?flag=' + this.yesNoEnterpriseUser + "&userId=" +
|
||||
this.userId + "&phone=" + this.informationPhone
|
||||
});
|
||||
},
|
||||
wechatLogin(code){
|
||||
var that = this;
|
||||
this.$API.wechatScanCodeLogin({
|
||||
data: {
|
||||
code: code,
|
||||
//code:'051fPQ000GexVS1W3s200X5SEb3fPQ0J'
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('wechatScanCodeLogin + res');
|
||||
console.log(res);
|
||||
if (res.code != 200) return uni.showToast({
|
||||
title: res.msg || '登录失败,请联系管理员',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
success: () => {}
|
||||
})
|
||||
|
||||
let data = res.data
|
||||
|
||||
let userInfo = data.sysUser
|
||||
var userId = null
|
||||
if (null != userInfo) {
|
||||
userId = userInfo.userId
|
||||
}
|
||||
|
||||
//需要完善资料 0不需要 1全部 2身高体重
|
||||
let needToPerfect = data.needToPerfect
|
||||
//是否企业用户 0是 1否
|
||||
that.yesNoEnterpriseUser = data.yesNoEnterpriseUser ? data.yesNoEnterpriseUser : '';
|
||||
that.userId = userId;
|
||||
if (needToPerfect == 0) {
|
||||
uni.setStorageSync('userInfo',res.data);
|
||||
} else {
|
||||
console.log(userId,"到完善资料")
|
||||
//到完善资料
|
||||
//没有手机号,完善手机号
|
||||
if(res.data.sysUser.phonenumber){
|
||||
that.unionid = res.data.sysUser.unionid ? res.data.sysUser.unionid : '';
|
||||
that.statusIndex = 1;
|
||||
}else{
|
||||
that.informationPhone = res.data.sysUser.phonenumber;
|
||||
that.goInfo();
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
getQueryVariable(variable) {
|
||||
var query = window.location.href.substring(1)
|
||||
var vars = query.split('&')
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split('=')
|
||||
if (pair[0] === variable) { return pair[1] }
|
||||
}
|
||||
return false
|
||||
},
|
||||
clearClick(){
|
||||
this.phone = '';
|
||||
},
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
console.log('获取验证码');
|
||||
if (this.$preventClick()) return
|
||||
if (!this.phone){
|
||||
return uni.showToast({
|
||||
title: String('请输入手机号'),
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
const reg = (
|
||||
/^(13[0-9]|14[1579]|15[0-3,5-9]|16[6]|17[0123456789]|18[0-9]|19[0-9])\d{8}$/
|
||||
);
|
||||
if (!reg.test(this.phone)) return toast('手机号码格式不正确,请重新填写')
|
||||
this.isResend = true
|
||||
this.$API.sendTheVerificationCodeXcx({
|
||||
data: {
|
||||
phone: this.phone,
|
||||
exist: 1,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('res');
|
||||
console.log(res);
|
||||
if (res.code != 200) return toast(res.msg)
|
||||
this.timeFunction()
|
||||
this.correctCode = res.data
|
||||
})
|
||||
},
|
||||
// 倒计时
|
||||
timeFunction() {
|
||||
this.timer = setInterval(() => {
|
||||
this.time--
|
||||
if (this.time == 0) {
|
||||
clearInterval(this.timer)
|
||||
this.isResend = false
|
||||
this.time = 60
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
updateWx(){
|
||||
console.log(333);
|
||||
new WxLogin({
|
||||
self_redirect: true,
|
||||
id: "codeBox",
|
||||
appid: "wx8a169dc73b528250",
|
||||
scope: "snsapi_login",
|
||||
//stylelite:1,
|
||||
//redirect_uri: "http://www.yhy.ren/register", // 修改成线上注册页面地址 /register
|
||||
redirect_uri:encodeURIComponent("https://syjk.yhy.ren/risk-assessment/#/pages/login/login/login"),
|
||||
state: "",
|
||||
style: "black",
|
||||
href: "https://sharkbaby.yhy.ren/login/wechat3.css",
|
||||
});
|
||||
|
||||
},
|
||||
// 登录
|
||||
async signIn() {
|
||||
if (this.$preventClick()) return
|
||||
var that = this
|
||||
const reg = (
|
||||
/^(13[0-9]|14[1579]|15[0-3,5-9]|16[6]|17[0123456789]|18[0-9]|19[0-9])\d{8}$/
|
||||
);
|
||||
if (!reg.test(this.phone)) return toast('手机号码格式不正确,请重新填写')
|
||||
uni.showLoading({
|
||||
title: String('登录中...'),
|
||||
mask: true,
|
||||
})
|
||||
let ret1 = that.$API.xcxLogin({
|
||||
data: {
|
||||
phone: that.phone,
|
||||
code: that.code,
|
||||
unionid: that.statusIndex == 2 ? '':that.unionid,
|
||||
openId:'',
|
||||
},
|
||||
}).then(async (res) => {
|
||||
console.log('小程序登录');
|
||||
console.log(res);
|
||||
uni.hideLoading()
|
||||
if (res.code != 200) return uni.showToast({
|
||||
title: res.msg || '登录失败,请联系管理员',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
success: () => {}
|
||||
})
|
||||
let data = res.data;
|
||||
let userInfo = data.sysUser
|
||||
var userId = null
|
||||
if (null != userInfo) {
|
||||
userId = userInfo.userId
|
||||
}
|
||||
|
||||
//需要完善资料 0不需要 1全部 2身高体重
|
||||
let needToPerfect = data.needToPerfect
|
||||
//是否企业用户 0是 1否
|
||||
that.yesNoEnterpriseUser = data.yesNoEnterpriseUser ? data.yesNoEnterpriseUser : '';
|
||||
that.userId = userId;
|
||||
if (needToPerfect == 0) {
|
||||
uni.setStorageSync('userInfo',res.data);
|
||||
} else {
|
||||
console.log(userId,"到完善资料")
|
||||
//到完善资料
|
||||
that.informationPhone = that.phone;
|
||||
that.goInfo();
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
click(index){
|
||||
//健康风险评估
|
||||
if(index == 0){
|
||||
console.log('健康风险评估');
|
||||
}
|
||||
//健康风险评估
|
||||
if(index == 1){
|
||||
console.log('健康风险评估');
|
||||
}
|
||||
//获取验证码
|
||||
if(index == 2){
|
||||
console.log('获取验证码');
|
||||
}
|
||||
//立即登录
|
||||
if(index == 3){
|
||||
if(index == 1){
|
||||
console.log('立即登录');
|
||||
this.signIn();
|
||||
}
|
||||
//手机或扫码登录
|
||||
if(index == 4){
|
||||
if(index == 2){
|
||||
console.log('手机或扫码登录');
|
||||
//状态,0为微信扫码,1为微信扫码完善信息,2为手机号登录
|
||||
let index = this.statusIndex;
|
||||
if((index == 0 || index == 1)){
|
||||
this.statusIndex = 2;
|
||||
}
|
||||
if(index == 2){
|
||||
this.statusIndex = 0;
|
||||
}
|
||||
console.log(this.statusIndex);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -128,6 +356,7 @@
|
|||
.titleOne2{
|
||||
color: #3AAFB8;
|
||||
font-size: 34px;
|
||||
|
||||
}
|
||||
}
|
||||
.backImg{
|
||||
|
@ -136,6 +365,13 @@
|
|||
height: 496px;
|
||||
}
|
||||
.qrImg{
|
||||
margin-top: -470px;
|
||||
width: 520px;
|
||||
height: 520px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +392,11 @@
|
|||
line-height: 100px;
|
||||
font-family: PingFang SC-Semibold;
|
||||
}
|
||||
.phomeIcon{
|
||||
margin-top: 204px;
|
||||
width: 312px;
|
||||
height: 73px;
|
||||
}
|
||||
.titleOne{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
@ -185,9 +426,70 @@
|
|||
height: 140px;
|
||||
border-radius: 70px 70px 70px 70px;
|
||||
background-color: #F5F5F5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.phoneInput{
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
height: 140px;
|
||||
line-height: 140px;
|
||||
font-size: 36px;
|
||||
}
|
||||
.phoneImg{
|
||||
margin-right: 60px;
|
||||
margin-top: 40px;
|
||||
margin-left: auto;
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
}
|
||||
.codeClass{
|
||||
margin-top: 60px;
|
||||
width: 800px;
|
||||
height: 140px;
|
||||
border-radius: 70px 70px 70px 70px;
|
||||
background-color: #F5F5F5;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.codeInput{
|
||||
margin-left: 60px;
|
||||
margin-top: 0;
|
||||
height: 140px;
|
||||
line-height: 140px;
|
||||
font-size: 36px;
|
||||
|
||||
}
|
||||
.codeGet{
|
||||
margin-right: 60px;
|
||||
margin-top: 0;
|
||||
margin-left: auto;
|
||||
height: 140px;
|
||||
line-height: 140px;
|
||||
color: #3AAFB8;
|
||||
font-size: 36px;
|
||||
}
|
||||
}
|
||||
.loginClass{
|
||||
margin-top: 60px;
|
||||
width: 800px;
|
||||
height: 140px;
|
||||
border-radius: 70px 70px 70px 70px;
|
||||
background-color: #3AAFB8;
|
||||
line-height: 140px;
|
||||
color: #FFFFFF;
|
||||
font-size: 46px;
|
||||
text-align: center;
|
||||
}
|
||||
.loginClass1{
|
||||
opacity: 0.5;
|
||||
}
|
||||
.loginClass2{
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.login{
|
||||
margin-top: 65px;
|
||||
|
|
Loading…
Reference in New Issue