From 502e020000d0a2db13d81871470af8ce73dc296f Mon Sep 17 00:00:00 2001 From: Gdpao <1341331954@qq.com> Date: Fri, 7 Aug 2020 19:56:47 +0800 Subject: [PATCH 1/2] gdpao --- common/http.interceptor.js | 3 + components/logininput/identifying.vue | 62 +++++++++-------- components/remaining/remaining.vue | 11 +-- components/shop/list/index.vue | 2 +- components/shop/list/item.vue | 11 +-- components/shop/recommend/index.vue | 3 +- components/shop/recommend/pintuan.vue | 11 +-- components/shop/seckill/index.vue | 26 ++++--- components/shop/seckill/item.vue | 21 +++--- components/shop/youhq/index.vue | 25 ++++--- pageA/login/login.vue | 11 ++- pageA/register/register.vue | 25 ++----- pageB/components/userinfo/index.vue | 13 +++- pageB/details/index.vue | 2 +- pageB/photo/index.vue | 46 +++++++++---- pages/index/index.vue | 99 +++++++++++++++++++++------ pages/shop/index.vue | 3 +- 17 files changed, 238 insertions(+), 136 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index d27505a..0fe6b37 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -43,12 +43,15 @@ const install = (Vue, vm) => { vm.$u.route('/pageA/login/login') }, 500) } + if (res.cancel) { + } } }) } return false; } else if (res.errCode == 1) { console.log(res.message); + return res; } else { // 如果返回false,则会调用Promise的reject回调, // 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值 diff --git a/components/logininput/identifying.vue b/components/logininput/identifying.vue index 384eb1b..fd9db9c 100644 --- a/components/logininput/identifying.vue +++ b/components/logininput/identifying.vue @@ -44,49 +44,57 @@ this.$emit('tochange'); let member_mobile = this.member_mobile; // 校验手机号 - let type_phone = this.$u.test.mobile(member_mobile) - console.log(member_mobile) - console.log(this.smslog_type) + let type_phone = this.$u.test.mobile(member_mobile); + // console.log(member_mobile); + // console.log(this.smslog_type); // 判断是否有手机号为空 if (type_phone == false) { - this.$refs.uToast.show({ - title: '手机号格式不正确', - type: 'error' - }) + this.$refs.uToast.show({ + title: "手机号格式不正确" + }) } else { // 验证码倒计时 if (this.$refs.uCode.canGetCode) { - // 模拟向后端请求验证码 - uni.showLoading({ - title: '正在获取验证码' - }) - setTimeout(() => { - uni.hideLoading(); - // 这里此提示会被this.start()方法中的提示覆盖 - this.$u.toast('验证码已发送'); - // 通知验证码组件内部开始倒计时 - this.$refs.uCode.start(); - }, 2000); + uni.showLoading({ + title: '正在获取验证码' + }) + // 请求接口 + this.$u.api.sendSmsCode({ + member_mobile: this.member_mobile, + smslog_type: this.smslog_type + }).then((res) => { + if (res.errCode == 0) { + console.log(res); + this.$refs.uToast.show({ + title: res.message, + }) + setTimeout(() => { + uni.hideLoading(); + // 这里此提示会被this.start()方法中的提示覆盖 + // this.$u.toast('验证码已发送'); + // 通知验证码组件内部开始倒计时 + this.$refs.uCode.start(); + }, 100); + } else { + this.$refs.uToast.show({ + title: res.message, + }) + } + }) } else { // this.$u.toast('倒计时结束后再发送'); - console.log("倒计时结束后再发送"); + // console.log("倒计时结束后再发送"); } } }, end() { - this.$u.toast('倒计时结束'); + // this.$u.toast('倒计时结束'); }, start() { // this.$u.toast('倒计时开始'); - console.log(this.smslog_type) + // console.log(this.smslog_type) // 倒计时请求 - this.$u.api.sendSmsCode({ - member_mobile: this.member_mobile, - smslog_type: this.smslog_type - }).then((res) => { - console.log(res) - }) } } } diff --git a/components/remaining/remaining.vue b/components/remaining/remaining.vue index 6e15e80..215766f 100644 --- a/components/remaining/remaining.vue +++ b/components/remaining/remaining.vue @@ -297,17 +297,18 @@ height: 560rpx; .protocol_content { + display: block; width: 494rpx; height: 528rpx; + margin: 10rpx auto 30rpx; font-size: 24rpx; font-weight: 400; - color: rgba(51, 51, 51, 1); - display: block; text-align: left; - margin: 80rpx auto 33rpx; - letter-spacing: 1rpx; - text-align: justify; line-height: 36rpx; + text-align: justify; + letter-spacing: 1rpx; + text-indent: 2rem; + color: rgba(51, 51, 51, 1); } } diff --git a/components/shop/list/index.vue b/components/shop/list/index.vue index 0f607b6..6b1eb5c 100644 --- a/components/shop/list/index.vue +++ b/components/shop/list/index.vue @@ -95,7 +95,7 @@ export default { }, setSwiperHeight() { // height: 230px, margin-bottom: 13 - const height = Math.ceil(this.goodsList.length / 2) * (540 + 26); + const height = Math.ceil(this.goodsList.length / 2) * (500 + 26); this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx'; // this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px'; }, diff --git a/components/shop/list/item.vue b/components/shop/list/item.vue index 5d30f05..0183f9b 100644 --- a/components/shop/list/item.vue +++ b/components/shop/list/item.vue @@ -3,7 +3,7 @@ {{ info.goods_name }} - {{ info.goods_advword }} + ¥{{ info.goods_price }} @@ -44,7 +44,7 @@ export default { \ No newline at end of file diff --git a/components/shop/seckill/item.vue b/components/shop/seckill/item.vue index efebd34..9ce6585 100644 --- a/components/shop/seckill/item.vue +++ b/components/shop/seckill/item.vue @@ -1,12 +1,12 @@