Browse Source

Merge branch 'master' of http://git.lcpcp.cc/py/assess-app

USER-20230908AJ\Administrator 3 weeks ago
parent
commit
41bd09e597
2 changed files with 70 additions and 34 deletions
  1. 18 5
      common/task/task-item.vue
  2. 52 29
      pages/index/index.vue

+ 18 - 5
common/task/task-item.vue

@@ -15,8 +15,12 @@
 						<view class="text-overflow-ellipsis-one size-30 max-w-80">
 							{{item.name}}
 						</view>
-						<uni-icons v-if="!item.live" type="heart" size="16" color="#99A1AF"></uni-icons>
-						<uni-icons v-else type="heart-filled" size="16" color="#FB2C36"></uni-icons>
+						<view class="" @click.stop="heartBut(item,true)" v-if="!item.live">
+							<uni-icons type="heart" size="16" color="#99A1AF"></uni-icons>
+						</view>
+						<view class="animate__animated animate__zoomIn" @click.stop="heartBut(item,false)" v-else>
+							<uni-icons type="heart-filled" size="16" color="#FB2C36"></uni-icons>
+						</view>
 					</view>
 					<view class="center flex-1 mb-18">
 						<uni-icons type="star-filled" size="16" color="#ff6b35"></uni-icons>
@@ -102,6 +106,12 @@
 			}
 		},
 		methods: {
+			heartBut(item, type) {
+				this.$emit('heartBut', {
+					id: item.id,
+					type: type
+				})
+			},
 			goLoan(id) {
 				uni.navigateTo({
 					url: '/pages/loan/module/perfect_rate?id=' + id
@@ -117,6 +127,8 @@
 				return `https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/${this.leftImg[this.leftImgStatus]}.png`
 			},
 			onTaskDetails(item) {
+				console.log(item,'1111111111');
+				return
 				if (item.business_id) {
 					uni.navigateTo({
 						url: '/page_task/task_details/task_details?taskId=' + item.business_id
@@ -161,6 +173,7 @@
 
 	.item-box {
 		position: relative;
+		box-shadow: 5rpx 5rpx 5px 0 rgba(0, 0, 0, 0.2);
 	}
 
 	.main_string {
@@ -200,10 +213,10 @@
 	.max-w-80 {
 		max-width: 398rpx;
 	}
+
 	.max-w-60 {
 		max-width: 60%;
 	}
-	.point{
-		
-	}
+
+	.point {}
 </style>

+ 52 - 29
pages/index/index.vue

@@ -19,7 +19,7 @@
 				</view>
 			</view>
 		</view>
-		<TaskItem :type="5" :taskList="backlogList"></TaskItem>
+		<TaskItem :type="5" :taskList="backlogList" @heartBut="heartBut"></TaskItem>
 		<Tab class="tabs_height" :tab-index="0"></Tab>
 	</view>
 
@@ -81,33 +81,7 @@
 					lagDate: 0,
 					totalNum: 0,
 				},
-				backlogList: [{
-						img: 'https://copyright.bdstatic.com/vcg/creative/d6c6a351be227d5d3b3e8c1f96f56e50.jpg@h_1280',
-						proportion: '37',
-						name: 'Downtown Office Tower -Prime Location',
-						live: false,
-						percentage: '3.1',
-						description: 'Metro Properties LLC',
-						amount: '5.0',
-						trend: '7.5',
-						risk: 'LTV 37%',
-						time: '2024-001',
-						id: 1,
-					},
-					{
-						img: 'https://pic.rmb.bdstatic.com/bjh/3ea195479f8a/250303/f53064611fee7c092312f3b6ea8e439d.jpeg',
-						proportion: '71',
-						name: 'Tower -Prime Location',
-						live: true,
-						percentage: '5.1',
-						description: 'Healthcare Properties Inc',
-						amount: '5.0',
-						trend: '7.5',
-						risk: 'LTV 37%',
-						time: '2024-001',
-						id: 2,
-					}
-				],
+				backlogList: [],
 				weekData: [],
 				weekNum: 1,
 				dayNum: 0,
@@ -124,8 +98,57 @@
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop / 120
 		},
+		mounted() {
+			this.backlogListData()
+		},
 		onReachBottom() {},
-		methods: {},
+		methods: {
+			heartBut(data) {
+				if(data){
+					this.backlogList.forEach((i,k)=>{
+						if(i.id === data.id){
+							i.live = !i.live
+						}
+					})
+					console.log(this.backlogList,'1111111111111');
+				}
+			},
+			backlogListData() {
+				let data = uni.getStorageSync('backlogList')
+				if (data) {
+					this.backlogList = data
+				} else {
+					this.backlogList = [{
+							img: 'https://copyright.bdstatic.com/vcg/creative/d6c6a351be227d5d3b3e8c1f96f56e50.jpg@h_1280',
+							proportion: '37',
+							name: 'Downtown Office Tower -Prime Location',
+							live: false,
+							percentage: '3.1',
+							description: 'Metro Properties LLC',
+							amount: '5.0',
+							trend: '7.5',
+							risk: 'LTV 37%',
+							time: '2024-001',
+							id: 1,
+						},
+						{
+							img: 'https://pic.rmb.bdstatic.com/bjh/3ea195479f8a/250303/f53064611fee7c092312f3b6ea8e439d.jpeg',
+							proportion: '71',
+							name: 'Tower -Prime Location',
+							live: false,
+							percentage: '5.1',
+							description: 'Healthcare Properties Inc',
+							amount: '5.0',
+							trend: '7.5',
+							risk: 'LTV 37%',
+							time: '2024-001',
+							id: 2,
+						}
+					]
+					uni.setStorageSync('backlogList', this.backlogList)
+				}
+			}
+		},
 	}
 </script>
 <style lang="scss" scoped>