| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view>
- <view v-for="(item,index) in treatmentPackage" :key="index">
- <view class="goodsitem">
- <view class="goodsitem-img">
- <image :src="item.images" mode="aspectFill" style="height: 100%;width: 100%"></image>
- <!-- <view class="goodsitem-status">讲解中</view> -->
- </view>
- <view class="goodsitem-r">
- <view>
- <view class="goodsitem-title" :style="{ fontSize: fontSize(32)}">{{item.productName}}</view>
- <view class="goodsitem-desc ellipsis2" :style="{ fontSize: fontSize(30)}">{{item.secondName}}</view>
- </view>
- <view class="goodsitem-btnbox" @click="goBuy(item)">
- <view class="goodsitem-price">
- <view class="unit">¥</view>
- <text class="price">{{item.price&&item.price.toFixed(2)}}</text>
- </view>
- <view class="btn">去购买</view>
- </view>
- </view>
- </view>
- </view>
- <view v-if="treatmentPackage.length==0">
- <view class="empty">
- <text>暂未上新活动</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { getJumpStoreAppId } from "../api/courseAuto.js"
- export default {
- props:['treatmentPackage','urlOption','source'],
- data() {
- return {
- list: []
- }
- },
- computed: {
- fontSize() {
- return size=>{
- const value = uni.upx2px(size)
- const scale = uni.getStorageSync('fontScale') || 1;
- if(scale<1){
- return value + 'px';
- }else {
- return value * scale + 'px';
- }
- }
- }
- },
- methods: {
- goBuy(item) {
- uni.navigateTo({
- url: '/pages/shopping/productDetails?productId='+item.productId+'&companyId='+this.urlOption.companyId+ '&companyUserId='+this.urlOption.companyUserId
- })
- },
- goBuy2(item) {
- if(item.type==3) {
- // 跳转商城
- const param = {
- type: item.type
- }
- getJumpStoreAppId(param,this.source).then(res=>{
- if(res.code==200) {
- if(getApp().globalData.appId == res.msg) {
- uni.navigateTo({
- url: '/pages/shopping/productDetails?productId='+item.packageId+'&companyId='+this.urlOption.companyId+ '&companyUserId='+this.urlOption.companyUserId
- })
- } else {
- uni.navigateToMiniProgram({
- appId: res.msg,
- path: '/pages/shopping/productDetails?productId='+item.packageId+'&companyId='+this.urlOption.companyId+ '&companyUserId='+this.urlOption.companyUserId
- })
- }
- }
- })
- } else {
- uni.navigateTo({
- url: '/pages_index/packageDetails?packageId='+item.packageId+'&companyId='+this.urlOption.companyId+ '&companyUserId='+this.urlOption.companyUserId
- })
- }
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .empty {
- padding: 40rpx 24rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- color: #999;
- &-btn {
- margin-top: 24rpx;
- padding: 20rpx 60rpx;
- border-radius: 44rpx 44rpx 44rpx 44rpx;
- border: 2rpx solid #FF5C03;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- color: #FF5C03;
- }
- }
- .empty-btn-min {
- flex-direction: column;
- padding: 8rpx 15rpx !important;
- font-size: 28rpx !important;
- }
- .goodsitem {
- display: flex;
- padding: 24rpx;
- overflow: hidden;
- min-height: 200rpx;
- &-img {
- overflow: hidden;
- flex-shrink: 0;
- width: 200rpx;
- height: 200rpx;
- border-radius: 14rpx;
- position: relative;
- }
- &-status {
- position: absolute;
- left: 0;
- top: 0;
- padding: 8rpx 15rpx;
- background: #FF5C03;
- border-radius: 14rpx 0 14rpx 0;
- font-size: 20rpx;
- color: #fff;
- box-sizing: border-box;
- text-align: center;
- }
- &-r {
- flex: 1;
- overflow: hidden;
- margin-left: 16rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- &-title {
- font-weight: bold;
- // font-size: 32rpx;
- color: #191A1B;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- &-desc {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- // font-size: 30rpx;
- color: #939599;
- margin-top: 20rpx;
- }
- &-btnbox {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .btn {
- display: inline-block;
- padding: 10rpx 38rpx;
- border-radius: 12rpx;
- border: 3rpx solid #FF5C03;
- font-weight: bold;
- // font-size: 30rpx;
- color: #FF5C03;
- text-align: center;
- }
- }
- .unit {
- font-size: 32rpx;
- }
- &-price {
- font-family: Roboto, Roboto;
- font-weight: bold;
- font-size: 40rpx;
- color: #FF5C03;
- display: flex;
- align-items: flex-end;
- }
- }
- </style>
|