123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- const app = getApp()
- const util = require("../../../utils/jmsUtil.js");
- const api = require('../../../api/jms.js');
- import moment from 'moment'
- Page({
- data: {
- ticketList:[],
- totalPages:'',
- page:1,
- listQuery:{
- status:'1',
-
- },
- selectVisible:false,
- columns:[],
- selectType:1,
- statusList:[
- {
- text:'全部',
- value:'0'
- },
- {
- text:'待审核',
- value:'1'
- },
- {
- text:'审核通过',
- value:'2'
- },
- {
- text:'审核未通过',
- value:'4'
- },
- {
- text:'退款成功',
- value:'3'
- },
- ],
- statusDesc: {
- 0: "",
- 1: "待审核",
- 2: "审核通过",
- 3: "退款成功",
- 4: "审核未通过",
- 5:"退款失败"
- },
- typeTag: ["", "primary","success","success", "warning", "warning"],
- levelMap: {
- 0: "无",
- 1: "一般",
- 2: "严重",
- 3: "非常严重",
- },
-
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- this.getTicketList();
- },
-
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
- },
- showPicker(e){
- let type=e.currentTarget.dataset.type;
- this.setData({
- selectType:type,
- columns:type==1?this.data.statusList:this.data.levelList,
- selectVisible:true,
- });
- },
- onPickerConfirm(e){
- console.log(e);
- if(this.data.selectType==1){
- this.setData({
- 'listQuery.statusVal':e.detail.value.text,
- 'listQuery.status':e.detail.value.value,
- });
- }else{
- this.setData({
- 'listQuery.levelVal':e.detail.value.text,
- 'listQuery.level':e.detail.value.value,
- });
- }
- this.setData({
-
- selectVisible:false,
- page:1,
- ticketList:[]
- });
- this.getTicketList();
- },
- onPickerCancel(){
- this.setData({
- selectVisible:false
- });
- },
-
- goDetail(e){
- let id=e.currentTarget.dataset.id;
- let orderId=e.currentTarget.dataset.orderid;
- let info=e.currentTarget.dataset.info;
- app.globalData.refundDetail=info;
- wx.navigateTo({
- url: '/pages/refund/refundDetail/refundDetail?id='+id+"&orderId="+orderId
- });
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- onReachBottom() {
- if (this.data.totalPages > this.data.page) {
- this.setData({
- page: this.data.page + 1
- });
- this.getTicketList();
- } else if (this.data.ticketList.length > 0) {
- wx.showToast({
- title: '没有更多工单了',
- icon: 'none',
- duration: 2000
- });
- return false;
- }
- },
- onChange(e){
- this.setData({
- 'listQuery.status':e.detail.name,
- 'listQuery.page':1,
- ticketList:[]
- });
- this.getTicketList();
- },
- getTicketList(){
- util.request(api.GetAfterSaleList, {
- pageNo: this.data.page,
- pageSize: 10,
- status:this.data.listQuery.status,
- }, 'POST').then(res=>{
- if (res.errno == 0) {
-
- this.setData({
- totalPages:Math.ceil(res.data.total/10),
- ticketList:this.data.ticketList.concat(res.data.list)
- });
- }else{
- wx.showToast({
- title: res.errmsg,
- icon:'none'
- })
- }
-
- });
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- })
|