You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
814 B

Page({
data: {
goodsList: [{
_id: '1',
title: '商品1',
price: 1,
}],
},
onLoad() {
// this.fetchGoodsList();
},
async fetchGoodsList() {
this.setData({ isLoading: true });
const res = await wx.cloud.callFunction({
name: 'quickstartFunctions',
data: { type: 'fetchGoodsList' },
});
const goodsList = res?.result?.dataList || [];
this.setData({
isLoading: false,
goodsList
});
},
async generateMPCode() {
wx.showLoading();
const resp = await wx.cloud.callFunction({
name: 'quickstartFunctions',
data: {
type: 'genMpQrcode',
pagePath: 'pages/goods-list/index',
}
});
this.setData({ codeModalVisible: true, codeImageSrc: resp?.result });
wx.hideLoading();
},
});