小程序
小游戏
企业微信
微信支付
扫描小程序码分享
请求教,缓存问题怎么解决~
8 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
谢谢谢谢
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你这数据都是concat起来的啊
还有你这几个变量都没定义也没报错么
textares = textares.concat(res.data.data[0].content[0].data)
idg = idg.concat(res.data.data[0].id)
upic = upic.concat(res.data.data[0].upic)
console.log(
'idg'
, idg)
author = author.concat(res.data.data[0].author)
time = time.concat(res.data.data[0].time)
onLoad:
function
(e) {
var
that =
this
;
wx.getStorage({
key:
' '
,
success:
(res) {
upsum = res.data
console.log(upsum)
that.setData({
count: upsum
})
}
'jsopenid'
// success
console.log(res)
'openid'
, res.data)
openid = res.data
wx.request({
url:
'https://www.wandumd.com/apiapp.php?s=apiapp/article/getMemberInfo'
data: {
openid: openid
},
method:
'GET'
"业主res:"
, res.data.data[0])
if
(res.data.code == 200) {
hasLocation:
true
locationAddress: res.data.data[0].residential_name
//获取首页显示
wx.getUserInfo({
'所有的001'
, res)
'昵称001'
, res.userInfo.nickName)
'图片001'
, res.userInfo.avatarUrl)
nickname = res.userInfo.nickName
pic = res.userInfo.avatarUrl
'https://www.wandumd.com/apiapp.php?s=apiapp/article/index'
openid: openid,
nickname: nickname,
//昵称
pic: pic
//头像
// OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
'金额:'
, res.data.data[0].money)
'内容:'
, res.data.data[0].content[0].data)
'作者:'
, res.data.data[0].author)
'pic:'
, res.data.data[0].upic)
money = money.concat(res.data.data[0].money)
titles = titles.concat(res.data.data[0].title)
(res.data.data[0].vote == 1) {
show =
""
usum = res.data.data[0].up
dsum = res.data.data[0].down
(usum ==
null
) usum = 0
(dsum ==
) dsum = 0
else
{
"none"
//console.log('值:',time)
wx.setStorage({
'gonggaoid'
data: idg,
titles: titles,
textares: textares,
id: idg,
author: author,
money: money,
time: time,
upic: upic,
toshow: show,
count: usum,
counts: dsum
'type'
, type)
//获取设备宽高
wx.getSystemInfo({
winWidth: res.windowWidth,
winHeight: res.windowHeight,
});
//调用应用实例的方法获取全局数据
app.getUserInfo(
(userInfo) {
//更新数据
'pic'
, userInfo.avatarUrl)
'nickname'
, userInfo.nickName)
pic = userInfo.avatarUrl,
nickname = userInfo.nickName,
userInfo: userInfo
要么你把代码发出来 要么你加我wx我帮你看看
这是为什么呢?从上一任程序员接手过来的,这个问题一直找不到解决方法
不能,你代码有问题
就是退出小程序在进入,数据就不断叠加叠加
怎么个缓存再说细点
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
谢谢谢谢
你这数据都是concat起来的啊
还有你这几个变量都没定义也没报错么
textares = textares.concat(res.data.data[0].content[0].data)
idg = idg.concat(res.data.data[0].id)
upic = upic.concat(res.data.data[0].upic)
console.log(
'idg'
, idg)
author = author.concat(res.data.data[0].author)
time = time.concat(res.data.data[0].time)
onLoad:
function
(e) {
var
that =
this
;
wx.getStorage({
key:
' '
,
success:
function
(res) {
upsum = res.data
console.log(upsum)
that.setData({
count: upsum
})
}
})
wx.getStorage({
key:
'jsopenid'
,
success:
function
(res) {
// success
console.log(res)
console.log(
'openid'
, res.data)
openid = res.data
wx.request({
url:
'https://www.wandumd.com/apiapp.php?s=apiapp/article/getMemberInfo'
,
data: {
openid: openid
},
method:
'GET'
,
success:
function
(res) {
console.log(
"业主res:"
, res.data.data[0])
if
(res.data.code == 200) {
that.setData({
hasLocation:
true
,
locationAddress: res.data.data[0].residential_name
})
}
}
})
//获取首页显示
wx.getUserInfo({
success:
function
(res) {
console.log(
'所有的001'
, res)
console.log(
'昵称001'
, res.userInfo.nickName)
console.log(
'图片001'
, res.userInfo.avatarUrl)
var
nickname = res.userInfo.nickName
var
pic = res.userInfo.avatarUrl
wx.request({
url:
'https://www.wandumd.com/apiapp.php?s=apiapp/article/index'
,
data: {
openid: openid,
nickname: nickname,
//昵称
pic: pic
//头像
},
method:
'GET'
,
// OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
success:
function
(res) {
// success
console.log(
'金额:'
, res.data.data[0].money)
console.log(
'内容:'
, res.data.data[0].content[0].data)
console.log(
'作者:'
, res.data.data[0].author)
console.log(
'pic:'
, res.data.data[0].upic)
money = money.concat(res.data.data[0].money)
titles = titles.concat(res.data.data[0].title)
textares = textares.concat(res.data.data[0].content[0].data)
idg = idg.concat(res.data.data[0].id)
upic = upic.concat(res.data.data[0].upic)
console.log(
'idg'
, idg)
author = author.concat(res.data.data[0].author)
time = time.concat(res.data.data[0].time)
if
(res.data.data[0].vote == 1) {
var
show =
""
var
usum = res.data.data[0].up
var
dsum = res.data.data[0].down
if
(usum ==
null
) usum = 0
if
(dsum ==
null
) dsum = 0
}
else
{
var
show =
"none"
}
//console.log('值:',time)
wx.setStorage({
key:
'gonggaoid'
,
data: idg,
})
that.setData({
titles: titles,
textares: textares,
id: idg,
author: author,
money: money,
time: time,
upic: upic,
toshow: show,
count: usum,
counts: dsum
})
}
})
}
})
console.log(
'type'
, type)
}
})
//获取设备宽高
wx.getSystemInfo({
success:
function
(res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight,
});
}
});
//调用应用实例的方法获取全局数据
app.getUserInfo(
function
(userInfo) {
//更新数据
console.log(
'pic'
, userInfo.avatarUrl)
console.log(
'nickname'
, userInfo.nickName)
pic = userInfo.avatarUrl,
nickname = userInfo.nickName,
that.setData({
userInfo: userInfo
})
})
}
要么你把代码发出来 要么你加我wx我帮你看看
这是为什么呢?从上一任程序员接手过来的,这个问题一直找不到解决方法
不能,你代码有问题
就是退出小程序在进入,数据就不断叠加叠加
怎么个缓存再说细点