vc自动加收货人名/字数最多输入500字

try to take over the world!

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

// ==UserScript==
// @name         vc自动加收货人名/字数最多输入500字
// @namespace    http://tampermonkey.net/
// @version      4.4
// @description  try to take over the world!
// @author       You
// @match        https://pdropship.jd.com/orderManage/initListPage
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
var anniu=`<button type="button"style="float: right;"  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 zsxz=`<button type="button"style="float: right;" id="zsxz"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-image"></span>
// <span class="pui-button-text">突破字数限制</span>
// </button>`
    var kefu = "涵";
    var timer3 = "";
    var ccc=''
    let mt={
        "width":"100%",
        "margin-left":"0px"
    }
    let _none={
        "display":"none",

    }
    let tit={
        "background":"rgba(255, 255, 255,0.2)",
        "border-bottom": "1px solid #cfcfcf",
        "text-align": "center",
        "height": "34px",
        "line-height": "34px",
        "border": "0px",
        "font-size": "18px"
    }
    let addremark={
        "border-radius":"3px",
        "outline":"0",
        "background":"#e8ebf1",
        "box-shadow":"inset 5px 5px 4px #e1e4ea,inset -5px -5px 4px #eff2f8",
        "width": "585px",
        "height": "190px",
        "margin-left":"0",
        "padding": "10px",
        "resize":"none",

    }
      let remarkWin={
          "background-image": "linear-gradient(to top, #e6e9f0 0%, #eef1f5 100%)",
          "box-shadow": "rgb(121 122 125) 5px 5px 12px, rgb(255 255 255) -5px -5px 12px",

      }
      let btn={
          "box-shadow": "5px 5px 10px #dfe2e7, -5px -5px 10px #f1f4fb",
          "border": "0px",
           "background": "#fff"
      }
      let hov={
          "box-shadow":"inset 5px 5px 10px #dfe2e7,inset -5px -5px 10px #f1f4fb!important"
      }

 timer3=setInterval(func1,1000)

    function func1() {
        if( $(".pui-dialog-buttonpane").length>7){
            clearInterval(timer3)
            console.log("找到了了")
            $(".pui-dialog-buttonpane").eq(5).append(anniu)
//             $(".pui-dialog-buttonpane").eq(5).append(zsxz)
            $("#addRemark").eq(0).attr("maxlength","500");
            $("#addRemark").eq(0).attr("placeholder","最多能输入500个字");
            $("#mytable").css(mt)
            $("#idTable").css(_none)
            $("#doAddCarrierForm>div>div>div").css(_none)
            $("#mytable tr").eq(0).css(_none)
            $("#remarkWin div").eq(0).css(tit)
            $("#remarkWin_label").css({"float":" none","margin": "0px"})
            $(".pui-dialog-titlebar-maximize").eq(5).css(_none)
            $(".pui-dialog-titlebar-minimize").eq(5).css(_none)
            $("#addRemark").css(addremark)
            $("#remarkWin").css(remarkWin)
            $("#mytable tr").eq(2).css(_none)
            $(".pui-dialog-buttonpane").eq(5).css("background","rgba(255, 255, 255,0.2)")
            $(".pui-dialog .pui-dialog-buttonpane button").css(btn)
            $(".ui-state-hover").css(hov)
        }
//         $("#zsxz").click(function(){
//             $("#addRemark").eq(0).attr("maxlength","-1");
//             $("#addRemark").eq(0).attr("placeholder","输入多少个字都可以");
//           })


        $("#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
                let pinming=data.rows[0].orderDetailList[0].wareName.indexOf("桌垫") //如果大于0 就是桌垫

                if(pinming>=0){
                    if( $('#addRemark').val().indexOf("桌垫可定制:")>0){

                      let bz= $('#addRemark').val()

                      let shan_zd=  bz.replace("桌垫可定制:",'').replace(kefu,'').replace(user,'').replace(',','');
                         $('#addRemark').val(shan_zd)
                    }else{
                      $('#addRemark').val(user+',桌垫可定制:'+remark+' '+kefu)
                    }

                }else{
                     if( $('#addRemark').val().indexOf("可定制:")>0){
                      let bz= $('#addRemark').val()
                      let shan_zd=  bz.replace("可定制:",'').replace(kefu,'').replace(user,'').replace(',','');
                         $('#addRemark').val(shan_zd)
                    }else{
                      $('#addRemark').val(user+',可定制:'+remark+' '+kefu)
                    }
                }
                console.log(user)
            })
        })
        }

    // Your code here...














})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址