Commit ffeadea4 by liangjianmin

js

parent f88e01a1
......@@ -11,6 +11,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-riqi:before {
content: "\e770";
}
.icon-a-riqi1:before {
content: "\e771";
}
.icon-juxing2:before {
content: "\e76f";
}
......
......@@ -2,7 +2,7 @@
<view class="home-index">
<view class="head">
<!-- 未登录 -->
<navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/auth">
<navigator class="row verCenter box" v-if="!is_login" url="/pages/mine/login" hover-class="none">
<view class="row verCenter">
<text class="iconfont icon-juxing"></text>
<text class="t1">未登录</text>
......@@ -11,13 +11,12 @@
<!-- 已登录 -->
<view class="row bothSide verCenter box" v-else>
<view class="row verCenter">
<text class="iconfont icon-juxing"></text>
<view class="column">
<text class="t1">张同学</text>
<text class="t2">cwl@ichunt.com</text>
</view>
<text class="iconfont icon-juxing"></text>
<view class="column">
<text class="t1">{{userInfo.name}}</text>
<text class="t2">{{userInfo.email}}</text>
</view>
</view>
<text class="t3">仓储部门 -工号0005</text>
</view>
</view>
<view class="fast-entry">
......@@ -50,14 +49,24 @@ import { API } from '@/util/api.js';
export default {
data() {
return {
is_login: false
is_login: false,
userInfo: {}
};
},
onShow() {
this.getData();
},
methods: {
getData() {}
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {
if (res.err_code === 0) {
this.userInfo = res.data;
this.is_login = true;
} else {
this.is_login = false;
}
});
}
}
};
</script>
......
<template>
<view class="mine-index">
<template v-if="!isLogin">
<template v-if="!is_login">
<view class="not-logged-in row verCenter" @click="toUrl">
<view class="row verCenter">
<image class="uni-img" src="http://img.ichunt.com/images/ichunt/minProgram/scm/14ec21333cd69cc5269772811b46b7ac.png" mode="aspectFill"></image>
......@@ -17,20 +17,12 @@
mode="aspectFill"
></image>
<view class="text column">
<text class="t1">{{ userData.company_name }}</text>
<text class="t2">cwl@ichunt.com</text>
<text class="t1">{{ userInfo.name }}</text>
<text class="t2">{{ userInfo.email }}</text>
</view>
</view>
</view>
<view class="list column">
<view class="box row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<text class="tt">所属部门</text>
</view>
<view class="text">仓储部门 -工号0005</view>
</view>
</view>
<view class="list column"></view>
<view class="exit row rowCenter verCenter" @click="exit()">退出账号</view>
</template>
</view>
......@@ -41,34 +33,27 @@ import { API } from '@/util/api.js';
export default {
data() {
return {
isLogin: false,
userData: {}
is_login: false,
userInfo: {}
};
},
onLoad(options) {},
onShow() {
this.getData();
},
onShareTimeline(res) {
return {
title: '',
imageUrl: ''
};
},
methods: {
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {
if (res.err_code === 0) {
this.userData = res.data;
this.isLogin = true;
this.userInfo = res.data;
this.is_login = true;
} else {
this.isLogin = false;
this.is_login = false;
}
});
},
toUrl() {
uni.navigateTo({
url: '/pages/mine/auth'
url: '/pages/mine/login'
});
},
exit() {
......
<template>
<view class="page-auth column rowCenter verCenter">
<text class="logo"></text>
<text class="title">SCM商务系统</text>
<text class="title">猎芯面单系统</text>
<view class="form-box column rowCenter verCenter">
<view class="input-box row verCenter">
<text class="iconfont icon-riqi1"></text>
<text class="iconfont icon-riqi"></text>
<input type="text" placeholder="请输入登录账号" v-model="account" />
</view>
<view class="input-box row verCenter">
<text class="iconfont icon-a-riqi11"></text>
<input type="password" placeholder="请输入登录密码" v-model="pwd" />
<text class="iconfont icon-a-riqi1"></text>
<input type="password" placeholder="请输入登录密码" v-model="passwd" />
</view>
<button class="btn row rowCenter verCenter" @click="submit()">绑定账号</button>
<button class="btn row rowCenter verCenter" @click="submit()">登录</button>
</view>
<view class="copyright">©2021深圳市猎芯供应链有限公司 ALL RIGHTS RESERVED</view>
</view>
......@@ -24,8 +24,7 @@ export default {
data() {
return {
account: '',
pwd: '',
wechat_unique_id: ''
passwd: ''
};
},
onLoad(options) {},
......@@ -45,7 +44,7 @@ export default {
return false;
}
if (!this.pwd) {
if (!this.passwd) {
uni.showToast({
title: '请输入登录密码',
icon: 'none'
......@@ -53,21 +52,7 @@ export default {
return false;
}
let openid = uni.getStorageSync('openid');
let session_key = uni.getStorageSync('session_key');
let unionid = uni.getStorageSync('unionid');
this.request(
API.Login,
'POST',
{
account: this.account,
pwd: this.pwd,
openid: openid,
session_key: session_key,
unionid: unionid
},
true
).then(res => {
this.request(API.login, 'POST', { account: this.account, passwd: this.passwd }).then(res => {
if (res.err_code === 0) {
uni.setStorageSync('token', res.data.token);
uni.navigateBack({
......
No preview for this file type
......@@ -2,25 +2,17 @@
const API_BASE = 'http://supplyapi.liexin.com'
const API = {
/**
* 绑定微信号
* 上传数据
* */
BindWechat: API_BASE + '/supplywechatorder/bindWechat',
/**
* 获取openid
* */
getOpenId: API_BASE + '/supplywechatorder/getOpenId',
uploadSignForInfo: API_BASE + '/supplywechatsignfor/uploadSignForInfo',
/**
* 会员中心获取
* */
userInfo: API_BASE + '/supplywechatorder/userInfo',
userInfo: API_BASE + '/supplywechatsignfor/userInfo',
/**
* 小程序登录
* */
Login: API_BASE + '/supplywechatorder/login',
/**
* 公告信息获取
* */
GetNotice: API_BASE + '/supplywechat/getNotice'
login: API_BASE + '/supplywechatsignfor/login',
}
......
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 sign in to comment