Browse Source

修改登录

jwyu 3 years ago
parent
commit
4327e2e329

+ 9 - 0
mixin/index.js

@@ -14,6 +14,15 @@ module.exports ={
 				num1=str
 			}
 			return num1.replace(/(?!^)(?=(\d{3})+$)/g, ',')+num2
+		},
+		
+		//格式化时间
+		formatTime(e){
+			if(e==='0001-01-01T00:00:00Z'){
+				return ''
+			}else{
+				return e.replace(/T/g,' ').replace(/\+08:00/g,' ').replace(/-/g,'.')
+			}
 		}
     }
 }

+ 0 - 0
pages-approve/activity/detail.vue


+ 72 - 7
pages-approve/activity/list.vue

@@ -9,11 +9,20 @@
 			</view>
 		</van-sticky>
         <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0"/>
-        <view class="list">
-            <view class="item">
-                
-            </view>
-        </view>
+        <view class="list-wrap" v-else>
+			<view class="item white-wrap" v-for="item in list" :key="item.id">
+				<view class="title flex">
+					<image src="../../static/man.png" mode="aspectFill" class="icon"></image>
+					<view>{{item.title}}</view>
+				</view>
+				<view class="content">
+					<view class="info">申请类型:{{item.applyType}}</view>
+					<view class="info">申请销售:{{item.saller}}</view>
+					<view class="info">提交时间:{{item.submitTime|formatTime}}</view>
+				</view>
+				<view class="status approve-list-status-wait" v-if="item.status==='待审批'">待审批</view>
+			</view>
+		</view>
     </view>
 </template>
 
@@ -27,6 +36,9 @@ export default {
 			finished:false,
 		}
     },
+	onLoad(options) {
+		this.getList()
+	},
     onShow() {
 	    this.selectComponent('#tabs').resize();// 解决初始渲染 vant tab 底部条
 	},
@@ -40,12 +52,65 @@ export default {
 		},
 
         async getList(){
-
+			let arr=[
+				{
+					title:"标题",
+					saller:'销售一',
+					submitTime:'',
+					approveTime:'',
+					backTime:'',
+					cancelTime:'',
+					status:'待审批',
+					applyType:'线上路演',
+					id:1,
+					type:'activity'
+				}
+			]
+			this.list=arr
         }
     }
 }
 </script>
 
-<style>
+<style lang="scss" scoped>
+.list-wrap {
+	padding: 20rpx;
+	.item {
+		padding: 30rpx;
+		box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
+		border-radius: 8px;
+		margin-bottom: 20rpx;
+
+		.title {
+			font-size: 16px;
+			font-weight: bold;
+			margin-bottom: 30rpx;
+
+			.icon {
+				width: 31rpx;
+				height: 34rpx;
+				flex-shrink: 0;
+				margin-right: 10rpx;
+				position: relative;
+				top: 4rpx;
+			}
+		}
 
+		.content {
+			font-size: 14px;
+			color: #666;
+			.info {
+				margin-bottom: 16rpx;
+			}
+
+			.info:last-child {
+				margin-bottom: 0;
+			}
+		}
+
+		.status {
+			text-align: right;
+		}
+	}
+}
 </style>

+ 0 - 9
pages-approve/components/approveListItem.vue

@@ -50,15 +50,6 @@
 			 */
 			data:null
 		},
-		filters:{
-			formatTime(e){
-				if(e==='0001-01-01T00:00:00Z'){
-					return ''
-				}else{
-					return e.replace(/T/g,' ').replace(/\+08:00/g,' ').replace(/-/g,'.')
-				}
-			}
-		},
 		methods: {
 			handleGoDetail() {
 				if(this.data.type==='custome'){

+ 0 - 7
pages-approve/contract/detail.vue

@@ -198,13 +198,6 @@
 					return e.split('T')[0].replace(/-/g,'.')
 				}
 			},
-			formatTime(e){
-				if(e==='0001-01-01T00:00:00Z'){
-					return ''
-				}else{
-					return e.replace(/T/g,' ').replace(/\+08:00/g,' ').replace(/-/g,'.')
-				}
-			},
 			formateYear(s,e){
 				return `有效期为 ${CalculationDate(s,e)}`;
 			}

+ 0 - 7
pages-approve/contract/search.vue

@@ -41,13 +41,6 @@
 				}else{
 					return e.split('T')[0].replace(/-/g,'.')
 				}
-			},
-			formatTime(e){
-				if(e==='0001-01-01T00:00:00Z'){
-					return ''
-				}else{
-					return e.replace(/T/g,' ').replace(/\+08:00/g,' ').replace(/-/g,'.')
-				}
 			}
 		},
 		data() {

+ 11 - 3
pages/login/login.vue

@@ -21,6 +21,13 @@
 		onLoad() {
 			this.$store.dispatch('WXLogin')
 		},
+		onShow() {
+			uni.hideHomeButton({
+				fail(res){
+					console.log(res);
+				}
+			})
+		},
 		methods: {
 			inputChange(type,event){
 				this[type]=event.detail
@@ -45,9 +52,10 @@
 				const res=await apiLogin({Username:this.username,Password:this.password})
 				if(res.code===200){
 					this.$store.commit('addUserData',res.data)
-					uni.navigateBack({
-						delta:1 
-					})
+					uni.switchTab({
+						url: '/pages/index/index',
+					});
+					  
 				}
 			}
 		}

+ 1 - 1
store/index.js

@@ -29,7 +29,7 @@ const store = new Vuex.Store({
 		removeUser(state){
 			state.token='',
 			state.userInfo={}
-			uni.navigateTo({
+			uni.reLaunch({
 				url:'/pages/login/login'
 			})
 		}

+ 1 - 1
utils/request.js

@@ -45,7 +45,7 @@ const http=(url,params,method)=>{
 				//401 代表token异常,用户需要重新静默授权,获取最新的token
 				//403 用户需要进行绑定操作,需要跳转到输入账号密码绑定页面用户需要进行绑定操作
 				if(res.data.code===401||res.data.code===403){
-					uni.navigateTo({
+					uni.reLaunch({
 						url:"/pages/login/login"
 					})
 				}