|
@@ -3,51 +3,71 @@ import {
|
|
|
login
|
|
|
} from "../api/user-api";
|
|
|
|
|
|
+import {
|
|
|
+ imgUrl
|
|
|
+} from "../api/request"
|
|
|
+
|
|
|
// 获取应用实例
|
|
|
const app = getApp()
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
+ imgUrl: imgUrl,
|
|
|
// 屏幕高度
|
|
|
navHeight: '',
|
|
|
searchInput: '',
|
|
|
+ // 南岸咨询
|
|
|
+ naTab: 0,
|
|
|
+ naItem: '',
|
|
|
// 服务列表
|
|
|
- serviceItems1: [{ img: '../images/service-1.png', name: '生活缴费' },
|
|
|
- { img: '../images/service-2.png', name: '社保服务' },
|
|
|
- { img: '../images/service-3.png', name: '公积金' },
|
|
|
- { img: '../images/service-4.png', name: '电子证照' },
|
|
|
- { img: '../images/service-5.png', name: '民政低保' }],
|
|
|
+ serviceItems1: [{ img: imgUrl + 'service-1.png', name: '生活缴费' },
|
|
|
+ { img: imgUrl + 'service-2.png', name: '社保服务' },
|
|
|
+ { img: imgUrl + 'service-3.png', name: '公积金' },
|
|
|
+ { img: imgUrl + 'service-4.png', name: '电子证照' },
|
|
|
+ { img: imgUrl + 'service-5.png', name: '民政低保' }],
|
|
|
serviceItems2: [{ img: '../images/service-6.png', name: '税务服务' },
|
|
|
- { img: '../images/service-7.png', name: '交通出行' },
|
|
|
- { img: '../images/service-8.png', name: '核算采样点' },
|
|
|
- { img: '../images/service-9.png', name: '住房置业' },
|
|
|
- { img: '../images/service-10.png', name: '更多功能' }],
|
|
|
+ { img: imgUrl + 'service-7.png', name: '交通出行' },
|
|
|
+ { img: imgUrl + 'service-8.png', name: '核算采样点' },
|
|
|
+ { img: imgUrl + 'service-9.png', name: '住房置业' },
|
|
|
+ { img: imgUrl + 'service-10.png', name: '更多功能' }],
|
|
|
// 百姓聚焦
|
|
|
peopleService: [{ top: true, name: '12345热线'},
|
|
|
{ top: false, name: '个人社保查询'},
|
|
|
{ top: false, name: '南岸文旅消费劵'},
|
|
|
{ top: false, name: '长喜汇弹子石老街'},
|
|
|
{ top: false, name: '南山一棵松'},
|
|
|
- { top: false, name: '一次性创业补助'}]
|
|
|
+ { top: false, name: '一次性创业补助'}],
|
|
|
+ // 南岸咨询二级title
|
|
|
+ naItemTabList: [
|
|
|
+ {id: 1, name: '政策.咨询'},
|
|
|
+ {id: 2, name: '党建.服务'},
|
|
|
+ {id: 3, name: '抗疫.复工'},
|
|
|
+ {id: 4, name: '功能.服务'}],
|
|
|
+ // 南岸咨询内容
|
|
|
+ naContentList: [
|
|
|
+ {id: 1, name: '洪斌在全区疫情防控工作会议上强调,坚持不松懈的精神,努力工作,开展创先争优活动,激励人民发扬美好传统美德!'},
|
|
|
+ {id: 2, name: '坚持不松劲渝事好商量'},
|
|
|
+ {id: 3, name: '南岸实践工作全面启动'},
|
|
|
+ {id: 4, name: '首条直达南滨路人防隧道开建'},
|
|
|
+ {id: 5, name: '全市首个!南岸区便民数字地图上线啦~'}],
|
|
|
},
|
|
|
-
|
|
|
onReady() {},
|
|
|
onShow() {
|
|
|
- if (typeof this.getTabBar === 'function' &&
|
|
|
- this.getTabBar()) {
|
|
|
- this.getTabBar().setData({
|
|
|
- selected: 0
|
|
|
- })
|
|
|
-}
|
|
|
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
|
|
+ this.getTabBar().setData({ selected: 0 })
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ naItem: 0
|
|
|
+ }),
|
|
|
+ this.setData({
|
|
|
+ naItemTab: 1
|
|
|
+ })
|
|
|
},
|
|
|
onHide(){
|
|
|
- if (typeof this.getTabBar === 'function' &&
|
|
|
- this.getTabBar()) {
|
|
|
- this.getTabBar().setData({
|
|
|
- selected: -1
|
|
|
- })
|
|
|
- }
|
|
|
-},
|
|
|
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
|
|
+ this.getTabBar().setData({ selected: -1 })
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
console.log(app.globalData.navHeight)
|
|
|
this.setData({
|
|
@@ -68,12 +88,89 @@ Page({
|
|
|
// })
|
|
|
},
|
|
|
|
|
|
+ // 搜索框
|
|
|
bindKeyInput: function (e) {
|
|
|
this.setData({
|
|
|
searchInput: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 南岸咨询tab
|
|
|
+ naChangeItem: function (e) {
|
|
|
+ this.setData({
|
|
|
+ naItem: e.currentTarget.dataset.item
|
|
|
+ })
|
|
|
+ if (this.data.naItem == 0) {
|
|
|
+ this.setData({
|
|
|
+ naItemTabList: [
|
|
|
+ {id: 1, name: '政策.咨询'},
|
|
|
+ {id: 2, name: '党建.服务'},
|
|
|
+ {id: 3, name: '抗疫.复工'},
|
|
|
+ {id: 4, name: '功能.服务'}]
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ naItemTabList: [
|
|
|
+ {id: 1, name: '天气.咨询'},
|
|
|
+ {id: 2, name: '外出.服务'},
|
|
|
+ {id: 3, name: '打工.复工'},
|
|
|
+ {id: 4, name: '娱乐.服务'}]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ naChangeTab: function (e) {
|
|
|
+ this.setData({
|
|
|
+ naTab: e.detail.current
|
|
|
+ })
|
|
|
+ if (this.data.naTab == 0) {
|
|
|
+ this.setData({
|
|
|
+ naItemTabList: [
|
|
|
+ {id: 1, name: '政策.咨询'},
|
|
|
+ {id: 2, name: '党建.服务'},
|
|
|
+ {id: 3, name: '抗疫.复工'},
|
|
|
+ {id: 4, name: '功能.服务'}]
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ naItemTabList: [
|
|
|
+ {id: 1, name: '天气.咨询'},
|
|
|
+ {id: 2, name: '外出.服务'},
|
|
|
+ {id: 3, name: '打工.复工'},
|
|
|
+ {id: 4, name: '娱乐.服务'}]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 重置咨询title-tab
|
|
|
+ this.setData({
|
|
|
+ naItemTab: 1
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 南岸咨询子集菜单点击
|
|
|
+ clickNaTilteTab: function (e) {
|
|
|
+ this.setData({
|
|
|
+ naItemTab: e.currentTarget.dataset.item.id
|
|
|
+ })
|
|
|
+ const ran = Math.random()*100 + 41
|
|
|
+ this.setData({
|
|
|
+ naContentList: [
|
|
|
+ {id: 1, name: `${ran}2洪斌在全区疫情防控工作会议上强调,坚持不松懈的精神,努力工作,开展创先争优活动,激励人民发扬美好传统美德!`},
|
|
|
+ {id: 2, name: `${ran}坚持不松劲渝事好商量`},
|
|
|
+ {id: 3, name: '2南岸实践工作全面启动'},
|
|
|
+ {id: 4, name: '2首条直达南滨路人防隧道开建'},
|
|
|
+ {id: 5, name: '2全市首个!南岸区便民数字地图上线啦~'}]
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 南岸咨询内容点击
|
|
|
+ clickNaContent: function (e) {
|
|
|
+ console.log(e)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 南岸咨询更多
|
|
|
+ naMore: function (e) {
|
|
|
+ console.log('更多')
|
|
|
+ },
|
|
|
+
|
|
|
getUserProfile() {
|
|
|
wx.setStorageSync('nickname', "");
|
|
|
wx.setStorageSync('avatarUrl', "");
|