小程序
小游戏
企业微信
微信支付
扫描小程序码分享
主页js代码是这样的(代码放不上来只能截图了):
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
谢邀,看下utils/util这个文件,是否没有公开出来。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
const app = getApp();
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
// 向服务器发送post请求
function postByJson(url, data, withCookie, cbOK, cbNo) {
wx.request({
url: 'http://localhost:10243' + url,
method: 'POST',
header: {
"Cookie": withCookie ? app.globalData.loginInfo.cookie : null
},
data: data,
success: cbOK,
fail: cbNo,
});
module.exports = {
formatTime: formatTime,
postByJson: postByJson
应该是getViewData有问题
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
谢邀,看下utils/util这个文件,是否没有公开出来。
const app = getApp();
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
// 向服务器发送post请求
function postByJson(url, data, withCookie, cbOK, cbNo) {
wx.request({
url: 'http://localhost:10243' + url,
method: 'POST',
header: {
"Cookie": withCookie ? app.globalData.loginInfo.cookie : null
},
data: data,
success: cbOK,
fail: cbNo,
});
}
module.exports = {
formatTime: formatTime,
postByJson: postByJson
}
应该是getViewData有问题