Bläddra i källkod

feat: 优化图书推荐和退款详情页功能

ylong 14 timmar sedan
förälder
incheckning
18d47bf8fc
3 ändrade filer med 49 tillägg och 12 borttagningar
  1. 43 8
      pages-car/pages/refund-detail.vue
  2. 1 1
      pages-sell/pages/recommend.vue
  3. 5 3
      pages-sell/pages/topic.vue

+ 43 - 8
pages-car/pages/refund-detail.vue

@@ -83,10 +83,6 @@
 
 		<!-- 底部操作栏 -->
 		<view class="bottom-bar" v-if="showBottomBar">
-			<view class="service-btn" @click="contactService">
-				<!-- 假设有一个客服图标 -->
-				<u-icon name="server-man" size="60" color="#666"></u-icon>
-			</view>
 			<view class="btn-group">
 				<u-button v-if="orderInfo.showComplaint == 1" shape="circle" plain :custom-style="btnStyle"
 					@click="handleAction('complaint')">投诉</u-button>
@@ -104,13 +100,38 @@
 
 		<!-- 占位符 -->
 		<view style="height: 120rpx;" v-if="showBottomBar"></view>
+
+		<!-- 客服按钮 -->
+		<FloatingDrag :width="126" :height="140" :initial-position="servicePosition"
+			@position-change="handlePositionChange">
+			<!-- #ifdef MP-ALIPAY -->
+			<button class="service-btn" @click="navigateToCustomerService">
+				<image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
+			</button>
+			<!-- #endif -->
+			<!-- #ifndef MP-ALIPAY -->
+			<button class="service-btn" open-type="contact">
+				<image src="/static/img/kf.png" mode="widthFix" style="width: 126rpx; height: 140rpx"></image>
+			</button>
+			<!-- #endif -->
+		</FloatingDrag>
 	</view>
 </template>
 
 <script>
+	import FloatingDrag from "@/components/floating-drag.vue";
 	export default {
+		components: {
+			FloatingDrag
+		},
 		data() {
 			return {
+				// 客服按钮位置
+				servicePosition: {
+					left: "auto",
+					right: 0,
+					bottom: "20%",
+				},
 				conditionTypeMap: {
 					'1': '良好',
 					'2': '中等',
@@ -205,12 +226,16 @@
 				// 跳转协商历史页面 (如果有)
 				uni.showToast({ title: '协商历史功能开发中', icon: 'none' });
 			},
-			contactService() {
+			navigateToCustomerService() {
 				// 联系客服
 				uni.navigateTo({
-					url: '/pages/service/index'
+					url: '/pages/customer-service/index'
 				});
 			},
+			// 处理位置变更
+			handlePositionChange(position) {
+				this.servicePosition = position;
+			},
 			handleAction(type) {
 				switch (type) {
 					case 'cancel':
@@ -247,6 +272,15 @@
 </script>
 
 <style lang="scss" scoped>
+	.service-btn {
+		height: max-content;
+		background-color: transparent;
+		padding: 0;
+		&::after {
+			border: none;
+		}
+	}
+
 	.refund-detail-page {
 		min-height: 100vh;
 		background-color: #F5F5F5;
@@ -278,7 +312,6 @@
 
 			.refund-amount-box {
 				margin-top: 30rpx;
-				border-top: 1rpx solid #eee;
 				padding-top: 30rpx;
 
 				.amount-row {
@@ -316,7 +349,7 @@
 
 					.goods-cover {
 						width: 140rpx;
-						height: 140rpx;
+						height: 160rpx;
 						border-radius: 8rpx;
 						margin-right: 20rpx;
 						flex-shrink: 0;
@@ -428,6 +461,8 @@
 			.btn-group {
 				display: flex;
 				align-items: center;
+				justify-content: flex-end;
+				width: 100%;
 			}
 		}
 	}

+ 1 - 1
pages-sell/pages/recommend.vue

@@ -81,7 +81,7 @@ export default {
 					const list = data.bookPageList.rows.map(item => {
 						return {
 							title: item.bookName,
-							author: '', // API doesn't return author currently
+							author: item.author || '', // API doesn't return author currently
 							price: item.bookPrice,
 							originalPrice: item.bookOriginalPrice,
 							cover: item.bookImg,

+ 5 - 3
pages-sell/pages/topic.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="feature-page">
 		<!-- Header Background -->
-		<image class="header-bg" src="/pages-sell/static/topic/top-bg-2.png" mode="widthFix"></image>
+		<image class="header-bg" :src="imageUrl" mode="widthFix"></image>
 
 		<!-- Custom Navbar -->
 		<Navbar title="图书专题" :titleSize="32" title-color="#ffffff" back-icon-color="#ffffff"></Navbar>
@@ -47,7 +47,8 @@
 				pageSize: 5,
 				total: 0,
 				bookList: [],
-				showName: ''
+				showName: '',
+				imageUrl: '/pages-sell/static/topic/top-bg-2.png'
 			}
 		},
 		onLoad(options) {
@@ -68,12 +69,13 @@
 					if (res.code == 200) {
 						const data = res.data;
 						this.showName = data.showName || '图书专题';
+						this.imageUrl = data.imgUrl || '/pages-sell/static/topic/top-bg-2.png';
 						this.total = data.bookPageList.total;
 
 						this.bookList = data.bookPageList.rows.map(item => {
 							return {
 								title: item.bookName,
-								author: '', // API doesn't return author currently
+								author: item.author || '', // API doesn't return author currently
 								price: item.bookPrice,
 								originalPrice: item.bookOriginalPrice,
 								cover: item.bookImg,