Browse Source

课程分享、401状态优化

学习?学个屁 1 month ago
parent
commit
e8ac86f763

+ 6 - 0
src/pages.json

@@ -336,6 +336,12 @@
 				"navigationBarTitleText": "支付失败",
 				"navigationStyle": "custom"
 			}
+		},
+				{
+			"path": "pages/mine/InvoiceGuide/index",
+			"style": {
+				"navigationBarTitleText": "发票开具"
+			}
 		}
 	],
 	"tabBar": {

+ 7 - 6
src/pages/index/attestation/index.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view style="height: 190rpx;"></view>
 		<view class="a-title">
-			<view class="title">学员实名认证</view>
+			<view class="title">实名认证</view>
 			<view class="text">用于身份实名核验,反洗钱,资料将严格保密</view>
 		</view>
 		<!-- <view class="a-idcard-box">
@@ -24,23 +24,23 @@
 		<view class="a-form">
 			<view class="form-item">
 				<view class="">真实姓名</view>
-				<input type="text" v-model="formData.fullName" placeholder="请输入学员姓名" />
+				<input type="text" v-model="formData.fullName" placeholder="请输入姓名" />
 			</view>
 			<view class="form-item">
 				<view class="">身份证号</view>
-				<input type="idcard" v-model="formData.identityCard" placeholder="请输入学员身份证号" @blur="getIdCardInfo" />
+				<input type="idcard" v-model="formData.identityCard" placeholder="请输入身份证号" @blur="getIdCardInfo" />
 			</view>
 			<view class="form-item">
 				<view class="">手机号码</view>
-				<input type="number" v-model="formData.phone" placeholder="请输入监护人手机号" />
+				<input type="number" v-model="formData.phone" placeholder="请输入本人或监护人手机号" />
 			</view>
-			<view class="form-tips">请填写监护人手机号</view>
+			<view class="form-tips">请填写本人或监护人手机号</view>
 			<view class="form-item-upload">
 				<view class="">近期照片</view>
 				<sunui-upimg :url="upPicUrl" :header="{ 'x-access-token': cache.get('TOKEN') }" ref="upload1"
 					title="店铺logo" @change="handleChange" :upload_count="1" @remove="removeImages"></sunui-upimg>
 			</view>
-			<view class="form-tips-upload">请上传学员近期高清、无遮挡照片</view>
+			<view class="form-tips-upload">请上传近期高清、无遮挡照片</view>
 		</view>
 		<view class="u-select-btn">
 			<button hover-class="hover-btn" @click="submit">下一步</button>
@@ -240,6 +240,7 @@ const getFaceRecognition = () => {
 
 			&>input {
 				font-weight: normal;
+				width: 70%;
 			}
 		}
 

+ 8 - 5
src/pages/index/courseDetail/index.vue

@@ -141,7 +141,7 @@
 				<view class="buy-price">
 					<text>¥{{ courseDetailInfo?.sellingPrice }}</text>
 					<text v-if="courseDetailInfo?.originalPrice">省{{ (courseDetailInfo?.originalPrice -
-							courseDetailInfo?.sellingPrice) }}</text>
+						courseDetailInfo?.sellingPrice) }}</text>
 				</view>
 			</view>
 			<block v-else>
@@ -179,12 +179,15 @@ const instance = getCurrentInstance();
 const cache = useCacheStore()
 const type = ref()
 onLoad((option) => {
-	console.log(option);
+	console.log(option, '课程详情页面load信息');
 	courseId.value = option.id
 	type.value = option.type
 	appraiseFormData.value.siteId = option.id
-	if (option.type == 'sharecourse') {
-		cache.set('COURSE_ID', courseDetailInfo.value.id)
+	if (option.type=='sharecourse') {
+		setTimeout(() => {
+			cache.set('COURSE_ID', courseDetailInfo.value.id || option.id)
+			console.log(cache.get('COURSE_ID'), '---用户通过分享课程码进入');
+		}, 1000)
 	}
 })
 const instructorAvatars = computed(() => {
@@ -330,7 +333,7 @@ const courseDetailInfo = ref()
 const bannerList = ref([])
 const videoList = ref([])
 const get_courseInfo = () => {
-	http.get('/detail/getCourseInfo', { data: { id: courseId.value || '22222', latitude: cache.get('LAT') || '23.129163', longitude: cache.get('LON') || '113.264435' }, loading: true }).then((res) => {
+	http.get('/detail/getCourseInfo', { data: { id: courseId.value, latitude: cache.get('LAT') || '23.129163', longitude: cache.get('LON') || '113.264435' }, loading: true }).then((res) => {
 		if (res.result && res.result.details) {
 			res.result.details = fixImgStyle(res.result.details);
 		}

+ 4 - 19
src/pages/index/index.vue

@@ -193,13 +193,13 @@
 <script setup lang="ts">
 import zsLoading from '@/components/zzx-loading/zzx-loading.vue'
 import { ref, onMounted, computed } from 'vue'
-import { onShow, onLoad, onPageScroll, onPullDownRefresh, onShareAppMessage } from '@dcloudio/uni-app';
+import {onLoad, onPageScroll, onPullDownRefresh, onShareAppMessage } from '@dcloudio/uni-app';
 import zsEmpty from '@/components/zs-empty/index.vue'
 import { TipsUtils, RouterUtils } from '@/utils/util';
 import { http } from '@/utils/http'
 import { useCacheStore } from '@/stores/cache'
+import QQMapWX from '@/libs/qqmap-wx-jssdk.js';
 const cache = useCacheStore()
-import QQMapWX from '@/libs/qqmap-wx-jssdk.js'
 const token = computed(() => cache.token)
 const navBarHeight = ref(0);
 const statusBarHeight = ref(0);
@@ -210,21 +210,6 @@ const instructorList = ref();
 const indexLoading = ref(true);
 const hotInstructorImg1 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/dxVfKxD7aH2397154f377d68fb59a71226c9c2f078a9_1758071827887.png')
 const hotInstructorImg2 = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/uv0VmclIvXiJc1081e0e33e281a8a436d24ec9ca87c3_1758071769194.png')
-const list = ref([{
-	src: "https://cdn.pixabay.com/photo/2020/05/19/13/32/cartoon-5190837_1280.jpg"
-},
-{
-	src: "https://cdn.pixabay.com/photo/2020/05/19/13/35/cartoon-5190860_1280.jpg"
-},
-{
-	src: "https://cdn.pixabay.com/photo/2022/03/31/14/53/camp-7103189_1280.png"
-}
-],)
-// onShow(() => {
-// 	get_indexInfo()
-// 	get_message()
-// 	get_searchList()
-// })
 onLoad(() => {
 	get_location()
 	console.log(token.value, 'token是否刷新')
@@ -409,7 +394,7 @@ const openSellocation = () => {
 const gyCourseList = ref()
 const stCourseList = ref()
 const get_indexInfo = () => {
-	http.get('/home/homeInfo').then((res) => {
+	http.get('/home/homeInfo',{loading:true}).then((res) => {
 		indexLoading.value = false
 		bannerList.value = res.result.bannerList
 		// item.priceType === 0精品,1免费
@@ -913,7 +898,7 @@ const searchInfoBtn = () => {
 		}
 
 		.i-skill {
-			width: 700rpx;
+			width: 680rpx;
 			margin-top: 20rpx;
 			font-size: 24rpx;
 			color: #AAAAAA;

+ 50 - 0
src/pages/mine/InvoiceGuide/index.vue

@@ -0,0 +1,50 @@
+<template>
+    <view class="content">
+        <view class="invoice-title">发票开具步骤</view>
+        <view class="invoice-content">
+            <view class="invoice-step">
+                <view class="step-title">第一步:进入“微信支付”:</view>
+                <image class="step-image" :src="imgOne" mode="widthFix" />
+            </view>
+            <view class="invoice-step">
+                <view class="step-title">第二步:选择需要开具发票的记录:</view>
+                <image class="step-image" :src="imgTwo" mode="widthFix" />
+            </view>
+                        <view class="invoice-step">
+                <view class="step-title">第三步:点击“开发票”:</view>
+                <image class="step-image" :src="imgThree" mode="widthFix" />
+            </view>
+        </view>
+    </view>
+</template>
+<script setup lang="ts">
+import { ref } from 'vue';
+const imgOne = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/PiZLzfcw7Wxyce7e73896af7197cfa9bbc9c47cdb0c9_1762222924576.png');
+const imgTwo = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/U6BYHO7l2e63e5486c0d574265a853395ee42167a283_1762222976362.png');
+const imgThree = ref('https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/6ifgG98JKnCa46eab469500ded77e40e2164dfe51908_1762223015627.png');
+</script>
+<style scoped lang="less">
+.invoice-title {
+    font-size: 30rpx;
+    font-weight: bold;
+    text-align: center;
+}
+
+.invoice-content {
+    margin-top: 20rpx;
+
+    .invoice-step {
+        margin-top: 20rpx;
+
+        .step-title {
+            font-size: 28rpx;
+            font-weight: bold;
+        }
+
+        .step-image {
+            width: 100%;
+            margin-top: 10rpx
+        }
+    }
+}
+</style>

+ 1 - 1
src/pages/mine/index.vue

@@ -35,7 +35,7 @@
 					<zzx-icon name="ashRight" size="10"></zzx-icon>
 					<button class="contact-btn" open-type="contact"></button>
 				</view>
-				<zzx-cell text="发票" url=''></zzx-cell>
+				<zzx-cell text="发票" url='/pages/mine/InvoiceGuide/index'></zzx-cell>
 				<zzx-cell text="意见反馈" url='/pages/mine/feedback/index'></zzx-cell>
 				<zzx-cell text="家庭成员" url="/pages/index/userList/index?name=家庭成员"></zzx-cell>
 				<zzx-cell text="评价" url='/pages/mine/mineComments/index'></zzx-cell>

+ 3 - 0
src/utils/http/index.ts

@@ -25,6 +25,7 @@
  */
 import type { RequestTask } from '@dcloudio/types'
 import type { UniRequestConfig, UniResponse } from '@dcloudio/uni-app'
+import { useCacheStore } from '@/stores/cache'
 // 定义基础响应类型
 export interface HttpResponse<T = any> {
   code: number
@@ -215,6 +216,8 @@ uni.addInterceptor('request', {
     const data = res.data as HttpResponse
     if (data.code === 401) {
       uni.clearStorageSync() // 清除所有本地缓存,页面响应式会自动刷新
+      const cacheStore = useCacheStore()
+      cacheStore.$reset()
       uni.showToast({
         title: data.message || '登录已失效,请重新登录',
         icon: 'none',

+ 5 - 3
src/utils/util/index.ts

@@ -83,9 +83,11 @@ export class RouterUtils {
 		if (pages.length > 1) {
 			uni.navigateBack()
 		} else {
-			uni.switchTab({
-				url: '/pages/index/index'
-			})
+			setTimeout(() => {
+				uni.switchTab({
+					url: '/pages/index/index'
+				})
+			},1100)
 		}
 	}