Просмотр исходного кода

Merge remote-tracking branch 'origin/2025鹅状元数学' into 2025鹅状元数学

# Conflicts:
#	pages/chanpinShop/components/kaiTongFongShi.vue
tanxue 19 часов назад
Родитель
Сommit
8199cb0ae2

+ 6 - 0
pages.json

@@ -61,6 +61,12 @@
 			"style": {
 				"navigationStyle": "custom"
 			}
+		},	
+		{
+			"path": "pages/bindPhone/bindPhone",
+			"style": {
+				"navigationStyle": "custom"
+			}
 		},
 		{
 			"path": "pages/chanpinXuanze/cp1/banben",

+ 9 - 11
components/bindPhone/bindPhone.vue → pages/bindPhone/bindPhone.vue

@@ -1,6 +1,4 @@
 <template>
-	<uni-popup ref="dlRef" :animation="true" :is-mask-click="false" 
-	mask-background-color="rgba(255, 255, 255, 0.6);">
 		<view class="bind-tel-page">
 			<!-- 返回 -->
 			<view class="icon-title-navBar-box">
@@ -26,17 +24,13 @@
 					<text class="yzm-btn" @click="startCountdown"
 						:class="{ 'cxfs-btn-disabled': loginData.isDisabled}">{{loginData.buttonText}}</text>
 				</view>
-				<!-- 登录按钮 -->
-				<ezyActiveVue v-if="skipBtnFlag" class="ezy-btn-active login-btn yzm-btn" @aclick="skipFun" :class="loginData.yzmStatus">跳过
-				</ezyActiveVue>
 				<ezyActiveVue class="ezy-btn-active login-btn yzm-btn" @aclick="bangdingFun" :class="loginData.yzmStatus">确认绑定
 				</ezyActiveVue>
 			</view>
+			<!-- 图形验证码 -->
+			<captchaVue ref="captcha" :config="config" @captchaSuccess="captchaSuccess" @captchaError="captchaError"
+				@captchaFail="captchaFail" @captchaReady="captchaReady" @captchaClose="captchaClose"></captchaVue>
 		</view>
-	</uni-popup>
-	<!-- 图形验证码 -->
-	<captchaVue ref="captcha" :config="config" @captchaSuccess="captchaSuccess" @captchaError="captchaError"
-		@captchaFail="captchaFail" @captchaReady="captchaReady" @captchaClose="captchaClose"></captchaVue>
 </template>
 
 <script setup>
@@ -86,12 +80,16 @@
 		skipBtnFlag: {
 			type: Boolean,
 			default: true
-		}
+		},
+		openFangshi: {
+			type: String,
+			default: 'bottom'
+		},
 	})
 	const sliderData = reactive({})
 
 	function showDl() {
-		dlRef.value.open('bottom');
+		dlRef.value.open(props.openFangshi);
 	}
 
 	function closeDl() {

+ 0 - 7
pages/chanpinMy/my.vue

@@ -45,7 +45,6 @@
 		</view>
 
 		<goLogin ref="loginRef" @success="handleSuccess"></goLogin>
-		<bindPhone ref="bindPhoneRef" :skipBtnFlag='false' @success="bingPhoneSuccess"></bindPhone>
 		<!-- 底部 -->
 		<custom-tab-bar :show="true" :current-index="currentTabIndex" />
 	</view>
@@ -63,7 +62,6 @@
 	} from '@/api/my.js'
 	import CustomTabBar from '@/components/custom-tabbar/index.vue';
 	import goLogin from "@/components/goLogin/goLogin.vue"
-	import bindPhone from "@/components/bindPhone/bindPhone.vue"
 	import {
 		onLoad,
 		onShow
@@ -81,7 +79,6 @@
 	let currentPlatform = ref(null);
 	let authInfo = ref(null);
 	let loginRef = ref(null);
-	let bindPhoneRef = ref(null);
 	let currentTabIndex = ref(3)
 	let myInfoData = reactive({
 		userImg: '',
@@ -169,10 +166,6 @@
 		})
 	}
 
-	function bangPhone() {
-		bindPhoneRef.value.showDl();
-	}
-
 	function duihuamaDuihuan() {
 		// 兑换码兑换策略
 		if (getUserIsYouke()) {

+ 3 - 7
pages/chanpinMy/order.vue

@@ -34,15 +34,12 @@
 			<!-- <view @click="bangdingPhone">绑定手机号</view> -->
 		</view>
 	</view>
-	<bindPhone ref="bindPhoneRef" @success="onLoginSuccess"></bindPhone>
 </template>
 
 <script setup>
 	import { reactive, ref } from "vue";
 	import {orderList} from '@/api/shop.js'
 	import { onLoad, onShow } from "@dcloudio/uni-app"
-	import bindPhone from "@/components/bindPhone/bindPhone.vue"
-	const bindPhoneRef = ref(null);
     const data = reactive({
         page: 0,
         list: [],
@@ -60,7 +57,7 @@
 			url: '/pages/chanpinMy/my'
 		})
 	}
-	
+
     function onScrolltolower() {
         getMore()
     }
@@ -127,11 +124,10 @@
 		})
 	}
 	
-	function bangdingPhone() {
-		bindPhoneRef.value.showDl();
-	}
+
 	onLoad(() => {
 		getMore();
+		// 判断游客 如果是弹出弹窗,忽略和绑定, 忽略删除缓存,绑定更新用户userName 删除缓存
 	})
 </script>
 

+ 7 - 4
pages/chanpinShop/components/kaiTongFongShi.vue

@@ -4,8 +4,8 @@
 			<view class="close-btn" @click="handleClose"></view>
 			<view class="tip-content-box sjh-kjdl-content-box">
 				<view class="tip-title">开通方式</view>
-				<view class="kjdl-btn" @click="handleKaitong">使用手机号快速登录</view>
-				<view class="ykkt-text" v-if="currentPlatform== 'ios'">游客身份开通(限当前设备使用)</view>
+                <view class="kjdl-btn" @click="handleKaitong">使用手机号快速登录</view>
+                <view class="ykkt-text" @click="youkeKaitongIos"  v-if="currentPlatform== 'ios'">游客身份开通(限当前设备使用)</view>
 			</view>
 		</view>
 	</uni-popup>
@@ -23,7 +23,7 @@
 	const kaitongRef = ref(null); // 索引
 	const LoginRef = ref(null);
 	const currentPlatform = ref(null);
-  const emits = defineEmits(['success']);
+  const emits = defineEmits(['success','ykIoszhifu']);
 
 
 	function isIOSorAndroid() {
@@ -52,6 +52,9 @@
 			kaitongRef.value.close();
 		})
 	}
+	function youkeKaitongIos(){
+		    emits('ykIoszhifu')
+	}
 
   function onLoginSuccess() {
     emits('success')
@@ -63,4 +66,4 @@
 </script>
 
 <style>
-</style>
+</style>

+ 19 - 7
pages/chanpinShop/cp1/dingdan.vue

@@ -51,7 +51,7 @@
 		</view>
 	</view>
 
-	<kaiTongFongShiVue ref="kaiRef" @success="handlePay"></kaiTongFongShiVue>
+	<kaiTongFongShiVue ref="kaiRef" @ykIoszhifu="ykIoszhifu" @success="handlePay"></kaiTongFongShiVue>
 </template>
 
 <script setup>
@@ -140,10 +140,10 @@
 		checkError: () => {}, // 校验失败
 		payError: () => {}, // 支付失败
 		paySuccess: () => {
-      uni.navigateTo({
-        url: "/pages/chanpinMy/order"
-      })
-    }, //支付成功
+			uni.navigateTo({
+				url: "/pages/chanpinMy/order"
+			})
+		}, //支付成功
 		applePayError: () => {}, // 苹果内购失败
 	});
 
@@ -155,10 +155,22 @@
 			current.value = -1;
 		}
 	})
+	function ykIoszhifu(){
+		console.log('12311');
+		const options = {
+			chanpinId: data.chanpinId,
+			taocanId: activeTaocan.value.taocanId
+		};
+		options.applePid = activeTaocan.value.applePid;
+		console.log('options',options);
+		console.log('activeTaocan.value.applePid',activeTaocan.value.applePid);
+		OrderPay('apple', options)
+	}
+
 
 	function radioChange(d) {
-    current.value = d.detail.value;
-  }
+		current.value = d.detail.value;
+	}
 
 	function handleSelectTaoCan(item) {
 		activeTaocan.value = item;

+ 12 - 5
pages/chanpinShop/usePay.js

@@ -375,6 +375,7 @@ export function usePay(opt = {}) {
 					ids,
 					function(e) {
 						// 获取订单信息成功回调方法
+						console.log('001',options);
 						uni.requestPayment({
 							provider: "appleiap",
 							orderInfo: {
@@ -384,7 +385,7 @@ export function usePay(opt = {}) {
 							},
 							success: (e) => {
 								// 苹果内购成功
-
+								console.log('002',e);
 								const {
 									transactionIdentifier: paynum,
 									transactionReceipt: receipt,
@@ -393,23 +394,28 @@ export function usePay(opt = {}) {
 									paynum,
 									receipt,
 								});
-
+								console.log('options.taocanId',options.taocanId);
 								orderPayApple({
 										chanpinId: appleData.chanpinId, // 产品ID
 										paynum: paynum, // 支付号
 										receipt: receipt, // 票据
-										taocanId: chanpinId.taocanId, // 套餐ID
+										taocanId: options.taocanId, // 套餐ID
 									})
 									.then((res) => {
+										console.log('res',res.data);
+								
 										uni.hideLoading();
 										if (res.code == 0 && res.data) {
 											//  完成内购
-											iapChannel.finishTransaction(data
+												console.log('123123123123');
+											iapChannel.finishTransaction(e
 												.transactionIdentifier);
 											// 购买成功
+											console.log('1231231',res);
 											paySuccessResult();
 										} else {
-											iapChannel.finishTransaction(data
+											console.log('shibai');
+											iapChannel.finishTransaction(e
 												.transactionIdentifier);
 											toast("业务异常,订单支付失败,请联系管理员");
 											applePayError &&
@@ -475,6 +481,7 @@ export function usePay(opt = {}) {
 
 	// 支付成功
 	function paySuccessResult() {
+		console.log('3423423423423');
 		uni.hideLoading()
 		toast('支付成功')
 		paySuccess && paySuccess();

+ 10 - 1
pages/chanpinXuanze/index.vue

@@ -68,7 +68,7 @@
 		yingyuList: [],
 		yuwenList: [],
 	})
-	const {isNowDate} = useSelectDateForUpdate('xuankeDate')
+	const {isNowDate,resetDate} = useSelectDateForUpdate('xuankeDate')
 
 	function getFormatData(data) {
 		const shuxue = data.shuxue || {};
@@ -103,6 +103,15 @@
 			data.shuxueList = result.shuxue;
 			data.yingyuList = result.yingyu;
 			data.yuwenList = result.yuwen;
+			
+			if (!data.shuxueList.length && !data.yingyuList.length && !data.yuwenList.length) {
+				// 并无学习数据时,清理时间缓存
+				resetDate()
+			}
+			
+		}).catch(err => {
+			// 请求异常时,清理时间缓存
+			resetDate()
 		})
 	}
 

+ 7 - 5
pages/login/index.vue

@@ -23,7 +23,7 @@
 			<ezyActiveVue class="ezy-btn-active login-btn" @aclick="getYzmBtn" :class="indexData.telStatus">发送验证码
 			</ezyActiveVue>
 			<view class="bottom-btn-box">
-				<view class="bottom-tip">选择游客登录</view>
+				<view class="bottom-tip">其他登录方式</view>
 				<view class="btn-box">
 					<!-- 		<view v-if="wxFlag" class="wx-btn" @click="wxLoginClick">
 						<icon></icon>
@@ -168,10 +168,12 @@
 		}
 	}
 
-	const ykConfirmBtn = () => {
-		uni.redirectTo({
-			url: `/pages/selectGradesTerms/index`
-		})
+	const ykConfirmBtn = () => {
+		indexData.isAgreed = true;
+		ykBtn()
+		// uni.redirectTo({
+		// 	url: `/pages/selectGradesTerms/index`
+		// })
 	}
 
 	const wxConfirmBtn = () => {

+ 7 - 1
utils/common.js

@@ -7,6 +7,7 @@ import cacheManager from "./cacheManager.js"
 export function toast(content) {
   uni.showToast({
     icon: 'none',
+	duration:3000,
     title: content
   })
 }
@@ -193,7 +194,12 @@ export function useSelectDateForUpdate(code) {
 		return nowDate == getFullTimer();
 	}
 	
+	function resetDate() {
+		cacheManager.remove(code)
+	}
+	
 	return {
-		isNowDate
+		isNowDate,
+		resetDate
 	}
 }