Commit 044301aa7c62791039b25d826bc96238f5ace9c2

Authored by “wangming”
1 parent bd028579

1

pages/login/index.vue
1 1 <template>
  2 +
2 3 <view class="logo-v">
3   - <view class="login-bg">
4   - <image src="/static/login-bg.png" mode="widthFix"></image>
5   - </view>
6   - <view class="logo-hd u-flex-col" style="">
7   -
8   - <view class="u-flex-col introduce u-m-t-30">
9   - <!-- <text class="u-font-36 text-one" style="">一丰大药房</text> -->
10   - <!-- <text class="u-font-24 text-two">表单采集</text> -->
  4 + <view class="t-login">
  5 + <!-- 页面装饰图片 -->
  6 + <image class="img-a" src="@/static/2.png"></image>
  7 + <image class="img-b" src="@/static/3.png"></image>
  8 + <!-- 标题 -->
  9 + <view class="t-b">
  10 + <image src="../../static/logo.png" mode="widthFix" style="width: 90%;">
  11 + </image>
11 12 </view>
12   - <view class="loginSwitch u-flex-col">
13   - <view class="loginInputBox u-flex-col">
14   - <u-form :model="formData" :rules="rules" ref="dataForm" :errorType="['toast']" label-position="left"
15   - label-width="150" label-align="left">
16   - <u-form-item prop="account">
17   - <u-input v-model="formData.account" placeholder="请输入帐号"></u-input>
18   - </u-form-item>
19   - <u-form-item prop="password">
20   - <u-input v-model="formData.password" type="password" placeholder="请输入密码"></u-input>
21   - </u-form-item>
22   - </u-form>
23   - <view class="loginBtnBox u-m-t-64">
24   - <u-button @click="login" type="primary" :loading="loading">{{ loading ? "登录中...":"登录"}}
25   - </u-button>
  13 + <u-form :model="formData" :rules="rules" ref="dataForm" :errorType="['toast']" label-position="left"
  14 + label-width="150" label-align="left">
  15 +
  16 + <u-form-item prop="account">
  17 + <view class="t-a">
  18 + <image src="@/static/sj.png"></image>
  19 + <input placeholder="请输入帐号" v-model="formData.account" />
  20 + </view>
  21 + </u-form-item>
  22 + <u-form-item prop="password">
  23 + <view class="t-a">
  24 + <image src="@/static/yz.png"></image>
  25 + <input placeholder="请输入密码" type="password" v-model="formData.password" />
26 26 </view>
  27 + </u-form-item>
  28 + </u-form>
  29 + <u-button @click="login" type="primary" :loading="loading">{{ loading ? "登录中...":"登录"}}
  30 + </u-button>
  31 +
  32 + <!-- <view class="t-f"><text>————— 第三方账号登录 —————</text></view>
  33 + <view class="t-e cl">
  34 + <view class="t-g" @tap="wxLogin()">
  35 + <image src="@/static/wx.png"></image>
27 36 </view>
28   - </view>
  37 + <view class="t-g" @tap="zfbLogin()">
  38 + <image src="@/static/qq.png"></image>
  39 + </view>
  40 + </view> -->
29 41 </view>
30   - <!-- <view class="copyright">Copyright © 2023 一丰大药房</view> -->
  42 +
31 43 </view>
32 44 </template>
33 45  
... ... @@ -87,53 +99,51 @@
87 99 // duration:'2000'
88 100 // })
89 101 request({
90   - url:'/api/oauth/Login1',
91   - method:'post',
92   - data:query,
93   - header:{
  102 + url: '/api/oauth/Login1',
  103 + method: 'post',
  104 + data: query,
  105 + header: {
94 106 "Content-Type": "application/x-www-form-urlencoded"
95 107 }
96 108 }).then(res => {
97   - // this.API.userLogin(query).then(res => {
98   - console.log('登录信息',res)
  109 + // this.API.userLogin(query).then(res => {
  110 + console.log('登录信息', res)
99 111 uni.showToast({
100   - title:'denglu',
101   - duration:'2000'
  112 + title: 'denglu',
  113 + duration: '2000'
102 114 })
103   -
104   - if(res.code === 200){
  115 +
  116 + if (res.code === 200) {
105 117 let token = res.data.token
106 118 // let user = res.data.user
107   - console.log('token',token)
  119 + console.log('token', token)
108 120 this.$store.commit('user/SET_TOKEN', token)
109 121 uni.setStorageSync('AuthToken_KEY', token)
110 122 uni.setStorageSync('token', token)
111   - // uni.switchTab({
112   - // url: '/pages/index/apply'
113   - // });
114   - that.API.getUserInfo().then(res=>{
  123 +
  124 + that.API.getUserInfo().then(res => {
115 125 console.log(res)
116   -
  126 +
117 127 let user = res.data
118   - uni.setStorageSync('user',user)
119   - if(uni.getStorageSync('user')){
  128 + uni.setStorageSync('user', user)
  129 + if (uni.getStorageSync('user')) {
120 130 this.loading = false
121 131 uni.showToast({
122   - icon:"success",
123   - title:"登陆成功"
  132 + icon: "success",
  133 + title: "登陆成功"
124 134 })
125 135 uni.switchTab({
126 136 url: '/pages/home/home'
127 137 });
128 138 }
129   -
130   -
  139 +
  140 +
131 141 })
132   -
133   - }else{
  142 +
  143 + } else {
134 144 uni.showToast({
135   - icon:"error",
136   - title:res.msg
  145 + icon: "error",
  146 + title: res.msg
137 147 })
138 148 this.loading = false
139 149 }
... ... @@ -147,108 +157,139 @@
147 157 });
148 158 },
149 159 },
150   -
  160 +
151 161 }
152 162 </script>
153 163  
154 164 <style lang="scss">
155   - page {}
  165 + .logo-v {}
156 166  
157   - .logo-v {
158   - .login-bg {
159   - image {
160   - width: 100%;
161   - height: 100%;
162   - }
163   - }
164   -
165   - .logo-hd {
166   - width: 100%;
167   - position: absolute;
168   - top: 200rpx;
169   -
170   - .logoImg {
171   - width: 160rpx;
172   - height: 160rpx;
173   - margin: 0 auto;
174   -
175   - image {
176   - width: 100%;
177   - height: 100%;
178   - border-radius: 20%;
179   - }
180   - }
  167 + .img-a {
  168 + position: absolute;
  169 + width: 100%;
  170 + top: -280rpx;
  171 + right: -100rpx;
  172 + }
181 173  
182   - .introduce {
183   - justify-content: center;
184   - align-items: center;
  174 + .img-b {
  175 + position: absolute;
  176 + width: 50%;
  177 + bottom: 0;
  178 + left: -50rpx;
  179 + margin-bottom: -200rpx;
  180 + }
185 181  
186   - .text-one {
187   - height: 70rpx;
188   - font-weight: 700;
189   - }
  182 + .t-login {
  183 + width: 600rpx;
  184 + margin: 0 auto;
  185 + font-size: 28rpx;
  186 + color: #000;
  187 + }
190 188  
191   - .text-two {
192   - color: #999999;
193   - }
194   - }
195   - }
196   -
197   - .loginSwitch {
198   - margin-top: 40rpx;
199   - justify-content: center;
200   - align-items: center;
201   -
202   - .tabs {
203   - color: #999999;
204   - position: relative;
205   -
206   - &::after {
207   - content: "";
208   - width: 64rpx;
209   - height: 4rpx;
210   - background-color: #356efe;
211   - margin-top: 15rpx;
212   - position: absolute;
213   - left: 0;
214   - bottom: -15rpx;
215   - display: block;
216   - border-radius: 50rpx;
217   - }
  189 + .t-login button {
  190 + font-size: 28rpx;
  191 + background: #ff0000;
  192 + color: #fff;
  193 + height: 90rpx;
  194 + line-height: 90rpx;
  195 + border-radius: 50rpx;
  196 + box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2);
  197 + }
218 198  
219   - // &.active1 {
220   - // &::after {
221   - // left: 0;
222   - // }
223   - // }
  199 + .t-login input {
  200 + padding: 0 20rpx 0 120rpx;
  201 + height: 90rpx;
  202 + line-height: 90rpx;
  203 + margin-bottom: 50rpx;
  204 + background: #f8f7fc;
  205 + border: 1px solid #e9e9e9;
  206 + font-size: 28rpx;
  207 + border-radius: 50rpx;
  208 + }
224 209  
225   - &.active2 {
226   - &::after {
227   - left: 70%;
228   - }
229   - }
  210 + .t-login .t-a {
  211 + position: relative;
  212 + width: 100%
  213 + }
230 214  
231   - .tab {
232   - width: 50%;
233   - height: 80upx;
234   - text-align: center;
235   - color: #AEAFB5;
236   - font-size: 32upx;
  215 + .t-login .t-a image {
  216 + width: 40rpx;
  217 + height: 40rpx;
  218 + position: absolute;
  219 + left: 40rpx;
  220 + top: 28rpx;
  221 + border-right: 2rpx solid #dedede;
  222 + padding-right: 20rpx;
  223 + }
237 224  
238   - &.active {
239   - color: #3281ff;
240   - }
241   - }
  225 + .t-login .t-b {
  226 + text-align: left;
  227 + font-size: 46rpx;
  228 + color: #000;
  229 + padding: 300rpx 0 40rpx 0;
  230 + font-weight: bold;
  231 + }
242 232  
243   - }
  233 + .t-login .t-c {
  234 + position: absolute;
  235 + right: 22rpx;
  236 + top: 22rpx;
  237 + background: #ff0000;
  238 + color: #fff;
  239 + font-size: 24rpx;
  240 + border-radius: 50rpx;
  241 + height: 50rpx;
  242 + line-height: 50rpx;
  243 + padding: 0 25rpx;
  244 + }
244 245  
245   - .loginInputBox {
246   - width: 100%;
247   - margin-top: 80rpx;
248   - padding: 0 64rpx;
  246 + .t-login .t-d {
  247 + text-align: center;
  248 + color: #999;
  249 + margin: 80rpx 0;
  250 + }
249 251  
250   - .loginBtnBox {}
251   - }
252   - }
  252 + .t-login .t-e {
  253 + text-align: center;
  254 + width: 250rpx;
  255 + margin: 80rpx auto 0;
  256 + }
  257 +
  258 + .t-login .t-g {
  259 + float: left;
  260 + width: 50%;
  261 + }
  262 +
  263 + .t-login .t-e image {
  264 + width: 50rpx;
  265 + height: 50rpx;
  266 + }
  267 +
  268 + .t-login .t-f {
  269 + text-align: center;
  270 + margin: 200rpx 0 0 0;
  271 + color: #666;
  272 + }
  273 +
  274 + .t-login .t-f text {
  275 + margin-left: 20rpx;
  276 + color: #aaaaaa;
  277 + font-size: 27rpx;
  278 + }
  279 +
  280 + .t-login .uni-input-placeholder {
  281 + color: #000;
  282 + }
  283 +
  284 + .cl {
  285 + zoom: 1;
  286 + }
  287 +
  288 + .cl:after {
  289 + clear: both;
  290 + display: block;
  291 + visibility: hidden;
  292 + height: 0;
  293 + content: '\20';
253 294 }
254 295 -</style>
  296 +</style>
255 297 \ No newline at end of file
... ...
pages/official/official.vue
... ... @@ -63,12 +63,12 @@
63 63 url: 'http://deyanggaoxin.fengshiyun.com/api/file/Uploader/1', // 不传入上传地址则返回本地链接
64 64 // url: '', // 不传入上传地址则返回本地链接
65 65 },
66   - check:false,
  66 + check: false,
67 67 // 文件名
68 68 fileName: '文件名',
69 69 // 当前用户ID:
70 70 userId: '',
71   - isAdmin:false
  71 + isAdmin: false
72 72 }
73 73 },
74 74 onShow() {
... ... @@ -82,10 +82,10 @@
82 82  
83 83 },
84 84 methods: {
85   - change(){
86   - console.log('check',this.check)
  85 + change() {
  86 + console.log('check', this.check)
87 87 this.check = !this.check
88   - console.log('check',this.check)
  88 + console.log('check', this.check)
89 89 },
90 90 // 获取用户信息
91 91 getUser() {
... ... @@ -96,7 +96,7 @@
96 96 this.userName = userCode.userInfo.userAccount
97 97 this.userIcon = userCode.userInfo.headIcon
98 98 this.organizeName = userCode.userInfo.organizeName
99   - if(this.userId === 'admin'){
  99 + if (this.userId === 'admin') {
100 100 this.isAdmin = true
101 101 }
102 102 console.log(userCode)
... ... @@ -114,9 +114,9 @@
114 114 },
115 115  
116 116 // 跳转到自定义分组页面
117   - toGrouping(){
  117 + toGrouping() {
118 118 uni.navigateTo({
119   - url:'/pages/official/grouping/grouping'
  119 + url: '/pages/official/grouping/grouping'
120 120 })
121 121 },
122 122 // 获取企业分类
... ... @@ -352,7 +352,7 @@
352 352 }).then(res => {
353 353 console.log(res)
354 354 if (res.code === 200) {
355   - if(this.check){
  355 + if (this.check) {
356 356 this.tellNotice()
357 357 }
358 358 uni.showToast({
... ... @@ -371,19 +371,19 @@
371 371  
372 372 },
373 373 // 进行通知
374   - tellNotice(){
  374 + tellNotice() {
375 375 // 进行通知
376 376 request({
377   - url:'/api/extend/demo/SendMessageByApp',
378   - method:'post',
379   - data:{
380   - title:'公文消息',
381   - companys:'公文消息,请及时查看!',
382   - desc:this.noticeDesc,
383   - fangshi:'通知'
  377 + url: '/api/extend/demo/SendMessageByApp',
  378 + method: 'post',
  379 + data: {
  380 + title: '公文消息',
  381 + companys: '公文消息,请及时查看!',
  382 + desc: this.noticeDesc,
  383 + fangshi: '通知'
384 384 }
385   - }).then(res=>{
386   - console.log('通知结果',res)
  385 + }).then(res => {
  386 + console.log('通知结果', res)
387 387 })
388 388 },
389 389 getCityNames(ids) {
... ...