Browse Source

优仟家微信端增加我要投诉功能

shengxuefei 3 năm trước cách đây
mục cha
commit
a9e9204261

+ 2 - 1
app.json

@@ -15,7 +15,8 @@
         "pages/ld/ld",
         "pages/index/tointro",
         "pages/index/facereconize",
-        "pages/index/job"
+        "pages/index/job",
+        "pages/tousu/tousu"
     ],
     "window": {
         "navigationBarBackgroundColor": "#ffffff",

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 319 - 0
miniprogram_npm/dom-parser/index.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
miniprogram_npm/dom-parser/index.js.map


+ 5 - 0
package-lock.json

@@ -8,6 +8,11 @@
       "version": "1.4.4",
       "resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.4.4.tgz",
       "integrity": "sha512-dWwo5y6GZc4XhHfQtgtbA9HFoo9kXJp3whxcNXNfrKnEc+lf1JE/8Tyw/DN7XlgSO5IUeKjg0ak+uFdMG0U3kQ=="
+    },
+    "dom-parser": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/dom-parser/-/dom-parser-0.1.6.tgz",
+      "integrity": "sha512-3nVRKbLEwmGfghLoeT1dxlK/0votalnOfasP+8VCHYDfDuCETY4LeMblfOeqww6XZk2ymZ1Uewy/hVad6Dy3yw=="
     }
   }
 }

+ 2 - 1
package.json

@@ -3,6 +3,7 @@
   "version": "0.1.0",
   "private": true,
   "dependencies": {
-    "@vant/weapp": "^1.4.4"
+    "@vant/weapp": "^1.4.4",
+    "dom-parser": "^0.1.6"
   }
 }

+ 1 - 1
pages/index/index.js

@@ -1,4 +1,4 @@
-const Parser = require('../xml/xmldom/dom-parser')
+//const Parser = require('../xml/xmldom/dom-parser')
 var app = getApp();
 Page({
 

+ 248 - 0
pages/tousu/tousu.js

@@ -0,0 +1,248 @@
+const Parser = require('../xml/xmldom/dom-parser')
+var app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        imgUrl:app.imgUrl,
+        hname:'',//房产
+        datatimestart:'',//日期起始
+        datatimeend:'',//日期结束
+        dfdapplydate:'',//派单时间
+        txtdrequiredate:'',//完成时间
+        txtvcontent:'',// 投诉内容
+        hddhcode:'',//房产编号
+        ownerid:'',  //房主ID
+        txtvplace:'',//投诉地址
+        txtvtel:'',   //投诉电话
+        owername:'',   //房主姓名
+        table:[],//上传图片的对象
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        console.warn('onload',options);
+        var timestamp = Date.parse(new Date());
+        var date = new Date(timestamp);
+        var Y =date.getFullYear();
+        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
+        var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); 
+        var that = this;
+        that.setData({
+            datatimestart:Y + '-'  + M+ '-' + D,
+            dfdapplydate:Y + '-'  + M+ '-' + D,
+            txtdrequiredate:Y + '-'  + M+ '-' + D,
+            datatimeend:Y + 2 + '-' + M + '-' + D,
+            hname:options.hname,
+            ownerid:options.ownerid,
+            txtvtel:options.phone,
+            owername:options.ownername,
+            hddhcode:options.hcode,
+        })
+    },
+    bindDateChangeb:function(e){
+        this.setData({
+            txtdrequiredate: e.detail.value
+        })
+    },
+    // 选择日期
+    bindDateChange: function(e) {
+        this.setData({
+            dfdapplydate: e.detail.value
+        })
+      },
+    // 删除图片
+    removeImage(e) {
+        var index = e.target.dataset.index;
+        var imgs = this.data.table;
+        imgs.splice(index,1);
+        this.setData({
+            table:imgs,
+        })
+    },
+    // 选择图片
+    chooseImage:function(e){
+        var that = this;
+        wx.chooseImage({
+            count:3,
+            sizeType:['original','compressed'],
+            sourceType:['album','camera'],
+            success(res){
+                that.setData({
+                table: res.tempFilePaths
+                });
+            }
+        })
+    },
+    ceShibtnJiaoFei:function(e){
+    },
+    // 点击提交投诉 
+    btnJiaoFei: function (e) {
+        var that= this;
+        if(this.data.txtvtel==''){
+            wx.showToast({
+                title: '请填写手机号',
+                icon: 'none',
+                duration: 2000
+            })
+            return;
+        }
+        if(this.data.txtvplace==''){
+            wx.showToast({
+                title: '请填写投诉地址',
+                icon: 'none',
+                duration: 2000
+            })
+            return;
+        }
+        let fileurl = "";// 图片名称
+        if(this.data.table.length>0){
+            // 拼接多(单)个图片名称
+            for (let index = 0; index < this.data.table.length; index++) {
+                if(this.data.table[index].substring(0,11)=='http://tmp/'){
+                    fileurl += this.data.table[index].substring(11)+',';
+                }
+                if(this.data.table[index].substring(0,9)=='wxfile://'){
+                    fileurl += this.data.table[index].substring(9)+',';
+                }
+            }    
+        }
+        var method='Insertfdc_pm_repair ';
+        var wsdlurl= app.webUrl;
+        var targetNamespace='http://tempuri.org/';
+        var datacopy= '<?xml version="1.0" encoding="utf-8"?>';
+        datacopy += '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';
+        datacopy += '<soap:Header><MySoapHeader xmlns="http://tempuri.org/">';
+        datacopy += `<UserName>${app.UserName}</UserName>`;
+        datacopy += `<PassWord>${app.PassWord}</PassWord>`;
+        datacopy += '</MySoapHeader></soap:Header>';
+        datacopy += '<soap:Body>';
+        datacopy += '<Insertfdc_pm_repair xmlns="http://tempuri.org/">';
+        datacopy += `<dfdapplydate>${this.data.dfdapplydate}</dfdapplydate>`;
+        datacopy += `<txtdrequiredate>${this.data.txtdrequiredate}</txtdrequiredate>`;
+        datacopy += `<hddhcode>${this.data.hddhcode}</hddhcode>`;
+        datacopy += `<hddownerid>${this.data.ownerid}</hddownerid>`;
+        datacopy += `<txtvcontent>${this.data.txtvcontent}</txtvcontent>`;
+        datacopy += `<txtvplace>${this.data.txtvplace}</txtvplace>`;
+        datacopy += `<txtvtel>${this.data.txtvtel}</txtvtel>`;
+        datacopy += `<fileurl>${fileurl}</fileurl>`;
+        datacopy += '</Insertfdc_pm_repair>';
+        datacopy += '</soap:Body>';
+        datacopy += '</soap:Envelope>';
+        wx.request({
+            url: wsdlurl,
+            data: datacopy, 
+            method: 'POST', 
+            header: { 
+                'Content-Type':'text/xml; charset=utf-8',
+                'SOAPAction':targetNamespace+method,
+            }, 
+            success:function(res){
+                console.warn('Insertfdc_pm_repair',res);
+                var XMLParser = new Parser.DOMParser();
+                var doc = XMLParser.parseFromString(res.data);
+                var Insertfdc_pm_repairResult = doc.getElementsByTagName("Insertfdc_pm_repairResult")[0].firstChild.nodeValue;
+                console.warn('Insertfdc_pm_repairResult',Insertfdc_pm_repairResult);
+                if(Insertfdc_pm_repairResult=='保存成功!'){
+                    wx.showToast({
+                        title: '提交成功!',
+                        icon: 'success',
+                        duration: 1000
+                    })
+                    // 图片上传
+                    for (let index = 0; index < that.data.table.length; index++) {
+                        wx.uploadFile({
+                            filePath:  that.data.table[index],
+                            name: 'name',
+                            url: app.coreUrl+ 'InsertPicture',
+                            header:{
+                                'content-type':'multipart/form-data'
+                            },
+                            name:'upload',
+                            success:function(res){
+                                console.warn('上传图片',res.data);
+                                if(res.data=='"上传成功"'){
+                                    wx.navigateBack({
+                                        delta: 2
+                                    })
+                                }
+                                else{
+                                    wx.showToast({       //上传失败,弹出错误提示
+                                        title: res.data,
+                                        icon: 'none',
+                                        duration: 3000
+                                    });
+                                }
+                            },
+                        })
+                    }
+                } else {
+                    wx.showToast({
+                        title: Insertfdc_pm_repairResult,
+                        icon: 'none',
+                        duration: 2000
+                    })
+                }
+            }
+        })
+    },
+    // 修改投诉地址
+    updateTxtvplace: function (e) {
+        this.setData({
+            txtvplace: e.detail.value
+        })
+    },
+    // 编辑投诉人电话
+    updateTxtvtel: function (e) {
+        this.setData({
+            txtvtel: e.detail.value
+        })
+    },
+    // 编辑投诉人电话
+    updateTxtvcontent: function (e) {
+        this.setData({
+            txtvcontent: e.detail.value
+        })
+    },
+    // 预览图片
+    handleImagePreview: function (e) {
+        var idx = e.target.dataset.index;
+        var imag = this.data.table;
+        wx.previewImage({
+        current: imag[idx],  //当前预览的图片
+        urls: imag,  //所有要预览的图片
+        })
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 5 - 0
pages/tousu/tousu.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarBackgroundColor": "#298DF7",
+  "navigationBarTitleText": "我要报修",
+  "navigationBarTextStyle":"white"
+}

+ 75 - 0
pages/tousu/tousu.wxml

@@ -0,0 +1,75 @@
+<!--index.wxml-->
+<view class="bodyclass">
+    <!-- 主题 -->
+    <view class="dier">
+        <view class="dier_yi">
+            <text>
+                门牌房号:{{hname}}
+            </text>
+        </view>
+         <view class="dier_yi">
+            <text>
+                业主:{{owername}}
+            </text>
+        </view>
+        <view class="dier_yi">
+            <view style="display:inline-block;">
+                <text>
+                    投诉人电话:
+                </text>
+            </view>
+            <view style="display:inline-block;position: absolute;padding-top:38rpx;">
+                <input bindinput="updateTxtvtel" type="number" value="{{txtvtel}}"></input>
+            </view>
+        </view>
+        <view class="dier_yi">
+            <view style="display:inline-block;">
+                <text>
+                    投诉位置:
+                </text>
+            </view>
+            <view style="display:inline-block;position: absolute;padding-top:38rpx;">
+                <input bindinput="updateTxtvplace" type="text" value="{{txtvplace}}"></input>
+            </view>
+        </view>
+        <!-- <view class="dier_yi">
+            <picker style="padding-top:30rpx;" mode="date" value="{{date}}" start="{{datatimestart}}" end="{{datatimeend}}" bindchange="bindDateChange">
+                <view class="picker">
+                派单时间: {{dfdapplydate}}
+                </view>
+            </picker>
+        </view> -->
+        <view class="dier_yi">
+            <picker style="padding-top:30rpx;" mode="date" value="{{date}}" start="{{datatimestart}}" end="{{datatimeend}}" bindchange="bindDateChangeb">
+                <view class="picker">
+                完成时间: {{txtdrequiredate}}
+                </view>
+            </picker>
+        </view>
+        <view class="dier_yi">
+            <view style="margin-bottom:10px;">
+                <text>
+                    投诉内容
+                </text>
+            </view>
+            <view>
+                <textarea bindinput="updateTxtvcontent" value="{{txtvcontent}}" placeholder="请填写投诉内容"></textarea>
+            </view>
+        </view>
+        <view class="dier_img">
+            <view style="display:inline-block;" wx:for="{{table}}" wx:key="*this">
+                <image style="width:200rpx;height:200rpx;" data-index="{{index}}" src="{{item}}" bindtap="handleImagePreview"></image>
+                <image style="width:35rpx;height:35rpx;position:relative;float: right;left:-35rpx;" data-index="{{index}}" bindtap="removeImage" src="{{imgUrl}}u217.svg"></image>
+            </view>
+            <view style="display:inline-block;">
+                <image style="width:200rpx;height:200rpx;" src="{{imgUrl}}1588087782(1).png"  bindtap="chooseImage" />
+                <text style="font-size:20rpx;color:#808080;">(最多支持3张)</text>
+            </view>
+        </view>
+    <!-- <navigator 1588087782(1) url="" hover-class="none">蒂娜我</navigator> -->
+    </view>
+    <!-- 底部 -->
+   <view class="diesan">
+    <button bindtap="btnJiaoFei" class="btn-class">提交</button>
+    </view>
+</view>

+ 38 - 0
pages/tousu/tousu.wxss

@@ -0,0 +1,38 @@
+/* pages/user/user.wxss */
+.bodyclass{
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    background-color: #F4F6F7;
+}
+.dier{ 
+    margin:10px;
+    flex: 100;
+}
+.dier_yi{
+    display: block;
+    padding: 0rpx 25rpx 30rpx 25rpx;
+    line-height: 40rpx;
+    margin-bottom: 1px;
+    border-radius: 5rpx;
+    background-color: #fff;
+}
+.dier_img{
+
+    line-height: 20px;
+    border-radius: 5rpx;
+    background-color: #fff;
+}
+.diesan{
+    flex: 13;
+}
+.btn-class{
+    background-color: #298DF7;
+    color:#fff;
+    text-align: center;
+    width: 80%;
+}
+textarea{
+    height: 150rpx;
+    width: 670rpx;
+}

+ 38 - 0
pages/user/user.js

@@ -222,6 +222,25 @@ Page({
       })
     }
   },
+  woYaoTousu:function(){
+    // 跳转我要投诉
+    if(this.data.phone!=''){
+      wx.navigateTo({
+        url: `../tousu/tousu?openid=${this.data.openid}&phone=${this.data.phone}&hname=${this.data.hname}&hcode=${this.data.hcode}&ownerid=${this.data.ownerid}&ownername=${this.data.ownername}`,
+      })
+    }
+    else{
+      wx.showModal({
+        title: '提示',
+        content: '请先点击登录',
+        showCancel:false,
+        success (res) {
+          if (res.confirm) {
+          }
+        }
+      })
+    }
+  },
   woYaoJiaoFei:function(){
     // 跳转我要缴费
     if(this.data.phone!=''){
@@ -260,6 +279,25 @@ Page({
       })
     }
   },
+  tousuJiLuURL:function(){
+    // 跳转报修记录
+    if(this.data.phone!=''){
+      wx.navigateTo({
+        url: `../tsjl/tsjl?ownerid=${this.data.ownerid}`,
+      })
+    }
+    else{
+      wx.showModal({
+        title: '提示',
+        content: '请先点击登录',
+        showCancel:false,
+        success (res) {
+          if (res.confirm) {
+          }
+        }
+      })
+    }
+  },
   fanChanXinXiURL:function(){
     //跳转房产信息
     if(this.data.phone!=''){

+ 8 - 0
pages/user/user.wxml

@@ -33,6 +33,10 @@
                 <image src="{{imgUrl}}1588849129(1).png"/>
                 <text>我要报修</text>
             </view>
+            <view bindtap="woYaoTousu" class="item">
+                <image src="{{imgUrl}}1588849129(1).png"/>
+                <text>我要投诉</text>
+            </view>
             <view bindtap="jiaoFeiJiLuURL" class="item">
                 <image src="{{imgUrl}}1588849331(1).png"/>
                 <text>缴费记录</text>
@@ -40,6 +44,10 @@
             <view bindtap="baoXiuJiLuURL" class="item">
                 <image src="{{imgUrl}}1588849223(1).png"/>
                 <text>报修记录</text>
+            </view>
+            <view bindtap="tousuJiLuURL" class="item">
+                <image src="{{imgUrl}}1588849223(1).png"/>
+                <text>投诉记录</text>
             </view>
              <view bindtap="fanChanXinXiURL" class="item">
                 <image src="{{imgUrl}}1588919246(1).png"/>

+ 9 - 8
project.config.json

@@ -4,7 +4,7 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": true,
+    "urlCheck": false,
     "es6": true,
     "enhance": false,
     "postcss": true,
@@ -12,7 +12,7 @@
     "minified": true,
     "newFeature": false,
     "coverView": true,
-    "nodeModules": false,
+    "nodeModules": true,
     "autoAudits": false,
     "showShadowRootInWxmlPanel": true,
     "scopeDataCheck": false,
@@ -21,22 +21,23 @@
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
     "compileHotReLoad": false,
-    "useMultiFrameRuntime": true,
+    "useMultiFrameRuntime": false,
+    "useApiHook": false,
+    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
       "outputPath": ""
     },
-    "bundle": false,
+    "enableEngineNative": false,
     "useIsolateContext": true,
-    "useCompilerModule": false,
-    "userConfirmedUseCompilerModuleSwitch": false,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
-    "useApiHook": true,
-    "useApiHostProcess": true
+    "disableUseStrict": false,
+    "showES6CompileOption": false,
+    "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.11.0",