zjjl.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view>
  3. <!-- <sub-tabnav :tabs="tabs" @change="changeIndex" :selectIndex="selectIndex" :scrollTop="scrollTop"></sub-tabnav> -->
  4. <!-- #ifdef MP-WEIXIN -->
  5. <!-- <view class="" style="background: #ffffff;">
  6. <uni-search-bar @confirm="search" :focus="false" placeholder="请输入搜索内容" v-model="searchValue" @blur="blur" @focus="focus" @input="input"
  7. @cancel="cancel" @clear="clear">
  8. </uni-search-bar>
  9. </view> -->
  10. <!-- #endif -->
  11. <!-- <view style="margin:10upx 30upx 0 30upx;box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.04);">
  12. <home-banner :banners="banners"></home-banner>
  13. </view> -->
  14. <view class="" style="padding: 30upx 30upx 0px 30upx;">
  15. <block v-for="(value,key) in listData" :key="key">
  16. <view @click="detail(value.vid,value.mid)" style="position: relative;" class="flex alcenter mb16">
  17. <image mode="aspectFill" class="tuan-product-l" :src="value.img"></image>
  18. <!-- <view class="btn-mini" style="position: absolute; top: 40upx; left: 280upx; border-radius: 10upx;font-size: 18upx;width: 60upx; height: 36upx;" :style="getBtnStyle">{{value.lxname}}</view> -->
  19. <view class="tuan-product-r pl15">
  20. <view class="ft16 ftw600 cl-main text-over2">{{value.vname}}</view>
  21. <view class="mt16">
  22. <text class="ft14 cl-orange">{{value.dqname}}</text>
  23. </view>
  24. <view class="mt16 flex space alcenter">
  25. <view class="ft14 cl-notice">{{value.mname}}</view>
  26. <view class="btn-vip-adviser ml15">继续观看</view>
  27. </view>
  28. </view>
  29. </view>
  30. </block>
  31. <!-- <uni-pagination title="" @change="onPageChange" v-if="total>pageSize" show-icon="true" :pageSize="pageSize" :total="total" current="1"></uni-pagination> -->
  32. </view>
  33. <uni-load-more :status="status" :content-text="contentText" />
  34. <view style="width: 100%; height: 30upx;"></view>
  35. <!-- <dialog-login v-if="showLogin" @loginYes="loginYes" @closed="showLogin = false"></dialog-login> -->
  36. <!-- <com-footer model="tuan"></com-footer> -->
  37. </view>
  38. </template>
  39. <script>
  40. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  41. export default {
  42. components: {
  43. uniLoadMore
  44. },
  45. data(){
  46. return {
  47. banners:[],
  48. vipLevel:0,
  49. isLogin:true,
  50. showLogin:false,
  51. datasa:[],
  52. dataconfig:[],
  53. searchValue:'',
  54. total:0,
  55. pageSize:10,
  56. tabs:[
  57. {name:'全部'},
  58. {name:'视频'},
  59. {name:'音频'},
  60. {name:'小说'},
  61. {name:'壁纸'},
  62. ],
  63. selectIndex:0,
  64. scrollTop:0,
  65. type2tab:[],
  66. selecttype2:0,
  67. type2id:'',
  68. type3tab:[],
  69. selecttype3:0,
  70. type3id:'',
  71. type4tab:[],
  72. selecttype4:0,
  73. type4id:'',
  74. typetab:[],
  75. selecttype:0,
  76. typeid:'',
  77. addddtab:[],
  78. selectadddd:0,
  79. addddid:'',
  80. yeartab:[],
  81. selectyear:0,
  82. yearid:'',
  83. type:'',
  84. keytext:'',
  85. listData: [],
  86. last_id: 0,
  87. reload: true,
  88. status: 'more',
  89. contentText: {
  90. contentdown: '上拉加载更多',
  91. contentrefresh: '加载中',
  92. contentnomore: '没有数据了'
  93. }
  94. }
  95. },
  96. onLoad(e){
  97. //console.log(111)
  98. if(e.selectIndex){
  99. this.selectIndex=e.selectIndex*1
  100. }
  101. this.status = 'more';
  102. this.getList();
  103. this.banners=uni.getStorageSync("config").banner
  104. },
  105. onPageScroll(e){
  106. this.scrollTop = e.scrollTop;
  107. },
  108. onReachBottom() {
  109. this.status = 'more';
  110. this.getList();
  111. },
  112. //监听搜索框文本变化
  113. onNavigationBarSearchInputChanged(e) {
  114. let text = e.text;
  115. if(text){
  116. this.keytext=text;
  117. }
  118. console.log(text)
  119. },
  120. //监听点击搜索按钮事件
  121. onNavigationBarSearchInputConfirmed(e) {
  122. // #ifdef APP-PLUS
  123. plus.key.hideSoftKeybord();
  124. // #endif
  125. var this_=this
  126. let text = e.text;
  127. if (!text) {
  128. uni.showModal({
  129. title: '',
  130. content:"请输入搜索内容",
  131. showCancel: false,
  132. confirmText: "确定",
  133. confirmColor:"#e19503",
  134. success: function (res) {
  135. this_.keytext='';
  136. this_.getList(0)
  137. }
  138. });
  139. return;
  140. } else {
  141. this.keytext=text;
  142. this.listData=[];
  143. this.last_id=0;
  144. this.type='';
  145. this.getList(0)
  146. }
  147. },
  148. methods:{
  149. detail(vid,mid){
  150. var fxpid=1
  151. if(uni.getStorageSync("userinfo")){
  152. fxpid=uni.getStorageSync("userinfo").id
  153. }
  154. uni.navigateTo({
  155. url:'/pages/client/tuan/detail?vid='+vid+'&mid='+mid+'&fxpid='+fxpid
  156. })
  157. },
  158. onPageChange(e) {
  159. this.last_id=0
  160. this.reload=true
  161. this.getList()
  162. uni.pageScrollTo({
  163. scrollTop: 0,
  164. duration: 100
  165. });
  166. },
  167. getList() {
  168. let data = {
  169. //column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
  170. };
  171. var limit=10;
  172. if (this.last_id>0) {
  173. //说明已有数据,目前处于上拉加载
  174. this.status = 'loading';
  175. data.offset = this.last_id*limit;
  176. data._ = new Date().getTime() + '';
  177. }
  178. data.limit=limit
  179. if(uni.getStorageSync("userinfo")){
  180. data.uid = uni.getStorageSync("userinfo").id;
  181. }
  182. uni.request({
  183. url: this.configs.webUrl+'/api/video/recordlist',
  184. data: data,
  185. success: data => {
  186. //console.log(data.data)
  187. if (data.data.total>0) {
  188. let list = data.data.rows;
  189. this.listData = this.reload ? list : this.listData.concat(list);
  190. this.reload = false;
  191. this.last_id = this.last_id+1;
  192. if(data.data.total<this.last_id*limit){
  193. this.status = '';
  194. }
  195. }else{
  196. this.listData=[];
  197. this.contentText.contentdown='没有数据'
  198. this.status=''
  199. }
  200. },
  201. fail: (data, code) => {
  202. //console.log('fail' + JSON.stringify(data));
  203. }
  204. });
  205. },
  206. changeIndex(index){
  207. this.selectIndex = index;
  208. this.type=this.tabs[index].name
  209. this.getdata()
  210. },
  211. changetype(index){
  212. this.selecttype = index;
  213. this.typeid=this.typetab[index].id
  214. this.getdata()
  215. },
  216. changeadddd(index){
  217. this.selectadddd = index;
  218. this.addddid=this.addddtab[index].id
  219. this.getdata()
  220. },
  221. changeyear(index){
  222. this.selectyear = index;
  223. this.yearid=this.yeartab[index].id
  224. this.getdata()
  225. },
  226. changetype2(index){
  227. this.selecttype2 = index;
  228. this.type2id=this.type2tab[index].id
  229. this.getdata()
  230. },
  231. changetype3(index){
  232. this.selecttype3 = index;
  233. this.type3id=this.type3tab[index].id
  234. this.getdata()
  235. },
  236. changetype4(index){
  237. this.selecttype4 = index;
  238. this.type4id=this.type4tab[index].id
  239. this.getdata()
  240. },
  241. getdata(){
  242. this.last_id=0
  243. this.reload=true
  244. this.getList()
  245. },
  246. loginYes(){
  247. },
  248. mlinkTo(e){
  249. if(this.isLogin == true){
  250. let link = e.currentTarget.dataset.link;
  251. }else{
  252. this.showLogin = true;
  253. }
  254. },
  255. search(res) {
  256. this.listData=[];
  257. this.last_id=0;
  258. this.keytext=res.value;
  259. this.type='';
  260. this.getList(0)
  261. },
  262. clear(res) {
  263. },
  264. input(res) {
  265. console.log('----input:', res)
  266. },
  267. blur(res) {
  268. // this.listData=[];
  269. // this.last_id=0;
  270. // this.keytext=res.value;
  271. // this.type='';
  272. // this.getList(0)
  273. //res.value
  274. },
  275. focus(e) {
  276. },
  277. cancel(res) {
  278. this.keytext='';
  279. this.type='';
  280. this.getList(0)
  281. }
  282. }
  283. }
  284. </script>
  285. <style>
  286. .integral-mall-goods{
  287. width: 100%;
  288. height: 280rpx;
  289. background: #F2F2F2;
  290. border-radius: 16upx;
  291. }
  292. .user-not-vip{
  293. width: 100%;
  294. height: 80rpx;
  295. background: #FDF6EC;
  296. border-radius: 40rpx;
  297. border: 2rpx solid #EFC381;
  298. text-align: center;
  299. line-height: 76rpx;
  300. font-size: 24rpx;
  301. color:#000000;
  302. font-weight: bold;
  303. }
  304. .tuan-product-l{
  305. width: 150rpx;
  306. height: 200rpx;
  307. border-radius: 16rpx;
  308. background: #F2F2F2;
  309. }
  310. .tuan-product-r{
  311. width: calc(100% - 150rpx);
  312. }
  313. .btn-vip-adviser{
  314. width: 150rpx;
  315. height: 60rpx;
  316. border-radius: 20rpx;
  317. display: flex;
  318. justify-content: center;
  319. align-items: center;
  320. font-size: 28rpx;
  321. /* font-weight: 600; */
  322. background: #FF6600;
  323. color:#FFFFFF;
  324. }
  325. .search-result {
  326. padding-top: 10px;
  327. padding-bottom: 20px;
  328. text-align: center;
  329. }
  330. .search-result-text {
  331. text-align: center;
  332. font-size: 14px;
  333. color:#666;
  334. }
  335. .example-body {
  336. /* #ifndef APP-NVUE */
  337. display: block;
  338. /* #endif */
  339. padding: 0px;
  340. }
  341. .uni-mt-10 {
  342. margin-top: 10px;
  343. }
  344. </style>