Browse Source

修改提示

wangxy 6 tháng trước cách đây
mục cha
commit
c82baa3952
3 tập tin đã thay đổi với 13 bổ sung12 xóa
  1. 10 5
      components/catalogue/catalogue.vue
  2. 2 6
      pages/my/index.vue
  3. 1 1
      utils/constant.js

+ 10 - 5
components/catalogue/catalogue.vue

@@ -27,6 +27,7 @@
 				</uni-collapse-item>
 			</uni-collapse>
 			<tip-small-dialog ref="confirmDialogRef" @confirm-btn="handleConfirmPay" :content="Message"></tip-small-dialog>
+			<tip-middle-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :content="MESSAGE_VISITER_TO_LOGIN"></tip-middle-dialog>
 		</view>
 	</uni-popup>
 </template>
@@ -44,7 +45,7 @@
 	import {getUserIdentity} from "@/utils/common.js"
 	import {MESSAGE_VISITER_TO_LOGIN,MESSAGE_BEFORE_PAY} from "@/utils/constant.js"
     import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
-	
+	import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
 
 	const $emit = defineEmits(['change-zhang'])
 
@@ -56,6 +57,13 @@
 	const activeCollapse = ref('');
 	const Message = MESSAGE_BEFORE_PAY;
 	const AuthCode = getUserIdentity(); // 用户身份
+	const youkeDialogRef = ref(null);
+
+	function ykConfirm() {
+		uni.redirectTo({
+			url: '/pages/login/index'
+		});
+	}
 
 	/**
 	 * @summary 展示弹窗 暴露函数
@@ -97,10 +105,7 @@
 	function handleSelectZhang(data,index) {
 		if(index !=0 && AuthCode == 'Visitor'){
 			// 游客
-			toast(MESSAGE_VISITER_TO_LOGIN)
-			uni.redirectTo({
-				url: '/pages/login/index'
-			})
+			youkeDialogRef.value.handleShow();
 			return;
 		}
 

+ 2 - 6
pages/my/index.vue

@@ -41,7 +41,7 @@
 		</view>
 		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
 		<tip-small-dialog ref="exitDialogRef" @confirm-btn="exitBtn" :content="tipContent"></tip-small-dialog>
-		<tip-middle-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :content="YouKeContent"></tip-middle-dialog>
+		<tip-middle-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :content="MESSAGE_VISITER_TO_LOGIN"></tip-middle-dialog>
 		<tel-dialog @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
 	</view>
 </template>
@@ -63,7 +63,6 @@
 	const nianji = ref(null);
 	const cardId = ref(null);
 	const tipContent = '你确定要执行这个操作吗?'; 
-	const YouKeContent = '您当前是游客身份,登录后才能浏览内容,现在去登录?';
 	let hyqyData = reactive({
 			indicatorDots: true,
 			autoplay: true,
@@ -271,10 +270,7 @@
 	if(loginFlag.value){
 		const AuthCode = getUserIdentity();
 		if (AuthCode == 'Visitor') {
-			toast(MESSAGE_VISITER_TO_LOGIN);
-			uni.navigateTo({
-				url: '/pages/login/index'
-			});
+			youkeDialogRef.value.handleShow();
 			return;
 		}  
 		uni.redirectTo({

+ 1 - 1
utils/constant.js

@@ -41,4 +41,4 @@ export const xueke_list = [
 ]
 
 export const MESSAGE_BEFORE_PAY = `当前为非会员模式请先购买!`;
-export const MESSAGE_VISITER_TO_LOGIN = `当前为游客模式请登录!`;
+export const MESSAGE_VISITER_TO_LOGIN = `您当前是游客身份,登录后才能浏览内容,现在去登录?`;