ComplaintList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="商家投诉" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view class="div" v-if="complaintList && complaintList.length">
  16. <view class="div complaint-item" v-for="(item, index) in complaintList" :key="index">
  17. <view class="head">
  18. <view class="type">{{item.complain_subject_content}}</view>
  19. <view class="time">{{ $moment.unix(item.complain_datetime).format('YYYY年MM月DD日') }}</view>
  20. </view>
  21. <view class="goods_info" @click="goNavigate('/pages/home/goodsdetail/Goodsdetail',{goods_id:item.order_goods_id})">
  22. <view class="image-wrapper" :style="'width:'+windowWidth+'px;height:'+windowWidth+'px;flex:0 0 ' + windowWidth + 'px'">
  23. <image mode="aspectFit" class="img" :src="goodsList[item.order_goods_id].goods_image_url"/>
  24. </view>
  25. <view class="p-info">
  26. <view class="goods_name">{{goodsList[item.order_goods_id].goods_name}}</view>
  27. <view class="goods_price">¥{{goodsList[item.order_goods_id].goods_price}}</view>
  28. </view>
  29. </view>
  30. <view class="div complaint-info">
  31. <view class="complaint_content"><text>投诉内容:</text>{{item.complain_content}}</view>
  32. </view>
  33. <view class="div complaint-btn">
  34. <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>
  35. <view class="div btn-wrapper" v-if="item.complain_state==30">
  36. <view class="div common-btn btn-1" @click="handleComplain(item.complain_id)">提交仲裁</view>
  37. </view>
  38. <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>
  39. </view>
  40. </view>
  41. </view>
  42. <empty-record v-else-if="complaintList && !complaintList.length"></empty-record>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  47. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  48. </uni-popup>
  49. </seller-base>
  50. </template>
  51. <script>
  52. import {getFontSize} from '@/util/common'
  53. import TitleHeader from '../../TitleHeader'
  54. import { urlencode } from '@/util/common'
  55. import SellerBase from '../SellerBase'
  56. import EmptyRecord from '../../EmptyRecord'
  57. import { getComplaintList, cancelComplaint, handleComplain } from '../../../api/sellerCompliant'
  58. export default {
  59. name: 'BillList',
  60. components:{
  61. TitleHeader,
  62. SellerBase,
  63. EmptyRecord
  64. },
  65. computed:{
  66. fontSize(){
  67. return getFontSize()
  68. },
  69. windowWidth: function () {
  70. const res = uni.getSystemInfoSync()
  71. var width=res.windowWidth
  72. var size=getFontSize()
  73. return (width-3*.6*size)/4
  74. }
  75. },
  76. data(){
  77. return {
  78. navHeight: 0,
  79. dialog:{},
  80. params: { 'page': 0, 'per_page': 10 },
  81. loading: false, // 是否加载更多
  82. isMore: true, // 是否有更多
  83. complaintList: false, // 商品列表
  84. goodsList: false
  85. }
  86. },
  87. onShow () {
  88. this.reload()
  89. },
  90. mounted(){
  91. // #ifdef MP-WEIXIN
  92. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  93. // #endif
  94. },
  95. methods:{
  96. closeDialog(){
  97. },
  98. confirmDialog(value){
  99. cancelComplaint(this.dialog.data).then(res => {
  100. uni.showToast({icon:'none',title: res.message})
  101. this.reload()
  102. }).catch(function (error) {
  103. uni.showToast({icon:'none',title: error.message})
  104. })
  105. },
  106. goNavigate(path,query=false){
  107. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  108. },
  109. goBack(){uni.navigateBack({delta:1})},
  110. handleComplain (complaint_id) {
  111. handleComplain(complaint_id).then(res => {
  112. uni.showToast({icon:'none',title: res.message})
  113. this.reload()
  114. }).catch(function (error) {
  115. uni.showToast({icon:'none',title: error.message})
  116. })
  117. },
  118. cancelComplaint (order_id) {
  119. this.dialog={content:'你确定要取消吗?',data:order_id}
  120. this.$refs.confirm.open()
  121. },
  122. getComplaintList (ispush) {
  123. uni.showLoading({ title: '加载中' })
  124. let params = this.params
  125. getComplaintList(params).then(res => {
  126. uni.hideLoading()
  127. if (res) {
  128. if (ispush && this.complaintList) {
  129. this.complaintList = this.complaintList.concat(res.result.complaint_list)
  130. this.goodsList = Object.assign(this.goodsList, res.result.goods_list)
  131. } else {
  132. this.complaintList = res.result.complaint_list
  133. this.goodsList = res.result.goods_list
  134. }
  135. if (res.result.hasmore) {
  136. this.isMore = true
  137. } else {
  138. this.isMore = false
  139. }
  140. }
  141. }).catch(error => {
  142. uni.hideLoading()
  143. uni.showToast({icon:'none',title: error.message})
  144. })
  145. },
  146. loadMore () {
  147. this.loading = true
  148. this.params.page = ++this.params.page
  149. if (this.isMore) {
  150. this.loading = false
  151. this.getComplaintList(true)
  152. }
  153. },
  154. reload () {
  155. // 重新加载数据
  156. this.params.page = 0
  157. this.isMore = true
  158. this.complaintList = false
  159. this.loadMore()
  160. }
  161. }
  162. }
  163. </script>
  164. <style scoped lang="scss">
  165. .scroll-view-wrapper{display: flex;flex-direction: column;}
  166. .scroll-view{flex:1}
  167. .complaint-item{
  168. background:#fff;
  169. border-bottom:1px solid #e1e1e1;
  170. margin-top: $modelSpace;
  171. border-radius: .5rem;
  172. padding: 0 $pageSpace;
  173. box-sizing: border-box;
  174. .head{
  175. padding: .3rem 0;
  176. display: flex;
  177. align-items: center;
  178. .type{
  179. font-size: .8rem;
  180. color: #333;
  181. }
  182. .time{
  183. font-size: .6rem;
  184. color: #999;
  185. margin-left: auto;
  186. }
  187. }
  188. .goods_info{
  189. display: flex;
  190. box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.06);
  191. .image-wrapper{
  192. border-radius: .5rem;
  193. overflow: hidden;
  194. }
  195. .p-info{
  196. margin-left: .5rem;
  197. .goods_name{
  198. color: #333;
  199. font-size: .7rem;
  200. line-height: .8rem;
  201. height: 1.6rem;
  202. margin-top: .4rem;
  203. overflow: hidden;
  204. display: -webkit-box;
  205. -webkit-box-orient: vertical;
  206. -webkit-line-clamp: 2;
  207. padding: 0 .3rem;
  208. box-sizing: border-box;
  209. }
  210. .goods_price{
  211. color: $primaryColor;
  212. font-size: .8rem;
  213. margin-top: 1rem;
  214. }
  215. }
  216. }
  217. .complaint-info{
  218. padding: $modelSpace 0;
  219. .complaint_content{
  220. font-size: .7rem;
  221. color: #666;
  222. text{
  223. color: #333;
  224. }
  225. }
  226. }
  227. .complaint-btn{
  228. padding:.5rem;
  229. border-top:1px solid #e4e4e4;
  230. display: flex;
  231. justify-content: flex-end;
  232. .btn-1{border:1px solid $primaryColor;color:$primaryColor;min-width: 2rem}
  233. .btn-2{border:1px solid #333;color:#333;min-width: 2rem}
  234. .btn-wrapper{
  235. margin-left:.5rem
  236. }
  237. .buyer-info{
  238. flex:1;
  239. font-size:$subFontSize;
  240. line-height:1.4rem
  241. }
  242. }
  243. }
  244. </style>