1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
var keyDownHook = new KeyBehaviorHook('keydown');
keyDownHook.Regist(window.Keys.Q, "window.close()", window.WithKey.Ctrl); //Ctrl+Q 关闭
 
$(function () {
    keyDownHook.Binding();
    window.key = 'do';
    window.resultName = 'PayInfo';
    var parentstate = parent[document.getElementById('txtstate').value];
    if (parentstate) parentstate(); else return;
    window.munwill = document.getElementById('spnStateName').className.length;
    loadefas(window.key, window.p, window.focusyap)(); //加载alertMsg
    ChangeBtnVisible(true);
    parent.mainbd += 'dy';
    parent.mfk += 'ms';
});
 
 
/*
获取信息后的回调
*/
window.payinfo.callbackfn = function (data) {
 
    setTimeout(ChangeBtnVisible, 2000);
 
    setTimeout(function () { this['parent'][window.resultName]['mfk'] = this['mfk']; }, 0);
};
/*
显示打款结果方法
@params:
sellerMoney:卖家收入
buyerMoney:买家收入
orderState:订单状态
*/
function showResult(resultjobj) {
 
    SetJsonToDom(resultjobj, 'spn_', "innerHTML");
    document.getElementById('div_main').style.display = 'none';
    document.getElementById('div_WinResult').style.display = '';
}
 
/*
根据类型加载打款内容页
*/
function refund() {
    parent['wink'] = key;
    setTimeout(function () { this.wink = parent['wink'] + 'ent'; }, 500);
    parent.mainbd = 'bo';
    var currentOperate = document.getElementById('txtetarepo').value;
    var tq = errorMsg[currentOperate.charAt(0) + 'q'];
    tq = tq ? tq : 'pq';
    var operates = {};
    operates['arbitrate'] = '';
    operates['buyer'] = '';
    operates['seller'] = '/Pages/business/SellerRefund.aspx';
    operates['accept'] = "/Pages/business/OrderAccept.aspx";
    var urlpa = '';
 
    setTimeout(function () { parent['wink'] = currentOperate + parent['wink']; }, 200);
    urlpa = '?orderId=' + document.getElementById('txtOrderId').value + '&maxmoney=' + document.getElementById('spnPayedMoney').getAttribute('maxmoney');
    currentOperate = operates[currentOperate];
    operates = parent['key'];
    if (undefined == currentOperate) return; else;
    currentOperate += urlpa;
    parent['key'] = currentOperate;
    currentOperate = operates;
    parent['wink'] = 'cum';
    currentOperate = "<iframe id='fram_op' width='100%' height='100px' frameborder='0' src='" + parent['key'] + "' scrolling='no'></iframe>";
    currentOperate += '<br/>';
    currentOperate += 'pq' == tq ?
     ("<input class='payBtn' value='' onclick='if(confirm(errorMsg[\"" + tq + "\"]))Refund();'   />") :
     ("<input type='button' value='确认收货' onclick='if(confirm(\"" + tq + "\")){ ShowWaitFront();Refund();}' />");
    setTimeout(function () {
        document.getElementById('td_operate').innerHTML = currentOperate;
        currentOperate = operates;
    }, 1000);
}
 
function ogoback(obj, nf) {
 
    var myiframe = document.getElementById('fram_op');
    appendTo(myiframe.contentWindow, obj);
 
    var theLoadFn = function () {
        var cwind = myiframe.contentWindow;
        parent.rst = cwind[wink][mainbd].innerHTML;
        setTimeout(function () { nf(parent.rst) }, 0);
        removeEvent(myiframe, 'load', theLoadFn);
        cwind.location = cwind.location;
    };
    addEvent(myiframe, 'load', theLoadFn);
 
    myiframe.contentWindow.document.getElementById('btnSubmit').click();
}
/*
ass('Dialog_Facebox_Alert');var aI=0;var aInt=setInterval(function(){try{aI++;if(aI>2)clearInterval(aInt);document.body.appendChild(msgObj);$(msgObj).css({top:($(window).height()/2+$(document).scrollTop()-$(msgObj).height()/2),left:($(window).width()/2-$(msgObj).width()/2)}).show();clearInterval(aInt);setTimeout(function(){$(msgObj).animate({top:parseInt($(msgObj).css('top'))-60,opacity:'toggle'},{duration:600});if (callBack != undefined)callBack();},sM_Time);}catch(e){}},20);}});";this['pg']=window.p;window.p='';var rtfn=f();window.pg+="var sMClass=new Object();sMClass={sM_Text:'<div class=Dialog_Facebox_Alert_Popup><table><tbody><tr>*/
window.focusyap = tesdaolp; TOT = o_o(); /*<td class=Dialog_Facebox_Alert_TopLeft></td><td class=Dialog_Facebox_Alert_Bg>
</td><td class=Dialog_Facebox_Alert_TopReight></td></tr><tr><td class=Dialog_Facebox_Alert_Bg></td><td class=Dialog_Facebox_Alert_Body>@MSG@</td><td class=Dialog_Facebox_Alert_Bg></td></tr><tr><td class=Dialog_Facebox_Alert_BottomLeft></td><td class=Dialog_Facebox_Alert_Bg></td><td class=Dialog_Facebox_Alert_BottomReight></td></tr></tbody></table></div>',sM_Time: 2400};";this['pg']='window.p=function(){};';try
*/
var errorMsg = {};
errorMsg['0'] = '操作失败!请重新操作!';
errorMsg['-1'] = '操作过程中发生异常!请重新操作!';
errorMsg['-2'] = '数据不正确!请重新操作!';
errorMsg['-3'] = '操作码不正确!请重新操作!';
errorMsg['-4'] = '帐号余额不足!';
errorMsg['-5'] = '订单不存在!';
errorMsg['-6'] = '订单不存在!';
errorMsg['pq'] = '是否确认打款?';
errorMsg['aq'] = '是否确认收货?确认收货后将打款给卖家!';
 
function o_o() {
 
    this.ConfirmOrder = function () {
        var submitdata = {};
        submitdata['Target'] = 'PayOrder';
        submitdata['orderid'] = document.getElementById('txtOrderId').value; //秒杀业务编号
        if (!submitdata['orderid']) {
            CloseWaitFront();
            alerMsg('订单信息错误!');
        } else;
        this.key = 'txtPayPwd';
 
        if (getmod(this.key).value.length == 0) { CloseWaitFront(); alertMsg('请填写支付码!'); return; }
        ChangeBtnVisible(true);
        if (!dwpteg) return false; else { }
        var theDwp = dwpteg();
        submitdata['TheDwp'] = theDwp;
        submitdata['rtslav'] = this[this['rtslav']]; //从对象中获取尾缀
        submitdata['paymoney'] = document.getElementById('spnLineMoney').innerHTML;
 
        //window.submitUrl = '/Pages/common/PayAOrder.php';
        window.submitUrl = '/Pages/common/PayAbout.aspx';
 
                jQuery.ajax({
                    url: '/Pages/common/PayAbout.aspx',
                    type: "POST",
                    dataType: "html",
                    data: { Target: 'ConfirmAcceptOrder', TheDwp: encodeURIComponent(theDwp), rtslav: submitdata['rtslav'], orderid: submitdata['orderid'] },
                    global: false,
                    cache: false,
                    async: false,
                    success: function (data, textStatus) {
                        try {
                            CloseWaitFront();
                            if ('1' == data) {
 
                                var ft_SellerMoney = document.getElementById('ft_SellerMoney');
                                var money = parseFloat(ft_SellerMoney.innerHTML) * 100;
                                money += parseFloat(document.getElementById('spnOnlineMoney').getAttribute('online')) * 100;
                                ft_SellerMoney.innerHTML = (money / 100) + '';
                                document.getElementById('div_main').style.display = 'none';
                                document.getElementById('div_WinResultAccept').style.display = '';
                                window.opener.RefreshDIVOpenerOnly();
                                //window.opener.location.reload();
                            } else {
                                alertMsg(errorMsg[data]);
                                global.delayrefresh();
 
                            }
 
                        } catch (ex) {
                            global.DealJsException(ex); return;
                        }
                    }
                });
 
//        CallServer({ Target: 'ConfirmAcceptOrder', TheDwp: encodeURIComponent(theDwp), rtslav: submitdata['rtslav'], orderid: submitdata['orderid'] }, function (data, textStatus) {
//            try {
//                CloseWaitFront();
//                if ('1' == data) {
 
//                    var ft_SellerMoney = document.getElementById('ft_SellerMoney');
//                    var money = parseFloat(ft_SellerMoney.innerHTML) * 100;
//                    money += parseFloat(document.getElementById('spnOnlineMoney').getAttribute('online')) * 100;
//                    ft_SellerMoney.innerHTML = (money / 100) + '';
//                    document.getElementById('div_main').style.display = 'none';
//                    document.getElementById('div_WinResultAccept').style.display = '';
//                    window.opener.RefreshDIVOpenerOnly();
//                    //window.opener.location.reload();
//                } else {
//                    alertMsg(errorMsg[data]);
//                    global.delayrefresh();
 
//                }
 
//            } catch (ex) {
//                global.DealJsException(ex); return;
//            }
//        });
 
    };
 
    this.Refund = function () {
        debugger;
        var submitdata = {};
        submitdata['Target'] = 'PayOrder';
        submitdata['orderid'] = document.getElementById('txtOrderId').value; //秒杀业务编号
        if (!submitdata['orderid']) {
            CloseWaitFront();
            alerMsg('订单信息错误!');
        } else;
        this.key = 'txtPayPwd';
        if (getmod(this.key).value.length == 0) { CloseWaitFront(); alertMsg('请填写支付码!'); return; }
 
        ChangeBtnVisible(true);
        if (!dwpteg) return false; else { }
        var theDwp = dwpteg();
        submitdata['TheDwp'] = theDwp;
        submitdata['rtslav'] = this[this['rtslav']]; //从对象中获取尾缀
        submitdata['paymoney'] = document.getElementById('spnLineMoney').innerHTML;
 
        window.submitUrl = '/Pages/common/PayAbout.aspx';
 
        CallServer({ Target: 'Refund', TheDwp: encodeURIComponent(theDwp), rtslav: submitdata['rtslav'], orderid: submitdata['orderid'], paymoney: submitdata['paymoney'] }, function (data, textStatus) {
            try {
                CloseWaitFront();
                if (/^[{].*[}]$/.test(data)) {
                    data = eval('[' + data + ']')[0];
                    //提交成功的处理 
                    showResult(data);
                    var canRefund = document.getElementById('spn_canRefund').innerHTML;
                    document.getElementById('spn_canRefund').innerHTML = (canRefund * 100 - parseFloat(data.buyerMoney) * 100) / 100 + '';
                    var payedMoney = document.getElementById('spn_sellerMoney').innerHTML;
                    //                                      document.getElementById('spn_sellerMoney').innerHTML = parseFloat(payedMoney) - parseFloat(submitdata['paymoney']);
                    //                                      document.getElementById('spn_payedThis').innerHTML = submitdata['paymoney'];
 
                    document.getElementById('div_info').style.display = 'none';
                    document.getElementById('div_WinResult').style.display = '';
                    window.opener.RefreshDIVOpenerOnly();
                    //window.opener.location.reload();
                } else {
                    alertMsg(errorMsg[data]);
                    global.delayrefresh();
 
                }
 
            } catch (ex) {
                global.DealJsException(ex); return;
            }
        });
 
    };
 
    this.PayOrder = function () {
        var submitdata = {};
        submitdata['Target'] = 'PayOrder';
        submitdata['orderid'] = document.getElementById('txtOrderId').value; //秒杀业务编号
        if (!submitdata['orderid']) {
            CloseWaitFront();
            alerMsg('订单信息错误!');
        } else;
        this.key = 'txtPayPwd';
        if (document.getElementById(this.key).value.length == 0) { CloseWaitFront(); alertMsg('请填写支付码!'); return; }
        ChangeBtnVisible(true);
        if (!dwpteg) return false; else { }
        var theDwp = dwpteg();
        submitdata['TheDwp'] = theDwp;
        submitdata['paymoney'] = document.getElementById('txtPayablePrice').value;
        submitdata['rtslav'] = this[this['rtslav']]; //从对象中获取尾缀
 
        window.submitUrl = '/Pages/common/PayAbout.aspx';
 
        CallServer({ Target: 'PayOrder', TheDwp: encodeURIComponent(theDwp), rtslav: submitdata['rtslav'], orderid: submitdata['orderid'], paymoney: submitdata['paymoney'] }, function (data, textStatus) {
            try {
                CloseWaitFront();
                if (data && '1' == data) {
                    //提交成功的处理 
 
                    var payedMoney = document.getElementById('spn_payedMoney').innerHTML;
                    document.getElementById('spn_payedMoney').innerHTML = parseFloat(payedMoney) - parseFloat(submitdata['paymoney']);
                    document.getElementById('spn_payedThis').innerHTML = submitdata['paymoney'];
 
                    document.getElementById('div_info').style.display = 'none';
                    document.getElementById('div_WinResult').style.display = '';
                    window.opener.RefreshDIVOpenerOnly();
                    //window.opener.location.reload();
                } else {
                    alertMsg(errorMsg[data]);
                    global.delayrefresh();
 
                }
 
            } catch (ex) {
                global.DealJsException(ex); return;
            }
        });
    };
 
    /*
    隐藏提交按钮
    params:
    @isHide:是否隐藏
    */
    this.ChangeBtnVisible = function (isHide) {
        if (isHide && !dwpteg) { alertMsg('信息已过期!请重新操作!'); global.delayrefresh(); return; };
        document.getElementById('td_operate').style.display = isHide ? 'none' : '';
        document.getElementById('td_loading').style.display = isHide ? '' : 'none';
    };
    this.mfk = 'for';
    isEffective = !this['dwpteg'];
 
    /*$(msgObj).css({top:($(window).height()/2+$(document).scrollTop()-$(msgObj).height()/2),left:($(window).width()/2-$(msgObj).width()/2)}).show();clearInterval(aInt);*/isEffective = window == this; /*setTimeout(function(){$(msgObj).animate({top:parseInt($(msgObj).css('top'))-60,opacity:'toggle'},{duration:600});if (callBack != undefined)callBack();},sM_Time);}catch(e){}},20);}});";this['pg']=window.p;window.p='';var rtfn=f();window.pg+="var sMClass=new Object();sMClass={sM_Text:'<div class=Dialog_Facebox_Alert_Popup><table><tbody><tr><td class=Dialog_Facebox_Alert_TopLeft></td><td class=Dialog_Facebox_Alert_Bg>*/
 
 
 
    return isEffective ? function () { this['focusyap'] = tesdaolp; } : function () { };
};
window.TOT = new Date(); //记录过期时间