Browse Source

整体框架搭建

sunlupeng 1 năm trước cách đây
mục cha
commit
ee8a3fed95

+ 26 - 0
api/work/index.js

@@ -0,0 +1,26 @@
+import request from '@/utils/request'
+
+//我的代办列表
+export function getTodoTaskPage(query) {
+  return request({
+    url: '/bpm/task/todo-page',
+    method: 'get',
+    params: query
+  })
+}
+//我处理的列表
+export function getDoneTaskPage(query) {
+  return request({
+    url: '/bpm/task/done-page',
+    method: 'get',
+    params: query
+  })
+}
+//我发起的列表
+export function getMyProcessInstancePage(query) {
+  return request({
+    url: '/bpm/process-instance/my-page',
+    method: 'get',
+    params: query
+  })
+}

+ 56 - 24
components/myUnits/purchaseUnit/unit.vue

@@ -1,20 +1,52 @@
 <template>
-    <view class='my-unit'>
-		<view class="unit-head">
-			<text>求购编号:12346579812</text><text class="fr color-999">正在报价</text>
+	<view>
+		<view v-if="initIndex==2" class='my-unit'>
+			<view class="unit-head">
+				<text style="font-weight: bold;font-size: 26upx;">{{info.name}}</text>
+			</view>
+			<view class="unit-body">
+				<view style="display: flex;justify-content: center;align-items:center;">
+					<uni-icons type="settings" size="20"></uni-icons>
+					<text style="margin-left: 10upx;" >{{info.status}}</text>
+				</view>
+				
+				<text style="color: gray;">{{parseTime(info.startTime)}}</text>
+			</view>
+			<view class="unit-foot">
+				<text style="color: gray;">当前处理人</text>
+				<text style="font-weight: bold;">{{info.currentAuditUser.nickname}}</text>
+			</view>
 		</view>
-		<view class="unit-body">
-			<text v-for="(item,index) in unitModel1" :key="index" >{{item.label}}:<text v-if="item.isMoney" :class="item.class">¥ </text><text :class="item.class">暂无</text><text v-if="item.isMoney" :class="item.class"> 元</text></text>
+		<view v-else class='my-unit'>
+			<view class="unit-head">
+				<text style="font-weight: bold;font-size: 26upx;">{{info.processInstance.name}}</text>
+			</view>
+			<view class="unit-body">
+				<view style="display: flex;justify-content: center;align-items:center;">
+					<uni-icons type="settings" size="20"></uni-icons>
+					<text style="margin-left: 10upx;" >{{info.name}}</text>
+				</view>
+				<text style="color: gray;">{{parseTime(info.createTime)}}</text>
+			</view>
+			<view class="unit-foot">
+				<text style="color: gray;">发起人</text>
+				<text style="font-weight: bold;">{{info.processInstance.startUser.nickname}}</text>
+			</view>
 		</view>
-		<view class="unit-foot">
-			<text class="color-999">20190212</text>
-			<button class="fr btn" type="warn" @click="doDel">删除求购</button>
-		</view>
-    </view>
+	</view>
+    
 </template>
 	
 <script>
     export default{
+		props: {
+			info: {
+				type: Object
+			},
+			initIndex:{
+				type: Number
+			}
+		  },
         data() {
             return {
 				unitModel1:[
@@ -43,25 +75,27 @@
 </script>
 <style lang='scss'>
     .my-unit{
-		margin: 20upx 0;
+		margin: 20upx 10upx;
 		background-color: #ffffff;
 		font-size: 28upx;
 		transform: all 1s;
+		border-radius: 10upx;
+		box-shadow: rgba(0, 0, 0, 0.08) 0px 0px 3;
 		
 		.unit-head{
-			padding: 20upx;
-			height: 80upx;
+			padding: 20upx 20upx 10upx 20upx;
+			/* height: 80upx; */
 			box-sizing: border-box;
-			border-bottom: 2upx solid #f5f5f5;
+			/* border-bottom: 2upx solid #f5f5f5; */
 		}
 		.unit-body{
-			padding: 20upx;
+			padding: 0 20upx;
 			display: flex;
 			flex-wrap: wrap;
-			
+			justify-content: space-between;
+			align-items: center;
 			text{
-				width: 50%;
-				font-size: 28upx;
+				font-size: 20upx;
 				line-height: 55upx;
 			}
 		}
@@ -71,12 +105,10 @@
 			border-top: 2upx solid #f5f5f5;
 			border-bottom: none;
 			line-height: 88upx;
-			
-			.btn{
-				height: 60upx;
-				font-size: 28upx;
-				line-height: 60upx;
-				margin: 14upx 0;
+			display: flex;
+			flex-wrap: wrap;
+			text{
+				width: 30%;
 			}
 		}
 	}

+ 2 - 0
main.js

@@ -3,10 +3,12 @@ import App from './App'
 import store from './store' // store
 import plugins from './plugins' // plugins
 import './permission' // permission
+import { parseTime } from "@/utils/ruoyi";
 Vue.use(plugins)
 
 Vue.config.productionTip = false
 Vue.prototype.$store = store
+Vue.prototype.parseTime = parseTime
 
 App.mpType = 'app'
 

+ 198 - 0
pages/mine/index - 副本.vue

@@ -0,0 +1,198 @@
+<template>
+  <view class="mine-container" :style="{height: `${windowHeight}px`}">
+    <!--顶部个人信息栏-->
+    <view class="header-section">
+      <view class="flex padding justify-between">
+        <view class="flex align-center">
+          <view v-if="!avatar" class="cu-avatar xl round bg-white">
+            <view class="iconfont icon-people text-gray icon"></view>
+          </view>
+          <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
+          </image>
+          <view v-if="!name" @click="handleToLogin" class="login-tip">
+            点击登录
+          </view>
+          <view v-if="name" @click="handleToInfo" class="user-info">
+            <view class="u_title">
+              用户名:{{ name }}
+            </view>
+          </view>
+        </view>
+        <view @click="handleToInfo" class="flex align-center">
+          <text>个人信息</text>
+          <view class="iconfont icon-right"></view>
+        </view>
+      </view>
+    </view>
+
+    <view class="content-section">
+      <view class="mine-actions grid col-4 text-center">
+        <view class="action-item" @click="handleJiaoLiuQun">
+          <view class="iconfont icon-friendfill text-pink icon"></view>
+          <text class="text">交流群</text>
+        </view>
+        <view class="action-item" @click="handleBuilding">
+          <view class="iconfont icon-service text-blue icon"></view>
+          <text class="text">在线客服</text>
+        </view>
+        <view class="action-item" @click="handleBuilding">
+          <view class="iconfont icon-community text-mauve icon"></view>
+          <text class="text">反馈社区</text>
+        </view>
+        <view class="action-item" @click="handleBuilding">
+          <view class="iconfont icon-dianzan text-green icon"></view>
+          <text class="text">点赞我们</text>
+        </view>
+      </view>
+
+      <view class="menu-list">
+        <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
+          <view class="menu-item-box">
+            <view class="iconfont icon-user menu-icon"></view>
+            <view>编辑资料</view>
+          </view>
+        </view>
+        <view class="list-cell list-cell-arrow" @click="handleHelp">
+          <view class="menu-item-box">
+            <view class="iconfont icon-help menu-icon"></view>
+            <view>常见问题</view>
+          </view>
+        </view>
+        <view class="list-cell list-cell-arrow" @click="handleAbout">
+          <view class="menu-item-box">
+            <view class="iconfont icon-aixin menu-icon"></view>
+            <view>关于我们</view>
+          </view>
+        </view>
+        <view class="list-cell list-cell-arrow" @click="handleToSetting">
+          <view class="menu-item-box">
+            <view class="iconfont icon-setting menu-icon"></view>
+            <view>应用设置</view>
+          </view>
+        </view>
+      </view>
+
+    </view>
+  </view>
+</template>
+
+<script>
+  import storage from '@/utils/storage'
+
+  export default {
+    data() {
+      return {
+        name: this.$store.state.user.name,
+        version: getApp().globalData.config.appInfo.version
+      }
+    },
+    computed: {
+      avatar() {
+        return this.$store.state.user.avatar
+      },
+      windowHeight() {
+        return uni.getSystemInfoSync().windowHeight - 50
+      }
+    },
+    methods: {
+      handleToInfo() {
+        this.$tab.navigateTo('/pages/mine/info/index')
+      },
+      handleToEditInfo() {
+        this.$tab.navigateTo('/pages/mine/info/edit')
+      },
+      handleToSetting() {
+        this.$tab.navigateTo('/pages/mine/setting/index')
+      },
+      handleToLogin() {
+        this.$tab.reLaunch('/pages/login')
+      },
+      handleToAvatar() {
+        this.$tab.navigateTo('/pages/mine/avatar/index')
+      },
+      handleLogout() {
+        this.$modal.confirm('确定注销并退出系统吗?').then(() => {
+          this.$store.dispatch('LogOut').then(() => {
+            this.$tab.reLaunch('/pages/index')
+          })
+        })
+      },
+      handleHelp() {
+        this.$tab.navigateTo('/pages/mine/help/index')
+      },
+      handleAbout() {
+        this.$tab.navigateTo('/pages/mine/about/index')
+      },
+      handleJiaoLiuQun() {
+        this.$modal.showToast('微信搜索 naidaguo 后,添加好友后拉你进技术交流群')
+      },
+      handleBuilding() {
+        this.$modal.showToast('模块建设中~')
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+  page {
+    background-color: #f5f6f7;
+  }
+
+  .mine-container {
+    width: 100%;
+    height: 100%;
+
+
+    .header-section {
+      padding: 15px 15px 45px 15px;
+      background-color: #3c96f3;
+      color: white;
+
+      .login-tip {
+        font-size: 18px;
+        margin-left: 10px;
+      }
+
+      .cu-avatar {
+        border: 2px solid #eaeaea;
+
+        .icon {
+          font-size: 40px;
+        }
+      }
+
+      .user-info {
+        margin-left: 15px;
+
+        .u_title {
+          font-size: 18px;
+          line-height: 30px;
+        }
+      }
+    }
+
+    .content-section {
+      position: relative;
+      top: -50px;
+
+      .mine-actions {
+        margin: 15px 15px;
+        padding: 20px 0px;
+        border-radius: 8px;
+        background-color: white;
+
+        .action-item {
+          .icon {
+            font-size: 28px;
+          }
+
+          .text {
+            display: block;
+            font-size: 13px;
+            margin: 8px 0px;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 27 - 53
pages/mine/index.vue

@@ -3,71 +3,33 @@
     <!--顶部个人信息栏-->
     <view class="header-section">
       <view class="flex padding justify-between">
-        <view class="flex align-center">
-          <view v-if="!avatar" class="cu-avatar xl round bg-white">
-            <view class="iconfont icon-people text-gray icon"></view>
-          </view>
-          <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
+        <view class="flex">
+          <image :src="avatar" class="cu-avatar xl round" mode="widthFix">
           </image>
-          <view v-if="!name" @click="handleToLogin" class="login-tip">
-            点击登录
-          </view>
-          <view v-if="name" @click="handleToInfo" class="user-info">
-            <view class="u_title">
-              用户名:{{ name }}
+          <view class="user-info">
+            <view class="u_title text-bold">
+             {{ name }}
             </view>
+			<view class="sub_title">
+			  系统管理员
+			</view>
           </view>
         </view>
-        <view @click="handleToInfo" class="flex align-center">
-          <text>个人信息</text>
-          <view class="iconfont icon-right"></view>
-        </view>
       </view>
     </view>
 
     <view class="content-section">
-      <view class="mine-actions grid col-4 text-center">
-        <view class="action-item" @click="handleJiaoLiuQun">
-          <view class="iconfont icon-friendfill text-pink icon"></view>
-          <text class="text">交流群</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-service text-blue icon"></view>
-          <text class="text">在线客服</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-community text-mauve icon"></view>
-          <text class="text">反馈社区</text>
-        </view>
-        <view class="action-item" @click="handleBuilding">
-          <view class="iconfont icon-dianzan text-green icon"></view>
-          <text class="text">点赞我们</text>
-        </view>
-      </view>
-
       <view class="menu-list">
-        <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
-          <view class="menu-item-box">
-            <view class="iconfont icon-user menu-icon"></view>
-            <view>编辑资料</view>
-          </view>
-        </view>
         <view class="list-cell list-cell-arrow" @click="handleHelp">
           <view class="menu-item-box">
             <view class="iconfont icon-help menu-icon"></view>
-            <view>常见问题</view>
+            <view>帮助中心</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="handleAbout">
           <view class="menu-item-box">
             <view class="iconfont icon-aixin menu-icon"></view>
-            <view>关于我们</view>
-          </view>
-        </view>
-        <view class="list-cell list-cell-arrow" @click="handleToSetting">
-          <view class="menu-item-box">
-            <view class="iconfont icon-setting menu-icon"></view>
-            <view>应用设置</view>
+            <view>联系我们</view>
           </view>
         </view>
       </view>
@@ -144,9 +106,9 @@
 
 
     .header-section {
-      padding: 15px 15px 45px 15px;
-      background-color: #3c96f3;
-      color: white;
+      // padding: 15px 15px 45px 15px;
+      background-color: white;
+      // color: white;
 
       .login-tip {
         font-size: 18px;
@@ -163,17 +125,29 @@
 
       .user-info {
         margin-left: 15px;
-
+		display: flex;
         .u_title {
           font-size: 18px;
           line-height: 30px;
         }
+		.sub_title{
+			font-size: 12px;
+			height: 30px;
+			// line-height: 30px;
+			margin-left: 15px;
+			background-color: #f5f6f7;
+			padding: 5px 8px;
+			border-radius: 20px;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+		}
       }
     }
 
     .content-section {
       position: relative;
-      top: -50px;
+      // top: -50px;
 
       .mine-actions {
         margin: 15px 15px;

+ 28 - 5
pages/work/index.vue

@@ -2,11 +2,12 @@
 	<view class='purchase-list'>
 		<my-tabs @change="tapChange" :modelData="modelData" :initIndex="initIndex"></my-tabs>
 		<scroll-view class="purchase-body" scroll-y="true" @scrolltolower="scrolltolower" @scrolltoupper="scrolltoupper" @scroll="scroll" @touchstart="touchstart" @touchend="touchend">
-			<my-unit v-for="(item,index) in 10" :key="index" :info="item"></my-unit>
+			<my-unit v-for="(item,index) in listData" :key="index" :info="item" :initIndex="initIndex"></my-unit>
 		</scroll-view>
 	</view>
 </template>
 <script>
+	import { getTodoTaskPage, getDoneTaskPage,getMyProcessInstancePage } from "@/api/work/index"
 	import myTabs from '@/components/myTabs/myTabs.vue'
 	import myUnit from '@/components/myUnits/purchaseUnit/unit.vue'
 	import myPull from '@/static/js/myPull.js'
@@ -14,7 +15,8 @@
 		components:{myTabs,myUnit},
 		data() {
 			return {
-				
+				pageNo: 1,
+				pageSize: 10
 			}
 		},
 		onLoad(){
@@ -25,8 +27,27 @@
 			 * @name 获取列表
 			 */
 			getList(page,done){
-				 console.log(`获取第${page}页数据`);
-				 done([1])
+				console.log(`获取第${page}页数据`);
+				if(this.initIndex==0){
+					getTodoTaskPage({pageNo:page,pageSize: this.pageSize}).then(response => {
+						let list = response.data.list;
+						done(list);
+					});
+				}
+				if(this.initIndex==1){
+					getDoneTaskPage({pageNo:page,pageSize: this.pageSize}).then(response => {
+						let list = response.data.list;
+						done(list);
+					});
+				}
+				if(this.initIndex==2){
+					getMyProcessInstancePage({pageNo:page,pageSize: this.pageSize}).then(response => {
+						let list = response.data.list;
+						done(list);
+					});
+				}
+				 
+				
 			},
 			
 			/**
@@ -51,7 +72,9 @@
 			 * @param val 索引
 			 */
 			tapChange(val){
-				this.initIndex=val
+				this.initIndex=val;
+				this.page = 1;
+				this.getList(this.page,this.__pulldone)
 			}
 		},
 		mixins:[myPull({})],

+ 3 - 3
static/js/myPull.js

@@ -14,9 +14,9 @@ export default({getList="getList",listData="listData",page="page",initIndex="ini
 				[page]:1,
 				[initIndex]:0,
 				[modelData]:[
-					{label:"测试"},
-					{label:"测试"},
-					{label:"测试"},
+					{label:"我的代办"},
+					{label:"我处理的"},
+					{label:"我发起的"},
 				]
 			}
 		},

+ 1 - 1
static/scss/global.scss

@@ -68,7 +68,7 @@
   
   
   .menu-list {
-    margin: 15px 15px;
+    margin: 15px 0px;
   
     .menu-item-box {
       width: 100%;