Browse Source

修改返回

wangxy 19 hours ago
parent
commit
e6b2d01e5a

+ 17 - 5
pages/chanpinMy/components/duihuanmaDialog.vue

@@ -1,13 +1,17 @@
 <!-- 小弹窗 一行文字 -->
 <template>
-	<uni-popup ref="tipSmallPopup" :animation="false" :is-mask-click="false"
+	<uni-popup ref="tipSmallPopup" :animation="true" :is-mask-click="false"
 	 mask-background-color="rgba(255, 255, 255, 0.6);">
-	 <view class="ezy-tip-dialog tip-small-dialog duihuan-dialog">
+	 <view class="ezy-tip-dialog tip-small-dialog duihuan-dialog"  style="height: 100vh">
 		<view class="tip-content-box">
-			<view class="tip-title">{{title}}</view>
+			<view class="icon-title-navBar-box">
+				<view class="nav-bar-title">{{title}}</view>
+		
+			</view>
+			<view>{{nickName}}</view>
+			<view>{{userName}}</view>
 				<input class="duihuan-input" type="text" focus v-model="duihuamaValue" placeholder="请输入兑换码" />
 				<view class="tip-btn-box">
-					<view class="not-confirm-btn" @click="handleClose"></view>
 					<view class="confirm-btn" @click="confirmBtn"></view>
 				</view>
 		</view>
@@ -27,13 +31,21 @@
 		require: true,
 	    default: ''
 	  },
+	  userName: {
+		  type: String,
+		  default: ''
+	  },
+	  nickName: {
+		  type: String,
+		  default: ''
+	  },
 	});
 	const tipSmallPopup = ref(null); // 索引
 	const duihuamaValue = ref(''); // 索引
 	const $emit = defineEmits(['confirm-btn'])
 	// 打开弹窗
 	function handleShow() {
-		tipSmallPopup.value.open();
+		tipSmallPopup.value.open('bottom');
 	}
 	// 取消
 	function handleClose() {

+ 2 - 2
pages/chanpinMy/my.vue

@@ -40,7 +40,7 @@
 			</view>
 		</view>
 
-		<duihuanmaDialog ref="duihuanmaDialogRef" @confirm-btn="duihuanmaBtn" title="兑换"></duihuanmaDialog>
+		<duihuanmaDialog ref="duihuanmaDialogRef" @confirm-btn="duihuanmaBtn" title="兑换" :userName="myInfoData.userName" :nickName="myInfoData.nickName"></duihuanmaDialog>
 		<loginComp ref="loginRef"></loginComp>
 		<!-- 底部 -->
 		<custom-tab-bar :show="true" :current-index="currentTabIndex" />
@@ -82,6 +82,7 @@
 		icon: '',
 	});
 	let pageFrom = ref(null)
+	let duihuanmaDialogRef = ref(null)
 
 	onShow(() => {
 		currentTabIndex.value = 3
@@ -161,7 +162,6 @@
 
 
 
-
 			} else {
 				// 已登录
 				duihuanmaDialogRef.value.handleShow();

+ 86 - 0
pages/chanpinShangcheng/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <view class="ezy-xuanke-page">
+    <!-- 返回区域 -->
+    <view class="icon-title-navBar-box">
+      <text class="nav-bar-title">选课</text>
+    </view>
+    <view class="ezy-page-body">
+      <!-- 头部区域 -->
+
+      <view class="xuanke-tab-box">
+        <!-- 动画按钮 -->
+        <ezyActiveVue class="ezy-btn-active tab-item" v-for="item in data.list" :key="item.value"
+                      :class="{active: item.value == data.chanpinActiveSelect}" @aclick="handleSelectChanpin(item)">
+          {{item.name}}</ezyActiveVue>
+      </view>
+      <!-- 英语列表 -->
+      <template v-if="data.chanpinActiveSelect == 1">
+        <view class="ezy-no-sj" v-if="data.list.length">
+          <icon></icon>
+          <text>暂无数据</text>
+        </view>
+      </template>
+      <!-- 数学列表 -->
+      <shuxueListVue v-if="data.chanpinActiveSelect == 2" :list="data.shuxueList"></shuxueListVue>
+      <!-- 语文列表 -->
+      <template v-if="data.chanpinActiveSelect == 3">
+        <view class="ezy-no-sj" v-if="data.list.length">
+          <icon></icon>
+          <text>暂无数据</text>
+        </view>
+      </template>
+    </view>
+  </view>
+  <custom-tab-bar :show="true" :current-index="currentTabIndex" />
+</template>
+
+<script setup>
+import {
+  reactive, ref
+} from "vue";
+import shuxueListVue from "./components/shuxueList.vue";
+import {
+  onLoad,
+  onShow
+} from "@dcloudio/uni-app"
+import * as shuxueHttp from "@/api/chanpinShuxue.js"
+import CustomTabBar from "@/components/custom-tabbar/index.vue";
+import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+
+let currentTabIndex = ref(0)
+const data = reactive({
+  list: [{
+    name: '英语',
+    value: 1
+  },
+    {
+      name: '数学',
+      value: 2
+    },
+    {
+      name: '语文',
+      value: 3
+    },
+  ],
+  chanpinActiveSelect: 2,
+
+  shuxueList: [],
+})
+
+function getShuxueList() {
+  shuxueHttp.getShuxueChanpinList().then(res => {
+    data.shuxueList = res.data;
+  })
+}
+
+function handleSelectChanpin(item) {
+  data.chanpinActiveSelect = item.value
+}
+onShow(() => {
+  currentTabIndex.value = 0;
+})
+onLoad(() => {
+  uni.hideTabBar()
+  getShuxueList()
+})
+</script>