diff --git a/src/app.config.ts b/src/app.config.ts index d609852..1384a7e 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,4 +1,5 @@ export default defineAppConfig({ + __usePrivacyCheck__: true, pages: [ 'pages/index/index', 'pages/login/login', diff --git a/src/app.less b/src/app.less index 2b6d1c0..4f0d876 100644 --- a/src/app.less +++ b/src/app.less @@ -103,6 +103,16 @@ image { flex-direction: column; } +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} + // 全局覆盖组件库样式 page { --primary-color: #000; diff --git a/src/components/modal/registerModal/registerModal.tsx b/src/components/modal/registerModal/registerModal.tsx index 9fe92f3..b295a5a 100644 --- a/src/components/modal/registerModal/registerModal.tsx +++ b/src/components/modal/registerModal/registerModal.tsx @@ -48,6 +48,7 @@ class RegisterModal extends Component { Dialog_.alert({ title: "提示", message: "暂未授权注册,请点击注册", + theme: "round-button", }).then((value) => { this.resetColor(); this.goRegister(); diff --git a/src/components/navbar/navbar.less b/src/components/navbar/navbar.less index 2103eb3..af581a2 100644 --- a/src/components/navbar/navbar.less +++ b/src/components/navbar/navbar.less @@ -21,7 +21,9 @@ left: 0; right: 0; display: flex; - justify-content: center; + // justify-content: center; + justify-content: space-between; + align-items: center; background: #fff; z-index: 99; .logo { @@ -29,6 +31,13 @@ align-items: center; width: 220rpx; } + .back { + width: 80rpx; + padding: 20rpx 0; + text-align: center; + color: #666; + font-size: 42rpx; + } } .nav_top_padding { diff --git a/src/components/navbar/navbar.tsx b/src/components/navbar/navbar.tsx index 048032e..9c1717b 100644 --- a/src/components/navbar/navbar.tsx +++ b/src/components/navbar/navbar.tsx @@ -4,7 +4,7 @@ import Taro from "@tarojs/taro"; import "./navbar.less"; import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; - +import { back } from "../../utils/traoAPI"; export default class Navbar extends Component { constructor(props) { super(props); @@ -33,6 +33,10 @@ export default class Navbar extends Component { this.setStatusBar(); } + back = () => { + back(); + }; + setStatusBar() { Taro.getSystemInfoAsync({ success: (res) => { @@ -55,6 +59,7 @@ export default class Navbar extends Component { } render() { + let { isBack } = this.props; let { statusBarHeight, navigationBarHeight, navHeight } = this.state; const statusBarHeightRpx = statusBarHeight * 2; const navigationBarHeightRpx = navigationBarHeight * 2; @@ -69,21 +74,23 @@ export default class Navbar extends Component { paddingTop: statusBarHeightRpx + "rpx", }} > + + {isBack && ( + + )} + + - {/* - - - - - - */} ); } diff --git a/src/components/popup/popup-alert.less b/src/components/popup/popup-alert.less new file mode 100644 index 0000000..e4ffc13 --- /dev/null +++ b/src/components/popup/popup-alert.less @@ -0,0 +1,59 @@ +.alert-box { + width: 650rpx; + // height: 800rpx; + padding: 40rpx; + padding-bottom: 80rpx; + box-sizing: border-box; + .alert-popup-title { + font-size: 36rpx; + font-weight: 700; + text-align: center; + color: #000; + } +} + +.alert-popup-content-box { + margin-top: 60rpx; +} + +.alert-popup-content { + font-size: 28rpx; + margin-bottom: 20rpx; +} + +.alert-popup-content.is-alert { + color: #41a9fc; + text-decoration: underline; +} + +.alert-popup-content.is-last { + margin-bottom: 0; +} + +.alert-popup-btns { + display: flex; + margin-top: 76rpx; + justify-content: center; +} + +.alert-popup-btn { + width: 480rpx; + height: 80rpx; + line-height: 80rpx; + font-size: 30rpx; + text-align: center; + border: 1rpx solid #000; + border-radius: 40rpx; + color: #fff; + background-color: #000; +} + +// .alert-popup-btn:first-child { +// margin-left: 22rpx; +// background-color: transparent; +// } + +// .confirm-popup-btn:last-child { +// color: #fff; +// background-color: #000; +// } diff --git a/src/components/popup/popup-alert.tsx b/src/components/popup/popup-alert.tsx new file mode 100644 index 0000000..1702d3b --- /dev/null +++ b/src/components/popup/popup-alert.tsx @@ -0,0 +1,101 @@ +import classnames from "classnames"; +import { Component } from "react"; + +import { + Block, + View, + Text, + Image, + Input, + Button, + PageMeta, +} from "@tarojs/components"; + +import { Popup } from "@antmjs/vantui"; + +import "@antmjs/vantui/lib/popup/index.less"; +import "@antmjs/vantui/lib/transition/index.less"; +import "@antmjs/vantui/lib/overlay/index.less"; + +import "./popup-alert.less"; + +import { go } from "../../utils/traoAPI"; + +/*** props + * isShow 是否显示 + * title 弹窗标题 + * content 弹窗内容 + * confirmButtonText 确定按钮 + * textAlgin 文本对齐 left right center + * type: 1注册 + * @confirm 关闭回调 + * ***/ +export default class PopupAlert extends Component { + constructor(props) { + super(props); + this.state = { + name: "确认组件", + }; + } + + async onLoad() {} + componentDidMount() {} + + componentWillUnmount() {} + + componentDidShow() {} + + componentDidHide() {} + + async initData() {} + + onConfirm = () => { + let { type } = this.props; + + switch (type) { + case "1": + go("/pages/register/register"); + break; + } + this.props.confirm(); + }; + + onClickStop = (e) => { + e.stopPropagation(); + }; + + render() { + let { title, content, confirmButtonText, textAlgin } = this.props; + return ( + + + + + {title} + + + {content} + + + + + + + + + ); + } +} diff --git a/src/components/popup/popup-confirm.less b/src/components/popup/popup-confirm.less new file mode 100644 index 0000000..2e026f4 --- /dev/null +++ b/src/components/popup/popup-confirm.less @@ -0,0 +1,57 @@ +.confirm-box { + width: 650rpx; + // height: 800rpx; + padding: 40rpx; + padding-bottom: 80rpx; + box-sizing: border-box; + .confirm-popup-title { + font-size: 36rpx; + font-weight: 700; + text-align: center; + color: #000; + } +} + +.confirm-popup-content-box { + margin-top: 60rpx; +} + +.confirm-popup-content { + font-size: 28rpx; + margin-bottom: 20rpx; +} + +.confirm-popup-content.is-confirm { + color: #41a9fc; + text-decoration: underline; +} + +.confirm-popup-content.is-last { + margin-bottom: 0; +} + +.confirm-popup-btns { + display: flex; + margin-top: 76rpx; + justify-content: space-around; +} + +.confirm-popup-btn { + width: 240rpx; + height: 80rpx; + line-height: 80rpx; + font-size: 30rpx; + text-align: center; + border: 1rpx solid #000; + border-radius: 40rpx; +} + +.confirm-popup-btn:first-child { + margin-left: 22rpx; + background-color: transparent; +} + +.confirm-popup-btn:last-child { + color: #fff; + background-color: #000; +} diff --git a/src/components/popup/popup-confirm.tsx b/src/components/popup/popup-confirm.tsx new file mode 100644 index 0000000..e2e5ae0 --- /dev/null +++ b/src/components/popup/popup-confirm.tsx @@ -0,0 +1,112 @@ +import classnames from "classnames"; +import { Component } from "react"; + +import { + Block, + View, + Text, + Image, + Input, + Button, + PageMeta, +} from "@tarojs/components"; + +import { Popup } from "@antmjs/vantui"; +// import "@antmjs/vantui/lib/index.less"; + +import "@antmjs/vantui/lib/popup/index.less"; +import "@antmjs/vantui/lib/transition/index.less"; +import "@antmjs/vantui/lib/overlay/index.less"; + +import "./popup-confirm.less"; + +/*** props + * isShow 是否显示 + * title 弹窗标题 + * content 弹窗内容 + * cancelButtonText 取消按钮 + * confirmButtonText 确定按钮 + * textAlgin 文本对齐 left right center + * type: 1注册 + * @confirm 关闭回调 + * ***/ +export default class PopupConfirm extends Component { + constructor(props) { + super(props); + this.state = { + name: "确认组件", + // isShowconfirmPopup: true, + }; + } + + async onLoad() {} + componentDidMount() {} + + componentWillUnmount() {} + + componentDidShow() { + // 是否已授权隐私 + // if (Taro.getStorageSync("isconfirmPopup") !== "true") { + // // this.setState({ + // // showconfirmPopup: true, + // // }); + // this.props.closeconfirm(); + // } + } + + componentDidHide() {} + + async initData() {} + + onClose = () => { + this.props.close(); + }; + + onConfirm = () => { + this.props.confirm(); + }; + + onClickStop = (e) => { + e.stopPropagation(); + }; + + render() { + let { title, content, cancelButtonText, confirmButtonText, textAlgin } = + this.props; + return ( + + + + + {title} + + + {content} + + + + + + + + + + ); + } +} diff --git a/src/components/popup/popup-privacy.less b/src/components/popup/popup-privacy.less index e1cf9ac..4342634 100644 --- a/src/components/popup/popup-privacy.less +++ b/src/components/popup/popup-privacy.less @@ -6,8 +6,9 @@ box-sizing: border-box; .privacy-popup-title { font-size: 36rpx; - font-weight: 500; + font-weight: 700; text-align: center; + color: #000; } } diff --git a/src/components/popup/popup-privacy.tsx b/src/components/popup/popup-privacy.tsx index 5378c83..c4e62d4 100644 --- a/src/components/popup/popup-privacy.tsx +++ b/src/components/popup/popup-privacy.tsx @@ -35,7 +35,6 @@ export default class PopupPrivacy extends Component { componentWillUnmount() {} componentDidShow() { - // console.log("isShowPrivacyPopup show", this.state); // 是否已授权隐私 // if (Taro.getStorageSync("isPrivacyPopup") !== "true") { // // this.setState({ @@ -70,9 +69,9 @@ export default class PopupPrivacy extends Component { }, }); }; - handleAgreePrivacyAuthorization = () => { + handleAgreePrivacyAuthorization = (event) => { Taro.setStorageSync("isPrivacyPopup", "true"); - this.props.closePrivacy(); + this.props.closePrivacy(); // 通知父组件关闭 }; onClickStop = (e) => { @@ -80,7 +79,6 @@ export default class PopupPrivacy extends Component { }; render() { - // let { isShowPrivacyPopup } = this.state; return ( { show={this.props.isShowPrivacyPopup} round overlayStyle="width: 100vw;padding: 0;" - onClose={this.onClose} + // onClose={this.onClose} onClick={this.onClickStop} > @@ -110,15 +108,15 @@ export default class PopupPrivacy extends Component { - +