Browse Source

2024-2-24

cmy 1 year ago
parent
commit
2ce930e7ff
2 changed files with 83 additions and 13 deletions
  1. 16 0
      api/index.js
  2. 67 13
      pages/index/index.vue

+ 16 - 0
api/index.js

@@ -53,6 +53,22 @@ export function getWorkerList(data) {
 		data
 	});
 }
+//获取精选名片
+export function getGoodWorkerList(data) {
+	return request({
+		url: '/api/pub/getGoodWorkerList',
+		method: 'get',
+		data
+	});
+}
+//获取最新名片
+export function getNewWorkerList(data) {
+	return request({
+		url: '/api/pub/getNewWorkerList',
+		method: 'get',
+		data
+	});
+}
 //https://api.myjie.cn/api/pub/
 export function getCardLookCountRank(data) {
 	return request({

+ 67 - 13
pages/index/index.vue

@@ -97,14 +97,6 @@
 						精选名片推荐
 					</view>
 				</view>
-				<!-- <navigator url="/pages/user/model/phb">
-					<view class="right flex">
-						<text class="margin-r-10">
-							更多
-						</text>
-						<image src="../../static/icon/next1.png" mode="scaleToFill" class="tip"></image>
-					</view>
-				</navigator> -->
 			</view>
 			<view class="bd-wrap">
 				<view class="bd-btm-item flex" v-for="item in jxList" @click="navTo('/pages/user/model/model?uid=' + item.uid + '&mtype=' + item.show_template_id + '&type=2')" v-if="item.name != '影子' && item.name != '测试牛niu' &&item.name != '111'">
@@ -123,8 +115,35 @@
 					</view>
 				</view>
 			</view>
+			<view class="title-box flex"  v-if="zxList.length > 0">
+				<view class="flex">
+					<image class="hot margin-r-10" src="../../static/icon/hot.png" mode="scaleToFill"></image>
+					<view class="title">
+						最新名片推荐
+					</view>
+				</view>
+			</view>
+			<view class="bd-wrap">
+				<view class="bd-btm-item flex" v-for="item in zxList" @click="navTo('/pages/user/model/model?uid=' + item.uid + '&mtype=' + item.show_template_id + '&type=2')" v-if="item.name != '影子' && item.name != '测试牛niu' &&item.name != '111'">
+					<image :src="item.avatar" mode="" class="item-img"></image>
+					<view class="flex item-info">
+						<view class="item-name">
+							{{item.name}}
+							<image :src="rz" mode="" v-if="item.is_type_audit == 1"></image>
+						</view>
+						<view class="item-where">
+							{{item.age}}岁
+						</view>
+						<view class="item-zy">
+							{{item.user_work_type_title}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer">
+			仅显示50条
 		</view>
-		<uni-load-more :status="navList.loadingType"></uni-load-more>
 	</view>
 </template>
 
@@ -141,7 +160,9 @@
 		getShowTemplateList
 	} from '@/api/model.js';
 	import {
-		getWorkerList
+		getWorkerList,
+		getGoodWorkerList,
+		getNewWorkerList
 	} from '@/api/index.js'
 	export default {
 		data() {
@@ -162,6 +183,7 @@
 				// 热门商品
 				rmList: [],
 				jxList: [], //精选列表
+				zxList:[]
 			};
 		},
 		computed: {
@@ -189,11 +211,12 @@
 		onShow() {
 			this.loadIndexs();
 			this.getWorkerList()
+			this.getNewWorkerList();
 		},
 		onReady() {},
 		// 滚动到底部
 		onReachBottom() {
-			this.getShowTemplateList();
+			// this.getShowTemplateList();
 		},
 		// #ifdef MP
 		onShareAppMessage(options) {
@@ -230,7 +253,7 @@
 		methods: {
 			getWorkerList() {
 				try {
-					getWorkerList().then(res => {
+					getGoodWorkerList().then(res => {
 						let arr = []
 						// console.log(res,'basa');
 						res.data.list.forEach(item => {
@@ -252,7 +275,33 @@
 					//TODO handle the exception
 					console.log(e);
 				}
-
+			},
+			// 最新名片
+			getNewWorkerList() {
+				try {
+					getNewWorkerList().then(res => {
+						let arr = []
+						// console.log(res,'basa');
+						res.data.list.forEach(item => {
+							let cc = false
+							arr.forEach(itemt => {
+								if(itemt.uid == item.uid) {
+									cc = true
+								}
+							})
+							if(!cc) {
+								arr.push(item)
+								// console.log(item,arr);
+							}
+						})
+						this.zxList = arr
+						// console.log(arr,this.jxList,'dddddd');
+					})
+				} catch (e) {
+					//TODO handle the exception
+					console.log(e);
+				}
+			
 			},
 			swiperChange() {
 
@@ -639,4 +688,9 @@
 		}
 		padding: 20rpx 0;
 	}
+	.footer{
+		text-align: center;
+		color: $font-color-light;
+		margin-top: 30rpx;
+	}
 </style>