Browse Source

修改提示信息

tanxue 1 month ago
parent
commit
31ad780130
1 changed files with 6 additions and 5 deletions
  1. 6 5
      pages/chanpinZiliao/shuxue/jstxInfo.vue

+ 6 - 5
pages/chanpinZiliao/shuxue/jstxInfo.vue

@@ -58,7 +58,7 @@ function handleBack() {
 		url: '/pages/chanpinZiliao/index'
 	})
 }
-			
+
 // jisuantexun Info data
 function getJisuanInfo() {
   jisuanInfo({ziliaoId:data.id}).then(res => {
@@ -89,7 +89,7 @@ function cardBtn(bbItem) {
 	jstxDownRef.value.handleShow();
 }
 
-// 弹窗确认	
+// 弹窗确认
 function jstxDialogConfirm() {
 	uni.showLoading({ title: '正在生成试题...' });
 	jisuanPdf({
@@ -98,9 +98,10 @@ function jstxDialogConfirm() {
 		const url = res1.data;
 		if (!url) {
 			uni.showToast({ title: '未获取到文件地址', icon: 'none' });
+			uni.hideLoading();
 			return;
 		}
-		
+
 		uni.downloadFile({
 		  url,
 		  success: function (res) {
@@ -121,11 +122,11 @@ function jstxDialogConfirm() {
 		  }
 		});
 	}).catch(err => {
-		uni.showToast({ title: '生成失败,请稍后重试', icon: 'none' });
+		uni.showToast({ title: err.data.msg || '生成失败,请稍后重试', icon: 'none' });
 		uni.hideLoading();
 	});
 }
-	
+
 onLoad((options) => {
 	data.id = options.ziliaoId;
 	getJisuanInfo()