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

@@ -1,6 +1,6 @@
{
"name": "jdt-user",
"version": "3.0.11",
"version": "3.0.12",
"private": true,
"description": "",
"templateInfo": {
@@ -9,7 +9,7 @@
"css": "sass"
},
"taroConfig": {
"version": "3.0.11"
"version": "3.0.12"
},
"scripts": {
"build:weapp": "taro build --type weapp",

View File

@@ -1,5 +1,8 @@
import request from "@/utils/request";
// 获取用户协议
export const getAgreement = () => request("/user/agreement", {}, "POST");
// 登录
export const login = (data: object) => request("/login", data, "POST");
export const phoneLogin = (data: object) =>

View File

@@ -10,6 +10,7 @@ export default defineAppConfig({
{
root: "pages/users",
pages: [
"user_agreement/index",
"order_list/index",
"setting/index",
"user_setting/index",

View File

@@ -1,4 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "订单详情",
navigationStyle: "custom",
// navigationStyle: "custom",
});

View File

@@ -1,7 +1,7 @@
<template>
<view>
<back-component title="订单详情" />
<view class="card" style="margin-top: 115px">
<!-- <back-component title="订单详情" /> -->
<view class="card" style="margin-top: 15px">
<view class="header">
<view>
<text>台号: {{ data.seat }}</text>
@@ -64,6 +64,7 @@
<nut-cell title="下单数量" :desc="String(data.count)"></nut-cell>
<nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="赠送游戏豆" :desc="String(data.gift_pulse)"></nut-cell>
<nut-cell
v-if="data.status !== 0"
title="实收金额"
@@ -89,7 +90,7 @@ import { ref } from "vue";
import Taro from "@tarojs/taro";
import Footer from "../components/Footer.vue";
import { getAfterOrder } from "@/api/admin";
import BackComponent from "../../../../../components/Back.vue";
// import BackComponent from "../../../../../components/Back.vue";
const data = ref<any>({});

View File

@@ -11,7 +11,7 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import { onUnmounted, ref } from "vue";
import Taro from "@tarojs/taro";
import { getAfterOrder } from "@/api/admin";
@@ -23,6 +23,7 @@ const info = ref<any>({});
Taro.useLoad((e) => {
info.value = e;
console.log(e);
code.value = Taro.getStorageSync("pay_code");
time_id.value = setInterval(async () => {
const { data } = await getAfterOrder({
@@ -36,6 +37,7 @@ Taro.useLoad((e) => {
icon: "success",
});
setTimeout(() => {
Taro.removeStorageSync("pay_code");
Taro.navigateTo({
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${info.value.oid}&bid=${info.value.bid}`,
});
@@ -47,6 +49,10 @@ Taro.useLoad((e) => {
Taro.useDidHide(() => {
clearInterval(time_id.value);
});
onUnmounted(() => {
clearInterval(time_id.value);
});
</script>
<style lang="scss">

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>