123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <view>
- <view>index/index</view>
- <view class="welcome" v-if="false">
-
- <view class="welcome-state1" >
- <view class="welcome-next" style="z-index: 999;" @click="gotoIndex()">{{step?step+'|':''}}跳过</view>
-
- </view>
-
- <u-image id="imgw"
- height="auto"
- v-if="imgmode" @load="imgsload" ref="imgw" mode="widthFix">
- <view slot="loading"></view>
- <view slot="error"></view>
- </u-image>
-
- <u-image v-if="!imgmode" :height="imgH" mode="aspectFill">
- <view slot="loading"></view>
- <view slot="error"></view>
- </u-image>
-
- <view class="welcome-foot">
- <u-image width="185px" height="48px" src="/static/logo.png"></u-image>
- </view>
-
- </view>
- </view>
- </template>
- <script>
- import * as loginApi from '@/apis/login.js'
- import * as API from '@/apis/index.js'
-
- export default {
- data() {
- return {
- isReady:true,
- isReady2:false,
- step:2,
- imgH:'',
- imgmode:true
- }
- },
- onUnload(){
- document.body.style=""
- },
- onReady() {
-
- },
- onLoad(op) {
- return;
- this.findNoLTextConfigure()
- this.findByOpenId()
- if(op.friends){
-
- this.carhelp.set("friends_invitation",{
- op:op,
- date:new Date().getTime()
- })
- uni.redirectTo({
- url:'/pages/login/login'
- })
- //this.onReadyIng()
- }else if(op.gunId){
- var k=API.codeOperation("jp_team51_charge_id:A_"+op.gunId);
- if(k){
- uni.redirectTo({
- url:k
- })
- }
-
- }else if(op.jpcode){
-
- var k=API.codeOperation(op.jpcode);
- if(k){
- uni.redirectTo({
- url:k
- })
- }
-
- }else{
-
- this.onReadyIng()
- }
- },
- methods: {
-
- imgsload(e){
-
-
- uni.getSystemInfo({
- success: (res) => {
- //(res)
-
- const query = uni.createSelectorQuery().in(this);
- query.select('#imgw').boundingClientRect(data => {
- //("得到布局位置信息" + JSON.stringify(data));
- //("节点离页面顶部的距离为" + data.height);
- var windowH=res.windowHeight;
- var imgH= data.height;
- var value=windowH-imgH;
- //(value)
- if(value>=100){
- this.imgmode=true
- document.getElementsByClassName("welcome-foot")[0].style="height:"+value+"px"
- }else{
- this.imgmode=false
-
- }
- }).exec();
-
- }
- })
- },
- findNoLTextConfigure(){
- API.getTips().then((response) => {
-
- this.carhelp.setConfigMessage(response.data.tipsList)
-
- }).catch(error => {
-
- })
-
- loginApi.findNoLTextConfigure().then((response) => {
-
- this.carhelp.setConfig(response.data.configure)
- this.setBackImg()
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- findByOpenId(){
-
- var openId=this.carhelp.getOpenId()
- if(openId==""){
- //("--------findByOpenId----------")
- setTimeout(()=>{
- this.findByOpenId()
- },1000)
- return
- }
- loginApi.findByOpenIdDetailed(openId).then((response) => {
-
- let [error, res] = response;
-
- if (res.data.code == 200&&res.data.result) {
- var token = res ? res.data.data.token : '';
- this.carhelp.setPersonInfo(res.data.data.regUser );
- this.carhelp.setToken(token);
-
- this.carhelp.setPersonInfoPlus(res.data.data);
-
- } else{
- this.carhelp.logoff()
- }
- this.isReady2=true;
-
- }).catch(error => {
-
-
- })
- },
- setBackImg(){
- var img=this.carhelp.getConfig().homepageLogo
-
- if(img){
- this.$refs.imgw.src=img
- //document.body.style="background:url("+img+") no-repeat;background-size: 100%;"
- }else{
- this.$refs.imgw.src="/static/welcome_bg.png"
- }
- if(this.$refs.imgw){ }
-
-
- },
- gotoIndex(){
- if(this.isReady){
- this.isReady=false
- uni.redirectTo({
- url: '/pages/index/index'
- });
- }
-
- },
- indexstep(){
- setTimeout(()=>{
-
- this.step--;
- if(this.step<0){
- if(this.isReady2){
- this.gotoIndex()
- }else{
- this.step=0;
- this.indexstep()
- }
-
- }else{
-
- this.indexstep()
- }
-
- },1000)
- },
- onReadyIng(){
- //let state = {};
- uni.getSystemInfo({
- success: (res) => {
- var windowH=res.windowHeight;
- this.imgH=(windowH-100)+"px";
-
- }
- })
-
- this.indexstep()
- this.setBackImg( )
- },
- }
- }
- </script>
- <style lang="scss">
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- .logo {
- height: 200rpx;
- width: 200rpx;
- margin-top: 200rpx;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 50rpx;
- }
- }
- /* .logo {
- height: 200rpx;
- width: 200rpx;
- margin-top: 200rpx;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 50rpx;
- } */
- .text-area {
- display: flex;
- justify-content: center;
- }
- .title {
- font-size: 36rpx;
- color: #8f8f94;
- }
- </style>
- <style>
- page{
-
- background-color: #ffffff;
- }
- </style>
- <style lang="scss" scoped>
- .welcome{
- position: relative;
- }
- .welcome-next{
- position: absolute;
- padding: 4px 15px;
- color:#fff;
- border-radius: 14px;
- background:rgba(0,0,0,0.5);
- right: 15px;
- top: 15px;
- }
- .welcome-foot{
- position:fixed;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #fff;
- height: 100px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .welcome-logo{
- position: absolute;
- left: 50%;
- margin-left: -100px;
- top: 120px;
- }
- .welcome-btn{
- position: fixed;
- left: 48px;
- right: 48px;
- bottom:48px;
- text-align: center;
- .welcomeBtn{
- color:#009143;
- border-color:#fff;
- }
- p{
- color:#fff;
- margin-top: 12px;
- font-size: 16px;
- }
- }
- </style>
|