<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ //圖片轉化成base64 //var img = "imgurl";//imgurl 就是你的圖片路徑 getBase64Image = function(img) { var canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; var ctx = canvas.getContext("2d"); ctx.drawImage(img, 0, 0, img.width, img.height); var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase(); var dataURL = canvas.toDataURL("image/" + ext); return dataURL; } //調用方法 // var image = new Image(); // image.src = img; // image.onload = function(){ // var base64 = getBase64Image(image); // console.log(base64); // } ~~~ ***** ~~~ //切割金額,超過萬和億則加萬和億的文字 cutmoney = function(money) { if (money >= 10000000) { money = parseFloat(money / 10000000) + '億'; } else if (money < 10000000 && money >= 10000) { money = parseFloat(money / 10000) + '萬'; } else { money = parseFloat(money); } return money; } ~~~ ***** ~~~ //判斷用戶名,如果沒有真實姓名則用用戶名 getname = function(name, turename) { var username = name; if (turename && turename != '' && turename != 'null') { username = turename; } return username; } ~~~ ***** ~~~ //判斷用戶頭像,如果為空則用默認頭像 getuserpic = function(useravatar) { //alert(useravatar); var userpic = '../image/default_user_portrait.gif'; if (useravatar && useravatar != '' && useravatar != 'null') { userpic = gip + 'data/upload/shop/avatar/' + useravatar; } return userpic; } ~~~ ***** ~~~ //轉換unix時間戳為年月日 turntime = function(ut) { var dateObj = new Date(ut * 1000); var UnixTimeToDate = dateObj.getUTCFullYear() + ' 年 ' + (dateObj.getUTCMonth() + 1 ) + ' 月 ' + dateObj.getUTCDate() + ' 日 '; return UnixTimeToDate; } ~~~ ***** ~~~ //轉換時間格式字符串為時間 turnDate = function(strDate) { var st = strDate; var a = st.split(" "); var b = a[0].split("-"); var c = a[1].split(":"); var date = new Date(b[0], b[1] - 1, b[2], c[0], c[1], c[2]); return date; } ~~~ ***** ~~~ //轉換unix時間戳為年月日小時分鐘 turntimemore = function(ut) { var dateObj = new Date(ut * 1000); var UnixTimeToDate = dateObj.getUTCFullYear() + ' 年 ' + (dateObj.getUTCMonth() + 1 ) + ' 月 ' + dateObj.getUTCDate() + ' 日 ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes(); return UnixTimeToDate; } ~~~ ***** ~~~ //去掉調用的null qunull = function(str) { if (!str || str == "null" || str == "Null" || typeof (str) == "undefined" || str == "undefined" || str == "NULL") { return ''; } else { return str; } } ~~~ ~~~ //獲取當前的日期時間 格式“yyyy-MM-dd HH:MM:SS” getnowDatetime = function() { var date = new Date(); var seperator1 = "-"; var seperator2 = ":"; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + " " + date.getHours() + seperator2 + date.getMinutes() + seperator2 + date.getSeconds(); return currentdate; } ~~~ ***** ~~~ //指定時間后的時間(特定格式) getnowDatetime1 = function(s) { var cdate = ''; cdate = new Date(new Date().getTime() + s); var month = cdate.getMonth() + 1; var strDate = cdate.getDate(); var strHour = cdate.getHours(); var strMinu = cdate.getMinutes(); var strSeco = cdate.getSeconds(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } if (strHour >= 0 && strHour <= 9) { strHour = "0" + strHour; } if (strMinu >= 0 && strMinu <= 9) { strMinu = "0" + strMinu; } if (strSeco >= 0 && strSeco <= 9) { strSeco = "0" + strSeco; } var currentdate = cdate.getFullYear() + month + strDate + strHour + strMinu + strSeco; //alert(currentdate); return currentdate; } ~~~ ***** ~~~ //獲取當前的日期 格式“yyyy-MM-dd” getnowDate = function() { var date = new Date(); var seperator1 = "-"; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate; return currentdate; } ~~~ ***** ~~~ //獲取指定的日期 格式“yyyy-MM-dd” getoldDate = function(ot) { var date = new Date(ot); var seperator1 = "-"; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate; return currentdate; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看