xiaohaizhao 3 hónapja
szülő
commit
8601a46ca1

+ 11 - 0
pages/login/modules/account.js

@@ -10,9 +10,11 @@ Component({
 	data: {
 		accountno: "",
 		password: "",
+		imagecaptcha: "",
 		inputType: "password", //密码输入框类型
 		memory: true, //记忆
 		focus: false,
+		timestamp: ""
 	},
 	lifetimes: {
 		attached: function () {
@@ -23,9 +25,17 @@ Component({
 			setTimeout(() => {
 				this.allowOrNot();
 			}, 300)
+			this.setData({
+				timestamp: new Date().getTime()
+			})
 		}
 	},
 	methods: {
+		changeTimestamp() {
+			this.setData({
+				timestamp: new Date().getTime()
+			})
+		},
 		/* input输入 */
 		inputChange(e) {
 			this.setData({
@@ -56,6 +66,7 @@ Component({
 			_Http.login({
 				"accountno": this.data.accountno,
 				"password": md5.hexMD5(this.data.password),
+				"imagecaptcha": this.data.imagecaptcha || '',
 				"systemclient": "wechatsaletool"
 			}).then(res => {
 				getCurrentPages()[0].setData({

+ 15 - 0
pages/login/modules/account.scss

@@ -29,4 +29,19 @@
         font-size: 24rpx;
         color: #999999;
     }
+}
+
+.checkCode {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 10rpx 30rpx;
+
+    .label {
+        font-size: 26rpx;
+    }
+
+    .image1 {
+        width: 160rpx;
+    }
 }

+ 5 - 0
pages/login/modules/account.wxml

@@ -10,6 +10,11 @@
         <image class="image" src="{{inputType=='password'?'/static/image/dp-none.svg':'/static/image/dp-show.svg'}}" />
     </view>
 </van-cell>
+<view class="checkCode" wx:if="{{timestamp}}">
+    <view class="label">验证码</view>
+    <input class="input" bindinput="inputChange" data-name="imagecaptcha" value="{{imagecaptcha}}" placeholder="请输入验证码" />
+    <image class="image1" src="http://61.164.207.46:8300/yos/rest/index/imagecaptcha?timestamp={{timestamp}}" bind:tap="changeTimestamp" mode="widthFix" />
+</view>
 <view class="box">
     <van-checkbox custom-class='checkbox' label-class='label' icon-size="28rpx" value="{{ memory }}" shape="square" bind:change="isMemory">
         记住密码