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", "name": "jdt-user",
"version": "3.0.11", "version": "3.0.12",
"private": true, "private": true,
"description": "", "description": "",
"templateInfo": { "templateInfo": {
@@ -9,7 +9,7 @@
"css": "sass" "css": "sass"
}, },
"taroConfig": { "taroConfig": {
"version": "3.0.11" "version": "3.0.12"
}, },
"scripts": { "scripts": {
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,14 @@ import logoImg from "../../../static/logo.jpg";
const isShow = ref(false); const isShow = ref(false);
const val = ref(false);
const getCode = () => { const getCode = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.showLoading({ Taro.showLoading({
title: "授权中...", title: "授权中...",
mask: true, mask: true,
@@ -24,10 +31,22 @@ const getCode = () => {
}; };
const toPage = () => { const toPage = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.navigateTo({ Taro.navigateTo({
url: "/pages/users/bindPhone/index?type=1", 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> </script>
<template> <template>
@@ -38,11 +57,28 @@ const toPage = () => {
<view>捷兑通</view> <view>捷兑通</view>
</view> </view>
<view class="center"> <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 style="margin-top: 15px" @click="toPage"
>手机号登录</nut-button >手机号登录</nut-button
> >
</view> </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" /> <UserModal v-model:isShow="isShow" @closeEdit="isShow = false" />
</view> </view>
</template> </template>
@@ -86,4 +122,22 @@ page {
padding: 10px 100px; 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> </style>

View File

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