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.

51 lines
1.0 KiB

// miniprogram/pages/more/more.js
const db = wx.cloud.database();
Page({
/**
* 页面的初始数据
*/
data: {
list:[]
},
sliderto:function(e){
var url=e.currentTarget.dataset.url
wx.navigateTo({
url: '/pages/webview/webview?url=' + url,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const that = this;
wx.showLoading({
title: '加载中',
})
if(options.model){
var list = JSON.parse(options.model)
this.setData({
list: list
})
wx.hideLoading();
return
}
db.collection('recommend').orderBy('index','asc').where({
isfirst:options.isfirst
}).get({
success: function(res) {
// res.data 是一个包含集合中有权限访问的所有记录的数据,不超过 20 条
console.log(res.data)
that.setData({
list: res.data
})
wx.hideLoading();
}
})
},
gotocompete:function(e){
},
})