| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <template>
- <view>
- <view class="top-fixed">
- <view class="search-box ddflex">
- <view class="search-input ddflex fflex">
- <image src="/static/images/ssico.png"></image>
- <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
- placeholder="请输入关键词" />
- </view>
- </view>
- <view class="image-nav ddflex">
- <image src="/static/images/xbrm.png" @click="jumpUrl('/topic/contentList/contentList?code='+xbrmCode+'&title=小白入门')"></image>
- <image src="/static/images/tbal.png" @click="jumpUrl('/topic/contentList/contentList?code='+tbalCode+'&title=投保案例')"></image>
- <image src="/static/images/lpal.png" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')"></image>
- </view>
- <view class="map-ac">
- <scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
- <view :class="'fx-nav '+(fxIndex==index?'fx-nav-active':'')" v-for="item,index in fxList" @click="changeFxTab(index)">{{item.name}}</view>
- </scroll-view>
- </view>
- </view>
- <view style="height: 400rpx;"></view>
- <view class="list">
- <view class="video-box" v-if="fxContentList&&fxContentList.length > 0">
- <view class="video-card" v-for="(item, index) in fxContentList" :key="index" @click="jumpUrl('/topic/content/content?id='+item.id)">
- <view class="video-cover">
- <view class="video">
- <image mode="aspectFill" style="max-width: 100%;max-height: 100%;" :src="item.pic"></image>
- </view>
- <image v-if="item.contentType==2" class="video-play" src="/static/images/video_play.png"></image>
- </view>
- <view class="video-info">
- <view class="video-name tovers">{{item.title}}</view>
- <view class="video-info-desc">
- <view class="ddflex" style="overflow: hidden;">
- {{formatTime(item.createDate)}}
- </view>
- <view class="ddflex">
- <image style="width: 27rpx;height: 20rpx;margin-right: 10rpx" src="/static/images/eyes.png"></image>
- <view>{{unitFormat(item.browse)}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="nodata" v-if="!fxContentList||fxContentList.length==0">
- <image :src="picUrlss+'empty_zb.png'"></image>
- <text>暂无资讯</text>
- </view>
- </view>
- <foot channel="found" :isUpdate="isUpdate"></foot>
- </view>
- </template>
- <script>
- // pages/live/live.js
- const app = getApp();
- const req = require("../../utils/request.js");
- const util = require("../../utils/util.js");
- import foot from "../../components/nav-bar/index";
- export default {
- data() {
- return {
- picUrlss: req.public.picUrls,
- bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
- page: 1,
- pageList: [],
- searchVal:'',
- isLoad: true,
- isUpdate: false, // 是否更新消息
- hasmore: false,
- ishow: false,
- videoList:[],
- videoCurrent:null,//当前正在播放的视频下标
- config:{},
- isFullScreen:false,//是否正在全屏播放
-
- swiperPlayIndex:0,
-
- fxList:[],
- fxContentList:[],
- fxIndex:0,
-
- xbrmCode:req.public.xbrmCode,
- tbalCode:req.public.tbalCode,
- lpalCode:req.public.lpalCode
- };
- },
- components: {
- foot
- },
- props: {},
- async onLoad() { // this.getList()
- await this.getConfig()
- this.getFx()
- },
- onShow() {
- this.setData({
- isUpdate: !this.isUpdate
- });
- },
- onReachBottom() {
- this.page++;
- this.getFxContenteList();
- },
- methods: {
- getConfig() {
- return new Promise((resolve, reject) => {
- req.getRequest('/api/other/config', {}, (res)=> {
- this.config = res;
- resolve(res)
- });
- });
- },
- jumpUrl(url) {
- // if (!req.isLogins(true)) {
- // return;
- // }
- uni.navigateTo({
- url: url
- });
- },
- // 获取发现
- async getFx(){
- this.fxList = await this.getContentList(req.public.fxCode)
- this.getFxContenteList()
- },
- // 获取文章栏目列表
- getContentList(code){
- return new Promise((r,j)=>{
- req.getRequest('/api/content/category/list',{parentCode:code},res=>{
- r(res?res:[])
- })
- })
- },
- // 发现tab切换
- changeFxTab(index){
- if(this.fxIndex==index) return false;
- this.fxIndex = index
- this.isLoad = true
- this.page = 1
- this.getFxContenteList(this.fxList[this.fxIndex].code)
- },
- // 获取发现文章列表
- getFxContenteList() {
- let that = this;
- let isShowLoading = false;
- // console.log(that.isLoad);
- if (!that.isLoad) return false;
- that.isLoad = false;
- let form = {
- page: that.page,
- limit: 10,
- code:that.fxList[that.fxIndex].code
- };
- if(this.searchVal){
- form.title=this.searchVal
- }else{
- delete form.title
- }
- if (form.page == 1 && !isShowLoading) {
- req.loadIng('加载中');
- isShowLoading = true;
- }
- req.getRequest('/api/content/list', form, data => {
- if (data && data.length == 10) that.isLoad = true;
- if (that.page > 1) data = that.pageList.concat(data);
- if (!data || data.length < 10) {
- that.setData({
- hasmore: true
- });
- }
- if (data) {
- data.map(item => {
- if (item.start_time) {
- item.time = util.transTime(item.start_time);
- }
- return item;
- });
- }
- // console.log(data);
- that.setData({
- fxContentList: data
- });
- if (!this.pageList) {
- that.setData({
- ishow: true
- });
- } else {
- that.setData({
- ishow: false
- });
- }
- if (isShowLoading) {
- uni.hideLoading();
- isShowLoading = false;
- }
- });
- },
- searchFn(){
- this.isLoad = true
- this.page = 1
- this.getFxContenteList(this.fxList[this.fxIndex].code)
- },
- captureTime(time) {
- return util.formatTime(new Date(time.replace(/\-/g, '/'))).t2;
- },
- // 视频浏览数
- getBrowse(libraryId) {
- let params = {
- bindId: libraryId,
- type: 7,//素材
- behavior:4//浏览
- }
- req.postRequest('/api/v3/behavior/save', params, data => {});
- },
- // 秒转换分秒
- getMinuteTime(data) {
- let minute = parseInt(data / 60);
- let second = parseInt(data % 60);
- if (minute.toString().length == 1) minute = `0${minute}`;
- if (second.toString().length == 1) second = `0${second}`;
- return `${minute}:${second}`;
- },
- unitFormat(data){
- return req.unitConverter(data).text
- },
- formatTime(date){
- date = new Date(date.replace(/-/g, '/'))
- return util.formatTime(date).t3
- }
- }
- };
- </script>
- <style>
- @import "./found.css";
- </style>
|