
const db = wx.cloud.database()const _ = db.commandPage({
/** * 页面的初始数据 */data: {array: [],index: 0,ant: []},search: function(e){var a = e.detail.valuevar that = thisdb.collection('users').where({name: a}).get().then(res=>{if(res.data[0]){that.setData({ant: res.data})}else{db.collection('users').where({code: a}).get().then(res=>{that.setData({ant: res.data})})}})},getdetail: function(e){var that = thisvar id = e.currentTarget.idwx.navigateTo({url: '../databaseGuide/databaseGuide?id='+id,})},reload: function(){var that = this wx.showModal({title: '提示',content: '确定吗?',success: function(e){if(e.confirm){wx.cloud.callFunction({name: 'demo',data:{ant: 1},success: function(e){wx.showToast({title: '成功',})}})}}})},getit: function(e){var that = thisthis.setData({index: e.detail.value})db.collection('users').where({zy: that.data.array[that.data.index]}).get().then(res=>{that.setData({ant: res.data})})},onLoad: function (options) {var that = thisdb.collection('users').where({zy: '安康学院'}).get().then(res => {that.setData({ant: res.data})})},onShow: function(){var that = thisvar array1 = []db.collection('dx').get().then(res => {for (var i = 0; i < 20; i++) {array1.push(res.data[i].a)}db.collection('dx').count().then(res => {var a = res.totalvar b = parseInt(a / 20)var bb = b - 1for (var i = 1; i < b; i++) {var q = Number(i * 20)var ii = idb.collection('dx').skip(q).get().then(e => {var ant = e.datafor (var j = 0; j < 20; j++) {array1.push(ant[j].a)if (ii == bb && j == 19) {that.setData({array: array1})}}})}})})},onReachBottom: function(){},getant: function(a,b){var that = thisif(a==0){if(b==0){db.collection('users').orderBy('zc','desc').get().then(res=>{that.setData({ant: res.data})})}else{var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('zc', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 1) {if (b == 0) {db.collection('users').orderBy('a1', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a1', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 2) {if (b == 0) {db.collection('users').orderBy('a2', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a2', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 3) {if (b == 0) {db.collection('users').orderBy('a3', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a3', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 4) {if (b == 0) {db.collection('users').orderBy('a4', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a4', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 5) {if (b == 0) {db.collection('users').orderBy('a5', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a5', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 6) {if (b == 0) {db.collection('users').orderBy('a6', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a6', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 7) {if (b == 0) {db.collection('users').orderBy('a7', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a7', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 8) {if (b == 0) {db.collection('users').orderBy('a8', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a8', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 9) {if (b == 0) {db.collection('users').orderBy('a9', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a9', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 10) {if (b == 0) {db.collection('users').orderBy('a10', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a10', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 11) {if (b == 0) {db.collection('users').orderBy('a11', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a11', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 12) {if (b == 0) {db.collection('users').orderBy('a12', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a12', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 13) {if (b == 0) {db.collection('users').orderBy('a13', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a13', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 14) {if (b == 0) {db.collection('users').orderBy('a14', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a14', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 15) {if (b == 0) {db.collection('users').orderBy('a15', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a15', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 16) {if (b == 0) {db.collection('users').orderBy('a16', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a16', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 17) {if (b == 0) {db.collection('users').orderBy('a17', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a17', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 18) {if (b == 0) {db.collection('users').orderBy('a18', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a18', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 19) {if (b == 0) {db.collection('users').orderBy('a19', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a19', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 20) {if (b == 0) {db.collection('users').orderBy('a20', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a20', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 21) {if (b == 0) {db.collection('users').orderBy('a21', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a21', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a ==22) {if (b == 0) {db.collection('users').orderBy('a22', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a22', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 23) {if (b == 0) {db.collection('users').orderBy('a23', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a23', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 24) {if (b == 0) {db.collection('users').orderBy('a24', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('a24', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}if (a == 25) {if (b == 0) {db.collection('users').orderBy('wc', 'desc').get().then(res => {that.setData({ant: res.data})})} else {var arr = that.data.antconsole.log(arr)db.collection('users').orderBy('wc', 'desc').skip(b).get().then(res => {arr = arr.concat(res.data)that.setData({ant: arr})})}}
}})