浏览代码

企业列表接口;首页页面部分;

sinea17 1 年之前
父节点
当前提交
d5290e6550

+ 5 - 0
api/enterprise.js

@@ -7,6 +7,11 @@ const enterpriseService = {
 	addEnterprise: params => request.post('/company/add', {
 		...params,
 		openid
+	}),
+	// 获取绑定企业列表
+	getEnterpriseList: (pageSize = 100) => request.get('/company/list', {
+		pageSize,
+		openid
 	})
 }
 

+ 16 - 1
pages.json

@@ -246,7 +246,8 @@
 		{
 			"path": "pages/self/enterprise/index",
 			"style": {
-				"navigationBarTitleText": "我的企业"
+				"navigationBarTitleText": "我的企业",
+				"enablePullDownRefresh": true
 			}
 		},
 		{
@@ -268,6 +269,20 @@
 			{
 				"navigationBarTitleText" : "社区活动"
 			}
+		},
+		{
+			"path" : "pages/index/product/index",
+			"style" : 
+			{
+				"navigationBarTitleText" : "服务详情"
+			}
+		},
+		{
+			"path" : "pages/index/product/category",
+			"style" : 
+			{
+				"navigationBarTitleText" : "企业服务"
+			}
 		}
 	],
 	"globalStyle": {

+ 61 - 18
pages/index/index.vue

@@ -1,32 +1,75 @@
 <template>
-  <view class="content">
-     首页
-  </view>
+  <view class="page-wrap">
+    <image class="banner banner-1" src="../../static/img_banner_1.jpg" mode="aspectFill"></image>
+		<view class="category-panel">
+			
+		</view>
+		<image class="banner banner-2" src="../../static/img_banner_2.jpg" mode="aspectFill"></image>
+		<view class="title-row">
+			<view class="line"></view>
+			<view class="point"></view>
+			<view class="title">热门服务</view>
+			<view class="point"></view>
+			<view class="line"></view>
+		</view>
+		<view class="product-panel">
+			<view class="item" v-for="(item,index) in [1,2,3,4,5]" :key="index">
+				
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
-import md5 from "@/common/md5.js";
 export default {
-	components: {
-	},
   data() {
     return {
 
     };
-  },
-  onLoad() {
-
-  },
-  onShow() {
-  },
-  methods: {
-
-  },
+  }
 };
 </script>
 
 <style lang="scss" scoped>
-.content {
- 
- }
+.banner{
+	width: 100%;
+	display: block;
+	margin-bottom: 13.74rpx;
+	&-1{
+		height: 391.48rpx;
+	}
+	&-2{
+		height: 171.7rpx;
+	}
+}
+.category-panel{
+	height: 412.09rpx;
+	background: #fff;
+	margin-bottom: 13.74rpx;
+}
+.title-row {
+	height: 82.42rpx;
+	box-sizing: border-box;
+	border-bottom: 1rpx solid #e0e0e0;
+	background: #fff;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	.line {
+		width: 42.58rpx;
+		height: 1rpx;
+		background: #ccc;
+		margin: 0 5.49rpx;
+	}
+	.point {
+		width: 8.24rpx;
+		height: 8.24rpx;
+		border-radius: 50%;
+		background: #ccc;
+	}
+	.title {
+		font-size: 30.22rpx;
+		padding: 0 13.74rpx;
+	}
+}
 </style>

+ 22 - 0
pages/index/product/category.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 22 - 0
pages/index/product/index.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 16 - 7
pages/self/enterprise/components/BaseInfo.vue

@@ -7,23 +7,23 @@
 		</view>
 		<view class="row">
 			<view class="label">企业全称</view>
-			<input class="text" type="text" placeholder="必填" placeholder-class="gray" v-model="form.customerName" />
+			<input class="text" type="text" placeholder="必填" placeholder-class="gray" v-model="form.customerName" maxlength="40"/>
 		</view>
 		<view class="row">
 			<view class="label">企业简称</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.customerTitle" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.customerTitle" maxlength="30"/>
 		</view>
 		<view class="row">
 			<view class="label">统一信用代码</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.customerUsci" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.customerUsci" maxlength="18"/>
 		</view>
 		<view class="row">
 			<view class="label">注册资本</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.capital" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.capital" maxlength="12"/>
 		</view>
 		<view class="row no-border">
 			<view class="label">注册地址</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.address" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.address" maxlength="40"/>
 		</view>
 		<view class="space"></view>
 		<picker :range="companyTypeList" range-key="dictLabel" @change="onCompanyTypePickerChange">
@@ -64,7 +64,7 @@
 		<view class="space"></view>
 		<view class="row">
 			<view class="label">联系人</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.contact" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.contact" maxlength="20"/>
 		</view>
 		<view class="row">
 			<view class="label">联系电话</view>
@@ -72,7 +72,7 @@
 		</view>
 		<view class="row">
 			<view class="label">电子件接收邮箱</view>
-			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.email" />
+			<input class="text" type="text" placeholder="选填" placeholder-class="gray" v-model="form.email" maxlength="20"/>
 		</view>
 	</view>
 </template>
@@ -82,6 +82,7 @@ import systemService from '@/api/system.js';
 import enterpriseService from '@/api/enterprise.js';
 import { filterDict } from '@/utils/util.js';
 export default {
+	props: ['enterpriseId'],
 	data() {
 		return {
 			form: {
@@ -108,14 +109,22 @@ export default {
 	created() {
 		this.getOptionsConfig();
 	},
+	mounted(){
+		if(this.enterpriseId) this.getEnterpriseInfo()
+	},
 	beforeDestroy() {
 		this.updateEnterpriseInfo();
 	},
 	methods: {
+		// 获取企业资料
+		async getEnterpriseInfo(){
+			console.log('获取企业资料')
+		},
 		// 修改企业资料
 		async updateEnterpriseInfo() {
 			if(!this.form.customerName) return
 			await enterpriseService.addEnterprise(this.form);
+			uni.$emit('onUpdateEnterprise')
 		},
 		// 获取选项配置
 		async getOptionsConfig() {

+ 43 - 35
pages/self/enterprise/index.vue

@@ -1,33 +1,13 @@
 <template>
 	<view class="page-wrap">
-		<view class="item-row">
+		<view class="item-row" v-for="(item, index) in enterpriseList" :key="index">
 			<view class="wrap">
-				<view class="name">天津超易达胜科技发展有限公司</view>
-				<view class="text">信用代码:911201033006420997</view>
-				<view class="text">企业认证:已认证</view>
-				<view class="text">团队成员:3人</view>
+				<view class="name">{{ item.customerName }}</view>
+				<view class="text">信用代码:{{ item.customerUsci || '--' }}</view>
+				<view class="text">企业认证:{{ item.status }}</view>
+				<view class="text">团队成员:{{ item.staffSize ? filterDict(item.staffSize, companySizeList) : '--' }}</view>
 			</view>
-			<button class="btn" @click="handleOpenInfo">企业资料</button>
-			<button class="btn">删除</button>
-		</view>
-		<view class="item-row">
-			<view class="wrap">
-				<view class="name">天津超易达胜科技发展有限公司</view>
-				<view class="text">信用代码:911201033006420997</view>
-				<view class="text">企业认证:已认证</view>
-				<view class="text">团队成员:3人</view>
-			</view>
-			<button class="btn">企业资料</button>
-			<button class="btn">删除</button>
-		</view>
-		<view class="item-row">
-			<view class="wrap">
-				<view class="name">天津超易达胜科技发展有限公司</view>
-				<view class="text">信用代码:911201033006420997</view>
-				<view class="text">企业认证:已认证</view>
-				<view class="text">团队成员:3人</view>
-			</view>
-			<button class="btn">企业资料</button>
+			<button class="btn" @click="handleOpenInfo(item.customerId)">企业资料</button>
 			<button class="btn">删除</button>
 		</view>
 		<button class="add-btn" @click="handleOpenAddEnterprise">+ 添加企业</button>
@@ -35,28 +15,56 @@
 </template>
 
 <script>
+import systemService from '@/api/system.js';
+import enterpriseService from '@/api/enterprise.js';
+import { filterDict } from '@/utils/util.js';
 export default {
 	data() {
-		return {};
+		return {
+			enterpriseList: [],
+			companySizeList: []
+		};
+	},
+	onLoad() {
+		this.getSizeConfig();
+		this.getEnterpriseList();
+		uni.$on('onUpdateEnterprise', () => {
+			this.getEnterpriseList();
+		});
+	},
+	onPullDownRefresh(){
+		this.getEnterpriseList()
 	},
 	methods: {
-		handleOpenInfo(){
+		// 获取企业列表
+		async getEnterpriseList() {
+			const { rows } = await enterpriseService.getEnterpriseList();
+			this.enterpriseList = rows;
+			uni.stopPullDownRefresh();
+		},
+		// 获取企业人员规模配置
+		async getSizeConfig() {
+			const { rows: companySizeList } = await systemService.getDict('biz_company_size');
+			this.companySizeList = companySizeList;
+		},
+		handleOpenInfo(id) {
 			uni.navigateTo({
-				url: 'info?id=1'
-			})
+				url: 'info?id=' + id
+			});
 		},
-		handleOpenAddEnterprise(){
+		handleOpenAddEnterprise() {
 			uni.navigateTo({
-				url: 'info',
-			})
-		}
+				url: 'info'
+			});
+		},
+		filterDict
 	}
 };
 </script>
 
 <style lang="scss" scoped>
 .page-wrap {
-	padding-top: 13.74rpx;
+	padding: 13.74rpx 0;
 }
 .item-row {
 	background: #fff;

+ 1 - 1
pages/self/enterprise/info.vue

@@ -8,7 +8,7 @@
 			</view>
 		</view>
 		<!-- 基础资料 -->
-		<BaseInfo v-show="tabActive === 1" />
+		<BaseInfo v-show="tabActive === 1" :enterpriseId="enterpriseId"/>
 		<!-- 资金账户 -->
 		<view v-if="tabActive === 2" class="info-panel">
 			<view class="title">银行公户</view>

二进制
static/img_banner_1.jpg


二进制
static/img_banner_2.jpg