diff --git a/src/app.tsx b/src/app.tsx index b90ed73..20a64a0 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -26,8 +26,9 @@ class App extends Component { // Taro.switchTab({ // url: "pages/index/index", // }); + // go("/pages/initiate/initiate"); // 介绍页 // go("/pages/entry/entry"); // 介绍页 - // go("/pages/userInfo/userInfo"); + // go("/pages/userInfo/userInfo"); // 个人信息完善 // go("/pages/register/register"); // go("/pages/instrument/instrument"); } diff --git a/src/components/calendar/body/index.tsx b/src/components/calendar/body/index.tsx index a533b1b..5a749d5 100644 --- a/src/components/calendar/body/index.tsx +++ b/src/components/calendar/body/index.tsx @@ -434,7 +434,7 @@ export default class AtCalendarBody extends React.Component { className={classnames("arrow", { "arrow-rotate": isFolding, })} - src={require("../../../img/index/arrow-down.png")} + src={require("../img/arrow-down.png")} mode="aspectFill" /> @@ -531,7 +531,7 @@ export default class AtCalendarBody extends React.Component { className={classnames("arrow", { "arrow-rotate": isFolding, })} - src={require("../../../img/index/arrow-down.png")} + src={require("../img/arrow-down.png")} mode="aspectFill" /> diff --git a/src/components/calendar/body/isFolding.less b/src/components/calendar/body/isFolding.less index 77ffa8a..49c38ab 100644 --- a/src/components/calendar/body/isFolding.less +++ b/src/components/calendar/body/isFolding.less @@ -35,6 +35,14 @@ } } +// .at-calendar__list.flex .flex__item--selected { +// .flex__item-container { +// position: relative; +// background: linear-gradient(0deg, #fff0da, #ffe4c0); +// border-radius: 50%; +// } +// } + .at-calendar__list.flex .flex__item--complete { color: #333 !important; font-weight: 400 !important; diff --git a/src/components/calendar/img/arrow-down.png b/src/components/calendar/img/arrow-down.png new file mode 100644 index 0000000..6cd1e0e Binary files /dev/null and b/src/components/calendar/img/arrow-down.png differ diff --git a/src/components/calendar/img/arrow-top.png b/src/components/calendar/img/arrow-top.png new file mode 100644 index 0000000..fd75699 Binary files /dev/null and b/src/components/calendar/img/arrow-top.png differ diff --git a/src/components/calendar/img/right.png b/src/components/calendar/img/right.png new file mode 100644 index 0000000..05794b1 Binary files /dev/null and b/src/components/calendar/img/right.png differ diff --git a/src/img/index/add-black.png b/src/img/index/add-black.png new file mode 100644 index 0000000..08586e3 Binary files /dev/null and b/src/img/index/add-black.png differ diff --git a/src/img/index/add.png b/src/img/index/add.png new file mode 100644 index 0000000..744bd97 Binary files /dev/null and b/src/img/index/add.png differ diff --git a/src/img/index/arrow-top.png b/src/img/index/arrow-top.png new file mode 100644 index 0000000..fd75699 Binary files /dev/null and b/src/img/index/arrow-top.png differ diff --git a/src/img/index/close.png b/src/img/index/close.png new file mode 100644 index 0000000..d3edf33 Binary files /dev/null and b/src/img/index/close.png differ diff --git a/src/img/index/fail.png b/src/img/index/fail.png new file mode 100644 index 0000000..22e5ff3 Binary files /dev/null and b/src/img/index/fail.png differ diff --git a/src/img/index/incomplete.png b/src/img/index/incomplete.png new file mode 100644 index 0000000..a44a670 Binary files /dev/null and b/src/img/index/incomplete.png differ diff --git a/src/img/index/success.png b/src/img/index/success.png new file mode 100644 index 0000000..b27ac49 Binary files /dev/null and b/src/img/index/success.png differ diff --git a/src/pages/about/about.less b/src/pages/about/about.less index c685942..a36bc1b 100644 --- a/src/pages/about/about.less +++ b/src/pages/about/about.less @@ -2,15 +2,37 @@ page { background: #f3f3f3; } -.cell { - border-bottom: 1px solid #f3f3f3; - background: #fff; - padding: 30rpx; - font-size: 28rpx; -} -.cell .label { - color: #323232; -} -.cell .value { - color: #a19fa2; +.about-box { + width: 690rpx; + height: 270rpx; + background: #ffffff; + border-radius: 30rpx; + margin: 33rpx auto; + // padding: 20rpx 0; + box-sizing: border-box; + overflow: hidden; + .cell { + border-bottom: 1px solid #f3f3f3; + background: #fff; + padding: 20rpx 30rpx; + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 500; + color: #000000; + .label { + color: #000000; + } + .value { + color: #000000; + } + } + + .version { + // height: 26rpx; + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 500; + color: #000000; + // line-height: 60rpx; + } } diff --git a/src/pages/about/about.tsx b/src/pages/about/about.tsx index 0cf886d..4ba4bcf 100644 --- a/src/pages/about/about.tsx +++ b/src/pages/about/about.tsx @@ -1,11 +1,13 @@ import { Component, PropsWithChildren, useEffect, useState } from "react"; import Taro from "@tarojs/taro"; -import { Block, View, Text } from "@tarojs/components"; +import { Block, View, Image, Text } from "@tarojs/components"; import Navbar from "../../components/navbar/navbar"; import { GetAboutUs } from "../../utils/Interface"; +import { go } from "../../utils/traoAPI"; + import "./about.less"; export default class About extends Component { @@ -34,20 +36,49 @@ export default class About extends Component { // this.setState({ version: res.data.data.value }); // } const accountInfo = Taro.getAccountInfoSync(); - this.setState({ - version: accountInfo?.miniProgram?.version || "开发版", - // accountInfo?.miniProgram?.envVersion, - }); + + let version = accountInfo?.miniProgram?.version + ? "当前版本V" + accountInfo?.miniProgram?.version + : "开发版"; + this.setState({ version: version }); } + goUser = () => { + go("/pages/userPolicy/userPolicy"); + }; + + goPrivacy = () => { + go("/pages/privacyPolicy/privacyPolicy"); + }; + render() { let { version } = this.state; return ( - - 版本管理 - {version} + + + 版本管理 + {version} + + + 用户协议 + + + + + + 隐私协议 + + + + ); diff --git a/src/pages/activity/activity.less b/src/pages/activity/activity.less index e69de29..fec9a80 100644 --- a/src/pages/activity/activity.less +++ b/src/pages/activity/activity.less @@ -0,0 +1,8 @@ +.main { + display: flex; + width: 100vw; + height: 100vh; + justify-content: center; + align-items: center; + font-size: 30rpx; +} diff --git a/src/pages/activity/activity.tsx b/src/pages/activity/activity.tsx index 5cee0bd..5647e55 100644 --- a/src/pages/activity/activity.tsx +++ b/src/pages/activity/activity.tsx @@ -9,13 +9,12 @@ import { Video, Swiper, SwiperItem, + Block, } from "@tarojs/components"; import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "./activity.less"; -const app = Taro.getApp(); - import type CustomTabBar from "../../custom-tab-bar"; export default class Activity extends Component { pageCtx = Taro.getCurrentInstance().page; @@ -42,6 +41,11 @@ export default class Activity extends Component { render() { let { name } = this.state; - return {name}; + return ( + + {name} + 待开发 + + ); } } diff --git a/src/pages/detect/detect.less b/src/pages/detect/detect.less index e69de29..fec9a80 100644 --- a/src/pages/detect/detect.less +++ b/src/pages/detect/detect.less @@ -0,0 +1,8 @@ +.main { + display: flex; + width: 100vw; + height: 100vh; + justify-content: center; + align-items: center; + font-size: 30rpx; +} diff --git a/src/pages/detect/detect.tsx b/src/pages/detect/detect.tsx index e0a04e7..a063fcb 100644 --- a/src/pages/detect/detect.tsx +++ b/src/pages/detect/detect.tsx @@ -3,6 +3,7 @@ import { Component, PropsWithChildren, useEffect, useState } from "react"; import Taro from "@tarojs/taro"; // 引入 Swiper, SwiperItem 组件 import { + Block, View, Text, Image, @@ -40,6 +41,11 @@ export default class Detect extends Component { render() { let { name } = this.state; - return {name}; + return ( + + {name} + 待开发 + + ); } } diff --git a/src/pages/entry/entry.tsx b/src/pages/entry/entry.tsx index ebd51b3..9858af1 100644 --- a/src/pages/entry/entry.tsx +++ b/src/pages/entry/entry.tsx @@ -13,15 +13,20 @@ import { SwiperItem, } from "@tarojs/components"; +/*** redux ***/ +import { connect } from "react-redux"; +import { userRefresh } from "../../store/features/userInfo"; +/*** redux end ***/ + import Navbar from "../../components/navbar/navbar"; import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "./entry.less"; import "./Animista.less"; import "./fade.css"; -import { go } from "../../utils/traoAPI"; +import { go, msg } from "../../utils/traoAPI"; -export default class Entry extends Component { +class Entry extends Component { constructor(props) { super(props); this.state = { @@ -40,7 +45,7 @@ export default class Entry extends Component { async onLoad() { this.setStatusBar(); - this.intData(); + this.initData(); } componentDidMount() {} @@ -73,12 +78,18 @@ export default class Entry extends Component { }); } - async intData() { + async initData() { let MpSplashDetail_type1 = Taro.getStorageSync("MpSplashDetail_type1") || undefined; if (MpSplashDetail_type1) { let detail = JSON.parse(MpSplashDetail_type1); let list = detail.filter((item: any) => item.fileSuffix === "images"); + if (list.length === 0) { + Taro.reLaunch({ + url: "/pages/index/index", + }); + return; + } let welcomeList = list.map((item) => { return { image: item.filePath, @@ -88,7 +99,9 @@ export default class Entry extends Component { }); this.setState({ welcomeList }); } else { - go("/pages/index/index"); + Taro.reLaunch({ + url: "/pages/index/index", + }); } } @@ -115,7 +128,10 @@ export default class Entry extends Component { } } toHomePage() { - Taro.switchTab({ + // Taro.switchTab({ + // url: "/pages/index/index", + // }); + Taro.reLaunch({ url: "/pages/index/index", }); } @@ -209,25 +225,18 @@ export default class Entry extends Component { ); })} - {/* - - 前往主页 - - - {welcomeList.map((item, index) => { - return ( - = index, - })} - > - ); - })} - - */} ); } } + +const mapStateToProps = (state) => ({ + mobile: state.userInfo.mobile, +}); +const mapDispatchToProps = (dispatch) => ({ + userRefresh(value) { + dispatch(userRefresh(value)); + }, +}); +export default connect(mapStateToProps, mapDispatchToProps)(Entry); diff --git a/src/pages/index/index.less b/src/pages/index/index.less index 2fabf46..a356f42 100644 --- a/src/pages/index/index.less +++ b/src/pages/index/index.less @@ -993,10 +993,11 @@ page { background-color: #fff; .date-title { position: absolute; - right: 0; - width: 140rpx; + right: 16rpx; + width: 132rpx; display: flex; align-items: center; + justify-content: space-between; height: 40rpx; .text { color: #666; diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 4761264..7270753 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -70,8 +70,17 @@ class Index extends Component { weekinfo: undefined, // 日历 currentDate: dayjs().format("YYYY-MM-DD"), - calendarComplete: [dayjs().subtract(1, "day").format("YYYY-MM-DD")], - calendarInComplete: [dayjs().add(1, "day").format("YYYY-MM-DD")], + calendarComplete: [ + dayjs().subtract(1, "day").format("YYYY-MM-DD"), + dayjs().subtract(3, "day").format("YYYY-MM-DD"), + ], + calendarInComplete: [ + dayjs().add(1, "day").format("YYYY-MM-DD"), + dayjs().add(3, "day").format("YYYY-MM-DD"), + ], + // currentDate: "2023-06-23", + // calendarComplete: ["2023-06-16", "2023-06-19", "2023-06-21"], + // calendarInComplete: ["2023-06-25", "2023-06-27"], // 横幅轮播 bannerList: [], bannerCurrent: 0, @@ -138,6 +147,11 @@ class Index extends Component { this.GetSitePopupList(); // 全局内存缓存,仅初次进入首页运行 this.props.setIndexFlag(true); + // 小程序切到后台,则清除弹窗缓存 + Taro.onAppHide((res) => { + console.log("小程序进入后台:", res); + this.props.setIndexFlag(false); + }); } } } @@ -366,7 +380,11 @@ class Index extends Component { 护理记录 - + + {/* */} { componentDidHide() {} async initData() { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); const { data } = await MpSplashDetail({ pageNum: 1, pageSize: 5, type: 1, }); + Taro.hideLoading(); if (data.code === 200) { let url = ""; if (data.rows.length) { Taro.setStorageSync("MpSplashDetail_type1", JSON.stringify(data.rows)); + // 1.判断是否设置登录页视频,有则正常显示视频 let bgObj = data.rows.find((item: any) => item.fileSuffix === "video"); if (bgObj) { url = bgObj.filePath; - console.log("url", url); this.setState({ url }); + } else { + // 1-2.判断是否设置介绍页图片,有则跳转介绍登录页 + let imgList = data.rows.filter( + (item: any) => item.fileSuffix === "images" + ); + if (imgList.length > 0) { + go("/pages/entry/entry"); + return; + } else { + // 1-3.如果介绍页图片也没有,直接跳转首页 + Taro.reLaunch({ + url: "/pages/index/index", + }); + } } } else { Taro.reLaunch({ @@ -85,20 +106,15 @@ class Initiate extends Component { }); } } else { - // msg("获取首页视频失败!"); - } - } - - setBg() { - let bgData = Taro.getStorageSync("MpSplashDetail_type1"); - bgData = JSON.parse(bgData); - let bgObj = bgData.find((item: any) => item.fileSuffix === "video"); - if (bgObj) { - this.setState({ url: bgObj.filePath }); + msg("请求失败,请联系管理员"); } } async WCUserLogin() { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); const { code } = await Taro.login(); const { data } = await WCUserLogin({ code }); if (data.code === 200) { @@ -106,10 +122,12 @@ class Initiate extends Component { Taro.setStorageSync("token", data.data.token); Taro.setStorageSync("mobile", data.data.mobile); this.props.userRefresh(data.data); + Taro.hideLoading(); this.initData(); } else { - msg("登录失败!"); + msg("请求失败,尝试重新请求"); + this.WCUserLogin(); } } @@ -125,18 +143,23 @@ class Initiate extends Component { } } onEnded = () => { - let timeOut: any = null; - clearTimeout(timeOut); - timeOut = setTimeout(() => { - go("/pages/entry/entry"); - }, 300); + let token = Taro.getStorageSync("token"); + if (token) { + let timeOut: any = null; + clearTimeout(timeOut); + timeOut = setTimeout(() => { + go("/pages/entry/entry"); + }, 300); + } else { + msg("请求中,请稍候"); + } }; render() { let { menu, url } = this.state; return ( - { src={require("../../img/welcome/top-logo.png")} mode="widthFix" /> - - + */} + { src={require("../../img/user/points.png")} mode="aspectFill" > - 暂无积分记录 + 暂无积分记录 )} {list.map((item: any, key: number) => { diff --git a/src/pages/shop/shop.tsx b/src/pages/shop/shop.tsx index 7ff14ad..dbeee3c 100644 --- a/src/pages/shop/shop.tsx +++ b/src/pages/shop/shop.tsx @@ -72,7 +72,12 @@ class Shop extends Component { // 获取小程序设置 GetOtherSetting = async () => { + Taro.showLoading({ + title: "请求中...", + mask: true, + }); let res = await GetOtherSetting(); + Taro.hideLoading(); if (res.data.code === 200) { this.props.otherSettingRefresh(res.data.data); diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index e109365..e1dd88c 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -12,7 +12,7 @@ import { connect } from "react-redux"; import { userRefresh } from "../../store/features/userInfo"; /*** redux end ***/ -import { RefreshWxUserInfo } from "../../utils/Interface"; +import { RefreshWxUserInfo, GetNoReadMessageNum } from "../../utils/Interface"; import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "./user.less"; @@ -47,16 +47,19 @@ class User extends Component { }; } - async onLoad() {} - componentDidMount() { + async onLoad() { this.initData(); } + componentDidMount() {} componentWillUnmount() {} componentDidShow() { this.setState({ userInfo: this.props.userInfo }); + let messagecount = Taro.getStorageSync("messageCount"); + this.setState({ messagecount: messagecount }); + const tabbar = Taro.getTabBar(this.pageCtx); tabbar?.setSelected(4); } @@ -65,8 +68,18 @@ class User extends Component { async initData() { this.RefreshWxUserInfo(); + this.GetNoReadMessageNum(); } + // 获取消息数量 + GetNoReadMessageNum = async () => { + let res = await GetNoReadMessageNum(); + if (res.data.code === 200) { + Taro.setStorageSync("messageCount", res.data.data); + this.setState({ messagecount: res.data.data }); + } + }; + // 刷新用户信息 RefreshWxUserInfo = async () => { let res = await RefreshWxUserInfo(); diff --git a/src/pages/userInfo/userInfo.css b/src/pages/userInfo/userInfo.css deleted file mode 100644 index 8467b23..0000000 --- a/src/pages/userInfo/userInfo.css +++ /dev/null @@ -1,139 +0,0 @@ -/* pages/userInfo/userInfo.wxss */ -page { - background: #f3f3f3; -} -.nav { - position: fixed; - z-index: 99; - width: 100%; - top: 0; -} -.nav .logo { - width: 223rpx; -} -.nav .nav_box { - position: relative; - display: flex; - align-items: center; - justify-content: center; - padding: 0 32rpx; -} -.main { - text-align: center; - padding-bottom: 153rpx; -} -.main .title { - font-size: 48rpx; - font-weight: 500; - color: #000; - margin: 73rpx auto 48rpx; -} -.main .txt { - font-size: 26rpx; - font-weight: 500; - color: #666; - margin-bottom: 10rpx; -} -.main .avatar_box { - position: relative; - width: max-content; - margin: 78rpx auto 59rpx; -} -.main .avatar_box .avatar { - width: 147rpx; - height: 147rpx; - border-radius: 50%; - margin: 0 auto 13rpx; -} -.main .avatar_box .btn_avatar { - background: transparent; -} -/* 去掉背景色和内外边距 */ -button { - margin: 0; - padding: 0; - background-color: inherit; - position: static; -} -button:after { - content: none; -} -/* 去掉边框 */ -button::after { - border: none; -} -.main .avatar_box .btn_avatar::after { - border: none; - background: transparent; -} -.form { - width: 690rpx; - text-align: left; - margin: 0 30rpx 0; -} -.form .form_item { - position: relative; - margin-bottom: 35rpx; -} -.form_item .arrow { - position: absolute; - bottom: 30rpx; - right: 51rpx; - width: 30rpx; - height: 20rpx; -} -.form .form_item .label { - font-size: 28rpx; - font-weight: 500; - color: #030000; - margin-bottom: 28rpx; -} -.form .form_item .label::after { - content: "*"; - color: #eb5858; - margin-left: 10rpx; -} -.form .form_item .ipt { - width: 100%; - height: 80rpx; - line-height: 80rpx; - background: #ffffff; - border: 1px solid #dddddd; - border-radius: 3rpx; - padding-left: 28rpx; - box-sizing: border-box; -} -.footer { - position: fixed; - bottom: 0; - z-index: 99; - display: flex; - align-items: baseline; - width: 100%; - height: 153rpx; - background: #ffffff; - box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21); -} -.btn { - width: 540rpx; - height: 90rpx; - background: #000; - border-radius: 45rpx; - color: #fff; - line-height: 90rpx; - text-align: center; - margin: 21rpx 49rpx 42rpx 30rpx; -} -.text { - font-size: 32rpx; - font-weight: bold; - color: #000; -} -.btn-disable { - background-color: #ccc !important; - /* 设置按钮背景颜色为灰色 */ - color: #fff !important; - /* 设置按钮文字颜色为白色 */ - border-color: #ccc !important; - /* 设置按钮边框颜色为灰色 */ -} diff --git a/src/pages/userInfo/userInfo.less b/src/pages/userInfo/userInfo.less index a935669..dc764f3 100644 --- a/src/pages/userInfo/userInfo.less +++ b/src/pages/userInfo/userInfo.less @@ -43,7 +43,8 @@ page { .main .avatar_box { position: relative; - width: max-content; + // width: max-content; + width: 147rpx; margin: 78rpx auto 50rpx; } @@ -131,6 +132,7 @@ button::after { height: 153rpx; background: #ffffff; box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21); + padding-bottom: env(safe-area-inset-bottom); } .btn { diff --git a/src/pages/userInfo/userInfo.tsx b/src/pages/userInfo/userInfo.tsx index a0ede7b..b38cf91 100644 --- a/src/pages/userInfo/userInfo.tsx +++ b/src/pages/userInfo/userInfo.tsx @@ -157,7 +157,6 @@ class UserInfo extends Component { let res = await UpdateUserUploadFile(formData); console.log("Res", res); if (res.code === 200) { - msg("更新成功"); userInfo.province = res.data.province; userInfo.city = res.data.city; userInfo.area = res.data.area; @@ -169,10 +168,10 @@ class UserInfo extends Component { userInfo.integralText = res.data.integralText; this.props.userRefresh(userInfo); this.setState({ userInfo: userInfo }); - if (res.data.integralText) { this.setState({ isShowIntegralText: true }); } else { + msg("更新成功"); this.goUser(); } } @@ -191,7 +190,6 @@ class UserInfo extends Component { let data = formData.getData(); let res = await UpdateUser(data); if (res.data.code === 200) { - msg("更新成功"); userInfo.province = res.data.data.province; userInfo.city = res.data.data.city; userInfo.area = res.data.data.area; @@ -207,6 +205,7 @@ class UserInfo extends Component { if (res.data.data.integralText) { this.setState({ isShowIntegralText: true }); } else { + msg("更新成功"); this.goUser(); } } @@ -419,7 +418,7 @@ class UserInfo extends Component { close={this.closeIntegralText} confirm={this.closeIntegralText} /> - + 个人信息 请完善您的个人信息 diff --git a/src/pages/userInfoDetail/userInfoDetail.less b/src/pages/userInfoDetail/userInfoDetail.less index eabfad9..d40a284 100644 --- a/src/pages/userInfoDetail/userInfoDetail.less +++ b/src/pages/userInfoDetail/userInfoDetail.less @@ -29,7 +29,7 @@ button::after { border: none; } .infobox1 .avatar_box { - width: max-content; + width: 100rpx; } .infobox1 .avatar_box .headimg { width: 100rpx; @@ -164,6 +164,7 @@ button::after { background: #ffffff; box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21); padding-bottom: 21rpx; + padding-bottom: env(safe-area-inset-bottom); .btn { width: 690rpx; height: 90rpx; diff --git a/src/pages/userPolicy/userPolicy.tsx b/src/pages/userPolicy/userPolicy.tsx index e8249f2..3abd443 100644 --- a/src/pages/userPolicy/userPolicy.tsx +++ b/src/pages/userPolicy/userPolicy.tsx @@ -52,14 +52,7 @@ export default class UserPolicy extends Component { - " + - // nodes + - // "" - } - /> + ); diff --git a/src/pages/webViewPage/webViewPage.tsx b/src/pages/webViewPage/webViewPage.tsx index 8fec071..b1e88a9 100644 --- a/src/pages/webViewPage/webViewPage.tsx +++ b/src/pages/webViewPage/webViewPage.tsx @@ -26,8 +26,11 @@ export default class WebViewPage extends Component { componentDidHide() {} async initData() { - console.log("this.$instance.router", this.$instance.router); - this.setState({ url: this.$instance.router?.params?.url }); + let url = this.$instance.router?.params?.url; + if (!url?.includes("https://") && !url?.includes("http://")) { + url = "https://" + url; + } + this.setState({ url: url }); } render() { diff --git a/src/utils/request.js b/src/utils/request.js index 55ddd30..4c17c73 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -108,7 +108,7 @@ export const Ajax = (params) => { }); }, complete() { - Taro.hideLoading(); + // Taro.hideLoading(); // const requestUrlList = global_requestUrlList; // const newRequestUrlList = requestUrlList.splice( // requestUrlList.indexOf(params.url), @@ -262,7 +262,7 @@ export const AjaxFormData = (params) => { }); }, complete() { - Taro.hideLoading(); + // Taro.hideLoading(); const requestUrlList = global_requestUrlList; const newRequestUrlList = requestUrlList.splice( requestUrlList.indexOf(params.url), diff --git a/src/utils/traoAPI.js b/src/utils/traoAPI.js index ea96d7c..172165e 100644 --- a/src/utils/traoAPI.js +++ b/src/utils/traoAPI.js @@ -100,15 +100,31 @@ const jupmFun = (type, data) => { try { switch (type) { case 1: // 跳转内部链接 - if (data.linkParams) { - Taro.reLaunch({ - url: data.link + "?" + data.linkParams, - }); - } else { - Taro.reLaunch({ + let tabbar = [ + "/pages/index/index", + "/pages/activity/activity", + "/pages/detect/detect", + "/pages/shop/shop", + "/pages/user/user", + ]; + if (tabbar.includes(data.link)) { + // tabbar页不能带参数 + Taro.setStorageSync(data.link + "-jupm-params", data.linkParams); + Taro.switchTab({ url: data.link, }); + } else { + if (data.linkParams) { + Taro.navigateTo({ + url: data.link + "?" + data.linkParams, + }); + } else { + Taro.navigateTo({ + url: data.link, + }); + } } + break; case 3: // 跳转外部链接 if (data.linkParams) { @@ -140,9 +156,10 @@ const jupmFun = (type, data) => { }); break; case 5: // 跳转视频号 + // Taro.getChannelsLiveInfo(); Taro.openChannelsActivity({ finderUserName: data.videoNo, - feedId: data.feedId, + // feedId: data.feedId, success: (res) => { // 打开成功 console.log("跳转视频号success", res);