Skip to content

Commit

Permalink
refactor: add lint-windows and relint
Browse files Browse the repository at this point in the history
  • Loading branch information
Topology2333 committed Mar 7, 2024
1 parent c2e06ca commit f637d12
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 36 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"lint": "eslint --ext .js,.vue src --max-warnings 0",
"lint-windows": "eslint --ext .js,.vue src --max-warnings 0 --fix",
"build-dev:h5": "uni build -m development"
},
"dependencies": {
Expand Down
118 changes: 82 additions & 36 deletions src/pages/users/me.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
<template>
<view>
<scroll-view class="scrollPage" scroll-y>
<scroll-view
class="scrollPage"
scroll-y
>
<image
class="bg-image"
mode="aspectFill"
src="https://cos.edialect.top/miniprogram/user.png"
/>
<view class="bg-info">
<view class="avatar" @tap="toUserInfoPage">
<image :src="avatar" class="cu-avatar round" mode="aspectFill" />
<view
class="avatar"
@tap="toUserInfoPage"
>
<image
:src="avatar"
class="cu-avatar round"
mode="aspectFill"
/>
</view>
<view class="text">
{{ nickname }}
Expand Down Expand Up @@ -52,13 +62,23 @@
<view
class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius"
>
<view class="cu-item arrow" @tap="toMailsPage">
<view
class="cu-item arrow"
@tap="toMailsPage"
>
<view class="content">
<text class="cuIcon-mail text-grey" />
<text class="text-grey"> 我的邮箱 </text>
<view class="notification-circle" v-if="unreadMailsCount > 0">{{
unreadMailsCount
}}</view>
<text class="text-grey">
我的邮箱
</text>
<view
v-if="unreadMailsCount > 0"
class="notification-circle"
>
{{
unreadMailsCount
}}
</view>
</view>
</view>
<view class="cu-item arrow">
Expand All @@ -68,7 +88,9 @@
url="/pages/users/me/likedarticles"
>
<text class="cuIcon-appreciate text-grey" />
<text class="text-grey"> 点赞文章 </text>
<text class="text-grey">
点赞文章
</text>
</navigator>
</view>
<view class="cu-item arrow">
Expand All @@ -78,7 +100,9 @@
url="/pages/users/me/articles"
>
<text class="cuIcon-edit text-grey" />
<text class="text-grey"> 我的文章 </text>
<text class="text-grey">
我的文章
</text>
</navigator>
</view>
<view class="cu-item arrow">
Expand All @@ -88,7 +112,9 @@
url="/pages/products/history"
>
<text class="cuIcon-shop text-grey" />
<text class="text-grey"> 我的积分 </text>
<text class="text-grey">
我的积分
</text>
</navigator>
</view>
<!-- <view class="cu-item arrow">-->
Expand Down Expand Up @@ -119,28 +145,48 @@
<view
class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius"
>
<view class="cu-item arrow" @tap="toChangePasswordPage()">
<view
class="cu-item arrow"
@tap="toChangePasswordPage()"
>
<view class="content">
<text class="cuIcon-write text-grey" />
<text class="text-grey"> 修改密码 </text>
<text class="text-grey">
修改密码
</text>
</view>
</view>
<view class="cu-item arrow" @tap="bindingWechat()">
<view
class="cu-item arrow"
@tap="bindingWechat()"
>
<view class="content">
<text class="cuIcon-group text-grey" />
<text class="text-grey"> 绑定微信 </text>
<text class="text-grey">
绑定微信
</text>
</view>
</view>
<view class="cu-item arrow" @tap="toTuxiaochaoPage()">
<view
class="cu-item arrow"
@tap="toTuxiaochaoPage()"
>
<view class="content">
<text class="cuIcon-question text-grey" />
<text class="text-grey"> 问题反馈 </text>
<text class="text-grey">
问题反馈
</text>
</view>
</view>
<view class="cu-item arrow" @tap="exit()">
<view
class="cu-item arrow"
@tap="exit()"
>
<view class="content">
<text class="cuIcon-exit text-grey" />
<text class="text-grey"> 退出登录 </text>
<text class="text-grey">
退出登录
</text>
</view>
</view>
</view>
Expand All @@ -150,28 +196,28 @@
</template>

<script>
import { toIndexPage, toTuxiaochaoPage } from "@/routers";
import { toIndexPage, toTuxiaochaoPage } from '@/routers';
import {
bindingWechat,
cancelBindingWechat,
clearUserInfo,
getUserInfo,
} from "@/services/user";
} from '@/services/user';
import {
toChangePasswordPage,
toPronunciationsPage,
toUserInfoPage,
toUserWordsPage,
} from "@/routers/user";
import { toMailsPage } from "@/routers/mail";
} from '@/routers/user';
import { toMailsPage } from '@/routers/mail';
const app = getApp();
export default {
data() {
return {
id: "",
avatar: "",
nickname: "",
id: '',
avatar: '',
nickname: '',
recordsCount: 0,
wordsCount: 0,
visitTotal: 0,
Expand Down Expand Up @@ -208,14 +254,14 @@ export default {
*/
exit() {
uni.showModal({
content: "是否退出当前登录?",
content: '是否退出当前登录?',
success: async (res) => {
if (res.confirm) {
clearUserInfo();
await toIndexPage(uni.getSystemInfoSync().uniPlatform === "web");
await toIndexPage(uni.getSystemInfoSync().uniPlatform === 'web');
uni.showToast({
title: "登出成功!",
title: '登出成功!',
});
}
},
Expand All @@ -231,7 +277,7 @@ export default {
if (!userInfo.user.wechat) {
// #ifndef MP-WEIXIN
uni.showToast({
title: "请在微信小程序中绑定微信",
title: '请在微信小程序中绑定微信',
});
// #endif
// #ifdef MP-WEIXIN
Expand All @@ -241,23 +287,23 @@ export default {
}
// 已经绑定微信
uni.showModal({
content: "当前用户已经绑定微信!",
cancelText: "返回",
confirmText: "继续操作",
content: '当前用户已经绑定微信!',
cancelText: '返回',
confirmText: '继续操作',
success(continueOperating) {
// 继续操作
if (continueOperating.confirm) {
// 取消绑定
uni.showModal({
content: "是否解除绑定?",
content: '是否解除绑定?',
success: async (cancelBinding) => {
if (cancelBinding.confirm) {
await cancelBindingWechat(app.globalData.id);
// 绑定到此微信
if (uni.getSystemInfoSync().uniPlatform === "mp-weixin") {
if (uni.getSystemInfoSync().uniPlatform === 'mp-weixin') {
uni.showModal({
content: "是否绑定至此微信?",
content: '是否绑定至此微信?',
success: async (binding) => {
if (binding.confirm) {
await bindingWechat(app.globalData.id);
Expand Down

0 comments on commit f637d12

Please sign in to comment.