| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <template>
- <view class="app-page">
- <view class="page-title">我们的故事</view>
- <view class="html-typed" v-html="html">内容渲染</view>
- </view>
- </template>
- <script>
- import LoveConfig from '@/config/love.config.js';
- export default {
- data() {
- return {
- html: '',
- timer: null
- };
- },
- created() {
- this.fnInit();
- },
- onBackPress() {
- clearTimeout(this.timer);
- },
- methods: {
- fnInit() {
- clearTimeout(this.timer);
- const _html = LoveConfig.story;
- let _index = 0;
- const _typing = () => {
- this.timer = setTimeout(() => {
- if (_index >= _html.length) {
- clearTimeout(this.timer);
- } else {
- this.html += _html.substring(_index, _index + 1);
- _index += 1;
- _typing();
- }
- }, 100);
- };
- _typing();
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .app-page {
- width: 100vw;
- min-height: 100vh;
- box-sizing: border-box;
- padding: 36rpx;
- /* #ifdef APP-PLUS */
- padding-top: 100rpx;
- /* #endif */
- /* #ifdef H5 */
- padding-top: 80rpx;
- /* #endif */
- /* #ifdef MP-WEIXIN */
- padding-top: 120rpx;
- /* #endif */
- background: linear-gradient(
- -45deg,
- rgba(247, 149, 51, 0.1),
- rgba(243, 112, 85, 0.1) 15%,
- rgba(239, 78, 123, 0.1) 30%,
- rgba(161, 102, 171, 0.1) 44%,
- rgba(80, 115, 184, 0.1) 58%,
- rgba(16, 152, 173, 0.1) 72%,
- rgba(7, 179, 155, 0.1) 86%,
- rgba(109, 186, 130, 0.1)
- );
- }
- .page-title {
- font-size: 42rpx;
- font-weight: bold;
- text-align: center;
- text-shadow: 0rpx 4rpx 24rpx #bfe9ef;
- }
- .html-typed {
- margin-top: 52rpx;
- line-height: 1.8;
- font-size: 30rpx;
- }
- </style>
|