ZZ 4 veckor sedan
förälder
incheckning
e92a643394

+ 49 - 0
mer_uniapp/api/discover.js

@@ -98,6 +98,14 @@ export function noteDetailApi(noteId){
 }
 
 /**
+ * 二手交易用户内容详情
+ * 
+*/
+export function secondHandDetailApi(noteId){
+  return request.get(`secondHand/detail/${noteId}`,{},{ noAuth : true});
+}
+
+/**
  * 逛逛内容发现推荐列表
  * 
 */
@@ -162,6 +170,14 @@ export function noteReplyLikeApi(replyId){
 }
 
 /**
+ * 二手交易内容评论点赞/取消
+ * 
+*/
+export function secondHandReplyLikeApi(replyId){
+  return request.post(`secondHand/like/${replyId}`);
+}
+
+/**
  * 我的主页
  * 
 */
@@ -202,6 +218,22 @@ export function myLikeListApi(params){
 }
 
 /**
+ * 二手交易我的点赞列表
+ * 
+*/
+export function secondHandListApi(params){
+  return request.get(`secondHand/my/like/list`, params);
+}
+
+/**
+ * 二手交易我的关注列表
+ * 
+*/
+export function secondHandFollowListApi(params){
+  return request.get(`secondHand/follow/list`, params);
+}
+
+/**
  * 我的关注列表
  * 
 */
@@ -242,6 +274,23 @@ export function noteDelApi(noteId){
 }
 
 /**
+ * 二手交易内容删除
+ * 
+*/
+export function secondHandDelApi(noteId){
+  return request.post(`secondHand/delete/${noteId}`);
+}
+
+
+/**
+ * 二手交易内容收藏
+ * 
+*/
+export function secondHandConcernedDelApi(noteId){
+  return request.post(`secondHand/concerned/${noteId}`);
+}
+
+/**
  * 逛逛内容评论删除
  * 
 */

+ 8 - 0
mer_uniapp/api/merchant.js

@@ -83,6 +83,14 @@ export function getMerProListApi(data) {
 }
 
 /**
+ * 二手交易商品列表
+ * @param Obj data
+ */
+export function getSecondHandListApi(data) {
+  return request.get(`secondHand/prod/list`, data , {noAuth:true});
+}
+
+/**
  * 商户商品分类列表
  * @param Obj data
  */

+ 9 - 3
mer_uniapp/components/WaterfallsFlow/WaterfallsFlow.vue

@@ -15,7 +15,7 @@
 			<view id="left" v-if="leftList.length">
 				<view v-for="(item,index) in leftList" :key="index" class="wf-item">
 					<discoverFlowItem :items="item" v-if="fromType==1" :fromTo="fromTo" @changeLikeToggle="(item)=>changeLikeToggle(false, index, item)" ></discoverFlowItem>
-					<WaterfallsFlowItem v-else :item="item" :isStore="isStore" :type="type" :isDynamics="isDynamics"  :userFair="userFair"/>
+					<WaterfallsFlowItem v-else :item="item" :isStore="isStore" :type="type" :isDynamics="isDynamics"  :userFair="userFair" :isManage="isManage"/>
 				</view>
 			</view>
 		</view>
@@ -24,7 +24,7 @@
 			<view id="right" v-if="rightList.length">
 				<view v-for="(item,index) in rightList" :key="index" class="wf-item">
 					<discoverFlowItem :items="item" v-if="fromType==1" :fromTo="fromTo" @changeLikeToggle="(item)=>changeLikeToggle(true, index, item)" ></discoverFlowItem>
-					<WaterfallsFlowItem v-else :item="item" :isStore="isStore" :type="type" :isDynamics="isDynamics"  :userFair="userFair"/>
+					<WaterfallsFlowItem v-else :item="item" :isStore="isStore" :type="type" :isDynamics="isDynamics"  :userFair="userFair" :isManage="isManage"/>
 				</view>
 			</view>
 		</view>
@@ -99,6 +99,10 @@
 			userFair: {
 				type: Boolean,
 				default: false
+			},
+			isManage: {
+				type: Number,
+				default: 0
 			}
 		},
 		data() {
@@ -155,7 +159,9 @@
 				immediate: true,
 				deep: true
 			},
-			mounted() {},
+			mounted() {
+				conolse.log(this.isDynamics, this.userFair, 1111111111111)
+			},
 
 			// 监听标记,当标记发生变化,则执行下一个item排序
 			mark() {

+ 9 - 2
mer_uniapp/components/WaterfallsFlowItem/WaterfallsFlowItem.vue

@@ -7,9 +7,12 @@
 				<view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
 			</view>
 			<view class='texts'>
-				<view class='names box-line2'>
+				<view class='names box-line2 flex-between-center'>
 					<text v-if="item.productTags && item.productTags.locationLeftTitle.length" class="font-bg-red mr10 bg-color merType">{{item.productTags.locationLeftTitle[0].tagName}}</text>
 					{{!userFair ? item.name : item.content}}
+					<view v-if="userFair">
+						<text class="iconfont icon-shoucang"></text>{{item.likeNum || 0}}
+					</view>
 				</view>
 				<view class='money mt-10'>
 					<svip-price :svipIconStyle="svipIconStyle" :productPrice="item" :svipPriceStyle="svipPriceStyle"></svip-price>
@@ -77,6 +80,10 @@
 			userFair: {
 				type: Boolean,
 				default: false
+			},
+			isManage: {
+				type: Number,
+				default: 0
 			}
 		},
 		data() {
@@ -118,7 +125,7 @@
 		methods: {
 			// 去详情页
 			goDetail(item) {
-				goProductDetail(item.id, 0, '', this.userFair ? JSON.stringify(item) : null);
+				goProductDetail(item.id, 0, '', this.userFair ? JSON.stringify(item) : '', this.isManage);
 			},
 			goStore(id) {
 				uni.navigateTo({

+ 1 - 1
mer_uniapp/components/base/recommend.vue

@@ -3,7 +3,7 @@
 		<block v-if="tempArr.length">
 			<title-box v-if="isShowTitle" title="热门推荐"></title-box>
 			<view class='recommendList borderPad' :class="isShowTitle?'':'mt30'">
-				<WaterfallsFlow :isDynamics="dynamics" :wfList='tempArr' :type="1" :isStore="1">
+				<WaterfallsFlow :isDynamics="dynamics" :userFair="dynamics" :wfList='tempArr' :type="1" :isStore="1">
 					<template slot-scope="{item}">{{item.name}}
 						<WaterfallsFlowItem :item="item" :type="1" :isStore="1"/>
 					</template>

+ 3 - 3
mer_uniapp/libs/order.js

@@ -41,18 +41,18 @@ export function goOrderDetail(orderNo) {
 /**
  * 去商品详情
  */
-export function goProductDetail(id, marketingType, params, data) {
+export function goProductDetail(id, marketingType, params, data, isManage) {
 	return new Promise(resolve => {
 		// #ifdef MP
 		uni.navigateTo({
-			url: `/pages/goods/goods_details/index?id=${id}&mt=${marketingType}${params}&dataItem=${data}`
+			url: `/pages/goods/goods_details/index?id=${id}&mt=${marketingType}${params}&dataItem=${data||''}&isManage=${isManage}`
 		})
 		// #endif
 		// #ifndef MP
 		uni.navigateTo({
 			animationType: animationType.type,
 			animationDuration: animationType.duration,
-			url: `/pages/goods/goods_details/index?id=${id}&mt=${marketingType}${params}&dataItem=${data}`
+			url: `/pages/goods/goods_details/index?id=${id}&mt=${marketingType}${params}&dataItem=${data||''}&isManage=${isManage}`
 		})
 		// #endif
 	});

+ 20 - 6
mer_uniapp/pages/discover/discover_release/index.vue

@@ -4,11 +4,11 @@
 		<form v-if="!topicShow" @submit="formSubmit" report-submit='true'>
 			<view class="release_content">
 				<view class="release_item">
-					<view class="title mb30" v-if="!fair">
-						<input placeholder='填写标题会有更多赞噢~' name="title" placeholder-class='placeholder' v-model="formData.title" maxlength="20" />
+					<view class="title mb30">
+						<input :placeholder="fair ? '填写好物名称' : '填写标题会有更多赞噢~'" name="title" placeholder-class='placeholder' v-model="formData.title" maxlength="20" />
 					</view>
 					<view class="textarea">
-						<textarea :placeholder="formData.type == 1?'分享使用体验和心得,获得更多点赞和关注哦~(600字以内)':'分享使用体验和心得,获得更多点赞和关注哦~(200字以内)'"
+						<textarea :placeholder="fair ? '说说好物信息,入手渠道,转卖原因...' : formData.type == 1?'分享使用体验和心得,获得更多点赞和关注哦~(600字以内)':'分享使用体验和心得,获得更多点赞和关注哦~(200字以内)'"
 						 auto-height name="comment" placeholder-class='placeholder' v-model="formData.content" :maxlength="formData.type == 1?'600':'200'"></textarea>
 						<view class="discoverlist acea-row mt-10">
 							<view v-for="(item, index) in discoverTopicList" :key="item.id" class="list mr-12 font-color">
@@ -89,6 +89,12 @@
 							</view>
 						</view>
 					</view>
+					<view v-if="fair && noteId" class='item acea-row row-between-wrapper'>
+						<view class='name color28'><text class="iconfont icon-neirongfenlei"></text>是否上架</view>
+						<view class="select">
+							<switch @change="switch2Change" :checked="saleStatus" :color="indicatorBg" style="transform:scale(0.7)" />
+						</view>
+					</view>
 					<view class='item acea-row row-between-wrapper' v-if="fair">
 						<view class='name color28'><text class="iconfont icon-qiandai"></text>价格
 						</view>
@@ -153,6 +159,7 @@
 	} from '@/utils/setTheme.js'
 	import {
 		noteDetailApi,
+		secondHandDetailApi,
 		communityCategoryListApi,
 		getSecondHandInfo,
 		noteUpdateApi,
@@ -217,6 +224,7 @@
 				indicatorBg: '#e93323',
 				discoverTopicList: [], //选中的话题列表
 				replyStatus: false, //开关
+				saleStatus: true, //开关
 				showVideo: false, //预览视频弹窗
 				replyPlatformSwitch: false, //评论总开关状态,true开启,false关闭
 				videoContext: '',
@@ -232,6 +240,7 @@
 			// #endif
 		},
 		onLoad(options) {
+			console.log(options)
 			this.discoverTopicList = [];
 			this.$store.commit('DiscoverTopic', this.discoverTopicList);
 			this.indicatorBg = setThemeColor();
@@ -280,6 +289,10 @@
 			switch1Change: function(e) {
 				this.formData.replyStatus = e.detail.value ? 2 : 1;
 			},
+			//开关
+			switch2Change: function(e) {
+				this.formData.saleStatus = e.detail.value ? 0 : 2;
+			},
 			//分类列表
 			getCommunityCategoryList() {
 				let categoryApi = this.fair ? getSecondHandInfo() : communityCategoryListApi();
@@ -295,7 +308,8 @@
 			},
 			/*获取图文详情*/
 			getDetail() {
-				noteDetailApi(this.noteId).then(res => {
+				let api = this.fair ? secondHandDetailApi : noteDetailApi;
+				api(this.noteId).then(res => {
 					this.formData = res.data;
 					this.productList = res.data.productList || [];
 					this.topicList = res.data.topicList || [];
@@ -323,6 +337,7 @@
 					this.discoverTopicList = res.data.topicList || [];
 					this.$store.commit('DiscoverTopic', this.discoverTopicList);
 					this.replyStatus = this.formData.replyStatus == 2 ? true : false;
+					this.saleStatus = this.formData.saleStatus == 0 ? true : false;
 					this.categoryName = this.formData.categoryName;
 					this.sexindex = this.formData.categoryId;
 				}).catch(err => {
@@ -412,7 +427,6 @@
 			 */
 			formSubmit: Debounce(function(e) {
 				let that = this;
-				console.log(this.fair)
 				if (this.fair) {
 					if (that.image.length == 0) return that.$util.Tips({
 						title: '请添加内容图片'
@@ -467,7 +481,7 @@
 				})
 				let addApi = this.fair ? secondHandAddApi : noteAddApi
 				let editApi = this.fair ? secondHandUpdateApi : noteUpdateApi
-				console.log(that.noteId)
+				console.log(that.noteId, this.formData, this.saleStatus)
 				that.noteId ? editApi(that.formData).then(res => {
 					uni.hideLoading()
 					that.$util.Tips({

+ 161 - 25
mer_uniapp/pages/goods/goods_details/index.vue

@@ -107,14 +107,15 @@
 										<!-- 其他商品价格 -->
 										<svip-price v-else :svipIconStyle="svipIconStyle" :productPrice="productPrice" :svipPriceStyle="svipPriceStyle"></svip-price>
 										<!-- 收藏 -->
-										<view v-show="productType !== ProductTypeEnum.Integral" @click="setCollect" class="item tui-skeleton-rect">
+										<view v-show="productType !== ProductTypeEnum.Integral" @click="setCollect" class="item tui-skeleton-rect flex-y-center">
 											<view class="iconfont icon-shoucang1 " :class="
 											      marketingType === ProductMarketingTypeEnum.Groupbuying
 											        ? 'color-normal'
 											        : 'color-change'
 											    "
-											 v-if="userCollect"></view>
+											 v-if="userCollect || dataItem.userIsLike"></view>
 											<view class="iconfont icon-shoucang" v-else></view>
+											<text v-if="dataItem">{{dataItem.likeNum || 0}}</text>
 										</view>
 										<!-- <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> -->
 									</view>
@@ -130,7 +131,10 @@
 										</view>
 									</view>
 									<view class="introduce tui-skeleton-rect line2 mt30" v-if="!dataItem">{{productInfo.name}}</view>
-									<view class="introduce tui-skeleton-rect line2 mt30" v-else>{{dataItem.content}}</view>
+									<view class="introduce tui-skeleton-rect line2 mt30" v-else>
+										<view>{{dataItem.title}}</view>
+										<view>{{dataItem.content}}</view>
+									</view>
 								</view>
 								<view v-if="marketingType !== ProductMarketingTypeEnum.Normal" class="share acea-row row-between row-middle">
 									<view class="introduce tui-skeleton-rect line2 lineWidth">{{ productInfo.name }}
@@ -364,7 +368,18 @@
 				</scroll-view>
 			</view>
 			<!-- 脚部按钮 -->
-			<view class="footer acea-row row-between-wrapper">
+			<!-- 管理 -->
+			<view class="footer acea-row row-between-wrapper" :class="dataItem ? 'flex-between-center-sc' : ''">
+				<view class="manageCount" v-if="isManage">
+					<view class="follow_btn author-focused flex-around-center" @click.stop="handleManage">
+						<view class="line-heightOne">管理</view>
+					</view>
+				</view>
+				<button hover-class="none" class="item tui-skeleton-rect flex-col flex-center" @click="shoucangClick" v-if="isManage == 0 && dataItem">
+					<text v-if="!dataItem.isConcerned" class="iconfont icon-shoucangbenzhan mb-10"></text>
+					<text v-else class="iconfont icon-wodeshoucang mb-10"></text>
+					{{ dataItem.isConcerned ? '已收藏' : '收藏' }}
+				</button>
 				<!-- #ifdef MP -->
 				<button hover-class="none" class="item tui-skeleton-rect" @click="kefuClick" v-if="chatConfig.telephone_service_switch === 'true'">
 					<view class="iconfont icon-kefu"></view>
@@ -417,7 +432,7 @@
 									加入购物车
 								</button> -->
 							</form>
-							<form @submit="goBuy" report-submit="true">
+							<form @submit="goBuy" report-submit="true" v-if="isManage == 0">
 								<button style="border-radius: 0;" :class="productInfo.systemFormId == 0 ? 'bnts' : 'longBnts'" class="buy"
 								 form-type="submit">
 									立即购买
@@ -629,6 +644,19 @@
 				</view>
 			</tui-drawer>
 		</view>
+		<!-- 管理弹窗 -->
+		<uni-popup type="bottom" ref="manageRef">
+			<view class="manage">
+				<popup-header title="内容管理" @close="closeManage"></popup-header>
+				<navigator hover-class="none" :url="`/pages/discover/discover_release/index?fair=${true}&noteId=${dataItem.id}`"
+					class="items">
+					<text>编辑</text>
+				</navigator>
+				<view class="items" @click.stop="deleteTopic(dataItem)">
+					<text>删除</text>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -668,6 +696,12 @@
 		toLogin
 	} from "@/libs/login.js";
 	import {
+		secondHandDelApi,
+		secondHandConcernedDelApi,
+		secondHandDetailApi,
+		secondHandReplyLikeApi
+	} from '@/api/discover.js';
+	import {
 		mapGetters
 	} from "vuex";
 	import {
@@ -937,7 +971,8 @@
 
 				iSshop: 0, //判断是否显示店铺
 				cart: null,
-				dataItem: null
+				dataItem: null,
+				isManage: false
 			};
 		},
 		computed: {
@@ -1007,13 +1042,16 @@
 		onLoad(options) {
 			//获取浏览器传来的对象
 			this.options = options;
+			this.isManage = +options.isManage
 			if (options.cart) {
 				this.cart = JSON.parse(options.cart) || []
 			}
 			if (options.dataItem) {
-				this.dataItem = JSON.parse(options.dataItem) || null
-				this.productPrice.price = this.dataItem.price;
+				this.dataItem = JSON.parse(options.dataItem) || {}
+				this.getSecondHandDetailApi()
+				this.productPrice.price = this.dataItem.price || '';
 			}
+			console.log(this.dataItem)
 			this.iSshop = this.options.iSshop //判断显示店铺
 			//获取浏览器秒杀状态、秒杀时间
 			if (options.status) this.seckillStatus = Number(options.status); //秒杀状态
@@ -1121,6 +1159,42 @@
 		},
 		// #endif
 		methods: {
+			//关闭操作管理
+			closeManage() {
+				this.$refs.manageRef.close();
+			},
+			//操作管理
+			handleManage() {
+				this.$refs.manageRef.open('bottom');
+			},
+			// 删除内容
+			deleteTopic(noteDetails) {
+				let that = this;
+				uni.showModal({
+					content: '确定要删除该内容么?',
+					success: function(res) {
+						if (res.confirm) {
+							secondHandDelApi(noteDetails.id).then(res => {
+								that.$util.Tips({
+									title: '删除成功'
+								});
+								setTimeout(function() {
+									uni.redirect({
+										url: '/pages/trade_fair/trade_fair_user/index'
+									})
+								}, 1000);
+							}).catch(err => {
+								uni.showToast({
+									title: err,
+									icon: 'none'
+								})
+							});
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			},
 			//滚动
 			touchStart() {
 				this.$refs.navBarRef.currentPage = false;
@@ -1203,6 +1277,22 @@
 					chatConfig(this.serviceConfig);
 				}
 			},
+			getSecondHandDetailApi() {
+				let that = this;
+				secondHandDetailApi(this.dataItem.id).then((res) => {
+					that.dataItem = res.data
+				});
+			},
+			shoucangClick() {
+				let that = this;
+				secondHandConcernedDelApi(this.dataItem.id).then((res) => {
+					let title = that.dataItem.isConcerned ? '收藏成功' : '取消收藏'
+					that.$util.Tips({
+						title: title,
+					});
+					that.getSecondHandDetailApi()
+				});
+			},
 			goActivity: function(e) {
 				let item = e;
 				if (item.type === "1") {
@@ -1730,29 +1820,39 @@
 			 */
 			setCollect: Debounce(function() {
 				let that = this;
+				if (this.isManage) {
+					console.log('不准点')
+					return
+				}
 				if (this.isLogin === false) {
 					toLogin("isLogin");
 				} else {
-					let id =
-						Number(this.masterProductId) > 0 ?
-						this.masterProductId :
-						this.productInfo.id;
-					if (this.userCollect) {
-						collectCancel({
-							ids: id,
-						}).then((res) => {
-							that.$set(that, "userCollect", !that.userCollect);
-							that.$util.Tips({
-								title: "取消收藏",
-							});
+					if (this.isManage == 0 && this.dataItem) {
+						secondHandReplyLikeApi(this.dataItem.id).then((res) => {
+							that.getSecondHandDetailApi()
 						});
 					} else {
-						collectAdd(id).then((res) => {
-							that.$set(that, "userCollect", !that.userCollect);
-							that.$util.Tips({
-								title: "收藏成功",
+						let id =
+							Number(this.masterProductId) > 0 ?
+							this.masterProductId :
+							this.productInfo.id;
+						if (this.userCollect) {
+							collectCancel({
+								ids: id,
+							}).then((res) => {
+								that.$set(that, "userCollect", !that.userCollect);
+								that.$util.Tips({
+									title: "取消收藏",
+								});
 							});
-						});
+						} else {
+							collectAdd(id).then((res) => {
+								that.$set(that, "userCollect", !that.userCollect);
+								that.$util.Tips({
+									title: "收藏成功",
+								});
+							});
+						}
 					}
 				}
 			}),
@@ -3576,4 +3676,40 @@
 			color: #050505;
 		}
 	}
+	
+	.follow_btn {
+		color: #282828 !important;
+		border: 1px solid #282828 !important;
+		line-height: 76rpx;
+	}
+	
+	.manage {
+		width: 100%;
+		background: #ffffff;
+		box-shadow: 0 2rpx 15rpx rgba(0, 0, 0, 0.1);
+		padding: 30rpx 24rpx;
+		z-index: 10;
+		border-radius: 40rpx 40rpx 0 0;
+	
+		.items {
+			// border-bottom: 1px solid #EEEEEE;
+			color: #333333;
+			font-size: 28rpx;
+			display: flex;
+			justify-content: center;
+			margin-bottom: 64rpx;
+	
+			&:last-child {
+				border-bottom: none;
+			}
+	
+			.iconfont {
+				margin: 0 16rpx 0;
+			}
+		}
+	}
+	
+	.flex-between-center-sc {
+		justify-content: space-between !important;
+	}
 </style>

+ 125 - 47
mer_uniapp/pages/goods/goods_list/index.vue

@@ -17,7 +17,7 @@
 					<view class="tab-item" :class="{on:tabIndex===2}" @click="changetab(2)">店铺</view>
 				</view>
 			</view>
-			<view v-if="tabIndex===1" class='nav acea-row row-middle' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
+			<view v-if="tabIndex===1" class='nav acea-row row-middle flex-between-center' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
 				<view class='item' :class='title ? "font_color":""' @click='set_where(1,tabIndex)'>
 					{{title ? title:'默认'}}
 				</view>
@@ -27,17 +27,41 @@
 					<image v-else-if="price==2" :src='downPng'></image>
 					<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
 				</view>
-				<view class='item-c item' @click='set_where(3,tabIndex)'>
-					销量
-					<image v-if="stock==1" :src='upPng'></image>
-					<image v-else-if="stock==2" :src='downPng'></image>
-					<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
+				<template v-if="!flowType">
+					<view class='item-c item' @click='set_where(3,tabIndex)'>
+						销量
+						<image v-if="stock==1" :src='upPng'></image>
+						<image v-else-if="stock==2" :src='downPng'></image>
+						<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
+					</view>
+					<!-- down -->
+					<view class="item-shu"></view>
+					<view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
+					</view>
+				</template>
+				<view class='item' v-else>
+					<view class="flex-center" @tap="showCateDrawer = !showCateDrawer">
+						<text>{{'预览' + rangeArr[tabActive].name}}</text>
+						<view class="w-76 h-100 flex-center topic-box">
+							<text class="iconfont fs-24" :class="!showCateDrawer?'icon-xiala3':'icon-xiangshang2'"></text>
+						</view>
+					</view>
 				</view>
-				<!-- down -->
-				<view class="item-shu"></view>
-				<view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
+			</view>
+			<!-- 话题分类下拉 -->
+			<view class="fixed-lt w-full bg--w111-fff rd-b-24rpx z-100 pt-22" v-if="showCateDrawer"
+			 :style="{top: (86+86) + 'rpx'}">
+				<view class="w-full pr-20 pb-30 pl-30">
+					<view>
+						<view  :class="tabActive == item.id ? 'bg-color-good' : ''" v-for="(item, index) of rangeArr" :key="index"
+						 class="flex-between-center h-40 mb-20" @click="tabActiveClick(item)">
+							预览{{item.name}}
+							<text v-if="tabActive == item.id" class="iconfont icon-gou"></text>
+						</view>
+					</view>
 				</view>
 			</view>
+			<view :style="{top: (86+86) + 'rpx'}" class="mask z-80" v-if="showCateDrawer" @tap="()=>{showCateDrawer = false}"></view>
 			<view v-if="tabIndex===1" :class="is_switch==true?'proList':'listBox'">
 				<view :class="[(merId > 0 || cid > 0) ? 'mer-listBox' : '']" v-if="productList.length>0">
 					<view v-if="!is_switch" class='list acea-row row-between-wrapper' :class="[is_switch==true ? '' : 'on', (merId > 0 || cid > 0) ? 'mer-list' : ''] ">
@@ -77,7 +101,7 @@
 						</view>
 					</view>
 					<view v-else class="goods">
-						<WaterfallsFlow :wfList='productList' :type="1">
+						<WaterfallsFlow :wfList='productList' :isDynamics="flowType" :userFair="flowType" :type="1">
 							<template slot-scope="{item}">
 								<WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
 							</template>
@@ -103,7 +127,8 @@
 				<image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
 			</view>
 			<text class="text-ccc">{{tabIndex===1?'暂无商品~':'暂无店铺~'}}</text>
-			<recommend v-if="!merId" ref="recommendIndex" class="mt-40"></recommend>
+			<recommend v-if="!merId || !fairCateId" ref="recommendIndex" class="mt-40"></recommend>
+			<recommend v-if="fairCateId" :dynamics="true" :tabActive="tabActive" ref="recommendIndex" class="mt-40"></recommend>
 		</view>
 
 		<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
@@ -127,7 +152,8 @@
 	} from '@/api/product.js';
 	import {
 		getMerSearchApi,
-		getMerProListApi
+		getMerProListApi,
+		getSecondHandListApi
 	} from '@/api/merchant.js';
 	import {
 		mapGetters
@@ -195,6 +221,14 @@
 				},
 				urlDomain: this.$Cache.get("imgHost"),
 				keyword: '',
+				rangeArr: [
+					{id: 0, range: 'school', name: '本校'},
+					{id: 1, range: 'school', name: '同城'},
+					{id: 2, range: 'school', name: '全国'},
+				],
+				rangeStr: '',
+				tabActive: null,
+				flowType: false,
 				drawers: 0,
 				tabIndex: 1,
 				productList: [],
@@ -238,7 +272,9 @@
 				merId: 0,
 				cateId: null,
 				goodScroll: true,
-				isShow: false
+				isShow: false,
+				fairCateId: '',
+				showCateDrawer: false
 			};
 		},
 		// 滚动监听
@@ -257,18 +293,19 @@
 					title: '精选商品'
 				});
 			}
+			this.$set(this, 'cid', Number(options.cid) || 0);
+			this.title = options.title || '';
 			if (this.fairCateId) {
-				this.merId = 9999999999
+				this.cid = 9999999999
+				this.flowType = true
+				this.$set(this, 'rangeStr', options.rangeStr || '');
+				this.$set(this, 'tabActive', +options.tabActive);
 				uni.setNavigationBarTitle({
 					title: '二手交易'
 				});
 			}
-			this.$set(this, 'cid', Number(options.cid) || 0);
-			this.title = options.title || '';
 			this.$set(this, 'keyword', options.searchValue || '');
-			if (this.tabIndex === 1 && !fairCateId) {
-				this.get_product_list();	
-			}
+			if (this.tabIndex === 1) this.get_product_list();
 			switch (this.theme) {
 				case 'theme2':
 					this.upPng = `${this.urlDomain}crmebimage/presets/up_orange.png`;
@@ -291,8 +328,14 @@
 					this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
 					break;
 			}
+			console.log(this.productList, this.isShow, this.tabIndex, this.loading)
 		},
 		methods: {
+			tabActiveClick(item) {
+				this.tabActive = item.id;
+				this.rangeStr = item.range;
+				this.showCateDrawer = false;
+			},
 			goStore(id) {
 				uni.navigateTo({
 					url: `/pages/merchant/home/index?merId=${id}`
@@ -465,33 +508,56 @@
 					}
 
 				}
-				this.merId === 0 ? productList(that.where).then(res => {
-					let list = res.data.list;
-					let productList = that.$util.SplitArray(list, that.productList);
-					let loadend = list.length < that.where.limit;
-					that.loadend = loadend;
-					that.loading = false;
-					that.loadTitle = loadend ? '已全部加载' : '加载更多';
-					that.$set(that, 'productList', productList);
-					that.$set(that.where, 'page', that.where.page + 1);
-					this.isShow = true
-				}).catch(err => {
-					that.loading = false;
-					that.loadTitle = '加载更多'
-				}) : getMerProListApi(that.where).then(res => {
-					let list = res.data.list;
-					let productList = that.$util.SplitArray(list, that.productList);
-					let loadend = list.length < that.where.limit;
-					that.loadend = loadend;
-					that.loading = false;
-					that.loadTitle = loadend ? '已全部加载' : '加载更多';
-					that.$set(that, 'productList', productList);
-					that.$set(that.where, 'page', that.where.page + 1);
-					this.isShow = true
-				}).catch(err => {
-					that.loading = false;
-					that.loadTitle = '加载更多'
-				})
+				if (this.fairCateId) {
+					that.where.range = this.rangeStr
+					if (that.where.range == 'city') {
+						that.where.city = uni.getStorageSync('cityName')
+					}
+					that.where.categoryId = this.fairCateId
+					console.log(this.where)
+					getSecondHandListApi(that.where).then(res => {
+						let list = res.data.list;
+						let productList = that.$util.SplitArray(list, that.productList);
+						let loadend = list.length < that.where.limit;
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? '已全部加载' : '加载更多';
+						that.$set(that, 'productList', productList);
+						that.$set(that.where, 'page', that.where.page + 1);
+						this.isShow = true
+					}).catch(err => {
+						that.loading = false;
+						that.loadTitle = '加载更多'
+					})
+				} else {
+					this.merId === 0 ? productList(that.where).then(res => {
+						let list = res.data.list;
+						let productList = that.$util.SplitArray(list, that.productList);
+						let loadend = list.length < that.where.limit;
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? '已全部加载' : '加载更多';
+						that.$set(that, 'productList', productList);
+						that.$set(that.where, 'page', that.where.page + 1);
+						this.isShow = true
+					}).catch(err => {
+						that.loading = false;
+						that.loadTitle = '加载更多'
+					}) : getMerProListApi(that.where).then(res => {
+						let list = res.data.list;
+						let productList = that.$util.SplitArray(list, that.productList);
+						let loadend = list.length < that.where.limit;
+						that.loadend = loadend;
+						that.loading = false;
+						that.loadTitle = loadend ? '已全部加载' : '加载更多';
+						that.$set(that, 'productList', productList);
+						that.$set(that.where, 'page', that.where.page + 1);
+						this.isShow = true
+					}).catch(err => {
+						that.loading = false;
+						that.loadTitle = '加载更多'
+					})
+				}
 			},
 		},
 		onReachBottom() {
@@ -499,7 +565,7 @@
 			if (this.tabIndex === 2) {
 				this.getMerStreet();
 			}
-			if (this.productList.length > 0 && !fairCateId) {
+			if (this.productList.length > 0) {
 				this.get_product_list();
 			}
 			if ((this.productList.length == 0 && this.isShow && this.tabIndex === 1 && !this.loading) || (this.merchantList
@@ -928,4 +994,16 @@
 	.box-line2 {
 		overflow: hidden;
 	}
+	.mask {
+		opacity: .5;
+		position: fixed;
+		inset: 0px;
+		background-color: rgba(0, 0, 0, 0.4);
+		transition: opacity 300ms ease 0ms, -webkit-transform 300ms ease 0ms, transform 300ms ease 0ms;
+		transform-origin: 50% 50%;
+	
+	}
+	.bg-color-good {
+		color: $bg-color-primary;
+	}
 </style>

+ 17 - 8
mer_uniapp/pages/trade_fair/home/index.vue

@@ -19,9 +19,9 @@
 				<!--  #endif -->
 				<view class="discover-navTab acea-row row-middle bg--w111-fff mt-4">
 					<view class="acea-row row-center-wrapper" :style="[textBoxStyle]">
-						<view style="margin-right: 52rpx;" :class="tabActive == 0 ? 'on' : ''" class="nav-item" @click="tabActive=0;showCateDrawer = false">本校</view>
-						<view style="margin-right: 52rpx;" :class="tabActive == 1 ? 'on' : ''" class="nav-item pb-10" @click="tabActive=1;">同城</view>
-						<view :class="tabActive == 2 ? 'on' : ''" class="nav-item pb-10" @click="tabActive=2;">全国</view>
+						<view style="margin-right: 52rpx;" :class="tabActive == 0 ? 'on' : ''" class="nav-item" @click="tabActive=0;rangeStr='school';showCateDrawer = false">本校</view>
+						<view style="margin-right: 52rpx;" :class="tabActive == 1 ? 'on' : ''" class="nav-item pb-10" @click="tabActive=1;rangeStr='city';">同城</view>
+						<view :class="tabActive == 2 ? 'on' : ''" class="nav-item pb-10" @click="tabActive=2;rangeStr='all';">全国</view>
 					</view>
 					<!-- #ifndef MP -->
 					<view style="width: 32rpx;"></view>
@@ -30,8 +30,8 @@
 				<view class='search acea-row '>
 					<view class='input acea-row row-middle'>
 						<text class='iconfont icon-sousuo2'></text>
-						<input class="placeholder" type='text' :value='searchValue' :focus="focus" placeholder='请输入标题' placeholder-class='placeholder'
-						 @input="setValue" confirm-type="search" @confirm="searchBut()"></input>
+						<input class="placeholder" type='text' v-model='searchValue' :focus="focus" placeholder='搜索好物' placeholder-class='placeholder'
+						 confirm-type="search" @confirm="searchBut()"></input>
 					</view>
 					<view class='bnt' @tap='searchBut'>搜索</view>
 				</view>
@@ -232,7 +232,8 @@
 				tabLeft: 0, //设置下划线位置
 				isLeft: 0, //导航栏下划线位置
 				isWidth: 0, //每个导航栏占位
-				tabActive: 1, // 顶部关注、发现切换
+				tabActive: 0, // 顶部关注、发现切换
+				rangeStr: 'school',
 				windowHeight: 0,
 				theme: app.globalData.theme,
 				marTop: 0,
@@ -301,7 +302,8 @@
 					name: '有图'
 				}],
 				active: 0,
-				recommendIndexL: 0
+				recommendIndexL: 0,
+				searchValue: ''
 			}
 		},
 		// 滚动监听
@@ -373,6 +375,13 @@
 			styleIsolation: 'shared'
 		},
 		methods: {
+			searchBut () {
+				console.log(this.searchValue)
+				console.log(this.$refs.recommendIndex)
+				this.$refs.recommendIndex.where.page = 1;
+				this.$refs.recommendIndex.tempArr = []
+				this.$refs.recommendIndex.get_host_product();
+			},
 			returns: function() {
 				if (this.returnShow) {
 					uni.navigateBack(-1);
@@ -801,7 +810,7 @@
 			onCategoryClick(item) {
 				console.log(item)
 				uni.navigateTo({
-					url: `/pages/goods/goods_list/index?fairCateId=${item.id}&title=${item.name}`
+					url: `/pages/goods/goods_list/index?fairCateId=${item.id}&title=${item.name}&rangeStr=${this.rangeStr}&tabActive=${this.tabActive}`
 				})
 			}
 		}

+ 35 - 4
mer_uniapp/pages/trade_fair/trade_fair_user/index.vue

@@ -81,7 +81,7 @@
 					<view class="goods">
 						<!-- <WaterfallsFlow v-if="list.length" :wfList="list" :fromType="1" fromTo="home">
 						</WaterfallsFlow> -->
-						<WaterfallsFlow :wfList='list' :type="1" :isDynamics="true" :userFair="true">
+						<WaterfallsFlow :wfList='list' :type="1" :isDynamics="true" :userFair="true" :isManage="manage">
 							<template slot-scope="{item}">
 								<WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
 							</template>
@@ -143,6 +143,8 @@
 		authorNoteApi,
 		mySecondHandListApi,
 		myLikeListApi,
+		secondHandListApi,
+		secondHandFollowListApi,
 		editSignatureApi,
 		editSchoolApi
 	} from '@/api/discover.js';
@@ -187,7 +189,8 @@
 				isShowSignature: false, // 是否显示简介编辑内容
 				signature: '', //弹窗中的签名
 				school: '',
-				fieldStr: ''
+				fieldStr: '',
+				manage: 1
 			}
 		},
 		created() {},
@@ -269,6 +272,7 @@
 			//获取我的用户信息
 			getMyHome() {
 				myHomeApi().then(res => {
+					console.log(res.data)
 					this.userInfo = res.data;
 					this.signature = this.userInfo.signature
 					this.school = this.userInfo.school
@@ -308,18 +312,45 @@
 				this.loaded = this.loading = false
 				this.list = []
 				if (tab === 0) {
+					this.manage = 1;
 					this.myNoteList();
-				} else {
+				} else if (tab === 1) {
+					this.manage = 0;
 					this.myLikeList();
+				} else if (tab === 2) {
+					this.manage = 0;
+					this.myFollowList()
 				}
 			},
 			// 获取我的点赞作品
+			myFollowList: function() {
+				let that = this;
+				if (that.loaded || that.loading) return;
+				that.loading = true;
+				that.loadTitle = '';
+				secondHandFollowListApi(that.where).then(res => {
+					let list = res.data.list;
+					let goods = that.$util.SplitArray(list, that.list);
+					that.loaded = list.length < that.where.limit;
+					that.loading = false;
+					that.loadTitle = that.loaded ? '到底了' : '加载更多';
+					that.$set(that, 'list', goods);
+					that.$set(that.where, 'page', that.where.page + 1);
+				}).catch(err => {
+					that.loading = false;
+					uni.showToast({
+						title: err,
+						icon: 'none'
+					})
+				})
+			},
+			// 获取我的点赞作品
 			myLikeList: function() {
 				let that = this;
 				if (that.loaded || that.loading) return;
 				that.loading = true;
 				that.loadTitle = '';
-				myLikeListApi(that.where).then(res => {
+				secondHandListApi(that.where).then(res => {
 					let list = res.data.list;
 					let goods = that.$util.SplitArray(list, that.list);
 					that.loaded = list.length < that.where.limit;