Explorar o código

fix:登录页面优化

jiayubo hai 1 día
pai
achega
a7fee38de1
Modificáronse 1 ficheiros con 17 adicións e 1 borrados
  1. 17 1
      pages/login.vue

+ 17 - 1
pages/login.vue

@@ -35,9 +35,15 @@
           name="agree"
           usedAlone
           v-model="checkboxValue"
+          @change="onCheckboxChange"
           class="text-grey1"
         >
         </up-checkbox>
+        
+        <!-- 备用方案:使用原生checkbox -->
+        <!-- <checkbox :checked="checkboxValue.value" @change="onNativeChange" style="transform:scale(0.7)" />
+        <text class="text-grey1">我已认真阅读、理解并同意</text> -->
+        
         <text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
         <text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
       </view>
@@ -114,7 +120,7 @@ const handleUserAgrement = () => {
 
 // 登录方法
 const handleLogin = async () => {
-  console.log('checkboxValue', checkboxValue)
+  console.log('checkboxValue', checkboxValue.value)
 
   if (!checkboxValue.value) {
     uni.showToast({
@@ -223,6 +229,16 @@ onMounted(() => {
 
   getSystemInfo()
 })
+
+const onCheckboxChange = (value) => {
+  console.log('复选框状态改变:', value)
+  checkboxValue.value = value
+}
+
+const onNativeChange = (e) => {
+  console.log('原生复选框状态改变:', e.detail.value)
+  checkboxValue.value = e.detail.value
+}
 </script>
 
 <style lang="scss" scoped>