暖心人
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.0 KiB

<template>
<view class="body-background"></view>
<u-navbar
:title="title"
:auto-back="true"
left-icon-size="40rpx"
:safe-area-inset-top="true"
:placeholder="true"
bgColor="#ffffff"
></u-navbar>
<view class="app-wallpaper">
<view class="leave-tab">
<u-tabs
:list="listItem"
u-sticky
lineWidth="40"
lineHeight="4"
:inactiveStyle="{color:'#AFB5BE'}"
:activeStyle="{color:'#F47210'}"
lineColor="#F47210"
:custom-style="{margin:'auto',width:'100%'}"
:scrollable="false"
:current="current"
@change="tabsChange"
></u-tabs>
</view>
<view class="leave-content">
<view class="leave-item" v-for="item in lists">
<view class="ask row">
<view class="icon col">
<u-image mode="widthFix" :src="staticImage.ask" width="64" height="64"></u-image>
</view>
<view class="body col">
<view class="name">
<u-text line-height="50" :text="item.name" size="32" color="#020b18"></u-text>
</view>
<view class="content">
<u-text line-height="50" :text="item.content" size="28" color="#020b18"></u-text>
</view>
</view>
</view>
<view class="answer row">
<view class="icon col">
<u-image mode="widthFix" :src="staticImage.answer" width="64" height="64"></u-image>
</view>
<view class="body col">
<view class="content">
<u-text v-if="item.status !== 1" line-height="50" size="28" color="#020b18" :text="item.answer_content"></u-text>
<u-text v-else-if="item.status === 1" @click="api.navTo('/pages/LeaveMsg/index?questions_id='+item.id)" line-height="50" size="28" color="#FF9545" text="立即回答" suffix-icon="arrow-right" icon-style="color:#ff9545;"></u-text>
<u-text v-else line-height="50" size="28" color="#020b18" text="顾问暂时还没有回答哦"></u-text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore :custom-style="{display:'flex'}" :status="status" fontSize="28"
marginBottom="30" marginTop="30" @loadmore="getUserLeave()"/>
</template>
<script>
import {
imghost
} from '@/config/host.js'
import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {goodsOrder, orderLogistics, roomOrder, tabCount} from "@/api/user";
import {userLeave} from "@/api/other";
import {goodsList} from "@/api/shop";
export default {
components: {
MzSubsection
},
data() {
return {
listItem:[
{name:'全部留言'},
{name:'已回答'},
{name:'未回答'},
],
tabCheck:'room',
title: '我的留言',
loading: true,
staticImage: {
bg: imghost + '/BG.png',
newIcon: imghost + '/new-icon.png',
shopThumb: imghost + '/new-1.png',
ask:imghost+ '/ask.png',
answer:imghost+ '/answer.png',
},
pages:{
page:1,
limit:10,
user_type:1,
},
lists:[],
status:'loadmore',
current:0,
}
},
onLoad() {
},
onReady() {
},
computed: {
api() {
return api
}
},
methods: {
tabsChange(e){
this.tabCheck = e.id
this.getUserLeave(true);
},
getUserLeave(clear = false){
if (clear) {
this.status = 'loadmore'
this.pages.page = 1;
this.lists = [];
}
if (this.status === 'nomore') {
return false;
}
userLeave(this.pages).then(res => {
this.lists.push.apply(this.lists, res.data);
if (res.data.length === 0) {
this.status = 'nomore'
}
})
this.pages.page++;
},
},
onReachBottom() {
this.getUserLeave();
},
onPageScroll(res) {
},
mounted() {
this.getUserLeave();
},
created() {
}
}
</script>
<style lang="scss">
@import './components/leave.scss';
</style>