-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
![]()
-
-
-
-
-
-
-

+
-
-
-
{{usertitle}}
-
{{userorder}}
+
+
+
+
+
+
+ {{ usertitle }}
+ {{ userorder }}
+
+
登录/注册
+
+
+
+ 会员权益
+
-
- 登录/注册
-
+
+
+
+
+ 当前积分:{{ rcrcord || 0 }}
+ 积分明细
+
+
+
+
距离升级还差:
+
{{ rcvalue }}
+
+
+ 0
+ 5000
+ 10000
+
+
+
+
+
+
+
+ 我的订单
+
+ 查看全部
+
+
+
+ -
+
+ {{ item.title }}
+
+
+
+
+
+
+
+
+
+
服务工具
+
+
+
+
![]()
+
{{ item.title }}
+
+
+
{{ item.usertitle }}
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
温馨提示
+ {{ usermessage }}
+
+
+
+

+
微信扫一扫,识别二维码
-
-
- 会员权益
-
-
-
-
-
-
-
- 当前积分:{{ rcrcord }}
- 积分明细
-
+
-
-
距离升级还差: {{ rcvalue }}
-
-
- 0
- 5000
- 10000
-
-
+
+
-
-
-
-
- 我的订单
-
-
- 查看全部
-
-
-
-
- -
-
- {{ item.title }}
-
-
-
-
-
-
-
-
-
-
服务工具
-
-
-
-
![]()
-
{{ item.title }}
-
-
-
{{ item.usertitle }}
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
温馨提示
- {{usermessage}}
-
-
-
-
-

-
微信扫一扫,识别二维码
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+@import url('@/assets/css/global.less');
+@import url('@/assets/css/mypersonal.less');
+
+
diff --git a/rc-busness/pages/personal/settlement.vue b/rc-busness/pages/personal/settlement.vue
index 79a6afbc..d87964be 100644
--- a/rc-busness/pages/personal/settlement.vue
+++ b/rc-busness/pages/personal/settlement.vue
@@ -1,357 +1,303 @@
-
-
-
-
-
-
-
-
-
-
-
- 编辑
-
-
- {{ item.recipient }}
- {{ item.recipientPhone }}
-
-
- {{ item.address }}
-
-
-
-
-
-
-
-
-
-
![]()
-
-
-
-
{{ item.productName }}
-
规格:{{ item.specifications }}
-
-
-
¥{{ item.productPrice }}
-
X{{ item.buyCount }}
-
¥{{ item.productPrice * item.buyCount }}
-
-
-
-
-
-
-
-
- -
- 配送方式:
- {{ shopprice.price }}
-
-
- -
- 活动促销:
- {{ curCoupon.couponName }}
-
-
- -
- 商品总价:
- {{ sumPrice }}
-
- -
- 配送费用:
- {{ shopprice.payment }}
-
-
-
-
-
-
-
-
-
diff --git a/rc-busness/pages/useraddress/editaddress.vue b/rc-busness/pages/useraddress/editaddress.vue
index a91488ac..c73c92a6 100644
--- a/rc-busness/pages/useraddress/editaddress.vue
+++ b/rc-busness/pages/useraddress/editaddress.vue
@@ -1,258 +1,247 @@
-
+
+
+ 取消
+ 确认
+
+
+
-
diff --git a/rc-busness/pages/useraddress/openaddress.vue b/rc-busness/pages/useraddress/openaddress.vue
index 9d6f4b9b..6b51d5db 100644
--- a/rc-busness/pages/useraddress/openaddress.vue
+++ b/rc-busness/pages/useraddress/openaddress.vue
@@ -1,206 +1,203 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.recipient }}
-
-
- {{ item.recipientPhone }}
-
-
-
-
- {{item.provinceName}}{{ item.districtName }}{{item.detailAddress}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
添加收货地址
-
-
+
-
-
-
-
-
-
-
+
+
+

+
添加收货地址
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/rc-busness/pages/userlogin/login.vue b/rc-busness/pages/userlogin/login.vue
index 623ac748..8e7a2c47 100644
--- a/rc-busness/pages/userlogin/login.vue
+++ b/rc-busness/pages/userlogin/login.vue
@@ -152,7 +152,8 @@ export default {
envData,
phone: "",
layerMSg: "手机格式不对",
- tel: "",
+ tel: "", // 15766132405 18825059708
+ sms: "", //去除记得把验证码打开 1234
password: "",
userdata:{},
allcheck:false,
@@ -165,7 +166,6 @@ export default {
],
hash:'',
text: "",
- sms: "",
buttonmsg: "获取验证码",
flag: false,
adminCode: "",
@@ -220,13 +220,14 @@ export default {
},
...mapState({
userInfo : state => state.user.userInfo,
+ loginState : state => state.login.loginState,
})
},
mounted() {
//console.log(this.$route.params);
- this.checkIsLogin();
- let user = this.$store.state.userInfo;
- if(user) {
+ // this.checkIsLogin();
+ // let user = this.$store.state.userInfo;
+ if(this.loginState && this.userInfo) {
this.$router.push({
path: "/personal/mypersonal",
});
@@ -401,13 +402,21 @@ export default {
}
}
else{
- let data=await this.vadmsg();
+ /* 暂时关闭短信验证 */
+ let data = await this.vadmsg();
+ // let data = {
+ // code : 1,
+ // }
if(data.code=="1")
{
data = await userregOrLogin(this.tel);
let token=JSON.stringify(data);
- this.changeClod({ cloud: token });
- this.checkIsLogin();
+ this.$store.dispatch('setUserInfo',{
+ data : data,
+ app : this,
+ });
+ // this.changeClod({ cloud: token });
+ // this.checkIsLogin();
let returnMessage='';
if(data.type==1) {
if(data.data.memberName===undefined){
diff --git a/rc-busness/pages/usersearch/search.vue b/rc-busness/pages/usersearch/search.vue
index 14da32d1..98aa5f37 100644
--- a/rc-busness/pages/usersearch/search.vue
+++ b/rc-busness/pages/usersearch/search.vue
@@ -571,12 +571,19 @@ export default {
tabs
},
mounted() {
+ const { query } = this.$route;
+ this.activeIndex1 = query.type || 0;
+ this.activeIndex = query.type || 0;
+ this.value = query.content || '';
this.usetmessage();
this.userst();
//Handling RxGoods filter
let curEnv = process.env.NODE_ENV;
this.rxFilters = envData[curEnv].rxGoodsFilter;
//Handling RxGoods filter end
+
+ console.log();
+
},
methods: {
//换一批
@@ -723,6 +730,7 @@ export default {
this.$nextTick(() => {
this.$refs.userstandard[0].style.margin = 0 + "px";
});
+ console.log(this.activeIndex1, this.value,'this.activeIndex1, this.value');
let data = await biaome(this.activeIndex1, this.value, 1, 10);
if (data) {
this.rccontair = data;
diff --git a/rc-busness/plugins/until/common.js b/rc-busness/plugins/until/common.js
new file mode 100644
index 00000000..88ca169f
--- /dev/null
+++ b/rc-busness/plugins/until/common.js
@@ -0,0 +1,24 @@
+/**
+ * 这个是一些全局函数方法
+ */
+import { Message } from 'element-ui';
+
+
+export default ({ app }, inject) => {
+ /**
+ * 消息提示框
+ * msg 提示语
+ * type 提示框状态 success/warning/info/error
+ * duration 默认3秒
+ */
+ inject('messageToast',(msg,type='success',duration=3000)=>{
+ Message({
+ type : type || 'success',
+ message : msg,
+ duration
+ })
+ })
+
+
+ inject('myInjectedFunction', string => Message('That was easy!', string));
+}
\ No newline at end of file
diff --git a/rc-busness/plugins/until/until.js b/rc-busness/plugins/until/until.js
index a7d8a72f..67250c13 100644
--- a/rc-busness/plugins/until/until.js
+++ b/rc-busness/plugins/until/until.js
@@ -3,7 +3,7 @@
*/
/**
- * 设置cookie的值
+ * 设置cookie的值(获取的是前端的 nuxt框架不可用 用cookie-universal-nuxt获取存放的token)
* @param {String} key cookie的键
* @param {String} val cookie的值
* @param {String} exdays 过期时间默认的话是7天
@@ -16,7 +16,7 @@ const setCookie = (key,val,exdays = 7)=>{
}
/**
- * 获取cookie的值
+ * 获取cookie的值(获取的是前端的 nuxt框架不可用 用cookie-universal-nuxt获取存放的token)
* @param {String} key cookie的键
*/
const getCookie = (key)=>{
@@ -30,8 +30,6 @@ const getCookie = (key)=>{
}
-
-
export {
setCookie,
getCookie,
diff --git a/rc-busness/store/index.js b/rc-busness/store/index.js
index cfdaa024..cef673b0 100644
--- a/rc-busness/store/index.js
+++ b/rc-busness/store/index.js
@@ -1,74 +1,88 @@
- import user from './modules/user.js';
-
-
+import user from './modules/user.js';
+ import login from './modules/login.js';
+
const state = () => ({
- // 这里是全局数据保存的地方
- tabsList: [
- {
- path: '/',
- name: 'index',
- meta:{
- title: '首页',
-
- }
- },
- ]
+ // 这里是全局数据保存的地方
+ tabsList: [{
+ path: '/',
+ name: 'index',
+ meta: {
+ title: '首页',
-})
+ }
+ }, ],
+ userInfo : null, //以前遗留的问题 用户数据后台统一用modal里面的userInfo
+ userKey : 'user_mobile', //存储用户的KEY值
+ tokenKey : 'token', //存储用户token的key
+
-const mutations = {
-// changeLogin(state, val) {
-// console.log(state,val);
-// let list=[];
-// list.push(val);
+ })
-// JSON.parse(list);
-// console.log(list);
-// localStorage.setItem("cardata", list);
-// },
- changeClod(state, val) {
- localStorage.setItem('userInfo', val.cloud);
- },
- logoutSystem(state) {
- localStorage.removeItem('userInfo')
- },
- checkIsLogin(state) {
- let rawUserInfoStr = localStorage.getItem('userInfo');
- let rawUserInfo = JSON.parse(rawUserInfoStr);
- if(rawUserInfo && rawUserInfo.hasOwnProperty('xaccessToken') && rawUserInfo['xaccessToken'].length>36)
- state.userInfo = rawUserInfo;
- else
- state.userInfo = undefined;
- },
- changemessage(state, val) {
- localStorage.setItem('message', val.data);
- },
- selectMenu(state, val) {
- let result = state.tabsList.findIndex(item => item.name === val.data.name)
- result === -1 ? state.tabsList.push(val.data) : ''
- },
+ const mutations = {
+ // changeLogin(state, val) {
+ // console.log(state,val);
+ // let list=[];
+ // list.push(val);
-// changeMenu(state, user){
-// // console.log("vuex存储的变化",JSON.parse(user))
-// // console.log("vuex存储的变化",user)
-// state.menuList = user;
-// localStorage.setItem('menuList', user);
-// }
-}
+ // JSON.parse(list);
+ // console.log(list);
+ // localStorage.setItem("cardata", list);
+ // },
+ changeClod(state, val) {
+ localStorage.setItem('userInfo', val.cloud);
+ },
+ logoutSystem(state) {
+ localStorage.removeItem('userInfo')
+ },
+ checkIsLogin(state) {
+ let rawUserInfoStr = localStorage.getItem('userInfo');
+ let rawUserInfo = JSON.parse(rawUserInfoStr);
+ if (rawUserInfo && rawUserInfo.hasOwnProperty('xaccessToken') && rawUserInfo['xaccessToken'].length > 36)
+ state.userInfo = rawUserInfo;
+ else
+ state.userInfo = undefined;
+ },
+ changemessage(state, val) {
+ localStorage.setItem('message', val.data);
+ },
+ selectMenu(state, val) {
+ let result = state.tabsList.findIndex(item => item.name === val.data.name)
+ result === -1 ? state.tabsList.push(val.data) : ''
+ },
+
+
+ SET_INDEX_USER_INFO(state,data){
+ state.userInfo = data;
+ }
-const actions = {
- setPosition: ({
- commit
- }, position) => {
- commit('setPosition', position)
- }
-}
+ // changeMenu(state, user){
+ // // console.log("vuex存储的变化",JSON.parse(user))
+ // // console.log("vuex存储的变化",user)
+ // state.menuList = user;
+ // localStorage.setItem('menuList', user);
+ // }
+ }
-/* 功能模块 */
-const modules = {
- user,
-}
+ const actions = {
+ setPosition: ({
+ commit
+ }, position) => {
+ commit('setPosition', position)
+ }
+ }
+
+ /* 功能模块 */
+ const modules = {
+ user,
+ login
+ }
-export default {namespaced: true, state, mutations, actions,modules}
+ export default {
+ namespaced: true,
+ state,
+ mutations,
+ actions,
+ modules
+ }
diff --git a/rc-busness/store/modules/login.js b/rc-busness/store/modules/login.js
index 2d2409f6..4288a3b1 100644
--- a/rc-busness/store/modules/login.js
+++ b/rc-busness/store/modules/login.js
@@ -1,17 +1,57 @@
+// import { getCookie } from "../../plugins/until/until.js";
export default {
- state : {
- des : '这个存储用户登录逻辑操作',
- loginState : false, //登录状态
+ state: {
+ des: '这个存储用户登录逻辑操作',
+ loginState: false, //登录状态
},
/* 存储修改状态的静态方法 */
- mutations : {
+ mutations: {
/* 设置登录状态 */
- SET_LOGIN_STATE(state){
- console.log(state);
- }
+ SET_LOGIN_STATE(state, value) {
+ state.loginState = value
+ },
},
/* 存储修改数据的动态方法 */
- actions : {
-
+ actions: {
+ /**
+ * 判断是否登录
+ * context
+ * app vue 实例
+ */
+ checkLoginState(context, app) {
+ let key = context.rootState.userKey;
+ let mobile = app.$cookies.get(key);
+ let isHasToken = false;
+ if (mobile == undefined || !mobile || mobile == 'mobile') {
+ isHasToken = false;
+ } else {
+ isHasToken = true;
+ /* 更新用户数据 */
+ if (!context.rootState.user.userInfo) {
+ context.dispatch('getUserInfo', app, {
+ root: true
+ });
+ }
+ }
+ context.commit('SET_LOGIN_STATE', isHasToken);
+ },
+ /**
+ * 退出登录
+ * @param {Object} context 上下文
+ * @param {Object} app vue 实例
+ */
+ logout(context, app){
+ let userKey = context.rootState.userKey;
+ let tokenKey = context.rootState.tokenKey;
+ app.$cookies.remove(userKey);
+ app.$cookies.remove(tokenKey);
+ context.commit('SET_USER_INFO', null, {
+ root: true
+ });
+ context.commit('SET_INDEX_USER_INFO', null, {
+ root: true
+ });
+ localStorage.removeItem(tokenKey)
+ }
}
-}
\ No newline at end of file
+}
diff --git a/rc-busness/store/modules/user.js b/rc-busness/store/modules/user.js
index 1c90c321..22aafd68 100644
--- a/rc-busness/store/modules/user.js
+++ b/rc-busness/store/modules/user.js
@@ -1,18 +1,61 @@
+import Vue from "vue";
+import { userregOrLogin } from '../../ajax/getData.js';
+
+
export default {
- state : {
- des : '这个存储用户数据的模块列表',
- userInfo : {}, //用户信息
- loginState : false, //登录状态
+ state: {
+ des: '这个存储用户数据的模块列表',
+ userInfo: null, //用户信息
+ loginState: false, //登录状态
},
/* 存储修改状态的静态方法 */
- mutations : {
+ mutations: {
/* 设置用户信息 */
- SET_USER_INFO(state){
- console.log(state);
+ SET_USER_INFO(state, userInfo) {
+ state.userInfo = userInfo;
}
},
/* 存储修改数据的动态方法 */
- actions : {
-
+ actions: {
+ /**
+ * 设置会员信息
+ * @param {Object} context 上下文
+ * @param {Object} {
+ data : 后台返回的用户数据
+ app : vue实例this
+ }
+ */
+ setUserInfo(context, {
+ data,
+ app
+ }) {
+ const userKey = context.rootState.userKey;
+ const tokenKey = context.rootState.tokenKey;
+ const userInfo = data.data;
+ const {
+ mobile
+ } = userInfo;
+ /* 存储数据 变更登录状态 */
+ app.$cookies.set(userKey, mobile);
+ app.$cookies.set(tokenKey, data.xaccessToken);
+ localStorage.setItem(tokenKey,data.xaccessToken);
+ context.commit('SET_USER_INFO', userInfo);
+ context.commit('SET_LOGIN_STATE', true, {
+ root: true
+ });
+ context.commit('SET_INDEX_USER_INFO', data, {
+ root: true
+ });
+ },
+ /* 获取用户数据 */
+ async getUserInfo(context,app){
+ let key = context.rootState.userKey;
+ let mobile = app.$cookies.get(key);
+ const data = await userregOrLogin(app.$cookies.get(key));
+ context.dispatch('setUserInfo',{
+ data,
+ app,
+ })
+ }
}
-}
\ No newline at end of file
+}