|
@@ -5,7 +5,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="learnWrap">
|
|
<view class="learnWrap">
|
|
|
<template v-if="current === 0">
|
|
<template v-if="current === 0">
|
|
|
- <!-- <view class="noData">您暂无相关学时审核记录哦~</view> -->
|
|
|
|
|
|
|
+ <view class="noData" v-if="listData.length == 0">您暂无相关学时审核记录哦~</view>
|
|
|
<view class="learnItem" v-for="(item, index) in listData" :key="index">
|
|
<view class="learnItem" v-for="(item, index) in listData" :key="index">
|
|
|
<view class="title">{{ item.goodsName }}</view>
|
|
<view class="title">{{ item.goodsName }}</view>
|
|
|
<view class="status">
|
|
<view class="status">
|
|
@@ -75,18 +75,18 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-if="current === 1">
|
|
<template v-if="current === 1">
|
|
|
- <view class="noData">您暂无相关学习凭证记录哦~</view>
|
|
|
|
|
- <!-- <view class="learnItem card">
|
|
|
|
|
- <view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
|
|
|
|
|
|
|
+ <view class="noData" v-if="listData.length == 0">您暂无相关学习凭证记录哦~</view>
|
|
|
|
|
+ <view class="learnItem card" v-for="(item,index) in listData" :key="index">
|
|
|
|
|
+ <view class="title">{{item.title}}</view>
|
|
|
<view class="number">
|
|
<view class="number">
|
|
|
<text class="label">编号:</text>
|
|
<text class="label">编号:</text>
|
|
|
- GZXY123456789
|
|
|
|
|
|
|
+ {{item.certificateCode}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="btnBox">
|
|
<view class="btnBox">
|
|
|
- <view class="btn" @click="showPhoto">电子照片</view>
|
|
|
|
|
- <view class="btn" @click="downloadCard">下载凭证</view>
|
|
|
|
|
|
|
+ <view class="btn" @click="showPhoto(item)">电子照片</view>
|
|
|
|
|
+ <!-- <view class="btn" @click="downloadCard(item)">下载凭证</view> -->
|
|
|
</view>
|
|
</view>
|
|
|
- </view> -->
|
|
|
|
|
|
|
+ </view>
|
|
|
</template>
|
|
</template>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -98,6 +98,7 @@ export default {
|
|
|
components: {},
|
|
components: {},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ loading:false,
|
|
|
current: 0,
|
|
current: 0,
|
|
|
list: [
|
|
list: [
|
|
|
{
|
|
{
|
|
@@ -121,15 +122,20 @@ export default {
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
if(this.itemIndex !== '') {
|
|
if(this.itemIndex !== '') {
|
|
|
- this.refreshByIndex();
|
|
|
|
|
|
|
+ if(this.current == 0) {
|
|
|
|
|
+ this.refreshByIndex();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
|
- console.log(111)
|
|
|
|
|
if(this.listData.length < this.total) {
|
|
if(this.listData.length < this.total) {
|
|
|
this.param.pageNum++;
|
|
this.param.pageNum++;
|
|
|
- this.getcourseperiodlistGoods();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(this.current == 0) {
|
|
|
|
|
+ this.getcourseperiodlistGoods();
|
|
|
|
|
+ } else if(this.current == 1){
|
|
|
|
|
+ this.getUserCertificateList();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -174,13 +180,29 @@ export default {
|
|
|
this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
|
|
this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getUserCertificateList() {
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.$api.getUserCertificateList(this.param).then(res => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ if (res.data.code === 200) {
|
|
|
|
|
+ this.listData = [...this.listData,...res.data.rows];
|
|
|
|
|
+ this.total = res.data.total;
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
getcourseperiodlistGoods() {
|
|
getcourseperiodlistGoods() {
|
|
|
|
|
+ this.loading = true;
|
|
|
this.$api.getcourseperiodlistGoods(this.param).then(res => {
|
|
this.$api.getcourseperiodlistGoods(this.param).then(res => {
|
|
|
|
|
+ this.loading = false;
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
this.listData = [...this.listData,...res.data.rows];
|
|
this.listData = [...this.listData,...res.data.rows];
|
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
appBeforeAddress(goodsId) {
|
|
appBeforeAddress(goodsId) {
|
|
|
this.$api.appBeforeAddress({
|
|
this.$api.appBeforeAddress({
|
|
@@ -202,12 +224,26 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
change(index) {
|
|
change(index) {
|
|
|
|
|
+ if(this.loading) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.current = index;
|
|
this.current = index;
|
|
|
|
|
+ this.listData = [];
|
|
|
|
|
+ this.total = 0;
|
|
|
|
|
+ this.param = {
|
|
|
|
|
+ pageNum:1,
|
|
|
|
|
+ pageSize:10
|
|
|
|
|
+ };
|
|
|
|
|
+ if(this.current == 0) {
|
|
|
|
|
+ this.getcourseperiodlistGoods();
|
|
|
|
|
+ } else if(this.current == 1){
|
|
|
|
|
+ this.getUserCertificateList();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- showPhoto() {
|
|
|
|
|
|
|
+ showPhoto(item) {
|
|
|
// 预览图片
|
|
// 预览图片
|
|
|
uni.previewImage({
|
|
uni.previewImage({
|
|
|
- urls: ['https://file.xyyxt.net/oss/images/file/20220111.jpg'],
|
|
|
|
|
|
|
+ urls: [this.$method.splitImgHost(item.certificatePath,true)],
|
|
|
longPressActions: {
|
|
longPressActions: {
|
|
|
itemList: ['发送给朋友', '保存图片', '收藏'],
|
|
itemList: ['发送给朋友', '保存图片', '收藏'],
|
|
|
success: function(data) {
|
|
success: function(data) {
|
|
@@ -219,11 +255,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- downloadCard() {
|
|
|
|
|
|
|
+ downloadCard(item) {
|
|
|
|
|
+ console.log(this.$method.splitImgHost(item.certificatePath,true))
|
|
|
uni.downloadFile({
|
|
uni.downloadFile({
|
|
|
- url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
|
|
|
|
|
|
|
+ url: this.$method.splitImgHost(item.certificatePath,true),
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
- console.log(999)
|
|
|
|
|
|
|
+ console.log(res,'res')
|
|
|
var filePath = res.tempFilePath;
|
|
var filePath = res.tempFilePath;
|
|
|
uni.openDocument({
|
|
uni.openDocument({
|
|
|
filePath: filePath,
|
|
filePath: filePath,
|