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.
|
|
|
const app = getApp<IAppOption>();
|
|
|
|
|
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
cateList: [] as any,
|
|
|
|
remark: '',
|
|
|
|
|
|
|
|
isLogin: 0,
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
app.waitLogin().then(() => {
|
|
|
|
this.getCateList();
|
|
|
|
this.setData({
|
|
|
|
isLogin: app.globalData.isLogin,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
getCateList() {
|
|
|
|
wx.ajax({
|
|
|
|
method: 'GET',
|
|
|
|
url: '?r=shizhong/book/cate-list',
|
|
|
|
data: {},
|
|
|
|
}).then((res) => {
|
|
|
|
this.setData({
|
|
|
|
cateList: res,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleDetail(e) {
|
|
|
|
const { index } = e.currentTarget.dataset;
|
|
|
|
const item = this.data.cateList[index];
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/pages/classify/index?id=${item.Id}`,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleSearch() {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/search/index',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleRemark() {
|
|
|
|
const { remark } = this.data;
|
|
|
|
wx.ajax({
|
|
|
|
method: 'POST',
|
|
|
|
url: '?r=shizhong/account/send-feedback',
|
|
|
|
data: {
|
|
|
|
content: remark,
|
|
|
|
},
|
|
|
|
loading: true,
|
|
|
|
}).then(() => {
|
|
|
|
wx.showToast({
|
|
|
|
title: '提交成功',
|
|
|
|
icon: 'success',
|
|
|
|
});
|
|
|
|
this.setData({
|
|
|
|
remark: '',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export {};
|