+
-
登录
-
登录
-
-
- 没有账号?
- 快速登录
-
+
登录
+
登录
+
-
@@ -126,7 +76,7 @@
validatorDefaultCatch
} from "@/utils/dialog";
import {
- getLogo
+ getLogo, appAuth, appleLogin
} from "@/api/public";
import {
VUE_APP_API_URL
@@ -140,7 +90,7 @@
data: function() {
return {
navList: ["快速登录", "账号登录"],
- current: 0,
+ current: 1,
account: "",
password: "",
captcha: "",
@@ -150,7 +100,13 @@
keyCode: "",
codeUrl: "",
codeVal: "",
- isShowCode: false
+ isShowCode: false,
+ platform: '',
+ appLoginStatus: false, // 微信登录强制绑定手机号码状态
+ appUserInfo: null, // 微信登录保存的用户信息
+ appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
+ appleUserInfo: null,
+ appleShow: false // 苹果登录版本必须要求ios13以上的
};
},
watch:{
@@ -166,7 +122,143 @@
this.getCode();
this.getLogoImage();
},
+ onLoad() {
+ let self = this
+ uni.getSystemInfo({
+ success: function(res) {
+ if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) {
+ self.appleShow = true
+ }
+ }
+ });
+ },
methods: {
+ // 苹果登录
+ appleLogin() {
+ let self = this
+ this.account = ''
+ this.captcha = ''
+ uni.showLoading({
+ title: '登录中'
+ })
+ uni.login({
+ provider: 'apple',
+ timeout: 10000,
+ success(loginRes) {
+ uni.getUserInfo({
+ provider: 'apple',
+ success: function(infoRes) {
+ self.appleUserInfo = infoRes.userInfo
+ self.appleLoginApi()
+ },
+ fail() {
+ uni.hideLoading()
+ uni.showToast({
+ title: '获取用户信息失败',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ complete() {
+ uni.hideLoading()
+ }
+ });
+ },
+ fail(error) {
+ uni.hideLoading()
+ console.log(error)
+ }
+ })
+ },
+ // 苹果登录Api
+ appleLoginApi() {
+ let self = this
+ appleLogin({
+ openId: self.appleUserInfo.openId,
+ email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email,
+ identityToken: self.appleUserInfo.identityToken || ''
+ }).then((res) => {
+ this.$store.commit("LOGIN", {
+ 'token': res.data.token
+ });
+ this.getUserInfo(res.data);
+ }).catch(error => {
+ uni.hideLoading();
+ 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) {
+ uni.hideLoading();
+ self.appUserInfo = infoRes.userInfo
+ self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx'
+ self.wxLoginGo(self.appUserInfo)
+ },
+ fail() {
+ uni.hideLoading();
+ uni.showToast({
+ title: '获取用户信息失败',
+ icon: 'none',
+ duration: 2000
+ })
+ },
+ complete() {
+ uni.hideLoading()
+ }
+ });
+ },
+ fail() {
+ uni.hideLoading()
+ uni.showToast({
+ title: '登录失败',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ });
+ },
+ wxLoginGo(userInfo) {
+ appAuth(userInfo).then(res => {
+ if (res.data.type === 'register') {
+ uni.navigateTo({
+ url: '/pages/users/app_login/index?authKey='+res.data.key
+ })
+ }
+ if (res.data.type === 'login') {
+ this.$store.commit("LOGIN", {
+ 'token': res.data.token
+ });
+ this.getUserInfo(res.data);
+ }
+ }).catch(res => {
+ that.$util.Tips({
+ title: res
+ });
+ });
+ },
again() {
this.codeUrl =
VUE_APP_API_URL +
@@ -177,20 +269,11 @@
},
getCode() {
let that = this
- // getCodeApi()
- // .then(res => {
- // that.keyCode = res.data.key;
- // })
- // .catch(res => {
- // that.$util.Tips({
- // title: res
- // });
- // });
},
async getLogoImage() {
let that = this;
getLogo().then(res => {
- that.logoUrl = res.data.logoUrl;
+ that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png';
});
},
async loginMobile() {
@@ -208,34 +291,17 @@
title: '请输入正确的验证码'
});
loginMobile({
- account: that.account,
+ phone: that.account,
captcha: that.captcha,
- spread: that.$Cache.get("spread")
+ spread_spid: that.$Cache.get("spread")
})
.then(res => {
let data = res.data;
let newTime = Math.round(new Date() / 1000);
- that.$store.commit("LOGIN", {
- 'token': data.token
- // 'time': dayjs(data.expiresTime) - newTime
+ this.$store.commit("LOGIN", {
+ 'token': res.data.token
});
- 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);
- if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
- '/pages/user/index') {
-
- uni.switchTab({
- url: backUrl
- });
-
- } else {
- uni.switchTab({
- url: '/pages/index/index'
- });
- }
- // })
+ that.getUserInfo(data);
})
.catch(res => {
that.$util.Tips({
@@ -290,21 +356,15 @@
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
- // phone: that.account
- // type: that.type,
- // key: that.keyCode,
- // code: that.codeVal
await registerVerify(that.account)
.then(res => {
that.$util.Tips({title:res.message});
that.sendCode();
})
- .catch(res => {
- // if (res.data.status === 402) {
- // that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
- // that.isShowCode = true;
- // }
- that.$util.Tips({title:res.message});
+ .catch(err => {
+ return that.$util.Tips({
+ title: err
+ });
});
},
navTap: function(index) {
@@ -329,44 +389,210 @@
.then(({
data
}) => {
- // let newTime = Math.round(new Date() / 1000);
- that.$store.commit("LOGIN", {
+ this.$store.commit("LOGIN", {
'token': data.token
- // 'time': dayjs(data.expiresTime) - newTime
});
- const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
- that.$Cache.clear(BACK_URL);
- getUserInfo().then(res => {
- that.$store.commit("SETUID", res.data.uid);
- if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
- uni.switchTab({
- url: backUrl
- });
- } else {
- uni.switchTab({
- url: '/pages/index/index'
- });
- }
- })
+ that.getUserInfo(data);
})
.catch(e => {
that.$util.Tips({
title: e
});
});
+ },
+ getUserInfo(data){
+ this.$store.commit("SETUID", data.uid);
+ getUserInfo().then(res => {
+ this.$store.commit("UPDATE_USERINFO", res.data);
+ let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
+ if (backUrl.indexOf('/pages/users/login/index') !== -1) {
+ backUrl = '/pages/index/index';
+ }
+ uni.reLaunch({
+ url: backUrl
+ });
+ })
}
}
};
-
\ No newline at end of file
+
+ .login-wrapper {
+ padding: 30rpx;
+
+ .shading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+
+ /* #ifdef APP-VUE */
+ margin-top: 50rpx;
+ /* #endif */
+ /* #ifndef APP-VUE */
+
+ margin-top: 200rpx;
+ /* #endif */
+
+
+ image {
+ width: 180rpx;
+ height: 180rpx;
+ }
+ }
+
+ .whiteBg {
+ margin-top: 100rpx;
+
+ .list {
+ border-radius: 16rpx;
+ overflow: hidden;
+
+ .item {
+ border-bottom: 1px solid #F0F0F0;
+ background: #fff;
+
+ .row-middle {
+ position: relative;
+ padding: 16rpx 45rpx;
+
+ .texts{
+ flex: 1;
+ font-size: 28rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+
+ input {
+ flex: 1;
+ font-size: 28rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+
+ .code {
+ position: absolute;
+ right: 30rpx;
+ top: 50%;
+ color: $theme-color;
+ font-size: 26rpx;
+ transform: translateY(-50%);
+ }
+ }
+ }
+ }
+
+ .logon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 86rpx;
+ margin-top: 80rpx;
+ background-color: $theme-color;
+ border-radius: 120rpx;
+ color: #FFFFFF;
+ font-size: 30rpx;
+ }
+
+ .tips {
+ margin: 30rpx;
+ text-align: center;
+ color: #999;
+ }
+ }
+ }
+
diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue
index 2af35f46..33043e6a 100644
--- a/pages/users/order_confirm/index.vue
+++ b/pages/users/order_confirm/index.vue
@@ -1,17 +1,23 @@
-
+
-
-
+
+
-
+
{{addressInfo.realName}}
{{addressInfo.phone}}
- [默认]{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}
+
+ [默认]
+ {{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}
+
设置收货地址
@@ -24,7 +30,8 @@
{{system_store.name}}
{{system_store.phone}}
- {{system_store.address}}{{", " + system_store.detailedAddress}}
+ {{system_store.address}}{{", " + system_store.detailedAddress}}
+
@@ -36,129 +43,134 @@
-
-
-
- 优惠券
- {{couponTitle}}
-
-
-
-
- 积分抵扣
-
- {{useIntegral ? "剩余积分":"当前积分"}}
- {{integral || 0}}
-
-
-
-
-
-
-
- 会员优惠
- -¥{{priceGroup.vipPrice}}
-
-
- 快递费用
- +¥{{priceGroup.storePostage}}
- 免运费
-
-
-
- 联系人
-
-
+
+
+
+
+ 优惠券
+ {{couponTitle}}
+
-
- 联系电话
-
-
+
+
+ 积分抵扣
+
+
+ {{useIntegral ? "剩余积分":"当前积分"}}
+ {{useIntegral ? orderInfoVo.surplusIntegral : orderInfoVo.userIntegral || 0}}
+
+
+
+
-
-
+
+ 快递费用
+
+ +¥{{orderInfoVo.freightFee}}
+
+ 免运费
+
+
+
+ 联系人
+
+
+
+
+
+ 联系电话
+
+
+
+
+
+
-
- 备注信息
-
-
-
-
-
- 支付方式
-
-
-
- {{item.name}}
-
- {{item.title}}
-
-
-
-
+
+ 备注信息
+
+
+
+ 支付方式
+
+
+
+
+
+ {{item.name}}
+
+ {{item.title}}
+
+
+
+
+
+
+ 商品总价:
+ ¥{{orderInfoVo.proTotalFee || 0}}
+
+
+ 优惠券抵扣:
+ -¥{{orderInfoVo.couponFee}}
+
+
+ 积分抵扣:
+ -¥{{orderInfoVo.deductionPrice}}
+
+
+ 运费:
+ +¥{{orderInfoVo.freightFee}}
+
+
+
-
-
- 商品总价:
- ¥{{priceGroup.totalPrice}}
-
-
- 优惠券抵扣:
- -¥{{coupon_price}}
-
-
- 积分抵扣:
- -¥{{integral_price}}
-
-
- 运费:
- +¥{{priceGroup.storePostage}}
-
-
-
-
-
+
+
-
+
diff --git a/pages/users/promoter-list/index.vue b/pages/users/promoter-list/index.vue
index 13eeff3f..7399028b 100644
--- a/pages/users/promoter-list/index.vue
+++ b/pages/users/promoter-list/index.vue
@@ -2,74 +2,84 @@