Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
1cbd3d7e62
9 changed files with 444 additions and 15 deletions
  1. 1
      app.json
  2. 293
      colorui/main.wxss
  3. 4
      pages/home/index/index.wxml
  4. 12
      pages/home/mobile/index.js
  5. 96
      pages/home/password/index.js
  6. 6
      pages/home/password/index.json
  7. 39
      pages/home/password/index.wxml
  8. 6
      pages/home/password/index.wxss
  9. 2
      pages/login/index.js

1
app.json

@ -3,6 +3,7 @@
"pages/login/index", "pages/login/index",
"pages/index/index", "pages/index/index",
"pages/home/mobile/index", "pages/home/mobile/index",
"pages/home/password/index",
"pages/home/employee/index", "pages/home/employee/index",
"pages/home/customer-list/index", "pages/home/customer-list/index",
"pages/home/customer-info/index", "pages/home/customer-info/index",

293
colorui/main.wxss

@ -1439,3 +1439,296 @@ swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active {
flex: 1; flex: 1;
} }
/* ==================
列表
==================== */
.grayscale {
filter: grayscale(1);
}
.cu-list+.cu-list {
margin-top: 30rpx
}
.cu-list>.cu-item {
transition: all .6s ease-in-out 0s;
transform: translateX(0rpx)
}
.cu-list>.cu-item.move-cur {
transform: translateX(-260rpx)
}
.cu-list>.cu-item .move {
position: absolute;
right: 0;
display: flex;
width: 260rpx;
height: 100%;
transform: translateX(100%)
}
.cu-list>.cu-item .move view {
display: flex;
flex: 1;
justify-content: center;
align-items: center
}
.cu-list.menu-avatar {
overflow: hidden;
}
.cu-list.menu-avatar>.cu-item {
position: relative;
display: flex;
padding-right: 10rpx;
height: 140rpx;
background-color: var(--white);
justify-content: flex-end;
align-items: center
}
.cu-list.menu-avatar>.cu-item>.cu-avatar {
position: absolute;
left: 30rpx
}
.cu-list.menu-avatar>.cu-item .flex .text-cut {
max-width: 510rpx
}
.cu-list.menu-avatar>.cu-item .content {
position: absolute;
left: 146rpx;
width: calc(100% - 96rpx - 60rpx - 120rpx - 20rpx);
line-height: 1.6em;
}
.cu-list.menu-avatar>.cu-item .content.flex-sub {
width: calc(100% - 96rpx - 60rpx - 20rpx);
}
.cu-list.menu-avatar>.cu-item .content>view:first-child {
font-size: 30rpx;
display: flex;
align-items: center
}
.cu-list.menu-avatar>.cu-item .content .cu-tag.sm {
display: inline-block;
margin-left: 10rpx;
height: 28rpx;
font-size: 16rpx;
line-height: 32rpx
}
.cu-list.menu-avatar>.cu-item .action {
width: 100rpx;
text-align: center
}
.cu-list.menu-avatar>.cu-item .action view+view {
margin-top: 10rpx
}
.cu-list.menu-avatar.comment>.cu-item .content {
position: relative;
left: 0;
width: auto;
flex: 1;
}
.cu-list.menu-avatar.comment>.cu-item {
padding: 30rpx 30rpx 30rpx 120rpx;
height: auto
}
.cu-list.menu-avatar.comment .cu-avatar {
align-self: flex-start
}
.cu-list.menu>.cu-item {
position: relative;
display: flex;
padding: 0 30rpx;
min-height: 100rpx;
background-color: var(--white);
justify-content: space-between;
align-items: center
}
.cu-list.menu>.cu-item:last-child:after {
border: none
}
.cu-list.menu>.cu-item:after {
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 200%;
height: 200%;
border-bottom: 1rpx solid #ddd;
border-radius: inherit;
content: " ";
transform: scale(.5);
transform-origin: 0 0;
pointer-events: none
}
.cu-list.menu>.cu-item.grayscale {
background-color: #f5f5f5
}
.cu-list.menu>.cu-item.cur {
background-color: #fcf7e9
}
.cu-list.menu>.cu-item.arrow {
padding-right: 90rpx
}
.cu-list.menu>.cu-item.arrow:before {
position: absolute;
top: 0;
right: 30rpx;
bottom: 0;
display: block;
margin: auto;
width: 30rpx;
height: 30rpx;
color: var(--grey);
content: "\e6a3";
text-align: center;
font-size: 34rpx;
font-family: "cuIcon";
line-height: 30rpx
}
.cu-list.menu>.cu-item button.content {
padding: 0;
background-color: transparent;
justify-content: flex-start
}
.cu-list.menu>.cu-item button.content:after {
display: none
}
.cu-list.menu>.cu-item .cu-avatar-group .cu-avatar {
border-color: var(--white)
}
.cu-list.menu>.cu-item .content>view:first-child {
display: flex;
align-items: center
}
.cu-list.menu>.cu-item .content>text[class*=cuIcon] {
display: inline-block;
margin-right: 10rpx;
width: 1.6em;
text-align: center
}
.cu-list.menu>.cu-item .content>image {
display: inline-block;
margin-right: 10rpx;
width: 1.6em;
height: 1.6em;
vertical-align: middle
}
.cu-list.menu>.cu-item .content {
font-size: 30rpx;
line-height: 1.6em;
flex: 1
}
.cu-list.menu>.cu-item .content .cu-tag.sm {
display: inline-block;
margin-left: 10rpx;
height: 28rpx;
font-size: 16rpx;
line-height: 32rpx
}
.cu-list.menu>.cu-item .action .cu-tag:empty {
right: 10rpx
}
.cu-list.menu {
display: block;
overflow: hidden
}
.cu-list.menu.sm-border>.cu-item:after {
left: 30rpx;
width: calc(200% - 120rpx)
}
.cu-list.grid>.cu-item {
position: relative;
display: flex;
padding: 20rpx 0 30rpx;
transition-duration: 0s;
flex-direction: column
}
.cu-list.grid>.cu-item:after {
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 200%;
height: 200%;
border-right: 1px solid rgba(0, 0, 0, .1);
border-bottom: 1px solid rgba(0, 0, 0, .1);
border-radius: inherit;
content: " ";
transform: scale(.5);
transform-origin: 0 0;
pointer-events: none
}
.cu-list.grid>.cu-item text {
display: block;
margin-top: 10rpx;
color: #888;
font-size: 26rpx;
line-height: 40rpx
}
.cu-list.grid>.cu-item [class*=cuIcon] {
position: relative;
display: block;
margin-top: 20rpx;
width: 100%;
font-size: 48rpx
}
.cu-list.grid>.cu-item .cu-tag {
right: auto;
left: 50%;
margin-left: 20rpx
}
.cu-list.grid {
background-color: var(--white);
text-align: center
}
.cu-list.grid.no-border>.cu-item {
padding-top: 10rpx;
padding-bottom: 20rpx
}
.cu-list.grid.no-border>.cu-item:after {
border: none
}
.cu-list.grid.no-border {
padding: 20rpx 10rpx
}

4
pages/home/index/index.wxml

@ -73,9 +73,9 @@
</van-cell-group> </van-cell-group>
<view style="height:16rpx"></view> <view style="height:16rpx"></view>
<van-cell-group> <van-cell-group>
<van-cell is-link link-type="navigateTo" url="/pages/home/mobile/index">
<van-cell is-link link-type="navigateTo" url="/pages/home/password/index">
<view class="flex" slot="title" style="align-items: center"> <view class="flex" slot="title" style="align-items: center">
<van-icon name="qr" size="18"/>
<text class="cuIcon-lock text-black" style="font-size:36rpx"></text>
<text class="text-sg" style="margin-left:12rpx">修改密码</text> <text class="text-sg" style="margin-left:12rpx">修改密码</text>
</view> </view>
</van-cell> </van-cell>

12
pages/home/mobile/index.js

@ -54,18 +54,6 @@ Page({
} }
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
var form = {account: this.data.form.mobile, accountType: 'MOBILE', purpose: 'RECYCLE_CLIENT_UPDATE_MOBILE' } var form = {account: this.data.form.mobile, accountType: 'MOBILE', purpose: 'RECYCLE_CLIENT_UPDATE_MOBILE' }
// /send/captcha 发送验证码
// request.post('/cloud-print-user-center/send/captcha', form).then(result => {
// wx.hideLoading()
// this.setData({ codeEnable: false })
// util.showToast('验证码已经发送')
// this.countDown = this.countDown || this.selectComponent('#count-down')
// this.countDown.reset()
// this.countDown.start()
// }).catch(error => {
// wx.hideLoading()
// util.showToast(error)
// })
}, },
onChange: function(e) { onChange: function(e) {
this.setData({ second: e.detail.seconds + ' 秒 ' }) this.setData({ second: e.detail.seconds + ' 秒 ' })

96
pages/home/password/index.js

@ -0,0 +1,96 @@
// pages/home/password/index.js
// 页面已经废弃,因为UEC的修改,暂时不会提供修改密码的功能
import { postCaptcha, setPassword } from "../../../api/user"
const util = require('../../../utils/util')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
second: '获取验证码',
codeEnable: false,
pwdType: 'password',
pwd_icon: 'attention',
form: {
mobile: null,
password: null,
verifyCode: null
},
requesting: false,
first: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ ['form.mobile']: app.userInfo.mobile })
if(options.from){
this.setData({ first: true })
}
},
bindForm: function (e) {
this.data.form[e.target.id] = e.detail.value
},
changePwd: function (e) {
if (this.data.pwdType === 'password') {
this.setData({ pwdType: 'text', pwd_icon: 'attentionforbid' })
} else {
this.setData({ pwdType: 'password', pwd_icon: 'attention' })
}
},
fetchCode: function () {
if (util.isEmpty(this.data.form.mobile)) {
util.showToast('请输入手机号码')
return
}
if (this.second && this.second.interval) return !1
wx.showLoading({ title: '正在获取', mask: true })
postCaptcha({ verifiableAccount: this.data.form.mobile, verifiableAccountType: 1, purpose: 2 }).then(result => {
wx.hideLoading()
this.setData({ codeEnable: true })
util.showToast('验证码已经发送')
this.countDown = this.countDown || this.selectComponent('.count-down')
this.countDown.reset()
this.countDown.start()
}).catch(error => {
wx.hideLoading()
util.showToast(error)
})
},
onChange: function(e) {
this.setData({ second: e.detail.seconds + ' 秒 ' })
},
onFinished: function(){
this.setData({ second: '重新获取验证码', codeEnable: false })
},
submitForm: function () {
if (this.data.requesting) {
return
}
if (util.isEmpty(this.data.form.mobile) && !this.data.first) {
util.showToast('请输入手机号码')
return
}
if (util.isEmpty(this.data.form.password)) {
util.showToast('请输入密码')
return
}
if (util.isEmpty(this.data.form.verifyCode) && !this.data.first) {
util.showToast('请输入验证码')
return
}
wx.showLoading({ title: '处理中', mask: true })
this.data.requesting = true
setPassword(this.data.form).then(res => {
wx.hideLoading()
util.showBackToast('设置成功')
}).catch(error => {
wx.hideLoading()
this.data.requesting = false
util.showToast(error)
})
}
})

6
pages/home/password/index.json

@ -0,0 +1,6 @@
{
"usingComponents": {
"van-button": "/components/button/index",
"van-count-down": "/components/count-down/index"
}
}

39
pages/home/password/index.wxml

@ -0,0 +1,39 @@
<!--pages/home/password/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:18px">{{first ? '设置密码' : '密码重置'}}</view>
</cu-custom>
<wux-alert theme="positive" title="为了简化登录流程,您可以设置登录密码,以后就可以直接使用密码进行登录了。" wx:if="{{first}}"/>
<view class="cu-list menu no-card sm-border margin-top">
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">登录密码:</view>
<input id="password" maxlength="24" type="password" placeholder="请输入新的登录密码" bindinput="bindForm"></input>
</view>
</view>
</view>
<view class="cu-list menu no-card sm-border margin-top" wx:if="{{!first}}">
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">手机号:</view>
<input id="mobile" maxlength="11" disabled="true" type="number" value="{{form.mobile}}" placeholder="请输入当前登录手机号码" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">验证码:</view>
<input id="verifyCode" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input>
</view>
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{codeEnable}}" bind:click="fetchCode">
<van-count-down id="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onChange" bind:finish="onFinished">
<text class="text-sm">{{second}}</text>
</van-count-down>
</van-button>
</view>
</view>
<view class="flex flex-direction" style="padding:80rpx 32rpx">
<van-button block type="info" bind:click="submitForm">提交</van-button>
</view>

6
pages/home/password/index.wxss

@ -0,0 +1,6 @@
/* pages/home/password/index.wxss */
.content-box {
background-color: #fff;
margin: 30rpx;
border-radius: 10rpx
}

2
pages/login/index.js

@ -111,7 +111,7 @@ Page({
} }
this.setData({ loging: false, metaData: this.data.metaData }) this.setData({ loging: false, metaData: this.data.metaData })
} else { } else {
if(!app.userInfo.factoryId){
if(app.userInfo.factoryId){
wx.redirectTo({ url: '/pages/index/index' }) wx.redirectTo({ url: '/pages/index/index' })
} else { } else {
wx.redirectTo({ url: '/pages/client/index/index' }) wx.redirectTo({ url: '/pages/client/index/index' })

Loading…
Cancel
Save