| | |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.userPhone != '' && row.userPhone != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.userPhone + '" onfocus="TUser.tooltip()">' + row.userPhone + '</p>'] |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + decryptAES(row.userPhone) + '" onfocus="TUser.tooltip()">' + decryptAES(row.userPhone) + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | |
| | | }; |
| | | |
| | | |
| | | TOrderLogistics.updateRecipient = function(){ |
| | | if(this.check()){ |
| | | var str = '<div class="row">\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label">收件人姓名</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input type="text" class="form-control" id="name">\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label">收件人电话</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input type="text" class="form-control" id="phone" >\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '修改收件人' |
| | | , area: ['200', '300'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出 |
| | | , content: '<div style="padding: 20px">' + str + '</div>' |
| | | , btn: ['确定','取消'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,yes: function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderLogistics/updateRecipient", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("修改成功"); |
| | | layer.closeAll(); |
| | | TOrderLogistics.search(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.setData({ |
| | | id: TOrderLogistics.seItem.id, |
| | | name: $('#name').val(), |
| | | phone: $('#phone').val() |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }); |
| | | var key = CryptoJS.enc.Utf8.parse("xqT86jictTPpHMem"); |
| | | var iv = CryptoJS.enc.Utf8.parse("xqT86jicxqT86jic"); |
| | | |
| | | //aes加密 |
| | | function encryptAES(context) { |
| | | if(null == context || '' == context){ |
| | | return context; |
| | | } |
| | | var encrypted = ''; |
| | | if (typeof(context) == 'string') { |
| | | |
| | | }else if(typeof(context) == 'object'){ |
| | | context = JSON.stringify(context); |
| | | } |
| | | var srcs = CryptoJS.enc.Utf8.parse(context); |
| | | encrypted = CryptoJS.AES.encrypt(srcs, key, { |
| | | iv: iv, |
| | | mode: CryptoJS.mode.CBC, |
| | | padding: CryptoJS.pad.Pkcs7 |
| | | }); |
| | | return encrypted.toString(); |
| | | } |
| | | // aes解密 |
| | | function decryptAES(context) { |
| | | if(null == context || '' == context){ |
| | | return context; |
| | | } |
| | | var decrypt = CryptoJS.AES.decrypt(context, key, { |
| | | iv: iv, |
| | | mode: CryptoJS.mode.CBC, |
| | | padding: CryptoJS.pad.Pkcs7 |
| | | }); |
| | | var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8); |
| | | return decryptedStr.toString(); |
| | | } |
| | | |
| | | |
| | |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['orderSource'] = $("#orderSource").val(); |
| | | queryData['userName'] = $("#userName").val(); |
| | | queryData['userPhone'] = $("#userPhone").val(); |
| | | queryData['userPhone'] = encryptAES($("#userPhone").val()); |
| | | queryData['recipient'] = $("#recipient").val(); |
| | | queryData['recipientPhone'] = $("#recipientPhone").val(); |
| | | queryData['driver'] = $("#driver").val(); |