jwyu 2 years ago
parent
commit
71ca6e6f9b

+ 1 - 1
api/user.js

@@ -42,7 +42,7 @@ export const apiUserLogin=params=>{
  * @param permission 选择的权限
  * @param real_name 姓名
  * @param source 来源:我的1、活动2、图库3、研报4
- * @param source_agent 来源平台:1:小程序、2:pc
+ * @param source_agent 来源平台:1:小程序、2:小程序(pc)、3:公众号、4:官网web(pc)
  * @param from_page 来源页面: '活动列表'、'活动详情'等
  */
 export const apiApplyPermission=params=>{

+ 120 - 0
components/searchBox/searchBox.vue

@@ -0,0 +1,120 @@
+<template>
+    <view :class="['flex search-box',isFocus||searchVal?'search-focus':'']">
+        <image 
+            class="search-icon" 
+            :src="isFocus||searchVal?'../../static/search-icon-s.png':'../../static/search-icon.png'" 
+            mode="aspectFill"
+        />
+        <input 
+            type="text" 
+            :maxlength="-1"
+            v-model="searchVal" 
+            :placeholder="placeholder" 
+            :focus="isFocus" 
+            @focus="handelFocus"
+            @blur="handelBlur"
+            @confirm="handleSearch"
+            @input="handleInput"
+            confirm-type="search"
+            :disabled="disabled"
+        />
+        <image 
+            class="search-clear" 
+            src="../../static/search-del.png" 
+            mode="aspectFill"
+            v-if="searchVal"
+            @click="handleClearSearch"
+        />
+        <view class="right-btn" v-if="hasRightBtn&&searchVal" @click="handleSearch">搜索</view>
+    </view>
+</template>
+
+<script>
+export default {
+    props: {
+        hasRightBtn:{
+            type:Boolean,
+            default:true
+        },
+        placeholder:{
+            type:String,
+            default:'请输入搜索关键词'
+        },
+        focus:{
+            type:Boolean,
+            default:false
+        },
+        disabled:{
+            type:Boolean,
+            default:false
+        }
+    },
+    data () {
+        return {
+            searchVal:'',
+            isFocus:this.focus
+        }
+    },
+    methods: {
+        handleClearSearch(){
+            this.searchVal=''
+            this.$emit('change',this.searchVal)
+            this.$emit('search')
+        },
+
+        handleInput(){
+            this.$emit('change',this.searchVal)
+        },
+
+        handelFocus(){
+            this.isFocus=true
+        },
+
+        handelBlur(){
+            this.isFocus=false
+        },
+
+        handleSearch(){
+            this.$emit('search')
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.search-box{
+    border: 1px solid #E5E5E5;
+    align-items: center;
+    background-color: #F6F6F6;
+    border-radius: 43rpx;
+    padding: 0 30rpx;
+    height: 70rpx;
+    .search-icon{
+        width: 48rpx;
+        height: 48rpx;
+        flex-shrink: 0;
+        margin-right: 5rpx;
+    }
+    input{
+        flex: 1;
+    }
+    .search-clear{
+        width: 40rpx;
+        height: 40rpx;
+        flex-shrink: 0;
+        margin-left: 5rpx;
+        margin-right: 20rpx;
+    }
+    .right-btn{
+        font-size: 28rpx;
+        color: #E3B377;
+        flex-shrink: 0;
+        border-left: 1px solid #999999;
+        padding-left: 20rpx;
+    }
+}
+.search-focus{
+    border-color: #E3B377;
+    background-color: #fff;
+}
+</style>

+ 9 - 3
pages.json

@@ -58,6 +58,12 @@
 				"navigationBarTitleText": "视频社区",
 				"enablePullDownRefresh": true
 			}
+		},
+		{
+			"path": "pages/video/videoSearch",
+			"style": {
+				"navigationBarTitleText": "视频社区"
+			}
 		}
 	],
 	"subPackages":[
@@ -307,16 +313,16 @@
 			"van-icon": "/wxcomponents/vant/icon/index",
 			"van-radio": "/wxcomponents/vant/radio/index",
 			"van-tab": "/wxcomponents/vant/tab/index",
-  		"van-tabs": "/wxcomponents/vant/tabs/index",
+  			"van-tabs": "/wxcomponents/vant/tabs/index",
 			"van-count-down": "/wxcomponents/vant/count-down/index",
 			"van-empty": "/wxcomponents/vant/empty/index",
 			"van-checkbox": "/wxcomponents/vant/checkbox/index",
 			"van-transition": "/wxcomponents/vant/transition/index",
 			"van-collapse": "/wxcomponents/vant/collapse/index",
-  		"van-collapse-item": "/wxcomponents/vant/collapse-item/index",
+  			"van-collapse-item": "/wxcomponents/vant/collapse-item/index",
 			"van-tag": "/wxcomponents/vant/tag/index",
 			"van-row": "/wxcomponents/vant/row/index",
-  		"van-col": "/wxcomponents/vant/col/index",
+  			"van-col": "/wxcomponents/vant/col/index",
 			"van-progress": "/wxcomponents/vant/progress/index",
 			"van-dialog": "/wxcomponents/vant/dialog/index"
 		}

+ 155 - 23
pages/video/videoList.vue

@@ -2,46 +2,113 @@
     <view class="video-list-page">
         <van-sticky style="background: #fff">
             <view class="flex search-wrap">
-                <van-search
-                    shape="round"
-                    :value="searchVal"
-                    placeholder="关键词搜索"
-                    @change="searchValChange"
-                    @search="onSearch"
-                    @clear="onClearSearch"
-                    clear-trigger="always"
-                    style="flex:1"
-                />
-                <image
-                    src="@/static/chart/menu.png"
-                    mode="widthFix"
-                    class="menu-icon"
-                    @click="showFilter=true"
-                />
+                <view @click="goSearchPage" style="flex:1;margin-right:30rpx" >
+                    <searchBox 
+                        placeholder="关键字搜索" 
+                        :hasRightBtn="false" 
+                        :disabled="true"
+                    ></searchBox>
+                </view>
+                <view class="flex" @click="showFilter=true">
+                    <image style="width:50rpx;height:50rpx" src="@/static/filter-icon.png" mode="aspectFill"/>
+                    <text style="color:#E3B377;font-size:32rpx">筛选</text>
+                </view>
             </view>
         </van-sticky>
-        <video
-            enable-auto-rotation
-            src="https://hzstatic.hzinsights.com/static/yb/video/a49d072618778809254a2a7d6e8fb4ac.mp4"
-        ></video>
+        <view class="list-wrap">
+            <view class="item" v-for="item in 4" :key="item">
+                <view class="title-box">
+                    <text class="tag">宏观</text>
+                    <text class="title">标题</text>
+                </view>
+                <button class="share-btn" open-type="share" :data-vid="item">
+                    <image class="share-img" src="@/static/share-icon.png" mode="aspectFill"/>
+                </button>
+                <video
+                    object-fit="cover"
+                    show-mute-btn
+                    src="https://hzstatic.hzinsights.com/static/yb/video/3a593d4aa674e7caa9a830803a527722.mp4"
+                ></video>
+                <view class="time">发布时间:2022-06-30 15:52:28</view>
+            </view>
+        </view>
+
+        <!-- 筛选 -->
+        <van-popup :show="showFilter" position="bottom" :safe-area-inset-bottom="false" round @close="showFilter=false">
+            <view class="filter-wrap">
+                <view class="flex top">
+                    <text style="color:#000">全部筛选</text>
+                    <text style="color:#E3B377" @click="showFilter=false">取消</text>
+                </view>
+                <view class="list-box">
+                    <van-collapse accordion @change="change" :value="active" :border="false">
+                        <van-collapse-item title="标题1" name='1' :border="false">
+                            代码是写出来给人看的,附带能在机器上运行
+                        </van-collapse-item>
+                        <van-collapse-item title="标题2" name='2' :border="false">
+                            代码是写出来给人看的,附带能在机器上运行
+                        </van-collapse-item>
+                        <van-collapse-item title="标题3" name='3' :border="false">
+                            代码是写出来给人看的,附带能在机器上运行
+                        </van-collapse-item>
+                    </van-collapse>
+                </view>
+            </view>
+        </van-popup>
     </view>
+    
 </template>
 <script>
 export default {
     data() {
         return {
+            showFilter:false,
+            active:'1'
         }
     },
     onLoad(options){
 
-    }
+    },
+    onShareAppMessage({from,target}) {
+        console.log(from,target);
+        return {
+            title:`FICC【】`
+        }
+    },
+    methods: {
+        goSearchPage(){
+            uni.navigateTo({
+                url: '/pages/video/videoSearch',
+            });
+        },
+        change(e){
+            this.active=e.detail
+        }
+    },
 }
 </script>
 
-<style>
+<style lang='scss'>
 .search-wrap .van-search{
     padding: 0 !important;
 }
+
+.video-list-page{
+    .filter-wrap{
+        .van-cell__title, .van-cell__value{
+            flex: none !important;
+        }
+        .van-cell:after{
+            border: none !important;
+        }
+        .van-cell__title{
+            font-size: 14px;
+        }
+        .van-hairline--top:after{
+            border-top-width: 0 !important;
+        }
+    }
+}
 </style>
 <style lang="scss" scoped>
 .video-list-page{
@@ -56,6 +123,71 @@ export default {
             flex-shrink: 0;
             margin-left: 30rpx;
         }
-    }   
+    } 
+    
+    .list-wrap{
+        .item{
+            border-top: 10rpx solid #f9f9f9;
+            padding: 30rpx 34rpx;
+            position: relative;
+            .title-box{
+                padding-right: 40rpx;
+            }
+            .share-btn{
+                position: absolute;
+                top: 34rpx;
+                right: 34rpx;
+                background-color: transparent;
+                width: 32rpx;
+                height: 32rpx;
+                line-height: 1;
+                padding: 0;
+                &::after{
+                    border: none;
+                }
+            }
+            .share-img{
+                width: 32rpx;
+                height: 32rpx;
+            }
+            .tag{
+                color: #E4B478;
+                background-color: #333;
+                padding: 5rpx 20rpx;
+                border-radius: 20rpx;
+                font-size: 24rpx;
+                margin-right: 26rpx;
+            }
+            .title{
+                font-size: 32rpx;
+                color: #000;
+            }
+            video{
+                width: 100%;
+                height: 400rpx;
+                margin: 30rpx 0 20rpx 0;
+                border-radius: 20rpx;
+            }
+            .time{
+                font-size: 28rpx;
+                color: #999;
+            }
+        }
+    }
+}
+
+.filter-wrap{
+    background-color: #fff;
+    padding-top: 53rpx;
+    .top{
+        font-size: 32rpx;
+        justify-content: space-between;
+        margin-bottom: 40rpx;
+        padding: 0 34rpx;
+    }
+    .list-box{
+        min-height: 30vh;
+        max-height: 60vh;
+    }
 }
 </style>

+ 47 - 0
pages/video/videoSearch.vue

@@ -0,0 +1,47 @@
+<template>
+    <view class="video-search-page">
+        <van-sticky style="background: #fff">
+            <view style="padding:30rpx 34rpx">
+            <searchBox 
+                :focus="focus" 
+                placeholder="关键字搜索" 
+                @change="onChange"
+                @search="onSearch"
+            ></searchBox>
+            </view>
+        </van-sticky>
+    </view>
+</template>
+
+<script>
+import searchBox from '@/components/searchBox/searchBox.vue'
+export default {
+    components: {
+        searchBox
+    },
+    data() {
+        return {
+            searchVal:'',
+            focus:true,
+            list:[],
+            finished:false,
+            page:1,
+        }
+    },
+}
+</script>
+
+<style>
+.van-sticky-wrap--fixed{
+  background-color: #fff;
+}
+page{
+    padding-bottom: 0;
+}
+</style>
+
+<style lang="scss" scoped>
+.video-search-page{
+
+}
+</style>

BIN
static/filter-icon.png


BIN
static/search-del.png


BIN
static/search-icon-s.png


BIN
static/search-icon.png


BIN
static/share-icon.png