This commit is contained in:
曹辉 2023-04-24 14:24:50 +08:00
parent 247c010c92
commit c3d3384353
2 changed files with 133 additions and 29 deletions

View File

@ -3,14 +3,34 @@
<view class="text"> <view class="text">
参加知识技能培训通过考试获得护理资格 参加知识技能培训通过考试获得护理资格
</view> </view>
<view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'> <view class="card">
<view class="item" v-for='(item,index) in list' :key="index" @click.stop='gographicvideo(item)'>
<image :src="baseurl + item.trainingItemCoverUrl" mode=""></image>
<view class="title">
{{item.trainingItemTitle}}
</view>
<view class="price" v-if="item.trainingItemPrice">
{{item.trainingItemPrice}}
</view>
<view class="price" v-else>
0
</view>
<view class="buy" v-if='!item.trainingOrderStatus' @click.stop='buy(item)'>
购买
</view>
<view class="havebuy" v-else>
已购
</view>
</view>
</view>
<!-- <view class="items" v-for="(item,index) in list" :key="index" @tap='gographicvideo(item)'>
<view class="item"> <view class="item">
<image :src="baseurl+item.trainingItemCoverUrl" mode=""></image> <image :src="baseurl+item.trainingItemCoverUrl" mode=""></image>
<view class="title"> <view class="title">
{{item.trainingItemTitle}} {{item.trainingItemTitle}}
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
</template> </template>
<script> <script>
@ -52,11 +72,11 @@
gographicvideo(item) { gographicvideo(item) {
if (item.trainingItemTitle == '图文学习') { if (item.trainingItemTitle == '图文学习') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/Graphiclearning/Graphiclearning?trainingItemId=${item.id}` url: `/pages/Graphiclearning/Graphiclearning?trainingItemId=${item.trainingItemId}`
}) })
} else if (item.trainingItemTitle == '视频学习') { } else if (item.trainingItemTitle == '视频学习') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/Videolearning/Videolearning?trainingItemId=${item.id}` url: `/pages/Videolearning/Videolearning?trainingItemId=${item.trainingItemId}`
}) })
} }
} }
@ -86,39 +106,123 @@
color: #333333; color: #333333;
padding: 0; padding: 0;
.items { .card {
width: 96%; width: 96%;
margin: 25rpx auto; margin: 25rpx auto;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
.item { .item {
width: 100%; width: 100%;
height: 132rpx; border-bottom: 1rpx solid #E6E6E6;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
margin-bottom: 20rpx;
position: relative; position: relative;
height: 200rpx;
.title { margin-bottom: 20rpx;
display: inline-block; background: #FFFFFF;
font-size: 32rpx; border-radius: 5rpx;
position: absolute;
top: 50%;
left: 120rpx;
transform: translateY(-50%);
}
image { image {
width: 60rpx;
height: 60rpx;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 41rpx;
transform: translateY(-50%); transform: translateY(-50%);
left: 15rpx;
width: 216rpx;
height: 136rpx;
}
.havebuy {
width: 125rpx;
height: 55rpx;
background: #CDCDCD;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
bottom: 30rpx;
}
.buy {
width: 125rpx;
height: 55rpx;
background: #4271B9;
border-radius: 5rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
position: absolute;
right: 15rpx;
bottom: 30rpx;
}
.time {
font-size: 24rpx;
color: #666666;
position: absolute;
top: 120rpx;
left: 250rpx;
}
.price {
position: absolute;
top: 120rpx;
left: 250rpx;
font-size: 28rpx;
font-weight: 500;
color: #EA706A;
}
.title {
width: 281rpx;
position: absolute;
top: 35rpx;
left: 250rpx;
font-weight: 500;
font-size: 30rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; //
line-clamp: 2;
-webkit-box-orient: vertical;
} }
} }
} }
// .items {
// width: 96%;
// margin: 25rpx auto;
// .item {
// width: 100%;
// height: 132rpx;
// background: #FFFFFF;
// box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
// border-radius: 5rpx;
// margin-bottom: 20rpx;
// position: relative;
// .title {
// display: inline-block;
// font-size: 32rpx;
// position: absolute;
// top: 50%;
// left: 120rpx;
// transform: translateY(-50%);
// }
// image {
// width: 60rpx;
// height: 60rpx;
// position: absolute;
// top: 50%;
// left: 41rpx;
// transform: translateY(-50%);
// }
// }
// }
.text { .text {
margin: 40rpx 0 0 23rpx; margin: 40rpx 0 0 23rpx;
font-size: 24rpx; font-size: 24rpx;

View File

@ -6,7 +6,7 @@
<view class="title"> <view class="title">
{{item.trainingItemTitle}} {{item.trainingItemTitle}}
</view> </view>
<view class="price" v-if="item.trainingItemPrice"> <!-- <view class="price" v-if="item.trainingItemPrice">
{{item.trainingItemPrice}} {{item.trainingItemPrice}}
</view> </view>
<view class="price" v-else> <view class="price" v-else>
@ -17,10 +17,10 @@
</view> </view>
<view class="havebuy" v-else> <view class="havebuy" v-else>
已购 已购
</view> -->
</view> </view>
</view> </view>
</view> <!-- <u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
<u-popup v-model="buyshow" mode='bottom' height='500' class='popup' safe-area-inset-bottom>
<view class="popuptitle">请选择支付方式</view> <view class="popuptitle">请选择支付方式</view>
<view class="buyselect"> <view class="buyselect">
<image src="../../static/wechat.png" mode=""></image> <image src="../../static/wechat.png" mode=""></image>
@ -31,7 +31,7 @@
<view class="buybtn" @tap='tobuy'> <view class="buybtn" @tap='tobuy'>
确认支付{{buylist.trainingItemPrice}} 确认支付{{buylist.trainingItemPrice}}
</view> </view>
</u-popup> </u-popup> -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
@ -58,8 +58,8 @@
}, },
onLoad(options) { onLoad(options) {
const that = this const that = this
// this.trainingItemId = options.trainingItemId this.trainingItemId = options.trainingItemId
this.trainingItemId = 2 // this.trainingItemId = 2
this.baseurl = baseurl this.baseurl = baseurl
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {