wangguoyu 4 månader sedan
förälder
incheckning
934b664cb5
5 ändrade filer med 84 tillägg och 28 borttagningar
  1. 11 0
      api/order.js
  2. 3 3
      pages/mall/mallPage.vue
  3. 3 15
      pages/mall/productDialog.vue
  4. 11 10
      pages/pay/order.vue
  5. 56 0
      pages/pay/productDialog.vue

+ 11 - 0
api/order.js

@@ -64,4 +64,15 @@ export function orderCheck(data = {}) {
     data,
     timeout: 20000
   })
+}
+export function orderInfo(data = {}) {
+  return request({
+    'url': '/app/order/info',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 3 - 3
pages/mall/mallPage.vue

@@ -31,7 +31,7 @@
 								</view>
 							</view>
 							<view class="mall-bottom-row">
-								<view v-if="item.type ==1" class="kcb-btn" @click="productBtn(item)">课程包明细<icon>
+								<view v-if="item.type ==1" class="kcb-btn" @click="productBtn(item.levelList)">课程包明细<icon>
 									</icon>
 								</view>
 								<view class="hdj-text">活动价:{{item.xianjia}}</view>
@@ -61,7 +61,7 @@
 							</view>
 						</view>
 						<view class="mall-bottom-row">
-							<view v-if="item.type ==1" class="kcb-btn" @click="productBtn(item)">课程包明细<icon>
+							<view v-if="item.type ==1" class="kcb-btn" @click="productBtn(item.levelList)">课程包明细<icon>
 								</icon>
 							</view>
 							<view class="hdj-text">活动价:{{item.xianjia}}</view>
@@ -173,7 +173,7 @@
 	}
 
 	function productBtn(item) {
-		mallProductPopup.value.detailShow(item.id);
+		mallProductPopup.value.detailShow(item);
 	}
 
 	function detailBtn() {

+ 3 - 15
pages/mall/productDialog.vue

@@ -11,9 +11,8 @@
 						<img :src="item.cover" class="mall-image" />
 						<view class="content-body-box">
 							<view class="content-name">
-								<view class="name-text">{{item.name}}</view>
+								<view class="name-text">{{item.levelName}}</view>
 							</view>
-							<view class="content-text">{{item.intro}}</view>
 						</view>
 					</view>
 				</view>
@@ -40,19 +39,8 @@
 	// 打开弹窗
 	function detailShow(data) {
 
-		let req = {
-			id: data
-		}
-		mallCardInfo(req).then(res => {
-			console.log('res', res);
-			if (res.code == 0) {
-				productList.value = res.data
-				detailPopup.value.open();
-			} else {
-				toast('获取产品明细失败')
-				return false
-			}
-		})
+		productList.value = data
+		detailPopup.value.open();
 
 	}
 	// 开启提分之旅按钮

+ 11 - 10
pages/pay/order.vue

@@ -38,8 +38,8 @@
 											<view class="content-text">{{item2.intro}}</view>
 											<!-- 未付款数据对一下  是否有课程包明细 wgy-->
 											<view class="content-money-box">
-												<view class="order-kcb-btn" v-if="item.cardList.length>0"
-													@click="detailBtn">课程包明细<icon></icon>
+												<view class="order-kcb-btn" v-if="item2.type ==1"
+													@click="detailBtn(item2,index2)">课程包明细<icon></icon>
 												</view>
 												<text class="content-yuanjia">¥{{item2.xianjia}}</text>
 											</view>
@@ -112,8 +112,8 @@
 											<view class="content-text">{{item2.intro}}</view>
 											<!-- 未付款数据对一下  是否有课程包明细 wgy-->
 											<view class="content-money-box">
-												<view class="order-kcb-btn" v-if="item.cardList.length>0"
-													@click="detailBtn">课程包明细<icon></icon>
+												<view class="order-kcb-btn" v-if="item2.type ==1"
+													@click="detailBtn(item2,index2)">课程包明细<icon></icon>
 												</view>
 												<text class="content-yuanjia">¥{{item2.xianjia}}</text>
 											</view>
@@ -186,8 +186,8 @@
 											<view class="content-text">{{item2.intro}}</view>
 											<!-- 未付款数据对一下  是否有课程包明细 wgy-->
 											<view class="content-money-box">
-												<view class="order-kcb-btn" v-if="item.cardList.length>0"
-													@click="detailBtn">课程包明细<icon></icon>
+												<view class="order-kcb-btn" v-if="item2.type ==1"
+													@click="detailBtn(item2,index2)">课程包明细<icon></icon>
 												</view>
 												<text class="content-yuanjia">¥{{item2.xianjia}}</text>
 											</view>
@@ -233,7 +233,7 @@
 				</view>
 			</view>
 		</view>
-		<!-- 		<product-dialog ref="mallProductPopup" @payBtn="payBtn"></product-dialog> -->
+		<product-dialog ref="mallProductPopup"></product-dialog>
 		<CustomTabBar></CustomTabBar>
 	</view>
 </template>
@@ -245,6 +245,7 @@
 	} from "vue";
 	import {
 		getOrderList,
+		orderInfo,
 		orderAdd
 	} from "@/api/order";
 	import {
@@ -258,7 +259,7 @@
 	import cacheManager from '@/utils/cacheManager.js';
 	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
 	import payComponents from '@/components/payComponents/index.vue';
-	import productDialog from '../mall/productDialog.vue'
+	import productDialog from './productDialog.vue'
 	const mallProductPopup = ref(null);
 	const payComponentsRef = ref(null);
 	const showPayWay = ref(true)
@@ -275,8 +276,8 @@
 		payType.value = payType.value == 'weixin' ? 'zhifubao' : 'weixin'
 	}
 
-	function detailBtn() {
-		mallProductPopup.value.detailShow();
+	function detailBtn(data, index) {
+		mallProductPopup.value.detailShow(data.levelList);
 	}
 	const dingdanData = reactive({
 		items: ['全部', '待付款', '已付款'],

+ 56 - 0
pages/pay/productDialog.vue

@@ -0,0 +1,56 @@
+<template>
+	<uni-popup ref="detailPopup" :animation="false" :is-mask-click="false"
+		mask-background-color="rgba(51, 137, 217, 0.65);" style="z-index: 101;">
+		<view class="mall-detail-dialog">
+			<view class="detail-content-box">
+				<icon class="cpmx-title"></icon>
+				<icon class="dialog-close-btn" @click="detailCloseBtn"></icon>
+				<view class="product-body-box">
+					<!-- ↓需要换成从接口中取得 wgy -->
+					<view class="detail-item-box" v-for="(item,index) in productList " :key="index">
+						<img :src="item.cover" class="mall-image" />
+						<view class="content-body-box">
+							<view class="content-name">
+								<view class="name-text">{{item.levelName}}</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</uni-popup>
+</template>
+
+<script setup>
+	import {
+		orderInfo
+	} from "@/api/order.js"
+	import {
+		toast,
+		debounce,
+		getUserIdentity
+	} from "@/utils/common";
+	import {
+		ref
+	} from 'vue';
+	const $emit = defineEmits(['payBtn'])
+	const detailPopup = ref(null); // 索引
+	let productList = ref([])
+	// 打开弹窗
+	function detailShow(data) {
+	productList.value = data
+	detailPopup.value.open();
+
+	}
+	// 开启提分之旅按钮
+	function detailPayBtn() {
+		$emit('payBtn')
+	}
+
+	function detailCloseBtn() {
+		detailPopup.value.close();
+	}
+	defineExpose({
+		detailShow
+	})
+</script>