Commit 1b360b91 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents d99a445b 7d92b1ed
...@@ -4,9 +4,11 @@ export default { ...@@ -4,9 +4,11 @@ export default {
globalData: { globalData: {
// 开发环境 // 开发环境
uniEnv: process.uniEnv, uniEnv: process.uniEnv,
questionList: [] questionList: [],
orgId: -1
}, },
onLaunch: function() { onLaunch: function(options) {
this.globalData.orgId = options?.orgId || -1
// 版本更新 // 版本更新
this.updateApp() this.updateApp()
}, },
......
<template>
<!-- #ifndef APP-NVUE -->
<view class="uni-list uni-border-top-bottom">
<view v-if="border" class="uni-list--border-top"></view>
<slot />
<view v-if="border" class="uni-list--border-bottom"></view>
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<list class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15"><slot /></list>
<!-- #endif -->
</template>
<script>
/**
* List 列表
* @description 列表组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} border = [true|false] 标题
*/
export default {
name: 'uniList',
'mp-weixin': {
options: {
multipleSlots: false
}
},
props: {
enableBackToTop: {
type: [Boolean, String],
default: false
},
scrollY: {
type: [Boolean, String],
default: false
},
border: {
type: Boolean,
default: true
}
},
// provide() {
// return {
// list: this
// };
// },
created() {
this.firstChildAppend = false;
},
methods: {
loadMore(e) {
this.$emit('scrolltolower');
}
}
};
</script>
<style lang="scss">
.uni-list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
background-color: $uni-bg-color;
position: relative;
flex-direction: column;
}
.uni-list--border {
position: relative;
/* #ifdef APP-NVUE */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
border-bottom-color: $uni-border-color;
border-bottom-style: solid;
border-bottom-width: 0.5px;
/* #endif */
z-index: -1;
}
/* #ifndef APP-NVUE */
.uni-list--border-top {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
z-index: 1;
}
.uni-list--border-bottom {
position: absolute;
bottom: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
/* #endif */
</style>
...@@ -63,8 +63,7 @@ ...@@ -63,8 +63,7 @@
"name": "searchDetail", "name": "searchDetail",
"style": { "style": {
"navigationBarTitleText": "搜索结果", "navigationBarTitleText": "搜索结果",
"navigationStyle": "custom", "navigationStyle": "custom"
"disableScroll": true
} }
} }
] ]
......
...@@ -244,7 +244,7 @@ export default { ...@@ -244,7 +244,7 @@ export default {
} }
if(this.source === 1){ // 顺序答题,如果答满则清空数据 if(this.source === 1){ // 顺序答题,如果答满则清空数据
const check = this.questionList.every(v => v.id) const check = this.questionList.every(v => v.submitStatus)
if (check) { if (check) {
this.$u.vuex('lastIndex', 0) this.$u.vuex('lastIndex', 0)
this.$u.vuex('questionList', []) this.$u.vuex('questionList', [])
...@@ -419,7 +419,7 @@ export default { ...@@ -419,7 +419,7 @@ export default {
// 统计是否达满所有试题 // 统计是否达满所有试题
const count = this.questionList.reduce((accumulator, currentValue) => { const count = this.questionList.reduce((accumulator, currentValue) => {
if (currentValue.id) accumulator++ if (currentValue.submitStatus) accumulator++
return accumulator return accumulator
}, 0) }, 0)
...@@ -525,7 +525,13 @@ export default { ...@@ -525,7 +525,13 @@ export default {
const info = this.list.find(v => v.index === this.currentIndex) const info = this.list.find(v => v.index === this.currentIndex)
const action = status ? 'removeCollection' : 'joinCollection' const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}).then(res => { this.$u.api[action]({questionId: info.id}).then(res => {
if(res) info.collectionFlag = !status if(res) {
info.collectionFlag = !status
if (this.source === 1) { //更新缓存数据
this.questionList[this.currentIndex] = info
this.$u.vuex('questionList', this.questionList)
}
}
}) })
}, },
// 移除 // 移除
......
...@@ -17,7 +17,8 @@ export default { ...@@ -17,7 +17,8 @@ export default {
host: '', //配置为自己的额服务器即可 host: '', //配置为自己的额服务器即可
} }
}, },
onShow() {}, onShow() {
},
methods: { methods: {
wxLogin() { wxLogin() {
// 获取code 小程序专有,用户登录凭证。 // 获取code 小程序专有,用户登录凭证。
...@@ -36,6 +37,7 @@ export default { ...@@ -36,6 +37,7 @@ export default {
code: code, code: code,
avatar: userInfo.avatarUrl, avatar: userInfo.avatarUrl,
nickname: userInfo.nickName, nickname: userInfo.nickName,
orgId: getApp().globalData.orgId
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment