shigeshimao.static_title

固定名字,随机价格

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/440568/1021985/shigeshimaostatic_title.js

  1. let title = 'long sleeve cotton dress solid dress dress long sleeve long sleeve solid cotton '
  2. let count = 9;
  3. let min_price = 51;
  4. let max_price = 99;
  5.  
  6.  
  7. $(document).ready(function () {
  8. function set_price_list() {
  9. let gradient = (max_price - min_price) / 49;
  10.  
  11. function toDecimal(x) {
  12. var f = parseFloat(x);
  13. if (isNaN(f)) {
  14. return;
  15. }
  16. f = Math.round(x * 100) / 100;
  17. return f;
  18. }
  19.  
  20. let my_prices = []
  21. let my_price_list = localStorage.getItem("my_price_list");
  22. for (let i = 0; i < 50; i++) {
  23. my_prices[i] = toDecimal(min_price + i * gradient)
  24. }
  25. let my_value_str = JSON.stringify(my_prices);
  26. localStorage.setItem("my_price_list", my_value_str);
  27. return my_prices
  28. }
  29.  
  30. function get_flag() {
  31. let storage_name = "my_price_flag_list"
  32. let my_flag_list = localStorage.getItem(storage_name);
  33. if (my_flag_list === null) {
  34. let my_value_str = JSON.stringify([]);
  35. localStorage.setItem(storage_name, my_value_str);
  36. return 0;
  37. } else {
  38. //游标最大值为长度减一
  39. let local_value = JSON.parse(my_flag_list);
  40. let flag = local_value.length
  41. local_value[flag] = flag
  42. let my_value_str = JSON.stringify(local_value);
  43. localStorage.setItem(storage_name, my_value_str);
  44. return flag
  45. }
  46. }
  47.  
  48. let my_prices = set_price_list();
  49.  
  50. let urls = location.href
  51.  
  52.  
  53. if (urls.search('products/') > -1) {
  54. function faBuShangPin() {
  55. $(".btn-responsive")[0].click()
  56. }
  57.  
  58. faBuShangPin()
  59. } else if (urls.search('addproduct/') > -1) {
  60.  
  61. function add_goods() {
  62. $('tbody tr')[0].click()
  63. }
  64.  
  65. setTimeout(function () {
  66. add_goods()
  67. console.log("添加商品")
  68. }, 1000)
  69.  
  70. setTimeout(function () {
  71. $("#Name").val(title)
  72. $("#Name").trigger("change");
  73. $("#Price").val(my_prices[get_flag()])
  74. $("#Price").trigger("change");
  75. //价格
  76. }, 1500)
  77.  
  78. setTimeout(function () {
  79. $("input[type='checkbox'][id='SourceWarehouse_0']")[0].click()
  80. //选定国内仓
  81. }, 2000)
  82.  
  83. setTimeout(function () {
  84. let couy = $("input[name='WarehouseQuantity_0']")[0];
  85. $(couy).val(count)
  86. $(couy).trigger("change");
  87. //商品数量
  88. }, 2500)
  89.  
  90. setTimeout(function () {
  91. $($("button[id='SubmitProduct']")[0]).click()
  92. }, 3000)
  93.  
  94. }
  95.  
  96. })
  97. ;

QingJ © 2025

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