123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <template>
- <view>
- <view class="flex space" style="display:flex; flex-wrap:wrap; padding: 30upx 30upx 0px 30upx;">
- <block v-for="(value,key) in listData" :key="key">
- <view class="box pb10 mb15" style="width:31%; border-radius:20rpx;"
- @click="detail(value.vid,value.mid)">
- <!-- <view class="btn-mini" style="position: absolute; top: 20upx; right: 20upx; border-radius: 10upx;font-size: 18upx;width: 60upx; height: 36upx; z-index: 1;" :style="getBtnStyle">{{value.lxname}}</view> -->
- <image class="integral-mall-goods" mode="aspectFill" :src="value.img"></image>
- <view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{value.vname}}</view>
- </view>
- </block>
- <!-- <uni-pagination title="" @change="onPageChange" v-if="total>pageSize" show-icon="true" :pageSize="pageSize" :total="total" current="1"></uni-pagination> -->
- </view>
- <uni-load-more :status="status" :content-text="contentText" />
- <view style="width: 100%; height: 30upx;"></view>
- <!-- <dialog-login v-if="showLogin" @loginYes="loginYes" @closed="showLogin = false"></dialog-login> -->
- <!-- <com-footer model="tuan"></com-footer> -->
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- export default {
- components: {
- uniLoadMore
- },
- data() {
- return {
- banners: [],
- vipLevel: 0,
- isLogin: true,
- showLogin: false,
- datasa: [],
- dataconfig: [],
- searchValue: '',
- total: 0,
- pageSize: 10,
- tabs: [{
- name: '全部'
- },
- {
- name: '视频'
- },
- ],
- selectIndex: 0,
- scrollTop: 0,
- type2tab: [],
- selecttype2: 0,
- type2id: '',
- type3tab: [],
- selecttype3: 0,
- type3id: '',
- type4tab: [],
- selecttype4: 0,
- type4id: '',
- typetab: [],
- selecttype: 0,
- typeid: '',
- addddtab: [],
- selectadddd: 0,
- addddid: '',
- yeartab: [],
- selectyear: 0,
- yearid: '',
- type: '',
- keytext: '',
- listData: [],
- last_id: 0,
- reload: true,
- status: 'more',
- contentText: {
- contentdown: '上拉加载更多',
- contentrefresh: '加载中',
- contentnomore: '没有数据了'
- }
- }
- },
- onLoad(e) {
- //console.log(111)
- if (e.selectIndex) {
- this.selectIndex = e.selectIndex * 1
- }
- this.status = 'more';
- this.getList();
- this.banners = uni.getStorageSync("config").banner
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- },
- onReachBottom() {
- this.status = 'more';
- this.getList();
- },
- //监听搜索框文本变化
- onNavigationBarSearchInputChanged(e) {
- let text = e.text;
- if (text) {
- this.keytext = text;
- }
- console.log(text)
- },
- //监听点击搜索按钮事件
- onNavigationBarSearchInputConfirmed(e) {
- // #ifdef APP-PLUS
- plus.key.hideSoftKeybord();
- // #endif
- var this_ = this
- let text = e.text;
- if (!text) {
- uni.showModal({
- title: '',
- content: "请输入搜索内容",
- showCancel: false,
- confirmText: "确定",
- confirmColor: "#e19503",
- success: function(res) {
- this_.keytext = '';
- this_.getList(0)
- }
- });
- return;
- } else {
- this.keytext = text;
- this.listData = [];
- this.last_id = 0;
- this.type = '';
- this.getList(0)
- }
- },
- methods: {
- detail(vid, mid) {
- var fxpid = 1
- if (uni.getStorageSync("userinfo")) {
- fxpid = uni.getStorageSync("userinfo").id
- }
- uni.navigateTo({
- url: '/pages/client/tuan/detail?vid=' + vid + '&mid=' + mid + '&fxpid=' + fxpid
- })
- },
- onPageChange(e) {
- this.last_id = 0
- this.reload = true
- this.getList()
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 100
- });
- },
- getList() {
- let data = {
- //column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
- };
- var limit = 10;
- if (this.last_id > 0) {
- //说明已有数据,目前处于上拉加载
- this.status = 'loading';
- data.offset = this.last_id * limit;
- data._ = new Date().getTime() + '';
- }
- data.limit = limit
- if (uni.getStorageSync("userinfo")) {
- data.uid = uni.getStorageSync("userinfo").id;
- }
- uni.request({
- url: this.configs.webUrl + '/api/video/wdxh',
- data: data,
- success: data => {
- if (data.data.total > 0) {
- let list = data.data.rows;
- this.listData = this.reload ? list : this.listData.concat(list);
- this.reload = false;
- this.last_id = this.last_id + 1;
- if (data.data.total < this.last_id * limit) {
- this.status = '';
- }
- } else {
- this.listData = [];
- this.contentText.contentdown = '没有数据'
- this.status = ''
- }
- },
- fail: (data, code) => {
- //console.log('fail' + JSON.stringify(data));
- }
- });
- },
- changeIndex(index) {
- this.selectIndex = index;
- this.type = this.tabs[index].name
- this.getdata()
- },
- changetype(index) {
- this.selecttype = index;
- this.typeid = this.typetab[index].id
- this.getdata()
- },
- changeadddd(index) {
- this.selectadddd = index;
- this.addddid = this.addddtab[index].id
- this.getdata()
- },
- changeyear(index) {
- this.selectyear = index;
- this.yearid = this.yeartab[index].id
- this.getdata()
- },
- changetype2(index) {
- this.selecttype2 = index;
- this.type2id = this.type2tab[index].id
- this.getdata()
- },
- changetype3(index) {
- this.selecttype3 = index;
- this.type3id = this.type3tab[index].id
- this.getdata()
- },
- changetype4(index) {
- this.selecttype4 = index;
- this.type4id = this.type4tab[index].id
- this.getdata()
- },
- getdata() {
- this.last_id = 0
- this.reload = true
- this.getList()
- },
- loginYes() {
- },
- mlinkTo(e) {
- if (this.isLogin == true) {
- let link = e.currentTarget.dataset.link;
- } else {
- this.showLogin = true;
- }
- },
- search(res) {
- this.listData = [];
- this.last_id = 0;
- this.keytext = res.value;
- this.type = '';
- this.getList(0)
- },
- clear(res) {
- },
- input(res) {
- console.log('----input:', res)
- },
- blur(res) {
- // this.listData=[];
- // this.last_id=0;
- // this.keytext=res.value;
- // this.type='';
- // this.getList(0)
- //res.value
- },
- focus(e) {
- },
- cancel(res) {
- this.keytext = '';
- this.type = '';
- this.getList(0)
- }
- }
- }
- </script>
- <style>
- .integral-mall-goods {
- width: 100%;
- height: 280rpx;
- background: #F2F2F2;
- border-radius: 16upx;
- }
- .user-not-vip {
- width: 100%;
- height: 80rpx;
- background: #FDF6EC;
- border-radius: 40rpx;
- border: 2rpx solid #EFC381;
- text-align: center;
- line-height: 76rpx;
- font-size: 24rpx;
- color: #000000;
- font-weight: bold;
- }
- .tuan-product-l {
- width: 320rpx;
- height: 240rpx;
- border-radius: 16rpx;
- background: #F2F2F2;
- }
- .tuan-product-r {
- width: calc(100% - 320rpx);
- }
- .search-result {
- padding-top: 10px;
- padding-bottom: 20px;
- text-align: center;
- }
- .search-result-text {
- text-align: center;
- font-size: 14px;
- color: #666;
- }
- .example-body {
- /* #ifndef APP-NVUE */
- display: block;
- /* #endif */
- padding: 0px;
- }
- .uni-mt-10 {
- margin-top: 10px;
- }
- </style>
|