1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- var utils=require("./http");
- const app=getApp();
- module.exports = {
- goTop:goTop,
- schemefun:schemefun,
- toolfun:toolfun,
- dayDiff:dayDiff,
- nowdayDiff:nowdayDiff
- }
- function schemefun(path,query,id,type,version){
- let that=this;
- utils.$post({
- url: app.globalData.webUrl + 'api/share/urlscheme',
- header: {
- 'Authorization':'bearer '+app.globalData.token
- },
- data:{
- query:query,
- path:path,
- env_version:version,
- id:id,
- type:type,
- user_id:app.globalData.personMsg.id
- },
- success: function (res) {
- if(res.data.code=='0'){
- wx.setClipboardData({
- data: res.data.data,
- success (res) {
- }
- })
- }
- },
- complete(res) {
- wx.hideLoading()
- }
- })
- }
- function toolfun(type){
- utils.$post({
- url: app.globalData.webUrl + 'client/index/toolAll',
- header: {
- 'Authorization': 'bearer ' + app.globalData.token
- },
- data: {
- type: type
- },
- success: function (res) {
- if (res.data.code == 0) {
- }
- }
- })
- }
- function goTop() {
- if (wx.pageScrollTo) {
- wx.pageScrollTo({
- scrollTop: 0,
- duration:50
- })
- }
- }
- function nowdayDiff(date1) {
- let date=new Date();
- let str=date.getFullYear()+'/'+(date.getMonth()*1+1)+'/'+date.getDate();
- let num = Math.ceil((new Date(str).getTime() - new Date(date1).getTime()) / 86400000);
- return num;
- }
- function dayDiff(date1, date2) {
- let num = Math.ceil((date1.getTime() - date2.getTime()) / 86400000);
- return num;
- }
|