123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <template>
- <view class="page">
- <view class="list_info">
- <block v-for="(item,index) in list" :key="index">
- <view class="item">
- <view class="avator">
- <image class="icon" :src="item.avator" mode="aspectFill">
- </image>
- </view>
- <view class="tit">
- <view class="name">{{item.nickname}}</view>
- <view class="desc">{{item.content}}</view>
- </view>
- <view class="state">
- <view class="status_9">{{item.create_time}}</view>
- </view>
- </view>
- <view class="line">
- </view>
- </block>
- <view class="blankHeight"></view>
- </view>
- </view>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- tab: 1,
- list: [],
- stype: 'like'
- }
- },
- onLoad() {},
- onShow() {
- let that = this;
- // uni.setNavigationBarTitle({
- // titleNView: that.titleNView
- // });
- // this.setStyle(1, '收到的点赞')
- this.loadData();
- },
- onNavigationBarButtonTap(e) {
- if (e.index === 0) {
- // 执行代码块
- // console.log("ee", e.index)
- // if (this.stype == 'comment') {
- // this.stype = 'like';
- // this.setStyle(1, '收到的评论');
- // uni.setNavigationBarTitle({
- // title: "收到的点赞"
- // })
- // } else {
- // this.stype = 'comment';
- // this.setStyle(1, '收到的点赞');
- // uni.setNavigationBarTitle({
- // title: "收到的评论"
- // })
- // }
- // this.loadData()
- }
- },
- methods: {
- setStyle(index, text) {
- try {
- let pages = getCurrentPages();
- let page = pages[pages.length - 1];
- // #ifdef APP-PLUS
- let currentWebview = page.$getAppWebview();
- let titleNView = currentWebview.getStyle().titleNView;
- // 添加文字过长截取为3个字符,请根据自己业务需求更改
- titleNView.buttons[0].text = text;
- currentWebview.setStyle({
- titleNView: titleNView
- });
- // #endif
- // #ifdef H5
- // h5 临时方案
- const btn = document.getElementsByClassName('uni-btn-icon')[index]
- btn.innerText = text;
- // #endif
- } catch (e) {
- }
- },
- onClickButton1() {
- console.log('点击了按钮1')
- },
- onClickButton2() {
- console.log('点击了按钮2')
- },
- onBack() {},
- loadData() {
- uni.request({
- url: this.$apiHost + '/Member/getComments',
- data: {
- uuid: getApp().globalData.uuid,
- stype: this.stype,
- },
- header: {
- 'content-type': 'application/json'
- },
- success: (res) => {
- console.log("res", res.data)
- this.list = res.data.list;
- }
- });
- },
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'hudong.scss';
- </style>
|