修复内容
1. 会员等级背景图去掉校验 2. 当查询不到会员等级是,按无会员等级展示 3. 删除商城首页冗余配置在index中的引用 4. 换绑推广人时,计算上一个推广人的推广人数 5. pc后台清除推广人时,更新推广人数量 6. 保证砍价金额最小为0.01 7. 修复商品删除时购物车关联删除 8. 删除商品问题修复 9. 运费模板——指定包邮,包邮数量类型修改 10. 签到错误修复 11. 修复我的优惠券只查询20条的问题 12. 文章列表修复 13. 拼团商品详情页数据统计显示问题修复 14. PC后台,账户详情,持有优惠券列表修复 15. 支付查询参数修复 16. 修复过期优惠券可以重复领取 17. 订单邮费切换地址重复计算修复 18. 判断是否在指定包邮区域内 必须满足件数 + 金额 才能包邮 19. 支付页面,切换tab,金额计算问题修复 20. 物流模板新增、编辑——修复 21. 去除线下邮费的影响 22. 订单运费计算重写 23. 下单页面到店自提合计金额不应该计算商品邮费 24. 新人券领取后,部分使用时间为空——修复
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -74,18 +74,23 @@
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -92,6 +92,16 @@
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getOrderProduct();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.unique || !options.uni || !options.id) return this.$util.Tips({
|
||||
title: '缺少参数'
|
||||
@@ -106,13 +116,7 @@
|
||||
if (this.isLogin) {
|
||||
this.getOrderProduct();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -98,7 +98,9 @@
|
||||
that.$set(that,'reply',that.reply);
|
||||
that.loading = false;
|
||||
that.loadend = loadend;
|
||||
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
|
||||
if(that.reply.length){
|
||||
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
|
||||
}
|
||||
that.page = that.page + 1;
|
||||
}).catch(err => {
|
||||
that.loading = false,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- #ifdef H5 -->
|
||||
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="store-phone" @click="call(item.phone)"><text class="iconfont icon-dadianhua01"></text></view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -78,10 +78,27 @@
|
||||
},
|
||||
orderInfo: {},
|
||||
expressList: [],
|
||||
hostProduct: []
|
||||
hostProduct: [],
|
||||
loading: false,
|
||||
goodScroll: true,
|
||||
params: { //精品推荐分页
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getExpress();
|
||||
this.get_host_product();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
|
||||
this.orderId = options.orderId;
|
||||
@@ -89,13 +106,7 @@
|
||||
this.getExpress();
|
||||
this.get_host_product();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onReady: function() {
|
||||
@@ -133,13 +144,43 @@
|
||||
/**
|
||||
* 获取我的推荐
|
||||
*/
|
||||
// getGroomList(onloadH) {
|
||||
// this.loading = true
|
||||
// if (!this.goodScroll) return
|
||||
// if (onloadH) {
|
||||
// this.iSshowH = true
|
||||
// }
|
||||
// getGroomList(type, this.params).then(({
|
||||
// data
|
||||
// }) => {
|
||||
// this.iSshowH = false
|
||||
// this.loading = false
|
||||
// this.goodScroll = data.list.length >= this.params.limit
|
||||
// this.params.page++
|
||||
// this.tempArr = this.tempArr.concat(data.list)
|
||||
// })
|
||||
// }
|
||||
get_host_product: function () {
|
||||
this.loading = true
|
||||
if (!this.goodScroll) return
|
||||
let that = this;
|
||||
getProductHot().then(function (res) {
|
||||
that.$set(that,'hostProduct',res.data.list);
|
||||
getProductHot(that.params.page,that.params.limit).then(function (res) {
|
||||
//this.iSshowH = false
|
||||
that.loading = false
|
||||
that.goodScroll = res.data.list.length >= that.params.limit
|
||||
that.params.page++
|
||||
that.hostProduct = that.hostProduct.concat(res.data.list)
|
||||
// that.$set(that,'hostProduct',res.data.list);
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
// 滚动到底部
|
||||
onReachBottom() {
|
||||
|
||||
if (this.params.page != 1) {
|
||||
this.get_host_product();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -93,6 +93,17 @@
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
if (!options.orderId) return this.$util.Tips({title:'缺少订单id,无法退款'},{tab:3,url:1});
|
||||
this.orderId = options.orderId;
|
||||
@@ -100,13 +111,7 @@
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -1,47 +1,36 @@
|
||||
<template>
|
||||
<div class="register absolute">
|
||||
<div class="login-wrapper">
|
||||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="/static/images/logo2.png" v-else />
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
|
||||
:key="index">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 1">
|
||||
<div class="list" v-if="current !== 1">
|
||||
<form @submit.prevent="submit">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
||||
<span class="iconfont icon-wenti"></span>忘记密码
|
||||
</navigator> -->
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 0">
|
||||
<div class="list" v-if="current !== 0 || appLoginStatus || appleLoginStatus">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
@@ -50,59 +39,44 @@
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
|
||||
<div class="tip">
|
||||
<div :hidden="current !== 1">
|
||||
没有账号?
|
||||
<span @click="current = 0" class="font-color-red">快速登录</span>
|
||||
</div>
|
||||
<div class="logon" @click="loginMobile" v-if="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" v-if="current === 0">登录</div>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<div class="tips">
|
||||
<div v-if="current==0" @click="current = 1">快速登录</div>
|
||||
<div v-if="current==1" @click="current = 0">账号登录</div>
|
||||
</div>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
|
||||
<view class="hds">
|
||||
<span class="line"></span>
|
||||
<p>其他方式登录</p>
|
||||
<span class="line"></span>
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<view class="btn wx" @click="wxLogin">
|
||||
<span class="iconfont icon-s-weixindenglu1"></span>
|
||||
</view>
|
||||
<view class="btn mima" v-if="current == 1" @click="current =0">
|
||||
<span class="iconfont icon-s-mimadenglu1"></span>
|
||||
</view>
|
||||
<view class="btn yanzheng" v-if="current == 0" @click="current =1">
|
||||
<span class="iconfont icon-s-yanzhengmadenglu1"></span>
|
||||
</view>
|
||||
<view class="apple-btn" @click="appleLogin" v-if="appleShow">
|
||||
<view class="iconfont icon-s-pingguo"></view>通过Apple登录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
<!-- <div class="whiteBg" v-else>
|
||||
<div class="title">注册账号</div>
|
||||
<div class="list">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_1.png"></image>
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="register">注册</div>
|
||||
<div class="tip">
|
||||
已有账号?
|
||||
<span @click="formItem = 1" class="font-color-red">立即登录</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -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 @@
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.appLogin {
|
||||
margin-top: 60rpx;
|
||||
|
||||
.hds {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: #B4B4B4;
|
||||
|
||||
.line {
|
||||
width: 68rpx;
|
||||
height: 1rpx;
|
||||
background: #CCCCCC;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.apple-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 246rpx;
|
||||
height: 66rpx;
|
||||
margin-left: 30rpx;
|
||||
background: #EAEAEA;
|
||||
border-radius: 34rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.icon-s-pingguo {
|
||||
color: #333;
|
||||
margin-right: 10rpx;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.wx {
|
||||
margin-right: 30rpx;
|
||||
background-color: #61C64F;
|
||||
}
|
||||
|
||||
.mima {
|
||||
background-color: #28B3E9;
|
||||
}
|
||||
|
||||
.yanzheng {
|
||||
background-color: #F89C23;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -371,6 +555,67 @@
|
||||
.acea-row.row-middle {
|
||||
input {
|
||||
margin-left: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.login-wrapper{
|
||||
padding: 30rpx;
|
||||
.shading{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
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: 30rpx 45rpx;
|
||||
input{
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.code{
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
color: #E93323;
|
||||
font-size: 26rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.logon{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
margin-top: 100rpx;
|
||||
background-color: $theme-color;
|
||||
border-radius: 120rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.tips{
|
||||
margin:30rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,372 +0,0 @@
|
||||
<template>
|
||||
<div class="register absolute">
|
||||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
|
||||
:key="index">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 1">
|
||||
<form @submit.prevent="submit">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
||||
<span class="iconfont icon-wenti"></span>忘记密码
|
||||
</navigator> -->
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 0">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
|
||||
<div class="tip">
|
||||
<div :hidden="current !== 1">
|
||||
没有账号?
|
||||
<span @click="current = 0" class="font-color-red">快速登录</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="whiteBg" v-else>
|
||||
<div class="title">注册账号</div>
|
||||
<div class="list">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_1.png"></image>
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="register">注册</div>
|
||||
<div class="tip">
|
||||
已有账号?
|
||||
<span @click="formItem = 1" class="font-color-red">立即登录</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import {
|
||||
loginH5,
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
register,
|
||||
// getCodeApi,
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
import attrs, {
|
||||
required,
|
||||
alpha_num,
|
||||
chs_phone
|
||||
} from "@/utils/validate";
|
||||
import {
|
||||
validatorDefaultCatch
|
||||
} from "@/utils/dialog";
|
||||
import {
|
||||
getLogo
|
||||
} from "@/api/public";
|
||||
import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/utils";
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
mixins: [sendVerifyCode],
|
||||
data: function() {
|
||||
return {
|
||||
navList: ["快速登录", "账号登录"],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
formItem: 1,
|
||||
type: "login",
|
||||
logoUrl: "",
|
||||
keyCode: "",
|
||||
codeUrl: "",
|
||||
codeVal: "",
|
||||
isShowCode: false
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
formItem:function(nval,oVal){
|
||||
if(nval == 1){
|
||||
this.type = 'login'
|
||||
}else{
|
||||
this.type = 'register'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.getCode();
|
||||
this.getLogoImage();
|
||||
},
|
||||
methods: {
|
||||
again() {
|
||||
this.codeUrl =
|
||||
VUE_APP_API_URL +
|
||||
"/sms_captcha?" +
|
||||
"key=" +
|
||||
this.keyCode +
|
||||
Date.parse(new Date());
|
||||
},
|
||||
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;
|
||||
});
|
||||
},
|
||||
async loginMobile() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (!that.captcha) return that.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||
title: '请输入正确的验证码'
|
||||
});
|
||||
loginMobile({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
spread: 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
|
||||
});
|
||||
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'
|
||||
});
|
||||
}
|
||||
// })
|
||||
})
|
||||
.catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
async register() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (!that.captcha) return that.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||
title: '请输入正确的验证码'
|
||||
});
|
||||
if (!that.password) return that.$util.Tips({
|
||||
title: '请填写密码'
|
||||
});
|
||||
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
|
||||
title: '您输入的密码过于简单'
|
||||
});
|
||||
register({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
that.formItem = 1;
|
||||
})
|
||||
.catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
async code() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
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});
|
||||
});
|
||||
},
|
||||
navTap: function(index) {
|
||||
this.current = index;
|
||||
},
|
||||
async submit() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写账号'
|
||||
});
|
||||
if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的账号'
|
||||
});
|
||||
if (!that.password) return that.$util.Tips({
|
||||
title: '请填写密码'
|
||||
});
|
||||
loginH5({
|
||||
account: that.account,
|
||||
password: that.password,
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
// let newTime = Math.round(new Date() / 1000);
|
||||
that.$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'
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
that.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.acea-row.row-middle {
|
||||
input {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -142,7 +142,7 @@
|
||||
<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address' :pagesUrl="pagesUrl"
|
||||
@OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
|
||||
@@ -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: {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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() {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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: {
|
||||
|
||||
@@ -10,21 +10,21 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="rank acea-row row-bottom row-around">
|
||||
<view class="item" v-if="Two.uid">
|
||||
<view class="item" v-show="Two.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="Two.avatar"></image>
|
||||
</view>
|
||||
<view class="name line1">{{Two.nickname}}</view>
|
||||
<view class="num">{{Two.spreadCount}}人</view>
|
||||
</view>
|
||||
<view class="item" v-if="One.uid">
|
||||
<view class="item" v-show="One.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="One.avatar"></image>
|
||||
</view>
|
||||
<view class="name line1">{{One.nickname}}</view>
|
||||
<view class="num">{{One.spreadCount}}人</view>
|
||||
</view>
|
||||
<view class="item" v-if="Three.uid">
|
||||
<view class="item" v-show="Three.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="Three.avatar"></image>
|
||||
</view>
|
||||
@@ -48,7 +48,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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 () {
|
||||
|
||||
BIN
app/pages/users/static/home.png
Normal file
BIN
app/pages/users/static/home.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
app/pages/users/static/left.png
Normal file
BIN
app/pages/users/static/left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/pages/users/static/wechat_login.png
Normal file
BIN
app/pages/users/static/wechat_login.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -43,7 +43,7 @@
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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: {
|
||||
|
||||
@@ -1,537 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<form @submit="formSubmit" report-submit='true'>
|
||||
<view class='addAddress'>
|
||||
<view class='list'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>姓名</view>
|
||||
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name" placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>联系电话</view>
|
||||
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone' placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>所在地区</view>
|
||||
<view class="address">
|
||||
<picker mode="multiSelector" @change="bindRegionChange" @columnchange="bindMultiPickerColumnChange" :value="valueRegion"
|
||||
:range="multiArray">
|
||||
<view class='acea-row'>
|
||||
<view class="picker">{{region[0]}},{{region[1]}},{{region[2]}}</view>
|
||||
<view class='iconfont icon-dizhi font-color'></view>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>详细地址</view>
|
||||
<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder' :value='userAddress.detail'></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class='default acea-row row-middle'>
|
||||
<checkbox-group @change='ChangeIsDefault'>
|
||||
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址</checkbox-group>
|
||||
</view>
|
||||
|
||||
<button class='keepBnt bg-color' form-type="submit">立即保存</button>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入微信地址</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !id" @click="getAddress">导入微信地址</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
editAddress,
|
||||
getAddressDetail
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
getCity
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import wPicker from "@/components/wPicker/w-picker.vue";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import home from '@/components/home';
|
||||
import city from '@/utils/city';
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
regionDval: ['浙江省', '杭州市', '滨江区'],
|
||||
cartId: '', //购物车id
|
||||
pinkId: 0, //拼团id
|
||||
couponId: 0, //优惠券id
|
||||
id: 0, //地址id
|
||||
userAddress: {
|
||||
is_default: false
|
||||
}, //地址详情
|
||||
region: ['省', '市', '区'],
|
||||
valueRegion: [0, 0, 0],
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
district: [],
|
||||
multiArray: [],
|
||||
multiIndex: [0, 0, 0],
|
||||
cityId: 0,
|
||||
defaultRegion: ['广东省', '广州市', '番禺区'],
|
||||
defaultRegionCode: '440113'
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad(options) {
|
||||
if (this.isLogin) {
|
||||
this.cartId = options.cartId || '';
|
||||
this.pinkId = options.pinkId || 0;
|
||||
this.couponId = options.couponId || 0;
|
||||
this.id = options.id || 0;
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.id ? '修改地址' : '添加地址'
|
||||
})
|
||||
this.getUserAddress();
|
||||
this.getCityList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 回去地址数据
|
||||
getCityList: function() {
|
||||
let that = this;
|
||||
getCity().then(res => {
|
||||
this.district = res.data
|
||||
that.initialize();
|
||||
})
|
||||
},
|
||||
initialize: function() {
|
||||
let that = this,
|
||||
province = [],
|
||||
city = [],
|
||||
area = [];
|
||||
if (that.district.length) {
|
||||
let cityChildren = that.district[0].c || [];
|
||||
let areaChildren = cityChildren.length ? (cityChildren[0].c || []) : [];
|
||||
that.district.forEach(function(item) {
|
||||
province.push(item.n);
|
||||
});
|
||||
cityChildren.forEach(function(item) {
|
||||
city.push(item.n);
|
||||
});
|
||||
areaChildren.forEach(function(item) {
|
||||
area.push(item.n);
|
||||
});
|
||||
this.multiArray = [province, city, area]
|
||||
}
|
||||
},
|
||||
bindRegionChange: function(e) {
|
||||
let multiIndex = this.multiIndex,
|
||||
province = this.district[multiIndex[0]] || {
|
||||
c: []
|
||||
},
|
||||
city = province.c[multiIndex[1]] || {
|
||||
v: 0
|
||||
},
|
||||
multiArray = this.multiArray,
|
||||
value = e.detail.value;
|
||||
|
||||
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
|
||||
// this.$set(this.region,0,multiArray[0][value[0]]);
|
||||
// this.$set(this.region,1,multiArray[1][value[1]]);
|
||||
// this.$set(this.region,2,multiArray[2][value[2]]);
|
||||
this.cityId = city.v
|
||||
this.valueRegion = [0, 0, 0]
|
||||
this.initialize();
|
||||
},
|
||||
bindMultiPickerColumnChange: function(e) {
|
||||
let that = this,
|
||||
column = e.detail.column,
|
||||
value = e.detail.value,
|
||||
currentCity = this.district[value] || {
|
||||
c: []
|
||||
},
|
||||
multiArray = that.multiArray,
|
||||
multiIndex = that.multiIndex;
|
||||
multiIndex[column] = value;
|
||||
switch (column) {
|
||||
case 0:
|
||||
let areaList = currentCity.c[0] || {
|
||||
c: []
|
||||
};
|
||||
multiArray[1] = currentCity.c.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
multiArray[2] = areaList.c.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
let cityList = that.district[multiIndex[0]].c[multiIndex[1]].c || [];
|
||||
multiArray[2] = cityList.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
|
||||
break;
|
||||
}
|
||||
// #ifdef MP
|
||||
this.$set(this.multiArray, 0, multiArray[0]);
|
||||
this.$set(this.multiArray, 1, multiArray[1]);
|
||||
this.$set(this.multiArray, 2, multiArray[2]);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.multiArray = multiArray;
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
this.multiIndex = multiIndex
|
||||
// this.setData({ multiArray: multiArray, multiIndex: multiIndex});
|
||||
},
|
||||
// 授权回调
|
||||
onLoadFun: function() {
|
||||
this.getUserAddress();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
toggleTab(str) {
|
||||
this.$refs[str].show();
|
||||
},
|
||||
// bindRegionChange: function(e) {
|
||||
// this.$set(this, 'region', e.detail.value);
|
||||
// },
|
||||
onConfirm(val) {
|
||||
this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
|
||||
},
|
||||
getUserAddress: function() {
|
||||
if (!this.id) return false;
|
||||
let that = this;
|
||||
getAddressDetail(this.id).then(res => {
|
||||
// let region = [res.data.province, res.data.city, res.data.district];
|
||||
let region = [res.data.province, res.data.city, res.data.district];
|
||||
that.$set(that, 'userAddress', res.data);
|
||||
that.$set(that, 'region', region);
|
||||
that.city_id = res.data.city_id
|
||||
});
|
||||
},
|
||||
// 导入共享地址(小程序)
|
||||
getWxAddress: function() {
|
||||
let that = this;
|
||||
uni.authorize({
|
||||
scope: 'scope.address',
|
||||
success: function(res) {
|
||||
uni.chooseAddress({
|
||||
success: function(res) {
|
||||
let addressP = {};
|
||||
addressP.province = res.provinceName;
|
||||
addressP.city = res.cityName;
|
||||
addressP.district = res.countyName;
|
||||
editAddress({
|
||||
address: addressP,
|
||||
is_default: 1,
|
||||
real_name: res.userName,
|
||||
post_code: res.postalCode,
|
||||
phone: res.telNumber,
|
||||
detail: res.detailInfo,
|
||||
id: 0,
|
||||
type: 1,
|
||||
}).then(res => {
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
|
||||
res.data
|
||||
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
return that.$util.Tips({
|
||||
title: "添加成功",
|
||||
icon: 'success'
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
|
||||
title: '取消选择'
|
||||
});
|
||||
},
|
||||
})
|
||||
},
|
||||
fail: function(res) {
|
||||
uni.showModal({
|
||||
title: '您已拒绝导入微信地址权限',
|
||||
content: '是否进入权限管理,调整授权?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: function(res) {}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
return that.$util.Tips({
|
||||
title: '已取消!'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
// 导入共享地址(微信);
|
||||
getAddress() {
|
||||
let that = this;
|
||||
that.$wechat.openAddress().then(userInfo => {
|
||||
open();
|
||||
editAddress({
|
||||
id: this.id,
|
||||
real_name: userInfo.userName,
|
||||
phone: userInfo.telNumber,
|
||||
address: {
|
||||
province: userInfo.provinceName,
|
||||
city: userInfo.cityName,
|
||||
district: userInfo.countryName
|
||||
},
|
||||
detail: userInfo.detailInfo,
|
||||
is_default: 1,
|
||||
post_code: userInfo.postalCode,
|
||||
type: 1,
|
||||
})
|
||||
.then(() => {
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
|
||||
res.data
|
||||
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/user_address_list/index'
|
||||
})
|
||||
// history.back();
|
||||
}
|
||||
}, 1000);
|
||||
close();
|
||||
that.$util.Tips({
|
||||
title: "添加成功",
|
||||
icon: 'success'
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
close();
|
||||
return that.$util.Tips({
|
||||
title: err || "添加失败"
|
||||
});
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 提交用户添加地址
|
||||
*
|
||||
*/
|
||||
formSubmit: function(e) {
|
||||
let that = this,
|
||||
value = e.detail.value;
|
||||
if (!value.real_name) return that.$util.Tips({
|
||||
title: '请填写收货人姓名'
|
||||
});
|
||||
if (!value.phone) return that.$util.Tips({
|
||||
title: '请填写联系电话'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (that.region == '省-市-区') return that.$util.Tips({
|
||||
title: '请选择所在地区'
|
||||
});
|
||||
if (!value.detail) return that.$util.Tips({
|
||||
title: '请填写详细地址'
|
||||
});
|
||||
value.id = that.id;
|
||||
let regionArray = that.region;
|
||||
value.address = {
|
||||
province: regionArray[0],
|
||||
city: regionArray[1],
|
||||
district: regionArray[2],
|
||||
city_id: that.cityId,
|
||||
};
|
||||
value.is_default = that.userAddress.is_default ? 1 : 0;
|
||||
|
||||
uni.showLoading({
|
||||
title: '保存中',
|
||||
mask: true
|
||||
})
|
||||
editAddress(value).then(res => {
|
||||
if (that.id)
|
||||
that.$util.Tips({
|
||||
title: '修改成功',
|
||||
icon: 'success'
|
||||
});
|
||||
else
|
||||
that.$util.Tips({
|
||||
title: '添加成功',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data.id) +'&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
// #ifdef H5
|
||||
return history.back();
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
return uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
}, 1000);
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
ChangeIsDefault: function(e) {
|
||||
this.$set(this.userAddress, 'is_default', !this.userAddress.is_default);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.addAddress .list {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.addAddress .list .item {
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.addAddress .list .item .name {
|
||||
width: 195rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.addAddress .list .item .address {
|
||||
// width: 412rpx;
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item input {
|
||||
width: 475rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item .placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker {
|
||||
width: 475rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .picker {
|
||||
width: 410rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .iconfont {
|
||||
font-size: 43rpx;
|
||||
}
|
||||
|
||||
.addAddress .default {
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 23rpx;
|
||||
}
|
||||
|
||||
.addAddress .default checkbox {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.addAddress .keepBnt {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 50rpx auto;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.addAddress .wechatAddress {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 32rpx;
|
||||
color: #fe960f;
|
||||
border: 1px solid #fe960f;
|
||||
}
|
||||
</style>
|
||||
@@ -52,7 +52,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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() {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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;
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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: {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index">
|
||||
<view class='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : ''">
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class="pic-num">满{{ item.minPrice }}元可用</view>
|
||||
<view>¥<text class='num'>{{item.money?Number(item.money):''}}</text></view>
|
||||
<view class="pic-num">满{{ item.minPrice?Number(item.minPrice):'' }}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line2'>
|
||||
@@ -26,7 +26,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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: {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view class='item acea-row row-center-wrapper' v-for="(item,index) in couponsList" :key="index">
|
||||
<view class='money' :class='item.isUse ? "moneyGray" : "" '>
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||
<view>¥<text class='num'>{{item.money?Number(item.money):''}}</text></view>
|
||||
<view class="pic-num">满{{item.minPrice?Number(item.minPrice):''}}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line2'>
|
||||
@@ -31,7 +31,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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(){
|
||||
|
||||
@@ -16,13 +16,19 @@
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>手机号码</view>
|
||||
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone">
|
||||
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input">
|
||||
<view class='input acea-row row-between-wrapper'>
|
||||
<input type='text' disabled='true' name='phone' :value='userInfo.phone' class='id'></input>
|
||||
<text class='iconfont icon-xiangyou'></text>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- <navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone">
|
||||
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
|
||||
</navigator>
|
||||
<view class='input acea-row row-between-wrapper' v-else>
|
||||
<input type='text' disabled='true' name='phone' :value='userInfo.phone' class='id'></input>
|
||||
<text class='iconfont icon-suozi'></text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>ID号</view>
|
||||
@@ -53,7 +59,7 @@
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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);
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
<recommend :hostProduct="hostProduct" v-if="hostProduct.length"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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: {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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: {
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
<template>
|
||||
<view>
|
||||
<form @submit="editPwd" report-submit='true'>
|
||||
<view class="ChangePassword">
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone"></input>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
|
||||
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</view>
|
||||
<view class="ChangePassword">
|
||||
<view class="list">
|
||||
<view class="item" v-if="isNew">
|
||||
<input type='number' disabled='true' placeholder='填写手机号码1' placeholder-class='placeholder' v-model="userInfo.phone"></input>
|
||||
</view>
|
||||
<view class="item" v-if="!isNew">
|
||||
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone"></input>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
|
||||
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</view>
|
||||
<button form-type="submit" class="confirmBnt bg-color">确认绑定</button>
|
||||
</view>
|
||||
</form>
|
||||
<button form-type="submit" v-if="isNew" class="confirmBnt bg-color" @click="next">下一步</button>
|
||||
<button form-type="submit" v-if="!isNew" class="confirmBnt bg-color" @click="editPwd">保存</button>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</form>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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: {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<view class='wrapper'>
|
||||
<view class='list acea-row row-between-wrapper'>
|
||||
<view class='item' v-for="(item,index) in signSystemList" :key="index">
|
||||
<view :class='(index+1) == signSystemList.length ? "rewardTxt" : ""'>{{item.title}}</view>
|
||||
<view :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'rewardTxt' : '')">{{item.title}}</view>
|
||||
<!-- <view :class='(index+1) == signSystemList.length ? "rewardTxt" : ""'>{{item.title}}</view> -->
|
||||
<view class='venus' :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')"></view>
|
||||
<view class='num' :class='item.is_sgin ? "on" : ""'>+{{item.integral}}</view>
|
||||
</view>
|
||||
@@ -64,7 +65,7 @@
|
||||
<view class='mask' @touchmove.stop.prevent="false" :hidden='active==false'></view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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: {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
@@ -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 () {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<view class="canvas" v-if="canvasStatus">
|
||||
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<view class='itemn acea-row row-between-wrapper'>
|
||||
<view>
|
||||
<view class='name line1'>{{child.title}}</view>
|
||||
<view>{{child.price}}</view>
|
||||
<view>{{child.updateTime}}</view>
|
||||
</view>
|
||||
<view class='num font-color' v-if="child.type == 1">+{{child.price}}</view>
|
||||
<view class='num' v-else>-{{child.price}}</view>
|
||||
@@ -61,7 +61,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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() {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
@@ -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();
|
||||
// });
|
||||
},
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</view>
|
||||
<navigator url="/pages/goods_cate/goods_cate" class="button" hover-class="none" open-type='switchTab'>去获取</navigator>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<!-- <view class="item acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-middle">
|
||||
<view class="pictrue on2"><text class="iconfont icon-yaoqing"></text></view>
|
||||
<view class="text">
|
||||
@@ -99,7 +99,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<navigator url="/pages/users/user_spread_code/index" class="button" hover-class="none">去获取</navigator>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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) {
|
||||
|
||||
@@ -1,480 +0,0 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class='member-center'>
|
||||
<view class='header'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
||||
@change="bindchange" previous-margin="30px" next-margin="30px">
|
||||
<block v-for="(item,index) in VipList" :key="index">
|
||||
<swiper-item>
|
||||
<view class="memberBg" :class="swiperIndex == index ? 'active' : 'quiet'" :style='"background-image:url("+item.image+")"'
|
||||
mode='aspectFill'>
|
||||
<view class='name'>{{item.name}}</view>
|
||||
<view class='discount'>可享受商品折扣:{{item.discount}}折<text class='iconfont icon-zhekou'></text></view>
|
||||
<view class='lock' v-if="item.grade < grade"><text class='iconfont icon-xuanzhong1'></text>已解锁更高等级</view>
|
||||
|
||||
<view class='lock' v-if="item.grade > grade"><text class='iconfont icon-quanxianguanlisuozi'></text>该会员等级尚未解锁</view>
|
||||
|
||||
<view class='nav acea-row' v-if="grade==item.grade">
|
||||
<view class='item' v-if="indexn <= 3" v-for="(itemn,indexn) in item.task_list" :key="indexn">
|
||||
<view class='num'>{{itemn.number}}</view>
|
||||
<view>{{itemn.real_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class='wrapper'>
|
||||
<view class='title acea-row row-between-wrapper'>
|
||||
<view><text class='iconfont icon-jingyanzhi'></text>会员升级要求</view>
|
||||
<view class='num'><text class='current'>{{reach_count || 0}}</text>/{{task.length || 0}}</view>
|
||||
</view>
|
||||
<view class='list'>
|
||||
<view class='item' v-for="(item,index) in task" :key="index">
|
||||
<view class='top acea-row row-between-wrapper'>
|
||||
<view class='name' @click='opHelp(index)'>{{item.name}}<text v-if="item.illustrate" class='iconfont icon-wenti'></text></view>
|
||||
<view v-if="item.finish">已满足条件</view>
|
||||
<view v-else>未满足条件</view>
|
||||
</view>
|
||||
<view class="cu-progress">
|
||||
<view class='bg-red' :style="'width:'+item.speed+'%;'"></view>
|
||||
</view>
|
||||
<view class='experience acea-row row-between-wrapper'>
|
||||
<view>{{item.task_type_title}}</view>
|
||||
<view><text class='num'>{{item.new_number || 0}}</text>/{{item.number || 0}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
<view class='growthValue' :class='growthValue==false?"on":""'>
|
||||
<view class='pictrue'>
|
||||
<image src='../../columnGoods/static/value.jpg'></image><text class='iconfont icon-guanbi3' @click='growthValue'></text>
|
||||
</view>
|
||||
<view class='conter'>{{illustrate}}</view>
|
||||
</view>
|
||||
<view class='mask' :hidden='growthValue' @click='growthValueClose'></view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userLevelGrade,
|
||||
userLevelTask,
|
||||
userLevelDetection
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
getProductHot
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import recommend from '@/components/recommend';
|
||||
export default {
|
||||
components: {
|
||||
recommend,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reach_count:0,
|
||||
VipList: [],
|
||||
indicatorDots: false,
|
||||
circular: true,
|
||||
autoplay: false,
|
||||
interval: 3000,
|
||||
duration: 500,
|
||||
swiperIndex: 0,
|
||||
growthValue: true,
|
||||
task: [], //任务列表
|
||||
illustrate: '', //任务说明
|
||||
level_id: 0, //任务id,
|
||||
hostProduct: [],
|
||||
grade: 0,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false ,//是否隐藏授权
|
||||
hotScroll:false,
|
||||
hotPage:1,
|
||||
hotLimit:10
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
VipList: function() {
|
||||
console.log('观察')
|
||||
let that = this;
|
||||
if (that.VipList.length > 0) {
|
||||
that.VipList.forEach(function(item, index) {
|
||||
if (item.is_clear === false) {
|
||||
// that.swiper.slideTo(index);
|
||||
that.activeIndex = index;
|
||||
that.grade = item.grade;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.setLeveLComplete();
|
||||
this.get_host_product();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
let that = this;
|
||||
setTimeout(function() {
|
||||
that.loading = true
|
||||
}, 500)
|
||||
},
|
||||
methods: {
|
||||
onLoadFun: function() {
|
||||
this.setLeveLComplete();
|
||||
this.get_host_product();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 获取我的推荐
|
||||
*/
|
||||
get_host_product: function() {
|
||||
let that = this;
|
||||
getProductHot().then(res => {
|
||||
let that = this;
|
||||
if(that.hotScroll) return
|
||||
getProductHot(
|
||||
that.hotPage,
|
||||
that.hotLimit,
|
||||
).then(res => {
|
||||
that.hotPage++
|
||||
that.hotScroll = res.data.length<that.hotLimit
|
||||
that.hostProduct = that.hostProduct.concat(res.data)
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 会员切换
|
||||
*
|
||||
*/
|
||||
bindchange(e) {
|
||||
let index = e.detail.current;
|
||||
this.swiperIndex = index;
|
||||
this.level_id = this.VipList[index].id || 0;
|
||||
// this.grade = this.VipList[index].grade
|
||||
this.getTask();
|
||||
},
|
||||
/**
|
||||
* 关闭说明
|
||||
*/
|
||||
growthValueClose: function() {
|
||||
this.growthValue = true;
|
||||
},
|
||||
/**
|
||||
* 打开说明
|
||||
*/
|
||||
opHelp: function(index) {
|
||||
this.growthValue = false;
|
||||
this.illustrate = this.task[index].illustrate;
|
||||
},
|
||||
/**
|
||||
* 设置会员
|
||||
*/
|
||||
setLeveLComplete: function() {
|
||||
let that = this;
|
||||
userLevelDetection().then(res => {
|
||||
that.getVipList();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取会员等级
|
||||
*
|
||||
*/
|
||||
getVipList: function() {
|
||||
let that = this;
|
||||
userLevelGrade().then(res => {
|
||||
that.$set(that, 'VipList', res.data.list);
|
||||
that.task = res.data.task.task;
|
||||
that.reach_count = res.data.task.reach_count;
|
||||
that.level_id = res.data.list[0] ? res.data.list[0].id : 0;
|
||||
let arr = [];
|
||||
// res.data.list.forEach(function(item, index) {
|
||||
// if (item.is_clear == false) {
|
||||
// arr.push(item.grade);
|
||||
// }
|
||||
// })
|
||||
// that.grade = arr[0] || 0;
|
||||
// that.grade = res.data.list[0].grade
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取任务要求
|
||||
*/
|
||||
getTask: function() {
|
||||
let that = this;
|
||||
userLevelTask(that.level_id).then(res => {
|
||||
that.task = res.data.task;
|
||||
that.reach_count = res.data.reach_count;
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.get_host_product();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.member-center .header {
|
||||
background-color: #232323;
|
||||
width: 100%;
|
||||
padding: 50rpx 0;
|
||||
}
|
||||
|
||||
.member-center .header swiper {
|
||||
width: 100%;
|
||||
height: 328rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg.active {
|
||||
transform: none;
|
||||
transition: all 0.2s ease-in 0s;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg.quiet {
|
||||
transform: scale(0.9);
|
||||
transition: all 0.2s ease-in 0s;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg {
|
||||
width: 100%;
|
||||
height: 328rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
background-size: 100% 100%
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg image {
|
||||
width: 89rpx;
|
||||
height: 108rpx;
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 60rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .name {
|
||||
font-size: 46rpx;
|
||||
font-weight: bold;
|
||||
padding: 40rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .discount {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
margin: 15rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .discount .iconfont {
|
||||
margin-left: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav {
|
||||
margin-top: 55rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item .num {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
font-family: 'Guildford Pro';
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item~.item::before {
|
||||
position: absolute;
|
||||
width: 2rpx;
|
||||
height: 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
content: '';
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .lock {
|
||||
font-size: 26rpx;
|
||||
margin: 73rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .lock .iconfont {
|
||||
font-size: 37rpx;
|
||||
margin-right: 15rpx;
|
||||
vertical-align: -4rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper {
|
||||
background-color: #fff;
|
||||
padding-bottom: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title {
|
||||
height: 98rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .iconfont {
|
||||
color: #ffae06;
|
||||
font-weight: normal;
|
||||
font-size: 40rpx;
|
||||
margin-right: 12rpx;
|
||||
vertical-align: -2rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .num {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .num .current {
|
||||
color: #ffae06;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item {
|
||||
width: 690rpx;
|
||||
height: 184rpx;
|
||||
background-color: #f9f9f9;
|
||||
margin: 0 auto 20rpx auto;
|
||||
padding: 27rpx 0 22rpx 0;
|
||||
border-radius: 12rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top {
|
||||
padding-right: 27rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top .name {
|
||||
border-left: 6rpx solid #ffae06;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top .name .iconfont {
|
||||
color: #999;
|
||||
font-size: 30rpx;
|
||||
vertical-align: -2rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .cu-progress {
|
||||
overflow: hidden;
|
||||
height: 12rpx;
|
||||
background-color: #eee;
|
||||
width: 636rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 35rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .cu-progress .bg-red {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
transition: width 0.6s ease;
|
||||
background-color: #ffaa29;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .experience {
|
||||
margin-top: 17rpx;
|
||||
padding: 0 27rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .experience .num {
|
||||
color: #ffad07;
|
||||
}
|
||||
|
||||
.member-center .growthValue {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
position: fixed;
|
||||
top: 266rpx;
|
||||
left: 50%;
|
||||
width: 560rpx;
|
||||
height: 740rpx;
|
||||
margin-left: -280rpx;
|
||||
z-index: 99;
|
||||
transform: translate3d(0, -200%, 0);
|
||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||
}
|
||||
|
||||
.member-center .growthValue.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue {
|
||||
width: 100%;
|
||||
height: 257rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
|
||||
.member-center .growthValue .conter {
|
||||
padding: 0 35rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-top: 58rpx;
|
||||
line-height: 1.5;
|
||||
height: 350rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue .iconfont {
|
||||
position: absolute;
|
||||
font-size: 65rpx;
|
||||
color: #fff;
|
||||
top: 775rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,14 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="page">
|
||||
<view class="system-height" :style="{height:statusBarHeight}"></view>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="title-bar" style="height: 43px;">
|
||||
<view class="icon" @click="back" v-if="!isHome"><image src="../static/left.png" ></image></view>
|
||||
<view class="icon" @click="home" v-else><image src="../static/home.png"></image></view>
|
||||
<view class="icon" @click="back" v-if="!isHome">
|
||||
<image src="../static/left.png"></image>
|
||||
</view>
|
||||
<view class="icon" @click="home" v-else>
|
||||
<image src="../static/home.png"></image>
|
||||
</view>
|
||||
账户登录
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@@ -13,13 +17,13 @@
|
||||
<image src="../static/wechat_login.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<button class="bg-red" hover-class="none" @click="isUp=true">手机号登录(账户同步)</button>
|
||||
<!-- #ifdef H5 -->
|
||||
<button hover-class="none" @click="wechatLogin">微信一键登录</button>
|
||||
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo">微信一键登录</button>
|
||||
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo" class="bg-green btn1">微信登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="isUp">
|
||||
@@ -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 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.wechat_login {
|
||||
padding: 72rpx 34rpx;
|
||||
|
||||
@@ -330,21 +392,24 @@
|
||||
|
||||
.btn-wrapper {
|
||||
margin-top: 86rpx;
|
||||
padding: 0 66rpx;
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
margin-bottom: 40rpx;
|
||||
color: $theme-color;
|
||||
border: 1px solid $theme-color;
|
||||
border-radius: 120rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
&.bg-red {
|
||||
background: $theme-color;
|
||||
&.btn1 {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.btn2 {
|
||||
color: #666666;
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +421,8 @@
|
||||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.icon{
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 0;
|
||||
@@ -365,7 +431,8 @@
|
||||
justify-content: center;
|
||||
width: 86rpx;
|
||||
height: 86rpx;
|
||||
image{
|
||||
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user