<template>
	<view>
		<form @submit="formSubmit" @reset="formReset">
			<input type="hidden" style="width: 0;height: 0;display: none;" class="" name="id" :value=id />
			<view class="tr">
				<view class="td-left">
					用户名称:
				</view>
				<view class="td-right">
					<input type="text" class="input" name="workName" :value=workName />
				</view>
			</view>
			<view class="bomtom" >
				<button type="primary" formType="submit" >
					<p class="p1">提交</p>
				</button>
			</view>
		</form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: null,
				workName: null
			}
		},
		onLoad: function(option) {
			this.id = option.id;
			this.workName = option.workName;
			console.log(this.workName);
		},
		methods: {
			formSubmit(event) {
				var that = this;
				var weixin = event.detail.value;
				var serverUrl = that.serverurl;
				var token = uni.getStorageSync("token");
				var id = weixin.id;
				var workName = weixin.workName;
				if(workName==null||workName==''){
					return ;
				}
				uni.request({
					url: serverUrl + "/TWeixin/updateWeixin?id=" + id + "&workName=" + workName,
					method: "POST",
					header: {
						'token': token
					},
					success: (Result) => {
						var res = Result;
						uni.showModal({
							title: '提示',
							content: res.data.message,
						});
					}
				});
			}
		}
	}
</script>

<style>
	.tr {
		padding-top: 15upx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		font-size: 26upx;
		font-family: "PingFang-SC-Bold";
	}

	.td-left {
		font-family: "PingFang-SC-Bold";
		/* font-weight: bold; */
		margin: auto;
		font-size: 40upx;
		width: 30%;
		text-align: right;
	}

	.td-right {
		font-family: "PingFang-SC-Bold";
		/* font-weight: bold; */
		margin: auto;
		font-size: 40upx;
		width: 65%;
		text-align: left;
	}

	.button {
		margin: auto;
		width: 60%;
		height: 100upx;
	}

	.input {
		/* padding: 10upx 20upx 10upx 0upx; */
		padding-left: 20upx;
		padding-top: 10upx;
		background-color: #FFFFFF;
		width: 450upx;
		height: 50upx;
		box-shadow: 0upx 0upx 20upx #D3D3D3;
		border-radius: 5upx;
	}

	.p1 {
		height: 80upx;
		font-family: "PingFang-SC-Bold";
		font-weight: bold;
		margin: auto;
		font-size: 40upx;
		color: #363D44;
	}

	.bomtom {
		position: absolute;
		bottom: 0;
		left: 50%;
		transform: translate(-50%, 0%);
		padding-bottom: 40upx;
	}
</style>
