123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
- <seller-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container">
- <view class="div common-header-wrap">
- <view class="status-holder"></view>
- <view :style="'height:'+navHeight+'px'"></view>
- <view class="common-header-holder"></view>
- <view class="common-header-fixed">
- <title-header />
- <uni-nav-bar title="商家投诉" class="common-header" left-icon="back" @clickLeft="goBack()">
- </uni-nav-bar>
- </view>
- </view>
- <view class="scroll-view div" style="position:relative">
- <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
- <view class="div" v-if="complaintList && complaintList.length">
- <view class="div complaint-item" v-for="(item, index) in complaintList" :key="index">
- <view class="head">
- <view class="type">{{item.complain_subject_content}}</view>
- <view class="time">{{ $moment.unix(item.complain_datetime).format('YYYY年MM月DD日') }}</view>
- </view>
- <view class="goods_info" @click="goNavigate('/pages/home/goodsdetail/Goodsdetail',{goods_id:item.order_goods_id})">
- <view class="image-wrapper" :style="'width:'+windowWidth+'px;height:'+windowWidth+'px;flex:0 0 ' + windowWidth + 'px'">
- <image mode="aspectFit" class="img" :src="goodsList[item.order_goods_id].goods_image_url"/>
- </view>
- <view class="p-info">
- <view class="goods_name">{{goodsList[item.order_goods_id].goods_name}}</view>
- <view class="goods_price">¥{{goodsList[item.order_goods_id].goods_price}}</view>
- </view>
- </view>
- <view class="div complaint-info">
- <view class="complaint_content"><text>投诉内容:</text>{{item.complain_content}}</view>
- </view>
- <view class="div complaint-btn">
- <view class="div btn-wrapper"><view class="div common-btn btn-1" v-if="item.complain_state=='10'" @click="cancelComplaint(item.complain_id)">取消</view></view>
- <view class="div btn-wrapper" v-if="item.complain_state==30">
- <view class="div common-btn btn-1" @click="handleComplain(item.complain_id)">提交仲裁</view>
- </view>
- <view class="div btn-wrapper"><view class="div common-btn btn-2" @click="goNavigate('/pages/seller/complaint/ComplaintForm',{complain_id:item.complain_id})">查看</view></view>
- </view>
- </view>
- </view>
- <empty-record v-else-if="complaintList && !complaintList.length"></empty-record>
- </scroll-view>
- </view>
- </view>
- <uni-popup background-color="#fff" ref="confirm" type="dialog">
- <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
- </uni-popup>
- </seller-base>
- </template>
- <script>
- import {getFontSize} from '@/util/common'
- import TitleHeader from '../../TitleHeader'
- import { urlencode } from '@/util/common'
- import SellerBase from '../SellerBase'
- import EmptyRecord from '../../EmptyRecord'
- import { getComplaintList, cancelComplaint, handleComplain } from '../../../api/sellerCompliant'
- export default {
- name: 'BillList',
- components:{
- TitleHeader,
- SellerBase,
- EmptyRecord
- },
- computed:{
- fontSize(){
- return getFontSize()
- },
- windowWidth: function () {
- const res = uni.getSystemInfoSync()
- var width=res.windowWidth
- var size=getFontSize()
- return (width-3*.6*size)/4
- }
- },
- data(){
- return {
- navHeight: 0,
- dialog:{},
- params: { 'page': 0, 'per_page': 10 },
- loading: false, // 是否加载更多
- isMore: true, // 是否有更多
- complaintList: false, // 商品列表
- goodsList: false
- }
- },
- onShow () {
- this.reload()
- },
- mounted(){
- // #ifdef MP-WEIXIN
- this.navHeight = uni.getMenuButtonBoundingClientRect().height
- // #endif
- },
- methods:{
- closeDialog(){
- },
- confirmDialog(value){
- cancelComplaint(this.dialog.data).then(res => {
- uni.showToast({icon:'none',title: res.message})
- this.reload()
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- },
- goNavigate(path,query=false){
- uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
- },
- goBack(){uni.navigateBack({delta:1})},
- handleComplain (complaint_id) {
- handleComplain(complaint_id).then(res => {
- uni.showToast({icon:'none',title: res.message})
- this.reload()
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- },
- cancelComplaint (order_id) {
- this.dialog={content:'你确定要取消吗?',data:order_id}
- this.$refs.confirm.open()
- },
- getComplaintList (ispush) {
- uni.showLoading({ title: '加载中' })
- let params = this.params
- getComplaintList(params).then(res => {
- uni.hideLoading()
- if (res) {
- if (ispush && this.complaintList) {
- this.complaintList = this.complaintList.concat(res.result.complaint_list)
- this.goodsList = Object.assign(this.goodsList, res.result.goods_list)
- } else {
- this.complaintList = res.result.complaint_list
- this.goodsList = res.result.goods_list
- }
- if (res.result.hasmore) {
- this.isMore = true
- } else {
- this.isMore = false
- }
- }
- }).catch(error => {
- uni.hideLoading()
- uni.showToast({icon:'none',title: error.message})
- })
- },
- loadMore () {
- this.loading = true
- this.params.page = ++this.params.page
- if (this.isMore) {
- this.loading = false
- this.getComplaintList(true)
- }
- },
- reload () {
- // 重新加载数据
- this.params.page = 0
- this.isMore = true
- this.complaintList = false
- this.loadMore()
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .scroll-view-wrapper{display: flex;flex-direction: column;}
- .scroll-view{flex:1}
- .complaint-item{
- background:#fff;
- border-bottom:1px solid #e1e1e1;
- margin-top: $modelSpace;
- border-radius: .5rem;
- padding: 0 $pageSpace;
- box-sizing: border-box;
- .head{
- padding: .3rem 0;
- display: flex;
- align-items: center;
- .type{
- font-size: .8rem;
- color: #333;
- }
- .time{
- font-size: .6rem;
- color: #999;
- margin-left: auto;
- }
- }
- .goods_info{
- display: flex;
- box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.06);
- .image-wrapper{
- border-radius: .5rem;
- overflow: hidden;
- }
- .p-info{
- margin-left: .5rem;
- .goods_name{
- color: #333;
- font-size: .7rem;
- line-height: .8rem;
- height: 1.6rem;
- margin-top: .4rem;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- padding: 0 .3rem;
- box-sizing: border-box;
- }
- .goods_price{
- color: $primaryColor;
- font-size: .8rem;
- margin-top: 1rem;
- }
- }
- }
- .complaint-info{
- padding: $modelSpace 0;
- .complaint_content{
- font-size: .7rem;
- color: #666;
- text{
- color: #333;
- }
- }
- }
- .complaint-btn{
- padding:.5rem;
- border-top:1px solid #e4e4e4;
- display: flex;
- justify-content: flex-end;
- .btn-1{border:1px solid $primaryColor;color:$primaryColor;min-width: 2rem}
- .btn-2{border:1px solid #333;color:#333;min-width: 2rem}
- .btn-wrapper{
- margin-left:.5rem
- }
- .buyer-info{
- flex:1;
- font-size:$subFontSize;
- line-height:1.4rem
- }
- }
- }
- </style>
|