zhengyiming
1 天以前 c0bcba49bef43b880978ff63b2ac00f1ba5c5c6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
  <PageLayoutWithBg class="phoneBillRecharge-page-wrapper" :title="current != 'step2' ? title : ''">
    <template #navigationBar v-if="current === 'step2'">
      <TranslateNavigationBar :title="title" :rangeValue="rangeValue"> </TranslateNavigationBar>
    </template>
    <template #bg>
      <div
        class="phoneBillRecharge-page-bg"
        :style="
          current === 'step2' && {
            backgroundImage: `url(${OssAssets.common.PhoneBillRechargePageBg})`,
            opacity: 1 - rangeValue,
          }
        "
      ></div>
    </template>
    <ContentScrollView hasPaddingTop style="background-color: transparent" @scroll="scroll">
      <InnerPage @currentChange="handleCurrentChange" />
    </ContentScrollView>
  </PageLayoutWithBg>
</template>
 
<script setup lang="ts">
import { useScrollRange } from '@/hooks';
import InnerPage from './InnerPage.vue';
import { OssAssets } from '@/constants';
 
defineOptions({
  name: 'phoneBillRecharge',
});
 
type Current = 'step1' | 'step2';
 
const title = '话费充值';
 
const current = ref<Current>();
 
function handleCurrentChange(val: Current) {
  current.value = val;
}
 
const { rangeValue, scroll } = useScrollRange();
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.phoneBillRecharge-page-wrapper {
  background-color: $body-background-color;
 
  .phoneBillRecharge-page-bg {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 100% 452px;
    background-repeat: no-repeat;
  }
}
</style>