1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <view class="activity">
- <web-view :webview-styles="webviewStyles" :src="activityPath"></web-view>
- <!-- 侧边 -->
- <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- webviewStyles: {
- progress: {
- color: '#FF3333'
- }
- },
- productID: '',
- activityPath: '',
- isScrollTop: false,
- }
- },
- onLoad(option) {
- this.initPageFree(option.linkId, option.link)
- },
- methods: {
- initPageFree(linkId, link) {
- this.CommonService.GetPageFree({ id: linkId })
- .then(response => {
- this.activityPath = link
- uni.setNavigationBarTitle({ title: response.data.title })
- uni.setStorageSync('pageLabel', `${response.data.contentLabel}`)
- })
- .catch(error => {
- console.log('获取活动专题页数据异常')
- })
- }
- },
- onPageScroll(e) {
- //实时获取到滚动的值
- if (e.scrollTop > 600) {
- this.isScrollTop = true
- } else {
- this.isScrollTop = false
- }
- }
- }
- </script>
- <style lang="scss">
- .activity {
- width: 100%;
- height: auto;
- image {
- width: 100%;
- height: auto;
- }
- }
- </style>
|