vc后台写备注时自动加收货人名

try to take over the world!

目前為 2021-03-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name         vc后台写备注时自动加收货人名
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       qq806350554
// @match        https://pdropship.jd.com/orderManage/initListPage
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

var anniu=`<button type="button" id="add_name"class="pui-button ui-widget ui-state-default ui-corner-all pui-button-text-icon-left" role="button" aria-disabled="false">
<span class="pui-button-icon-left ui-icon ui-icon-key"></span>
<span class="pui-button-text">添加收货人</span>
</button>`

    var timer3 = "";
    var timer2 = "";
    var ccc=''
 timer3=setInterval(func1,1000)

    function func1() {
        if( $(".pui-dialog-buttonpane").length>7){
        clearInterval(timer3)
             console.log("找到了了")
            $(".pui-dialog-buttonpane").eq(5).append(anniu)

        }
        $("#add_name").click(function(){
            var user='1'
            var remark=   $('#addRemark').val()
            var _id= $("#tr_1").text()
            $.get("https://pdropship.jd.com/outBound/outboundList?orderIdList=&orderId="+_id,function(data){
                user=data.rows[0].customerName

                $('#addRemark').val(user+' '+remark)
                console.log(user)

            })

        })

        }

    // Your code here...














})();