123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <template>
- <view class="pages">
- <mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <view class="questions wrap40">
- <view class="questions-item" v-for="(item,index) in questionlist" :key="index">
- <view class="questions-item-til">
- <image :src="$getInnerImg + 'icon-questions.png'" class="questions-item-img" mode="scaleToFill"></image>
- <view class="questions-item-text">{{item.title}}</view>
- </view>
- <view class="questions-item-con">{{item.content}}</view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
-
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
-
- import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
-
- export default {
- mixins: [MescrollMixin],
- components: {
- MescrollBody,
- },
- data() {
- return {
- $getInnerImg:this.$getInnerImg,
- params:{},
- mescroll: null,
-
- downOption: {
-
- },
-
- upOption: {
- page: {
- size: 10
- },
- noMoreSize: 3,
- empty: {
- tip: '暂无相关数据'
- }
- },
- questionlist:[
- {title:'1.如何获得碳积分',content:'如何获得碳积分'},
- {title:'2.如何获得碳积分',content:'如何获得碳积分'},
- ],
-
- }
- },
- onShow() {
- },
- onLoad() {
- let self = this;
- uni.getStorage({
- key:'token',
- success: function (res) {
- self.token = res.data;
-
- }
- });
- uni.getStorage({
- key:'tokenhead',
- success: function (res) {
- self.tokenhead = res.data;
-
- }
- });
- },
- methods: {
-
- mescrollInit(mescroll) {
-
- },
-
- downCallback(){
-
- this.mescroll.resetUpScroll();
- },
-
- upCallback(page) {
- let pageNum = page.num;
- let pageSize = page.size;
- this.params = Object.assign(this.params,{pageNum:pageNum,pageSize:pageSize});
- let thetoken = 'Bearer ' + this.token;
-
- this.$api.http.post(this.config.apiBaseurl + '/carbon-h5/wap/order/searchByPage',this.params,{
- header: {
- Accept:'application/json',
- Authorization: 'Bearer '+ this.token,
- },
- }).then(data => {
-
-
- let curPageData = data.data.retBody;
-
-
- let curPageLen = curPageData.length;
-
-
-
- let totalSize = data.data.retHead.total;
-
-
-
-
-
- if(page.num == 1) this.questionlist = [];
- this.questionlist = this.questionlist.concat(curPageData);
-
- console.log('this.questionlist',JSON.parse(JSON.stringify(this.questionlist)));
-
-
- this.mescroll.endBySize(curPageLen, totalSize);
-
-
-
-
-
- }).catch(err => {
- this.mescroll.endErr()
- console.log(err)
-
- });
- },
- }
- }
- </script>
- <style>
- @import url("./question.css");
- </style>
|