Forráskód Böngészése

小程序二期,分享,pdf,报告停留时长

db 3 éve
szülő
commit
91a9ac038d

+ 4 - 0
config/api.js

@@ -172,4 +172,8 @@ export const Reports = {
 	getArticleList: params => {
 		return getHttp('/report/industry/ArticleList',params)
 	},
+/*上传文章阅读时间接口*/
+	addStopTime: params => {
+		return postHttp('/article/addStopTime',params,0)
+	},
 }

+ 2 - 2
config/config.js

@@ -1,6 +1,6 @@
 
- //export const baseUrl = 'http://8.136.199.33:8500/api';//小程序开发接口地址
-export const baseUrl = 'https://cygx.hzinsights.com/api';//小程序线上接口地址
+ export const baseUrl = 'http://8.136.199.33:8500/api';//小程序开发接口地址
+//export const baseUrl = 'https://cygx.hzinsights.com/api';//小程序线上接口地址
 // #ifdef H5
 export const H5baseUrl=process.env.NODE_ENV === 'development'?window.location.origin+'/':baseUrl
 // #endif

+ 12 - 0
pages.json

@@ -121,6 +121,14 @@
             }
             
         }
+        ,{
+            "path" : "pages/reportSearch/reportSearch",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "搜索"
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
@@ -128,6 +136,10 @@
 		"navigationBarBackgroundColor": "#fff",
 		"backgroundColor": "#F8F8F8",
 		"backgroundTextStyle":"dark"
+		// "usingComponents": {
+		//   "van-dropdown-menu": "vantComponents/vant/dropdown-menu/index",
+		//   "van-dropdown-item": "vantComponents/vant/dropdown-item/index"
+		// }
 	},
 	"tabBar": {
 		"color": "#D0CFD5",

+ 18 - 14
pages/IndustryReport/IndustryReport.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="industry-content">
-	<view v-if="haveDatas">
+	<view v-if="layoutTime">
 	<view class="content-top">
 	  <view class="top-bg">产业赛道布局于{{layoutTime}}</view>
    <view class="top-box">
@@ -12,9 +12,9 @@
       				class="scroll-tab" 
       				:scroll-into-view="'_'+tabIndex">
       					<block v-for="(item, index) in tabBars" :key="item.CategoryId">
-      						<view :id="'_'+index" class="scroll-tab-item" :class="{ active: tabAct_id === item.CategoryId }" @click.stop="toggleTab(item,index)">
+      						<view :id="'_'+index" class="scroll-tab-item" :class="{ active: tabAct_id == item.CategoryId }" @click.stop="toggleTab(item,index)">
       						{{item.MatchTypeName}}
-      						<image src="@/static/img/border_act.png" mode="" class="border_act" v-if="tabAct_id === item.CategoryId"></image>
+      						<image src="@/static/img/border_act.png" mode="" class="border_act" v-if="tabAct_id == item.CategoryId"></image>
                   <text class="reg-hint" v-if="item.IsRed"></text>
       						</view>
       					</block>
@@ -58,7 +58,7 @@
           tabAct_id:null,
 		  tabBars: [],
 		  industrialManagementId:null,
-		  layoutTime:null,
+		  layoutTime:'',
           refresh: false,//正在下拉
           page_no:1,
           pageSize:10,
@@ -80,8 +80,12 @@
 		},
     onLoad(option) {
 		this.industrialManagementId=option.id
+		this.tabAct_id=option.tab
 		this.toArticleCategoryList()
     },
+	onShow() {
+		
+	},
     watch:{
       //监听tabs的变化
         tabAct_id: {
@@ -92,7 +96,7 @@
 						this.getCollectList()
 					}
         			},
-        			immediate:true
+        		immediate:true
         		}
       },
     methods:{
@@ -183,26 +187,26 @@
     		if(this.status === 'nomore') return ;
     		this.status = 'loading';
     		this.page_no++;
+			if(this.tabAct_id){
     		this.getCollectList()
+			}
     	}),
     	/* 下拉刷新 */
     	onPullDownRefresh: Throttle(function() {
-    		this.page_no = 1;
-    		this.refresh = true;
-    		this.getCollectList()
+    		
+    		if(this.tabAct_id){
+				this.page_no = 1;
+				this.refresh = true;
+				this.getCollectList()
+    		}
     	}),
-    
-	onBackPress	() {
-		console.log(123000000000000)
-	},
 	/**
 	* 用户点击分享
 	*/
 	onShareAppMessage: function (res) {
-		console.log(this.industrialManagementId)
 		return {
 			title: this.titleReport,
-			path: '/pages/IndustryReport/IndustryReport?id='+this.industrialManagementId,
+			path: '/pages/IndustryReport/IndustryReport?id='+this.industrialManagementId+'&tab='+this.tabAct_id,
 			success: (res)=> {
 			},
 			fail: (err)=> {

+ 9 - 2
pages/downloadFile/downloadFile.vue

@@ -21,10 +21,17 @@
 			        if (res.statusCode === 200) {
 							   uni.openDocument({
 							   		filePath:res.tempFilePath,
+									showMenu:true
 							   })
 			        }
-			    }
-			});
+			    },
+				// fail:(res)=>{
+				// 	console.log('fail',option.url,res);
+				// },
+				// complete:(res)=>{
+				// 	console.log('complete',option.url,res);
+				// }
+			})
 			downloadTask.onProgressUpdate((res) => {
 				this.progress=res.progress
 			});

+ 1 - 1
pages/index/index.vue

@@ -235,7 +235,7 @@ export default {
 	*/
 	onShareAppMessage: function (res) {
 		return {
-			title: '您手边的研究素材检索库',
+			title: '您手边的弘则研究素材检索库',
 			path: '/pages/index/index',
 			imageUrl: '/static/img/home_share.png',
 			success: (res)=> {

+ 10 - 5
pages/login/login.vue

@@ -62,7 +62,8 @@
 				phoneNum:'',//手机号,
 				codeNum:'',//验证码
 				phoneIpt:'',
-				phone_code:''
+				phone_code:'',
+				countryCode:'',//区号
 			};
 		},
 		methods:{
@@ -78,15 +79,17 @@
 			},
 			/* 授权获取手机号 */
 			getPhoneNumber(e) {
-				// console.log(e)
+				//console.log(e)
 				if(e.detail.errMsg == 'getPhoneNumber:ok') { // 点击了允许
 					User.getPhoneNum({
 						EncryptedData: e.detail.encryptedData,
 						Iv: e.detail.iv
 					}).then(res => {
 						if(res.Ret === 200) {
-							this.phoneNum = res.Data.PhoneNumber;
-              this.phoneIpt=res.Data.PhoneNumber;
+						console.log(res);
+							this.phoneNum = res.Data.PurePhoneNumber;
+							this.countryCode=res.Data.CountryCode
+                             this.phoneIpt=res.Data.PhoneNumber;
 							this.bindHandle()
 						}
 					})
@@ -125,7 +128,8 @@
 				if(this.bind_type === 1) {
 					params = {
 						LoginType: 1,
-						Mobile: this.phoneNum
+						Mobile: this.phoneNum,
+						CountryCode:this.countryCode
 					}
 					User.Bind(params).then(res => {
 						if(res.Ret === 200) {
@@ -164,6 +168,7 @@
 			},
 			/* 绑定手机号 */
 			bindPhoneHandle() {
+				console.log(1111);
 				if(this.phoneIpt && this.phone_code && this.checked) {
 					let params = {
 						Mobile: this.phoneIpt,

+ 27 - 4
pages/reportDetail/reportDetail.vue

@@ -49,7 +49,7 @@
 </template>
 
 <script>
-	import { Report,User } from '@/config/api.js'
+	import { Report,User ,Reports} from '@/config/api.js'
 	let app = getApp();
 	export default {
 		data() {
@@ -59,8 +59,6 @@
 				access_token:'',//用户标识
 				isIphoneX:false,//判断机型
 				reportInfo:'',
-				//linkurl:'http://192.168.1.61:2000/raiReportDtl',//链接地址
-				// linkurl:'http://8.136.199.33:8088/raiReportDtl',//链接地址
 				linkurl:'https://details.hzinsights.com/raiReportDtl',//线上链接地址
 				//linkurl:' http://192.168.1.155:2000/raiReportDtl',//链接地址
 				showNav:false,
@@ -70,9 +68,12 @@
 				sale_name:'',//可联系销售名称
 				sale_number:'',//可联系销售电话
 				industry:'',//行业
+				readTiem:0,
+				setIntervalTiem:null
 			};
 		},
 		computed:{
+			
 			userId(){
 				return this.id ? this.id : this.idReport
 			}
@@ -193,7 +194,11 @@
 				})
 			}
 		},
-		onShow() {
+		onShow() {
+			this.readTiem=0
+		this.setIntervalTiem=setInterval(() => {
+			      this.readTiem++
+			    },1000)
 			let page = getCurrentPages();//查看路径
 			if(page.length === 1) { //分享入口
 				this.$store.dispatch('checkHandle').then(res => {
@@ -272,6 +277,24 @@
 				}
 			}
 			
+		},
+		onHide(){
+			clearInterval(this.setIntervalTiem)
+			Reports.addStopTime({
+				ArticleId:Number(this.id)||Number( this.idReport)  ,
+				StopTime:this.readTiem
+			}).then(res=>{
+				
+			})
+		},
+		onUnload(){
+			clearInterval(this.setIntervalTiem)
+			Reports.addStopTime({
+				ArticleId:Number(this.id)||Number( this.idReport)  ,
+				StopTime:this.readTiem
+			}).then(res=>{
+				
+			})
 		}
 	}
 </script>

+ 1 - 1
pages/reportForm/components/strategy.vue

@@ -173,7 +173,7 @@
 <style scoped lang="scss">
 .industrial-container {
   background-color: #f6f6f6;
-  margin-top: 20rpx;
+  margin-top: 35rpx;
   .collect-ul {
     // margin-top: 10rpx;
     // background-color: #f6f6f6;

+ 781 - 709
pages/reportForm/reportForm.vue

@@ -1,725 +1,797 @@
 <template>
-  <view class="reportForm-container">
-    <!-- tabs -->
-	<view class="top-box">
-	<view class="top-tab-cont">
-     <view class="tab-cont">
-     				<scroll-view 
-     				scroll-x="true" 
-     				scroll-with-animation 
-     				class="scroll-tab" 
-     				:scroll-into-view="'_'+tabIndex">
-     					<block v-for="(item, index) in tabBars" :key="item.ChartPermissionId">
-     						<view :id="'_'+index" class="scroll-tab-item" :class="{ active: tabAct_id === item.ChartPermissionId }" @click.stop="toggleTab(item,index)">
-     						{{item.PermissionName}}
-     						<image src="@/static/img/border_act.png" mode="" class="border_act" v-if="tabAct_id === item.ChartPermissionId"></image>
-     						</view>
-     					</block>
-     				</scroll-view>
-            
-     			</view>
-           <view class="lucency" v-if="tabBars.length>6"></view>
-   </view>
-  	</view>
-   <!-- 内容 -->
-   <view class="strategy" v-if="strategyIndex==4">
-    <view class="tab-cont-two">
-       				<scroll-view 
-       				scroll-x="true" 
-       				scroll-with-animation 
-       				class="scroll-tab-tow" 
-       			>
-       					<block v-for="(item, index) in tabBarsTow" :key="item.CategoryId">
-       						<view :id="'_'+index"
-                   class="scroll-tab-item"
-                    :class="{ active: tabAct_idTwo === item.CategoryId }" 
-                    @click.stop="toggleTabTwo(item,index)">
-       						{{item.MatchTypeName}}
-                  <text class="reg-text" v-if="item.IsRed"></text>
-       						</view>
-       					</block>
-       				</scroll-view>   
-      </view>
-      <view class="row">
-        
-      </view>
-  <!-- 子组件 -->
-      <strategy :strategyIndexTwo="strategyIndexTwo" :pageNumFather='pageNumFather' :matchTypeName="matchTypeName" :tabAct_idTwo="tabAct_idTwo" :isNum="isNum" :isSwitchover="isSwitchover"  @hideIsred="hideIsred"/>
-     </view>
-   <!-- </view> -->
-  <view class="industrial_eport_one" v-else>  
-      <!-- 行业报告 -->
-   <view class="industry" v-if="tradeList">
-     <view style="height: 12rpx;"></view>
-     <view class="industry-top">
-     <view class="img-top-box">
-       <image src="@/static/img/industry-ico.png" ></image>
-       <text>行业综述</text>
-     </view>
-     <view></view>
-     </view>
-     <view class="industry-box" @click="isClickHandle(item.CategoryId)" v-for="item in tradeList" :key="item.CategoryId">
-       <view class="box-left">
-         {{item.MatchTypeName}}
-         <text v-if="item.IsRed"></text>
-       </view>
-       <view class="box-right">
-         <text>{{item.UpdateTime}}更新</text>
-        	<u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
-       </view>
-     </view>
-   </view>
-    <!-- 产业报告 -->
-   <view class="industry">
-	 <!-- <view style="" class="industry-box-sticky"></view> -->
-	 <view style="height: 12rpx;" v-if="!tradeList"></view>
-     <view class="industry-top industry-sticky" >
-      <view>
-        <image src="@/static/img/property_ico.png" style="height: 50rpx;"></image>
-        <text class="text-sub">细分产业报告</text>
-      </view>
-	  <text class="equilateral-triangle" v-if="isPitchOnShow"></text>
-      <view class="pop-box">
-          <!-- <image src="@/static/img/property_inco.png" style="height: 50rpx;" @click="isPitchOnShowBtn"></image> -->
-		  <text @click="isPitchOnShowBtn" class="pop-text">
-			 {{pitchOnName}}
-		  </text>
-          <view class="pop-up" v-if="isPitchOnShow">
-            <view v-for="(item,index) in pitchOn" :key="item.id" @click="pitchClick(item,index)" :class="pitchOnId==item.id?'pitch-on':''">{{item.name}}</view>
-			
-          </view>
-           
-      </view>
-	  
-     </view>
-     <!-- 需要循环的地方 -->
-     <view class="forindustry" v-for="item in industryList" :key="item.IndustrialManagementId" >
-       <!-- 火锅底料这个位置 -->
-       <view class="industry-box industry-content" >
-         <view class="industry-box-left">
-           <image src="@/static/img/top_ico.png" v-if="item.IsTop" @click="isOverhead(item.IndustrialManagementId)"></image>
-           <image src="@/static/img/top_no_ico.png" v-else  @click="isOverhead(item.IndustrialManagementId)"></image>
-         </view>
-         <view class="industry-box-right" @click="goIndustryReport(item.IndustrialManagementId)">
-			 <view class="ndustry-box-read"> 
-					<text>{{item.IndustryName}}</text>
-					<text v-if="item.IsRed" class="read"></text>
-			 </view>
-           <view class="ndustry-box-arrow">
-           	<text class="ndustry-box-text">{{item.UpdateTime}}更新</text>
-           	<u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
-           </view>
-         </view>
-       </view>
-        <view class="content-box" v-if="item.IndustrialSubjectList.length>6">
-         <!-- <view class="img-box">
-            <image src="@/static/img/fenxi_ico.png"></image>
-            <text> 分析师:&nbsp; {{item.Analyst}}</text>
-          </view>
-          <view class="img-box">
-              <image src="@/static/img/fugai_ico.png"></image>
-            <text>覆盖标的</text>
-          </view>
-        -->
-            <u-read-more :toggle="true" :show-height="item.IndustrialSubjectList.length>6 ? 140 :150" :shadow-style="shadowStyle" close-text="展开" color="#D1D1D1">
-                 <view class="read-more">
-                 <view v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId"  @click="goIndustryReport(item.IndustrialManagementId)" class="text-box">{{val.SubjectName}}</view>
-                 </view>
-            </u-read-more>
-        </view>
-		<view class="content-box" v-else   @click="goIndustryReport(item.IndustrialManagementId)" >
-		         <view class="read-more">
-		         <view v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId" class="text-box">{{val.SubjectName}}</view>
-		         </view>
+	<view class="reportForm-container">
+		<!-- tabs -->
+		<view class="top-box">
+			<view class="top-tab-cont">
+				<view class="tab-cont">
+					<scroll-view scroll-x="true" scroll-with-animation class="scroll-tab"
+						:scroll-into-view="'_'+tabIndex">
+						<block v-for="(item, index) in tabBars" :key="item.ChartPermissionId">
+							<view :id="'_'+index" class="scroll-tab-item"
+								:class="{ active: tabAct_id == item.ChartPermissionId }"
+								@click.stop="toggleTab(item,index)">
+								{{item.PermissionName}}
+								<image src="@/static/img/border_act.png" mode="" class="border_act"
+									v-if="tabAct_id == item.ChartPermissionId"></image>
+							</view>
+						</block>
+					</scroll-view>
+
+				</view>
+				<view class="lucency" v-if="tabBars.length>6"></view>
+			</view>
+		</view>
+		<!-- 内容 -->
+		<view class="strategy" v-if="strategyIndex==4">
+			<view class="tab-cont-two">
+				<scroll-view scroll-x="true" scroll-with-animation class="scroll-tab-tow">
+					<block v-for="(item, index) in tabBarsTow" :key="item.CategoryId">
+						<view :id="'_'+index" class="scroll-tab-item"
+							:class="{ active: tabAct_idTwo == item.CategoryId }" @click.stop="toggleTabTwo(item,index)">
+							{{item.MatchTypeName}}
+							<text class="reg-text" v-if="item.IsRed"></text>
+						</view>
+					</block>
+				</scroll-view>
+			</view>
+			<view class="row">
+
+			</view>
+			<!-- 子组件 -->
+			<strategy :strategyIndexTwo="strategyIndexTwo" :pageNumFather='pageNumFather' :matchTypeName="matchTypeName"
+				:tabAct_idTwo="tabAct_idTwo" :isNum="isNum" :isSwitchover="isSwitchover" @hideIsred="hideIsred" />
+		</view>
+		<!-- </view> -->
+		<view class="industrial_eport_one" v-else>
+			<!-- 行业报告 -->
+			<view class="industry" v-if="tradeList">
+				<view style="height: 12rpx;"></view>
+				<view class="industry-top">
+					<view class="img-top-box">
+						<image src="@/static/img/industry-ico.png"></image>
+						<text>行业综述</text>
+					</view>
+					<view>
+
+					</view>
+				</view>
+				<view class="industry-box" @click="isClickHandle(item.CategoryId)" v-for="item in tradeList"
+					:key="item.CategoryId">
+					<view class="box-left">
+						{{item.MatchTypeName}}
+						<text v-if="item.IsRed"></text>
+					</view>
+					<view class="box-right">
+						<text>{{item.UpdateTime}}更新</text>
+						<u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
+					</view>
+				</view>
+			</view>
+			<!-- 产业报告 -->
+			<view class="industry">
+				<view style="height: 12rpx;" v-if="!tradeList"></view>
+				<view class="industry-top industry-sticky">
+					<view>
+						<image src="@/static/img/property_ico.png" style="height: 50rpx;"></image>
+						<text class="text-sub">细分产业报告</text>
+					</view>
+					<text class="equilateral-triangle" v-if="isPitchOnShow"></text>
+					<view class="pop-box">
+						<!-- <image src="@/static/img/property_inco.png" style="height: 50rpx;" @click="isPitchOnShowBtn"></image> -->
+						<text @click="isPitchOnShowBtn" class="pop-text">
+							{{pitchOnName}}
+						</text>
+						<view class="pop-up" v-if="isPitchOnShow">
+							<view v-for="(item,index) in pitchOn" :key="item.id" @click="pitchClick(item,index)"
+								:class="pitchOnId==item.id?'pitch-on':''">{{item.name}}</view>
+
+						</view>
+
+					</view>
+
+				</view>
+				<!-- 需要循环的地方 -->
+				<view class="forindustry" v-for="item in industryList" :key="item.IndustrialManagementId">
+					<!-- 火锅底料这个位置 -->
+					<view class="industry-box industry-content">
+						<view class="industry-box-left">
+							<image src="@/static/img/top_ico.png" v-if="item.IsTop"
+								@click="isOverhead(item.IndustrialManagementId)"></image>
+							<image src="@/static/img/top_no_ico.png" v-else
+								@click="isOverhead(item.IndustrialManagementId)"></image>
+						</view>
+						<view class="industry-box-right" @click="goIndustryReport(item.IndustrialManagementId)">
+							<view class="ndustry-box-read">
+								<text>{{item.IndustryName}}</text>
+								<text v-if="item.IsRed" class="read"></text>
+							</view>
+							<view class="ndustry-box-arrow">
+								<text class="ndustry-box-text">{{item.UpdateTime}}更新</text>
+								<u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
+							</view>
+						</view>
+					</view>
+					<view class="content-box" v-if="item.IndustrialSubjectList.length>6">
+						<u-read-more :toggle="true" :show-height="item.IndustrialSubjectList.length>6 ? 140 :150"
+							:shadow-style="shadowStyle" close-text="展开" color="#D1D1D1">
+							<view class="read-more">
+								<view v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId"
+									@click="goIndustryReport(item.IndustrialManagementId)" class="text-box">
+									{{val.SubjectName}}</view>
+							</view>
+						</u-read-more>
+					</view>
+					<view class="content-box" v-else @click="goIndustryReport(item.IndustrialManagementId)">
+						<view class="read-more">
+							<view v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId"
+								class="text-box">{{val.SubjectName}}</view>
+						</view>
+					</view>
+				</view>
+				<u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20"
+					v-if="totalPage>1" />
+			</view>
 		</view>
-     </view>
-	  <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage>1"/> 
-   </view>
-    <!-- <text class="text-bottom-none">没有更多了</text> -->
-   </view>
-  
-   <u-mask :show="isPitchOnShow" @click="isPitchOnShow = false" :z-index="8" :custom-style="{background: 'rgba(0, 0, 0, 0)'}"></u-mask>
-  </view>
+
+		<u-mask :show="isPitchOnShow" @click="isPitchOnShow = false" :z-index="8"
+			:custom-style="{background: 'rgba(0, 0, 0, 0)'}"></u-mask>
+	</view>
 </template>
 
 <script>
-  import strategy from "./components/strategy.vue"
-  import { Throttle } from '@/config/util.js' 
-  import { Reports } from '@/config/api.js' 
-  export default {
-   components:{strategy},
-    data(){
-      return {
-		tabAct_id:null,
-        tabAct_idTwo:null,
-        tabBars: [],
-		pageNumFather:null,
-        shadowStyle: {	backgroundImage: "none"},
-        tabBarsTow:[],
-        pitchOn:[{  name:'按最近更新排序',  id:'NewTime' }, {  name:'按推荐关注排序', id:'Recommend',}],
-		pitchOnId:'NewTime',
-		pitchOnName:'按最近更新排序',
-        isPitchOnShow:false,  
-        isNum:1,
-		strategyIndex:null,
-		strategyIndexTwo:0,
-		isSwitchover:1,
-		tradeList:[],
-		OrderColumn:'',
-		industryList:[],
-		loadText: {
-			loadmore: '上拉加载更多',
-			loading: '加载中',
-			nomore: '已经到底了'
+	import strategy from "./components/strategy.vue"
+	import {
+		Throttle
+	} from '@/config/util.js'
+	import {
+		Reports
+	} from '@/config/api.js'
+	export default {
+		components: {
+			strategy
 		},
-		refresh: false,//正在下拉
-		page_no:1,
-		pageSize:10,
-		status:'loadmore',
-		haveData:true,
-		 totalPage:'',
-		 matchTypeName:'',
-      }
-    },
-     onLoad() {
-	this.getClassify()	
-	},
-	computed:{
-	},
-    watch:{
-      //监听tabs的变化
-        tabAct_id: {
-        			handler() {
-						if(this.strategyIndex==4) {
-							this.getstrategyAll()
-						}
-						if(this.tabAct_id) {
-							this.OrderColumn='NewTime'
-							this.pitchOnId='NewTime'
-							this.pitchOnName='按最近更新排序'
-							this.page_no = 1;
-							this.refresh = true;
-							this.getIndustryList()
-							this.getTradeList()
-						}	
-        			},
-        			immediate:true
-        		}
-      },
-    methods:{
-	 //获取一级事件
-	 getClassify(){
-			Reports.getClassify().then(res=>{
-				this.tabBars=res.Data.List
-				this.tabAct_id=res.Data.List[0].ChartPermissionId			
-			})
+		data() {
+			return {
+				tabAct_id: null,
+				tabAct_idTwo: null,
+				tabBars: [],
+				pageNumFather: null,
+				shadowStyle: {
+					backgroundImage: "none"
+				},
+				tabBarsTow: [],
+				pitchOn: [{
+					name: '按最近更新排序',
+					id: 'NewTime'
+				}, {
+					name: '按推荐关注排序',
+					id: 'Recommend',
+				}],
+				pitchOnId: 'NewTime',
+				pitchOnName: '按最近更新排序',
+				isPitchOnShow: false,
+				isNum: 1,
+				strategyIndex: null,
+				strategyIndexTwo: 0,
+				isSwitchover: 1,
+				tradeList: [],
+				OrderColumn: '',
+				industryList: [],
+				loadText: {
+					loadmore: '上拉加载更多',
+					loading: '加载中',
+					nomore: '已经到底了'
+				},
+				refresh: false, //正在下拉
+				page_no: 1,
+				pageSize: 10,
+				status: 'loadmore',
+				haveData: true,
+				totalPage: '',
+				matchTypeName: '',
+			}
+		},
+		onLoad(option) {
+			this.tabAct_id = option.tab || null
+			if (option.tabs!=='null'&&option.tabs) {
+				this.strategyIndex = 4
+				this.tabAct_idTwo = option.tabs
+			}
+			this.getClassify()
+		},
+		computed: {},
+		watch: {
+			//监听tabs的变化
+			tabAct_id: {
+				handler() {
+					if (this.strategyIndex == 4) {
+						this.getstrategyAll()
+					}else {
+						this.tabAct_idTwo=null
+					}
+					if (this.tabAct_id) {
+						this.OrderColumn = 'NewTime'
+						this.pitchOnId = 'NewTime'
+						this.pitchOnName = '按最近更新排序'
+						this.page_no = 1;
+						this.refresh = true;
+						this.getIndustryList()
+						this.getTradeList()
+					}
+				},
+				immediate: true
+			}
 		},
-	 //获取二级事件
-	 getstrategyAll(){
-			Reports.getstrategyAll().then(res=>{
-				this.tabBarsTow=res.Data.List
-				this.tabAct_idTwo=res.Data.List[0].CategoryId
-				this.matchTypeName=res.Data.List[0].MatchTypeName
-			})
+		methods: {
+			//获取一级事件
+			getClassify() {
+				Reports.getClassify().then(res => {
+					this.tabBars = res.Data.List
+					if (!this.tabAct_id) {
+						this.tabAct_id = res.Data.List[0].ChartPermissionId
+					}
+
+				})
+			},
+			//获取二级事件
+			getstrategyAll() {
+				Reports.getstrategyAll().then(res => {
+					this.tabBarsTow = res.Data.List
+					if (!this.tabAct_idTwo) {
+						this.tabAct_idTwo = res.Data.List[0].CategoryId
+					}
+					this.matchTypeName = res.Data.List[0].MatchTypeName
+				})
+			},
+			//tabs切换事件
+			toggleTab(item, index) {
+				this.strategyIndex = index
+				this.isPitchOnShow = false
+				if (this.tabAct_id !== item.ChartPermissionId) {
+					this.tabAct_id = item.ChartPermissionId;
+					this.pageNum = 1;
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 0,
+					});
+				}
+			},
+			//tabs切换二级事件
+			toggleTabTwo(item, index) {
+				this.matchTypeName = item.MatchTypeName
+				this.strategyIndexTwo = index
+				if (this.tabAct_idTwo !== item.CategoryId) {
+					this.tabAct_idTwo = item.CategoryId;
+					this.pageNum = 1;
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 0,
+					});
+				}
+			},
+			//产业报告筛选条件
+			isPitchOnShowBtn() {
+				this.isPitchOnShow = !this.isPitchOnShow
+			},
+			//点击产业报告的筛选条件
+			pitchClick(item) {
+				this.pitchOnName = item.name
+				this.OrderColumn = item.id
+				if (this.pitchOnId !== item.id) {
+					this.pitchOnId = item.id;
+				}
+				this.page_no = 1;
+				this.refresh = true;
+				this.getIndustryList()
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 300
+				});
+				this.isPitchOnShow = false
+			},
+			//获取报告所有品种接口
+			getTradeList() {
+				Reports.getTradeList({
+					ChartPermissionId: this.tabAct_id
+				}).then(res => {
+					if (res.Ret == 200) {
+						if (res.Data.List) {
+							this.tradeList = res.Data.List
+						} else {
+							this.tradeList = null
+						}
+					}
+				})
+			},
+			//获取产业报告所有品种接口
+			getIndustryList() {
+				Reports.getIndustryList({
+					ChartPermissionId: this.tabAct_id,
+					OrderColumn: this.OrderColumn,
+					PageSize: this.pageSize,
+					CurrentIndex: this.page_no
+				}).then(res => {
+					// this.industryList=res.Data.List
+					this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
+					this.totalPage = res.Data.Paging.Pages; //总页数
+					if (this.page_no === 1) {
+						this.industryList = res.Data.List || [];
+						this.haveData = this.industryList.length ? true : false
+						if (this.refresh) {
+							uni.stopPullDownRefresh();
+							this.refresh = false;
+						}
+					} else {
+						this.industryList = this.industryList.concat(res.Data.List)
+					}
+
+				})
+			},
+			//跳转季度策略
+			isClickHandle(id) {
+				uni.navigateTo({
+					url: '/pages/industrialReport/industrialReport?id=' + id
+				});
+			},
+			//跳转产业报告
+			goIndustryReport(id) {
+				uni.navigateTo({
+					url: '/pages/IndustryReport/IndustryReport?id=' + id
+				});
+			},
+
+			//点击顶置的图标
+			isOverhead(id) {
+				Reports.postToptt({
+					IndustrialManagementId: id
+				}).then(res => {
+					if (res.Ret === 200) {
+						this.page_no = 1;
+						this.refresh = true;
+						this.industryList = []
+						this.getIndustryList()
+						uni.showToast({
+							title: res.Msg,
+							duration: 2000
+						});
+					}
+				})
+			},
+			hideIsred(is) {
+				this.tabBarsTow[this.strategyIndexTwo].IsRed = is
+			}
 		},
-     //tabs切换事件
-     toggleTab (item,index) {
-		  this.strategyIndex=index
-		  // console.log( this.strategyIndex)
-		  this.isPitchOnShow=false
-      		if(this.tabAct_id !== item.ChartPermissionId) {
-      			this.tabAct_id = item.ChartPermissionId;
-      			this.pageNum = 1;
-      			uni.pageScrollTo({
-      			   scrollTop: 0,
-      			   duration: 0,
-      			});
-      		}
-      	},
-	 //tabs切换二级事件
-     toggleTabTwo (item,index) { 
-		 this.matchTypeName=item.MatchTypeName
-			this.strategyIndexTwo=index
-      		if(this.tabAct_idTwo !== item.CategoryId) {
-      			this.tabAct_idTwo = item.CategoryId;
-      			this.pageNum = 1;
-      			uni.pageScrollTo({
-      			   scrollTop: 0,
-      			   duration: 0,
-      			});
-      		}
-      	},
-     //产业报告筛选条件
-      isPitchOnShowBtn(){
-        this.isPitchOnShow=!this.isPitchOnShow
-      },
-	  //点击产业报告的筛选条件
-      pitchClick(item) {
-		  this.pitchOnName=item.name
-		  this.OrderColumn=item.id
-		  if(this.pitchOnId !== item.id) {
-		  	this.pitchOnId = item.id;}
-			this.page_no = 1;
-			this.refresh = true;
+		/* 触底 */
+		onReachBottom: Throttle(function() {
+			this.isNum++
+			if (this.status === 'nomore') return;
+			this.status = 'loading';
+			this.page_no++;
 			this.getIndustryList()
-		  uni.pageScrollTo({
-		  scrollTop: 0,
-		  duration: 300
-		  });
-		this.isPitchOnShow=false
-      },
-	  //获取报告所有品种接口
-	  getTradeList(){
-		  Reports.getTradeList({
-			  ChartPermissionId:this.tabAct_id
-		  }).then(res=>{
-			  if(res.Ret==200){
-				  if(res.Data.List){
-					  this.tradeList=res.Data.List
-				  }else{
-					   this.tradeList=null
-				  }   
-			  }
-		  })
-	  },
-	  //获取产业报告所有品种接口
-	  getIndustryList(){
-	  		  Reports.getIndustryList({
-	  			  ChartPermissionId:this.tabAct_id,
-				  OrderColumn: this.OrderColumn,
-				  PageSize: this.pageSize,
-				  CurrentIndex: this.page_no
-	  		  }).then(res=>{	
-				 // this.industryList=res.Data.List
-				 this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
-				 this.totalPage = res.Data.Paging.Pages;//总页数
-				 if(this.page_no === 1) {
-				 	this.industryList = res.Data.List || [];
-				 	this.haveData = this.industryList.length ? true : false
-				 	if(this.refresh) {
-				 		uni.stopPullDownRefresh();
-				 		this.refresh = false;
-				 	} 
-				 }else {
-				 	this.industryList = this.industryList.concat(res.Data.List)
-				 }
-				  
-	  		  })
-	  },
-      //跳转季度策略
-      isClickHandle(id){
-        uni.navigateTo({
-        	url:'/pages/industrialReport/industrialReport?id='+id
-        });
-      },
-      //跳转产业报告
-      goIndustryReport(id){
-        uni.navigateTo({
-        	url:'/pages/IndustryReport/IndustryReport?id='+id
-        });
-      },
-	 
-	 //点击顶置的图标
-	  isOverhead(id){
-		  Reports.postToptt({
-			  IndustrialManagementId:id
-		  }).then(res=>{   
-			  if(res.Ret===200){
-				  this.page_no = 1;
-				  this.refresh = true;
-				  this.industryList=[]
-				   this.getIndustryList()
-				   uni.showToast({
-				       title: res.Msg,
-				       duration: 2000
-				   });
-			  } 
-		  })
-	  },
-	  hideIsred(is){
-		  this.tabBarsTow[this.strategyIndexTwo].IsRed=is
-	  }
-    },
-	   /* 触底 */
-   	onReachBottom: Throttle(function() {
-       this.isNum++
-	   if(this.status === 'nomore') return ;
-	   this.status = 'loading';
-	   this.page_no++;
-	   this.getIndustryList()
-   	}),
-	/* 下拉刷新 */
-	onPullDownRefresh: Throttle(function() {
-	if(this.strategyIndex==4) {
-		this.pageNumFather=1
-	}else {
-		this.industryList=[]
-		this.pageNumFather=null
-		this.page_no = 1;
-		this.refresh = true;
-		this.getIndustryList()
-		this.getTradeList()
+		}),
+		/* 下拉刷新 */
+		onPullDownRefresh: Throttle(function() {
+			if (this.strategyIndex == 4) {
+				this.pageNumFather = 1
+			} else {
+				this.industryList = []
+				this.pageNumFather = null
+				this.page_no = 1;
+				this.refresh = true;
+				this.getIndustryList()
+				this.getTradeList()
+			}
+			wx.stopPullDownRefresh();
+		}),
+		onShow() {
+			if (this.tabAct_id) {
+				this.getTradeList()
+			}
+
+		},
+		/**
+		 * 用户点击分享
+		 */
+		onShareAppMessage: function(res) {
+			console.log(this.tabAct_id);
+			return {
+				title: "报告",
+				path: '/pages/reportForm/reportForm?tab=' + this.tabAct_id + '&tabs=' + this.tabAct_idTwo,
+				success: (res) => {},
+				fail: (err) => {}
+			}
+		},
+
 	}
-	 wx.stopPullDownRefresh();
-	}),
-	onShow() {
-		if(this.tabAct_id) {
-			this.getTradeList()
-		}
-		
-	},
-	
-  }
 </script>
 
-<style lang="scss" >
-  .reportForm-container {
-       background-color: #f6f6f6;
-	   height: 100vh;
-	   .top-box {
-		   position: fixed;
-		   height: 100rpx;
-		   width: 100%;
-		   z-index: 99;
-		   background-color: #fff;
-		   top: 0;
-		   left: 0;
-    .top-tab-cont{
-      height: 60rpx;
-      padding-bottom: 40rpx;
-       position: relative;
-	   background-color: #FFF;
-       .lucency{
-         position: absolute;
-         top: 0;
-         right: 0;
-         width: 32px;
-         height: 30px;
-         opacity:0.9;
-         background-color: #fff;
-       }
-   .tab-cont {
-     margin-top: 20rpx;
-     padding: retu;
-   		padding: 0 26rpx;
-   		background-color: #fff;
-   		font-size: 32rpx;
-   		.scroll-tab {
-   			width: 100%;
-   			white-space: nowrap;
-   		}
-   		.scroll-tab-item {
-   			text-align: center;
-   			display: inline-block;
-   			padding: 0 8rpx 30rpx 8rpx;
-   			margin-right: 70rpx;
-   			border-bottom: 8rpx solid transparent;
-   			position: relative;
-   			&:last-child {
-   				margin-right: 0;
-   			}
-   			&.active {
-   				border-bottom: none;
-   				color: #2C83FF;
-   				font-weight: 700;
-   			}
-   			.border_act {
-   				width: 100%;
-   				height: 8rpx;
-   				position: absolute;
-   				bottom: 0;
-   				left: 0;
-   			}
-   		}
-   	}
-  }
-  }
-  .forindustry {
-	  margin-bottom: 10rpx;
-  }
-  .industrial_eport_one {
-	 padding-top: 80rpx;
-	 background-color:  #f6f6f6;
-	 padding-bottom: 10rpx;
-  }
-  .strategy {
-    margin-top: 20rpx;
-    height: 65rpx;
-    line-height: 65rpx;
-    background-color: #fff;
-    .row {
-      width: 100%;
-      height: 170rpx;
-      background-color: #f6f6f6;
-    }
-    .tab-cont-two {
-		position: fixed;
-		top: 100rpx;
-		left: 0;
-		width: 100%;
-		z-index: 99;
-		height: 100rpx;
-		background-color: #fff;
-       padding: 0 30rpx;
-      .scroll-tab-tow {
-		padding-top: 20rpx;
-        width: 100%;
-        white-space: nowrap;
-        .scroll-tab-item {
-          position: relative;
-          display: inline-block;
-          height: 54rpx;
-          line-height: 54rpx;
-          padding: 0 23rpx;
-          background: #F7F7F7;
-          border-radius: 27px;
-          color: #999999;
-          margin-right: 46rpx;
-          .reg-text {
-            position: absolute;
-            top: -6rpx;
-            right: -8rpx;
-            width: 14rpx;
-            height: 14rpx;
-            background-color: #FF0000;
-            border-radius: 50%;
-          }
-        }
-        .active {
-          color: #FFFFFF !important;
-          background-color: #2C83FF!important;
-        }
-      }
-    }
-  }
-  .industry {
-    margin-top: 20rpx;
-	// .industry-box-sticky{
-	// 	position: sticky;
-	// 	border: 2rpx solid #ccc;
-	// 	top:98rpx;
-	// 	z-index:999;
-	// 	width: 100%;
-	// 	height: 12rpx;
-	// 	// background-color: #fff;;
-	// }
-	.industry-sticky{
-		// border-bottom: 2rpx solid #f6f6f6;
-		position: sticky;
-		top:98rpx;
-		z-index:99;
-	}
-    .industry-top {
-      display: flex;
-      justify-content: space-between;
-      background-color: #fff;
-      width: 100%;
-      height: 90rpx;
-      padding: 0 30rpx;
-      color: #333333;
-      font-weight: 700;
-      font-size: 32rpx;
-      line-height:90rpx ;
-	  .equilateral-triangle {
-	  	 position: relative;
-	  	 bottom:-78rpx;
-		 right:-300rpx;
-		 padding: 0;
-	  	 width: 0;
-	  	 height: 0;
-	  	 border-left: 18rpx solid transparent;
-	  	 border-right: 18rpx solid transparent;
-	  	 border-bottom: 20rpx solid #434343;
-	  }
-      .pop-box {
-        position: relative;
-		width: 280rpx;
-		text-align: right;
-		.pop-up view:nth-child(2) {
-			border: none !important;
+<style lang="scss">
+	.reportForm-container {
+		background-color: #f6f6f6;
+		height: 100vh;
+		.top-box {
+			position: fixed;
+			height: 100rpx;
+			width: 100%;
+			z-index: 99;
+			background-color: #fff;
+			top: 0;
+			left: 0;
+
+			.top-tab-cont {
+				height: 60rpx;
+				padding-bottom: 40rpx;
+				position: relative;
+				background-color: #FFF;
+
+				.lucency {
+					position: absolute;
+					top: 0;
+					right: 0;
+					width: 32px;
+					height: 30px;
+					opacity: 0.9;
+					background-color: #fff;
+				}
+
+				.tab-cont {
+					margin-top: 20rpx;
+					padding: retu;
+					padding: 0 26rpx;
+					background-color: #fff;
+					font-size: 32rpx;
+
+					.scroll-tab {
+						width: 100%;
+						white-space: nowrap;
+					}
+
+					.scroll-tab-item {
+						text-align: center;
+						display: inline-block;
+						padding: 0 8rpx 30rpx 8rpx;
+						margin-right: 43rpx;
+						border-bottom: 8rpx solid transparent;
+						position: relative;
+
+						&:last-child {
+							margin-right: 0;
+						}
+
+						&.active {
+							border-bottom: none;
+							color: #2C83FF;
+							font-weight: 700;
+						}
+
+						.border_act {
+							width: 100%;
+							height: 8rpx;
+							position: absolute;
+							bottom: 0;
+							left: 0;
+						}
+					}
+				}
+			}
+		}
+
+		.forindustry {
+			margin-bottom: 10rpx;
+		}
+
+		.industrial_eport_one {
+			padding-top: 80rpx;
+			background-color: #f6f6f6;
+			padding-bottom: 10rpx;
+		}
+
+		.strategy {
+			margin-top: 20rpx;
+			height: 65rpx;
+			line-height: 65rpx;
+			background-color: #fff;
+
+			.row {
+				width: 100%;
+				height: 170rpx;
+				background-color: #f6f6f6;
+			}
+
+			.tab-cont-two {
+				position: fixed;
+				top: 100rpx;
+				left: 0;
+				width: 100%;
+				z-index: 99;
+				height: 100rpx;
+				background-color: #fff;
+				padding: 0 30rpx;
+
+				.scroll-tab-tow {
+					padding-top: 20rpx;
+					width: 100%;
+					white-space: nowrap;
+
+					.scroll-tab-item {
+						position: relative;
+						display: inline-block;
+						height: 54rpx;
+						line-height: 54rpx;
+						padding: 0 23rpx;
+						background: #F7F7F7;
+						border-radius: 27px;
+						color: #999999;
+						margin-right: 46rpx;
+
+						.reg-text {
+							position: absolute;
+							top: -6rpx;
+							right: -8rpx;
+							width: 14rpx;
+							height: 14rpx;
+							background-color: #FF0000;
+							border-radius: 50%;
+						}
+					}
+
+					.active {
+						color: #FFFFFF !important;
+						background-color: #2C83FF !important;
+					}
+				}
+			}
 		}
-		.pop-text {
-			font-size: 28rpx;
-			color: #2C83FF;
+
+		.industry {
+			margin-top: 20rpx;
+			.industry-sticky {
+				position: sticky;
+				top: 98rpx;
+				z-index: 99;
+			}
+
+			.industry-top {
+				display: flex;
+				justify-content: space-between;
+				background-color: #fff;
+				width: 100%;
+				height: 90rpx;
+				padding: 0 30rpx;
+				color: #333333;
+				font-weight: 700;
+				font-size: 32rpx;
+				line-height: 90rpx;
+
+				.equilateral-triangle {
+					position: relative;
+					bottom: -78rpx;
+					right: -300rpx;
+					padding: 0;
+					width: 0;
+					height: 0;
+					border-left: 18rpx solid transparent;
+					border-right: 18rpx solid transparent;
+					border-bottom: 20rpx solid #434343;
+				}
+
+				.pop-box {
+					position: relative;
+					width: 280rpx;
+					text-align: right;
+
+					.pop-up view:nth-child(2) {
+						border: none !important;
+					}
+
+					.pop-text {
+						font-size: 28rpx;
+						color: #2C83FF;
+					}
+
+					.pop-up {
+						position: absolute;
+						left: -30rpx;
+						bottom: -210rpx;
+						width: 317rpx;
+						text-align: center;
+						overflow: hidden;
+						font-size: 24rpx;
+						background-color: #434343;
+						border-radius: 10rpx;
+						z-index: 9;
+
+						.pitch-on {
+							color: #2C83FF !important;
+						}
+
+						view {
+							padding: 0;
+							height: 105rpx;
+							width: 258rpx;
+							font-size: 28rpx;
+							margin-left: 30rpx;
+							line-height: 104rpx;
+							border-bottom: 2rpx solid #f6f6f6;
+							text-align: center;
+							color: #FFFFFF;
+						}
+
+					}
+				}
+
+				.img-top-box {
+					padding-left: 5rpx;
+
+				}
+
+				image {
+					width: 44rpx;
+					height: 44rpx;
+					vertical-align: middle;
+					margin-top: -6rpx;
+				}
+
+				text {
+					display: inline-block;
+					padding-left: 16rpx;
+					vertical-align: middle;
+				}
+			}
+
+			.industry-box {
+				margin-top: 5rpx;
+				background-color: #fff;
+				height: 90rpx;
+				line-height: 90rpx;
+				padding: 0 30rpx;
+				display: flex;
+				justify-content: space-between;
+				color: #000000;
+				font-size: 30rpx;
+
+				.box-left {
+					position: relative;
+					// width: 150rpx;
+					padding-right: 30rpx;
+					height: 90rpx;
+
+					text {
+						position: absolute;
+						top: 20rpx;
+						right: 5rpx;
+						width: 14rpx;
+						height: 14rpx;
+						background-color: #f00;
+						border-radius: 50%;
+					}
+
+				}
+
+				.box-right {
+					color: #999999;
+					font-size: 26rpx;
+					// width: 45%;
+					display: flex;
+					justify-content: flex-end;
+					// justify-content: space-between;
+					text-align: right;
+					align-items: right;
+
+					u-icon {
+						padding-left: 15rpx;
+					}
+				}
+			}
+
+			.industry-content {
+				padding-left: 40rpx;
+				vertical-align: middle;
+				display: flex;
+				margin-bottom: 3rpx;
+
+				image {
+					padding-right: 20rpx;
+					width: 24rpx;
+					height: 30rpx;
+				}
+
+				.industry-box-left {
+					width: 48rpx;
+
+					image {
+						vertical-align: middle;
+						margin-top: -8rpx;
+						padding: 5rpx 20rpx 5rpx 0;
+					}
+				}
+
+				.industry-box-right {
+					width: 100%;
+					display: flex;
+					justify-content: space-between;
+
+					.ndustry-box-read {
+						position: relative;
+
+						.read {
+							position: absolute;
+							top: 20rpx;
+							right: -20rpx;
+							width: 14rpx;
+							height: 14rpx;
+							background-color: #FF0000;
+							border-radius: 50%;
+						}
+					}
+
+					.ndustry-box-arrow {
+						display: flex;
+
+						.ndustry-box-text {
+							font-size: 26rpx;
+							color: #999999;
+							padding-right: 20rpx;
+						}
+					}
+				}
+
+			}
+
+			.content-box {
+				background-color: #fff;
+				padding: 20rpx 25rpx 0;
+
+				.img-box {
+					display: flex;
+					height: 90rpx;
+					line-height: 90rpx;
+					box-sizing: border-box;
+					width: 100%;
+					vertical-align: middle !important;
+
+					image {
+						padding-top: 18rpx;
+						width: 44rpx;
+						height: 44rpx;
+						vertical-align: middle;
+					}
+
+					text {
+						display: inline-block;
+						padding-left: 16rpx;
+						vertical-align: middle !important;
+					}
+				}
+			}
 		}
-        .pop-up {
-          position: absolute;
-          left: -30rpx;
-          bottom: -210rpx;
-          width: 317rpx;
-		  text-align: center;
-		  overflow: hidden;
-          font-size: 24rpx;
-          background-color: #434343;
-		  border-radius: 10rpx;
-          z-index: 9;
-		 
-		  .pitch-on {
-			  color: #2C83FF !important;
-		  }
-          view {
-            padding: 0;
-			height: 105rpx;
-			width: 258rpx;
-			font-size: 28rpx;
-			margin-left: 30rpx;
-            line-height: 104rpx;
-            border-bottom: 2rpx solid #f6f6f6;
-            text-align: center;
-			color: #FFFFFF;
-          }  
-		
-        }
-      }
-      .img-top-box {
-        padding-left: 5rpx;
-		
-      }
-      image {
-        width: 44rpx;
-        height: 44rpx;
-        vertical-align:middle;
-		margin-top: -6rpx;
-      }
-      text {
-        display: inline-block;
-        padding-left: 16rpx;
-        vertical-align:middle;
-      }
-    }
-    .industry-box{
-      margin-top: 5rpx;
-      background-color: #fff;
-      height: 90rpx;
-      line-height: 90rpx;
-      padding: 0 30rpx;
-      display:flex;
-      justify-content: space-between; 
-      color: #000000;
-      font-size: 30rpx;
-      .box-left {
-        position: relative;
-        // width: 150rpx;
-		padding-right: 30rpx;
-        height: 90rpx;
-         text {
-           position: absolute;
-           top: 20rpx;
-           right: 5rpx;
-           width: 14rpx;
-           height: 14rpx;
-           background-color: #f00;
-           border-radius: 50%;
-         }
-         
-      }
-      .box-right { 
-        color: #999999;
-        font-size: 26rpx;
-		// width: 45%;
-        display: flex;
-		justify-content: flex-end;
-        // justify-content: space-between;
-		text-align: right;
-		align-items: right;
-        u-icon {
-          padding-left:15rpx;
-        }
-      }
-    }
-    .industry-content {
-      padding-left: 40rpx;
-      vertical-align:middle;
-	  display: flex;
-      margin-bottom: 3rpx;
-      image {
-      padding-right: 20rpx;
-        width: 24rpx;
-        height: 30rpx;
-      }
-      .industry-box-left {
-		  width: 48rpx;
-		image {
-			vertical-align: middle;
-			 margin-top: -8rpx; 
-			 padding:5rpx 20rpx 5rpx 0;
+		.read-more {
+			margin-left: 60rpx;
+			display: flex;
+			flex-wrap: wrap;
+
+			.text-box {
+				// display: inline-block;
+				margin-bottom: 27rpx;
+				margin-right: 40rpx;
+				padding: 0;
+				font-size: 24rpx;
+				color: #408FFF;
+				width: 170rpx;
+				height: 46rpx;
+				line-height: 46rpx;
+				text-align: center !important;
+				background: url(../../static/img/report_bg.png) no-repeat;
+				background-size: 100% 100%;
+				text-indent: 0em;
+			}
 		}
-      }
-	  .industry-box-right {
-		  width: 100%;
-		  display: flex;
-		  justify-content: space-between;
-		  .ndustry-box-read {
-			  position: relative;
-			  .read {
-				  position: absolute;
-				  top: 20rpx;
-				  right: -20rpx;
-				  width: 14rpx;
-				  height: 14rpx;
-				  background-color: #FF0000;
-				  border-radius: 50%;
-			  }
-		  }
-		  .ndustry-box-arrow {
-			  display: flex;
-			  .ndustry-box-text {
-				  font-size: 26rpx;
-				  color: #999999;
-				  padding-right: 20rpx;
-			  }
-		  }
-	  }
-    
-  }
-  .content-box {
-    background-color: #fff;
-    padding: 20rpx 25rpx 0;
-      .img-box {
-         display: flex;
-        height: 90rpx;
-        line-height: 90rpx;
-       box-sizing: border-box;
-        width: 100%;
-        vertical-align:middle !important;
-        image {
-          padding-top: 18rpx;
-         width: 44rpx;
-         height: 44rpx;
-         vertical-align:middle;
-        }
-        text {
-          display: inline-block;
-          padding-left: 16rpx;
-           vertical-align:middle !important;
-        }
-      }
-    }
-  }
-  .read-more {
-   margin-left:60rpx;
-   display: flex;
-   flex-wrap: wrap;
-   .text-box {
-     // display: inline-block;
-     margin-bottom: 27rpx;
-     margin-right:40rpx;
-     padding: 0;
-     font-size: 24rpx;
-     color: #408FFF;
-     width: 170rpx;
-     height: 46rpx;
-     line-height: 46rpx;
-     text-align: center !important;
-     background:url(../../static/img/report_bg.png) no-repeat;
-     background-size: 100% 100%;
-     text-indent:0em;
-   }
-  }
-  
-  }
-  .text-bottom-none {
-	  width: 100%;
-  	  text-align: center;
-  }
+
+	}
+
+	.text-bottom-none {
+		width: 100%;
+		text-align: center;
+	}
+	
 </style>

+ 490 - 0
pages/reportSearch/reportSearch.vue

@@ -0,0 +1,490 @@
+<template>
+	<view class="searchTarget-container container">
+		<view class="searchTarget-header">
+			<input type="text" 
+			placeholder="请输入关键字" 
+			placeholder-class="sea_ipt_placeholder" 
+			class="sea_ipt" 
+			v-model="searchTxt"
+			focus="true"
+			confirm-type="search"
+			@confirm="searchHandle"/>
+			<icon type="search" size="15" class="sea_ico"/>
+			<view class="ipt-right">
+				<icon type="clear" size="16" color="#E0E0E0" v-show="searchTxt" @click="clearIpt"/>
+				<text  class="line">|</text>
+				<text @click="searchHandle" style="color: #3385FF;">搜索</text>
+			</view>
+		</view>
+		<view class="search-cont">
+			<template v-if="!isResult">
+				<view class="search-cont-top" v-if="historySearchList.length">
+					<view class="cont-tit">
+						<text>搜索历史</text>
+						<image src="@/static/img/empty_ico.png" class="empty_ico" @click="clearHistory"></image>
+					</view>
+					<view class="targetList">
+						<view class="target-item" v-for="(item,index) in historySearchList" :key="index" @click="chooseTarget(item)">{{item}}</view>
+					</view>
+				</view>
+				<view class="search-cont-top">
+					<view class="cont-tit">
+						<text>弘则推荐</text>
+					</view>
+					<view class="targetList">
+						<view class="target-item" v-for="(item,index) in keywordList" :key="index" @click="chooseTarget(item)">{{item}}</view>
+					</view>
+				</view>
+			</template>
+			<template v-else>
+				<block v-if="haveResult">
+					<view class="result-data">
+						<view class="report-ul">
+							<view class="report-item" v-for="(report,index) in resultList" :key="index" v-if="index%2 === 0" @click="goDetail(report)">
+								<!-- <view class="item-content">{{report.content}}</view> -->
+								<view class="item-content"><u-parse :html="report.Body[0]+'...'"></u-parse></view>
+								<view class="line"></view>
+								<view class="item-title"><u-parse :html="report.Title"></u-parse></view>
+								<view class="item-abstract" v-if="report.abstract">
+									<image src="@/static/img/report_ico.png" class="report_ico"></image>
+									{{report.abstract}}
+								</view>
+								<text class="item-createtime">{{report.PublishDate}}</text>
+							</view>
+						</view>
+						<view class="report-ul">
+							<view class="report-item" v-for="(report,index) in resultList" :key="index"  v-if="index%2 !== 0" @click="goDetail(report)">
+								<!-- <view class="item-content">{{report.content}}</view> -->
+								<view class="item-content"><u-parse :html="report.Body[0]+'...'"></u-parse></view>
+								<view class="line"></view>
+								<view class="item-title"><u-parse :html="report.Title"></u-parse></view>
+								<view class="item-abstract" v-if="report.ExpertBackground">
+									<image src="@/static/img/report_ico.png" class="report_ico"></image>
+									{{report.ExpertBackground}}
+								</view>
+								<text class="item-createtime">{{report.PublishDate}}</text>
+							</view>
+						</view>
+					</view>
+					<u-loadmore :status="status" icon-type="flower" :load-text="loadText"  bg-color="#F7F7F7" padding-bottom="20rpx"/>
+					<!-- v-if="totalPage>1" -->
+				</block>
+				<view class="nodata" v-else>
+					<image src="@/static/img/nodata.png" mode="" class="nodata_ico"></image>
+					<text>未找到您想搜索的内容</text>
+				</view>
+			</template>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { Search } from '@/config/api.js';
+	import { Debounce,Throttle } from '@/config/util.js'
+	export default {
+		data() {
+			return {
+				searchTxt:'',//搜索关键字
+				isResult:false,//显示搜索结果
+				haveResult:true,//是否有搜索数据
+				// 历史搜索列表
+				historySearchList:[],
+				// 关键字列表
+				keywordList:[],
+				targetList:[],//所有指标列表
+				// 搜索结果列表
+				resultList:[],
+				page_no: 1,
+				pageSize: 10,
+				totalPage: 0,
+				orderColumn:'Matching',
+				loadText:{
+					loadmore: '上拉加载更多',
+					loading: '加载中',
+					nomore: '已经到底了'
+				},
+				status:'loadmore',
+				tabAct_id: 1,
+				isTabAct:true,
+				tabBars: [ {
+        					PermissionName: '匹配度排序',
+							ChartPermissionId:1,
+							mode:'Matching'
+        				}, 
+						{
+									PermissionName: '综合排序',
+									ChartPermissionId:2,
+									mode:'Comprehensive'
+								},
+						{
+        					PermissionName: '发布时间排序',
+							ChartPermissionId:3,
+							mode:'PublishDate'
+        				}],
+			};
+
+		},
+		watch:{
+			searchTxt(newVal) {
+				if(newVal.length <= 0) {
+					this.tabAct_id=1
+					this.isResult = false;
+				}
+			},
+      //监听tabs的变化
+      tabAct_id: {
+      			handler() {
+					if(this.isTabAct){
+						// console.log(111)
+						// this.getDataList();
+					}
+      				
+      			},
+      			// immediate:true
+      		}
+		},
+		methods:{
+			/* 获取关键词 */
+			getKeyWord() {
+				Search.getKeys().then(res => {
+					if(res.Ret === 200) {
+						this.keywordList = res.Data.Item.ConfigValue ? res.Data.Item.ConfigValue.split(',') : [];
+					}
+				})
+			},
+			// 选择历史搜索
+			chooseTarget(item) {
+				this.searchTxt = item;
+				this.SecName = item;
+				this.resultList = [];
+				this.page_no = 1;
+				this.getDataList();	
+			},
+			// 键盘输入过程中
+			searchDoing() {
+				this.isResult = false;
+				//全部指标列表
+				let arr = JSON.parse(JSON.stringify(this.targetList));
+				let filterArr = [];
+				// // 过滤出符合搜索条件的值
+				arr.forEach((item,index)=>{
+					if(item.SecName.includes(this.searchTxt)){
+						item.SecName = this.join(item.SecName,this.searchTxt)
+						filterArr.unshift(item);
+					}
+				});
+				this.keywordList = filterArr;
+			},
+			// 拼接
+			join(str,key){
+				return str.replace(new RegExp(`${key}`, 'g'), `%%${key}%%`).split('%%');
+			},
+			// 搜索数据
+			searchHandle: Debounce(function() {
+				if(this.searchTxt) {
+					//添加搜索记录
+					if(!this.historySearchList.includes(this.searchTxt)) {
+						this.historySearchList.unshift(this.searchTxt);
+						this.$db.set('historySearchList',JSON.stringify(this.historySearchList))
+					}
+					this.resultList = [];
+					this.page_no = 1;
+					this.getDataList();
+				}else {
+					this.$util.toast('请输入关键字')
+				}
+			}),
+			// 查找数据
+			getDataList() {
+				this.isResult = true;
+				Search.getResult({
+					KeyWord: this.searchTxt,
+					// PageSize: this.pageSize,
+					// CurrentIndex: this.page_no,
+					OrderColumn:this.orderColumn
+				}).then(res => {
+					if(res.Ret === 200) {
+						// this.status = this.page_no < res.Data.Paging.Pages ? 'loadmore' : 'nomore';
+						this.status = 'nomore';
+						this.totalPage = res.Data.Paging.Pages;//总页数
+						if(this.page_no === 1) {
+							this.resultList = res.Data.List || [];
+							this.haveResult = this.resultList.length ? true : false
+						}else {
+							this.resultList = this.resultList.concat(res.Data.List)
+						}
+					}
+				})
+			},
+			// 点击数据列表修改数据
+			itemClick(item) {
+				let data = encodeURIComponent(JSON.stringify(item));
+				uni.navigateTo({
+					url:'/pages/recordData/recordData?data=' + data
+				})
+			},
+			/* 表单清空 */
+			clearIpt() {
+				
+				this.searchTxt = '';
+				this.isTabAct=false
+				this.orderColumn='Matching'
+				// 
+			},
+			/* 历史搜索清空 */
+			clearHistory() {
+				this.historySearchList = [];
+				this.$db.del('historySearchList');
+			},
+			/* 进入详情 校验是否有该品种权限 */
+			goDetail(item) {
+				uni.navigateTo({
+					url:'/pages/reportDetail/reportDetail?id=' + item.ArticleId,
+				});
+				
+			},
+		},
+		/* 触底 */
+		onReachBottom: Throttle(function() {
+			// this.status = 'nomore';
+			if(this.isResult) {
+				// if(this.status === 'nomore') return ;
+				
+				// this.page_no++;
+				// this.getDataList();				
+			}
+		}),
+		onLoad() {
+			// 获取历史搜索记录
+			if(this.$db.get('historySearchList')) {
+				let historyList = JSON.parse(this.$db.get('historySearchList'));
+				this.historySearchList = historyList;
+			}
+		},
+		onShow() {
+			this.getKeyWord();
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+.searchTarget-container {
+	background-color: #fff;
+	.searchTarget-header {
+		padding: 0 34rpx;
+		width: 100%;
+		background-color: #fff;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 99;
+		padding: 30rpx 0;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.sea_ipt_placeholder {
+			color: #E5E5E5;
+		}
+		.sea_ipt {
+			width: 682rpx;
+			height: 70rpx;
+			line-height: 70rpx;
+			box-sizing: border-box;
+			border: 1rpx solid #E5E5E5;
+			background-color: rgba(245, 245, 245, 0.2);
+			font-size: 26rpx;
+			color: #4A4A4A;
+			padding: 0 180rpx 0 78rpx;
+			border-radius: 70rpx;
+		}
+		.sea_ico {
+			width: 31rpx;
+			height: 31rpx;
+			position: absolute;
+			left: 68rpx;
+			top: 50%;
+			transform: translateY(-50%);
+		}
+		.ipt-right {
+			display: flex;
+			align-items: center;
+			position: absolute;
+			right:59rpx;
+			top: 50%;
+			transform: translateY(-50%);
+			color: #3385FF;
+			.line {
+				margin: 0 21rpx;
+				color: #E0E0E0;
+			}
+		}
+	}
+	.search-cont {
+		padding-top: 130rpx;
+		.search-cont-top {
+			padding: 0 34rpx 0;
+			margin-bottom: 10rpx;
+			padding-top: 20rpx;
+			&:last-child {
+				margin-bottom: 0;
+			}
+			.cont-tit {
+				color: #666;
+				font-size: 28rpx;
+				margin-bottom: 30rpx;
+				display: flex;
+				justify-content: space-between;
+				.empty_ico {
+					width: 32rpx;
+					height: 33rpx;
+				}
+			}
+			.targetList {
+				display: flex;
+				flex-wrap: wrap;
+				// justify-content: space-between;
+				.target-item {
+					padding: 4rpx 18rpx;
+					color: #4A4A4A;
+					font-size: 26rpx;
+					// border: 1rpx solid #3385ff;
+					background-color: #F7F7F7;
+					margin-bottom: 30rpx;
+					margin-right: 30rpx;
+					border-radius: 20rpx;
+				}
+			}
+		}
+		.result-cont {
+			padding: 0 34rpx 0;
+			padding-left: 21rpx;
+			.result-list {
+				display: flex;
+				align-items: center;
+				color: #333;
+				padding-bottom: 30rpx;
+				border-bottom: 1rpx solid #EBEDF0;
+				margin-bottom: 30rpx;
+				.result_ico {
+					width: 28rpx;
+					height: 28rpx;
+					margin-right: 20rpx;
+				}
+				text {
+					display: inline;
+				}
+				.highlight {
+					color: #3385FF;
+				}
+			}
+		}
+		.result-data {
+			// margin-top: 80rpx;
+			min-height: calc(100vh - 130rpx);
+			padding: 20rpx 34rpx 40rpx;
+			display: flex;
+			background-color: #F7F7F7;
+			.report-ul {
+				width: 50%;
+				&:first-child {
+					margin-right: 10rpx;
+				}
+				.report-item {
+					padding: 20rpx 20rpx 24rpx 20rpx;
+					margin-bottom: 20rpx;
+					border-radius: 8rpx;
+					box-shadow: 0 3rpx 6rpx rgba($color: #000000, $alpha: 0.16);
+					background: #fff;
+					.item-content {
+						// height: 273rpx;
+						font-size: 24rpx;
+						line-height: 40rpx;
+						color: #7F7F7F;
+						display: -webkit-box;
+						// text-overflow:ellipsis;
+						// overflow: hidden;
+						text {
+							display: inline;
+						}
+					}
+					.line {
+						margin: 18rpx 0;
+						content: '';
+						width: 100%;
+						height: 1px;
+						padding: 0 32rpx;
+						box-sizing: border-box;
+						background-color: #E5E5E5;
+						-webkit-transform: scale(1, 0.5);
+						transform: scale(1, 0.5);
+						-webkit-transform-origin: center bottom;
+						transform-origin: center bottom;
+					}
+					.item-title {
+						font-size: 28rpx;
+						color: #4A4A4A;
+						margin-bottom: 10rpx;
+						text {
+							display: inline;
+						}
+					}
+					.item-abstract {
+						font-size: 26rpx;
+						color: #6A6A6A;
+						margin-bottom: 10rpx;
+						.report_ico {
+							width: 32rpx;
+							height: 26rpx;
+							margin-right: 20rpx;
+							display: inline-block;
+						}
+					}
+					.item-createtime {
+						color: #ACACAC;
+						font-size: 24rpx;
+					}
+				}
+			}
+		}
+	}
+  	.tab-cont {
+			position: fixed;
+			top: 128rpx;
+			width: 100%;
+  			padding: 0 26rpx;
+  			background-color: #fff;
+  			font-size: 32rpx;
+			z-index: 99;
+  			box-shadow: 0 3rpx 6rpx rgba(187,216,255,0.2);
+  			.scroll-tab {
+  				width: 100%;
+  				white-space: nowrap;
+  			}
+  			.scroll-tab-item {
+  				// flex-grow: 1;
+  				text-align: center;
+  				display: inline-block;
+  				padding: 0 8rpx 30rpx 8rpx;
+  				margin-right: 40rpx;
+  				border-bottom: 8rpx solid transparent;
+  				position: relative;
+  				&:last-child {
+  					margin-right: 0;
+  				}
+  				&.active {
+  					border-bottom: none;
+  					color: #2C83FF;
+  					font-weight: 700;
+  				}
+  				.border_act {
+  					width: 100%;
+  					height: 8rpx;
+  					position: absolute;
+  					bottom: 0;
+  					left: 0;
+  				}
+  			}
+  		}
+}
+</style>

+ 0 - 1
pages/search/search.vue

@@ -38,7 +38,6 @@
 			</template>
 			<template v-else>
 				<block v-if="haveResult">
-          <!-- 等接口待完善 -->
 <view class="tab-cont">
 				<scroll-view 
 				scroll-x="true" 

+ 1 - 0
vantComponents/vant-weapp/dropdown-item/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 111 - 0
vantComponents/vant-weapp/dropdown-item/index.js

@@ -0,0 +1,111 @@
+import { useParent } from '../common/relation';
+import { VantComponent } from '../common/component';
+VantComponent({
+  field: true,
+  relation: useParent('dropdown-menu', function () {
+    this.updateDataFromParent();
+  }),
+  props: {
+    value: {
+      type: null,
+      observer: 'rerender',
+    },
+    title: {
+      type: String,
+      observer: 'rerender',
+    },
+    disabled: Boolean,
+    titleClass: {
+      type: String,
+      observer: 'rerender',
+    },
+    options: {
+      type: Array,
+      value: [],
+      observer: 'rerender',
+    },
+    popupStyle: String,
+  },
+  data: {
+    transition: true,
+    showPopup: false,
+    showWrapper: false,
+    displayTitle: '',
+  },
+  methods: {
+    rerender() {
+      wx.nextTick(() => {
+        var _a;
+        (_a = this.parent) === null || _a === void 0
+          ? void 0
+          : _a.updateItemListData();
+      });
+    },
+    updateDataFromParent() {
+      if (this.parent) {
+        const {
+          overlay,
+          duration,
+          activeColor,
+          closeOnClickOverlay,
+          direction,
+        } = this.parent.data;
+        this.setData({
+          overlay,
+          duration,
+          activeColor,
+          closeOnClickOverlay,
+          direction,
+        });
+      }
+    },
+    onOpen() {
+      this.$emit('open');
+    },
+    onOpened() {
+      this.$emit('opened');
+    },
+    onClose() {
+      this.$emit('close');
+    },
+    onClosed() {
+      this.$emit('closed');
+      this.setData({ showWrapper: false });
+    },
+    onOptionTap(event) {
+      const { option } = event.currentTarget.dataset;
+      const { value } = option;
+      const shouldEmitChange = this.data.value !== value;
+      this.setData({ showPopup: false, value });
+      this.$emit('close');
+      this.rerender();
+      if (shouldEmitChange) {
+        this.$emit('change', value);
+      }
+    },
+    toggle(show, options = {}) {
+      var _a;
+      const { showPopup } = this.data;
+      if (typeof show !== 'boolean') {
+        show = !showPopup;
+      }
+      if (show === showPopup) {
+        return;
+      }
+      this.setData({
+        transition: !options.immediate,
+        showPopup: show,
+      });
+      if (show) {
+        (_a = this.parent) === null || _a === void 0
+          ? void 0
+          : _a.getChildWrapperStyle().then((wrapperStyle) => {
+              this.setData({ wrapperStyle, showWrapper: true });
+              this.rerender();
+            });
+      } else {
+        this.rerender();
+      }
+    },
+  },
+});

+ 8 - 0
vantComponents/vant-weapp/dropdown-item/index.json

@@ -0,0 +1,8 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-popup": "../popup/index",
+    "van-cell": "../cell/index",
+    "van-icon": "../icon/index"
+  }
+}

+ 48 - 0
vantComponents/vant-weapp/dropdown-item/index.wxml

@@ -0,0 +1,48 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  wx:if="{{ showWrapper }}"
+  class="{{ utils.bem('dropdown-item', direction) }}"
+  style="{{ wrapperStyle }}"
+>
+  <van-popup
+    show="{{ showPopup }}"
+    custom-style="position: absolute;{{ popupStyle }}"
+    overlay-style="position: absolute;"
+    overlay="{{ overlay }}"
+    position="{{ direction === 'down' ? 'top' : 'bottom' }}"
+    duration="{{ transition ? duration : 0 }}"
+    close-on-click-overlay="{{ closeOnClickOverlay }}"
+    bind:enter="onOpen"
+    bind:leave="onClose"
+    bind:close="toggle"
+    bind:after-enter="onOpened"
+    bind:after-leave="onClosed"
+  >
+    <van-cell
+      wx:for="{{ options }}"
+      wx:key="value"
+      data-option="{{ item }}"
+      class="{{ utils.bem('dropdown-item__option', { active: item.value === value } ) }}"
+      clickable
+      icon="{{ item.icon }}"
+      bind:tap="onOptionTap"
+    >
+      <view
+        slot="title"
+        class="van-dropdown-item__title"
+        style="{{ item.value === value  ? 'color:' + activeColor : '' }}"
+      >
+        {{ item.text }}
+      </view>
+      <van-icon
+        wx:if="{{ item.value === value }}"
+        name="success"
+        class="van-dropdown-item__icon"
+        color="{{ activeColor }}"
+      />
+    </van-cell>
+
+    <slot />
+  </van-popup>
+</view>

+ 1 - 0
vantComponents/vant-weapp/dropdown-item/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit}

+ 5 - 0
vantComponents/vant-weapp/dropdown-item/shared.d.ts

@@ -0,0 +1,5 @@
+export interface Option {
+  text: string;
+  value: string | number;
+  icon: string;
+}

+ 1 - 0
vantComponents/vant-weapp/dropdown-item/shared.js

@@ -0,0 +1 @@
+export {};

+ 1 - 0
vantComponents/vant-weapp/dropdown-menu/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 112 - 0
vantComponents/vant-weapp/dropdown-menu/index.js

@@ -0,0 +1,112 @@
+import { VantComponent } from '../common/component';
+import { useChildren } from '../common/relation';
+import { addUnit, getRect, getSystemInfoSync } from '../common/utils';
+let ARRAY = [];
+VantComponent({
+  field: true,
+  relation: useChildren('dropdown-item', function () {
+    this.updateItemListData();
+  }),
+  props: {
+    activeColor: {
+      type: String,
+      observer: 'updateChildrenData',
+    },
+    overlay: {
+      type: Boolean,
+      value: true,
+      observer: 'updateChildrenData',
+    },
+    zIndex: {
+      type: Number,
+      value: 10,
+    },
+    duration: {
+      type: Number,
+      value: 200,
+      observer: 'updateChildrenData',
+    },
+    direction: {
+      type: String,
+      value: 'down',
+      observer: 'updateChildrenData',
+    },
+    closeOnClickOverlay: {
+      type: Boolean,
+      value: true,
+      observer: 'updateChildrenData',
+    },
+    closeOnClickOutside: {
+      type: Boolean,
+      value: true,
+    },
+  },
+  data: {
+    itemListData: [],
+  },
+  beforeCreate() {
+    const { windowHeight } = getSystemInfoSync();
+    this.windowHeight = windowHeight;
+    ARRAY.push(this);
+  },
+  destroyed() {
+    ARRAY = ARRAY.filter((item) => item !== this);
+  },
+  methods: {
+    updateItemListData() {
+      this.setData({
+        itemListData: this.children.map((child) => child.data),
+      });
+    },
+    updateChildrenData() {
+      this.children.forEach((child) => {
+        child.updateDataFromParent();
+      });
+    },
+    toggleItem(active) {
+      this.children.forEach((item, index) => {
+        const { showPopup } = item.data;
+        if (index === active) {
+          item.toggle();
+        } else if (showPopup) {
+          item.toggle(false, { immediate: true });
+        }
+      });
+    },
+    close() {
+      this.children.forEach((child) => {
+        child.toggle(false, { immediate: true });
+      });
+    },
+    getChildWrapperStyle() {
+      const { zIndex, direction } = this.data;
+      return getRect(this, '.van-dropdown-menu').then((rect) => {
+        const { top = 0, bottom = 0 } = rect;
+        const offset = direction === 'down' ? bottom : this.windowHeight - top;
+        let wrapperStyle = `z-index: ${zIndex};`;
+        if (direction === 'down') {
+          wrapperStyle += `top: ${addUnit(offset)};`;
+        } else {
+          wrapperStyle += `bottom: ${addUnit(offset)};`;
+        }
+        return wrapperStyle;
+      });
+    },
+    onTitleTap(event) {
+      const { index } = event.currentTarget.dataset;
+      const child = this.children[index];
+      if (!child.data.disabled) {
+        ARRAY.forEach((menuItem) => {
+          if (
+            menuItem &&
+            menuItem.data.closeOnClickOutside &&
+            menuItem !== this
+          ) {
+            menuItem.close();
+          }
+        });
+        this.toggleItem(index);
+      }
+    },
+  },
+});

+ 3 - 0
vantComponents/vant-weapp/dropdown-menu/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 23 - 0
vantComponents/vant-weapp/dropdown-menu/index.wxml

@@ -0,0 +1,23 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+<wxs src="./index.wxs" module="computed" />
+
+<view class="van-dropdown-menu van-dropdown-menu--top-bottom">
+  <view
+    wx:for="{{ itemListData }}"
+    wx:key="index"
+    data-index="{{ index }}"
+    class="{{ utils.bem('dropdown-menu__item', { disabled: item.disabled }) }}"
+    bind:tap="onTitleTap"
+  >
+    <view
+      class="{{ item.titleClass }} {{ utils.bem('dropdown-menu__title', { active: item.showPopup, down: item.showPopup === (direction === 'down') }) }}"
+      style="{{ item.showPopup ? 'color:' + activeColor : '' }}"
+    >
+      <view class="van-ellipsis">
+        {{ computed.displayTitle(item) }}
+      </view>
+    </view>
+  </view>
+
+  <slot />
+</view>

+ 16 - 0
vantComponents/vant-weapp/dropdown-menu/index.wxs

@@ -0,0 +1,16 @@
+/* eslint-disable */
+function displayTitle(item) {
+  if (item.title) {
+    return item.title;
+  }
+
+  var match = item.options.filter(function(option) {
+    return option.value === item.value;
+  });
+  var displayTitle = match.length ? match[0].text : '';
+  return displayTitle;
+}
+
+module.exports = {
+  displayTitle: displayTitle
+};

+ 1 - 0
vantComponents/vant-weapp/dropdown-menu/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-dropdown-menu{display:-webkit-flex;display:flex;box-shadow:0 2px 12px rgba(100,101,102,.12);-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#ee0a24;color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)}