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 @@
-
+
{{ item.goods_name }}
¥{{ item.groupbuy_price }}
¥{{ item.goods_price }}
-
+
剩余{{ item.inventory | formatValue }}件
立即购买
@@ -55,23 +55,28 @@ export default {
\ No newline at end of file
diff --git a/pageA/login/login.vue b/pageA/login/login.vue
index 0681d9e..0e0015f 100644
--- a/pageA/login/login.vue
+++ b/pageA/login/login.vue
@@ -101,7 +101,7 @@
},
onLoad() {
// 数据的请求
- this.apiwelcome();
+ // this.apiwelcome();
},
onShow() {
let pages = getCurrentPages();
@@ -123,7 +123,9 @@
...mapMutations(['loginIn']),
apiwelcome() {
this.$u.api.sendSmsCode({}).then((res) => {
- console.log(res)
+ if (res.errCode == 0) {
+ console.log(res)
+ }
})
},
// 协议跳转
@@ -148,21 +150,18 @@
if (this.member_mobile == '') {
this.$refs.uToast.show({
title: '手机号不能为空',
- type: 'error'
})
return false;
}
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确',
- type: 'error'
});
return false;
}
if (this.sms_code == '') {
this.$refs.uToast.show({
title: '验证码不能为空',
- type: 'error'
})
return false;
}
@@ -176,7 +175,6 @@
if (res.data == '') {
this.$refs.uToast.show({
title: res.message,
- type: 'error'
})
return false
} else {
@@ -205,7 +203,6 @@
} else {
this.$refs.uToast.show({
title: res.message,
- type: 'error'
})
}
})
diff --git a/pageA/register/register.vue b/pageA/register/register.vue
index 8579985..dac3e13 100644
--- a/pageA/register/register.vue
+++ b/pageA/register/register.vue
@@ -109,28 +109,24 @@
if( this.member_mobile == ''){
this.$refs.uToast.show({
title: '手机号不能为空!',
- type: 'error'
})
return false;
}
if (type_phone == false) {
this.$refs.uToast.show({
title: '手机号格式不正确!',
- type: 'error'
});
return false;
}
if( this.sms_code == ''){
this.$refs.uToast.show({
title: '验证码不能为空!',
- type: 'error'
})
return false;
}
if (this.is_check) {
this.$refs.uToast.show({
title: '请同意协议!',
- type: 'error'
})
return false;
}
@@ -138,10 +134,6 @@
member_mobile: this.member_mobile,
sms_code: this.sms_code
}).then((res) => {
- console.log('3333333333',res);
- // 校验手机号
-
- // console.log(res)
if(res.errCode == 0){
//存储一个字符传值
me.loginIn(res.data.token);
@@ -159,20 +151,18 @@
// type: 'success',
// url: '/pageA/topick/topick'
// })
- }
- if(res.errCode == 1){
- this.$refs.uToast.show({
- title: res.message,
- type: 'error'
- })
- }
- if(res.errCode == 2){
+ } else if(res.errCode == 2){
this.$refs.uToast.show({
title: res.message,
type: 'primary',
url: '/pageA/login/login'
})
- }
+ } else {
+ this.$refs.uToast.show({
+ title: res.message,
+ type: 'primary'
+ })
+ }
})
},
// 选中某个复选框时,由checkbox时触发
@@ -196,7 +186,6 @@
// console.log("调用父组件的方法")
// console.log('2222',this._data.member_mobile)
let member_mobile = this._data.member_mobile;
-
}
},
components: {
diff --git a/pageB/components/userinfo/index.vue b/pageB/components/userinfo/index.vue
index 1d5a7ee..42f1164 100644
--- a/pageB/components/userinfo/index.vue
+++ b/pageB/components/userinfo/index.vue
@@ -18,7 +18,7 @@
- {{item.comment_num}}
+ {{ comment_num }}
@@ -74,7 +74,7 @@