Browse Source

优化代码

master
453530270@qq.com 2 years ago
parent
commit
01e2e67cd2
  1. 20
      pages/index/index.vue

20
pages/index/index.vue

@ -180,7 +180,7 @@
.then(res=>{ .then(res=>{
// //
const newList = app.initList(res.data) const newList = app.initList(res.data)
console.log(newList,"newlist") // console.log(newList,"newlist")
app.gdlist.data = getMoreListData(newList, app.gdlist, pageNo) app.gdlist.data = getMoreListData(newList, app.gdlist, pageNo)
resolve(newList) resolve(newList)
}) })
@ -212,10 +212,6 @@
initList(newList) { initList(newList) {
newList.data.forEach(item => { newList.data.forEach(item => {
item.gdimg = pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'}) item.gdimg = pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'})
// console.log(bytarr)
// item.gdimg = "data:image/png;base64,"+decompress(bytarr)
//item.gdimg="ss"
//item.username = item.user.name
}) })
return newList return newList
}, },
@ -223,18 +219,20 @@
// //
onRefreshList() { onRefreshList() {
this.gdlist = getEmptyPaginateObj() this.gdlist = getEmptyPaginateObj()
setTimeout(() => { setTimeout(() => {
this.mescroll.resetUpScroll() this.mescroll.resetUpScroll()
}, 120) }, 120)
}, },
/**
* 跳转商品详情页
*/
onTargetGoods(gislicode) {
this.$navTo(`pages/goods/detail`, { gislicode })
}
}, },
// moune
} }
</script> </script>

Loading…
Cancel
Save