Commit c2b175b47e9b6a9ed9b8d2ffa828828f093e5762
1 parent
d5ff7056
样式调整
Showing
3 changed files
with
29 additions
and
11 deletions
project-wl-kuaidiyuan-uniapp-vue3/src/composable/jpush.js
| ... | ... | @@ -2,19 +2,15 @@ import { updateJpush } from '@/api/jpush' |
| 2 | 2 | import { platform } from '@/config/index' |
| 3 | 3 | import { ref, reactive, onMounted } from 'vue'; |
| 4 | 4 | export function useJPush() { |
| 5 | + //饮用JPush | |
| 5 | 6 | const JPushModule = uni.requireNativePlugin('JG-JPush') |
| 6 | 7 | console.log('jpushModule', JPushModule) |
| 7 | 8 | const isRegistrationPushed = ref(false) |
| 8 | 9 | const registerID = ref(null) |
| 9 | - const startUploadJpush = () => { | |
| 10 | - if (registerID.value) { | |
| 11 | - console.log(`推送注册成功222222${registerID.value}`) | |
| 12 | - isRegistrationPushed.value = true | |
| 13 | - | |
| 14 | - console.log(222222, registerID.value) | |
| 15 | - // JPushModule.initJPushService() | |
| 16 | - // 监听通知点击事件 - 这是关键 | |
| 17 | - JPushModule.addNotificationListener(result => { | |
| 10 | + | |
| 11 | + const eventRegister = () => { | |
| 12 | + if(JPushModule) { | |
| 13 | + JPushModule.addNotificationListener(result => { | |
| 18 | 14 | console.log('通知事件回调:', result) |
| 19 | 15 | |
| 20 | 16 | // 判断事件类型 |
| ... | ... | @@ -44,7 +40,19 @@ export function useJPush() { |
| 44 | 40 | JPushModule.addLocalNotificationListener(result => { |
| 45 | 41 | console.log('本地通知被点击:', result) |
| 46 | 42 | }) |
| 43 | + } | |
| 44 | + } | |
| 45 | + | |
| 46 | + | |
| 47 | + const startUploadJpush = () => { | |
| 48 | + if (registerID.value) { | |
| 49 | + console.log(`推送注册成功222222${registerID.value}`) | |
| 50 | + isRegistrationPushed.value = true | |
| 47 | 51 | |
| 52 | + // JPushModule.initJPushService() | |
| 53 | + // 监听通知点击事件 - 这是关键 | |
| 54 | + eventRegister() | |
| 55 | + | |
| 48 | 56 | updateJpush({ registrationId: registerID.value, platform: platform() }) |
| 49 | 57 | .then(() => { |
| 50 | 58 | console.warn('推送注册成功') | ... | ... |
project-wl-kuaidiyuan-uniapp-vue3/src/pages/login/index.scss
| ... | ... | @@ -64,6 +64,12 @@ uni-page-head, |
| 64 | 64 | font-size: 32rpx; |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | + ::v-deep .is-input-border.is-focused { | |
| 68 | + border-bottom-color: var(--essential-color-red)!important; | |
| 69 | + .content-clear-icon { | |
| 70 | + color: rgb(192, 196, 204)!important; | |
| 71 | + } | |
| 72 | + } | |
| 67 | 73 | ::v-deep .is-input-error-border { |
| 68 | 74 | border-bottom: 1px solid var(--essential-color-red); |
| 69 | 75 | margin-bottom: 44rpx; | ... | ... |
project-wl-kuaidiyuan-uniapp-vue3/src/pages/login/user.vue
| ... | ... | @@ -13,10 +13,10 @@ |
| 13 | 13 | <!-- 登录表单 --> |
| 14 | 14 | <view class="loginMain"> |
| 15 | 15 | <uni-forms ref="customForm" :rules="customRules" :modelValue="fromInfo"> |
| 16 | - <uni-forms-item name="account"><uni-easyinput class="item" v-model="fromInfo.account" placeholder="请输入账号" /></uni-forms-item> | |
| 16 | + <uni-forms-item name="account"><uni-easyinput class="item" v-model="fromInfo.account" placeholder="请输入账号" /></uni-forms-item> | |
| 17 | 17 | <uni-forms-item name="password" class="pwdBox"> |
| 18 | 18 | <uni-easyinput class="item" type="password" v-model="fromInfo.password" placeholder="请输入密码" /> |
| 19 | - <text class="clearIcon" v-if="fromInfo.password.length > 0" @click="handlePwd"></text> | |
| 19 | + <!-- <text class="clearIcon" v-if="fromInfo.password.length > 0" @click="handlePwd"></text> --> | |
| 20 | 20 | </uni-forms-item> |
| 21 | 21 | </uni-forms> |
| 22 | 22 | <!-- 按钮 --> |
| ... | ... | @@ -52,6 +52,10 @@ import { userLogins } from '@/api/user.js'; |
| 52 | 52 | // 导入接口 |
| 53 | 53 | import { getHomeInfo } from '@/api/index.js'; |
| 54 | 54 | |
| 55 | +const styles = ref({ | |
| 56 | + color: '#2979FF', | |
| 57 | + borderColor: 'red' | |
| 58 | + }) | |
| 55 | 59 | |
| 56 | 60 | // ------定义变量------ |
| 57 | 61 | const store = useStore(); //vuex获取储存数据 | ... | ... |