complete.vue 6.2 KB
Newer Older
朱国瑞's avatar
朱国瑞 committed
1
<template>
朱国瑞's avatar
朱国瑞 committed
2
  <div class="page" :class="{'mobile':_isMobile,'pc':!_isMobile}">
朱国瑞's avatar
朱国瑞 committed
3 4 5 6 7 8 9 10 11 12 13 14 15
    <div class="main_content">
      <img class="page-bg" src="../assets/images/gesture/massage-entry-fullbg.png" alt srcset />
      <div class="massage-complete-modal" :class="{'noBaby':finalBabyStatus == 3 || finalBabyStatus == -1}">
        <div class="nickname">
          Hey,
          <span>{{nikeName}}</span>
        </div>
        <div class="title">
          <!-- <image src="{{images.title}}"></image> -->
          <img class="icon" src="../assets/images/gesture/massage-complete-title-icon.png" />
          {{$t('strings.completeText')}}
        </div>
        <div class="record" v-if="finalBabyStatus != 3 && finalBabyStatus != -1">
朱国瑞's avatar
朱国瑞 committed
16
          <div>{{$t('strings.completeText2')}}: {{time}}s</div>
朱国瑞's avatar
朱国瑞 committed
17
        </div>
18 19 20
        <div class="bottom">
          <light-button @click="goHome" :text="$t('strings.completeButtonText')"></light-button>
        </div>
朱国瑞's avatar
朱国瑞 committed
21 22 23 24 25 26
      </div>
    </div>
  </div>
</template>

<script>
朱国瑞's avatar
朱国瑞 committed
27
import { calcAdapt, isMobile } from "../common/util";
28
import lightButton from "../components/lightButton.vue";
朱国瑞's avatar
朱国瑞 committed
29 30 31 32 33 34

let calcs = calcAdapt();
let scale;
const calcCoord = function () {
  let width = 0;
  let height = 0;
朱国瑞's avatar
朱国瑞 committed
35
  if (!isMobile()) {
朱国瑞's avatar
朱国瑞 committed
36
    width = 750;
朱国瑞's avatar
朱国瑞 committed
37 38
    height =
      document.body.clientHeight > 1334 ? document.body.clientHeight : 1334;
朱国瑞's avatar
朱国瑞 committed
39 40 41 42 43 44
  } else {
    width = document.body.clientWidth;
    height = document.body.clientHeight;
  }
  if (height === 0) {
    height = window.innerHeight;
朱国瑞's avatar
朱国瑞 committed
45
    if (!isMobile()) {
朱国瑞's avatar
朱国瑞 committed
46 47
      height = window.innerHeight > 1334 ? window.innerHeight : 1334;
    }
朱国瑞's avatar
朱国瑞 committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
  }
  scale = height / width;
  let k = +scale.toFixed(2);
  if (k >= 2.16) {
    k = 2.16;
  } else if (k <= 1.78) {
    k = 1.78;
  }
  return calcs.calcCoord.call(null, ...arguments, k);
};
export default {
  data() {
    return {
      nikeName: "William",
      finalBabyStatus: 0,
      lying: 0,
      time: 0,
      total: 0,
      modalCalc: {
        top: ""
朱国瑞's avatar
朱国瑞 committed
68 69
      },
      _isMobile: false
朱国瑞's avatar
朱国瑞 committed
70 71
    };
  },
72 73 74 75 76 77 78 79 80 81
  components: {
    lightButton
  },
  methods: {
    goHome() {
      this.$router.push({
        path: "/"
      });
    }
  },
朱国瑞's avatar
朱国瑞 committed
82
  created() {
朱国瑞's avatar
朱国瑞 committed
83 84 85 86 87
    this.$i18n.locale = "en";
    let lang = localStorage.getItem("lang");
    if (lang) {
      this.$i18n.locale = lang;
    }
朱国瑞's avatar
朱国瑞 committed
88
    this._isMobile = isMobile();
朱国瑞's avatar
朱国瑞 committed
89 90
    let finalBabyStatus = this.$route.query.finalBabyStatus;
    let lying = this.$route.query.lying;
朱国瑞's avatar
朱国瑞 committed
91 92
    let time = this.$route.query.total;
    let total = this.$route.query.total;
朱国瑞's avatar
朱国瑞 committed
93 94
    this.finalBabyStatus = finalBabyStatus;
    this.lying = lying;
95 96
    this.time = time || 0;
    this.total = total || 0;
朱国瑞's avatar
朱国瑞 committed
97 98 99 100 101 102 103 104 105 106
  },
  mounted() {}
};
</script>

<style lang="scss" scoped>
.page {
  background: #000;
  display: flex;
  justify-content: center;
朱国瑞's avatar
朱国瑞 committed
107
  height: 100%;
朱国瑞's avatar
朱国瑞 committed
108
}
朱国瑞's avatar
朱国瑞 committed
109 110 111
.pc {
  .main_content {
    width: 750px;
朱国瑞's avatar
朱国瑞 committed
112
    min-height: 1334px;
朱国瑞's avatar
朱国瑞 committed
113 114 115 116 117 118 119 120 121 122
    background: #ffffff;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    .page-bg {
      position: absolute;
      left: 0;
      top: 0;
朱国瑞's avatar
朱国瑞 committed
123
      width: 750px;
朱国瑞's avatar
朱国瑞 committed
124
      z-index: 0;
朱国瑞's avatar
朱国瑞 committed
125
    }
朱国瑞's avatar
朱国瑞 committed
126 127 128 129
  }
  .massage-complete-modal {
    box-sizing: border-box;
    width: 660px;
130
    min-height: 620px;
朱国瑞's avatar
朱国瑞 committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
    padding: 80px 0 125px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 14px 14px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    &.noBaby {
      height: 420px;
    }
    .nickname {
      font-size: 46px;
      color: #fb7c76;
      font-family: "Gotham-Book";
      text-shadow: 2px 2px 4px #ffffff;
      span {
        font-size: 60px;
朱国瑞's avatar
朱国瑞 committed
150
      }
朱国瑞's avatar
朱国瑞 committed
151 152 153 154 155 156 157 158 159 160
    }
    .title {
      height: 53px;
      margin-top: 41px;
      color: #fb7c76;
      font-size: 46px;
      font-weight: bolder;
      .icon {
        width: 69px;
        height: 45px;
朱国瑞's avatar
朱国瑞 committed
161
      }
朱国瑞's avatar
朱国瑞 committed
162 163 164 165 166 167 168 169 170 171
    }
    .subTitle {
      width: 100%;
      text-align: center;
      color: #fb7c76;
      font-size: 26px;
      margin-top: 20px;
      font-weight: bolder;
      &.underline {
        text-decoration: underline;
朱国瑞's avatar
朱国瑞 committed
172 173
      }
    }
朱国瑞's avatar
朱国瑞 committed
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
    .record {
      margin-top: 100px;
      margin-bottom: 100px;
      width: 559px;
      height: 96px;
      line-height: 96px;
      border-radius: 48px 48px;
      font-size: 34.67px;
      color: #999999;
      background-color: #f5f5f5;
      text-align: center;
      text-shadow: 2px 2px 4px #ffffff;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
    }
朱国瑞's avatar
朱国瑞 committed
191 192 193
  }
}

朱国瑞's avatar
朱国瑞 committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
.mobile {
  .main_content {
    width: 10rem;
    height: 100vh;
    background: #ffffff;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    .page-bg {
      position: absolute;
      left: 0;
      top: 0;
      width: 10rem;
      z-index: 0;
    }
  }
  .massage-complete-modal {
    box-sizing: border-box;
    width: 8.8rem;
215
    min-height: 8.2667rem;
朱国瑞's avatar
朱国瑞 committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
    padding: 1.0667rem 0 1.6667rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 0.1867rem 0.1867rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    &.noBaby {
      height: 5.6rem;
    }
    .nickname {
      font-size: 0.6133rem;
      color: #fb7c76;
      font-family: "Gotham-Book";
      text-shadow: 0.0267rem 0.0267rem 0.0533rem #ffffff;
      span {
        font-size: 0.8rem;
      }
    }
    .title {
      height: 0.7067rem;
      margin-top: 0.5467rem;
      color: #fb7c76;
      font-size: 0.6133rem;
      font-weight: bolder;
      .icon {
        width: 0.92rem;
        height: 0.6rem;
      }
    }
    .subTitle {
      width: 100%;
      text-align: center;
      color: #fb7c76;
      font-size: 0.3467rem;
      margin-top: 0.2667rem;
      font-weight: bolder;
      &.underline {
        text-decoration: underline;
      }
    }
    .record {
      margin-top: 1.3333rem;
      margin-bottom: 1.3333rem;
      width: 7.4533rem;
      height: 1.28rem;
      line-height: 1.28rem;
      border-radius: 0.64rem 0.64rem;
      font-size: 0.4623rem;
      color: #999999;
      background-color: #f5f5f5;
      text-align: center;
      text-shadow: 0.0267rem 0.0267rem 0.0533rem #ffffff;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
朱国瑞's avatar
朱国瑞 committed
275 276 277 278
    }
  }
}
</style>