diff --git a/api/rumor.js b/api/rumor.js index 5910e2f..e57f831 100644 --- a/api/rumor.js +++ b/api/rumor.js @@ -4,7 +4,7 @@ const LIST = BASE_URL + '/businessRumor/list' const Vote = BASE_URL + '/businessVoteRecord/isVote' -const Add = BASE_URL + '/businessRumor/add' +const Add = BASE_URL + '/businessVoteRecord/add' // 谣言列表 export function getRumorList(data) { return fetch.post(LIST, data).then(res => res); diff --git a/api/rumor.js b/api/rumor.js index 5910e2f..e57f831 100644 --- a/api/rumor.js +++ b/api/rumor.js @@ -4,7 +4,7 @@ const LIST = BASE_URL + '/businessRumor/list' const Vote = BASE_URL + '/businessVoteRecord/isVote' -const Add = BASE_URL + '/businessRumor/add' +const Add = BASE_URL + '/businessVoteRecord/add' // 谣言列表 export function getRumorList(data) { return fetch.post(LIST, data).then(res => res); diff --git a/common/utils.js b/common/utils.js index 3184fa0..3640f03 100644 --- a/common/utils.js +++ b/common/utils.js @@ -331,4 +331,14 @@ } } } +/** + * 隐藏手机号中间四位,正则替换 + * @param {*} phone + * @returns + */ +export function hidePhone(phone) { + let reg = /^(\d{3})\d{4}(\d{4})$/; + return phone.replace(reg, '$1****$2'); +} + diff --git a/api/rumor.js b/api/rumor.js index 5910e2f..e57f831 100644 --- a/api/rumor.js +++ b/api/rumor.js @@ -4,7 +4,7 @@ const LIST = BASE_URL + '/businessRumor/list' const Vote = BASE_URL + '/businessVoteRecord/isVote' -const Add = BASE_URL + '/businessRumor/add' +const Add = BASE_URL + '/businessVoteRecord/add' // 谣言列表 export function getRumorList(data) { return fetch.post(LIST, data).then(res => res); diff --git a/common/utils.js b/common/utils.js index 3184fa0..3640f03 100644 --- a/common/utils.js +++ b/common/utils.js @@ -331,4 +331,14 @@ } } } +/** + * 隐藏手机号中间四位,正则替换 + * @param {*} phone + * @returns + */ +export function hidePhone(phone) { + let reg = /^(\d{3})\d{4}(\d{4})$/; + return phone.replace(reg, '$1****$2'); +} + diff --git a/components/card.vue b/components/card.vue index b284762..491a970 100644 --- a/components/card.vue +++ b/components/card.vue @@ -124,7 +124,7 @@ // this.isVoteFlag = false const params = { rumorId:this.currentShow.id, // id - votePerson:userinfo.phone ?userinfo.phone : '123' // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime() // 用户唯一标识 } // 查询用户是否投票 isVote(params).then(res => { @@ -142,7 +142,7 @@ const userinfo = wx.getStorageSync('userInfoxj') const params = { rumorId:this.currentShow.id, - votePerson:userinfo.phone ?userinfo.phone : '123', // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime(), // 用户唯一标识 status: flag ? '1' : '0' } addVote(params).then(res => { @@ -150,6 +150,7 @@ uni.$u.toast('投票成功') // 投票成功修改 投票状态 this.isVoteFlag = true + this.next() }) }, // 触摸开始 diff --git a/api/rumor.js b/api/rumor.js index 5910e2f..e57f831 100644 --- a/api/rumor.js +++ b/api/rumor.js @@ -4,7 +4,7 @@ const LIST = BASE_URL + '/businessRumor/list' const Vote = BASE_URL + '/businessVoteRecord/isVote' -const Add = BASE_URL + '/businessRumor/add' +const Add = BASE_URL + '/businessVoteRecord/add' // 谣言列表 export function getRumorList(data) { return fetch.post(LIST, data).then(res => res); diff --git a/common/utils.js b/common/utils.js index 3184fa0..3640f03 100644 --- a/common/utils.js +++ b/common/utils.js @@ -331,4 +331,14 @@ } } } +/** + * 隐藏手机号中间四位,正则替换 + * @param {*} phone + * @returns + */ +export function hidePhone(phone) { + let reg = /^(\d{3})\d{4}(\d{4})$/; + return phone.replace(reg, '$1****$2'); +} + diff --git a/components/card.vue b/components/card.vue index b284762..491a970 100644 --- a/components/card.vue +++ b/components/card.vue @@ -124,7 +124,7 @@ // this.isVoteFlag = false const params = { rumorId:this.currentShow.id, // id - votePerson:userinfo.phone ?userinfo.phone : '123' // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime() // 用户唯一标识 } // 查询用户是否投票 isVote(params).then(res => { @@ -142,7 +142,7 @@ const userinfo = wx.getStorageSync('userInfoxj') const params = { rumorId:this.currentShow.id, - votePerson:userinfo.phone ?userinfo.phone : '123', // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime(), // 用户唯一标识 status: flag ? '1' : '0' } addVote(params).then(res => { @@ -150,6 +150,7 @@ uni.$u.toast('投票成功') // 投票成功修改 投票状态 this.isVoteFlag = true + this.next() }) }, // 触摸开始 diff --git a/packageA/accountBound/accountBound.vue b/packageA/accountBound/accountBound.vue index c856add..23e889e 100644 --- a/packageA/accountBound/accountBound.vue +++ b/packageA/accountBound/accountBound.vue @@ -130,34 +130,39 @@ this.$refs.form.validate().then(res => { // uni.$u.toast('校验通过') // 登录接口 - // this.form.timeStr = new Date().getTime() - // loginUser(this.form).then(res => { - // console.log(res, '用户信息') - // }).catch((error) => { - // console.log(error) - // }) - // 模拟登录成功 - const userInfo = { - id:'b56d2019f49353aa85a93c06228b8d80', - account:'用户账号', - name:'姓名', - sex:'性别', - nation:'民族', - IDCard:'身份证号', - phone:'手机号码', - email:'电子邮箱', - country:'国家', - province:'省', - city:'市', - county:'县', - address:'详细地址', - regTime:'注册时间'} - wx.setStorageSync('userInfoxj', userInfo) - setTimeout(() => { - wx.switchTab({ + this.form.timeStr = new Date().getTime() + loginUser(this.form).then(res => { + console.log(res, '用户信息') + const userInfo = res + wx.setStorageSync('userInfoxj', userInfo) + wx.switchTab({ url:'/pages/mine/mine' - },500) + }) + }).catch((error) => { + console.log(error) }) + // 模拟登录成功 + // const userInfo = { + // id:'b56d2019f49353aa85a93c06228b8d80', + // account:'test001', + // name:'姓名', + // sex:'性别', + // nation:'民族', + // IDCard:'身份证号', + // phone:'13712345678', + // email:'123456789@163.com', + // country:'国家', + // province:'省', + // city:'市', + // county:'县', + // address:'详细地址', + // regTime:'注册时间'} + // wx.setStorageSync('userInfoxj', userInfo) + // setTimeout(() => { + // wx.switchTab({ + // url:'/pages/mine/mine' + // },500) + // }) }).catch(errors => { console.log(errors, 'errors') uni.$u.toast('请将信息填写完整') diff --git a/api/rumor.js b/api/rumor.js index 5910e2f..e57f831 100644 --- a/api/rumor.js +++ b/api/rumor.js @@ -4,7 +4,7 @@ const LIST = BASE_URL + '/businessRumor/list' const Vote = BASE_URL + '/businessVoteRecord/isVote' -const Add = BASE_URL + '/businessRumor/add' +const Add = BASE_URL + '/businessVoteRecord/add' // 谣言列表 export function getRumorList(data) { return fetch.post(LIST, data).then(res => res); diff --git a/common/utils.js b/common/utils.js index 3184fa0..3640f03 100644 --- a/common/utils.js +++ b/common/utils.js @@ -331,4 +331,14 @@ } } } +/** + * 隐藏手机号中间四位,正则替换 + * @param {*} phone + * @returns + */ +export function hidePhone(phone) { + let reg = /^(\d{3})\d{4}(\d{4})$/; + return phone.replace(reg, '$1****$2'); +} + diff --git a/components/card.vue b/components/card.vue index b284762..491a970 100644 --- a/components/card.vue +++ b/components/card.vue @@ -124,7 +124,7 @@ // this.isVoteFlag = false const params = { rumorId:this.currentShow.id, // id - votePerson:userinfo.phone ?userinfo.phone : '123' // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime() // 用户唯一标识 } // 查询用户是否投票 isVote(params).then(res => { @@ -142,7 +142,7 @@ const userinfo = wx.getStorageSync('userInfoxj') const params = { rumorId:this.currentShow.id, - votePerson:userinfo.phone ?userinfo.phone : '123', // 用户唯一标识 + votePerson:userinfo.phone ?userinfo.phone : new Date().getTime(), // 用户唯一标识 status: flag ? '1' : '0' } addVote(params).then(res => { @@ -150,6 +150,7 @@ uni.$u.toast('投票成功') // 投票成功修改 投票状态 this.isVoteFlag = true + this.next() }) }, // 触摸开始 diff --git a/packageA/accountBound/accountBound.vue b/packageA/accountBound/accountBound.vue index c856add..23e889e 100644 --- a/packageA/accountBound/accountBound.vue +++ b/packageA/accountBound/accountBound.vue @@ -130,34 +130,39 @@ this.$refs.form.validate().then(res => { // uni.$u.toast('校验通过') // 登录接口 - // this.form.timeStr = new Date().getTime() - // loginUser(this.form).then(res => { - // console.log(res, '用户信息') - // }).catch((error) => { - // console.log(error) - // }) - // 模拟登录成功 - const userInfo = { - id:'b56d2019f49353aa85a93c06228b8d80', - account:'用户账号', - name:'姓名', - sex:'性别', - nation:'民族', - IDCard:'身份证号', - phone:'手机号码', - email:'电子邮箱', - country:'国家', - province:'省', - city:'市', - county:'县', - address:'详细地址', - regTime:'注册时间'} - wx.setStorageSync('userInfoxj', userInfo) - setTimeout(() => { - wx.switchTab({ + this.form.timeStr = new Date().getTime() + loginUser(this.form).then(res => { + console.log(res, '用户信息') + const userInfo = res + wx.setStorageSync('userInfoxj', userInfo) + wx.switchTab({ url:'/pages/mine/mine' - },500) + }) + }).catch((error) => { + console.log(error) }) + // 模拟登录成功 + // const userInfo = { + // id:'b56d2019f49353aa85a93c06228b8d80', + // account:'test001', + // name:'姓名', + // sex:'性别', + // nation:'民族', + // IDCard:'身份证号', + // phone:'13712345678', + // email:'123456789@163.com', + // country:'国家', + // province:'省', + // city:'市', + // county:'县', + // address:'详细地址', + // regTime:'注册时间'} + // wx.setStorageSync('userInfoxj', userInfo) + // setTimeout(() => { + // wx.switchTab({ + // url:'/pages/mine/mine' + // },500) + // }) }).catch(errors => { console.log(errors, 'errors') uni.$u.toast('请将信息填写完整') diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index ea9ac0d..a495939 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -22,6 +22,7 @@