|
@@ -2,15 +2,15 @@
|
|
|
<view>
|
|
|
<view style="background-color: #FFFFFF;">
|
|
|
<view >
|
|
|
- <image src="/static/login_bg.jpg" style="height: 461rpx;width: 100%;"></image>
|
|
|
+ <image :src="$method.splitImgHost(goodsData.coverUrl, true)" style="width: 100%;"></image>
|
|
|
<view style="padding:20rpx">
|
|
|
<view style="display: flex;margin-top: 13rpx;">
|
|
|
- <view class="yearTag">2020</view>
|
|
|
- <view class="titleTag">2020年二建建筑工程管理与实务(实务专题班)</view>
|
|
|
+ <view class="yearTag">{{goodsData.createTime | formatDate}}</view>
|
|
|
+ <view class="titleTag">{{goodsData.goodsName}}</view>
|
|
|
</view>
|
|
|
<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
|
|
|
<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
|
|
|
- 共 <text class="blackFont">6</text> 张卷 <text class="blackFont">1200</text> 道题 </view>
|
|
|
+ 共 <text class="blackFont">{{goodsData.updateTime}}</text> 张卷 <text class="blackFont">1200</text> 道题 </view>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
@@ -25,50 +25,66 @@
|
|
|
</view>
|
|
|
<view class="intro" v-if="current == 0">
|
|
|
<view class="content">
|
|
|
- <view class="top">本题库为广东省建筑施工企业安全生产管理人员安全生产考试第三批参考题库(可两行)</view>
|
|
|
- <image class="img" src="/static/wd_bg.png" ></image>
|
|
|
+ <rich-text :nodes="goodsData.mobileDetailHtml"></rich-text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="title-list" v-if="current == 1">
|
|
|
<view class="content">
|
|
|
- <view class="list" v-for="(item1,index) in outline">
|
|
|
- <view class="module">
|
|
|
- .2Z106000 施工合同管理-模块标题
|
|
|
- </view>
|
|
|
- <view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
|
|
|
- 2Z106010 施工承发包的模式-2Z106020 施工合同...
|
|
|
- </view>
|
|
|
- <view class="article" v-if="item1.showList" :class="{active:index1 == 0}" v-for="(article,index1) in item1.list">
|
|
|
- 施工承发包模式-施工合同与物资采购合同二
|
|
|
- <navigator url="/pages2/bank/questionBankTest">
|
|
|
- <view v-if="index1 == 0" class="btn">试做</view>
|
|
|
- </navigator>
|
|
|
+ <view class="list" v-for="(item1,index1) in bankList" :key="'index1'+index1">
|
|
|
+ <template v-if="item1.type==1">
|
|
|
+ <view class="module" @click="clickModule" :data-id="item1.majorId" :data-index="index1">
|
|
|
+ {{item1.name}} {{item1.subjectName}}
|
|
|
+ </view>
|
|
|
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="list">
|
|
|
- <view class="section" :data-index="index" @click="changeItem">
|
|
|
- 2Z106010 施工承发包的模式-2Z106020 施工合同...
|
|
|
- </view>
|
|
|
- <view class="article" :class="{active:index1 == 0}" v-for="(article,index1) in 3">
|
|
|
- 施工承发包模式-施工合同与物资采购合同二
|
|
|
- <navigator url="/pages2/bank/questionBankTest">
|
|
|
- <view v-if="index1 == 0" class="btn">试做</view>
|
|
|
- </navigator>
|
|
|
+ <template v-if="item1.showList">
|
|
|
+ <view class="section" v-for="(item2,index2) in item1.list" :key="'childIndex2'+index2" @click="changeItem" :data-index1="index1" :data-index2="index2" :data-id="item2.chapterExamId" :data-type="item1.type">
|
|
|
+ <u-icon name="arrow-down" v-if="item2.showList"></u-icon>
|
|
|
+ <u-icon name="arrow-up" v-if="!item2.showList"></u-icon>
|
|
|
+ {{item2.name}}
|
|
|
+ {{item2.list}}
|
|
|
+ </view>
|
|
|
+ <view v-if="item2.showList" >
|
|
|
+ <view class="article" v-for="(article,index3) in item2.list" :key="'index3'+index3">
|
|
|
+ <view class="flex">{{article.name}}</view>
|
|
|
+ <navigator :url="'/pages2/bank/questionBankTest?id='+article.majorId">
|
|
|
+ <view v-if="index3 == 0" class="btn">试做</view>
|
|
|
+ </navigator>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="list">
|
|
|
- <view class="article" :class="{active:index1 == 0}" v-for="(article,index1) in 3">
|
|
|
- 施工承发包模式-施工合同与物资采购合同二
|
|
|
- <navigator url="/pages2/bank/questionBankTest">
|
|
|
- <view v-if="index1 == 0" class="btn">试做</view>
|
|
|
- </navigator>
|
|
|
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-if="item1.type ==2">
|
|
|
+ <view class="section" :data-index1="index1" :data-id="item1.majorId" @click="changeItem" :data-type="item1.type">
|
|
|
+ <u-icon name="arrow-down" v-if="item1.showList"></u-icon>
|
|
|
+ <u-icon name="arrow-up" v-if="!item1.showList"></u-icon>
|
|
|
+ {{item1.name}}
|
|
|
+ </view>
|
|
|
+ <view v-if="item1.showList" >
|
|
|
+ <view class="article" :class="{active:index2 == 0}" :key="'parentIndex2'+index3" v-for="(article,index2) in item1.list">
|
|
|
+ {{item1.name}}
|
|
|
+ <navigator :url="'/pages2/bank/questionBankTest?id='+article.majorId">
|
|
|
+ <view v-if="index1 == 0" class="btn">试做</view>
|
|
|
+ </navigator>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-if="item1.type ==3">
|
|
|
+ <view class="article active" >
|
|
|
+ {{item1.name}}
|
|
|
+
|
|
|
+ <navigator :url="'/pages2/bank/questionBankTest?id='+item1.majorId">
|
|
|
+ <view class="btn">试做</view>
|
|
|
+ </navigator>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="bottomBox">
|
|
@@ -95,23 +111,78 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
current:0,
|
|
|
- outline:[{
|
|
|
- list:[1,2,3,4],
|
|
|
- showList:false,
|
|
|
- }]
|
|
|
+ id:'',
|
|
|
+ goodsData:{},
|
|
|
+ bankList:[]
|
|
|
};
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ formatDate: function (value) {
|
|
|
+
|
|
|
+ var date = new Date(value);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
|
|
+ var Y = date.getFullYear();
|
|
|
+ return Y;
|
|
|
+ }
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
|
|
|
},
|
|
|
computed: { ...mapGetters(['userInfo']) },
|
|
|
onLoad(option) {
|
|
|
-
|
|
|
+ console.log(option)
|
|
|
+ this.id = option.id
|
|
|
+ this.getDetail();
|
|
|
+ this.goodsBankList()
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ getDetail(){
|
|
|
+ this.$api.goodsDetail(this.id).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.goodsData = res.data.data;
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goodsBankList() {
|
|
|
+ this.$api.goodsBankList({
|
|
|
+ goodsId:this.id
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.bankList = res.data.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goodsChapterList(bank,id) {
|
|
|
+ this.$api.goodsChapterList({
|
|
|
+ moduleExamId:id
|
|
|
+ }).then(res => {
|
|
|
+ this.$set(bank,'list',res.data.data)
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clickModule(e) {
|
|
|
+
|
|
|
+ let index = e.currentTarget.dataset.index;
|
|
|
+ let id = e.currentTarget.dataset.id;
|
|
|
+
|
|
|
+
|
|
|
+ if(this.bankList[index].list) {
|
|
|
+ this.$set(this.bankList[index],'showList',!this.bankList[index].showList)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$api.goodsChapterList({
|
|
|
+ moduleExamId:id
|
|
|
+ }).then(res => {
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ item.list = [];
|
|
|
+ })
|
|
|
+ this.$set(this.bankList[index],'showList',true)
|
|
|
+ this.$set(this.bankList[index],'list',res.data.data)
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
buy(){
|
|
|
if(this.$method.isGoLogin()){
|
|
|
return
|
|
@@ -122,9 +193,17 @@ export default {
|
|
|
if(this.$method.isGoLogin()){
|
|
|
return
|
|
|
}
|
|
|
- uni.showToast({
|
|
|
- title: '添加成功',
|
|
|
- duration: 1000
|
|
|
+
|
|
|
+ let self = this
|
|
|
+ this.$api.addCart({goodsId:this.id}).then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ uni.setStorageSync('updateCart',1) //提醒刷新购物车
|
|
|
+ uni.showToast({
|
|
|
+ title: '添加成功'
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$u.toast(res.data.msg);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
},
|
|
@@ -135,12 +214,61 @@ export default {
|
|
|
this.current = index;
|
|
|
},
|
|
|
changeItem(e) {
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- this.outline.forEach((arrItem,i) => {
|
|
|
- if(i == index) {
|
|
|
- arrItem.showList = !arrItem.showList
|
|
|
+
|
|
|
+
|
|
|
+ let index1 = e.currentTarget.dataset.index1
|
|
|
+ let index2 = e.currentTarget.dataset.index2
|
|
|
+ let id = e.currentTarget.dataset.id
|
|
|
+ let type = e.currentTarget.dataset.type
|
|
|
+
|
|
|
+ if(type == 1) {
|
|
|
+ if(this.bankList[index1].list[index2].list.length) {
|
|
|
+ this.$set(this.bankList[index1].list[index2],'showList',!this.bankList[index1].list[index2].showList)
|
|
|
+ // this.$set(this.bankList[index1].list[index2],'list',[{
|
|
|
+ // name:'试卷',
|
|
|
+ // id:2,
|
|
|
+ // }])
|
|
|
+ return;
|
|
|
}
|
|
|
- })
|
|
|
+
|
|
|
+ this.$api.goodsExamList({
|
|
|
+ chapterExamId:id
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+ // res.data.data.forEach(item => {
|
|
|
+ // item.showList = false;
|
|
|
+ // })
|
|
|
+ // this.bankList = res.data.data;
|
|
|
+
|
|
|
+ this.$set(this.bankList[index1].list[index2],'showList',true)
|
|
|
+ this.$set(this.bankList[index1].list[index2],'list',res.data.data)
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ } else if(type == 2) {
|
|
|
+ if(this.bankList[index1].list.length) {
|
|
|
+ this.$set(this.bankList[index1],'showList',!this.bankList[index1].showList)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$api.goodsExamList({
|
|
|
+ chapterExamId:id
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+ // res.data.data.forEach(item => {
|
|
|
+ // item.showList = false;
|
|
|
+ // })
|
|
|
+ // this.bankList = res.data.data;
|
|
|
+
|
|
|
+ this.$set(this.bankList[index1],'showList',true)
|
|
|
+ this.$set(this.bankList[index1],'list',res.data.data)
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -196,18 +324,6 @@ export default {
|
|
|
font-size: 24rpx;
|
|
|
color: #666666;
|
|
|
|
|
|
- &::before {
|
|
|
- content:'^';
|
|
|
- display: inline-block;
|
|
|
- margin-right:20rpx;
|
|
|
- }
|
|
|
-
|
|
|
- &.up {
|
|
|
- &::before {
|
|
|
- transform: rotate(180deg);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.article {
|
|
@@ -218,6 +334,11 @@ export default {
|
|
|
font-size: 24rpx;
|
|
|
color: #666666;
|
|
|
border-bottom: 1rpx solid #EEEEEE;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .flex_auto{
|
|
|
+ flex:1;
|
|
|
+ }
|
|
|
|
|
|
&:nth-last-of-type(1) {
|
|
|
border:0;
|