WxApp/page/component/index.js

39 lines
756 B
JavaScript
Raw Normal View History

2024-08-29 14:36:16 +08:00
Page({
data: {
imgUrls: [
'/image/b1.jpg',
'/image/b2.jpg',
'/image/b3.jpg'
],
indicatorDots: false,
autoplay: false,
interval: 3000,
duration: 800,
goods: {
id: 1,
image: [
'/image/beizi1.jpg',
'/image/beizi1.jpg'
],
title: '床上用品六件套',
price: 220,
detail: '被子、褥子、枕头、三件套',
},
},
onLoad() {
var self = this;
/**
* 发起请求获取商品列表信息
*/
wx.request({
// get请求
2024-08-29 23:54:16 +08:00
url: 'http://localhost:8080/goods/loadData',
2024-08-29 14:36:16 +08:00
success(res) {
self.setData({
2024-08-29 23:54:16 +08:00
goods: res.data.data
2024-08-29 14:36:16 +08:00
})
2024-08-29 23:54:16 +08:00
console.log(res,'res',res.data.data)
2024-08-29 14:36:16 +08:00
}
})
},
})