city_card/pages/serve/serve.js
2023-07-15 14:25:28 +08:00

119 lines
3.2 KiB
JavaScript

var e = getApp();
Page({
data: {
token: e.globalData.token,
showSettleType: !1,
sourceUrl: e.baseUrls.sourceUrl,
settleType: "",
orgList: [],
page: {
page: 1,
rows: 3,
newsTypeId: "b163953b-ed22-4041-a79f-73d5deedd025"
},
serveOrgList: [],
indicatorDots: !0,
vertical: !1,
autoplay: !0,
interval: 3e3,
duration: 500,
serviceUrl: e.baseUrls.serviceUrl,
baseImgUrl: e.baseUrls.baseImgUrl
},
orgSettle: function(e) {
var t = e.currentTarget.dataset.type;
wx.navigateTo({
url: "./settle?type=" + t
});
},
closeSettleType: function() {
this.setData({
showSettleType: !1
});
},
doSettle: function(e) {
var t = e.currentTarget.dataset.type, a = e.currentTarget.dataset.name;
this.setData({
showSettleType: !1
}), wx.navigateTo({
url: "./settle?id=" + t + "&name=" + a
});
},
checkMoreOrg: function() {
wx.navigateTo({
url: "./orgList"
});
},
showDetail: function(e) {
console.log(e);
var t = e.currentTarget.dataset.item;
console.log(t), "" == t.cardSysId ? wx.showToast({
title: "该服务机构未添加展示内容",
icon: "none"
}) : wx.navigateTo({
url: "/pages/center/contact/contactDetail?gridMiniId=" + t.cardSysId + "&title=" + t.unitName
});
},
getServeOrg: function() {
var t = this;
e.restAjax.get(e.restAjax.path(e.apis.getOrgList, [ e.baseUrls.requestUrl ]), {
pages: 1,
rows: 3,
areaCode: wx.getStorageSync("areaCode")
}, {
headers: {
token: t.data.token
}
}, function(e, a) {
console.log(a), t.setData({
serveOrgList: a.rows
});
}, function(e, t) {
console.log(t);
});
},
getNotice: function() {
var t = this;
e.restAjax.get(e.restAjax.path(e.apis.getNewsList, [ e.baseUrls.requestUrl ]), {
pages: 1,
newsTypeId: "b163953b-ed22-4041-a79f-73d5deedd025",
areaCode: wx.getStorageSync("areaCode")
}, {
headers: {
token: t.data.token
}
}, function(e, a) {
t.setData({
noticeList: a.rows
});
}, function(e, t) {
console.log(t);
});
},
checkNewsDetail: function(e) {
var t = e.currentTarget.dataset.id;
wx.navigateTo({
url: "../news/newsDetail?newsId=" + t
});
},
checkMoreNews: function() {
wx.navigateTo({
url: "./newsList"
});
},
onLoad: function(t) {
this.setData({
token: e.globalData.token
}), this.getNotice();
},
onReady: function() {},
onShow: function() {
this.getServeOrg();
},
onHide: function() {},
onUnload: function() {},
onPullDownRefresh: function() {},
onReachBottom: function() {},
onShareAppMessage: function() {}
});