123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- const app = getApp()
- const util = require("../../../utils/jmsUtil.js");
- const api = require('../../../api/jms.js');
- Page({
- noop() {
- },
- data: {
- userInfo: {
- userName: '',
- headImg: '',
- fraName: '',
- },
- serviceOrder: '',
- ticket: '',
- aftersale: '',
- wmsOrderCount: '',
- showFraWeekReportFlag: false,
- fraWeekReportId: null
- },
- onPageScroll(e) {
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- let userInfo = wx.getStorageSync('userInfo');
- console.log(userInfo);
- app.globalData.userInfo = userInfo;
- this.setData({
- userInfo: userInfo
- });
- },
- getHomeInfo() {
- util.request(api.GetHomeInfo, {}, 'GET').then(res => {
- if (res.errno === 0) {
- this.setData({
- serviceOrder: res.data.serviceOrder,
- ticket: res.data.ticket,
- aftersale: res.data.aftersale,
- wmsOrderCount: res.data.wmsOrderCount,
- showFraWeekReportFlag: res.data.showFraWeekReportFlag,
- fraWeekReportId: res.data.fraWeekReportId
- })
- } else {
- wx.showToast({
- title: res.errmsg,
- icon: 'none'
- })
- }
- });
- },
- closePopup() {
- console.log('closePopup');
- this.setData({
- showFraWeekReportFlag: false
- })
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.getHomeInfo();
- },
- onHide: function () {
- console.log('onHide');
- },
- onUnload: function () {
- console.log('onunload');
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- exitLogin: function () {
- wx.showModal({
- title: '',
- confirmColor: '#b4282d',
- content: '退出登录?',
- success: function (res) {
- if (!res.confirm) {
- return;
- }
- // util.request(api.AuthLogout, {}, 'POST');
- app.globalData.hasLogin = false;
- wx.removeStorageSync('token');
- wx.removeStorageSync('userInfo');
- // wx.redirectTo({
- // url: '/pages/temp/login/login'
- // });
- wx.redirectTo({
- url: '/pages/index/index'
- });
- }
- })
- },
- goService() {
- wx.navigateTo({
- url: '/pages/temp/orderBoard/orderBoard'
- });
- },
- goTicket() {
- wx.navigateTo({
- url: '/pages/ticket/ticketList/ticketList'
- });
- },
- goRefund() {
- wx.navigateTo({
- url: '/pages/refund/refundList/refundList'
- });
- },
- goMall() {
- wx.navigateTo({
- url: '/pages/mall/catalog/catalog'
- });
- },
- goOrder() {
- wx.navigateTo({
- url: '/pages/mall/order/order'
- });
- },
- goWeekData(e) {
- let type=e.target.dataset.type
- if(type==2){
- let params={dataId:this.data.fraWeekReportId}
- util.request(api.readWeekReport, params, 'get').then(res => {
- if (res.errno === 0) {
- } else {
- wx.showToast({
- title: res.errmsg, icon: 'none'
- })
- }
- });
- }
- wx.navigateTo({
- url: '/pages/temp/fraWeekReport/fraWeekReport?id=' + this.data.fraWeekReportId,
- })
-
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
- })
|