diff --git a/dist.rar b/dist.rar new file mode 100644 index 0000000..78a1168 Binary files /dev/null and b/dist.rar differ diff --git a/package-lock.json b/package-lock.json index 436058d..385c861 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@tarojs/runtime": "3.6.19", "@tarojs/shared": "3.6.19", "@tarojs/taro": "3.6.19", - "lodash": "4.17.15", + "lodash": "^4.17.15", "react": "^18.0.0", "react-dom": "^18.0.0", "react-redux": "^9.0.3", @@ -21760,8 +21760,7 @@ "node_modules/lodash": { "version": "4.17.15", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "license": "MIT" + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "node_modules/lodash-es": { "version": "4.17.21", diff --git a/package.json b/package.json index 2bb1a15..ffdba62 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@tarojs/runtime": "3.6.19", "@tarojs/shared": "3.6.19", "@tarojs/taro": "3.6.19", - "lodash": "4.17.15", + "lodash": "^4.17.15", "react": "^18.0.0", "react-dom": "^18.0.0", "react-redux": "^9.0.3", diff --git a/src/components/popup/popup-site-swiper.less b/src/components/popup/popup-site-swiper.less index 685df83..99e7910 100644 --- a/src/components/popup/popup-site-swiper.less +++ b/src/components/popup/popup-site-swiper.less @@ -11,8 +11,24 @@ color: #fff; font-size: 36rpx; z-index: 100009; - border: 4px solid #fff; + background-color: #ababab; border-radius: 50%; - padding: 4px; + padding: 8rpx; + box-sizing: border-box; +} + +.site-popup-btn { + position: absolute; + bottom: 100rpx; + left: calc(50% - 120rpx); + width: 240rpx; + height: 70rpx; + line-height: 70rpx; + font-size: 28rpx; + text-align: center; + border: 1rpx solid #000; + border-radius: 40rpx; + background-color: #000; + color: #fff; box-sizing: border-box; } diff --git a/src/components/popup/popup-site-swiper.tsx b/src/components/popup/popup-site-swiper.tsx index 7d22144..eb7c0c6 100644 --- a/src/components/popup/popup-site-swiper.tsx +++ b/src/components/popup/popup-site-swiper.tsx @@ -38,6 +38,14 @@ export default class PopupSiteSwiper extends Component { current: 0, toRight: false, isClick: false, + typeButton: { + 1: "前往内部页面", + 2: "", + 3: "打开外部链接", + 4: "前往小程序", + 5: "前往视频号", + 6: "前往直播间", + }, }; } @@ -51,7 +59,6 @@ export default class PopupSiteSwiper extends Component { componentDidHide() {} initData = () => { - console.log("this.props.siteData", this.props.siteData); if (this.props.siteData) { let arr = JSON.parse(JSON.stringify(this.props.siteData)); this.setState({ siteList: arr }); @@ -62,9 +69,8 @@ export default class PopupSiteSwiper extends Component { this.props.close(); }; - onConfirm = () => { - let { type } = this.props; - + onConfirm = (item: any) => { + let { type } = item; // switch (type) { // case "1": // 未注册 // go("/pages/register/register"); @@ -117,10 +123,9 @@ export default class PopupSiteSwiper extends Component { } render() { - let { confirmButtonText, isShow, siteData } = this.props; + let { confirmButtonText, isShow, siteData, type } = this.props; let { current } = this.state; - console.log("siteData", siteData); return ( @@ -173,6 +178,12 @@ export default class PopupSiteSwiper extends Component { mode="aspectFit" > + {/* */} ); })} diff --git a/src/pages/index/index.less b/src/pages/index/index.less index 443d0c6..b9d2c7c 100644 --- a/src/pages/index/index.less +++ b/src/pages/index/index.less @@ -479,6 +479,7 @@ page { border-radius: 22rpx; overflow: hidden; height: 214rpx; + background-color: #ababab; } .infobox3 .currentbox { diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 0f622e7..aae0b50 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -2,7 +2,14 @@ import classnames from "classnames"; import dayjs from "dayjs"; import Taro from "@tarojs/taro"; import { Component, PropsWithChildren } from "react"; -import { Block, View, Text, Image, PageMeta, Button } from "@tarojs/components"; +import { + Block, + View, + Text, + Image, + Swiper, + SwiperItem, +} from "@tarojs/components"; /*** redux ***/ import { connect } from "react-redux"; @@ -20,13 +27,13 @@ import type CustomTabBar from "../../custom-tab-bar"; import Navbar from "../../components/navbar/navbar"; /** 自定义组件 **/ -import { Toast } from "@antmjs/vantui"; - import { RefreshWxUserInfo, GetNoReadMessageNum, GetOtherSetting, GetSitePopupList, + GetSiteCarousel, + GetSiteAddTag, } from "../../utils/Interface"; // css引入 @@ -67,6 +74,9 @@ class Index extends Component { info: {}, // 护理推荐点击参与活动的信息 weekinfo: undefined, currentDate: dayjs().format("YYYY-MM-DD"), + // 横幅轮播 + bannerList: [], + bannerCurrent: 0, }; } @@ -105,6 +115,7 @@ class Index extends Component { this.RefreshWxUserInfo(); this.GetSitePopupList(); + this.GetSiteCarousel(); // if (!this.state.isShowIndexFlag) { // // 仅初次进入首页运行 // this.GetSitePopupList(); @@ -174,7 +185,26 @@ class Index extends Component { if (res.data.data) { this.setState({ sitePopupList: res.data.data, isShowSiteSwiper: true }); } else { - msg("暂无数据"); + // msg("暂无数据"); + } + } + }; + + // 获取站点管理-广告轮播列表 + GetSiteCarousel = async () => { + let res = await GetSiteCarousel(); + if (res.data.code === 200) { + if (res.data.data) { + this.setState({ bannerList: res.data.data }); + } + } + }; + + GetSiteAddTag = async (id) => { + let res = await GetSiteAddTag(id); + console.log("tag", res.data); + if (res.data.code === 200) { + if (res.data.data) { } } }; @@ -267,6 +297,13 @@ class Index extends Component { this.setState({ isShowSiteSwiper: false }); }; + bannerSwiperchange() {} + + gobanner(item) { + console.log("item", item); + this.GetSiteAddTag(item.id); + } + render() { let { currentDate, @@ -276,7 +313,12 @@ class Index extends Component { isNotRegister, isShowSiteSwiper, isDev, + + bannerList, + bannerCurrent, } = this.state; + + console.log("bannerList", bannerList); return ( { 您暂时还没有绑定任何设备 - + + {/* + + 护理推荐 + + 更多 + + + + + + + + + + {{item.title}} + + 参与中 + 参与 + + + + + + + */} + + {/* {bannerList.length && ( + + + {bannerList.map((item, index) => { + return ( + + + + ); + })} + + + )} */} + + + {bannerList.map((item, index) => { + return ( + + + + ); + })} + + ); } diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 733de2c..d011cbc 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -272,7 +272,8 @@ class User extends Component { {userInfo.credit} - 过期 + + {/* 过期 */} diff --git a/yarn.lock b/yarn.lock index 28f5abd..1fd51a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10264,7 +10264,7 @@ "resolved" "https://registry.npmmirror.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz" "version" "4.5.0" -"lodash@^4.17.10", "lodash@^4.17.11", "lodash@^4.17.13", "lodash@^4.17.15", "lodash@^4.17.4", "lodash@>4.17.0", "lodash@4.17.15", "lodash@4.6.1 || ^4.16.1": +"lodash@^4.17.10", "lodash@^4.17.11", "lodash@^4.17.13", "lodash@^4.17.15", "lodash@^4.17.4", "lodash@>4.17.0", "lodash@4.6.1 || ^4.16.1": "integrity" "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "resolved" "https://registry.npmmirror.com/lodash/-/lodash-4.17.15.tgz" "version" "4.17.15"