Browse Source

细节优化

release_0.0.4
liujiangyong 2 years ago
parent
commit
1c101fab1c
  1. 8
      weapp/src/packages/changePassword/index.jsx
  2. 1
      weapp/src/packages/patrolView/index.jsx
  3. 33
      weapp/src/pages/home/index.jsx
  4. 10
      weapp/src/pages/home/index.scss
  5. 88
      weapp/src/static/img/home/video-bg.svg

8
weapp/src/packages/changePassword/index.jsx

@ -14,10 +14,10 @@ function Index() {
function confirm() { function confirm() {
if (!password) { if (!password) {
Taro.showToast({ title: '请输入密码' }) Taro.showToast({ title: '请输入密码', icon: 'none' })
return return
} else if (password !== password2) { } else if (password !== password2) {
Taro.showToast({ title: '两次输入的密码不一致' }) Taro.showToast({ title: '两次输入的密码不一致', icon: 'none' })
return return
} else { } else {
Taro.showModal({ Taro.showModal({
@ -50,11 +50,11 @@ function Index() {
</View> </View>
<View className='pswd'> <View className='pswd'>
<View className='title'>新的密码</View> <View className='title'>新的密码</View>
<Input value={password} onInput={e => setPassword(e.detail.value)} /> <Input value={password} type='password' onInput={e => setPassword(e.detail.value)} />
</View> </View>
<View className='pswd'> <View className='pswd'>
<View className='title'>再次输入新的密码</View> <View className='title'>再次输入新的密码</View>
<Input value={password2} onInput={e => setPassword2(e.detail.value)} /> <Input value={password2} type='password' onInput={e => setPassword2(e.detail.value)} />
</View> </View>
<AtButton className='btn' type='primary' onClick={confirm}>确认</AtButton> <AtButton className='btn' type='primary' onClick={confirm}>确认</AtButton>
</View> </View>

1
weapp/src/packages/patrolView/index.jsx

@ -79,7 +79,6 @@ function Index() {
// //
useReachBottom(() => { useReachBottom(() => {
console.log('onReachBottom')
setPage(page + 1) setPage(page + 1)
setNum(Math.random()) setNum(Math.random())
}) })

33
weapp/src/pages/home/index.jsx

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect } from 'react';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { View } from '@tarojs/components'; import { View } from '@tarojs/components';
import { useIndustry } from '@/actions/business'; import { useIndustry } from '@/actions/business';
@ -6,8 +6,26 @@ import './index.scss';
const Index = () => { const Index = () => {
const userInfo = Taro.getStorageSync('userInfo') || {}; const userInfo = Taro.getStorageSync('userInfo') || {};
const token = Taro.getStorageSync('token') || null;
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
useEffect(() => {
if (!userInfo || !token) {
Taro.showModal({
title: '提示',
content: '未获取用户信息,请重新登录',
showCancel: false,
success: (res) => {
if (res.confirm) {
Taro.reLaunch({
url: '/pages/auth/login/login'
});
}
}
});
}
}, [])
function toPatrol() { function toPatrol() {
Taro.navigateTo({ Taro.navigateTo({
url: '/packages/patrol/index?type=edit' url: '/packages/patrol/index?type=edit'
@ -19,14 +37,25 @@ const Index = () => {
}) })
} }
function toVideo() {
}
return ( return (
<View className='page'> <View className='page'>
<View className='fill'> <View className='card fill'>
<View className='title'> </View> <View className='title'> </View>
<View className='btn' onClick={isSuperAdmin ? toPatrolView : toPatrol}> <View className='btn' onClick={isSuperAdmin ? toPatrolView : toPatrol}>
{isSuperAdmin ? '查看' : '填报'} {isSuperAdmin ? '查看' : '填报'}
</View> </View>
</View> </View>
{
isSuperAdmin &&
<View className='card video'>
<View className='title'> </View>
<View className='btn' onClick={toVideo}>查看</View>
</View>
}
</View> </View>
); );
} }

10
weapp/src/pages/home/index.scss

@ -3,15 +3,23 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.fill { .card {
margin-top: 30px; margin-top: 30px;
padding: 10px; padding: 10px;
width: 94%; width: 94%;
height: 360px; height: 360px;
}
.fill {
background: url('../../static/img/home/fill-bg.svg') no-repeat; background: url('../../static/img/home/fill-bg.svg') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.video {
background: url('../../static/img/home/video-bg.svg') no-repeat;
background-size: 100% 100%;
}
.title { .title {
margin: 50px 0 0 48px; margin: 50px 0 0 48px;
color: #fff; color: #fff;

88
weapp/src/static/img/home/video-bg.svg

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="355px" height="180px" viewBox="0 0 355 180" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>椭圆形</title>
<defs>
<linearGradient x1="94.8177083%" y1="40.1387904%" x2="5.97712862%" y2="62.1403067%" id="linearGradient-1">
<stop stop-color="#34C29A" offset="0%"></stop>
<stop stop-color="#81D2CA" offset="100%"></stop>
</linearGradient>
<rect id="path-2" x="0" y="0" width="345" height="170" rx="8"></rect>
<filter x="-2.5%" y="-3.8%" width="104.9%" height="110.0%" filterUnits="objectBoundingBox" id="filter-4">
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.898039216 0 0 0 0 0.898039216 0 0 0 0 0.898039216 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
<radialGradient cx="41.0959558%" cy="36.7313023%" fx="41.0959558%" fy="36.7313023%" r="109.268488%" gradientTransform="translate(0.410960,0.367313),scale(0.456675,1.000000),rotate(135.284157),translate(-0.410960,-0.367313)" id="radialGradient-5">
<stop stop-color="#FFFFFF" stop-opacity="0.330364948" offset="0%"></stop>
<stop stop-color="#FFFFFF" stop-opacity="0.219542177" offset="2.71252185%"></stop>
<stop stop-color="#E6F3FF" stop-opacity="0.181763549" offset="100%"></stop>
</radialGradient>
<linearGradient x1="27.99208%" y1="8.10997596%" x2="77.6436298%" y2="92.0883413%" id="linearGradient-6">
<stop stop-color="#FFFFFF" offset="0%"></stop>
<stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop>
</linearGradient>
<path d="M299.319574,92.4461513 L323.319574,86.8570888 C324.93325,86.4812999 326.546029,87.4848053 326.921818,89.0984808 C326.973768,89.3215612 327,89.5498572 327,89.7789068 L327,120.030821 C327,121.687675 325.656854,123.030821 324,123.030821 C323.777838,123.030821 323.556363,123.006143 323.33965,122.957241 L299.33965,117.541616 C297.971618,117.232919 297,116.017624 297,114.615196 L297,95.3679693 C297,93.9732458 297.961198,92.7624866 299.319574,92.4461513 Z" id="path-7"></path>
<filter x="-5.0%" y="-1.9%" width="110.0%" height="103.9%" filterUnits="objectBoundingBox" id="filter-8">
<feGaussianBlur stdDeviation="1.5" in="SourceAlpha" result="shadowBlurInner1"></feGaussianBlur>
<feOffset dx="0" dy="0" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
<linearGradient x1="15.091271%" y1="21.73492%" x2="93.8480319%" y2="78.3988936%" id="linearGradient-9">
<stop stop-color="#FFFFFF" offset="0%"></stop>
<stop stop-color="#FFFFFF" stop-opacity="0" offset="100%"></stop>
</linearGradient>
<rect id="path-10" x="216" y="70" width="84" height="69" rx="8"></rect>
<filter x="-1.2%" y="-1.4%" width="104.8%" height="105.8%" filterUnits="objectBoundingBox" id="filter-11">
<feOffset dx="1" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="0.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
<feColorMatrix values="0 0 0 0 0.807843137 0 0 0 0 1 0 0 0 0 0.949019608 0 0 0 0.424797858 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
<filter x="-1.8%" y="-2.2%" width="106.0%" height="107.2%" filterUnits="objectBoundingBox" id="filter-12">
<feGaussianBlur stdDeviation="1.5" in="SourceAlpha" result="shadowBlurInner1"></feGaussianBlur>
<feOffset dx="0" dy="0" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-13">
<stop stop-color="#E9FFFA" offset="0%"></stop>
<stop stop-color="#CEFFF2" offset="100%"></stop>
</linearGradient>
<polygon id="path-14" points="260.5 93 274 120 247 120"></polygon>
<filter x="-3.7%" y="-3.7%" width="114.8%" height="114.8%" filterUnits="objectBoundingBox" id="filter-15">
<feOffset dx="1" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="0.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0.807843137 0 0 0 0 1 0 0 0 0 0.949019608 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页_巡查(管理员)" transform="translate(-10.000000, -275.000000)">
<g id="椭圆形" transform="translate(15.000000, 278.000000)">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<g id="蒙版">
<use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-2"></use>
<use fill="url(#linearGradient-1)" fill-rule="evenodd" xlink:href="#path-2"></use>
</g>
<path d="M-25.1264086,44.3554348 C-22.8540945,43.4604524 -19.9720573,43.2618945 -16.3915335,43.8308467 C-9.45771541,44.9326439 0.0397231269,48.9019168 12.7510815,56.3907566 C85.2689971,99.1143615 101.526273,100.285815 157.01895,104.299238 C160.528313,104.553047 164.194848,104.818224 168.042785,105.106029 C251.195069,111.325385 298.21739,119.468187 324.522292,128.949845 C339.379312,134.305089 347.591516,140.069255 351.945866,146.174029 C357.803157,154.38592 356.636977,163.182122 355.47544,172.269858 C354.983672,176.117388 354.486328,180.019081 354.486328,183.955078 C354.486328,190.565127 350.969335,195.802414 344.574971,199.974635 C337.534232,204.568606 327.032087,207.873856 313.817887,210.266705 C281.200306,216.17315 232.117876,216.485999 177.575934,216.499454 L174.195339,216.499951 L174.195339,216.499951 L172.5,216.5 C151.619296,216.5 132.49809,217.669332 115.119764,218.732312 C78.6988427,220.960071 49.9497981,222.750964 28.7363653,212.203464 C11.9160687,203.840268 -0.120527505,187.690127 -7.5147057,157.879628 C-10.5366892,145.696146 -14.4375121,132.807586 -18.2424469,120.236626 C-27.4467917,89.8267865 -36.1911016,61.2508546 -30.2724922,49.2327272 C-29.1448998,46.9430764 -27.4674175,45.2774736 -25.1264086,44.3554348 Z" stroke-opacity="0.262647509" stroke="#FFFFFF" fill="url(#radialGradient-5)" opacity="0.34" mask="url(#mask-3)"></path>
<g id="矩形" mask="url(#mask-3)">
<use fill-opacity="0.2" fill="url(#linearGradient-6)" fill-rule="evenodd" xlink:href="#path-7"></use>
<use fill="black" fill-opacity="1" filter="url(#filter-8)" xlink:href="#path-7"></use>
<path stroke="" stroke-width="1" d="M323.432978,87.3440585 C324.105343,87.1874797 324.777521,87.318254 325.320753,87.6562642 C325.863985,87.9942743 326.27827,88.5395203 326.434848,89.2118851 C326.47814,89.3977855 326.5,89.5880322 326.5,89.7789068 L326.5,89.7789068 L326.5,120.030821 C326.5,120.721177 326.220178,121.346177 325.767767,121.798588 C325.315356,122.250999 324.690356,122.530821 324,122.530821 C323.814865,122.530821 323.630303,122.510256 323.449708,122.469505 L323.449708,122.469505 L299.449708,117.05388 C298.879695,116.925255 298.392268,116.607757 298.047344,116.176328 C297.70242,115.7449 297.5,115.199541 297.5,114.615196 L297.5,114.615196 L297.5,95.3679693 C297.5,94.7868345 297.70025,94.2440256 298.041997,93.8135488 C298.383744,93.3830721 298.866988,93.0649274 299.432978,92.933121 L299.432978,92.933121 Z" stroke-linejoin="square"></path>
</g>
<g id="矩形" mask="url(#mask-3)">
<use fill="black" fill-opacity="1" filter="url(#filter-11)" xlink:href="#path-10"></use>
<use fill-opacity="0.2" fill="url(#linearGradient-9)" fill-rule="evenodd" xlink:href="#path-10"></use>
<use fill="black" fill-opacity="1" filter="url(#filter-12)" xlink:href="#path-10"></use>
<rect stroke="" stroke-width="1" stroke-linejoin="square" x="216.5" y="70.5" width="83" height="68" rx="8"></rect>
</g>
<g id="三角形" mask="url(#mask-3)" transform="translate(260.500000, 106.500000) rotate(-270.000000) translate(-260.500000, -106.500000) ">
<use fill="black" fill-opacity="1" filter="url(#filter-15)" xlink:href="#path-14"></use>
<use fill="url(#linearGradient-13)" fill-rule="evenodd" xlink:href="#path-14"></use>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.4 KiB

Loading…
Cancel
Save