Skip to content

Commit

Permalink
app
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopenggithub committed Aug 21, 2022
1 parent 5fc7cc4 commit ef477b4
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 70 deletions.
58 changes: 57 additions & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,62 @@
"h5": {
"router": {
"base": ""
}
}
/*
"devServer": {
"port": 8084,
"disableHostCheck": true,
"proxy": {
"/api/": {
"target": "http://127.0.0.1:8888", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
},
"/api/book": {
"target": "http://127.0.0.1:8892", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
},
"/api/reader": {
"target": "http://127.0.0.1:8892", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
},
"/api/verifyCode": {
"target": "http://127.0.0.1:8892", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
},
"/api/activity": {
"target": "http://127.0.0.1:8892", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
},
"/api/activityOrders": {
"target": "http://127.0.0.1:8892", //请求的目标域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/api": "/"
}
}
}
},
*/
}
}
13 changes: 12 additions & 1 deletion app/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"style": {
"navigationBarTitleText": "借阅详情"
}
},
{
"path": "pages/activities/activity",
"style": {
"navigationBarTitleText": "活动"
}
}
],
"tabBar": {
Expand All @@ -56,7 +62,12 @@
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/bookstore/list",
"text": "首页",
"text": "图书",
"iconPath": "static/img/home.png",
"selectedIconPath": "static/img/homeHL.png"
},{
"pagePath": "pages/activities/activity",
"text": "活动",
"iconPath": "static/img/home.png",
"selectedIconPath": "static/img/homeHL.png"
}, {
Expand Down
22 changes: 22 additions & 0 deletions app/pages/activities/activity.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<view>
welcome to activity
</view>
</template>

<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>

<style>
</style>
116 changes: 58 additions & 58 deletions app/pages/login/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
mapMutations
} from 'vuex'
import mInput from '../../components/m-input.vue'
import {
univerifyLogin,
univerifyErrorHandler
} from '@/common/univerify.js'
// import {
// univerifyLogin,
// univerifyErrorHandler
// } from '@/common/univerify.js'
import {
getDeviceUUID
} from '@/common/utils.js'
Expand Down Expand Up @@ -76,61 +76,61 @@
},
methods: {
...mapMutations(['login']),
sendSmsCode() {
if (this.codeDuration) {
uni.showModal({
content: `请在${this.codeDuration}秒后重试`,
showCancel: false
})
}
if (!/^1\d{10}$/.test(this.mobile)) {
uni.showModal({
content: '手机号码填写错误',
showCancel: false
})
return
}
uniCloud.callFunction({
name: 'user-center',
data: {
action: 'sendSmsCode',
params: {
mobile: this.mobile,
type: 'login'
}
},
success: (e) => {
if (e.result.code == 0) {
uni.showModal({
content: '验证码发送成功,请注意查收',
showCancel: false
})
this.codeDuration = 60
this.codeInterVal = setInterval(() => {
this.codeDuration--
if (this.codeDuration === 0) {
if (this.codeInterVal) {
clearInterval(this.codeInterVal)
this.codeInterVal = null
}
}
}, 1000)
} else {
uni.showModal({
content: '验证码发送失败:' + e.result.msg,
showCancel: false
})
}
// sendSmsCode() {
// if (this.codeDuration) {
// uni.showModal({
// content: `请在${this.codeDuration}秒后重试`,
// showCancel: false
// })
// }
// if (!/^1\d{10}$/.test(this.mobile)) {
// uni.showModal({
// content: '手机号码填写错误',
// showCancel: false
// })
// return
// }
// uniCloud.callFunction({
// name: 'user-center',
// data: {
// action: 'sendSmsCode',
// params: {
// mobile: this.mobile,
// type: 'login'
// }
// },
// success: (e) => {
// if (e.result.code == 0) {
// uni.showModal({
// content: '验证码发送成功,请注意查收',
// showCancel: false
// })
// this.codeDuration = 60
// this.codeInterVal = setInterval(() => {
// this.codeDuration--
// if (this.codeDuration === 0) {
// if (this.codeInterVal) {
// clearInterval(this.codeInterVal)
// this.codeInterVal = null
// }
// }
// }, 1000)
// } else {
// uni.showModal({
// content: '验证码发送失败:' + e.result.msg,
// showCancel: false
// })
// }
},
fail(e) {
uni.showModal({
content: '验证码发送失败',
showCancel: false
})
}
})
},
// },
// fail(e) {
// uni.showModal({
// content: '验证码发送失败',
// showCancel: false
// })
// }
// })
// },
async loginByPwd() {
/**
* 客户端对账号信息进行一些必要的校验。
Expand Down
38 changes: 28 additions & 10 deletions app/pages/user/user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
<text class="list-icon">&#xe639;</text>
<text class="list-text">借阅列表</text>
<text class="navigat-arrow">&#xe65e;</text>
</view>
<view class="center-list-item" @click="commingsoon">
<text class="list-icon">&#xe639;</text>
<text class="list-text">图书捐赠记录</text>
<text class="navigat-arrow">&#xe65e;</text>
</view>
<view class="center-list-item" @click="commingsoon">
<text class="list-icon">&#xe639;</text>
<text class="list-text">自习室预订记录</text>
<text class="navigat-arrow">&#xe65e;</text>
</view>
</view>
<view class="btn-row" v-if="token.length>0">
Expand All @@ -32,9 +42,9 @@
mapState,
mapMutations
} from 'vuex'
import {
univerifyLogin
} from '@/common/univerify.js'
// import {
// univerifyLogin
// } from '@/common/univerify.js'
export default {
data() {
Expand All @@ -56,16 +66,24 @@
//this.hasLogin=true;
},
methods: {
...mapMutations(['logout']),
...mapMutations(['logout']),
commingsoon(){
uni.showToast({
title:'Comming Soon!'
})
},
bindLogin() {
if (!this.hasLogin) {
univerifyLogin().catch(err => {
if (err === false) return;
// univerifyLogin().catch(err => {
// if (err === false) return;
uni.navigateTo({
url: '../login/login',
});
})
// uni.navigateTo({
// url: '../login/login',
// });
// })
uni.navigateTo({
url: '../login/login',
});
}
},
bindLogout() {
Expand Down

0 comments on commit ef477b4

Please sign in to comment.