| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <template>
- <view class="u-content">
- <!-- #ifdef MP-WEIXIN -->
- <u-navbar title-color="#000000" :is-back="true" title="积分规则"></u-navbar>
- <!-- #endif -->
- <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
- <u-parse :html="content" ></u-parse>
- </mescroll-body>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- downOption:{
- use:false,
- auto:false
- },
- content:'',
- list: [] // 数据列表
- }
- },
- methods: {
- downCallback(){
- setTimeout(()=>{
- this.mescroll.resetUpScroll();
- },1000)
- },
- upCallback(mescroll) {
- try {
- let params={
- title:'积分规则',
- activeId:this.vuex_active_setting.defaultActiveId,
- current:mescroll.num,
- size:mescroll.size,
- }
- this.$api.notice.list(params).then(res => {
- let data = res.data.data.records
- let total = res.data.data.total
- mescroll.endBySize(data.length, total);
- if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
- this.list = this.list.concat(data); //追加新数据
- this.content = decodeURIComponent(this.list[0].content)
- }).catch(err=>{
- console.log(err);
- })
- } catch (e) {
- console.error(e);
- this.mescroll.endErr()
- }
- }
- }
- }
- </script>
- <style >
- page{
- background-color: #FFFFFF;
- }
-
- .u-content {
- padding: 30rpx;
- line-height: 50rpx;
- color: #505050;
- }
- </style>
|