1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/goeasy-io-GoEasyDemo-wxapp-Helloworld

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
app.js 2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
BettyWbb Отправлено 28.04.2022 10:42 f607fd5
//app.js
import GoEasy from './utils/goeasy-2.4.6.min.js';
App({
globalData: {
goEasy: GoEasy.getInstance({
host:"hangzhou.goeasy.io",//应用所在的区域地址: 【hangzhou.goeasy.io |singapore.goeasy.io】
appkey:"BC-xxxx",// common key
modules: ['pubsub']
})
},
onLaunch: function () {
this.extendDateFormat();
//建立连接
this.globalData.goEasy.connect({
onSuccess: function () {
console.log("GoEasy connect successfully.")
},
onFailed: function (error) {
console.log("Failed to connect GoEasy, code:" + error.code + ",error:" + error.content);
wx.showModal({
icon: "none",
title: error.code.toString(),
content: error.content,
showCancel: false,
duration: 6000
});
},
onProgress: function (attempts) {
console.log("GoEasy is connecting", attempts);
}
});
},
extendDateFormat() {
Date.prototype.formatDate = function (fmt) {
var o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds()
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (o.hasOwnProperty(k)) {
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
return fmt;
};
}
})

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/goeasy-io-GoEasyDemo-wxapp-Helloworld.git
git@api.gitlife.ru:oschina-mirror/goeasy-io-GoEasyDemo-wxapp-Helloworld.git
oschina-mirror
goeasy-io-GoEasyDemo-wxapp-Helloworld
goeasy-io-GoEasyDemo-wxapp-Helloworld
2.4