+
-
登录
-
登录
-
-
- 没有账号?
- 快速登录
-
+
登录
+
登录
+
+
+
+
+
+
+
+ 其他方式登录
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 通过Apple登录
+
+
+
+
-
@@ -150,7 +124,12 @@
keyCode: "",
codeUrl: "",
codeVal: "",
- isShowCode: false
+ isShowCode: false,
+ appLoginStatus: false, // 微信登录强制绑定手机号码状态
+ appUserInfo: null, // 微信登录保存的用户信息
+ appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
+ appleUserInfo: null,
+ appleShow: false // 苹果登录版本必须要求ios13以上的
};
},
watch:{
@@ -167,6 +146,138 @@
this.getLogoImage();
},
methods: {
+ // 苹果登录
+ appleLogin() {
+ let self = this
+ this.account = ''
+ this.captcha = ''
+ uni.showLoading({
+ title: '登录中'
+ })
+ uni.login({
+ provider: 'apple',
+ timeout: 10000,
+ success(loginRes) {
+ console.log(loginRes, 'loginRes')
+ uni.getUserInfo({
+ provider: 'apple',
+ success: function(infoRes) {
+ console.log(infoRes.userInfo, 'yyyy')
+ self.appleUserInfo = infoRes.userInfo
+ self.appleLoginApi()
+
+ console.log(self.$store);
+ console.log(infoRes.userInfo);
+ },
+ fail() {
+ uni.showToast({
+ title: '获取用户信息失败',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ complete() {
+ uni.hideLoading()
+ }
+ });
+ },
+ fail(error) {
+ console.log(error)
+ }
+ })
+ },
+ // 苹果登录Api
+ appleLoginApi() {
+ let self = this
+ appleLogin({
+ openId: self.appleUserInfo.openId,
+ email: self.appleUserInfo.email || '',
+ phone: this.account,
+ captcha: this.captcha
+ }).then(({
+ data
+ }) => {
+ if (data.isbind) {
+ uni.showModal({
+ title: '提示',
+ content: '请绑定手机号后,继续操作',
+ showCancel: false,
+ success: function(res) {
+ if (res.confirm) {
+ self.current = 1
+ self.appleLoginStatus = true
+ }
+ }
+ });
+ } else {
+ self.$store.commit("LOGIN", {
+ 'token': data.token,
+ 'time': data.expires_time - self.$Cache.time()
+ });
+ let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
+ self.$Cache.clear(BACK_URL);
+ self.$store.commit("SETUID", data.userInfo.uid);
+ uni.reLaunch({
+ url: backUrl
+ });
+ }
+ }).catch(error => {
+ uni.showModal({
+ title: '提示',
+ content: `错误信息${error}`,
+ success: function(res) {
+ if (res.confirm) {
+ console.log('用户点击确定');
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ }
+ }
+ });
+ })
+ },
+ // App微信登录
+ wxLogin() {
+ let self = this
+ this.account = ''
+ this.captcha = ''
+ uni.showLoading({
+ title: '登录中'
+ })
+ uni.login({
+ provider: 'weixin',
+ success: function(loginRes) {
+ // 获取用户信息
+ uni.getUserInfo({
+ provider: 'weixin',
+ success: function(infoRes) {
+ console.log(infoRes.userInfo, 'yyyy')
+ self.appUserInfo = infoRes.userInfo
+ self.wxLoginApi()
+
+ console.log(self.$store);
+ console.log(infoRes.userInfo);
+ },
+ fail() {
+ uni.showToast({
+ title: '获取用户信息失败',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ complete() {
+ uni.hideLoading()
+ }
+ });
+ },
+ fail() {
+ uni.showToast({
+ title: '登录失败',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ });
+ },
again() {
this.codeUrl =
VUE_APP_API_URL +
@@ -221,8 +332,9 @@
});
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
- // getUserInfo().then(res => {
- that.$store.commit("SETUID", res.data.user.uid);
+ getUserInfo().then(res => {
+ that.$store.commit("UPDATE_USERINFO", res.data);
+ that.$store.commit("SETUID", res.data.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
'/pages/user/index') {
@@ -231,11 +343,12 @@
});
} else {
- uni.switchTab({
- url: '/pages/index/index'
- });
+ uni.navigateBack()
+ // uni.switchTab({
+ // url: '/pages/index/index'
+ // });
}
- // })
+ })
})
.catch(res => {
that.$util.Tips({
@@ -304,7 +417,7 @@
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
// that.isShowCode = true;
// }
- that.$util.Tips({title:res});
+ that.$util.Tips({title:res.message});
});
},
navTap: function(index) {
@@ -324,7 +437,7 @@
loginH5({
account: that.account,
password: that.password,
- spread_spid: that.$Cache.get("spread")
+ spread: that.$Cache.get("spread")
})
.then(({
data
@@ -337,6 +450,7 @@
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
getUserInfo().then(res => {
+ that.$store.commit("UPDATE_USERINFO", res.data);
that.$store.commit("SETUID", res.data.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
uni.switchTab({
@@ -347,11 +461,7 @@
url: '/pages/index/index'
});
}
- }).catch(e => {
- that.$util.Tips({
- title: e
- });
- });
+ })
})
.catch(e => {
that.$util.Tips({
@@ -362,7 +472,81 @@
}
};
-
diff --git a/pages/users/login/index2.vue b/pages/users/login/index2.vue
deleted file mode 100644
index 493156ea..00000000
--- a/pages/users/login/index2.vue
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
登录
-
登录
-
-
-
-
-
-
-
-
diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue
index 50250137..09faee3d 100644
--- a/pages/users/order_confirm/index.vue
+++ b/pages/users/order_confirm/index.vue
@@ -142,7 +142,7 @@
-
+
@@ -280,6 +280,17 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getaddressInfo();
+ this.getConfirm();
+ }
+ },
+ deep:true
+ }
+ },
onLoad: function(options) {
// #ifdef H5
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
@@ -310,13 +321,7 @@
//调用子页面方法授权后执行获取地址列表
this.$nextTick(function() {})
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true);
- // #endif
}
},
/**
diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue
index 6e7de8cf..c3ab5d39 100644
--- a/pages/users/order_list/index.vue
+++ b/pages/users/order_list/index.vue
@@ -93,7 +93,7 @@
-
+
@@ -173,13 +173,7 @@
this.getOrderList();
this.getUserInfo();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true);
- // #endif
}
},
methods: {
diff --git a/pages/users/promoter-list/index.vue b/pages/users/promoter-list/index.vue
index a5251438..47c8082d 100644
--- a/pages/users/promoter-list/index.vue
+++ b/pages/users/promoter-list/index.vue
@@ -69,7 +69,7 @@
-
+
@@ -119,13 +119,7 @@
if (this.isLogin) {
this.userSpreadNewList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
onShow: function() {
diff --git a/pages/users/promoter-order/index.vue b/pages/users/promoter-order/index.vue
index 646ac72c..fdd36cea 100644
--- a/pages/users/promoter-order/index.vue
+++ b/pages/users/promoter-order/index.vue
@@ -46,7 +46,7 @@
-
+
@@ -92,13 +92,7 @@
if (this.isLogin) {
this.getRecordOrderList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/promoter_rank/index.vue b/pages/users/promoter_rank/index.vue
index 9a150c98..890608e1 100644
--- a/pages/users/promoter_rank/index.vue
+++ b/pages/users/promoter_rank/index.vue
@@ -10,21 +10,21 @@
-
+
{{Two.nickname}}
{{Two.spreadCount}}人
-
+
{{One.nickname}}
{{One.spreadCount}}人
-
+
@@ -48,7 +48,7 @@
-
+
@@ -93,17 +93,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getRanklist();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getRanklist();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
// onShow: function () {
diff --git a/pages/users/static/home.png b/pages/users/static/home.png
new file mode 100644
index 00000000..3f8782bb
Binary files /dev/null and b/pages/users/static/home.png differ
diff --git a/pages/users/static/left.png b/pages/users/static/left.png
new file mode 100644
index 00000000..0e593e43
Binary files /dev/null and b/pages/users/static/left.png differ
diff --git a/pages/users/static/wechat_login.png b/pages/users/static/wechat_login.png
new file mode 100644
index 00000000..65d6691c
Binary files /dev/null and b/pages/users/static/wechat_login.png differ
diff --git a/pages/users/user_address/index.vue b/pages/users/user_address/index.vue
index 18b7f34c..671d7643 100644
--- a/pages/users/user_address/index.vue
+++ b/pages/users/user_address/index.vue
@@ -43,7 +43,7 @@
-
+
@@ -102,6 +102,17 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserAddress();
+ this.getCityList();
+ }
+ },
+ deep:true
+ }
+ },
onLoad(options) {
if (this.isLogin) {
this.cartId = options.cartId || '';
@@ -120,13 +131,7 @@
// this.initialize();
// }
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_address/index001.vue b/pages/users/user_address/index001.vue
deleted file mode 100644
index 29345cdd..00000000
--- a/pages/users/user_address/index001.vue
+++ /dev/null
@@ -1,537 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/users/user_address_list/index.vue b/pages/users/user_address_list/index.vue
index 9ac11e39..85fe3976 100644
--- a/pages/users/user_address_list/index.vue
+++ b/pages/users/user_address_list/index.vue
@@ -52,7 +52,7 @@
-
+
@@ -102,6 +102,16 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserAddress(true);
+ }
+ },
+ deep:true
+ }
+ },
onLoad(options) {
if (this.isLogin) {
this.cartId = options.cartId || '';
@@ -112,13 +122,7 @@
this.bargain = options.bargain || false;
this.getAddressList(true);
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
onShow: function() {
diff --git a/pages/users/user_bill/index.vue b/pages/users/user_bill/index.vue
index 498b65cc..9ffbe236 100644
--- a/pages/users/user_bill/index.vue
+++ b/pages/users/user_bill/index.vue
@@ -31,7 +31,7 @@
-
+
@@ -78,13 +78,7 @@
if (this.isLogin) {
this.getUserBillList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
/**
@@ -116,6 +110,7 @@
getUserBillList: function() {
let that = this;
if (that.loadend) return;
+
if (that.loading) return;
that.loading = true;
that.loadTitle = "";
@@ -126,7 +121,7 @@
}
getBillList(data).then(function(res) {
let list = res.data.list?res.data.list:[],
- loadend = list.length < that.limit;
+ loadend = res.data.list < res.data.limit;
that.userBillList = that.$util.SplitArray(list, that.userBillList);
that.$set(that, 'userBillList', that.userBillList);
that.loadend = loadend;
diff --git a/pages/users/user_cash/index.vue b/pages/users/user_cash/index.vue
index 136e855a..cabc4459 100644
--- a/pages/users/user_cash/index.vue
+++ b/pages/users/user_cash/index.vue
@@ -108,7 +108,7 @@
-
+
@@ -165,19 +165,24 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ this.getUserExtractBank();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
this.getUserExtractBank();
//this.getBrokerageCommission();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true);
- // #endif
}
},
methods: {
diff --git a/pages/users/user_coupon/index.vue b/pages/users/user_coupon/index.vue
index 2872be09..8eeb34c4 100644
--- a/pages/users/user_coupon/index.vue
+++ b/pages/users/user_coupon/index.vue
@@ -3,8 +3,8 @@
- ¥{{item.money}}
- 满{{ item.minPrice }}元可用
+ ¥{{item.money?Number(item.money):''}}
+ 满{{ item.minPrice?Number(item.minPrice):'' }}元可用
@@ -26,7 +26,7 @@
-
+
@@ -73,17 +73,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch: {
+ isLogin: {
+ handler: function(newV, oldV) {
+ if (newV) {
+ this.getUseCoupons();
+ }
+ },
+ deep: true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUseCoupons();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_get_coupon/index.vue b/pages/users/user_get_coupon/index.vue
index 63f0bc8b..c4169e31 100644
--- a/pages/users/user_get_coupon/index.vue
+++ b/pages/users/user_get_coupon/index.vue
@@ -3,8 +3,8 @@
- ¥{{item.money}}
- 满{{item.minPrice}}元可用
+ ¥{{item.money?Number(item.money):''}}
+ 满{{item.minPrice?Number(item.minPrice):''}}元可用
@@ -31,7 +31,7 @@
-
+
@@ -69,19 +69,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch: {
+ isLogin: {
+ handler: function(newV, oldV) {
+ if (newV) {
+ this.getUseCoupons();
+ }
+ },
+ deep: true
+ }
+ },
onLoad(){
if(this.isLogin){
- // #ifdef H5
this.getUseCoupons();
- // #endif
}else{
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this,'isShowAuth',true)
- // #endif
}
},
/**
diff --git a/pages/users/user_goods_collection/index.vue b/pages/users/user_goods_collection/index.vue
index eae09cd9..2bc6f78c 100644
--- a/pages/users/user_goods_collection/index.vue
+++ b/pages/users/user_goods_collection/index.vue
@@ -25,7 +25,7 @@
-
+
@@ -75,16 +75,13 @@
computed: mapGetters(['isLogin']),
onLoad() {
if (this.isLogin) {
+ this.loadend = false;
+ this.page = 1;
+ this.collectProductList = [];
this.get_user_collect_product();
this.get_host_product();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
onShow(){
diff --git a/pages/users/user_info/index.vue b/pages/users/user_info/index.vue
index 17331ca6..56f57d96 100644
--- a/pages/users/user_info/index.vue
+++ b/pages/users/user_info/index.vue
@@ -16,13 +16,19 @@
手机号码
-
+
+
+
+
+
+
+
ID号
@@ -53,7 +59,7 @@
-
+
@@ -93,17 +99,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch: {
+ isLogin: {
+ handler: function(newV, oldV) {
+ if (newV) {
+ this.getUserInfo();
+ }
+ },
+ deep: true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
@@ -164,6 +174,8 @@
getUserInfo().then(res => {
res.data.localPath = res.data.avatar;
that.$set(that, 'userInfo', res.data);
+ that.$store.commit("UPDATE_USERINFO", res.data);
+ that.$store.commit("SETUID", res.data.uid);
});
},
/**
diff --git a/pages/users/user_integral/index.vue b/pages/users/user_integral/index.vue
index adae88fe..c47044ae 100644
--- a/pages/users/user_integral/index.vue
+++ b/pages/users/user_integral/index.vue
@@ -61,7 +61,7 @@
-
+
@@ -109,18 +109,23 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ this.getIntegralList();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
this.getIntegralList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
/**
diff --git a/pages/users/user_money/index.vue b/pages/users/user_money/index.vue
index 2fba47d1..f48ca8fd 100644
--- a/pages/users/user_money/index.vue
+++ b/pages/users/user_money/index.vue
@@ -121,7 +121,7 @@
-
+
@@ -174,6 +174,19 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ this.get_host_product();
+ this.get_activity();
+ this.userDalance();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
@@ -181,13 +194,7 @@
this.get_activity();
this.userDalance();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_payment/index.vue b/pages/users/user_payment/index.vue
index f44339f6..c545dfe5 100644
--- a/pages/users/user_payment/index.vue
+++ b/pages/users/user_payment/index.vue
@@ -47,7 +47,7 @@
-
+
@@ -102,6 +102,18 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ this.getRecharge();
+ this.getUserExtractBank();
+ }
+ },
+ deep:true
+ }
+ },
onLoad(options) {
// #ifdef H5
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5"
@@ -111,13 +123,7 @@
this.getRecharge();
this.getUserExtractBank();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_phone/index.vue b/pages/users/user_phone/index.vue
index 635f5288..e330bd74 100644
--- a/pages/users/user_phone/index.vue
+++ b/pages/users/user_phone/index.vue
@@ -1,23 +1,25 @@
-
+
+
+
-
+
@@ -27,7 +29,8 @@
import {
registerVerify,
bindingPhone,
- verifyCode
+ verifyCode,
+ bindingVerify
} from '@/api/api.js';
import {
toLogin
@@ -51,31 +54,75 @@
captcha:'',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
- key: ''
+ key: '',
+ isNew: true,
+ timer: '',
+ text: '获取验证码',
+ nums: 60
};
},
- computed: mapGetters(['isLogin']),
+ mounted() {
+ // this.timer = setInterval(this.getTimes, 1000);
+ },
+ computed: mapGetters(['isLogin','userInfo']),
onLoad() {
if (this.isLogin) {
// verifyCode().then(res=>{
// this.$set(this, 'key', res.data.key)
// });
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
+ getTimes(){
+ this.nums = this.nums - 1;
+ this.text = "剩余 " + this.nums + "s";
+ if (this.nums < 0) {
+ clearInterval(this.timer);
+ }
+ this.text = "剩余 " + this.nums + "s";
+ if (this.text < "剩余 " + 0 + "s") {
+ this.disabled = false;
+ this.text = "重新获取";
+ }
+ },
onLoadFun:function(){},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
+ next() {
+ uni.hideLoading();
+ this.isNew = false;
+ this.captcha = '';
+ clearInterval(this.timer);
+ this.disabled = false;
+ this.text = "获取验证码";
+ uni.showLoading({
+ title: '加载中',
+ mask: true
+ });
+ if (!this.captcha) return this.$util.Tips({
+ title: '请填写验证码'
+ });
+ bindingVerify({
+ phone: this.userInfo.phone,
+ captcha: this.captcha
+ }).then(res => {
+ uni.hideLoading();
+ this.isNew = false;
+ this.captcha = '';
+ clearInterval(this.timer);
+ this.disabled = false;
+ this.text = "获取验证码";
+ }).catch(err => {
+ return this.$util.Tips({
+ title: err
+ });
+ uni.hideLoading();
+ })
+ },
editPwd: function() {
let that = this;
if (!that.phone) return that.$util.Tips({
@@ -88,12 +135,12 @@
title: '请填写验证码'
});
uni.showModal({
- title: '是否绑定账号',
+ title: '是否更换绑定账号',
confirmText: '绑定',
success(res) {
if (res.confirm) {
bindingPhone({
- account: that.phone,
+ phone: that.phone,
captcha: that.captcha
}).then(res => {
return that.$util.Tips({
@@ -110,7 +157,7 @@
})
} else if (res.cancel) {
return that.$util.Tips({
- title: '您已取消绑定!'
+ title: '您已取消更换绑定!'
}, {
tab: 5,
url: '/pages/users/user_info/index'
@@ -124,22 +171,33 @@
*
*/
async code() {
+ this.nums = 60;
+ uni.showLoading({
+ title: '加载中',
+ mask: true
+ });
let that = this;
- if (!that.phone) return that.$util.Tips({
- title: '请填写手机号码!'
- });
- if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
- title: '请输入正确的手机号码!'
- });
- await registerVerify(that.phone).then(res => {
+ if(!that.isNew){
+ if (!that.phone) return that.$util.Tips({
+ title: '请填写手机号码!'
+ });
+ if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
+ title: '请输入正确的手机号码!'
+ });
+ }
+ await registerVerify(that.isNew?that.userInfo.phone:that.phone).then(res => {
that.$util.Tips({
title: res.message
});
- that.sendCode();
+
+ that.timer = setInterval(that.getTimes, 1000);
+ that.disabled = true;
+ uni.hideLoading();
}).catch(err => {
return that.$util.Tips({
title: err
});
+ uni.hideLoading();
});
}
}
diff --git a/pages/users/user_pwd_edit/index.vue b/pages/users/user_pwd_edit/index.vue
index 4bd4768d..68cafe2a 100644
--- a/pages/users/user_pwd_edit/index.vue
+++ b/pages/users/user_pwd_edit/index.vue
@@ -21,7 +21,7 @@
-
+
@@ -63,17 +63,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_return_list/index.vue b/pages/users/user_return_list/index.vue
index a0e93697..2f48e8e9 100644
--- a/pages/users/user_return_list/index.vue
+++ b/pages/users/user_return_list/index.vue
@@ -26,7 +26,7 @@
{{loadTitle}}
-
+
@@ -67,17 +67,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getOrderList();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getOrderList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
/**
diff --git a/pages/users/user_sgin/index.vue b/pages/users/user_sgin/index.vue
index 43b493a1..d89e2a2a 100644
--- a/pages/users/user_sgin/index.vue
+++ b/pages/users/user_sgin/index.vue
@@ -21,7 +21,8 @@
- {{item.title}}
+ {{item.title}}
+
+{{item.integral}}
@@ -64,7 +65,7 @@
-
+
@@ -109,19 +110,25 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getUserInfo();
+ this.getSignSysteam();
+ this.getSignList();
+ }
+ },
+ deep:true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getUserInfo();
this.getSignSysteam();
this.getSignList();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
diff --git a/pages/users/user_sgin_list/index.vue b/pages/users/user_sgin_list/index.vue
index 2f378e65..4214bdb8 100644
--- a/pages/users/user_sgin_list/index.vue
+++ b/pages/users/user_sgin_list/index.vue
@@ -20,7 +20,7 @@
-
+
@@ -51,17 +51,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch:{
+ isLogin:{
+ handler:function(newV,oldV){
+ if(newV){
+ this.getSignMoneList();
+ }
+ },
+ deep:true
+ }
+ },
onLoad(){
if(this.isLogin){
this.getSignMoneList();
}else{
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this,'isShowAuth',true)
- // #endif
}
},
onReachBottom: function () {
diff --git a/pages/users/user_spread_code/index.vue b/pages/users/user_spread_code/index.vue
index f537b8b1..e7f56694 100644
--- a/pages/users/user_spread_code/index.vue
+++ b/pages/users/user_spread_code/index.vue
@@ -21,7 +21,7 @@
-
+
@@ -83,19 +83,23 @@
};
},
computed: mapGetters(['isLogin']),
+ watch: {
+ isLogin: {
+ handler: function(newV, oldV) {
+ if (newV) {
+ this.userSpreadBannerList();
+ }
+ },
+ deep: true
+ }
+ },
onLoad() {
if (this.isLogin) {
// // #ifdef H5
this.userSpreadBannerList();
// // #endif
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
/**
diff --git a/pages/users/user_spread_money/index.vue b/pages/users/user_spread_money/index.vue
index 5dbe8b69..b71d276f 100644
--- a/pages/users/user_spread_money/index.vue
+++ b/pages/users/user_spread_money/index.vue
@@ -45,7 +45,7 @@
{{child.title}}
- {{child.price}}
+ {{child.updateTime}}
+{{child.price}}
-{{child.price}}
@@ -61,7 +61,7 @@
-
+
@@ -113,13 +113,7 @@
if (this.isLogin) {
this.type = options.type;
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
onShow: function() {
diff --git a/pages/users/user_spread_user/index.vue b/pages/users/user_spread_user/index.vue
index 04cd5a0a..aec204df 100644
--- a/pages/users/user_spread_user/index.vue
+++ b/pages/users/user_spread_user/index.vue
@@ -52,7 +52,7 @@
-
+
@@ -86,17 +86,21 @@
};
},
computed: mapGetters(['isLogin']),
+ watch: {
+ isLogin: {
+ handler: function(newV, oldV) {
+ if (newV) {
+ this.getUserInfo();
+ }
+ },
+ deep: true
+ }
+ },
onLoad() {
if (this.isLogin) {
this.getSpreadInfo();
} else {
- // #ifdef H5 || APP-PLUS
toLogin();
- // #endif
- // #ifdef MP
- this.isAuto = true;
- this.$set(this, 'isShowAuth', true)
- // #endif
}
},
methods: {
@@ -108,17 +112,20 @@
this.isShowAuth = e
},
openSubscribe: function(page) {
- uni.showLoading({
- title: '正在加载',
- })
- openExtrctSubscribe().then(res => {
- uni.hideLoading();
- uni.navigateTo({
- url: page,
- });
- }).catch(() => {
- uni.hideLoading();
+ uni.navigateTo({
+ url: page,
});
+ // uni.showLoading({
+ // title: '正在加载',
+ // })
+ // openExtrctSubscribe().then(res => {
+ // uni.hideLoading();
+ // uni.navigateTo({
+ // url: page,
+ // });
+ // }).catch(() => {
+ // uni.hideLoading();
+ // });
},
/**
* 获取个人用户信息
diff --git a/pages/users/user_vip/index.vue b/pages/users/user_vip/index.vue
index 80d0d7b8..e87ac5c6 100644
--- a/pages/users/user_vip/index.vue
+++ b/pages/users/user_vip/index.vue
@@ -90,7 +90,7 @@
去获取
-
+
@@ -163,6 +163,8 @@
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
+ that.$store.commit("SETUID", res.data.uid);
+ that.$store.commit("UPDATE_USERINFO", res.data);
that.userInfo = res.data;
that.levelInfo = res.data.experience;
}).catch(function(res) {
diff --git a/pages/users/user_vip/index01.vue b/pages/users/user_vip/index01.vue
deleted file mode 100644
index 4f9eb4be..00000000
--- a/pages/users/user_vip/index01.vue
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-
-
-
-
- 会员升级要求
- {{reach_count || 0}}/{{task.length || 0}}
-
-
-
-
- {{item.name}}
- 已满足条件
- 未满足条件
-
-
-
-
-
- {{item.task_type_title}}
- {{item.new_number || 0}}/{{item.number || 0}}
-
-
-
-
-
-
-
-
-
- {{illustrate}}
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/users/wechat_login/index.vue b/pages/users/wechat_login/index.vue
index 04e5f97c..638054e3 100644
--- a/pages/users/wechat_login/index.vue
+++ b/pages/users/wechat_login/index.vue
@@ -1,10 +1,14 @@
-
+
-
-
+
+
+
+
+
+
账户登录
@@ -13,13 +17,13 @@
-
-
+
-
+
+
@@ -36,6 +40,9 @@
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import mobileLogin from '@/components/login_mobile/index.vue'
import routinePhone from '@/components/login_mobile/routine_phone.vue'
+ import {
+ mapGetters
+ } from "vuex";
import {
getLogo,
silenceAuth,
@@ -56,34 +63,39 @@
export default {
data() {
return {
- isUp:false,
+ isUp: false,
phone: '',
statusBarHeight: statusBarHeight,
- isHome:false,
- isPhoneBox:false,
- logoUrl:'',
- code:'',
- authKey:'',
- options:'',
- userInfo:{},
- codeNum:0
+ isHome: false,
+ isPhoneBox: false,
+ logoUrl: '',
+ code: '',
+ authKey: '',
+ options: '',
+ userInfo: {},
+ codeNum: 0
}
},
- components:{
+ components: {
mobileLogin,
routinePhone
},
+ computed: mapGetters({
+ 'authorizeType': 'authorizeType'
+ }),
onLoad(options) {
- getLogo().then(res=>{
- this.logoUrl = res.data.logo_url
+ console.log('options',options)
+ if (this.authorizeType === 'register') this.isPhoneBox = true
+ getLogo().then(res => {
+ this.logoUrl = res.data.logoUrl
})
let that = this
// #ifdef H5
document.body.addEventListener("focusout", () => {
- setTimeout(() => {
- const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
- window.scrollTo(0, Math.max(scrollHeight - 1, 0));
- }, 100);
+ setTimeout(() => {
+ const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
+ window.scrollTo(0, Math.max(scrollHeight - 1, 0));
+ }, 100);
});
const {
code,
@@ -91,66 +103,72 @@
scope
} = options;
this.options = options
+ console.log('lalaal',this.options)
// 获取确认授权code
this.code = code || ''
- if(code){
- let spread = app.globalData.spid ? app.globalData.spid : '';
- //公众号授权登录回调
- wechat.auth(code, state).then(res => {
- if (res.key !== undefined && res.key) {
- that.authKey = res.key;
- that.isUp = true
- }else{
- let time = res.expires_time - that.$Cache.time();
- that.$store.commit('LOGIN', {
- token: res.token,
- time: time
+ if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
+ if (code && this.options.scope !== 'snsapi_base') {
+ let spread = app.globalData.spid ? app.globalData.spid : 0;
+ //公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
+ wechat.auth(code, spread).then(res => {
+ console.log('进来的授权',res)
+ if (res.type === 'register') {
+ this.authKey = res.key;
+ console.log('authKey',this.authKey)
+ this.isUp = true
+ }
+ if(res.type === 'login'){
+ // let time = res.data.expires_time - this.$Cache.time();
+ this.$store.commit('LOGIN', {
+ token: res.data.token,
+ // time: time
});
- that.userInfo = res.userInfo
- that.$store.commit("SETUID", res.userInfo.uid);
- that.$store.commit("UPDATE_USERINFO", res.userInfo);
- that.wechatPhone()
+ // this.$store.commit('SETUID', res.data.userInfo.uid);
+ // this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
+ this.wechatPhone();
+ //location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
}
}).catch(error => {
- // location.replace("/");
});
}
// #endif
let pages = getCurrentPages();
- let prePage = pages[pages.length - 2];
- if(prePage.route == 'pages/order_addcart/order_addcart'){
- this.isHome = true
- }else{
- this.isHome = false
- }
-
+ console.log('数据库1',pages)
+ // let prePage = pages[pages.length - 2];
+ // console.log('数据库',prePage)
+ // if (prePage.route == 'pages/order_addcart/order_addcart') {
+ // this.isHome = true
+ // } else {
+ // this.isHome = false
+ // }
+
},
methods: {
- back(){
+ back() {
uni.navigateBack();
},
- home(){
+ home() {
uni.switchTab({
- url:'/pages/index/index'
+ url: '/pages/index/index'
})
},
// 弹窗关闭
- maskClose(){
+ maskClose() {
this.isUp = false
},
- bindPhoneClose(data){
- if(data.isStatus){
+ bindPhoneClose(data) {
+ if (data.isStatus) {
this.isPhoneBox = false
this.$util.Tips({
- title:'登录成功',
- icon:'success'
- },{
- tab:3
+ title: '登录成功',
+ icon: 'success'
+ }, {
+ tab: 3
})
- }else{
+ } else {
this.isPhoneBox = false
}
-
+
},
// #ifdef MP
// 小程序获取手机号码
@@ -174,7 +192,9 @@
iv: iv,
code: code,
spid: app.globalData.spid,
- spread: app.globalData.code
+ spread: app.globalData.code,
+ type: 'routine',
+ key: this.authKey
})
.then(res => {
let time = res.data.expires_time - this.$Cache.time();
@@ -194,8 +214,10 @@
})
.catch(res => {
- console.log(res);
uni.hideLoading();
+ that.$util.Tips({
+ title: res
+ });
});
},
/**
@@ -217,7 +239,9 @@
});
},
setUserInfo(e) {
- uni.showLoading({ title: '正在登录中' });
+ uni.showLoading({
+ title: '正在登录中'
+ });
Routine.getCode()
.then(code => {
this.getWxUser(code);
@@ -226,21 +250,29 @@
uni.hideLoading();
});
},
- getWxUser(code){
+ getWxUser(code) {
let self = this
Routine.getUserInfo()
.then(res => {
let userInfo = res.userInfo;
userInfo.code = code;
- userInfo.spread_spid = app.globalData.spid; //获取推广人ID
- userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
- Routine.authUserInfo(userInfo)
+ userInfo.spread_spid = app.globalData.spid;//获取推广人ID
+ userInfo.spread_code = app.globalData.code;//获取推广人分享二维码ID
+ userInfo.avatar = userInfo.userInfo.avatarUrl;
+ userInfo.city = userInfo.userInfo.city;
+ userInfo.country = userInfo.userInfo.country;
+ userInfo.nickName = userInfo.userInfo.nickName;
+ userInfo.province = userInfo.userInfo.province;
+ userInfo.sex = userInfo.userInfo.gender;
+ userInfo.type = 'routine'
+ Routine.authUserInfo(userInfo.code, userInfo)
.then(res => {
- if(res.data.key !== undefined && res.data.key){
+ console.log(res)
+ self.authKey = res.data.key;
+ if (res.data.type === 'register') {
uni.hideLoading();
- self.authKey = res.data.key;
self.isPhoneBox = true
- }else{
+ } else {
uni.hideLoading();
let time = res.data.expires_time - self.$Cache.time();
self.$store.commit('LOGIN', {
@@ -248,13 +280,12 @@
time: time
});
self.$util.Tips({
- title:res,
- icon:'success'
- },{
- tab:3
+ title: res,
+ icon: 'success'
+ }, {
+ tab: 3
})
}
-
})
.catch(res => {
uni.hideLoading();
@@ -269,8 +300,8 @@
uni.hideLoading();
});
},
-
-
+
+
// #endif
// #ifdef H5
// 获取url后面的参数
@@ -279,35 +310,62 @@
var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
var r = window.location.search.substr(1).match(reg);
var q = window.location.pathname.substr(1).match(reg_rewrite);
- if(r != null){
- return unescape(r[2]);
- }else if(q != null){
- return unescape(q[2]);
- }else{
- return null;
+ if (r != null) {
+ return unescape(r[2]);
+ } else if (q != null) {
+ return unescape(q[2]);
+ } else {
+ return null;
}
},
// 公众号登录
- wechatLogin(){
- if(!this.code){
- this.$wechat.oAuth('','/pages/users/wechat_login/index')
- }else{
+ wechatLogin() {
+ console.log('微信登录',this.code)
+ console.log('微信登录2',this.options.code)
+ console.log('微信登录3',this.authKey)
+ console.log('isUp2',this.isUp)
+ if (!this.code && this.options.scope !== 'snsapi_base') {
+ this.$wechat.oAuth('snsapi_userinfo', '/pages/users/wechat_login/index');
+ } else {
+ console.log('isUp',this.isUp)
+ // if (this.authKey) {
+ // this.isUp = true;
+ // }
+ this.isUp = true;
}
+ // wechat.auth(this.code, this.$Cache.get("spread")).then(res => {
+ // if (res.data.type === 'register') {
+ // this.authKey = res.data.key;
+ // this.isUp = true
+ // }
+ // if(res.data.type === 'login'){
+ // let time = res.data.expires_time - this.$Cache.time();
+ // this.$store.commit('LOGIN', {
+ // token: res.data.token,
+ // time: time
+ // });
+ // this.$store.commit('SETUID', res.data.userInfo.uid);
+ // this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
+ // // location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
+ // }
+ // }).catch(error => {
+ // // location.replace("/");
+ // });
},
// 输入手机号后的回调
- wechatPhone(){
- if(this.options.back_url){
- let url = uni.getStorageSync('snRouter')
+ wechatPhone() {
+ if (this.options.back_url) {
+ let url = uni.getStorageSync('snRouter')
let self = this
this.isUp = false
uni.showToast({
- title:'登录成功',
- icon:'none'
+ title: '登录成功',
+ icon: 'none'
})
- setTimeout(res=>{
- location.href = url.indexOf("/pages/index/index") != -1?'/':url
- },800)
- }else{
+ setTimeout(res => {
+ location.href = url.indexOf("/pages/index/index") != -1 ? '/' : url
+ }, 800)
+ } else {
uni.navigateBack()
}
}
@@ -316,11 +374,15 @@
}
-