优化提交

This commit is contained in:
zhangwentao 2024-11-11 14:31:27 +08:00
parent 9acbefedbe
commit 6e4f5cfce6
6 changed files with 42 additions and 33 deletions

View File

@ -6,7 +6,7 @@
<!-- 详细信息 --> <!-- 详细信息 -->
<info-list :item="info" isDetail @mark="handleMark" @comment="handleComment" @share="handleShare" <info-list :item="info" isDetail @mark="handleMark" @comment="handleComment" @share="handleShare"
@follow="handleFollow"> @follow="handleFollow">
<view class="text-30 my-20 text-gray-600"> <view v-if="info.content" class="text-30 my-20 text-gray-600">
<u-parse :content="info.content"></u-parse> <u-parse :content="info.content"></u-parse>
</view> </view>
</info-list> </info-list>

View File

@ -72,14 +72,14 @@
title: '适应', title: '适应',
type: 3 type: 3
}, { }, {
img: '/static/img/demo/chuangye.png', img: '/static/img/demo/chuangye.png',
imgSelect: '/static/img/demo/chuangye-select.png', imgSelect: '/static/img/demo/chuangye-select.png',
title: '职业', title: '职业',
type: 2 type: 2
}, },
{ {
img: '/static/img/demo/jineng.png', img: '/static/img/demo/jineng.png',
imgSelect: '/static/img/demo/jineng-select.png', imgSelect: '/static/img/demo/jineng-select.png',
title: '创业', title: '创业',
type: 4 type: 4
}, },
@ -106,13 +106,12 @@
}, },
onLoad() { onLoad() {
this.getUserInfo() // this.getUserInfo()
this.getList() this.getList()
this.getBannerList() this.getBannerList()
}, },
onShow() { onShow() {
//
this.getTrainHas()
}, },
methods: { methods: {
async getList() { async getList() {
@ -148,7 +147,7 @@
}) })
}, },
search() { search() {
this.queryParams.page=1 this.queryParams.page = 1
this.assetList = [] this.assetList = []
this.getList() this.getList()
}, },
@ -179,6 +178,7 @@
this.tabIndex = e.detail.current this.tabIndex = e.detail.current
}, },
btntabs(item) { btntabs(item) {
this.getTrainHas()
this.queryParams.type = item.type this.queryParams.type = item.type
this.queryParams.page = 1 this.queryParams.page = 1
this.assetList = [] this.assetList = []
@ -219,6 +219,7 @@
assetInfo({ assetInfo({
id: item.asset_id id: item.asset_id
}).then(Response => { }).then(Response => {
uni.hideLoading()
uni.downloadFile({ uni.downloadFile({
url: Response.data.pdf_url, url: Response.data.pdf_url,
success: function(res) { success: function(res) {

View File

@ -695,6 +695,7 @@
title: '提交成功', title: '提交成功',
icon: 'none' icon: 'none'
}) })
uni.setStorageSync('token', res.data.token);
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/home/home' url: '/pages/home/home'

View File

@ -5,13 +5,13 @@
</zxVideo> </zxVideo>
</u-sticky> </u-sticky>
<view class="detail"> <view class="detail">
<view class="title"> <view v-if="info.asset_name" class="title">
{{info.asset_name}} {{info.asset_name}}
</view> </view>
<view class="desc"> <view v-if="info.digest" class="desc">
{{info.digest}} {{info.digest}}
</view> </view>
<view class="parse"> <view v-if="info.content" class="parse">
<u-parse :content="info.content"></u-parse> <u-parse :content="info.content"></u-parse>
</view> </view>
</view> </view>

View File

@ -69,9 +69,15 @@ function codes() {
title: '提示', title: '提示',
content: '请先用户注册', content: '请先用户注册',
success: function(res) { success: function(res) {
uni.reLaunch({ if (res.confirm) {
url: '/pages/mine/edit-info?type=register' uni.reLaunch({
}); url: '/pages/mine/edit-info?type=register'
});
} else if (res.cancel) {
uni.navigateBack({
delta: 1
})
}
} }
}); });
} }

View File

@ -49,27 +49,28 @@ export const apiResquest = (params) => {
success: (res) => { success: (res) => {
// 如果返回的 code 为 1表示需要重新获取 token // 如果返回的 code 为 1表示需要重新获取 token
if (res.data.code == 1) { if (res.data.code == 1) {
if (!isRefreshing) { // if (!isRefreshing) {
isRefreshing = true; // 设置标志位 // isRefreshing = true; // 设置标志位
wxCode.codes().then(newToken => { wxCode.codes()
isRefreshing = false; // 请求完成,重置标志位 // .then(newToken => {
// 更新所有等待中的请求的 token // isRefreshing = false; // 请求完成,重置标志位
pendingRequests.forEach((req) => { // // 更新所有等待中的请求的 token
req.resolve({ ...res.data, token: newToken }); // pendingRequests.forEach((req) => {
}); // req.resolve({ ...res.data, token: newToken });
pendingRequests = []; // 清空等待中的请求 // });
}).catch((err) => { // pendingRequests = []; // 清空等待中的请求
isRefreshing = false; // 请求失败,重置标志位 // }).catch((err) => {
// 拒绝所有等待中的请求 // isRefreshing = false; // 请求失败,重置标志位
pendingRequests.forEach((req) => { // // 拒绝所有等待中的请求
req.reject(err); // pendingRequests.forEach((req) => {
}); // req.reject(err);
pendingRequests = []; // 清空等待中的请求 // });
}); // pendingRequests = []; // 清空等待中的请求
// });
} }
// 如果正在刷新,加入等待中的请求 // 如果正在刷新,加入等待中的请求
return pendingRequests.push({ resolve, reject }); // return pendingRequests.push({ resolve, reject });
} // }
resolve(res.data); // 正常返回 resolve(res.data); // 正常返回
}, },