lsw преди 1 година
родител
ревизия
2065cfb131
променени са 4 файла, в които са добавени 353 реда и са изтрити 101 реда
  1. 0 9
      app/package.json
  2. 1 1
      app/pages.json
  3. 96 91
      app/pages/index/index.vue
  4. 256 0
      app/pages/index/index2.vue

+ 0 - 9
app/package.json

@@ -1,9 +0,0 @@
-{
-    "id": "sin-signature",
-    "name": "签名组件-兼容H5、小程序、APP",
-    "version": "1.0.0",
-    "description": "用于uni-app的签名组件,支持H5、小程序、APP,可导出svg矢量图片。",
-    "keywords": [
-        "签名,签字,svg,canvas"
-    ]
-}

+ 1 - 1
app/pages.json

@@ -74,7 +74,7 @@
 				"pagePath": "pages/packages/index",
 				"iconPath": "static/tab/jb.png",
 				"selectedIconPath": "static/tab/jb_s.png",
-				"text": "接包"
+				"text": "承揽广场"
 			},
 			{
 				"pagePath": "pages/user/index",

+ 96 - 91
app/pages/index/index.vue

@@ -9,67 +9,69 @@
 			<u-notice-bar color="#848484" :text="noticeList" :step="true" direction="column" mode="link" bgColor="white" speed="300" url="/pages/notice/index"></u-notice-bar>
 		</view>
 		<view class="flow">
-			<view class="title">操作流程</view>
 			<!--实名认证-->
 			<view class="item" @click="go('auth')">
-				<view class="icon tb">&#xe600;</view>
-				<view class="con">
-					<view class="bt">实名认证</view>
-					<view class="bor" style="background: linear-gradient(to right, rgb(198 187 250), rgb(251 251 251))"></view>
-					<view class="zt">{{ !user.isAuthentication || user.isAuthentication == 0 ? '尚未提交资料' : '已提交资料' }}</view>
-				</view>
-				<view class="state" v-if="user.isAuthentication === 1">
-					<text class="zt">已认证</text>
-					<text class="icon">&#xe62b;</text>
-				</view>
-				<view class="state" v-else>
-					<view class="go">去认证</view>
+				<view class="out">
+					<view class="int">
+						<view class="icon tb" style="color: rgb(72, 154, 253)">&#xe600;</view>
+						<view class="con">
+							<view class="bt">实名认证</view>
+							<view class="zt">{{ !user.isAuthentication || user.isAuthentication == 0 ? '尚未提交资料' : '已认证' }}</view>
+						</view>
+						<view class="state" v-if="!user.isAuthentication || user.isAuthentication === 0">
+							<view class="go">去认证</view>
+						</view>
+					</view>
 				</view>
 			</view>
 			<!--关联企业-->
 			<view class="item" @click="go('company')">
-				<view class="icon tb">&#xe623;</view>
-				<view class="con">
-					<view class="bt">关联企业</view>
-					<view class="bor" style="background: linear-gradient(to right, #eecce0, rgb(253 253 253))"></view>
-					<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '尚未关联企业' : '已完成' }}</view>
-				</view>
-				<view class="state" v-if="user.isCompany > 0">
-					<text class="zt">{{ user.isCompany }}家</text>
-					<text class="icon">&#xe62b;</text>
-				</view>
-				<view class="state" v-else>
-					<view class="go" :style="{ backgroundColor: user.isAuthentication === 1 ? '#5a7afc' : '#d6d6d6' }">去关联</view>
+				<view class="out">
+					<view class="int">
+						<view class="icon tb" style="color: rgb(250, 178, 46)">&#xe623;</view>
+						<view class="con">
+							<view class="bt">关联企业</view>
+							<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '尚未关联企业' : '已关联' }} {{ user.isCompany > 0 ? user.isCompany + '家' : '' }}</view>
+						</view>
+						<view class="state" v-if="!user.isCompany || user.isCompany == 0">
+							<view class="go" :style="{ backgroundColor: user.isAuthentication === 1 ? '#5a7afc' : '#d6d6d6' }">去关联</view>
+						</view>
+					</view>
 				</view>
 			</view>
 			<!--电子签约-->
 			<view class="item" @click="go('contract')">
-				<view class="icon tb">&#xe6ed;</view>
-				<view class="con">
-					<view class="bt">电子签约</view>
-					<view class="bor" style="background: linear-gradient(to right, #f6f6bf, rgb(246 246 246))"></view>
-					<view class="zt">{{ !user.isContract || user.isContract == 0 ? '尚未签约' : '已签约' }}</view>
-				</view>
-				<view class="state">
-					<view class="go" :style="{ backgroundColor: user.isCompany > 0 ? '#5a7afc' : '#d6d6d6' }" v-if="!user.isContract || user.isContract == 0">去签约</view>
-					<text class="icon" v-if="user.isContract == 1">&#xe62b;</text>
+				<view class="out">
+					<view class="int">
+						<view class="icon tb" style="color: rgb(255, 87, 34)">&#xe6ed;</view>
+						<view class="con">
+							<view class="bt">电子签约</view>
+							<view class="zt">{{ !user.isContract || user.isContract == 0 ? '尚未签约' : '已签约' }}</view>
+						</view>
+						<view class="state">
+							<view class="go" :style="{ backgroundColor: user.isCompany > 0 ? '#5a7afc' : '#d6d6d6' }" v-if="!user.isContract || user.isContract == 0">去签约</view>
+						</view>
+					</view>
 				</view>
 			</view>
 			<!--开始接包-->
 			<view class="item" @click="go('packages')">
-				<view class="icon tb">&#xe604;</view>
-				<view class="con">
-					<view class="bt">开始接包</view>
-					<view class="bor" style="background: linear-gradient(to right, #c9f1d4, rgb(250 255 252))"></view>
-					<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '请先完成上一步' : '去接包' }}</view>
-				</view>
-				<view class="state">
-					<view class="go" :style="{ backgroundColor: user.isCompany > 0 && user.isContract == 1 ? '#5a7afc' : '#d6d6d6' }">去接包</view>
+				<view class="out">
+					<view class="int">
+						<view class="icon tb" style="color: rgb(250, 83, 118)">&#xe604;</view>
+						<view class="con">
+							<view class="bt">开始接包</view>
+							<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '请先签约' : '去接包' }}</view>
+						</view>
+						<view class="state">
+							<view class="go" :style="{ backgroundColor: user.isCompany > 0 && user.isContract == 1 ? '#5a7afc' : '#d6d6d6' }" v-if="!user.isCompany || user.isCompany == 0 || user.isContract == 0">去接包</view>
+						</view>
+					</view>
 				</view>
 			</view>
 		</view>
 		<u-action-sheet round="20" :actions="actions" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
-		<signature ref="sig" @sign="sign" v-if=""></signature>
+		<signature ref="sig" @sign="sign"></signature>
 	</view>
 </template>
 <script>
@@ -192,63 +194,66 @@ export default {
 }
 .notice {
 	margin-top: 10px;
+	margin-bottom: -10px;
 }
 .flow {
 	padding-top: 20px;
 	.title {
 		font-size: 15px;
+		margin-bottom: 10px;
 	}
 	.item {
-		background-color: white;
 		border-radius: 10px;
-		padding: 18px;
 		overflow: hidden;
-		margin-top: 12px;
-		.tb {
-			float: left;
-			padding: 13px;
-			border: 1px solid $main-color;
-			color: $main-color;
-			border-radius: 50%;
-			font-size: 23px;
-		}
-		.con {
-			float: left;
-			padding-left: 20px;
-
-			.bt {
-				font-size: 18px;
-			}
-			.bor {
-				background-color: red;
-				border-radius: 20px;
-				height: 9px;
-				margin-top: -9px;
-				width: 105px;
-				margin-left: -5px;
-			}
-			.zt {
-				font-size: 13px;
-				padding-top: 5px;
-				color: #909090;
-			}
-		}
-		.state {
-			float: right;
-			padding-top: 11px;
-			.zt {
-				font-size: 13px;
-				color: $main-color;
-			}
-			.icon {
-				color: #909090;
-			}
-			.go {
-				padding: 5px 12px;
-				font-size: 14px;
-				background-color: #5a7afc;
-				color: white;
-				border-radius: 20px;
+		float: left;
+		width: 50%;
+		.out {
+			padding: 5px;
+			.int {
+				padding: 15px;
+				background-color: white;
+				overflow: hidden;
+				border-radius: 9px;
+				text-align: center;
+				.tb {
+					margin: 0 auto;
+					width: 40px;
+					height: 40px;
+					padding: 10px;
+					line-height: 39px;
+					color: $main-color;
+					box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+					border-radius: 50%;
+					font-size: 27px;
+				}
+				.con {
+					padding-top: 8px;
+					.bt {
+						font-size: 18px;
+					}
+					.zt {
+						font-size: 13px;
+						padding-top: 5px;
+						color: #909090;
+					}
+				}
+				.state {
+					padding-top: 11px;
+					.zt {
+						font-size: 13px;
+						color: $main-color;
+					}
+					.icon {
+						color: #909090;
+					}
+					.go {
+						padding: 5px 12px;
+						font-size: 14px;
+						background-color: #5a7afc;
+						color: white;
+						border-radius: 20px;
+					}
+				}
 			}
 		}
 	}

+ 256 - 0
app/pages/index/index2.vue

@@ -0,0 +1,256 @@
+<template>
+	<view class="main">
+		<!--轮播图-->
+		<view class="banner">
+			<u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="150" class="uni-swiper" @click="click"></u-swiper>
+		</view>
+		<!--通知公告-->
+		<view class="notice">
+			<u-notice-bar color="#848484" :text="noticeList" :step="true" direction="column" mode="link" bgColor="white" speed="300" url="/pages/notice/index"></u-notice-bar>
+		</view>
+		<view class="flow">
+			<view class="title">操作流程</view>
+			<!--实名认证-->
+			<view class="item" @click="go('auth')">
+				<view class="icon tb">&#xe600;</view>
+				<view class="con">
+					<view class="bt">实名认证</view>
+					<view class="bor" style="background: linear-gradient(to right, rgb(198 187 250), rgb(251 251 251))"></view>
+					<view class="zt">{{ !user.isAuthentication || user.isAuthentication == 0 ? '尚未提交资料' : '已提交资料' }}</view>
+				</view>
+				<view class="state" v-if="user.isAuthentication === 1">
+					<text class="zt">已认证</text>
+					<text class="icon">&#xe62b;</text>
+				</view>
+				<view class="state" v-else>
+					<view class="go">去认证</view>
+				</view>
+			</view>
+			<!--关联企业-->
+			<view class="item" @click="go('company')">
+				<view class="icon tb">&#xe623;</view>
+				<view class="con">
+					<view class="bt">关联企业</view>
+					<view class="bor" style="background: linear-gradient(to right, #eecce0, rgb(253 253 253))"></view>
+					<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '尚未关联企业' : '已完成' }}</view>
+				</view>
+				<view class="state" v-if="user.isCompany > 0">
+					<text class="zt">{{ user.isCompany }}家</text>
+					<text class="icon">&#xe62b;</text>
+				</view>
+				<view class="state" v-else>
+					<view class="go" :style="{ backgroundColor: user.isAuthentication === 1 ? '#5a7afc' : '#d6d6d6' }">去关联</view>
+				</view>
+			</view>
+			<!--电子签约-->
+			<view class="item" @click="go('contract')">
+				<view class="icon tb">&#xe6ed;</view>
+				<view class="con">
+					<view class="bt">电子签约</view>
+					<view class="bor" style="background: linear-gradient(to right, #f6f6bf, rgb(246 246 246))"></view>
+					<view class="zt">{{ !user.isContract || user.isContract == 0 ? '尚未签约' : '已签约' }}</view>
+				</view>
+				<view class="state">
+					<view class="go" :style="{ backgroundColor: user.isCompany > 0 ? '#5a7afc' : '#d6d6d6' }" v-if="!user.isContract || user.isContract == 0">去签约</view>
+					<text class="icon" v-if="user.isContract == 1">&#xe62b;</text>
+				</view>
+			</view>
+			<!--开始接包-->
+			<view class="item" @click="go('packages')">
+				<view class="icon tb">&#xe604;</view>
+				<view class="con">
+					<view class="bt">开始接包</view>
+					<view class="bor" style="background: linear-gradient(to right, #c9f1d4, rgb(250 255 252))"></view>
+					<view class="zt">{{ !user.isCompany || user.isCompany == 0 ? '请先完成上一步' : '去接包' }}</view>
+				</view>
+				<view class="state">
+					<view class="go" :style="{ backgroundColor: user.isCompany > 0 && user.isContract == 1 ? '#5a7afc' : '#d6d6d6' }">去接包</view>
+				</view>
+			</view>
+		</view>
+		<u-action-sheet round="20" :actions="actions" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
+		<signature ref="sig" @sign="sign" v-if=""></signature>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			ip: this.http.ip,
+			user: {},
+			bannerList: [],
+			noticeList: [],
+			contract: {},
+			show: false,
+			actions: [{ name: '查看合同' }, { name: '去签字' }]
+		};
+	},
+	onShow() {
+		if (this.hasLogin()) {
+			this.getUserInfo();
+		}
+	},
+	onLoad() {
+		this.getData();
+	},
+	methods: {
+		getUserInfo() {
+			this.http.request({
+				url: '/app/user/info',
+				success: (res) => {
+					this.user = res.data.data;
+				}
+			});
+		},
+		getData() {
+			this.http.request({
+				url: '/app/home/index',
+				success: (res) => {
+					this.contract = res.data.data.contract;
+					this.bannerList = res.data.data.bannerList;
+					res.data.data.noticeList.forEach((item) => {
+						this.noticeList.push(item.title);
+					});
+				}
+			});
+		},
+		go(url) {
+			if (this.hasLogin()) {
+				if (url == 'auth') {
+					uni.navigateTo({ url: '/pages/auth/index' });
+				}
+				if (url == 'company' && this.user.isAuthentication === 1) {
+					uni.navigateTo({ url: '/pages/company/index' });
+				}
+				if (url == 'packages' && this.user.isCompany > 0 && this.user.isContract == 1) {
+					uni.switchTab({ url: '/pages/packages/index' });
+				}
+				if (url == 'contract' && this.user.isContract == 1) {
+					this.look();
+				}
+				if (url == 'contract' && this.user.isContract == 0) {
+					this.show = true;
+				}
+			} else {
+				uni.navigateTo({ url: '/pages/user/login' });
+			}
+		},
+		selectClick(e) {
+			if (e.name == '查看合同') {
+				this.look();
+			} else {
+				this.$refs.sig.getSyncSignature();
+			}
+		},
+		//查看合同
+		look() {
+			uni.showLoading({ title: '正在打开合同...', mask: true });
+			uni.downloadFile({
+				url: this.user.isContract == 0 ? this.ip + this.contract.url : this.ip + '/app/contract/look',
+				header: { Authorization: this.getUser().token },
+				success: (res) => {
+					uni.openDocument({
+						filePath: res.tempFilePath,
+						showMenu: true,
+						success: (res) => {
+							uni.hideLoading();
+						}
+					});
+				},
+				fail: (res) => {
+					uni.hideLoading();
+				}
+			});
+		},
+		//电子签名
+		sign(val) {
+			this.http.request({
+				url: '/app/contract/add',
+				data: { contractId: this.contract.id, url: val },
+				method: 'POST',
+				success: (res) => {
+					uni.showModal({
+						title: '提示',
+						content: '签约成功',
+						showCancel: false,
+						success: (res) => {
+							this.getUserInfo();
+						}
+					});
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.main {
+	padding: 5px 15px 15px 15px;
+}
+.banner {
+}
+.notice {
+	margin-top: 10px;
+}
+.flow {
+	padding-top: 20px;
+	.title {
+		font-size: 15px;
+	}
+	.item {
+		background-color: white;
+		border-radius: 10px;
+		padding: 18px;
+		overflow: hidden;
+		margin-top: 12px;
+		.tb {
+			float: left;
+			padding: 13px;
+			border: 1px solid $main-color;
+			color: $main-color;
+			border-radius: 50%;
+			font-size: 23px;
+		}
+		.con {
+			float: left;
+			padding-left: 20px;
+
+			.bt {
+				font-size: 18px;
+			}
+			.bor {
+				background-color: red;
+				border-radius: 20px;
+				height: 9px;
+				margin-top: -9px;
+				width: 105px;
+				margin-left: -5px;
+			}
+			.zt {
+				font-size: 13px;
+				padding-top: 5px;
+				color: #909090;
+			}
+		}
+		.state {
+			float: right;
+			padding-top: 11px;
+			.zt {
+				font-size: 13px;
+				color: $main-color;
+			}
+			.icon {
+				color: #909090;
+			}
+			.go {
+				padding: 5px 12px;
+				font-size: 14px;
+				background-color: #5a7afc;
+				color: white;
+				border-radius: 20px;
+			}
+		}
+	}
+}
+</style>