Explorar el Código

提现的接口修改

zhangyujun hace 3 años
padre
commit
4bd935eddf

+ 1 - 1
src/api/modules/cashOut.ts

@@ -25,7 +25,7 @@ class CashOut {
 
 	/**微信提现 */
 	cashout(params: { amount: number }): AxiosPromise<CashoutRes> {
-		return request("wx/extract/withdraw", {
+		return request("/student/wx/extract/withdraw", {
 			params,
 			method: "post",
 		});

BIN
src/assets/img/招行.png


BIN
src/assets/img/提现到银行卡.png


+ 4 - 1
src/components/m-exercise/index.vue

@@ -78,7 +78,7 @@
 	<!-- 分割线 -->
 	<van-divider />
 	<!-- 功能选择列表 -->
-	<functionList :currentSubject="currentSubject" @subjectAudioPlay="subjectAudioPlay" @addCurrentQuestion="addCurrentQuestion" v-model:skillsShow="skillsShow" />
+	<functionList v-if="!hideFunctionList" :currentSubject="currentSubject" @subjectAudioPlay="subjectAudioPlay" @addCurrentQuestion="addCurrentQuestion" v-model:skillsShow="skillsShow" />
 	<!-- 技巧讲解 -->
 	<explainJq
 		@audioPause="
@@ -141,6 +141,9 @@ const {
 
 const props = defineProps<{
 	listType: ExerciseType.ListType;
+	hideFunctionList:Boolean
+
+
 }>();
 
 const isVip = store.getters.getIsVip;

+ 17 - 0
src/hooks/base/userData.ts

@@ -0,0 +1,17 @@
+import { computed } from "vue";
+
+declare interface userData {
+    nickname:string,
+    sex:string,
+    headimgurl:string,
+    expireTime:string,
+    openid:string,
+    phone:null|string,
+    saleType:number
+
+}
+export const userData = computed(() => {
+    let vuexJson = window.localStorage.getItem("vuex") || "{}"
+    let userData:userData = JSON.parse(vuexJson).userData
+    return userData
+});

+ 2 - 2
src/store/index.ts

@@ -22,8 +22,8 @@ const store = createStore({
     getIsVip(state): Boolean {
       const userTime: number = dayjs(store.getters.getUserData.expireTime).valueOf();
       const currentTime: number = dayjs().valueOf();
-      //return (userTime - currentTime) > 0
-      return true
+      return (userTime - currentTime) > 0
+      // return true
     }
   },
   mutations: {

+ 144 - 116
src/views/cashOut/index.vue

@@ -3,16 +3,22 @@
 		<m-nav-bar :transparent="true" title="提现页面" style="color: #ffffff" />
 		<div class="user-data">
 			<div class="left">
-				<m-user-avatar />
+				<!-- <m-user-avatar /> -->
 				<div class="name">
-					<m-user-name />
+					<!-- <m-user-name /> -->
 					<span
-						>可提现余额<span class="grade">{{ profitPrice }}</span
-						>元</span
+						><span class="grade">{{ profitPrice }}</span></span
 					>
+					<div>可提现余额(元)</div>
 				</div>
 			</div>
-			<m-button @click="showCashout(updateExtractList)" class="continue" width="90px" height="30px" text="我要提现" />
+			<div class="draw-button">
+				<m-button @click="showCashout(updateExtractList)" class="continue" width="90px" height="30px" text="我要提现" />
+			</div>
+			<!-- <div  class="draw-button mr15">
+				<m-button @click="()=>{
+					push('/drawByBank')}" class="bank" width="90px" height="30px" text="银行卡提现" />
+			</div> -->
 		</div>
 	</div>
 	<div class="summary content-box">
@@ -37,140 +43,162 @@
 </template>
 
 <script lang="ts">
-	import { CashOutModel } from "@/model/cashOut";
-	import { ref, onBeforeMount } from "vue";
-	const cashOutModel = new CashOutModel();
-
-	/**用户提现列表展示 */
-	const useExtract = () => {
-		type ExtractType = {
-			status: number;
-			extractPrice: number;
-			partnerTradeNo: string;
-			id: number;
-			createTime: string;
-		};
-
-		const extractList = ref<Array<ExtractType>>([]);
-
-		const updateExtractList = async () => {
-			const extractListRes = await cashOutModel.extractList();
-			extractList.value = extractListRes.rows;
-		};
-
-		onBeforeMount(updateExtractList);
+import { CashOutModel } from "@/model/cashOut";
+import { ref, onBeforeMount } from "vue";
+import { userData} from "@/hooks/base/userData"
+const cashOutModel = new CashOutModel();
+/**用户提现列表展示 */
+const useExtract = () => {
+	type ExtractType = {
+		status: number;
+		extractPrice: number;
+		partnerTradeNo: string;
+		id: number;
+		createTime: string;
+	};
 
-		return {
-			extractList,
-			updateExtractList,
-		};
+	const extractList = ref<Array<ExtractType>>([]);
+	// const userData = 
+	const updateExtractList = async () => {
+		const extractListRes = await cashOutModel.extractList();
+		extractList.value = extractListRes.rows;
+	};
+	onBeforeMount(updateExtractList);
+	const isAgent = userData.value.saleType==2||userData.value.saleType==3||false
+	return {
+		extractList,
+		updateExtractList,
+		userData,
+		isAgent,
+		
 	};
+};
 </script>
 
 <script lang="ts" setup>
-	import { useProfitPrice } from "@/hooks/user";
-	import { showCashout } from "./components/cashout";
-	const searchValue = ref("");
-
-	const { profitPrice } = useProfitPrice();
-	const { extractList, updateExtractList } = useExtract();
+import { useProfitPrice } from "@/hooks/user";
+import { showCashout } from "./components/cashout";
+import { useRouter } from "vue-router";
+const searchValue = ref("");
+const push = useRouter().push
+const { profitPrice } = useProfitPrice();
+const { extractList, updateExtractList } = useExtract();
 </script>
 
 <style scoped lang="scss">
-	.header-back {
-		width: 375px;
-		padding-bottom: 82px;
-		background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
-		border-radius: 0px 0px 82px 82px;
-		.user-data {
+.mr15{
+	margin-top: 15px;
+}
+.header-back {
+	width: 375px;
+	padding-bottom: 82px;
+	background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
+	border-radius: 0px 0px 82px 82px;
+	.user-data {
+		display: flex;
+		justify-content: center;
+		flex-wrap: wrap;
+		.draw-button {
+			width: 100%;
+			display: flex;
+			justify-content: center;
+		}
+
+		.left {
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
-			padding: 19px 17px 24px;
-			.left {
+			margin-bottom: 12px;
+			.name {
 				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				.name {
-					display: flex;
-					flex-direction: column;
-					font-size: 13px;
-					color: #ffffff;
-					justify-content: space-between;
-					margin-left: 6px;
-					.grade {
-						font-size: 24px;
-						padding: 4px;
-					}
-				}
-			}
-			.continue {
+				flex-direction: column;
 				font-size: 13px;
-				font-family: PingFang SC;
-				font-weight: 400;
-				line-height: 19px;
+				width: 100%;
 				color: #ffffff;
-				background: #01c18d;
+				justify-content: space-between;
+				margin-left: 6px;
+				.grade {
+					font-size: 36px;
+					padding: 4px;
+				}
 			}
 		}
-	}
-	.content-box {
-		width: 345px;
-		background: #ffffff;
-		box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
-		border-radius: 10px;
-		position: relative;
-		left: 50%;
-		transform: translateX(-50%);
-		top: -82px;
-		margin-top: 10px;
-	}
-	.summary {
-		display: flex;
-		justify-content: space-around;
-		box-sizing: border-box;
-		overflow: hidden;
-		.search {
-			width: 100%;
+		.bank{
+			font-size: 13px;
+			font-family: PingFang SC;
+			font-weight: 400;
+			line-height: 19px;
+			color: #498ef5;
+			background: #fff;
+
+		}
+		.continue {
+			font-size: 13px;
+			font-family: PingFang SC;
+			font-weight: 400;
+			line-height: 19px;
+			color: #498ef5;
+			background: #fff;
 		}
 	}
-	.test-scores {
+}
+.content-box {
+	width: 345px;
+	background: #ffffff;
+	box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
+	border-radius: 10px;
+	position: relative;
+	left: 50%;
+	transform: translateX(-50%);
+	top: -82px;
+	margin-top: 10px;
+}
+.summary {
+	display: flex;
+	justify-content: space-around;
+	box-sizing: border-box;
+	overflow: hidden;
+	.search {
+		width: 100%;
+	}
+}
+.test-scores {
+	font-size: 13px;
+	font-family: PingFang SC;
+	font-weight: 400;
+	line-height: 19px;
+	color: #0a1a33;
+	padding: 15px;
+	box-sizing: border-box;
+	.table {
+		width: 100%;
+		border-collapse: collapse;
 		font-size: 13px;
-		font-family: PingFang SC;
-		font-weight: 400;
-		line-height: 19px;
-		color: #0a1a33;
-		padding: 15px;
-		box-sizing: border-box;
-		.table {
-			width: 100%;
-			border-collapse: collapse;
-			font-size: 13px;
 
-			th {
-				padding: 5px;
-				color: #0a1a33;
+		th {
+			padding: 5px;
+			color: #0a1a33;
+		}
+		td {
+			text-align: center;
+			padding: 5px;
+			color: #8a9099;
+		}
+		tr {
+			&:nth-of-type(n) {
+				background: #ffffff;
 			}
-			td {
-				text-align: center;
-				padding: 5px;
-				color: #8a9099;
-			}
-			tr {
-				&:nth-of-type(n) {
-					background: #ffffff;
-				}
-				&:nth-of-type(2n) {
-					background: rgba(73, 142, 245, 0.15);
-				}
+			&:nth-of-type(2n) {
+				background: rgba(73, 142, 245, 0.15);
 			}
+		}
 
-			.oneColunm {
-				white-space: nowrap;
-				text-overflow: ellipsis;
-				overflow: hidden;
-				width: 50px;
-			}
+		.oneColunm {
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			overflow: hidden;
+			width: 50px;
 		}
 	}
+}
 </style>

+ 1 - 1
src/views/classifyCol/index.vue

@@ -100,7 +100,7 @@ getTopicClass(query.path as string, {
 	...query,
 	excellIssueName: "选学",
 }).then(({data}) => {
-	data.data.shift();
+	
 	classDataRight.value = data.data;
 });
 </script>

+ 124 - 0
src/views/classifyOrder/index.vue

@@ -0,0 +1,124 @@
+<template>
+	<m-nav-bar :title="query.title" />
+	<div class="cell-box">
+		<van-cell class="cell" :title="item.placeIssueName || item.classIssueName || item.excellIssueName || item.sequeIssueName" center v-for="(item, index) in classData" :key="index" :border="false">
+			<div class="select">
+				<div
+					class="select-item0"
+					@click="
+						() => {
+							push({
+								name: 'exercise',
+								query: {
+									...query,
+									classIssueName: item.classIssueName,
+									placeIssueName: item.placeIssueName,
+									excellIssueName: item.excellIssueName,
+									sequeIssueName: item.sequeIssueName,
+									placeIssue: item.placeIssue,
+									classIssue: item.classIssue,
+									excellIssue: item.excellIssue,
+									sequeIssue: item.sequeIssue,
+								},
+							});
+						}
+					">
+					语音讲解
+				</div>
+				<div
+					@click="
+						() => {
+							push({
+								name: 'exerciseStrict',
+								query: {
+									...query,
+									classIssueName: item.classIssueName,
+									placeIssueName: item.placeIssueName,
+									excellIssueName: item.excellIssueName,
+									sequeIssueName: item.sequeIssueName,
+									placeIssue: item.placeIssue,
+									classIssue: item.classIssue,
+									excellIssue: item.excellIssue,
+									sequeIssue: item.sequeIssue,
+								},
+							});
+						}
+					"
+					class="select-item1">
+					单项测试
+				</div>
+			</div>
+			<template #icon>
+				<div class="icon">{{ index + 1 }}</div>
+			</template>
+		</van-cell>
+	</div>
+</template>
+
+<script setup lang="ts">
+import { getTopicClass } from "@/api";
+import { ref } from "vue";
+import { RouterBus } from "@/hooks";
+const {
+	route: { query },
+	router: { push },
+} = new RouterBus();
+const classData = ref();
+getTopicClass(query.path as string, query).then(({ data }) => {
+	data.data.shift();
+	classData.value = data.data;
+});
+</script>
+
+<style lang="scss" scoped>
+:deep .van-cell__value {
+	flex: 1.2;
+}
+.cell-box {
+	display: flex;
+	padding: 5px 15px;
+	flex-wrap: wrap;
+	justify-content: space-between;
+	.cell {
+		width: 100%;
+		border-bottom: 1px solid #ddd;
+		line-height: 28px;
+
+		// box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
+	}
+	.select {
+		display: flex;
+		flex-direction: row;
+		color: white;
+
+		.select-item0 {
+			padding: 0 12px;
+			background: #498ef5;
+			margin-right: 10px;
+			border-radius: 8px;
+			font-size: 12px;
+		}
+
+		.select-item1 {
+			padding: 0 12px;
+			background: #06bd5e;
+			font-size: 12px;
+			border-radius: 8px;
+		}
+	}
+	.icon {
+		width: 20px;
+		height: 20px;
+		background: #498ef5;
+		border-radius: 50%;
+		font-weight: 500;
+		font-family: PingFang SC;
+		font-size: 13px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		color: #ffffff;
+		margin-right: 5px;
+	}
+}
+</style>

+ 120 - 0
src/views/drawByBank/index.vue

@@ -0,0 +1,120 @@
+<template>
+	<div class="">
+		<div class="header0">
+			<m-nav-bar :transparent="true" title="提现记录" style="color: #ffffff" />
+			<div class="btn1-container">
+				<div class="btn1">
+					<img class="" src="@/assets/img/提现到银行卡.png" />
+					<span class="btn1-text">提现到银行卡</span>
+				</div>
+			</div>
+		</div>
+        <div class="rect1"></div>
+		<div class="list">
+			<div class="draw">
+				<span class="draw-text1">最近转账·一点即提</span>
+                <span class="draw-text2">查看全部</span>
+			</div>
+            <div class="list-item">
+                <img src="@/assets/img/招行.png" class="bank-logo">
+                <div>
+                    <div  class="list-item-text1">林好</div>
+                    <div class="list-item-text2">中国建设银行(6227****2458)</div>
+                </div>
+                <div class="list-item-text3">2021-10-11 18:17:06 </div>
+
+            </div>
+		</div>
+	</div>
+</template>
+
+<script setup lang="ts">
+</script>
+
+<style lang="scss" scoped>
+.header0 {
+	background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
+}
+.btn1-container {
+	padding-top: 26px;
+	padding-bottom: 30px;
+}
+.btn1 {
+	margin: 0 auto;
+	width: 256px;
+	border-radius: 10px;
+	background: #fff;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	align-content: center;
+	height: 55px;
+	.btn1-text {
+		font-size: 16px;
+		color: #498ef5;
+	}
+
+	img {
+		width: 31px;
+		height: 24px;
+	}
+}
+.rect1{
+    width: 100%;
+    height: 13px;
+    background: #F5F5F5;
+
+
+}
+.list {
+	.draw {
+		width: 100%;
+		height: 63px;
+		padding-left: 29px;
+		padding-right: 29px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+		.draw-text1 {
+			font-size: 15px;
+			color: #333;
+            font-weight: 600;
+			font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", miui, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
+		}
+        .draw-text2{
+            font-size: 13px;
+            color: #498EF5;
+
+        }
+	}
+    .list-item{
+        width: 345px;
+        height: 65px;
+        margin: 0 auto;
+        display: flex;
+        position: relative;
+        align-content: flex-start;
+        align-items: flex-start;
+        .bank-logo{
+            width: 25px;
+            height: 25px;
+            margin-right: 8px;
+            margin-top: 19px;
+        }
+        .list-item-text1{
+            font-size: 15px;
+        }
+        .list-item-text2{
+            font-size: 13px;
+            color: #5C6066;
+        }
+        .list-item-text3{
+            position: absolute;
+            right: 0;
+            font-size: 11px;
+            color: #8A9099;
+         
+        }
+    }
+}
+</style>

+ 12 - 0
src/views/exerciseStrict/index.vue

@@ -0,0 +1,12 @@
+<script lang="tsx">
+	import { defineComponent } from "vue";
+	export default defineComponent({
+		setup() {
+			return () => {
+				return <m-exercise hideFunctionList={ true } listType="normal" />;
+			};
+		},
+	});
+</script>
+
+<style lang="scss" scoped></style>

+ 1 - 1
src/views/home/children/test/components/sujectOne.vue

@@ -66,7 +66,7 @@ const testList = [
 				icon: "顺序练习",
 				name: "顺序练习",
 				route: {
-					name: "classify",
+					name: "classifyOrder",
 					query: {
 						...props.query,
 						path: "selectSxQustionInfo",