Commit f3f00306 authored by leon's avatar leon

feat: page add share

parent 17888a7c
...@@ -125,6 +125,9 @@ ...@@ -125,6 +125,9 @@
this.getReportIdList() this.getReportIdList()
} }
this.getReportCharts() this.getReportCharts()
},
onShareAppMessage() {
}, },
onShow() { onShow() {
const that = this const that = this
......
...@@ -116,6 +116,10 @@ ...@@ -116,6 +116,10 @@
this.userAuthCheck() this.userAuthCheck()
}, },
onShareAppMessage() {
},
// detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听 // detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听
onShow() { onShow() {
const that = this const that = this
......
<template> <template>
<view class="wrap"> <view class="wrap">
<view class="content"> <view class="content">
<u-form <u-form ref="uForm" :model="params" :error-type="['toast']" :label-width="200">
ref="uForm"
:model="params"
:error-type="['toast']"
:label-width="200"
>
<u-form-item label="用户名" prop="userName"> <u-form-item label="用户名" prop="userName">
<u-input <u-input v-model="params.userName" placeholder="请输入用户名" type="text" />
v-model="params.userName"
placeholder="请输入用户名"
type="text"
/>
</u-form-item> </u-form-item>
<u-form-item label="密码" prop="password"> <u-form-item label="密码" prop="password">
<u-input <u-input v-model="params.password" placeholder="请输入密码" type="password" :password-icon="true" />
v-model="params.password"
placeholder="请输入密码"
type="password"
:password-icon="true"
/>
</u-form-item> </u-form-item>
<u-form-item label="员工号(选填)" prop="staffNo"> <u-form-item label="员工号(选填)" prop="staffNo">
<u-input <u-input v-model="params.staffNo" placeholder="填写员工号可以更精确的获取权限" type="number" />
v-model="params.staffNo"
placeholder="填写员工号可以更精确的获取权限"
type="number"
/>
</u-form-item> </u-form-item>
</u-form> </u-form>
<u-button <u-button class="my-u-block u-m-t-80" type="warning" shape="square" :ripple="true" @click="submit('login')"
class="my-u-block u-m-t-80" :disabled="!submitDisabled">登入</u-button>
type="warning" <u-button class="my-u-block u-m-t-80" type="warning" shape="square" :ripple="true"
shape="square" @click="submit('register')" :disabled="!submitDisabled">注册</u-button>
:ripple="true"
@click="submit('login')"
:disabled="!submitDisabled"
>登入</u-button>
<u-button
class="my-u-block u-m-t-80"
type="warning"
shape="square"
:ripple="true"
@click="submit('register')"
:disabled="!submitDisabled"
>注册</u-button>
<text class="tips-text">使用须知:仅限企业内部人员使用,使用前需要认证用户</text> <text class="tips-text">使用须知:仅限企业内部人员使用,使用前需要认证用户</text>
</view> </view>
...@@ -53,25 +23,31 @@ ...@@ -53,25 +23,31 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
params: { params: {
appId: wx.getAccountInfoSync().miniProgram.appId, appId: wx.getAccountInfoSync().miniProgram.appId,
userName: '', userName: '',
password: '', password: '',
staffNo:'' staffNo: ''
}, },
rules: { rules: {
userName: [ userName: [{
{ required: true, message: '请输入用户名', trigger: 'blur' } required: true,
], message: '请输入用户名',
password: [ trigger: 'blur'
{ required: true, message: '请输入密码', trigger: 'blur' } }],
], password: [{
staffNumber:[ required: true,
{ required: true, message: '员工号(选填)', trigger: 'blur' } message: '请输入密码',
] trigger: 'blur'
}],
staffNumber: [{
required: true,
message: '员工号(选填)',
trigger: 'blur'
}]
} }
} }
}, },
...@@ -96,7 +72,10 @@ export default { ...@@ -96,7 +72,10 @@ export default {
} }
} }
let res = await info.url let res = await info.url
const { Status, Result } = res.data const {
Status,
Result
} = res.data
if (Status === 'true') { if (Status === 'true') {
this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`) this.$u.vuex('vuex_token', `${res.token_type} ${res.access_token}`)
this.$u.toast(info.msg) this.$u.toast(info.msg)
...@@ -143,8 +122,12 @@ export default { ...@@ -143,8 +122,12 @@ export default {
}, },
onReady() { onReady() {
this.$refs.uForm.setRules(this.rules) this.$refs.uForm.setRules(this.rules)
},
onShareAppMessage() {
} }
};
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
onLoad() { onLoad() {
this.getReportList() this.getReportList()
}, },
onShareAppMessage() {
},
methods: { methods: {
/** /**
* 获取页面报表配置 * 获取页面报表配置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment