huangli865118801 3 years ago
parent
commit
3e52282ead
  1. 26
      api/user.js
  2. 39
      pages.json
  3. 78
      pages/editePsd/editePsd.vue
  4. 7
      pages/firstInspection/firstInspection.vue
  5. 52
      pages/firstInspectionInfo/firstInspectionInfo.vue
  6. 59
      pages/user/index.scss
  7. 82
      pages/user/user.vue
  8. BIN
      static/def.jpg
  9. BIN
      static/shouye-g.png
  10. BIN
      static/shouye.png
  11. BIN
      static/wode-g.png
  12. BIN
      static/wode.png
  13. BIN
      static/xg.png

26
api/user.js

@ -14,7 +14,18 @@ export function login(data) {
});
}
/**
* 修改密码
* @param {Object} data
*/
export function modifyPassword(data) {
console.log(data)
return request({
url: `${functions.getDomain()}/api/modify-password`,
method: "post",
data
});
}
/**
* 获取权限
* @param {Object} data
@ -41,3 +52,16 @@ export function firstCheckLists(data) {
data
});
}
/**
* 首检详情
* @param {Object} data
*/
export function firstCheckDetail(data) {
console.log(data)
return request({
url: `${functions.getDomain()}/api/first-check-detail`,
method: "post",
data
});
}

39
pages.json

@ -139,11 +139,48 @@
}
}
],
,{
"path" : "pages/editePsd/editePsd",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/user/user",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#008EBC",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"backgroundColor": "#FFFFFF",
"color": "#C3C3C3",
"selectedColor": "#1296db",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "./static/shouye-g.png",
"selectedIconPath": "./static/shouye.png"
},
{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "./static/wode-g.png",
"selectedIconPath": "./static/wode.png"
}
]
}
}

78
pages/editePsd/editePsd.vue

@ -0,0 +1,78 @@
<template>
<view>
<view class="card">
<input type="number" v-model="form.tel" placeholder="请输入账号" />
</view>
<view class="card">
<input type="password" v-model="form.old_password" placeholder="请输入旧密码" />
</view>
<view class="card">
<input type="password" v-model="form.new_password" placeholder="请输入新密码" />
</view>
<view class="card">
<input type="password" v-model="form.algin_pasd" placeholder="请再次输入新密码" />
</view>
<view class="btn-div">
<button :disabled="form.old_password&&form.new_password&&form.algin_pasd?false:true" type="primary" @tap="subMitBtn()" >确认修改</button>
</view>
</view>
</template>
<script>
import {modifyPassword} from "../../api/user.js"
export default {
data() {
return {
form:{
old_password:'',
new_password:'',
algin_pasd:'',
tel:''
}
};
},methods:{
subMitBtn(){
if(this.form.new_password!=this.form.algin_pasd){
this.$functions.error("两次密码不一致,请重新输入");
this.form.new_password='';
this.form.algin_pasd=''
return false;
}
let parm={
tel:this.form.tel,
password:this.form.new_password
}
modifyPassword(parm).then(res=>{
this.$functions.success("修改成功").then(()=>{
uni.navigateTo({
url: '../login/login',
success: res => {},
fail: () => {},
complete: () => {}
});
})
})
}
}
}
</script>
<style lang="scss">
.card{
@include wh(750upx,auto);
padding-top: 30upx;
padding-bottom: 30upx;
background: white;
border-bottom: 2upx solid #f5f5f5;
input{
margin-left: 30upx;
}
}
.btn-div{
width: 690upx;
margin: auto;
margin-top: 30upx;
}
</style>

7
pages/firstInspection/firstInspection.vue

@ -1,6 +1,6 @@
<template>
<view>
<view class="card" v-for="(item,index) in list" :key="index" @tap="firstInspectionInfo()">
<view class="card" v-for="(item,index) in list" :key="index" @tap="firstInspectionInfo(item.plan_id,item)">
<view class="card-left">
<view class="card-up-list">
<view class="card-up-list-list">
@ -47,9 +47,10 @@
this.list = res;
})
},
firstInspectionInfo() {
firstInspectionInfo(plan_id,item) {
console.log("id",plan_id)
uni.navigateTo({
url: '../firstInspectionInfo/firstInspectionInfo',
url: `../firstInspectionInfo/firstInspectionInfo?plan_id=${plan_id}&&planInfo=${encodeURIComponent(JSON.stringify(item))}`,
success: res => {},
fail: () => {},
complete: () => {}

52
pages/firstInspectionInfo/firstInspectionInfo.vue

@ -13,23 +13,25 @@
<view class="content-box-card-ul">
<view class="content-box-card-list">
<view class="content-box-card-title">物料名称:</view>
<text>这是物料名称</text>
<text>{{palnInfo.product_name}}</text>
</view>
</view>
<view class="content-box-card-ul-two">
<view class="content-box-card-ul">
<view class="content-box-card-list">
<view class="content-box-card-title">检验日期:</view>
<text>2021-07-15</text>
<text>{{crrentTime}}</text>
</view>
</view>
<view class="content-box-card-ul">
<view class="content-box-card-list">
<view class="content-box-card-title">生产日期:</view>
<text>2021-07-15</text>
<text>{{palnInfo.production}}</text>
</view>
</view>
<view class="content-box-card-ul-two">
<view class="content-box-card-list">
<view class="content-box-card-title">机型:</view>
<text>2021-07-15</text>
<text>{{palnInfo.product_name}}</text>
</view>
<view class="content-box-card-list">
<view class="content-box-card-title">线别:</view>
@ -215,13 +217,19 @@
</template>
<script>
import {firstCheckDetail} from "../../api/user.js"
export default {
data() {
return {
pId:0,//id
palnInfo:{},//
crrentTime:'',//
line: ["A线", "B线", "C线", "D线"],
lineIndex: 0,
current: -1,
ifQualifiedIds: 0,
cyMethod: [{
name: "开机首检",
check: false
@ -264,7 +272,41 @@
ProductionIds: -1
};
},
onLoad(e) {
this.pId = e.plan_id;
this.palnInfo = JSON.parse(decodeURIComponent(e.planInfo));
console.log('详情',this.palnInfo);
this.getTime();
},
onShow() {
this.getInfo();
this.getTime();
},
methods: {
getTime:function(){
var date = new Date(),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
month >= 1 && month <= 9 ? (month = "0" + month) : "";
day >= 0 && day <= 9 ? (day = "0" + day) : "";
var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
console.log("当前时间",date);
this.crrentTime=timer
return timer;
console.log("当前时间",timer)
},
getInfo(){
firstCheckDetail({plan_id:this.pId}).then(res=>{
// /console.log('', res)
})
},
bindline: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
this.lineIndex = e.target.value

59
pages/user/index.scss

@ -0,0 +1,59 @@
.bg{
@include wh(750upx,auto);
padding-top: 30upx;
padding-bottom: 30upx;
background: #008EBC;
.user-info{
@include flex(center,flex-start);
}
image{
@include wh(120upx,120upx);
border-radius: 50%;
margin-left: 30upx;
}
view{
@include fonts(28upx,#fff,500);
margin-left: 20upx;
}
}
.list{
@include wh(690upx,auto);
margin: auto;
@include flex(center,space-between);
padding: 30upx;
border-bottom: 2upx solid #f5f5f5;
background: white;
.next-icon{
@include wh(28upx,33upx);
}
.left{
width:400upx;
@include flex(center,flex-start);
.grzl{
@include wh(45upx,45upx);
}
.xgmi{
@include wh(39upx,45upx);
}
.yjfk{
@include wh(39upx,45upx);
}
view{
@include fonts(28upx,#333,500);
margin-left: 10upx;
}
}
.right{
@include flex(center,flex-start);
text{
font-size: 26upx;
}
}
}
.logout{
@include wh(690upx);
margin-top: 400upx;
}

82
pages/user/user.vue

@ -0,0 +1,82 @@
<template>
<view>
<view class="bg">
<view class="user-info">
<image src="../../static/def.jpg" mode=""></image>
<view @tap="login()" v-if="!userInfo.name">未登录去登录</view>
<view v-else>欢迎您!{{userInfo.name}}</view>
</view>
</view>
<view>
<view class="list" @tap="editPsd()">
<view class="left">
<image class="xgmi" src="../../static/xg.png" mode=""></image>
<view>修改密码</view>
</view>
<image class="next-icon" src="../../static/next.png"></image>
</view>
</view>
<button class="logout" type="primary" v-if="userInfo.name" @tap="logout">退出登录</button>
</view>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex';
import {authSee} from "../../api/user.js"
export default {
computed: {
...mapGetters(['userInfo', 'roleType'])
},
onShow() {
},
onLoad() {
this.getRz()
},
data() {
return {
status:0,
ifJump:0,
};
},methods:{
...mapMutations(['setToken', 'setUserInfo']),
smrz(){
this.ifJump=1
console.log("ss",this.ifJump)
this.getRz()
},
editPsd(){
uni.navigateTo({
url: '../editePsd/editePsd',
success: res => {},
fail: () => {},
complete: () => {}
});
},
login(){
uni.navigateTo({
url: '../login/login',
success: res => {},
fail: () => {},
complete: () => {}
});
},
logout(){
this.$functions.confirm("是否确认退出登录").then(()=>{
this.setToken("");
this.setUserInfo({});
uni.reLaunch({
url:"../login/login"
})
})
}
}
}
</script>
<style lang="scss">
@import "./index.scss"
</style>

BIN
static/def.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/shouye-g.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/shouye.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/wode-g.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
static/wode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
static/xg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Loading…
Cancel
Save