12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- // index.ts
- // 获取应用实例
- var mixins = require('../../utils/mixins')
- Page({
- mixins: [mixins],
- data: {
- isList:true,
- score:10,
- paging: {
- pageSize: 8,
- pageNum: 1,
- total: 0,
- showSize: 3,
- current: 1,
- },
- userInfo:{},
- roomDetail:{},
- recordlist:[]
- },
- // 事件处理函数
-
- onLoad() {
-
- },
- onShow(){
- this.getRecordList()
- },
- changeCurrent(data:any){
- this.setData({
- paging: {
- ...this.data.paging,
- current:data.detail,
- },
- })
- console.log(this.data.paging.current);
-
- this.getRecordList()
- },
- getRecordList(){
- // @ts-ignore
- this.data.fetchutil.post(`cms/my/list`, {
- "pageNum": this.data.paging.current,
- "pageSize": this.data.paging.pageSize,
- }, {}).then((response: any) => {
-
- this.setData({
- recordlist: response.data.page.records,
- userInfo: response.data.user,
- paging: {
- ...this.data.paging,
- total:response.data.page.total,
- },
- })
- })
- },
- backlist(){
- this.setData({
- isList:true
- })
- },
- handleItem(e:any){
- console.log(e);
-
- let {roomid} = e.currentTarget.dataset;
- // @ts-ignore
- this.data.fetchutil.get(`cms/my/detail/${roomid}`, {}, {}).then((response: any) => {
- console.log(response);
-
- this.setData({
- isList:false,
- roomDetail:response.data
- })
- })
-
- }
- })
|