助力
This commit is contained in:
28
project.config.json
Normal file
28
project.config.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"appid": "wx24c1b58020a5ce66",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.3.3",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "insertSpaces",
|
||||
"tabSize": 2
|
||||
}
|
||||
}
|
||||
7
project.private.config.json
Normal file
7
project.private.config.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "jwl-applet",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,11 @@ export function queryActivityDetail(data) {
|
||||
url: 'activity/applet/activity/detail',
|
||||
method: 'get',
|
||||
data,
|
||||
<<<<<<< HEAD
|
||||
noToken: true
|
||||
=======
|
||||
noToken: true
|
||||
>>>>>>> 9e24edad28eff09cb1c9d947314de6e4e3a33d19
|
||||
});
|
||||
}
|
||||
//查询抽奖次数
|
||||
@@ -62,6 +66,7 @@ export function getLuckyRecord(data) {
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
//查询中奖记录
|
||||
@@ -116,3 +121,6 @@ export function wxLogin(data) {
|
||||
}
|
||||
|
||||
|
||||
=======
|
||||
}
|
||||
>>>>>>> 9e24edad28eff09cb1c9d947314de6e4e3a33d19
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
<<<<<<< HEAD
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
@@ -139,6 +140,140 @@
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/activity?detailId=' + detailId,
|
||||
=======
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
querySysConfigList,
|
||||
} from '@/jtools/api/question';
|
||||
import Subject1 from "./components/Subject1";
|
||||
import Subject2 from "./components/Subject2";
|
||||
import {
|
||||
queryActivityList,
|
||||
} from '@/jtools/api/activity';
|
||||
export default {
|
||||
components: {
|
||||
Subject1,
|
||||
Subject2
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:false,
|
||||
subject: storage.get('curSubject') || '1',
|
||||
curTab: 0,
|
||||
searchValue: '',
|
||||
cityName: '',
|
||||
categoryList: [],
|
||||
rightList: storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
activityList: ['https://cdn.uviewui.com/uview/swiper/swiper1.png']
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.show=true
|
||||
this.getSubjectConfig()
|
||||
if (this.subject == '1' || this.subject == '4') {
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
if(this.subject=='2'||this.subject=='3'){
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
}
|
||||
this.queryActivityList();
|
||||
},
|
||||
onHide(){
|
||||
this.show=false
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject","orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
getLoading(newVal){
|
||||
if(this.show){
|
||||
if(newVal){
|
||||
if(this.loading_subject4 && this.loading_subject1){
|
||||
uni.hideTabBar();
|
||||
}
|
||||
}else{
|
||||
uni.showTabBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub4', 'getOrderQuestion_sub1', 'changeSubject']),
|
||||
//获取科目配置
|
||||
getSubjectConfig() {
|
||||
const carTypeId = storage.get('carType') || '1001'
|
||||
querySysConfigList(carTypeId, 'Subject').then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
this.categoryList = resp.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
name: item.configItemName
|
||||
}
|
||||
})
|
||||
this.subject=storage.get('curSubject') || '1',
|
||||
this.curTab=this.categoryList.findIndex(item=>item.configItemCode==this.subject)
|
||||
}
|
||||
})
|
||||
},
|
||||
//切换科目
|
||||
async changeCategory(val) {
|
||||
this.subject = val.configItemCode
|
||||
this.changeSubject(this.subject)
|
||||
if (this.subject == '1' || this.subject == '4') {
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
//查询活动列表
|
||||
queryActivityList(){
|
||||
// console.log(this.user)
|
||||
// console.log(useUserStore().userInfo)
|
||||
// this.activityList = null;
|
||||
// uni.request({
|
||||
// url: 'http://localhost:8089/applet/activity/list',
|
||||
// method: 'get',
|
||||
// data: {'schoolId': useUserStore().userInfo.schoolId}
|
||||
// }).then(resp => {
|
||||
// console.log(".....")
|
||||
// console.log(resp)
|
||||
// if(resp.data.code == 200) {
|
||||
// this.activityList = resp.data.data
|
||||
// console.log("*****")
|
||||
// console.log(resp.data)
|
||||
// console.log(resp.data.data)
|
||||
// console.log(this.activityList)
|
||||
// }
|
||||
// })
|
||||
queryActivityList({schoolId: this.user.schoolId}).then(resp => {
|
||||
this.activityList = resp.data;
|
||||
})
|
||||
},
|
||||
// 去活动
|
||||
handleToActivity(index) {
|
||||
let detailId;
|
||||
this.activityList.find((item, index1) => {
|
||||
if(index === index1){
|
||||
detailId = item.detailId;
|
||||
}
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/activity?detailId='+detailId,
|
||||
>>>>>>> 9e24edad28eff09cb1c9d947314de6e4e3a33d19
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user