feat(custom): 新增用户协议
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-15 16:06:24 +08:00
parent 5844762b25
commit aef52631e7
11 changed files with 113 additions and 10 deletions

View File

@@ -6,7 +6,14 @@ import logoImg from "../../../static/logo.jpg";
const isShow = ref(false);
const val = ref(false);
const getCode = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.showLoading({
title: "授权中...",
mask: true,
@@ -24,10 +31,22 @@ const getCode = () => {
};
const toPage = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.navigateTo({
url: "/pages/users/bindPhone/index?type=1",
});
};
const clickText = (type: number, text: string) => {
console.log("点击了协议", type);
Taro.navigateTo({
url: `/pages/users/user_agreement/index?type=${type}&name=${text}`,
});
};
</script>
<template>
@@ -38,11 +57,28 @@ const toPage = () => {
<view>捷兑通</view>
</view>
<view class="center">
<nut-button type="success" @click="getCode">微信登录</nut-button>
<nut-button type="primary" @click="getCode">一键微信授权登录</nut-button>
<nut-button style="margin-top: 15px" @click="toPage"
>手机号登录</nut-button
>
</view>
<view class="checkbox"
><nut-checkbox v-model="val"></nut-checkbox>
<view class="text">
阅读并同意
<view style="color: #fa2c1a" @click.stop="clickText(1, '用户协议')">
用户协议
</view>
&<view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')">
隐私政策 </view
>&<view
style="color: #fa2c1a"
@click.stop="clickText(3, '积分使用规则')"
>
积分使用规则
</view>
</view>
</view>
<UserModal v-model:isShow="isShow" @closeEdit="isShow = false" />
</view>
</template>
@@ -86,4 +122,22 @@ page {
padding: 10px 100px;
}
}
.checkbox {
position: absolute;
bottom: -15%;
width: 100%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: center;
.nut-checkbox__label {
margin-left: -60px;
}
.text {
display: flex;
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view>
<view class="topTips">
<!-- <view class="topTips">
<view>
<view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px"
@@ -11,7 +11,7 @@
</view>
</view>
<image src="../static/user/order_list_top.png" />
</view>
</view> -->
<view class="tabs">
<view
class="item"

View File

@@ -0,0 +1 @@
export default definePageConfig({});

View File

@@ -0,0 +1,37 @@
<template>
<view><rich-text :nodes="nodes"></rich-text> </view>
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getAgreement } from "../../../api/user";
const nodes = ref(``);
Taro.useLoad((e) => {
Taro.setNavigationBarTitle({
title: e.name,
});
get_data(e.type);
});
const get_data = async (type: string) => {
const res = await getAgreement();
switch (type) {
case "1":
nodes.value = res.data.data.user;
break;
case "2":
nodes.value = res.data.data.policy;
break;
case "3":
nodes.value = res.data.data.integral;
break;
}
};
</script>
<style lang="scss">
@import "./index.scss";
</style>