ss 1 yıl önce
işleme
b2b81ad476
100 değiştirilmiş dosya ile 2014 ekleme ve 0 silme
  1. 16 0
      .gitignore
  2. 371 0
      app.js
  3. 56 0
      app.json
  4. 33 0
      app.wxss
  5. BIN
      images/avatar.png
  6. BIN
      images/bg.png
  7. BIN
      images/icon-banben@2x.png
  8. BIN
      images/icon-gongzuotai-xuanzhong@2x.png
  9. BIN
      images/icon-gongzuotai@2x.png
  10. BIN
      images/icon-guanyuwomen@2x.png
  11. BIN
      images/icon-richanggongzuo.png
  12. BIN
      images/icon-tongzhi@2x.png
  13. BIN
      images/icon-wode-xuanzhong@2x.png
  14. BIN
      images/icon-wode@2x.png
  15. BIN
      images/icon-yijian@2x.png
  16. BIN
      images/icons/account.png
  17. BIN
      images/icons/addImg.png
  18. BIN
      images/icons/avatar.png
  19. BIN
      images/icons/biyan.png
  20. BIN
      images/icons/bl.png
  21. BIN
      images/icons/camera.png
  22. BIN
      images/icons/check_star.png
  23. BIN
      images/icons/checked.png
  24. BIN
      images/icons/confirm.png
  25. BIN
      images/icons/dangqianbanben@2x.png
  26. BIN
      images/icons/dangqianxiangmu@2x.png
  27. BIN
      images/icons/delete.png
  28. BIN
      images/icons/goright.png
  29. BIN
      images/icons/guanyuwomen@2x.png
  30. BIN
      images/icons/huiyishiyuding.png
  31. BIN
      images/icons/jia2@2x.png
  32. BIN
      images/icons/jia@2x.png
  33. BIN
      images/icons/jian@2x.png
  34. BIN
      images/icons/luyinzhong.png
  35. BIN
      images/icons/meetuser.png
  36. BIN
      images/icons/newdel.png
  37. BIN
      images/icons/notice.png
  38. BIN
      images/icons/off.png
  39. BIN
      images/icons/password.png
  40. BIN
      images/icons/play.png
  41. BIN
      images/icons/quxiaogongdan@2x.png
  42. BIN
      images/icons/recording.png
  43. BIN
      images/icons/renwulan-click@2x.png
  44. BIN
      images/icons/renwulan@2x.png
  45. BIN
      images/icons/searchbar.png
  46. BIN
      images/icons/shipinyishangchuan@2x.png
  47. BIN
      images/icons/shoudaopingjia@2x.png
  48. BIN
      images/icons/toRight.png
  49. BIN
      images/icons/tongxunlu-click@2x.png
  50. BIN
      images/icons/tongxunlu@2x.png
  51. BIN
      images/icons/uncheck.png
  52. BIN
      images/icons/weichuli@2x.png
  53. BIN
      images/icons/wode-click@2x.png
  54. BIN
      images/icons/wode@2x.png
  55. BIN
      images/icons/wodetongzhi@2x.png
  56. BIN
      images/icons/wodetousu@2x.png
  57. BIN
      images/icons/wodexiaoxi@2x.png
  58. BIN
      images/icons/xiangyou@2x.png
  59. BIN
      images/icons/xiangyougray@2x.png
  60. BIN
      images/icons/xiaohongdian@2x.png
  61. BIN
      images/icons/yijianfankui@2x.png
  62. BIN
      images/icons/yijianhujiao.png
  63. BIN
      images/icons/yilingqu@2x.png
  64. BIN
      images/icons/yipaifa@2x.png
  65. BIN
      images/icons/yipingjia@2x.png
  66. BIN
      images/icons/yiwancheng@2x.png
  67. BIN
      images/icons/yizuofei@2x.png
  68. BIN
      images/icons/yuangongxuexi.png
  69. BIN
      images/icons/yuyue.png
  70. BIN
      images/icons/zanting .png
  71. BIN
      images/icons/zanting.png
  72. BIN
      images/icons/zanwushuju.png
  73. BIN
      images/icons/zhengyan.png
  74. BIN
      images/icons/zhugongneng-click@2x.png
  75. BIN
      images/icons/zhugongneng@2x.png
  76. BIN
      images/idep.png
  77. BIN
      images/iname.png
  78. BIN
      images/ipass.png
  79. BIN
      images/iphone.png
  80. BIN
      images/no_data.png
  81. BIN
      images/tousu@2x.png
  82. BIN
      images/tu.png
  83. BIN
      images/wode-bg.png
  84. BIN
      images/youjiantou@2x.png
  85. BIN
      images/zi.png
  86. 563 0
      pages/complain/add/index.js
  87. 4 0
      pages/complain/add/index.json
  88. 82 0
      pages/complain/add/index.wxml
  89. 249 0
      pages/complain/add/index.wxss
  90. 155 0
      pages/complain/detail/index.js
  91. 3 0
      pages/complain/detail/index.json
  92. 53 0
      pages/complain/detail/index.wxml
  93. 195 0
      pages/complain/detail/index.wxss
  94. 71 0
      pages/complain/index.js
  95. 7 0
      pages/complain/index.json
  96. 26 0
      pages/complain/index.wxml
  97. 81 0
      pages/complain/index.wxss
  98. 45 0
      pages/components/modal/modal.js
  99. 4 0
      pages/components/modal/modal.json
  100. 0 0
      pages/components/modal/modal.wxml

+ 16 - 0
.gitignore

@@ -0,0 +1,16 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/
+
+*.config.json

+ 371 - 0
app.js

@@ -0,0 +1,371 @@
+//app.js
+App({
+  //全局变量
+  globalData: {
+    //服务器地址
+    serverUrl: 'https://mdyg.sdmingde.cn/api/v1/',
+    uploadServerUrl: 'https://mdyg.sdmingde.cn/api/v1/',
+    visitorServerUrl: 'https://mdyg.sdmingde.cn/api/h5/',
+    appVersion: '1.0.0',
+    platform: 'wxapp',
+    userinfo:{}
+  },
+  onLaunch: function (options) {
+   // let orgId = 3
+   // wx.setStorageSync("orgId", orgId);
+    // wx.setStorageSync("token", 3914262743650);
+    // wx.setStorageSync("userId", 3);
+    this.getScene(options);
+  },
+  
+  getScene(options){
+    const scene = decodeURIComponent(options.scene);
+    let ss = scene.split('_');
+    if(ss.length == 2){
+      var orgId = wx.getStorageSync("orgId");
+      if(!orgId || (orgId && Number(orgId) != Number(ss[1]))){
+        wx.setStorageSync("orgId", ss[1]);
+        this.logout();
+      }
+    }
+  },
+
+  logout(){
+    wx.removeStorageSync("token");
+    wx.removeStorageSync("userId");
+    wx.removeStorageSync("visitorToken");
+    wx.removeStorageSync("visitorUserId");
+  },
+
+  checkCode:function(code){
+    if(code == -100){
+      wx.showToast({
+        title: '登录超时,请重新登录',
+        icon: 'none',
+        duration: 2000
+      })
+      this.logout();
+      setTimeout(function(){
+        wx.reLaunch({ //关闭所有页面,打开到应用内的某个页面
+          url: '/pages/splash/splash'
+        })
+      },2000);
+      return false;
+    }
+    return true;
+  },
+
+  ajax:function(params){
+    if (!params.type) {
+      var type = 'POST';
+    }else{
+      var type = params.type;
+    }
+    if (!params.apiname) {
+      var apiname = '1';
+    } else {
+      var apiname = params.apiname;
+    }
+    if (!params.data) {
+      var data = [];
+    }else{
+      var data = params.data;
+    }
+    var app = getApp();
+    var userId = app.globalData.userinfo.userId;
+    var token = app.globalData.userinfo.token;
+    var orgId = wx.getStorageSync("orgId");
+
+    if (!userId || userId == undefined) { //未登录
+      wx.showToast({
+        title: '未登录',
+        icon: 'none',
+        duration: 2000
+      });
+      this.logout();
+      setTimeout(function () {
+        wx.reLaunch({ //关闭所有页面,跳转到闪屏页
+          url: '/pages/splash/splash'
+        })
+      }, 2000);
+      return false;
+    }
+    data['userId'] = userId;
+    data['token'] = token;
+    data['orgId'] = orgId;
+    
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    
+    wx.request({
+      url: params.url,
+      data: data,
+      method: type,
+      header: {
+        'content-type': 'application/x-www-form-urlencoded'
+      },
+      success: function (res) {
+        wx.hideLoading();
+        wx.stopPullDownRefresh();
+        var ret = app.checkCode(res.data.code); //检查token是否失效
+        if(ret == false){
+          return false;
+        }
+
+        if (res.data.code == 0) {
+          if (app.ajaxReadyCallback) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+            res.data['apiname'] = apiname;
+            app.ajaxReadyCallback(res)
+          }
+        } else {
+          let showMsg = true;
+          if(params.showMsg != undefined){
+            showMsg = params.showMsg;
+          }
+          if(showMsg){
+            wx.showToast({
+              title: res.data.message,
+              icon: 'none',
+              duration: 2000
+            })
+          }
+        }
+      },
+      fail: function (err) {
+        wx.hideLoading();
+        wx.showToast({
+          title: '请求失败',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  },
+
+  
+  loginVisitor:function(type){
+    wx.login({
+      success: function (loginRes) {
+        var app = getApp();
+        var serverUrl = app.globalData.visitorServerUrl;
+        if (loginRes) {
+          wx.request({
+            url: serverUrl + 'oauth/checkCode',
+            data: {
+              type: 2,
+              code: loginRes.code//临时登录凭证
+            },
+            method: 'POST',
+            header: {
+              'content-type': 'application/x-www-form-urlencoded'
+            },
+            success: function (res) {
+              if (res.data.code == -101) {
+                wx.removeStorageSync("visitorToken");
+                if(type == 'visitorAdd'){
+                  wx.redirectTo({
+                    url: '/pages/splash/splash?type=visitorAdd'
+                  })
+                }else{
+                  wx.redirectTo({
+                    url: '/pages/splash/splash?type=visitor'
+                  })
+                }
+              }
+              if (res.data.code == 0) {
+                try {
+                  wx.setStorageSync("visitorToken", res.data.data.token);
+                  wx.setStorageSync("visitorUserId", res.data.data.userId);
+                } catch (e) {
+                  this.logout();
+                  wx.showModal({
+                    title: '提示',
+                    content: '登录异常!',
+                    showCancel: false
+                  })
+                  return false;
+                };
+              
+                if(type == 'visitorAdd'){
+                  wx.redirectTo({
+                    url: '/pages/visitor/add/index'
+                  });
+                }else{
+                  wx.redirectTo({
+                    url: '/pages/visitor/index'
+                  });
+                }
+              }
+            },
+            fail: function (err) {
+              wx.showModal({
+                title: '提示',
+                content: '登录异常!',
+                showCancel: false
+              })
+            }
+          })
+        } else {
+          wx.showModal({
+            title: '提示',
+            content: '登录异常!',
+            showCancel: false
+          })
+        }
+      }
+    })
+  },
+
+  checkCode2:function(code){
+    if(code == -100){
+      wx.showToast({
+        title: '登录超时,请重新登录',
+        icon: 'none',
+        duration: 2000
+      })
+      wx.removeStorageSync('visitorToken');
+      wx.removeStorageSync('visitorUserId');
+      setTimeout(function(){
+        var vtype = wx.getStorageSync('visitorType');
+        if(vtype == 'visitorAdd'){
+          wx.redirectTo({ //关闭所有页面,打开到应用内的某个页面
+            url: '/pages/splash/splash?type=visitorAdd'
+          })
+        }else{
+          wx.redirectTo({ //关闭所有页面,打开到应用内的某个页面
+            url: '/pages/splash/splash?type=visitor'
+          })
+        }
+      },2000);
+      return false;
+    }
+    return true;
+  },
+
+  ajax2:function(params){
+    if (!params.type) {
+      var type = 'POST';
+    }else{
+      var type = params.type;
+    }
+    if (!params.apiname) {
+      var apiname = '1';
+    } else {
+      var apiname = params.apiname;
+    }
+    if (!params.data) {
+      var data = [];
+    }else{
+      var data = params.data;
+    }
+    var app = getApp();
+    var token = wx.getStorageSync('visitorToken');
+    var userId = wx.getStorageSync('visitorUserId');
+    var vtype = wx.getStorageSync('visitorType');
+    if (!token || token == undefined) { //未登录
+      wx.showToast({
+        title: '未登录',
+        icon: 'none',
+        duration: 2000
+      });
+      setTimeout(function () {
+        if(vtype == 'visitorAdd'){
+          wx.redirectTo({ //关闭所有页面,跳转到闪屏页
+            url: '/pages/splash/splash?type=visitorAdd'
+          })
+        }else{
+          wx.redirectTo({ //关闭所有页面,跳转到闪屏页
+            url: '/pages/splash/splash?type=visitor'
+          })
+        }
+      }, 2000);
+      return false;
+    }
+    data['token'] = token;
+    data['userId'] = userId;
+    
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    
+    wx.request({
+      url: params.url,
+      data: data,
+      method: type,
+      header: {
+        'content-type': 'application/x-www-form-urlencoded'
+      },
+      success: function (res) {
+        wx.hideLoading();
+        wx.stopPullDownRefresh();
+        var ret = app.checkCode2(res.data.code); //检查token是否失效
+        if(ret == false){
+          return false;
+        }
+
+        if (res.data.code == 0) {
+          if (app.ajaxReadyCallback) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+            res.data['apiname'] = apiname;
+            app.ajaxReadyCallback(res)
+          }
+        } else {
+          let showMsg = true;
+          if(params.showMsg != undefined){
+            showMsg = params.showMsg;
+          }
+          if(showMsg){
+            wx.showToast({
+              title: res.data.message,
+              icon: 'none',
+              duration: 2000
+            })
+          }
+        }
+      },
+      fail: function (err) {
+        wx.hideLoading();
+        wx.showToast({
+          title: '请求失败',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  },
+
+  gotopage: function (url, data) { //传递数据到下一页面的跳转,在新页面onload中获取
+    wx.setStorage({
+      key: "gotopage",
+      data: data,
+      success: function () {
+        wx.navigateTo({
+          url: url,
+        })
+      },
+      fail: function () {
+        wx.showToast({
+          title: '跳转失败',
+          icon: 'none',
+          duration: 2000
+        })
+        return false;
+      }
+    });
+  },
+  getgotodata: function (url, data) { //传递数据到下一页面的跳转,在新页面onload中获取
+    wx.getStorage({
+      key: 'gotopage',
+      success(res) {
+        return res.data;
+      },
+      fail(res) {
+        wx.navigateBack({ delta: 1 });
+        return false;
+      }
+    });
+  }
+
+})

+ 56 - 0
app.json

@@ -0,0 +1,56 @@
+{
+  "pages": [
+    "pages/splash/splash",
+    "pages/userLogin/userLogin",
+    "pages/index/index",
+    "pages/user/index",
+    "pages/video/index",
+    "pages/feedback/feedback",
+    "pages/webview/index",
+    "pages/complain/index",
+    "pages/complain/add/index",
+    "pages/complain/detail/index",
+    "pages/hiddendanger/index",
+    "pages/hiddendanger/add/index",
+    "pages/hiddendanger/detail/index",
+    "pages/order/index",
+    "pages/order/add/index",
+    "pages/order/addys/index",
+    "pages/order/detail/index",
+    "pages/order/select/index",
+    "pages/visitor/index",
+    "pages/visitor/add/index",
+    "pages/visitor/detail/index",
+    "pages/visitor/apply/index",
+    "pages/visitor/apply/detail/index"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#023894",
+    "navigationBarTitleText": "云盘谷",
+    "navigationBarTextStyle": "white"
+  },
+  "usingComponents": {
+    "modalView": "./pages/components/modal/modal"
+  },
+  "sitemapLocation": "sitemap.json",
+  "tabBar": {
+    "color": "#777777",
+    "selectedColor": "#023894",
+    "backgroundColor": "#FFFFFF",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "text": "工作台",
+        "iconPath": "images/icon-gongzuotai@2x.png",
+        "selectedIconPath": "images/icon-gongzuotai-xuanzhong@2x.png"
+      },
+      {
+        "pagePath": "pages/user/index",
+        "text": "我的",
+        "iconPath": "images/icon-wode@2x.png",
+        "selectedIconPath": "images/icon-wode-xuanzhong@2x.png"
+      }
+    ]
+  }
+}

+ 33 - 0
app.wxss

@@ -0,0 +1,33 @@
+/**app.wxss**/
+page{
+  --themeColor:#023894;
+  width: 100%;
+  height: 100%;
+  background-color: #F7F7F7;
+}
+
+.container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  box-sizing: border-box;
+} 
+image{
+  overflow: hidden;
+}
+
+.zanwushuju{
+  width: 750rpx;
+  text-align: center;
+  padding-top: 40%;
+  color: #666666;
+  font-size: 32rpx;
+}
+.zanwushuju image{
+  width: 374rpx;
+  height: 288rpx;
+  margin: 0 auto;
+}
+.weui-search-bar__cancel-btn {
+  color: var(--themeColor) !important;
+}

BIN
images/avatar.png


BIN
images/bg.png


BIN
images/icon-banben@2x.png


BIN
images/icon-gongzuotai-xuanzhong@2x.png


BIN
images/icon-gongzuotai@2x.png


BIN
images/icon-guanyuwomen@2x.png


BIN
images/icon-richanggongzuo.png


BIN
images/icon-tongzhi@2x.png


BIN
images/icon-wode-xuanzhong@2x.png


BIN
images/icon-wode@2x.png


BIN
images/icon-yijian@2x.png


BIN
images/icons/account.png


BIN
images/icons/addImg.png


BIN
images/icons/avatar.png


BIN
images/icons/biyan.png


BIN
images/icons/bl.png


BIN
images/icons/camera.png


BIN
images/icons/check_star.png


BIN
images/icons/checked.png


BIN
images/icons/confirm.png


BIN
images/icons/dangqianbanben@2x.png


BIN
images/icons/dangqianxiangmu@2x.png


BIN
images/icons/delete.png


BIN
images/icons/goright.png


BIN
images/icons/guanyuwomen@2x.png


BIN
images/icons/huiyishiyuding.png


BIN
images/icons/jia2@2x.png


BIN
images/icons/jia@2x.png


BIN
images/icons/jian@2x.png


BIN
images/icons/luyinzhong.png


BIN
images/icons/meetuser.png


BIN
images/icons/newdel.png


BIN
images/icons/notice.png


BIN
images/icons/off.png


BIN
images/icons/password.png


BIN
images/icons/play.png


BIN
images/icons/quxiaogongdan@2x.png


BIN
images/icons/recording.png


BIN
images/icons/renwulan-click@2x.png


BIN
images/icons/renwulan@2x.png


BIN
images/icons/searchbar.png


BIN
images/icons/shipinyishangchuan@2x.png


BIN
images/icons/shoudaopingjia@2x.png


BIN
images/icons/toRight.png


BIN
images/icons/tongxunlu-click@2x.png


BIN
images/icons/tongxunlu@2x.png


BIN
images/icons/uncheck.png


BIN
images/icons/weichuli@2x.png


BIN
images/icons/wode-click@2x.png


BIN
images/icons/wode@2x.png


BIN
images/icons/wodetongzhi@2x.png


BIN
images/icons/wodetousu@2x.png


BIN
images/icons/wodexiaoxi@2x.png


BIN
images/icons/xiangyou@2x.png


BIN
images/icons/xiangyougray@2x.png


BIN
images/icons/xiaohongdian@2x.png


BIN
images/icons/yijianfankui@2x.png


BIN
images/icons/yijianhujiao.png


BIN
images/icons/yilingqu@2x.png


BIN
images/icons/yipaifa@2x.png


BIN
images/icons/yipingjia@2x.png


BIN
images/icons/yiwancheng@2x.png


BIN
images/icons/yizuofei@2x.png


BIN
images/icons/yuangongxuexi.png


BIN
images/icons/yuyue.png


BIN
images/icons/zanting .png


BIN
images/icons/zanting.png


BIN
images/icons/zanwushuju.png


BIN
images/icons/zhengyan.png


BIN
images/icons/zhugongneng-click@2x.png


BIN
images/icons/zhugongneng@2x.png


BIN
images/idep.png


BIN
images/iname.png


BIN
images/ipass.png


BIN
images/iphone.png


BIN
images/no_data.png


BIN
images/tousu@2x.png


BIN
images/tu.png


BIN
images/wode-bg.png


BIN
images/youjiantou@2x.png


BIN
images/zi.png


+ 563 - 0
pages/complain/add/index.js

@@ -0,0 +1,563 @@
+
+const app = getApp();
+//创建录音管理
+const recorderManager = wx.getRecorderManager();
+//创建播放管理器
+const innerAudioContext = wx.createInnerAudioContext();
+innerAudioContext.autoplay = false;
+var filescount = 0;
+var files = [];
+var uploadFlag = 0; //1=上传出错 0=正常
+var filesindex = 0;
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        mode: 0,
+        taskContent: {
+            title: '任务内容',
+            showImg: '/images/icons/recording.png',
+            playImg: '/images/icons/play.png',
+            blImg: '/images/icons/bl.png',
+            readingImg: '/images/icons/recording.png',
+            luyinzhongImg: '/images/icons/luyinzhong.png',
+            stopPlayImg: '/images/icons/zanting.png',
+            delimg: '/images/icons/newdel.png',
+            taskRadioType: '1',
+            radioUrl: '',
+            second: 10
+        },
+        rightImage:"/images/icons/toRight.png",
+        images:[],
+        videos:[],
+        voices: '',
+        imagesAdd: '/images/icons/camera.png',
+        wyPhone:"",
+        depId:0,
+        content:"",
+        depName:"",
+        form:{
+            images: [],
+            videos: [],
+            voices: []
+        },
+        isHide:0
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        let that = this;
+        this.setData({
+            mode: options.mode
+        })
+        wx.setNavigationBarTitle({
+            title: options.name
+        })
+        recorderManager.onStart(() => {
+            var taskContent = that.data.taskContent;
+        taskContent.showImg = taskContent.luyinzhongImg;
+        taskContent.taskRadioType = '2';
+        that.setData({
+            taskContent: taskContent
+        })
+    })
+        recorderManager.onPause(() => {
+
+        })
+
+        recorderManager.onStop((res) => {
+            var path = res.tempFilePath;
+        var task = that.data.taskContent;
+        task.taskRadioType = '3';
+        task.showImg = task.playImg;
+        task.second = Math.ceil(res.duration / 1000);
+        that.setData({
+            voices: path,
+            taskContent: task
+        });
+        // const { tempFilePath } = res
+    })
+        recorderManager.onError((res) => {
+            wx.showToast({
+            title: '录音失败',
+            icon: 'none',
+            duration: 2000
+        });
+        var task = that.data.taskContent;
+        task.taskRadioType = '1';
+        task.showImg = task.readingImg;
+        that.setData({
+            voices: '',
+            taskContent: task
+        });
+    });
+    this.getUserInfo();
+    },
+    gotopage: function(e){
+        var url = e.currentTarget.dataset.url;
+        var type = e.currentTarget.dataset.type;
+        var title = e.currentTarget.dataset.title;
+        app.gotopage(url, { title: title, type: type });
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        var arr = [];
+        var that = this;
+        app.ajaxReadyCallback = res => {
+            var apiname = res.data.apiname;
+            if(apiname == 'wyConfig'){
+                console.log(res);
+                that.setData({
+                    wyPhone:res.data.data.orgPhone
+                })
+            }else if(apiname == 'addorder') {
+                wx.showToast({
+                    title: '提交成功!',
+                    icon: 'success',
+                    duration: 1500
+                });
+
+                setTimeout(function () {
+                    wx.navigateBack({ delta: 1 });
+                }, 1500);
+            }else if(apiname == 'userInfo') {         
+                that.setData({
+                    depId:res.data.data.depId,
+                    depName:res.data.data.depName,
+                })
+           
+            }
+        }
+        this.wyConfig();
+    },
+
+    checkboxChange: function(e){
+      var data = e.detail.value;
+      if(data.length >0){
+          this.setData({
+              isHide:1
+          })
+      }else {
+          this.setData({
+              isHide:0
+          })
+      }
+    },
+    callPhone(){
+        var that = this;
+        wx.makePhoneCall({
+            phoneNumber: that.data.wyPhone,
+        })
+    },
+    wyConfig(){
+        app.ajax({
+            url: app.globalData.serverUrl + '/org/queryConfig',
+            type: 'POST',
+            apiname: 'wyConfig',
+            data: {
+
+            }
+        });
+    },
+    btnsubmit(){
+        var that = this;
+        if(!this.data.content){
+            wx.showToast({
+                title: '请输入内容',
+                icon: 'none',
+                duration: 2000
+            });
+            return ;
+        }
+        if(this.data.depId==0){
+            wx.showToast({
+                title: '请选择部门',
+                icon: 'none',
+                duration: 2000
+            });
+            return ;
+        }
+
+        //数据初始化
+        files = [];
+        filescount = 0;
+        uploadFlag = 0;
+        filesindex = 0;
+        var formdata = {
+            images: this.data.images,
+            voices: this.data.voices?[this.data.voices]:[],
+            videos: this.data.videos,
+        }
+        if (formdata.voices.length > 0) {
+            for (var i in formdata.voices){
+                var file = {
+                    path: formdata.voices[i],
+                    type: 'voice'
+                }
+                files.push(file);
+            }
+        }
+
+        if (formdata.images.length > 0) {
+            for (var i in formdata.images) {
+                var file = {
+                    path: formdata.images[i],
+                    type: 'image'
+                }
+                files.push(file);
+            }
+        }
+
+        if (formdata.videos.length > 0) {
+            for (var i in formdata.videos) {
+                var file = {
+                    path: formdata.videos[i],
+                    type: 'video'
+                }
+                files.push(file);
+            }
+        }
+
+
+        //上传文件
+        if(files.length > 0){
+            filescount = files.length;
+            wx.showLoading({
+                title: '提交中',
+                mask: true
+            });
+            this.uploadFiles();
+        }else{
+            this.addorder();
+        }
+    },
+
+    addorder: function(){
+        var that = this;
+        var form = that.data.form;
+        var formimages = '';
+        if (form.images.length > 0) {
+            formimages = form.images.join(",");
+        }
+        var formvoices = '';
+        if (form.voices.length > 0) {
+            formvoices = form.voices.join(",");
+        }
+        var formvideos = '';
+        if (form.videos.length > 0) {
+            formvideos = form.videos.join(",");
+        }
+        var m =  this.data.mode;
+        if(this.data.mode===1){
+            var m = 2;
+        }
+        if(this.data.mode===2){
+            var m = 1;
+        }
+        app.ajax({
+            url: app.globalData.serverUrl + '/Complain/add',
+            type: 'POST',
+            apiname:'addorder',
+            data: {
+                depId: that.data.depId,
+                content: that.data.content,
+                images: formimages,
+                voices: formvoices,
+                videos: formvideos,
+                hide:that.data.isHide,
+            }
+        });
+    },
+    contentChange(e){
+        this.setData({
+            content: e.detail.value
+        });
+    },
+    onTouchstartRadio: function(event) {
+        var radioType = this.data.taskContent.taskRadioType;
+        if (radioType == 1) {
+            //开始录音
+            var options = {
+                duration: 15000,
+                sampleRate: 44100,
+                numberOfChannels: 1,
+                encodeBitRate: 192000,
+                format: 'mp3',
+                frameSize: 50
+            }
+            recorderManager.start(options);
+        }
+    },
+
+    onTouchendRadio: function(event) {
+        var radioType = this.data.taskContent.taskRadioType;
+        var that = this;
+        if (radioType == 2) {
+            recorderManager.stop();
+        }
+    },
+    //播放录音
+    playRadio: function(event) {
+        var taskContent = this.data.taskContent;
+        var radioType = taskContent.taskRadioType;
+        if (radioType == 3) {
+            var radioUrl = this.data.voices;
+            innerAudioContext.src = radioUrl;
+            innerAudioContext.play();
+            innerAudioContext.onPlay(() => {
+                taskContent.taskRadioType = 4;
+            taskContent.showImg = taskContent.stopPlayImg;
+            this.setData({
+                taskContent: taskContent
+            })
+        });
+            innerAudioContext.onError((res) => {
+                // console.log(res)
+            });
+            //监听音频自然播放至结束的事件
+            innerAudioContext.onEnded((res) => {
+                taskContent.taskRadioType = 3;
+            taskContent.showImg = taskContent.playImg;
+            this.setData({
+                taskContent: taskContent
+            })
+        });
+        } else if (radioType == 4) {
+            innerAudioContext.stop();
+            //监听音频停止事件
+            innerAudioContext.onStop((res) => {
+                taskContent.taskRadioType = 3;
+            taskContent.showImg = taskContent.playImg;
+            this.setData({
+                taskContent: taskContent
+            })
+        });
+        }
+    },
+
+
+    delfile: function(e){
+        var type = e.currentTarget.dataset.type;
+        var path = e.currentTarget.dataset.path;
+        if(type == 'image'){
+            var imgs = this.data.images;
+            var newsimgs = [];
+            for(var i in imgs){
+                if (imgs[i] == path){
+                    continue;
+                }
+                newsimgs.push(imgs[i]);
+            }
+            this.setData({
+                images: newsimgs
+            });
+            this.checkfiles();
+        }else if(type == 'video'){
+            var videos = this.data.videos;
+            var newvideos = [];
+            for (var i in videos) {
+                if (videos[i] == path) {
+                    continue;
+                }
+                newvideos.push(videos[i]);
+            }
+            this.setData({
+                videos: newvideos
+            });
+            this.checkfiles();
+        }else{
+            var task = this.data.taskContent;
+            task.showImg = task.readingImg;
+            task.taskRadioType = '1';
+            this.setData({
+                voices: '',
+                taskContent: task
+            });
+        }
+    },
+
+    choosefile : function(){
+        let that = this;
+        wx.showActionSheet({
+            itemList: ['选择图片','选择视频'],
+            success(res) {
+                if (res.tapIndex == 0){
+                    if (that.data.images.length >= 3){
+                        wx.showToast({
+                            title: '图片最多只能上传3张',
+                            icon: 'none',
+                            duration: 2000
+                        });
+                    }else{
+                        that.chooseImg();
+                    }
+                } else if (res.tapIndex == 1){
+                    if (that.data.videos.length >= 1) {
+                        wx.showToast({
+                            title: '视频最多只能上传1个',
+                            icon: 'none',
+                            duration: 2000
+                        });
+                    } else {
+                        that.chooseVideo();
+                    }
+                }
+            },
+            fail(res) {
+                // console.log('fail')
+            },
+        })
+    },
+
+    chooseImg: function(){
+        var imgs = this.data.images;
+        var that = this;
+        var count = 3 - imgs.length;
+        wx.chooseImage({
+            count: count,
+            sizeType: ['compressed'],
+            sourceType: ['album', 'camera'],
+            success(res) {
+                var files = res.tempFilePaths;
+                imgs = imgs.concat(files);
+                that.setData({
+                    images: imgs
+                });
+                that.checkfiles();
+            }
+        })
+    },
+
+    checkfiles: function(){
+        if (this.data.videos.length >= 1 && this.data.images.length >= 3) {
+            this.setData({
+                choosefinish: true,
+            });
+        }else{
+            this.setData({
+                choosefinish: false,
+            });
+        }
+        if (this.data.videos.length >= 1 || this.data.images.length >= 1){
+            this.setData({
+                choosefinishline: true
+            });
+        }else{
+            this.setData({
+                choosefinishline: false
+            });
+        }
+    },
+
+    chooseVideo: function () {
+        var that = this;
+        let maxDuration = 15;
+        wx.chooseVideo({
+            sourceType: ['album', 'camera'],
+            compressed: true,
+            maxDuration: maxDuration,
+            camera: 'back',
+            success(res) {
+                if (res.duration > maxDuration){
+                    wx.showToast({
+                        title: '视频时长不能超过' + maxDuration +'秒',
+                        icon: 'none',
+                        duration: 2000
+                    });
+                    return false;
+                }
+                let videos = [];
+                videos.push(res.tempFilePath);
+                that.setData({
+                    videos: videos
+                });
+                that.checkfiles();
+            }
+        })
+    },
+
+    uploadFiles: function(){
+        var that = this;
+        if (files.length > 0){
+            wx.uploadFile({
+                url: app.globalData.uploadServerUrl + 'upload/upfile',
+                filePath: files[filesindex].path,
+                name: 'uploadFile',
+                formData: {
+                    // 'ttype': mode,
+                    // 'orgId': orgId
+                },
+                success(res) {
+                    var data =JSON.parse(res.data);
+                    if (data.code != 0) {
+                        wx.hideLoading();
+                        wx.showToast({
+                            title: '文件上传失败1',
+                            icon: 'none',
+                            duration: 2000
+                        });
+                        that.setData({
+                            form:{
+                                images:[],
+                                voices:[],
+                                videos:[]
+                            }
+                        })
+                        return false;
+                    }else{
+                        var form = that.data.form;
+                        if (files[filesindex].type == 'image'){
+                            form.images.push(data.data.path);
+                        } else if (files[filesindex].type == 'video'){
+                            form.videos.push(data.data.path);
+                        }else{
+                            form.voices.push(data.data.path);
+                        }
+                        filescount--;
+                        if(filescount == 0){ //提交表单
+                            that.addorder();
+                        }else{ //继续上传
+                            filesindex++;
+                            that.uploadFiles();
+                        }
+                    }
+                },
+                fail(res){
+                    wx.hideLoading();
+                    wx.showToast({
+                        title: '文件上传失败',
+                        icon: 'none',
+                        duration: 2000
+                    });
+                    that.setData({
+                        form: {
+                            images: [],
+                            voices: [],
+                            videos: []
+                        }
+                    })
+                    return false;
+                }
+            })
+        }
+    },
+
+    getUserInfo(){
+        app.ajax({
+            url: app.globalData.serverUrl + '/User/info',
+            type: 'POST',
+            apiname:'userInfo',
+            data: {
+  
+            }
+        });
+    },
+
+})

+ 4 - 0
pages/complain/add/index.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "运送物品",
+  "backgroundTextStyle": "dark"
+}

+ 82 - 0
pages/complain/add/index.wxml

@@ -0,0 +1,82 @@
+<view class="container">
+    <view class="public_view task_content">
+        <view class="task_content_input">
+            <textarea placeholder="请输入内容..." bindinput="contentChange" value="{{deptcontent}}"></textarea>
+            <block wx:if="{{taskContent.taskRadioType == 1 || taskContent.taskRadioType == 2}}">
+                <view class="voicebtn">
+                    <image class="voiceimg" catchtouchstart="onTouchstartRadio" catchtouchend="onTouchendRadio" src="{{taskContent.showImg}}"></image>
+                </view>
+            </block>
+
+            <block wx:else>
+                <view class="voicebtnfinish" catchtap="playRadio">
+                    <image class="playimg" src="{{taskContent.showImg}}"></image>
+                    <image class="blimg" src="{{taskContent.blImg}}"></image>
+                    <image class="delimg" data-path="voices" data-type="voice" catchtap="delfile" src="{{taskContent.delimg}}"></image>
+                    <view class="second">{{taskContent.second}}"</view>
+                </view>
+            </block>
+
+
+        </view>
+    </view>
+
+    <view class="public_view images">
+        <!-- <template is="title_tpl" data="{{...image}}" /> -->
+        <view class="images_select_btn" wx:if="{{!choosefinish}}">
+            <image class="images_img" bindtap="choosefile" src="{{imagesAdd}}"></image>
+            <block wx:if="{{choosefinishline}}">
+                <view class="images_select_btn_desc border">(点击添加图片、视频,仅支持15秒内视频1项,图片最多不可超过三张)</view>
+            </block>
+            <block wx:else>
+                <view class="images_select_btn_desc">(点击添加图片、视频,仅支持15秒内视频1项,图片最多不可超过三张)</view>
+            </block>
+        </view>
+        <view class="images_imgs">
+            <block wx:for="{{videos}}" wx:key="key">
+                <view>
+                    <image class="images_img" src="../../../images/icons/shipinyishangchuan@2x.png" data-video="{{item}}" bindtap="videotap"></image>
+                    <image class="delimg" data-path="{{item}}" data-type="video" bindtap="delfile" src="{{taskContent.delimg}}"></image>
+                </view>
+            </block>
+            <block wx:for="{{images}}" wx:key="key">
+                <view>
+                    <image mode="aspectFill" class="images_img" src="{{item}}" data-src="{{item}}" bindtap="previewImage"></image>
+                    <image class="delimg" data-path="{{item}}" data-type="image" bindtap="delfile" src="{{taskContent.delimg}}"></image>
+                </view>
+            </block>
+        </view>
+        <view wx:if="{{choosefinish}}" class="images_select_btn_desc">(点击添加图片、视频,仅支持15秒内视频1项,图片最多不可超过三张)</view>
+    </view>
+
+
+
+    <view class="public_view startAddr">
+        <view class="select_area">
+
+            <view class="select_list" data-type="dep" data-title="部门列表" data-url="/pages/order/select/index?type=dep" bindtap="gotopage">
+                <view class="select_list_title">*选择部门:</view>
+                <view class="select_list_content">{{depName}} <image class="select_list_img" src="{{rightImage}}" /></view>
+
+            </view>
+        </view>
+    </view>
+    <view class="public_view startAddr">
+        <view class="select_area">
+
+            <view class="select_list">
+                <view class="select_list_title">是否匿名:</view>
+                <view class="select_list_content">
+                    <checkbox-group bindchange="checkboxChange">
+                        <checkbox value="1"  checked="{{isHide}}"/>
+                    </checkbox-group></view>
+
+            </view>
+        </view>
+    </view>
+</view>
+
+<view class="button_view">
+<button class="button_view_submit" bindtap="btnsubmit">提交</button>
+<button class="button_view_toWuYe" bindtap="callPhone">致电物业</button>
+</view>

+ 249 - 0
pages/complain/add/index.wxss

@@ -0,0 +1,249 @@
+.public_title{
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    line-height: 32rpx;
+    margin-top: 24rpx;
+    margin-left: 14rpx;
+}
+
+.public_title_left{
+    width: 1rpx;
+    height: 40rpx;
+    /* background-color: #3495A5; */
+}
+.public_title_right{
+    margin-left: 16rpx;
+    width: 136rpx;
+    height: 32rpx;
+    color: var(--themeColor);
+    font-size: 34rpx;
+    font-weight: bold;
+    font-family:PingFang-SC-Bold;
+}
+
+
+.container,page{
+    background-color: #F1F1F1;
+}
+
+.public_view{
+    width: 730rpx;
+    display: flex;
+    flex-direction: column;
+    background-color: #FFFFFF;
+    margin: 10rpx 10rpx 0 10rpx;
+    border-radius: 20rpx;
+    position: relative;
+}
+
+.task_content{
+    height: 302rpx;
+}
+.task_content_input{
+    /* margin-top: 20rpx;
+    margin-left: 62rpx; */
+    padding: 20rpx;
+    display: flex;
+    flex-direction: row;
+}
+.task_content_input textarea{
+    width: 660rpx;
+    height: 200rpx;
+}
+.task_content_input .voicebtn{
+    display: inline-block;
+    width: 153rpx;
+    height: 153rpx;
+    position: absolute;
+    z-index: 1000;
+    right: 10rpx;
+    top: 140rpx;
+}
+.task_content_input .voicebtn .voiceimg{
+    display: inline-block;
+    /* margin-top: 80rpx; */
+    width: 100%;
+    height: 100%;
+}
+.task_content_input .voicebtn .delimg{
+    display: inline-block;
+    width: 50rpx;
+    height: 50rpx;
+    position: absolute;
+    top: 70rpx;
+    right: -10rpx;
+}
+
+.voicebtnfinish{
+    display: inline-block;
+    width: 230rpx;
+    height: 48rpx;
+    position: absolute;
+    z-index: 1001;
+    right: 25rpx;
+    top: 200rpx;
+    background:rgba(235,234,234,1);
+    border-radius:10rpx;
+    padding: 12rpx 24rpx 20rpx 24rpx;
+}
+.voicebtnfinish .playimg{
+    display: inline-block;
+    width: 48rpx;
+    height: 48rpx;
+    vertical-align: middle;
+    margin-right: 22rpx;
+}
+.voicebtnfinish .blimg{
+    display: inline-block;
+    width: 93rpx;
+    height: 33rpx;
+    vertical-align: middle;
+    margin-right: 22rpx;
+}
+.voicebtnfinish .delimg{
+    position: absolute;
+    width: 36rpx;
+    height: 36rpx;
+    z-index: 1002;
+    right: -18rpx;
+    top: -18rpx;
+}
+.voicebtnfinish .second{
+    width: 42rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    display: inline-block;
+    font-size: 30rpx;
+    color: var(--themeColor);
+}
+
+/* .images{ */
+/* height: 336rpx; */
+/* } */
+.images_imgs{
+    margin: 30rpx 50rpx;
+    display: flex;
+    flex-direction: row;
+}
+.images_imgs view{
+    display: inline-block;
+    width: 145rpx;
+    height: 145rpx;
+    position: relative;
+    margin: 0 20rpx 20rpx 0;
+}
+.images_imgs view .images_img{
+    width: 100%;
+    height: 100%;
+}
+.images_imgs view .delimg{
+    position: absolute;
+    z-index: 1000;
+    width: 50rpx;
+    height: 50rpx;
+    right: -15rpx;
+    top: -15rpx;
+}
+
+.images_select_btn{
+    text-align: center;
+    padding: 35rpx 25rpx 20rpx 25rpx;
+}
+.images_select_btn .images_img{
+    width: 192rpx;
+    height: 192rpx;
+    border-radius: 96rpx;
+    margin-bottom: 10rpx;
+}
+.images_select_btn_desc{
+    font-size: 20rpx;
+    color: #999999;
+    padding-bottom: 20rpx;
+    text-align: center;
+}
+.images_select_btn_desc.border{
+    border-bottom: 1rpx dashed rgb(74, 188, 206);
+}
+
+.button_view{
+    padding: 60rpx 0 80px 0;
+    width: 100%;
+    height: 210rpx;
+    background-color: #F1F1F1;
+}
+button{
+    width: 640rpx;
+    height: 72rpx;
+    line-height: 72rpx;
+    color: #FFFFFF;
+    font-size: 38rpx;
+}
+.button_view_submit{
+    margin-top: 10rpx;
+    background-color: var(--themeColor);
+}
+.button_view_toWuYe{
+    margin-top: 28rpx;
+    background-color: #407FCC;
+}
+.pull-right{
+    float: right;
+}
+.anonymity{
+    width: 690rpx;
+    height: 100rpx;
+    line-height: 100rpx;
+    padding: 0 20rpx;
+    background-color: #FFFFFF;
+    margin: 10px;
+    border-radius: 20rpx;
+}
+
+.select_area{
+    padding: 0 30rpx 0 30rpx;
+    width: 690rpx;
+    height: auto;
+}
+.select_area.cur{
+    padding: 0 30rpx 0 30rpx;
+    width: 690rpx;
+    height: auto;
+}
+.select_area .select_list{
+    width: 690rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+    color: #5C5C5C;
+    border-bottom: 1rpx solid #CCCCCC;
+    font-size:32rpx;
+    font-family:PingFang-SC-Medium;
+    font-weight:500;
+}
+.select_area .select_list:last-child{
+    border-bottom: 0;
+}
+.select_list_title{
+    display: inline-block;
+    width: 180rpx;
+    /* padding-left: 30rpx; */
+
+}
+.select_list_title.cur{
+    color: var(--themeColor);
+    font-size: 34rpx;
+    font-weight: bold;
+}
+.select_list_content{
+    display: inline-block;
+    width: 463rpx;
+    text-align: right;
+    padding-right: 15rpx;
+    color: #999999;
+    font-size: 30rpx;
+}
+.select_list_img{
+    display: inline-block;
+    width: 12rpx;
+    height: 20rpx;
+}

+ 155 - 0
pages/complain/detail/index.js

@@ -0,0 +1,155 @@
+//index.js
+//获取应用实例
+const app = getApp()
+var id = 0;
+var playimg = '/images/icons/play.png';
+var pauseimg = '/images/icons/zanting.png';
+
+let innerAudioContext = null;
+
+Page({
+  data: {
+    taskContent: {
+      title: '投诉内容',
+      img: playimg,
+      second: ''
+    },
+    image: {
+      title: '图片'
+    },
+    video: {
+      title: '视频'
+    },
+    summary: {
+      title: '总结'
+    },
+    info: {},
+    flag: 0
+  },
+  onLoad: function (res) {
+    id = res.id;
+    this.showData();
+  },
+  onShow: function () {
+    var that = this;
+    app.ajaxReadyCallback = res => {
+      var imgs = [];
+      if (res.data.data.images){
+        imgs = res.data.data.images.split(',');
+      }
+      var info = {
+        content: res.data.data.content,
+        imgs: imgs,
+        videos: res.data.data.videos,
+        voices: res.data.data.voices,
+        note:res.data.data.note,
+        summary:res.data.data.summary,
+        orderId:res.data.data.orderId,
+      }
+      that.setData({
+        info: info
+      });
+      
+    }
+  },
+
+  showData: function () {
+    app.ajax({
+      url: app.globalData.serverUrl + '/complain/detail',
+      type: 'POST',
+      data: {
+        id: id,
+      }
+    });
+  },
+
+  playaudio: function(e){
+    innerAudioContext = null;
+    innerAudioContext = wx.createInnerAudioContext();
+    innerAudioContext.autoplay = false;
+    var audiosrc = e.currentTarget.dataset.audio;
+    var flag = e.currentTarget.dataset.flag;
+    var that = this;
+    if(!audiosrc){
+      wx.showToast({
+        title: '未上传音频',
+        icon: 'none',
+        duration: 1500
+      });
+      return false;
+    }
+    if(flag == 0){ //播放
+      innerAudioContext.autoplay = false;
+      innerAudioContext.src = that.data.info.voices;
+      innerAudioContext.play();
+    }else{ //停止
+      innerAudioContext.stop();
+    }
+    setTimeout(() => {
+      innerAudioContext.duration;
+    },300)
+    innerAudioContext.onTimeUpdate(() => {
+      var task = that.data.taskContent;
+      task.second = innerAudioContext.duration.toFixed(1)+'"';
+      that.setData({
+        taskContent: task
+      });
+    })
+    innerAudioContext.onPlay(() => {
+      var task = that.data.taskContent;
+      task.img = pauseimg;
+      that.setData({
+        flag: 1,
+        taskContent: task
+      })
+    })
+    innerAudioContext.onStop(() => {
+      var task = that.data.taskContent;
+      task.img = playimg;
+      that.setData({
+        flag: 0,
+        taskContent: task
+      })
+    })
+    innerAudioContext.onEnded(() => {
+      var task = that.data.taskContent;
+      task.img = playimg;
+      that.setData({
+        flag: 0,
+        taskContent: task
+      })
+    })
+    innerAudioContext.onError((res) => {
+      wx.showToast({
+        title: '音频播放失败',
+        icon: 'none',
+        duration: 1500
+      });
+      return false;
+    })
+  },
+
+  //图片预览
+  previewImage: function (e) {
+    var current = e.target.dataset.src;
+    wx.previewImage({
+      current: current, // 当前显示图片的http链接  
+      urls: this.data.info.imgs, // 需要预览的图片http链接列表  
+      success: function (e) {
+        console.log(e);
+      }
+    })
+  },
+
+  videotap: function(e){
+    var video = e.target.dataset.video;
+    app.gotopage('/pages/video/index', { video: video });
+  },
+
+  orderDetail: function(e){ //跳转到详情
+    wx.navigateTo({
+      url: '/pages/order/detail/index?id=' + this.data.info.orderId
+    })
+  },
+  
+})

+ 3 - 0
pages/complain/detail/index.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "投诉详情"
+}

+ 53 - 0
pages/complain/detail/index.wxml

@@ -0,0 +1,53 @@
+<import src="/pages/template/title/title_tpl.wxml"/>
+<view class="container">
+  <view class="public_view task_content">
+    <!-- <template is="title_tpl" data="{{...taskContent}}"/> -->
+    <view class="task_content_input">
+      <view class="textarea">{{info.content}}</view>
+      <!-- <textarea placeholder=""></textarea> -->
+      <block wx:if="{{info.voices}}">
+        <view class="voicebtnfinish" data-flag="{{flag}}" data-audio="{{info.voices}}" bindtap="playaudio">
+        <image class="playimg" src="{{taskContent.img}}"></image>
+        <image class="blimg" src="/images/icons/bl.png"></image>
+        <view class="second">{{taskContent.second}}</view>
+      </view>
+      <!-- <image src="{{taskContent.img}}" data-flag="{{flag}}" data-audio="{{info.voices}}" bindtap="playaudio"></image> -->
+      </block>
+    </view>
+  </view>
+  <block wx:if="{{info.imgs.length > 0 || info.videos}}"> 
+  <view class="public_view images">
+    <!-- <template is="title_tpl" data="{{...image}}"/> -->
+    <view class="images_imgs">
+      <image wx:if="{{info.videos}}" class="images_img" data-video="{{info.videos}}" bindtap="videotap" src="/images/icons/shipinyishangchuan@2x.png"></image>
+      <block wx:for="{{info.imgs}}" wx:key="key">
+        <image mode="aspectFill" class="images_img imglists" bindtap="previewImage" data-src="{{item}}" src="{{item}}"></image>
+      </block>
+    </view>
+    <view class="text-tip">(点击可查看图片、视频详情信息)</view>
+  </view>
+ 
+  </block>
+  <!-- <block wx:if="{{info.videos}}"> 
+    <view class="public_view images">
+      <template is="title_tpl" data="{{...video}}"/>
+      <view class="images_imgs">
+        <image class="images_img" data-video="{{info.videos}}" bindtap="videotap" src="/images/icons/shipinyishangchuan@2x.png"></image>
+      </view>
+    </view>
+  </block> -->
+
+</view>
+
+<view wx:if="{{info.note}}" class="task_box">
+    <view class="task_content_title">处理意见:</view>
+    <view class="textarea">{{info.note}}</view>
+  </view>
+
+  <view wx:if="{{info.summary}}" class="task_box">
+    <view class="task_content_title">总结:</view>
+    <view class="textarea">{{info.summary}}</view>
+  </view>
+
+  <button wx:if="{{info.orderId > 0}}" bindtap="orderDetail" class="user-info">订单详情</button>
+

+ 195 - 0
pages/complain/detail/index.wxss

@@ -0,0 +1,195 @@
+/* pages/repair/repair.wxss */
+.public_title{
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  line-height: 32rpx;
+  margin-top: 24rpx;
+  margin-left: 14rpx;
+}
+
+.public_title_left{
+  width: 1rpx;
+  height: 40rpx;
+  /* background-color: #3495A5; */
+}
+.public_title_right{
+  margin-left: 16rpx;
+  width: 136rpx;
+  height: 32rpx;
+  color: var(--themeColor);
+  font-size: 34rpx;
+  font-weight: bold;
+  font-family:PingFang-SC-Bold;
+}
+
+.hide{
+  display: none;
+}
+.container,page{
+  background-color: #F1F1F1;
+}
+
+.public_view{
+  width: 710rpx;
+  display: flex;
+  flex-direction: column;
+  background-color: #FFFFFF;
+  margin: 15rpx 20rpx;
+  border-radius: 20rpx;
+}
+
+.task_content{
+  height: 302rpx;
+}
+.task_content_input{
+  padding: 20rpx;
+  display: flex;
+  flex-direction: row;
+}
+.task_content_input .textarea{
+  width: 554rpx;
+  height: 180rpx;
+}
+.task_content_input image{
+  width: 112rpx;
+  height: 112rpx;
+}
+
+.task_box{
+  width: 670rpx;
+  height: auto;
+  background-color: #FFFFFF;
+  border-radius: 8rpx;
+  margin: 20rpx;
+  padding: 20rpx;
+}
+.task_content_title{
+  width: 100%;
+  display: block;
+  margin-bottom: 20rpx;
+  font-weight: bold;
+}
+
+.video-icon {
+  width: 45rpx;
+  height: 45rpx;
+}
+
+.repair_type{
+  height: 182rpx;
+  margin-bottom: 20rpx;
+}
+.repair_content{
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  margin: 24rpx 0 24rpx 58rpx;
+  align-items: center;
+}
+.repair_content_left{
+  font-size: 32rpx;
+}
+.repair_content_center{
+  width: 512rpx;
+  text-align: right;
+  margin-right: 10rpx;
+}
+.repair_content_right{
+  width: 12rpx;
+  height: 20rpx;
+}
+
+.public_view.images{
+  height: 300rpx;
+  margin-bottom: 20rpx;
+}
+.images_imgs{
+  margin: 44rpx 50rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+}
+.images_img{
+  width: 120rpx;
+  height: 120rpx;
+  margin: 0 20rpx;
+}
+/* .imglists{
+  margin: 0 10rpx 10rpx 0;
+} */
+
+.button_view{
+  width: 100%;
+  height: 210rpx;
+  background-color: #F1F1F1;
+}
+button{
+  width: 640rpx;
+  height: 72rpx;
+  line-height: 72rpx;
+  color: #FFFFFF;
+  font-size: 38rpx;
+}
+.button_view_submit{
+  margin-top: 80rpx;
+  background-color: var(--themeColor);
+}
+.button_view_toWuYe{
+  margin-top: 28rpx;
+  background-color: #407FCC;
+}
+
+.voicebtnfinish{
+  display: inline-block;
+  width: 230rpx;
+  height: 48rpx;
+  position: absolute;
+  z-index: 1001;
+  right: 60rpx;
+  top: 200rpx;
+  background:rgba(235,234,234,1);
+  border-radius:10rpx;
+  padding: 20rpx 24rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.voicebtnfinish .playimg{
+  display: inline-block;
+  width: 48rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  margin-right: 22rpx;
+}
+.voicebtnfinish .blimg{
+  display: inline-block;
+  width: 93rpx;
+  height: 33rpx;
+  line-height: 33rpx;
+  margin-right: 22rpx;
+}
+.voicebtnfinish .second{
+  width: 42rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  display: inline-block;
+  font-size: 28rpx;
+  color: #3495A5;
+}
+.text-tip {
+  margin: 0 auto;
+  width: 300rpx;
+  font-size: 20rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color:rgba(153,153,153,1);
+}
+
+.user-info{
+  height: 90rpx;
+  line-height: 90rpx;
+  background-color: var(--themeColor) !important;
+  color: #ffffff !important;
+  width: 710rpx !important;
+}

+ 71 - 0
pages/complain/index.js

@@ -0,0 +1,71 @@
+//index.js
+//获取应用实例
+const app = getApp()
+var page = 1;
+var flag = 0;
+var size = 10;
+
+Page({
+  data: {
+    list: []
+  },
+  onLoad: function () {
+    page = 1;
+    flag = 0;
+    this.showData();
+  },
+  
+  onShow:function(){
+    var that = this;
+    app.ajaxReadyCallback = res => {
+      var oldlist = that.data.list;
+      var list = res.data.data;
+      if (page == 1) {
+        oldlist = [];
+      }
+      var newlist = oldlist.concat(list);
+      that.setData({
+        list: newlist
+      });
+
+      if (list.length < size) {
+        flag = 1;
+      } else {
+        page++;
+      }
+    }
+
+  },
+
+  onPullDownRefresh() { //下拉刷新
+    page = 1;
+    flag = 0;
+    this.showData();
+  },
+
+  onReachBottom() { //上拉加载
+    this.showData();
+  },
+
+  showData: function () {
+    if (flag == 1) {
+      return false;
+    }
+    app.ajax({
+      url: app.globalData.serverUrl + '/complain/selectAllByOrgId',
+      type: 'POST',
+      data: {
+        page: page,
+        size: size
+      }
+    });
+  },
+
+  detail: function(e){ //跳转到详情
+    var id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: '/pages/complain/detail/index?id=' + id
+    })
+  }
+  
+})

+ 7 - 0
pages/complain/index.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "我的投诉",
+  "enablePullDownRefresh": true,
+  "backgroundTextStyle": "dark",
+  "usingComponents": {},
+  "onReachBottomDistance": 50
+}

+ 26 - 0
pages/complain/index.wxml

@@ -0,0 +1,26 @@
+<block wx:if="{{list.length > 0}}">
+<view class="device" data-id="{{item.id}}"  wx:for="{{list}}" wx:key="key" bindtap="detail">
+  <view class="device-header">
+    <view class="device-header-title">
+      投诉
+      <view class="detail pull-right">
+        <view>详情</view>
+        <image src="/images/icons/xiangyou@2x.png" />
+      </view>
+    </view>
+  </view>
+  <view class="device-list">
+    <view>提交时间: <text class="pull-right">{{item.createTime}}</text></view>
+    <view>投诉内容: <text class="pull-right">{{item.content}}</text></view>
+    <view> <text class="pull-right">{{item.statusText}}</text></view>
+  
+  </view>
+</view>
+</block>
+
+<block wx:if="{{list.length == 0}}">
+<view class="zanwushuju">
+  <image src="/images/icons/zanwushuju.png"></image>
+  <view>暂无数据</view>
+</view>
+</block>

+ 81 - 0
pages/complain/index.wxss

@@ -0,0 +1,81 @@
+.pull-right{
+  float: right;
+}
+
+.device{
+  width: 710rpx;
+  height: auto;
+  background-color: #FFFFFF;
+  border-radius: 20rpx;
+  margin: 15rpx 20rpx;
+  overflow: hidden;
+}
+.device-header{
+  width: 750rpx;
+  height: 83rpx;
+  line-height: 83rpx;
+  padding: 0 30rpx;
+  overflow: hidden;
+}
+.device-header-title{
+  width: 682rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  margin-top: 23rpx;
+  color: var(--themeColor);
+  /* border-left: 8rpx solid var(--themeColor); */
+  /* padding-left: 17rpx; */
+  font-size: 34rpx;
+  font-weight: bold;
+  font-family:PingFang-SC-Bold;
+}
+
+.device-list{
+  font-size: 32rpx;
+  font-family:PingFang-SC-Medium;
+  padding: 0 28rpx;
+}
+.device-list view{
+  height: 80rpx;
+  line-height: 80rpx;
+  border-bottom: 1rpx solid #CCCCCC;
+}
+.device-list view:last-child{
+  border: 0;
+}
+.device-list text{
+  display: inline-block;
+  width: 400rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
+  text-align: right;
+  color: #999999
+}
+
+.detail{
+  display: inline-block;
+  width: 155rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+}
+.detail view{
+  display: inline-block;
+  width: 120rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  color: var(--themeColor);
+  font-size: 30rpx;
+  font-family: PingFang-SC-Medium;
+  font-weight:500;
+  text-align: right;
+  padding-right: 10rpx;
+}
+.detail image{
+  display: inline-block;
+  width: 12rpx;
+  height: 20rpx;
+  margin-top: 10rpx;
+}

+ 45 - 0
pages/components/modal/modal.js

@@ -0,0 +1,45 @@
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    //是否显示modal弹窗
+    show: {
+      type: Boolean,
+      value: false
+    },
+    //控制底部是一个按钮还是两个按钮,默认两个
+    single: {
+      type: Boolean,
+      value: false 
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    // 点击modal的回调函数
+    clickMask() {
+      // 点击modal背景关闭遮罩层,如果不需要注释掉即可
+      // this.setData({show: true})
+    },
+   // 点击取消按钮的回调函数
+    cancel() {
+      this.setData({ show: false })
+      this.triggerEvent('cancel')  //triggerEvent触发事件
+    },
+    // 点击确定按钮的回调函数
+    confirm() {
+      this.setData({ show: false })
+      this.triggerEvent('confirm')
+    }
+  }
+})

+ 4 - 0
pages/components/modal/modal.json

@@ -0,0 +1,4 @@
+{
+  "component": true, 
+  "usingComponents": {}
+}

+ 0 - 0
pages/components/modal/modal.wxml


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor