From 5b219a9694c8d69db42e746a654c779cc6a61bf6 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 18 七月 2024 18:42:20 +0800
Subject: [PATCH] ‘’
---
wechat_staff/pages/index/index.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/wechat_staff/pages/index/index.js b/wechat_staff/pages/index/index.js
index 1f8cb47..4d44bd6 100644
--- a/wechat_staff/pages/index/index.js
+++ b/wechat_staff/pages/index/index.js
@@ -1,10 +1,12 @@
-// index.js
+import { getDictData, getDailyUpdates, getZSZXCatalogs } from '../../api/index'
Page({
data: {
searchValue: '',
clientHeight: 0,
clientTop: 0,
+ DailyUpdates: {}, //姣忔棩涓婃柊
+ everydayTop: ['../../static/ic_top1@2x.png', '../../static/ic_top2@2x.png', '../../static/ic_top3@2x.png'],
bannerList: [
{imgurl: ''},
{imgurl: 'adsa.png'},
@@ -24,5 +26,50 @@
const res = wx.getMenuButtonBoundingClientRect()
this.setData({clientHeight: res.height})
this.setData({clientTop: res.top})
- }
+
+ this.initData()
+ },
+ initData() {
+ // 姣忔棩涓婃柊
+ getDailyUpdates({
+ fileType: '0'
+ }).then(res => {
+ this.setData({ DailyUpdates: res.data })
+ })
+ getZSZXCatalogs().then(res => { //蹇楄瑁呬慨
+ this.setData({
+ ZSZXCata: res.data || {}
+ })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_A'
+ }).then(res => {
+ this.setData({ HOME_CLASS_A: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_B'
+ }).then(res => {
+ this.setData({ HOME_CLASS_B: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_B2'
+ }).then(res => {
+ this.setData({ HOME_CLASS_B2: res.data.code })
+ })
+ getDictData({
+ code: 'WEIXIN_DEFAULT_IMGS',
+ label: 'HOME_CLASS_C'
+ }).then(res => {
+ this.setData({ HOME_CLASS_C: res.data.code })
+ })
+ },
+ changeStrategy(e) {
+ let item = e.currentTarget.dataset.item
+ wx.navigateTo({
+ url: `/pages/homeId/index?code=${item.code}&name=${item.name}` ,
+ })
+ },
})
--
Gitblit v1.9.3