diff --git a/baseapp.config.js b/baseapp.config.js
index a400ac94c0fc18de13feff51d9b1b5fc335e4200..ec37697b45c8c26f9fbad3bebd0e97f9267cda80 100644
--- a/baseapp.config.js
+++ b/baseapp.config.js
@@ -14,9 +14,8 @@ module.exports = {
},
"router":{
"needLogin":[ //配置需要路由拦截的页面地址,在打开这些页面之前会自动检查(不联网)uni_id_token的值是否存在/过期等
- "/pages/ucenter/edit/edit",
- "/uni_modules/uni-login-page/pages/index/pwd-retrieve",
"/uni_modules/uni-id-users/pages/uni-id-users/edit"
+ "/uni_modules/uni-news-favorite/pages/uni-news-favorite/list"
],
"login":["univerify","smsCode","username","weixin","apple"] //默认就是短信验证码登陆
},
diff --git a/pages/list/detail.vue b/pages/list/detail.vue
index 840a450df325b3583391763fef317cfcab731375..722315c288846a6aeb508679e722d71d00ce88b7 100644
--- a/pages/list/detail.vue
+++ b/pages/list/detail.vue
@@ -6,25 +6,27 @@
unicloud-db 组件文档:https://uniapp.dcloud.net.cn/uniCloud/unicloud-db-component
DB Schema 规范:https://uniapp.dcloud.net.cn/uniCloud/schema
-->
-
-
+
+
+
+
+ {{ title }}
- {{title}}
-
@@ -61,7 +63,7 @@
return {
// 当前显示 _id
id: "",
- title: '',
+ title: 'title',
// 数据表名
collection: 'opendb-news-articles,uni-id-users',
// 查询字段,多个字段用 , 分割
@@ -92,7 +94,7 @@
uni.setNavigationBarTitle({
title: event.title
})
- }
+ }
},
onNavigationBarButtonTap(event) {
if (event.type == 'share') {
@@ -136,7 +138,7 @@
}
})
.then(res=>{
- console.log(res);
+ // console.log(res);
})
.catch(err=>{
console.log(err);
diff --git a/pages/ucenter/settings/settings.vue b/pages/ucenter/settings/settings.vue
index 4e3259438f7aa10f9041920b050022b03f6e677e..6e96fa33cd0f35c1690f47d40616c5ef6b95aec6 100644
--- a/pages/ucenter/settings/settings.vue
+++ b/pages/ucenter/settings/settings.vue
@@ -205,9 +205,11 @@
url: '/uni_modules/uni-login-page/pages/index/index'
});
}
- },
+ },
+ /**
+ * 每一项的点击事件
+ */
itemClick(item) {
- console.log(item);
if (item.event) {
this[item.event](item);
}
diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue
index 17cc7bb540fa9b053def85495e2fe8d4feec78f2..e423edc3c21a4f5ffc8aee41bd4719238dfb36f7 100644
--- a/pages/ucenter/ucenter.vue
+++ b/pages/ucenter/ucenter.vue
@@ -112,9 +112,6 @@
// #endif
},
methods: {
- ...mapMutations({
- logout: 'user/logout'
- }),
toSettings() {
uni.navigateTo({
url: "/pages/ucenter/settings/settings"
@@ -175,10 +172,12 @@
uni.showLoading({
mask: true
})
- db.collection(dbCollectionName).field('score,balance').get().then((res) => {
+ db.collection(dbCollectionName).where('user_id == $env.uid').field('score,balance').get().then((res) => {
const data = res.result.data[0];
+ let msg = '';
+ msg = data ? ('当前积分为' + data.balance) : '当前无积分';
uni.showToast({
- title: '当前积分为' + data.balance,
+ title: msg,
icon: 'none'
});
}).catch((err) => {
@@ -333,4 +332,4 @@
/* #endif */
background-color: #DD524D;
}
-
+
diff --git a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
index af83748f1e11af479269cbe6759bd74c0ccd70f2..1a6ee31b70ac0c9309d2be87506ff6854e74d622 100644
--- a/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+++ b/uni_modules/uni-forms/components/uni-forms/uni-forms.vue
@@ -353,7 +353,8 @@
this.formData[i] = this._getValue(i, this.value[i])
}
}
- }
+ }
+ console.log(this.formData, this.formRules);
return this.validateAll(this.formData, 'submit', callback)
},
diff --git a/uni_modules/uni-id-users/pages/uni-id-users/edit.vue b/uni_modules/uni-id-users/pages/uni-id-users/edit.vue
index eaf387d1e67515d905a68d6e08e86262378b6869..ac48d9a1bd1e2c65c0bb19ca9fc3c0440d6e1d61 100644
--- a/uni_modules/uni-id-users/pages/uni-id-users/edit.vue
+++ b/uni_modules/uni-id-users/pages/uni-id-users/edit.vue
@@ -1,13 +1,13 @@
-
-
+
+
-
+
@@ -29,7 +29,8 @@
validator
} from '../../js_sdk/validator/uni-id-users.js';
import {
- mapMutations
+ mapMutations,
+ mapGetters
} from 'vuex';
const db = uniCloud.database();
const dbCollectionName = 'uni-id-users';
@@ -71,10 +72,14 @@
...getValidator(["avatar", "gender", "nickname"])
}
}
+ },
+ computed:{
+ ...mapGetters({
+ userInfo:'user/info'
+ })
},
onLoad(e) {
- let id = "60795c140983f8000192f235";
- id = uni.getStorageSync('uni_id_uid');
+ let id = uni.getStorageSync('uni_id_uid') || this.userInfo._id;
this.formDataId = id
this.getDetail(id)
},
@@ -138,7 +143,6 @@
title: '修改成功'
})
this.setUserInfo(value);
- // this.getOpenerEventChannel().emit('refreshData')
setTimeout(() => uni.navigateBack(), 500)
}).catch((err) => {
uni.showModal({
diff --git a/uni_modules/uni-login-page/common/loginPage.mixin.js b/uni_modules/uni-login-page/common/loginPage.mixin.js
index 0c492e29b18242fa2aa9f46fc5db0dfc00f06fd0..fc342a81d88bd11663ac0e32af63b52457c1ad50 100644
--- a/uni_modules/uni-login-page/common/loginPage.mixin.js
+++ b/uni_modules/uni-login-page/common/loginPage.mixin.js
@@ -21,7 +21,8 @@ let mixin = {
formData:{
phone:'',
code:'',
- pwd:''
+ pwd:'',
+ pwd2:''
},
rules: {
phone:{
@@ -56,6 +57,26 @@ let mixin = {
errorMessage: '密码应为6到20位',
}
]
+ },
+ pwd2:{
+ rules:[{
+ required: true,
+ errorMessage: '请确认密码',
+ },
+ {
+ pattern: /^.{6,20}$/,
+ errorMessage: '密码应为6到20位',
+ },
+ {
+ validateFunction:function(rule,value,data,callback){
+ console.log(value);
+ if(value!=data.pwd){
+ callback('两次输入密码不一致')
+ };
+ return true
+ }
+ }
+ ]
}
}
}
diff --git a/uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue b/uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
index 9b402cb2300e0e0a314326fa6eb63ca29c190a4f..6b7c6115774c0c09ff899e5496521ed74bdf794c 100644
--- a/uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
+++ b/uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
@@ -17,19 +17,21 @@
+
+
-
+
忘记密码
注册账号
-
+
-
+
@@ -80,7 +82,7 @@
uni.hideLoading()
console.log(e.result);
if(e.result.code === 0){
- this.loginSuccess(e.result)
+ this.loginSuccess(e.result)
}else{
uni.showModal({
title: '错误',
@@ -113,13 +115,13 @@
icon: 'none'
});
// this.currenPhoneArea = this.phoneArea[event.detail.value];
- },
- /* 前往注册 */
- toRegister(e){
- console.log(e);
- uni.navigateTo({
- url:'/uni_modules/uni-login-page/pages/register/register'
- })
+ },
+ /* 前往注册 */
+ toRegister(e){
+ console.log(e);
+ uni.navigateTo({
+ url:'/uni_modules/uni-login-page/pages/register/register'
+ })
}
}
}
@@ -136,9 +138,9 @@
}
.login-text-sub {
color: #8a8f8b;
- }
- .toRegister{
- margin-top: 80px;
- width: 600rpx;
+ }
+ .toRegister{
+ margin-top: 80px;
+ width: 600rpx;
}
diff --git a/uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue b/uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
index b782937f84310e7bd52b0258ccd17d6cfba4d47b..3c98b798ea569b6cc0a3b4f97a1c3cdd50c58535 100644
--- a/uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
+++ b/uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
@@ -3,22 +3,30 @@
- 重置密码
-
+ 重置密码
+
+
+
+
+
+
+
+
@@ -52,7 +60,7 @@ import mixin from '../../common/loginPage.mixin.js';
},
onReady() {
if(this.formData.phone){
- this.$refs.shortCode.start();
+ // this.$refs.shortCode.start();
}
},
methods: {
@@ -60,19 +68,22 @@ import mixin from '../../common/loginPage.mixin.js';
* 完成并提交
*/
submit(){
- this.request('user-center/resetPwdBySmsCode',{
- "mobile":this.formData.phone,
- "code":this.formData.code,
- "password":this.formData.pwd
- },(data,result)=>{
- console.log(result);
- uni.showToast({
- title: result.msg,
- icon: 'none'
- });
- if(result.code === 0){
- uni.navigateBack()
- }
+ this.$refs.form.submit()
+ .then(res=>{
+ this.request('user-center/resetPwdBySmsCode',{
+ "mobile":this.formData.phone,
+ "code":this.formData.code,
+ "password":this.formData.pwd
+ },(data,result)=>{
+ console.log(result);
+ uni.showToast({
+ title: result.msg,
+ icon: 'none'
+ });
+ if(result.code === 0){
+ uni.navigateBack()
+ }
+ })
})
}
}
diff --git a/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue b/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue
index 67e4cf688c7f47e1ed973894f7326bcec29e1706..66e810041accb4bd014a314c4be7ad34fc361750 100644
--- a/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue
+++ b/uni_modules/uni-news-favorite/pages/uni-news-favorite/list.vue
@@ -1,71 +1,63 @@
-
-
-
- {{error.message}}
-
-
-
-
- {{item.article_title || item.article_id}}
-
-
-
-
-
-
-
-
-
-
-
-
-