login.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <view class="">
  3. <view class="top">
  4. </view>
  5. <view class="content" style="height: 85vh;">
  6. <scroll-view style="border-radius: 20rpx;padding-left: 20rpx;" scroll-x class="bg-white nav" scroll-with-animation :scroll-left="scrollLeft">
  7. <view class="cu-item text-lg" :class="index==current?'text-checked text-bold cur':''" v-for="(item,index) in list" :key="index" @tap="tabSelect(index)" >
  8. {{item.name}}
  9. </view>
  10. </scroll-view>
  11. <view class="item">
  12. <swiper :circular="true" style="height: 100%;" :current="current" @change="swiperChange"
  13. @animationfinish="animationfinish">
  14. <swiper-item style="height: 100%;">
  15. <view class="flex justify-center flex-direction align-center">
  16. <image style="width: 120rpx;height: 120rpx;" src="../../static/login/yuangong.png" ></image>
  17. </view>
  18. <view class="input">
  19. <image src="../../static/login/yuanqu.png" mode=""></image>
  20. <input disabled v-model="agencyName" @click="agencyShow = true" placeholder="请选择您所在的园区" type="text" value="" />
  21. </view>
  22. <view class="input">
  23. <image class="phone" src="../../static/login/phone.png" mode=""></image>
  24. <input v-model="phone" placeholder="请输入您的手机号码" type="text" value="" />
  25. </view>
  26. <view class="input" style="position: relative;">
  27. <image src="../../static/login/code.png" mode=""></image>
  28. <input v-model="yzm" style="width: 60%;" placeholder="请输入验证码" type="text" value="" />
  29. <view :style="showText?'':'background-color: #A7A7A7;'" class="code" @click="getCode()">{{tips}}</view>
  30. </view>
  31. </swiper-item>
  32. <swiper-item >
  33. <view class="flex justify-center flex-direction align-center">
  34. <image style="width: 90rpx;height: 90rpx;" src="../../static/login/qiye.png" ></image>
  35. </view>
  36. <view class="input">
  37. <image src="../../static/login/yuanqu.png" mode=""></image>
  38. <input disabled v-model="agencyName" @click="agencyShow = true" placeholder="请选择您所在的园区" type="text" value="" />
  39. </view>
  40. <view class="input">
  41. <image class="qiye" src="../../static/login/qiye.png" mode=""></image>
  42. <input disabled v-model="enterpriseName" @click="enterpriseShow = true" placeholder="请选择您所在的企业" type="text" value="" />
  43. </view>
  44. <view class="input" >
  45. <image src="../../static/login/account.png" mode=""></image>
  46. <input v-model="enterpriseAccount" style="width: 60%;" placeholder="请输入您的登录账号" type="text" value="" />
  47. </view>
  48. <view class="input" >
  49. <image src="../../static/login/password.png" mode=""></image>
  50. <input v-model="enterprisePassword" style="width: 60%;" placeholder="请输入您的登录密码" type="password" value="" />
  51. </view>
  52. </swiper-item>
  53. <swiper-item >
  54. <view class="flex justify-center " >
  55. <image style="width: 120rpx;height: 120rpx;" src="../../static/login/guanliyuan.png" ></image>
  56. </view>
  57. <view class="input">
  58. <image src="../../static/login/yuanqu.png" mode=""></image>
  59. <input disabled v-model="agencyName" @click="agencyShow = true" placeholder="请选择您所在的园区" type="text" value="" />
  60. </view>
  61. <view class="input" >
  62. <image src="../../static/login/account.png" mode=""></image>
  63. <input v-model="agencyAccount" style="width: 60%;" placeholder="请输入您的登录账号" type="text" value="" />
  64. </view>
  65. <view class="input" >
  66. <image src="../../static/login/password.png" mode=""></image>
  67. <input type="password" v-model="agencyPassword" style="width: 60%;" placeholder="请输入您的登录密码" value="" />
  68. </view>
  69. </swiper-item>
  70. <swiper-item >
  71. <view class="flex justify-center flex-direction align-center">
  72. <image style="width: 100rpx;height: 100rpx;" src="../../static/login/fangke.png"></image>
  73. </view>
  74. <view class="input">
  75. <image class="qiye" src="../../static/login/time.png" mode=""></image>
  76. <input disabled v-model="interviewTime" @click="interviewTimeShow = true" placeholder="请选择访问时间" type="text" value="" />
  77. </view>
  78. <view class="input">
  79. <image src="../../static/login/yuanqu.png" mode=""></image>
  80. <input disabled v-model="agencyName" @click="agencyShow = true" placeholder="请选择您要访问的园区" type="text" value="" />
  81. </view>
  82. <view class="input">
  83. <image class="qiye" src="../../static/login/qiye.png" mode=""></image>
  84. <input disabled v-model="enterpriseName" @click="enterpriseShow = true" placeholder="请选择您要访问的企业 (选填)" type="text" value="" />
  85. </view>
  86. <view @click="jump('/pages/guest/records/records')" class="text-center base-color padding-top-50 text-lg">
  87. <text style="text-decoration: underline;">申请记录</text>
  88. </view>
  89. </swiper-item>
  90. </swiper>
  91. </view>
  92. <button v-if="current!=3" class="button" @click="login()">登 录</button>
  93. <button v-else class="button" @click="applyOpenDoor">申请开门</button>
  94. </view>
  95. <!-- 园区 -->
  96. <u-popup border-radius="60" height="60%" mode="bottom" v-model="agencyShow">
  97. <view class="fixed cu-bar search bg-white">
  98. <view class="search-form round">
  99. <text class="cuIcon-search"></text>
  100. <u-input style="width: 90%;" v-model="agencyKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
  101. </view>
  102. </view>
  103. <scroll-view v-if="!$isEmpty(agencyList)" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
  104. <view @click="selectAgency(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom" v-for="(item,index) in agencyList" :key="index">
  105. <text>{{item.name}}</text>
  106. </view>
  107. <u-divider v-if="agencyList.length>=20" height="80">只显示20条数据</u-divider>
  108. </scroll-view>
  109. <u-empty v-else name="search"></u-empty>
  110. </u-popup>
  111. <!-- 企业列表 -->
  112. <u-popup border-radius="60" height="60%" mode="bottom" v-model="enterpriseShow">
  113. <view class="fixed cu-bar search bg-white">
  114. <view class="search-form round">
  115. <text class="cuIcon-search"></text>
  116. <u-input style="width: 90%;" v-model="enterpriseKeyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
  117. </view>
  118. </view>
  119. <scroll-view v-if="!$isEmpty(enterpriseList)" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
  120. <view @click="selectEnterprise(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom" v-for="(item,index) in enterpriseList" :key="index">
  121. <text>{{item.enterpriseName}}</text>
  122. </view>
  123. <u-divider v-if="enterpriseList.length>=20" height="80">只显示20条数据</u-divider>
  124. </scroll-view>
  125. <u-empty v-else name="search"></u-empty>
  126. </u-popup>
  127. <!-- 访问时间 -->
  128. <u-picker @confirm="interviewTimeConfirm" :params="params" v-model="interviewTimeShow" mode="time"></u-picker>
  129. <!-- 验证码 -->
  130. <u-verification-code seconds="60" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
  131. </view>
  132. </template>
  133. <script>
  134. var that;
  135. export default {
  136. name: 'card',
  137. data() {
  138. return {
  139. backpath:'',
  140. contentHeight:'',
  141. list: [{
  142. name: '员工'
  143. }, {
  144. name: '企业'
  145. }, {
  146. name: '管理员',
  147. }, {
  148. name: '访客',
  149. }],
  150. current: 0,
  151. //发送验证码
  152. tips: '',
  153. showText:true,
  154. //园区下拉框
  155. agencyName:'',
  156. agencyList:[],
  157. agencyKeyWord:'',
  158. agencyShow:false,
  159. //园区登录
  160. agencyId:'',
  161. agencyAccount:'',
  162. agencyPassword:'',
  163. //企业下拉框
  164. enterpriseName:'',//回显
  165. enterpriseShow:false,
  166. enterpriseList:[],
  167. enterpriseKeyword:'',
  168. //企业登录
  169. creditCode:'',
  170. enterpriseId:'',
  171. enterpriseAccount:'',
  172. enterprisePassword:'',
  173. openId:'',
  174. //员工登录
  175. phone:'',
  176. yzm:'',
  177. //访客
  178. interviewTimeShow:false,
  179. interviewTime:'',
  180. params: {
  181. year: true,
  182. month: true,
  183. day: true,
  184. hour: false,
  185. minute: false,
  186. second: false
  187. },
  188. };
  189. },
  190. onLoad(options) {
  191. this.contentHeight=this.$u.sys().windowHeight+'px'
  192. that=this
  193. if(!this.$isEmpty(options.backpath)){
  194. this.backpath=options.backpath
  195. }
  196. if (this.$isAuth()) {
  197. uni.reLaunch({
  198. url:'/pages/index/index'
  199. })
  200. //免登录
  201. return
  202. }
  203. if(this.$isEmpty(this.$cache.get('openId'))){
  204. this.getOpenId()
  205. }else{
  206. this.openId=this.$cache.get('openId')
  207. }
  208. this.getAgencyList()
  209. },
  210. onShow() {
  211. this.handelNoToken()
  212. this.getAppletStatus()
  213. },
  214. watch:{
  215. agencyKeyWord(){
  216. let that=this
  217. //节流函数
  218. if (this.timer){
  219. clearTimeout(this.timer)
  220. }
  221. this.timer = setTimeout(() => {
  222. that.agencyList=[]
  223. that.getAgencyList()
  224. }, 500)
  225. },
  226. enterpriseKeyword(){
  227. let that=this
  228. //节流函数
  229. if (this.timer){
  230. clearTimeout(this.timer)
  231. }
  232. this.timer = setTimeout(() => {
  233. that.enterpriseList=[]
  234. that.getEnterpriseList()
  235. }, 500)
  236. },
  237. },
  238. methods:{
  239. //处理没token但是却选择了园区的情况
  240. //访客从申请列表返回登录页时,是没有token的,这样导致其他接口报错
  241. async handelNoToken(){
  242. let that=this
  243. if(!this.$cache.get('tokenObj')&&!this.$isEmpty(this.agencyId)){
  244. //如果没有token,且园区id不为空
  245. this.agencyList.forEach(item=>{
  246. if(item.id==that.agencyId){
  247. let params={
  248. tenant_id:item.tenantId,
  249. username:item.account,
  250. password:item.password,
  251. grant_type: "password"
  252. }
  253. //放进缓存中,并获取token
  254. that.$cache.put('tokenObj',params)
  255. //获取token
  256. that.$api.getToken(that.$u.queryParams(params)).then(res=>{
  257. let token=res.token_type+" "+res.access_token
  258. uni.setStorageSync('token', token)
  259. //获取企业列表
  260. that.getEnterpriseList()
  261. })
  262. }
  263. })
  264. }
  265. },
  266. //访问时间
  267. interviewTimeConfirm(e){
  268. this.interviewTime=e.year+'-'+e.month+'-'+e.day
  269. },
  270. /**
  271. * 获取openid
  272. */
  273. getOpenId(){
  274. uni.login({
  275. success: (res) => {
  276. let data={
  277. appId:this.$api.wxData.appId,
  278. jsCode:res.code,
  279. secret:this.$api.wxData.secret
  280. }
  281. this.$api.wxApi.getOpenId(data).then(res=>{
  282. let resData= JSON.parse(res.data)
  283. this.openId=resData.openid
  284. this.$cache.put('openId',this.openId)
  285. })
  286. }
  287. })
  288. },
  289. //获取园区列表
  290. getAgencyList(){
  291. let params={
  292. size:20,
  293. name:this.agencyKeyWord
  294. }
  295. this.$api.agency.getAgencyTenantList(params).then(res=>{
  296. this.agencyList = res.data
  297. })
  298. },
  299. //选择园区
  300. selectAgency(item){
  301. console.log(item);
  302. let params={
  303. tenant_id:item.tenantId,
  304. username:item.account,
  305. password:item.password,
  306. grant_type: "password",
  307. scope:"all",
  308. type:"account"
  309. }
  310. this.agencyId=item.id
  311. this.agencyName=item.name
  312. this.agencyShow=false
  313. this.$cache.put('tokenObj',params)
  314. //获取token
  315. this.$api.getToken(this.$u.queryParams(params)).then(res=>{
  316. let token=res.token_type+" "+res.access_token
  317. uni.setStorageSync('token', token)
  318. //获取企业列表
  319. this.getEnterpriseList()
  320. })
  321. },
  322. /**
  323. * 获取验证码
  324. */
  325. async getCode() {
  326. let that=this
  327. if (this.$isEmpty(this.phone)) {
  328. this.$u.toast("请输入手机号")
  329. return
  330. }
  331. if (!this.$u.test.mobile(this.phone)) {
  332. this.$u.toast("请输入正确的手机号")
  333. return
  334. }
  335. if(this.$refs.uCode.canGetCode) {
  336. // 模拟向后端请求验证码
  337. uni.showLoading({
  338. title: '正在获取验证码'
  339. })
  340. setTimeout(async () => {
  341. uni.hideLoading();
  342. let params=`?phone=${this.phone}`
  343. this.$api.SMSApi.sendSms(params).then(res=>{
  344. if (res.data=='获取验证码成功') {
  345. that.$u.toast('验证码已发送');
  346. // 通知验证码组件内部开始倒计时
  347. that.$refs.uCode.start();
  348. }else{
  349. that.$refs.uTips.show({
  350. title: res.data,
  351. type: 'primary',
  352. duration: '3000'
  353. })
  354. }
  355. // 通知验证码组件内部开始倒计时
  356. that.$refs.uCode.start();
  357. }).catch(err=>{
  358. that.$u.toast('获取验证码失败');
  359. })
  360. }, 2300);
  361. } else {
  362. this.$u.toast('倒计时结束后再发送');
  363. }
  364. },
  365. codeChange(text) {
  366. this.tips = text;
  367. },
  368. end() {
  369. this.showText=true
  370. },
  371. start() {
  372. this.showText=false
  373. },
  374. //当前登录按钮操作
  375. async login() {
  376. if (this.current==0) {
  377. //员工登录
  378. this.staffLogin()
  379. }else if (this.current==1) {
  380. //企业登录
  381. this.enterpriseLogin()
  382. }else if (this.current==2) {
  383. //管理员登陆
  384. this.ganderLogin()
  385. }
  386. },
  387. //员工登录
  388. async staffLogin(){
  389. //15622205184
  390. if (this.phone=='15622205184') {
  391. this.userLogin()
  392. return
  393. }
  394. if (this.$isEmpty(this.agencyId)) {
  395. this.$u.toast('请选择您所在的园区')
  396. return
  397. }
  398. if (!this.phone) {
  399. uni.showToast({ title: '请输入手机号', icon: 'none' });
  400. return;
  401. }
  402. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.phone)) {
  403. uni.showToast({ title: '请输入正确手机号', icon: 'none' });
  404. return;
  405. }
  406. if (!this.yzm) {
  407. uni.showToast({ title: '请输入验证码', icon: 'none' });
  408. return;
  409. }
  410. if (this.yzm.length!=6) {
  411. this.$u.toast('请输入6位数的验证码')
  412. return
  413. }
  414. let params={
  415. phone:this.phone,
  416. code:this.yzm
  417. }
  418. let smsRes=await this.$api.SMSApi.validCode(this.$u.queryParams(params))
  419. if (smsRes.data!='success') {
  420. this.$u.toast(smsRes.data)
  421. return
  422. }
  423. this.userLogin()
  424. },
  425. //用户登陆
  426. async userLogin(){
  427. //通过手机号查找该员工信息
  428. let staffRes=await this.$api.login({loginType:0,phone:this.phone})
  429. let records=staffRes.data
  430. if (this.$isEmpty(records)) {
  431. //如果没有员工信息。新用户。跳转到注册认证界面
  432. uni.navigateTo({
  433. url:'/pages/auth/auth?phone='+this.phone
  434. })
  435. }else{
  436. let userInfo=records[0]
  437. if (userInfo.auditStatus==0) {
  438. //有员工信息,但审核未通过,提示等待审核
  439. this.$showModel('您的认证信息尚未审核,请联系企业负责人审核',false)
  440. }else if(userInfo.auditStatus==1){
  441. //后台导入的员工信息没有openid,需要在小程序重新插入
  442. if (this.$isEmpty(userInfo.openId)&&!this.$isEmpty(this.openId)) {
  443. userInfo.openId=this.openId
  444. this.$api.enterprisestaff.submit(userInfo)
  445. }
  446. this.$cache.put('agencyId',userInfo.agencyId)
  447. this.$cache.put('agencyTenantId',userInfo.tenantId)
  448. getApp().globalData.userInfo=userInfo
  449. //存储手机号,便于拉取用户信息
  450. this.$cache.put('phone',userInfo.phone)
  451. this.$cache.put('userId',userInfo.id)
  452. this.$cache.put('enterpriseId',userInfo.enterpriseId)
  453. this.handelSuccessLogin('staff')
  454. }else if (userInfo.auditStatus==2) {
  455. //审核不通过
  456. this.$showModel('您的认证信息审核不通过,是否重新认证!').then(res=>{
  457. uni.navigateTo({
  458. url:"/pages/auth/auth?operationType=1&phone="+that.phone
  459. })
  460. })
  461. }
  462. }
  463. },
  464. //获取企业列表
  465. getEnterpriseList(){
  466. let params={
  467. size:20,
  468. enterpriseName:this.enterpriseKeyword
  469. }
  470. this.$api.enterprise.page(params).then(res=>{
  471. this.enterpriseList =res.data.records
  472. })
  473. },
  474. //选择企业
  475. selectEnterprise(item){
  476. this.creditCode=item.creditCode
  477. this.enterpriseShow=false
  478. this.enterpriseName=item.enterpriseName
  479. this.enterpriseId=item.id
  480. },
  481. /**
  482. * 企业登录
  483. */
  484. async enterpriseLogin(){
  485. if(this.$isEmpty(this.agencyId)){
  486. this.$u.toast('请选择园区')
  487. return
  488. }
  489. if (this.$isEmpty(this.enterpriseId)) {
  490. this.$u.toast('请选择企业')
  491. return
  492. }
  493. if (this.$isEmpty(this.enterpriseAccount)) {
  494. this.$u.toast("请输入账号")
  495. return
  496. }
  497. if (this.$isEmpty(this.enterprisePassword)) {
  498. this.$u.toast("请输入密码")
  499. return
  500. }
  501. let params={
  502. "loginType":1,  
  503.     "enterpriseId": this.enterpriseId,
  504.     "enterpriseAccount": this.enterpriseAccount,
  505.     "enterprisePassword": this.enterprisePassword
  506. }
  507. this.$api.login(params).then(res=>{
  508. if (this.$isEmpty(res.data)) {
  509. this.$u.toast('账号或密码错误')
  510. return
  511. }else{
  512. //公司信息
  513. let userInfo=res.data[0]
  514. this.$cache.put('agencyId',userInfo.agencyId)
  515. getApp().globalData.userInfo=userInfo
  516. this.$cache.put('loginAccount',this.enterpriseAccount)
  517. this.$cache.put('agencyTenantId',userInfo.tenantId)
  518. this.$cache.put('creditCode',this.creditCode)
  519. this.$cache.put('enterpriseId',userInfo.enterpriseId)
  520. this.handelSuccessLogin('enterprise')
  521. }
  522. })
  523. },
  524. /**
  525. * 管理员登陆
  526. */
  527. async ganderLogin(){
  528. if (this.$isEmpty(this.agencyId)) {
  529. this.$u.toast('请选择您所在的园区')
  530. return
  531. }
  532. if (this.$isEmpty(this.agencyAccount)) {
  533. this.$u.toast('请输入账号')
  534. return
  535. }
  536. if (this.$isEmpty(this.agencyPassword)) {
  537. this.$u.toast('请输入密码')
  538. return
  539. }
  540. let params={
  541.     "loginType":2,  
  542.     "agencyId": this.agencyId,
  543.     "agencyAccount": this.agencyAccount,
  544.     "agencyPassword": this.agencyPassword
  545. }
  546. let res=await this.$api.login(params)
  547. let ganderInfo=res.data[0]
  548. if (this.$isEmpty(ganderInfo)) {
  549. this.$u.toast('账号或密码错误')
  550. return
  551. }
  552. //订阅消息通知 -- 登录不了,暂时去掉,
  553. // await this.$mpi.subscribe(this.$adminTmplIds)
  554. //输入密码成功
  555. //园区信息
  556. this.$cache.put('loginAccount',this.agencyAccount)
  557. this.$cache.put('agencyId',ganderInfo.agencyId)
  558. this.$cache.put('agency',ganderInfo.agencyName)
  559. this.$cache.put('agencyTenantId',ganderInfo.tenantId)
  560. getApp().globalData.userInfo=ganderInfo
  561. this.handelSuccessLogin('agency')
  562. },
  563. /**
  564. * 登录成功的处理方式
  565. * 如果是从其他地方跳转回的登录页,则登录后跳转回原页面
  566. * 否则跳转到首页
  567. */
  568. handelSuccessLogin(loginType){
  569. that.$cache.put("loginType",loginType)
  570. if (!this.$isEmpty(this.backpath)) {
  571. uni.navigateTo({
  572. url:this.backpath
  573. })
  574. return
  575. }
  576. uni.switchTab({
  577. url:"/pages/index/index"
  578. })
  579. },
  580. async applyOpenDoor(){
  581. if (this.$isEmpty(this.interviewTime)) {
  582. this.$u.toast('请选择访问时间')
  583. return
  584. }
  585. if (this.$isEmpty(this.agencyId)) {
  586. this.$u.toast('请选择要访问的园区')
  587. return
  588. }
  589. let params={
  590. interviewTime:this.interviewTime,
  591. agencyId:this.agencyId,
  592. openId:this.openId
  593. }
  594. let res=await this.$api.guest.page(params)
  595. let data=res.data.records[0]
  596. if (this.$isEmpty(data)) {
  597. that.reApply(params)
  598. return
  599. }
  600. uni.showModal({
  601. content:"检测到您有该园区的申请记录,是否立即去开门?",
  602. cancelText:"重新申请",
  603. confirmText:'去开门',
  604. success: (res) => {
  605. if (res.confirm) {
  606. console.log("去开门")
  607. }else{
  608. that.reApply(params)
  609. }
  610. }
  611. })
  612. },
  613. reApply(params){
  614. params.enterpriseId=this.enterpriseId,
  615. params.agencyName=this.agencyName
  616. params.enterpriseName=this.enterpriseName
  617. uni.navigateTo({
  618. url:"/pages/guest/guest"+this.$u.queryParams(params)
  619. })
  620. },
  621. jump(url){
  622. if (!this.$isEmpty(url)) {
  623. uni.navigateTo({
  624. url
  625. })
  626. }
  627. },
  628. isToday(str){
  629. var d = new Date(str.replace(/-/g,"/"));
  630. var todaysDate = new Date();
  631. if(d.setHours(0,0,0,0) == todaysDate.setHours(0,0,0,0)){
  632. return true;
  633. } else {
  634. return false;
  635. }
  636. },
  637. getAppletStatus(){
  638. this.$api.wxApi.getAppletStatus({id:2}).then(res=>{
  639. uni.setStorageSync("appletStatus",res.data.appletType)
  640. })
  641. },
  642. tabSelect(index){
  643. this.current=index
  644. },
  645. swiperChange(e) {
  646. this.current = e.detail.current
  647. },
  648. animationfinish({detail: { current }}) {
  649. this.current = current;
  650. },
  651. }
  652. };
  653. </script>
  654. <style lang="scss">
  655. page{
  656. background-color: #FFFFFF;
  657. height: 100%;
  658. }
  659. .text-checked{
  660. font-size: 36rpx;
  661. // color: #333;
  662. color: $base-color;
  663. }
  664. .button{
  665. position: fixed;
  666. bottom: 5%;
  667. left: 0;
  668. right: 0;
  669. font-size: 28rpx;
  670. background: $base-color;
  671. color: #fff;
  672. height: 90rpx;
  673. margin:0rpx 30rpx;
  674. line-height: 90rpx;
  675. border-radius: 50rpx;
  676. box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2);
  677. }
  678. .guest{
  679. font-size: 28rpx;
  680. color: #fff;
  681. background: $base-color;
  682. height: 90rpx;
  683. margin:120rpx 30rpx;
  684. line-height: 90rpx;
  685. border-radius: 50rpx;
  686. box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2);
  687. }
  688. .top{
  689. height: 220rpx;
  690. background-color: #5064eb;
  691. }
  692. .content{
  693. border-radius: 20rpx;
  694. background-color: #FFFFFF;
  695. margin: -120rpx 20rpx 0;
  696. .item{
  697. height: 100%;
  698. padding-top: 15%;
  699. .input{
  700. margin:40rpx 30rpx;
  701. border-radius: 50rpx;
  702. background-color: rgba(80, 100, 235,.1);
  703. display: flex;
  704. padding: 20rpx 30rpx;
  705. image{
  706. width: 30rpx;
  707. height: 36rpx;
  708. margin-top: 4rpx;
  709. margin-right: 20rpx;
  710. }
  711. .phone{
  712. width: 40rpx;
  713. height: 40rpx;
  714. margin-top: 4rpx;
  715. margin-right: 22rpx;
  716. }
  717. .qiye{
  718. width: 38rpx;
  719. height: 38rpx;
  720. margin-top: 4rpx;
  721. margin-right: 22rpx;
  722. }
  723. input{
  724. width: 100%;
  725. height: 100%;
  726. }
  727. .code{
  728. position: absolute;
  729. right: 22rpx;
  730. top: 18rpx;
  731. background: $base-color;
  732. color: #fff;
  733. font-size: 24rpx;
  734. border-radius: 50rpx;
  735. height: 50rpx;
  736. line-height: 50rpx;
  737. padding: 0 25rpx;
  738. z-index: 1000;
  739. }
  740. }
  741. }
  742. }
  743. </style>