Commit 04d4a2f2 authored by 王向前's avatar 王向前

no message

parent 057a258a
<script>
import Vue from 'vue'
import appUpdate from 'common/util/appUpdate.js'
// import appUpdate from 'common/util/appUpdate.js'
import { mapActions } from "vuex"
import md5 from 'common/util/md5.js'
export default {
onLaunch: function() {
uni.getSystemInfo({
success: function(e) {
// #ifdef APP-PLUS
// 检测升级
appUpdate()
// #endif
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
......@@ -32,26 +30,8 @@
// #endif
// #ifdef APP-PLUS
//Vue.prototype.$api.listenTranMsg()
// var info = plus.push.getClientInfo();
// /* 5+ push 消息推送 ps:使用:H5+的方式监听,实现推送*/
// plus.push.addEventListener("click", function(msg) {
// console.log("click:" + JSON.stringify(msg));
// console.log(msg.payload);
// console.log(JSON.stringify(msg));
// //这里可以写跳转业务代码
// }, false);
// // 监听在线消息事件
// plus.push.addEventListener("receive", function(msg) {
// // plus.ui.alert(2);
// //这里可以写跳转业务代码
// console.log("recevice:" + JSON.stringify(msg))
// }, false);
// #endif
//Vue.prototype.$api.initLogin()
}
})
Vue.prototype.NavBarColor='bg-gradual-blue'
......@@ -138,13 +118,46 @@
color: '#ffffff'
},
]
let _this=this;
uni.getStorage({//获得保存在本地的用户信息
key: 'userinfo',
success:(res) => {
let userinfo=res.data.userinfo
this.mLogin(userinfo).then((res) => {
if(res.data.success){
// _this.$tip.success('登录成功!')
uni.setStorage({
key: 'ACCESS_TOKEN',
data: res.data.data.token,
success: function () {
_this.$Router.replace({name:'index'})
},
fail:function() {
// this.$tip.alert("未获取token,请重新登录");
}
});
}else{
// this.$tip.alert(res.data.message);
}
}).catch((err) => {
// this.$tip.alert("自动登录失败");
this.$Router.replaceAll({name:"cusmerLogin"})
}).finally(()=>{
})
}})
},
methods: {
...mapActions([ "mLogin","SetPressmisson"]),
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
......@@ -154,6 +167,61 @@
@import "plugin/colorui/main.css";
@import "plugin/colorui/icon.css";
@import "plugin/colorui/animation.css";
/* 解决checkbox失效
*/
page{
background-color: white;
}
uni-picker{
height: 36px;
}
.cu-item:after{
border: 0;
}
.textRed{
color: red;
}
.textGreen{
color: green;
}
.uni-forms-item__label .label-text{
color: #333!important;
}
.uni-form-content {
padding-left: 20px;
margin-top: 0px;
}
/deep/.uni-collapse-item-border{
border-bottom: solid #EEEEEE 0px!important;
}
/deep/.uni-collapse-item__wrap{
border-bottom: solid #EEEEEE 10px!important;
}
.wbgeee{
padding: 10px;background-color: #f8f8f8;
}
.wbgw{
height: 100%;width:100%;border-radius: 5%;
}
.border-bot{
border-bottom: #F8F8F8 solid 5px;
}
.textarea-ls{
width: 70vw;padding: 10px;border: 1px #eee solid;border-radius: 5px;margin: 10px;
}
uni-checkbox .uni-checkbox-input {
border-radius: 3upx !important;
color: #ffffff !important;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
color: #fff;
border-color: rgb(0, 122, 255);
background: rgb(0, 122, 255);
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:after {
font-size: 18px;
}
.lccontent {
padding: 60rpx;
......@@ -163,7 +231,6 @@
}
}
.bg-blue{
background-color: #0081FF!important;
color: #FFFFFF!important;
}
.newts{
......@@ -269,7 +336,14 @@
font-size: 36upx;
margin-right: 1px;
}
.flexRight{
display: flex;justify-content: flex-end;
}
.absoluteRight{
position: absolute;
z-index: 99;
right: 10px;
}
.nav-li text {
position: absolute;
right: 30upx;
......@@ -285,6 +359,17 @@
font-weight: 300;
}
.fixed-bottom {
position: fixed;
left: 0;
width: 100%;
right: 100%;
bottom: 0;
z-index: 99999;
}
.border-top{
border-top: 1px solid #f8f8f8;
}
@keyframes show {
0% {
transform: translateY(-50px);
......
......@@ -10,23 +10,22 @@ const router = new Router({
routes: [...modules]//路由表
});
console.log(router)
const whiteList = ['/pages/login/login','/pages/login/cusmerLogin']
const whiteList = ['/pages/login/login','/pages/login/cusmerLogin','/pages/login/update']
//全局路由前置守卫
router.beforeEach((to, from, next) => {
console.log(from)
console.log(to,'to')
let token=uni.getStorageSync("ACCESS_TOKEN");
if(token){
next()
}else if(to.name=="fwqsz"){
}else if(to.name=="fwqsz"||to.name=="register"||to.name=="update"||to.name=="login"){
next()
}else{
if (whiteList.indexOf(to.path) !== -1) {
next()
}else{
next({ path: '/pages/login/login'})
next({ path: '/pages/login/cusmerLogin'})
}
}
next()
})
// 全局路由后置守卫
router.afterEach((to, from) => {
......
......@@ -6,6 +6,20 @@ const routes = [
title: '登录',
},
},
{
path: "/pages/login/cusmerLogin",
name: 'cusmerLogin',
meta: {
title: '云登录',
},
},
{
path: "/pages/login/update",
name: 'update',
meta: {
title: '更新',
},
},
{
path: "/pages/login/fwqsz",
name: 'fwqsz',
......
let BASE_URL = ''
let fwq=""
let fwq="clouderp.gavelinfo.com/erp"
// 修改
try {
fwq = uni.getStorageSync('fwq');
} catch (e) {
// error
}
let newUrl = 'http://'+fwq
// try {
// fwq = uni.getStorageSync('fwq');
// } catch (e) {
// // error
// }
let newUrl = 'https://'+fwq
console.log(BASE_URL)
if (process.env.NODE_ENV == 'development') {
BASE_URL = newUrl
......
......@@ -64,6 +64,12 @@ export default function appUpdate(loginApp) {
}
}
if (verC < 0) {
var downUrl=res.data.url;
if(downUrl&&downUrl.includes(".wgt")){
flag_hot=true;
}else{
flag_hot=false
}
loginApp.showProcess('检测到最新版本', 90)
uni.hideLoading()
if (flag_hot) {
......
{
"name" : "格物ERP",
"appid" : "__UNI__C98E701",
"name" : "格物ERP",
"appid" : "__UNI__4557C88",
"description" : "",
"versionName" : "4",
"versionCode" : 4,
......
{
"pages": [
// 云erp
{
"path": "pages/login/update",
"style": {}
},
{
"path": "pages/login/cusmerLogin",
"style": {}
......
......@@ -2,7 +2,7 @@
<view class="home-page">
<cu-custom bgColor="bg-white">
<block slot="content">{{title}}</block>
<block slot="right"><image @tap="goindex()" src="../../static/icon/application.png"></image></block>
<!-- <block slot="right"><image @tap="goindex()" src="../../static/icon/application.png"></image></block> -->
</cu-custom>
<scroll-view :style="[{top:CustomBar + 'px'}]" class="">
<view class="cu-bar bg-white search" style="position: relative;">
......@@ -161,7 +161,7 @@
showlist:[],
searchKey:"",
CustomBar:this.CustomBar,
title:"格物ERP",
title:"格物ERP",
swiperList: [
{id:1,type: 'image',url: '/static/banner/banner1.png', link: ''},
],
......
......@@ -57,9 +57,9 @@
<!-- #ifdef APP-PLUS -->
<view class="padding flex flex-direction text-center">
<!-- <view class="padding flex flex-direction text-center">
当前版本:{{version}}
</view>
</view> -->
<!-- #endif -->
</view>
......@@ -290,6 +290,13 @@
this.loading=false;
this.loginurl =resp.data.data.records+"&&tp='1'";
/* this.loginT() */
uni.setStorage({
key: 'userinfo',
data:{...{'userinfo':params},...resp.data.data},
success: function (r) {
console.log(r);
}
});
uni.setStorage({
key: 'userid',
data: resp.data.data.userid,
......
<template>
<view class="bg-white">
<cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<!-- <cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<slot slot="backText">返回</slot>
</cu-custom> -->
<cu-custom bgColor="bg-white" isBack="true" @tapBind="cuopen">
<block slot="content">{{title}}</block>
<block slot="right" ><text class="cuIcon-search">查询</text></block>
</cu-custom>
<view class="bg-white nav fixed" :style="[{top:CustomBar + 'px'}]">
<view class="flex text-center flex-wrap">
......@@ -11,7 +15,6 @@
</view>
<view class="" style="height: 30px;line-height: 30px;padding-left: 30px;padding-right: 30px;text-align: right;">当前共查询到{{total}}个结果</view>
</view>
<view class="container">
<view class="index">
<view v-if="!showlist[0]" style="margin-top: 140px;background-image: url(/static/sswnr.png);height: calc( 100vh - 185px);background-size:100% 70%;background-repeat:no-repeat;"></view>
......@@ -235,6 +238,7 @@
},
data() {
return {
title:"采购订单明细",
poid:"",
cgyinfo:"",
wlxxinfo:"",
......@@ -277,7 +281,7 @@
},
methods: {
cuopen(e){
this.modalName=e
this.modalName="bottomModal"
},
// 获取上个月日期
// 获取上一个月时间,返回yyyy-MM-dd字符串
......@@ -625,4 +629,8 @@
color: red;
} */
/deep/.cu-custom .cu-bar .action:last-child {
width: 140rpx;
}
</style>
<template>
<view class="bg-white">
<cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<!-- <cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<slot slot="backText">返回</slot>
</cu-custom> -->
<cu-custom bgColor="bg-white" isBack="true" @tapBind="cuopen">
<block slot="content">{{title}}</block>
<block slot="right" ><text class="cuIcon-search">查询</text></block>
</cu-custom>
<view class="bg-white nav fixed" :style="[{top:CustomBar + 'px'}]">
<view class="flex text-center flex-wrap">
......@@ -233,6 +237,7 @@
},
data() {
return {
title:"收发汇总",
sum:{bqcksl:0,bqrksl:0,qcjcsl:0,qmjcsl:0},
wlph:"",
kwid:"",
......@@ -273,7 +278,7 @@
},
methods: {
cuopen(e){
this.modalName=e
this.modalName="bottomModal"
},
// 获取上个月日期
// 获取上一个月时间,返回yyyy-MM-dd字符串
......@@ -608,5 +613,7 @@
/* .list-da view text {
color: red;
} */
/deep/.cu-custom .cu-bar .action:last-child {
width: 140rpx;
}
</style>
<template>
<view class="bg-white">
<cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<!-- <cu-custom bgColor="bg-white" isBack="true" cx=true modal="bottomModal" @open="cuopen" :modalName="modalName">
<slot v-slot=""></slot>
<slot slot="backText">返回</slot>
</cu-custom> -->
<cu-custom bgColor="bg-white" isBack="true" @tapBind="cuopen">
<block slot="content">{{title}}</block>
<block slot="right" ><text class="cuIcon-search">查询</text></block>
</cu-custom>
<view class="bg-white nav fixed" :style="[{top:CustomBar + 'px'}]">
<view class="flex text-center flex-wrap">
......@@ -216,6 +221,7 @@
},
data() {
return {
title:"销售订单明细",
soid:"",
wlxxinfo:"",
startdate:'2021-01-01',
......@@ -257,7 +263,7 @@
},
methods: {
cuopen(e){
this.modalName=e
this.modalName="bottomModal"
},
// 获取上个月日期
// 获取上一个月时间,返回yyyy-MM-dd字符串
......@@ -424,7 +430,7 @@
}
</script>
<style scoped>
<style scoped lang="scss">
.tjys{
margin-left: 20%;
}
......@@ -603,5 +609,7 @@
/* .list-da view text {
color: red;
} */
/deep/.cu-custom .cu-bar .action:last-child {
width: 140rpx;
}
</style>
......@@ -2,7 +2,7 @@
<view class="process-page">
<cu-custom bgColor="bg-white">
<block slot="content">{{title}}</block>
<block slot="right"><image src="../../static/icon/application.png"></image></block>
<!-- <block slot="right"><image src="../../static/icon/application.png"></image></block> -->
</cu-custom>
<view class="bg-white nav fixed" :style="[{top:CustomBar + 'px'}]">
<view class="flex text-center">
......
......@@ -11,12 +11,12 @@
</view>
</view>
<view class=" flex bg-white cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
<!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
<view class="content" >
<text class="cuIcon-favorfill text-yellow"></text>
<text class="text-grey">收藏</text>
</view>
</view>
</view> -->
<!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
<view class="content">
<text class="cuIcon-redpacket_fill text-red"></text>
......@@ -35,13 +35,13 @@
<text class="text-grey">定位</text>
</view>
</navigator> -->
<navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/setting" :style="[{animationDelay: '0.6s'}]" >
<navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/setting" >
<view class="content">
<text class="cuIcon-settingsfill text-cyan"></text>
<text class="text-grey">设置</text>
</view>
</navigator>
<navigator style="" class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" :url="isCloud?'/pages/login/cusmerLogin':'/pages/login/login'" hover-class="none">
<navigator style="" class="cu-item arrow animation-slide-bottom" :url="isCloud?'/pages/login/cusmerLogin':'/pages/login/login'" hover-class="none">
<view class="content" @click="clearToken()">
<text class="cuIcon-exit text-cyan"></text>
<text class="text-grey">退出</text>
......
......@@ -6,17 +6,15 @@
<text class="cuIcon-back"></text>
<slot name="backText"></slot>
</view>
<view class="content" :style="[{top:StatusBar + 'px'}]">
<view class="content" @click="ClickChange" :style="[{top:StatusBar + 'px'}]" >
<slot name="content"></slot>
</view>
<view style="margin-right: 15px;" @click="openmodal()" v-if="cx">
<text class="lg grey" :class="'cuIcon-' + 'search'">查询</text>
</view>
<!-- <view class="action">
<view style="">
<view class="action" @tap="tapBind">
<slot name="right"></slot>
</view>
</view> -->
</view>
</view>
</view>
......@@ -84,14 +82,19 @@
// }else{
// this.$emit('open','bottomModal')
// }
},
ClickChange(){
this.$emit("clickChange")
},
tapBind(){
this.$emit("tapBind")
}
}
}
</script>
<style scoped>
.process-page .cu-custom .cu-bar .content {
width: calc(100% - 440upx);
.cu-custom .cu-bar .content {
width: calc(100%);
}
</style>
......@@ -3,7 +3,6 @@ import Vuex from 'vuex'
import api from "@/api/api"
import MinCache from'@/common/util/MinCache.js'
import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
console.log("Vuex")
Vue.use(Vuex)
export default new Vuex.Store({
state: {
......@@ -12,7 +11,8 @@ export default new Vuex.Store({
username: '',
realname: '',
welcome: '',
avatar: ''
avatar: '',
hasLogin:false
},
mutations: {
SET_TOKEN: (state, token) => {
......@@ -25,24 +25,98 @@ export default new Vuex.Store({
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_HASLOGIN:(state,status)=>{
state.hasLogin=status
}
},
actions: {
// 登录
mLogin({ commit }, userInfo) {
return new Promise((resolve, reject) => {
api.login(userInfo).then(response => {
if(response.data.code ==200){
const result = response.data.result
const userInfo = result.userInfo
uni.setStorageSync(ACCESS_TOKEN,result.token);
uni.setStorageSync(USER_INFO,userInfo);
commit('SET_TOKEN', result.token)
commit('SET_AVATAR', userInfo.avatar)
commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
resolve(response)
api.login(userInfo).then(res => {
if(res.data.success){
const result = res.data.data
// uni.setStorageSync(ACCESS_TOKEN,result.token);
// uni.setStorageSync(USER_INFO,userInfo);
commit('SET_HASLOGIN',true)
// commit('setHasLogin',true)
// commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname})
/* uni.setStorage({
key: 'userid',
data: res.data.data.userid,
success: function () {
console.log(res.data.data.userid);
}
});
uni.setStorage({
key: 'userkey',
data: res.data.data.userkey,
success: function () {
console.log(res.data.data.userkey);
}
});
uni.setStorage({
key: 'bmid',
data: res.data.data.orgname,
success: function () {
console.log(res.data.data.orgname);
}
});
uni.setStorage({
key: 'username',
data: res.data.data.username,
success: function () {
console.log(res.data.data.username);
}
});
uni.setStorage({
key: 'userName',
data: userInfo.userid,
success: function () {
console.log("用户名获取成功")
}
});
uni.setStorage({
key: 'password',
data: userInfo.password,
success: function () {
console.log("密码存储成功")
}
});
*/
uni.setStorageSync('ACCESS_TOKEN',res.data.data.token)
uni.setStorage({
key: 'ACCESS_TOKEN',
data: res.data.data.token,
success: function () {
},
fail:function() {
// this.$tip.alert("未获取token,请重新登录");
}
});
uni.setStorage({
key: 'userinfo',
data:{...{'userinfo':userInfo},...res.data.data},
success: function (r) {
}
});
uni.setStorage({
key: 'systemid',
data: res.data.data.systemid,
success: function () {
console.log(res.data.data.systemid);
}
});
resolve(res)
}else{
resolve(response)
resolve(res)
}
}).catch(error => {
// console.log("catch===>response",response)
......
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 to comment