修复V2.7版本以上 点击最新栏目后点击其他栏目再次点击最新栏目无法加载最新栏目视频的bug。修复V2.7版本以上 关注用户后无法加载关注用户的视频的bug。
本次修改文件比较多
pages/index/user/other.vue
| @@ -12,11 +12,11 @@ | 12 | 12 | <view class="user-info-wrapper card"> | 13 | 13 | <view class="user-info-head"> | 14 | 14 | <view class="head-img-wrapper"> | 15 | | <image @click="previmg([user.head_img],0)" class="head-img" mode="aspectFill" :src="user!=null?formatUrl(user.head_img):'/static/logo.png'"></image> | | 15 | <image class="head-img" :src="user.head_img ? formatUrl(user.head_img) : '/static/logo.png'"></image> | 16 | 16 | </view> | 17 | 17 | <view class="user-info-content-wrapper" @tap="tapUser"> | 18 | 18 | <text class="user-name">{{user!=null?user.name:''}}</text> | 19 | | <text class="user-id" v-if="user!=null">ID: {{user.custom_id==null?'未设置':user.custom_id}}</text> | | 19 | <text class="user-id">ID: {{user.id ? user.id : '未设置'}}</text> | 20 | 20 | <button v-if="thisuser.id != user.id" size="mini" class="user-follow" :class="{'cache':user.follow}" @tap="tapFollow">{{user.follow?'取消关注':'关注'}}</button> | 21 | 21 | </view> | 22 | 22 | </view> |
| @@ -71,7 +71,8 @@ | 71 | 71 | isMore: true | 72 | 72 | }, | 73 | 73 | user: { | 74 | | id: null | | 74 | id: null, | | 75 | head_img: null | 75 | 76 | }, | 76 | 77 | uid: 0 | 77 | 78 | } |
| @@ -87,61 +88,12 @@ | 87 | 88 | } | 88 | 89 | }, | 89 | 90 | methods: { | 90 | | formatUrl(url, scale) { | 91 | | if (!scale) { | 92 | | scale = 1; | | 91 | formatUrl(url) { | | 92 | if (url.indexOf('http') != 0) { | | 93 | return this.$store.state.baseUrl + url; | | 94 | } else { | | 95 | return url; | 93 | 96 | } | 94 | | if (url == undefined) { | 95 | | return ""; | 96 | | } | 97 | | var index = url.indexOf("http"); | 98 | | if (index == 0) { | 99 | | return url; | 100 | | } | 101 | | return this.$store.state.baseUrl + "/thumb/" + scale + "?url=" + url; | 102 | | }, | 103 | | previmg(urls, index) { | 104 | | urls = urls.map((item, key) => { | 105 | | return this.formatUrl(item) | 106 | | }) | 107 | | uni.previewImage({ | 108 | | current: index, | 109 | | indicator: "default", | 110 | | urls: urls, | 111 | | longPressActions: { | 112 | | itemList: ['保存图片'], | 113 | | success: function(data) { | 114 | | switch (data.tapIndex) { | 115 | | case 0: | 116 | | uni.downloadFile({ | 117 | | url: urls[data.index], | 118 | | success: (res) => { | 119 | | if (res.statusCode === 200) { | 120 | | uni.saveImageToPhotosAlbum({ | 121 | | filePath: res.tempFilePath, | 122 | | success: function() { | 123 | | uni.showToast({ | 124 | | title: "保存成功" | 125 | | }); | 126 | | }, | 127 | | fail: function() { | 128 | | uni.showToast({ | 129 | | title: "保存失败,请稍后重试", | 130 | | icon: "none" | 131 | | }); | 132 | | } | 133 | | }); | 134 | | } | 135 | | } | 136 | | }) | 137 | | break; | 138 | | } | 139 | | }, | 140 | | fail: function(err) { | 141 | | console.log(err.errMsg); | 142 | | } | 143 | | } | 144 | | }); | 145 | 97 | }, | 146 | 98 | tabSetting() { | 147 | 99 | uni.navigateTo({ |
| @@ -156,19 +108,11 @@ | 156 | 108 | loadUser() { | 157 | 109 | this.$api.userOtherInfo({ | 158 | 110 | uid: this.uid | 159 | | }).then((res) => { | 160 | | console.log(res) | 161 | | if (res.data.code == 1) { | 162 | | uni.showToast({ | 163 | | title: '获取用户信息失败', | 164 | | icon: 'none', | 165 | | duration: 500, | 166 | | success() { | 167 | | this.back(); | 168 | | } | 169 | | }); | 170 | | } | 171 | | this.user = res.data.data; | | 111 | }).then(({ data }) => { | | 112 | if (data.code == 0) { | | 113 | this.user = data.data; | | 114 | } | | 115 | console.log(this.user) | 172 | 116 | }); | 173 | 117 | }, | 174 | 118 | tapFollow() { |
|