Explorar el Código

完成意见反馈

sslyg hace 3 años
padre
commit
722f149eba

+ 42 - 11
App.vue

@@ -8,7 +8,7 @@
 		onLaunch: function() {
 			console.log('App Launch')
 			// #ifdef APP-PLUS
-			// this.checkUpdate();
+			this.checkUpdate();
 			// #endif
 
 			const value = uni.getStorageSync('launchFlag');
@@ -18,22 +18,49 @@
 					url: '/pages/index/index'
 				});
 			}
-			this.$on("login", () => {
-				if(this.$store.state.user.group_id === 2){
+			uni.$on("login", () => {
+				if (this.$store.state.user.group_id === 2) {
+					let iconIndex = 2
+					// #ifdef H5
+					iconIndex = 3
+					// #endif
 					uni.setTabBarItem({
-					  index: 3,
-					  text: '我的商品',
-					  pagePath:'/pages/product/my-product-tabbar'
+						index: iconIndex,
+						text: '我的商品',
+						pagePath: '/pages/product/my-product-tabbar',
+						iconPath: "static/images/kan.png",
+						selectedIconPath: "static/images/kan_selected.png",
 					})
+				} else {
+					let iconIndex = 2
+					// #ifdef H5
+					iconIndex = 3
+					// #endif
+					uni.setTabBarItem({
+						index: iconIndex,
+						text: '购物车',
+						pagePath: '/pages/shopping-cart/shopping-cart',
+						iconPath: "static/images/kan.png",
+						selectedIconPath: "static/images/kan_selected.png",
+					})
+
 				}
+			});
+			uni.onTabBarMidButtonTap(() => {
+				uni.chooseImage({
+					count: 1,
+					sourceType: ['camera']
+				})
+
 			})
+
 		},
 		onShow: function() {
 			console.log('App Show')
 			this.$store.commit("user/load")
 			this.$store.dispatch("cart/load");
-			
-						this.$emit("login");
+
+			uni.$emit("login");
 		},
 		onHide: function() {
 			console.log('App Hide')
@@ -46,18 +73,18 @@
 
 						let temp = [];
 						let last_version = res.data.data.versionName.substring(1);
-						temp = last_version.substring(1).split(".");
+						temp = last_version.split(".");
 						let last_version_code = parseInt(temp[0]) * 10000 + parseInt(temp[1]) * 100 + parseInt(
 							temp[2]);
 
 						let cur_version = plus.runtime.version;
-						temp = cur_version.substring(1).split(".");
+						temp = cur_version.split(".");
 						let cur_version_code = parseInt(temp[0]) * 10000 + parseInt(temp[1]) * 100 + parseInt(
 							temp[2]);
 
 						console.log(`最新版本:${last_version} 当前版本${cur_version}`)
 						// uni.showModal({
-						// 	content:`最新版本:${last_version} 当前版本${cur_version} 当前环境 ${process.env.NODE_ENV}`
+						// 	content:`${最新版本:${last_version} ${last_version_code} 当前版本${cur_version} ${cur_version_code} 当前环境 ${process.env.NODE_ENV}`
 						// })
 						if (last_version_code > cur_version_code || process.env.NODE_ENV === 'development') {
 							uni.showModal({
@@ -135,6 +162,10 @@
 		background: #F8F8F8;
 	}
 
+	uni-button:after {
+		border: none;
+	}
+
 	/*每个页面公共css */
 	::-webkit-scrollbar {
 		display: none;

+ 18 - 17
http.js

@@ -1,32 +1,33 @@
 import store from './store'
 
-const baseUrl = "http://192.168.1.101:8000";
+const baseUrl =  process.env.NODE_ENV === 'development' ? "http://192.168.1.101:8000":"http://sxzg.ngrok.ssly.site";
 const baseApiUrl = baseUrl + "/api";
 
 function initPramas() {
 	arguments[0].url = baseApiUrl + arguments[0].url;
 	arguments[0].timeout = 10000
 	// console.log(typeof arguments[0].fail)
-	if (typeof arguments[0].fail === "undefined") {
-		arguments[0].fail = (res) => {
-			console.log(res)
-			let msg = '请求失败'
-			if (res.data && res.data.msg) {
-				msg = res.data.msg
-			}
-			uni.showToast({
-				title: msg,
-				icon: "none"
-			})
+	const fail = arguments[0].fail
+	arguments[0].fail = (res) => {
+
+		console.log(res)
+		let msg = '请求失败'
+		if (res.data && res.data.msg) {
+			msg = res.data.msg
 		}
+		uni.showToast({
+			title: msg,
+			icon: "none"
+		})
+		fail(res)
 	}
 	const success = arguments[0].success
 	arguments[0].success = (res) => {
 		console.log(res)
-		if(typeof res.data === "string"){
-			try{				
+		if (typeof res.data === "string") {
+			try {
 				res.data = JSON.parse(res.data)
-			}catch(err){}
+			} catch (err) {}
 		}
 		if (res.data.code === 0) {
 			uni.showToast({
@@ -38,7 +39,7 @@ function initPramas() {
 		if (res.data.code === 1) {
 			success(res)
 		}
-		if (res.data.code === 401 || res.statusCode ===401 ) {			
+		if (res.data.code === 401 || res.statusCode === 401) {
 			uni.navigateTo({
 				url: "/pages/user/login"
 			})
@@ -70,7 +71,7 @@ export default {
 	},
 	upload: function() {
 		let obj = initPramas(arguments[0]);
-		obj.url = baseApiUrl + '/common/upload';		
+		obj.url = baseApiUrl + '/common/upload';
 		uni.uploadFile(obj)
 	}
 }

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "taoke",
+    "name" : "省心直供",
     "appid" : "__UNI__FCF6108",
     "description" : "",
     "versionName" : "1.0.0",

+ 0 - 11
package-lock.json

@@ -1,11 +0,0 @@
-{
-  "requires": true,
-  "lockfileVersion": 1,
-  "dependencies": {
-    "mp-html": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npm.taobao.org/mp-html/download/mp-html-2.1.0.tgz",
-      "integrity": "sha1-uS81Rl3Bt4+q68iPkUNf9m28j2k="
-    }
-  }
-}

+ 27 - 8
pages.json

@@ -6,10 +6,12 @@
 				// "navigationStyle": "custom",
 				"backgroundColorTop": "#ff5d5b",
 				"backgroundColorBottom": "#F8F8F8",
+				// "navigationBarTitleText": "",			
 				"app-plus": {
 					"titleNView": {
+						// "backgroundImage": "./static/images/search.png",
 						"searchInput": {
-							"backgroundColor": "#fff",
+							"backgroundColor": "rgba(255,255,255,1)",							
 							"borderRadius": "16px", //输入框圆角
 							"placeholder": "粘贴宝贝标题",
 							"disabled": true //disable时点击输入框不置焦,可以跳到新页面搜索
@@ -18,7 +20,7 @@
 							"text": "\ue847",
 							"fontSrc": "/static/uni.ttf",
 							"width": "auto",
-							"fontSize": "26px"
+							"fontSize": "22px"
 						}]
 					}
 				}
@@ -56,13 +58,13 @@
 								"text": "\ue532",
 								"fontSrc": "/static/uni.ttf",
 								"width": "auto",
-								"fontSize": "26px"
+								"fontSize": "24px"
 							},
 							{
 								"text": "\ue847",
 								"fontSrc": "/static/uni.ttf",
 								"width": "auto",
-								"fontSize": "26px"
+								"fontSize": "22px"
 							}
 						]
 					}
@@ -161,13 +163,13 @@
 				"navigationBarTitleText": "我的商品",
 				"enablePullDownRefresh": true
 			}
-		},{
+		}, {
 			"path": "pages/product/my-product-tabbar",
 			"style": {
 				"navigationBarTitleText": "我的商品",
 				"enablePullDownRefresh": true
 			}
-		},{
+		}, {
 			"path": "pages/product/product-edit",
 			"style": {
 				"navigationBarTitleText": "发布商品",
@@ -209,6 +211,21 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/user/feedback",
+			"style": {
+				"navigationBarTitleText": "意见反馈",
+				"enablePullDownRefresh": false,
+				"backgroundColorTop": "#ff5d5b"
+			}
+
+		}, {
+			"path": "pages/home/camera",
+			"style": {
+				"navigationBarTitleText": "扫一扫",
+				"enablePullDownRefresh": false
+			}
+
 		}
 	],
 	"globalStyle": {
@@ -223,10 +240,12 @@
 		"selectedColor": "#ff5d5b",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
+		"height":"44px",
+		"iconWidth":"20px",
 		"midButton": {
 			"iconPath": "static/images/camera.png",
-			"iconWidth": "40px",
-			"height": "45px"
+			"iconWidth": "36px",
+			"height": "40px"
 		},
 		"list": [{
 			"pagePath": "pages/home/home",

+ 23 - 0
pages/home/camera.vue

@@ -0,0 +1,23 @@
+<template>
+	<view>
+        <camera device-position="back" flash="off" @error="error" style="width: 100%; height: 300px;"></camera>
+			
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 1 - 1
pages/home/home.vue

@@ -227,7 +227,7 @@
 		display: flex;
 		align-items: center;
 		padding: 20upx 20upx 10upx 20upx;
-
+		font-size: 28upx;
 		.icon {
 			// vertical-align: middle;
 			margin-right: 12rpx;

+ 3 - 0
pages/order/back-order.vue

@@ -1,5 +1,8 @@
 <template>
 	<view class="order">
+		<view  v-if="orders.length===0" style="margin: 20upx auto;text-align: center; font-size: 28upx;color: #999999;">
+			暂无任何订单
+		</view>
 		<view class="order-list">
 			<view class="order-item" v-for="order in orders">
 				<view class="order-head">

+ 3 - 0
pages/order/order.vue

@@ -13,6 +13,9 @@
 					@tap="orderStatus='complete',orders=[],getOrdersData()">已完成</view>
 			</view>
 		</view>
+		<view  v-if="orders.length===0" style="margin: 20upx auto;text-align: center; font-size: 28upx;color: #999999;">
+			暂无任何订单
+		</view>
 		<view class="order-list">
 			<view class="order-item" v-for="order in orders">
 				<view class="order-head">

+ 1 - 1
pages/product/my-product-tabbar.vue

@@ -64,7 +64,7 @@
 			this.refresh();
 		},
 		onShow() {
-			uni.startPullDownRefresh()
+			this.refresh();
 		},
 		methods: {
 			getProductData() {

+ 5 - 2
pages/product/my-product.vue

@@ -11,7 +11,10 @@
 				</view>
 			</view>
 		</view>
-
+		<view v-if="products.length===0"
+			style="margin: 20upx auto;text-align: center; font-size: 28upx;color: #999999;">
+			暂未发布任何商品
+		</view>
 		<view class="product-list">
 			<view class="product-item" v-for="product in products" @tap="goToEdit(product.id)">
 				<view class="product-image">
@@ -64,7 +67,7 @@
 			this.refresh();
 		},
 		onShow() {
-			uni.startPullDownRefresh()
+			this.refresh();
 		},
 		methods: {
 			getProductData() {

+ 1 - 1
pages/product/product-details.vue

@@ -249,7 +249,7 @@
 
 	.sxzg-icon {
 		color: $primary-color;
-		font-size: 22rpx;
+		font-size: 20rpx;
 		width: 120rpx;
 		text-align: center;
 		line-height: normal;

+ 3 - 0
pages/shopping-cart/shopping-cart.vue

@@ -1,5 +1,8 @@
 <template>
 	<view class="shopping-cart">
+		<view  v-if="cart.length===0" style="margin: 20upx auto;text-align: center; font-size: 28upx;color: #999999;">
+			暂未添加任何商品
+		</view>
 		<view class="shopping-cart-item" v-for="seller in cart">
 			<view class="shopping-cart-item-head">
 				<view class="select">

+ 232 - 0
pages/user/feedback.vue

@@ -0,0 +1,232 @@
+<template>
+	<view class="feedback">
+		<view class="header-bg"></view>
+
+		<view class="header">
+			<view class="title">
+				意见反馈
+			</view>
+
+		</view>
+		<view class="" style="margin: 0 20upx;">
+			<view class="">
+				<label class="label" for="">我要反馈</label>
+				<view style="background: white;margin: 20upx 0;border-radius: 10upx;">
+					<view>
+						<textarea class="textarea" v-model="form.content" placeholder="" maxlength="300" />
+					</view>
+					<view class="tips">您还能输入{{300-form.content.length}}个字符</view>
+				</view>
+			</view>
+			<view class="">
+				<label class="label" for="">上传图片</label>
+				<view style="background: white;border-radius: 10upx;margin-top: 20upx;">
+					<view class="images-wrapper">
+						<view class="image-item" v-for="(image,i) in mainImages">
+							<view class="del" @tap="mainImages.splice(i,1)">删除</view>
+							<image class="image" :src="image|imagesFilter" mode="aspectFill" @tap="replaceImage(i)">
+							</image>
+						</view>
+
+						<view class="image-item" v-if="mainImagesLimit>mainImages.length">
+							<view class="add" @tap="addImage">
+								<uni-icons type="plusempty" size="40" color="#EEEEEE" style="font-weight: 500;">
+								</uni-icons>
+							</view>
+						</view>
+					</view>
+
+				</view>
+			</view>
+			<view class="" style="margin-top: 100upx;">
+				<button type="default" class="btn submit-btn" @tap="submit">提交</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				mainImages: [],
+				mainImagesLimit: 4,
+				form: {
+					content: ''
+				}
+			}
+		},
+		methods: {
+			addImage() {
+				this.chooseImage().then((res) => {
+					console.log(res)
+					for (let i in res.tempFilePaths) {
+						this.$http.upload({
+							file: res.tempFiles[i],
+							filePath: res.tempFilePaths[i],
+							name: 'file',
+							success: (res) => {
+								console.log(res.data.data)
+								this.mainImages.push(res.data.data.url)
+							}
+						})
+					}
+				});
+			},
+			replaceImage(index) {
+				console.log(index)
+				this.chooseImage().then((res) => {
+					this.$http.upload({
+						file: res.tempFiles[0],
+						filePath: res.tempFilePaths[0],
+						name: 'file',
+						success: (res) => {
+							// this.mainImages[index] = res.data.data.url
+							this.$set(this.mainImages, index, res.data.data.url)
+						}
+					})
+
+				});
+			},
+			chooseImage() {
+				return new Promise((resolve, reject) => {
+					uni.chooseImage({
+						count: this.mainImagesLimit - this.mainImages.length,
+						extension: ['jpg', 'png', 'bmp', 'jpeg'],
+						success(res) {
+							resolve(res)
+						},
+						fail(err) {
+							reject(err)
+						}
+					})
+				})
+			},
+			submit() {
+				if (this.$verified.required(this.form.content,"请输入反馈内容")) {
+					this.$http.post({
+						url: "/feedback/create",
+						data: this.form,
+						success: (res) => {
+							console.log(res)
+							uni.showModal({
+								title: "意见反馈",
+								content: "提交成功,平台将于三个工作日之内为您处理",
+								success: (res) => {
+									if (res.confirm) {
+										uni.navigateBack()
+									}
+								}
+							})
+						}
+					})
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.feedback {
+		position: relative;
+		overflow: hidden;
+	}
+
+	.header-bg {
+		background: $primary-color;
+		height: 100upx;
+		position: absolute;
+		top: 0;
+		width: 100%;
+		z-index: 1;
+	}
+
+	.header {
+		margin: 20upx;
+		background: white;
+		text-align: center;
+		border-radius: 20upx;
+		position: relative;
+		z-index: 2;
+
+		.title {
+			height: 100upx;
+			font-size: 32upx;
+			line-height: 100upx;
+			// font-weight: bold;
+		}
+	}
+
+	.label {
+		font-size: 30upx;
+
+	}
+
+	.tips {
+		font-size: 28upx;
+		text-align: right;
+		padding: 10upx;
+		color: #999999;
+	}
+
+	.textarea {
+		padding: 20upx;
+		font-size: 28upx;
+		width: 100%;
+		box-sizing: border-box;
+	}
+
+	.images-wrapper {
+		padding: 0;
+		padding-top: 40upx;
+		display: flex;
+		flex-wrap: wrap;
+
+		// justify-content: space-between;
+
+		.image-item {
+			position: relative;
+			width: 25%;
+			text-align: center;
+			margin-bottom: 40upx;
+
+			.del {
+				position: absolute;
+				top: 0;
+				right: 30upx;
+				z-index: 1;
+				font-size: 24upx;
+				background-color: $primary-color;
+				color: white;
+				padding: 2upx 15upx;
+			}
+		}
+
+		.image {
+			width: 120upx;
+			height: 120upx;
+			background: #EEEEEE;
+			flex: 0 0 150upx;
+
+		}
+
+		.add {
+			width: 120upx;
+			height: 120upx;
+			display: inline-block;
+			line-height: 110upx;
+
+			border: 8upx #EEEEEE solid;
+			box-sizing: border-box;
+		}
+
+	}
+
+	.submit-btn {
+		font-size: 30upx;
+		line-height: 60upx;
+		width: 250upx;
+		background: $primary-color;
+		color: white;
+	}
+</style>

+ 1 - 0
pages/user/login.vue

@@ -66,6 +66,7 @@
 						success: (res) => {
 							console.log(this.$store)
 							this.$store.dispatch("user/save", res.data.data.userinfo)
+							uni.$emit("login");
 							uni.navigateBack();
 						}
 					})

+ 1 - 1
pages/user/setting.vue

@@ -189,7 +189,7 @@
 
 			.info {
 				color: #999999;
-				font-size: 24upx;
+				font-size: 26upx;
 				display: inline-block;
 				margin-left: 20upx;
 			}

+ 29 - 18
pages/user/user-center.vue

@@ -12,7 +12,7 @@
 				</view>
 			</view>
 			<view class="invite">
-				<view class="invite-code">邀请码:H00000164</view>
+				<view class="invite-code">邀请码:{{invite_code}}</view>
 				<view class="invite-progress">
 					<view class="item active"></view>
 					<view class="item active"></view>
@@ -46,7 +46,7 @@
 					<view class="name">账单明细</view>
 				</view>
 				<view class="menu-item">
-					<navigator url="/pages/order/order" open-type="navigate">
+					<navigator url="/pages/order/order" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b7.png" mode=""></image>
 						</view>
@@ -54,7 +54,7 @@
 					</navigator>
 				</view>
 				<view>
-					<navigator url="/pages/product/my-product" open-type="navigate">
+					<navigator url="/pages/product/my-product" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b2.png" mode=""></image>
 						</view>
@@ -62,7 +62,7 @@
 					</navigator>
 				</view>
 				<view>
-					<navigator url="/pages/user/strategy" open-type="navigate">
+					<navigator url="/pages/user/strategy" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b1.png" mode=""></image>
 						</view>
@@ -72,7 +72,7 @@
 			</view>
 			<view class="menu">
 				<view>
-					<navigator url="/pages/user/problem" open-type="navigate">
+					<navigator url="/pages/user/problem" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b3.png" mode=""></image>
 						</view>
@@ -80,7 +80,7 @@
 					</navigator>
 				</view>
 				<view>
-					<navigator url="/pages/user/kefu" open-type="navigate">
+					<navigator url="/pages/user/kefu" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b4.png" mode=""></image>
 						</view>
@@ -88,7 +88,7 @@
 					</navigator>
 				</view>
 				<view>
-					<navigator url="/pages/user/notice" open-type="navigate">
+					<navigator url="/pages/user/notice" open-type="navigate" hover-class="none">
 						<view class="icon">
 							<image class="image" src="../../static/images/menu/b5.png" mode=""></image>
 						</view>
@@ -96,10 +96,14 @@
 					</navigator>
 				</view>
 				<view>
+					<navigator url="/pages/user/feedback" open-type="navigate" hover-class="none">
+					
 					<view class="icon">
 						<image class="image" src="../../static/images/menu/b6.png" mode=""></image>
 					</view>
 					<view class="name">意见反馈</view>
+					</navigator>
+					
 				</view>
 			</view>
 		</view>
@@ -120,7 +124,10 @@
 		},
 		computed: mapState({
 			nickname: state => state.user.nickname,
-			user_type: state => state.user.group_id
+			user_type: state => state.user.group_id,
+			invite_code: (state) => {
+				return 'H' + ('00000000' + state.user.id).slice(-8);
+			}
 		}),
 		onNavigationBarButtonTap(e) {
 			// console.log(e)
@@ -153,13 +160,16 @@
 
 	.portrait {
 		margin: 0 20upx;
-
+		border: 10upx solid rgba(255, 255, 255, 0.5);
+		border-radius: 128upx;
+		overflow: hidden;
+		width: 128upx;
+		height: 128upx;
+		
 		.image {
 			width: 128upx;
 			height: 128upx;
-			background: white;
-			border-radius: 128upx;
-			border: 10upx solid rgba(255, 255, 255, 0.2);
+			background: white;			
 		}
 	}
 
@@ -285,16 +295,17 @@
 	.vip-center {
 		background: url(../../static/images/center5.png) no-repeat;
 		background-size: 710upx 78upx;
-		color: #EEEEEE;
+		color: white;
 		padding: 0 20upx;
 		margin-top: 20upx;
-
+		height: 78upx;
 		.text {
 			margin-left: 50upx;
 			background-color: #ff5454;
 			font-weight: bold;
-			line-height: 76upx;
-
+			line-height: 60upx;
+			display: inline-block;
+			margin-top: 10upx;
 			.sub {
 				font-size: 24upx;
 			}
@@ -319,8 +330,8 @@
 		}
 
 		.icon .image {
-			width: 50upx;
-			height: 50upx;
+			width: 60upx;
+			height: 60upx;
 		}
 	}
 </style>

+ 64 - 8
pages/user/vcode-login.vue

@@ -1,21 +1,24 @@
 <template>
 	<view class="login">
 		<view class="logo">
-			<image src="../../static/images/login/logo.png" style="width: 160upx;height: 160upx;" mode="scaleToFill"></image>
+			<image src="../../static/images/login/logo.png" style="width: 160upx;height: 160upx;" mode="scaleToFill">
+			</image>
 		</view>
 		<view class="login-from">
 			<view class="input-item">
 				<label for="">
-					<image src="../../static/images/login/phone.png" style="width: 30upx;height: 40upx;" mode=""></image>
+					<image src="../../static/images/login/phone.png" style="width: 30upx;height: 40upx;" mode="">
+					</image>
 				</label>
-				<input type="text" placeholder="请输入手机号">
+				<input type="text" placeholder="请输入手机号" v-model="form.mobile">
 			</view>
 			<view class="input-item">
 				<label for="">
 					<image src="../../static/images/login/lock.png" style="width: 30upx;height: 40upx;" mode=""></image>
 				</label>
-				<input type="number" placeholder="请输入验证码" maxlength="6">
-				<button class="send-vcode">获取验证码</button>
+				<input type="number" placeholder="请输入验证码" maxlength="6" v-model="form.captcha">
+				<button class="send-vcode" @tap="sendSms()"
+					:disabled="!sendable">{{sendable?'获取验证码':countdown+'秒'}}</button>
 			</view>
 			<view class="button-item" style="margin-top: 140upx;">
 				<button class="login-btn">登录</button>
@@ -26,21 +29,72 @@
 		<view class="third-party">
 			<view class="title"><text>第三方登录</text></view>
 			<view class="content">
-				<image src="../../static/images/login/wx.png" style="width: 90upx;height: 90upx;" mode="scaleToFill"></image>
+				<image src="../../static/images/login/wx.png" style="width: 90upx;height: 90upx;" mode="scaleToFill">
+				</image>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	let timeInterval = null;
+	const time = 120
+
 	export default {
 		data() {
 			return {
-
+				sendable: true,
+				countdown: time,
+				form: {
+					mobile: '',
+					captcha: ''
+				}
 			}
 		},
 		methods: {
-
+			login() {
+				if (this.$verified.mobile(this.mobile) &&
+					this.$verified.required(this.captcha, "请输入验证码")) {
+					this.$http.post({
+						url: "/user/mobilelogin",
+						data: form,
+						success: (res) => {
+							console.log(this.$store)
+							this.$store.dispatch("user/save", res.data.data.userinfo)
+							uni.navigateBack();
+						}
+					})
+				}
+			},
+			sendSms() {
+				if (this.sendable && this.$verified.mobile(this.form.mobile)) {
+					this.sendable = false;
+
+					this.$http.get({
+						url: '/sms/send',
+						data: {
+							mobile: this.form.mobile,
+							event: "register"
+						},
+						success: (res) => {
+							uni.showToast({
+								title: res.data.msg,
+								icon: "none"
+							})
+							timeInterval = setInterval(() => {
+								if (this.countdown-- === 0) {
+									clearInterval(timeInterval)
+									this.countdown = time;
+									this.sendable = true;
+								}
+							}, 1000)
+						},
+						fail: () => {
+							this.sendable = true;
+						}
+					})
+				}
+			}
 		}
 	}
 </script>
@@ -98,6 +152,7 @@
 		display: flex;
 		margin-bottom: 48upx;
 		position: relative;
+
 		label {
 			width: 50upx;
 		}
@@ -122,6 +177,7 @@
 		right: 0upx;
 		top: -5upx;
 	}
+
 	.login-btn {
 		height: 80upx;
 		border: 2upx solid $primary-color;

BIN
static/images/menu/b7.png


BIN
static/images/menu/b7.png.bak


BIN
static/images/search.png