Commit 15f45dd5 authored by zhengke's avatar zhengke

增加组件

parent 9e1a0b53
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5> <style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5>
<!--列表模式--> <!--列表模式-->
<style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6> <style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6>
<!-- 教育有星星模式 -->
<style7 v-if="goods.listStyle == 4" :goods-info="goods" :good-list="currentList"></style7>
</template> </template>
<template v-else-if="goods.catPosition == 'left'"> <template v-else-if="goods.catPosition == 'left'">
<!-- 左侧分类 --> <!-- 左侧分类 -->
...@@ -61,6 +63,8 @@ ...@@ -61,6 +63,8 @@
<style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5> <style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5>
<!--列表模式--> <!--列表模式-->
<style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6> <style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6>
<!-- 教育有星星模式 -->
<style7 v-if="goods.listStyle == 4" :goods-info="goods" :good-list="currentList"></style7>
</template> </template>
</div> </div>
</div> </div>
...@@ -73,6 +77,7 @@ import style3 from './style3'; ...@@ -73,6 +77,7 @@ import style3 from './style3';
import style4 from './style4'; import style4 from './style4';
import style5 from './style5'; import style5 from './style5';
import style6 from './style6'; import style6 from './style6';
import style7 from './style7';
import sidebar from '../sidebar/index'; import sidebar from '../sidebar/index';
export default { export default {
props: ['goods'], props: ['goods'],
...@@ -83,6 +88,7 @@ export default { ...@@ -83,6 +88,7 @@ export default {
style4, style4,
style5, style5,
style6, style6,
style7,
sidebar sidebar
}, },
data() { data() {
......
<template>
<view
style="padding: 12px; padding-bottom: 0;width:100%;"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
class="good-seven"
v-for="(item, gli) in goodList"
:key="gli"
@click="openGood(item)"
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /></view>
<view class="img-box"><image style="width: 100%; height: 100%;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" /></view>
<view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
<view class="good-price-info">
<view>
<u-rate
:current="item.courseScore!=null &&item.courseScore>0?item.courseScore:'5'"
:active-color="mainColor" inactive-color="#DDDDDD"
active-icon="star"
inactive-icon="star-o"
size="20"
:disabled="true"
></u-rate>
<text class="good-rb-text">{{item.courseScore!=null &&item.courseScore>0?item.courseScore.toFixed(1):'5.0'}}</text>
</view>
<view class="price" :style="{ color: mainColor }">{{ goodsInfo.showGoodsPrice ? getPrice(item.price) : '' }}</view>
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
<u-icon name="cart-o" size="40" :color="mainColor" v-if="goodsInfo.buyBtn == 'cart'" />
<u-icon name="add-o" size="40" :color="mainColor" v-else-if="goodsInfo.buyBtn == 'add'" />
<u-button
type="primary"
size="mini"
:ripple="true"
:color="goodsInfo.buttonColor"
:custom-style="
`backgroundColor:${goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{ goodsInfo.buyBtnText }}
</u-button>
</view>
</view>
</view>
</view>
<good-sku v-if="showSku" borderRadius="20" v-model="showSku" :good="sku" :option-type="2"></good-sku>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
<script>
import goodSku from '../goods/goodsku';
import auth from '@/components/auth/index.vue';
export default {
components: {
goodSku,
auth
},
props: ['goodList', 'goodsInfo'],
data() {
return {
mainColor: '',
activeKey: 0,
showSku: false,
sku: {},
showAuth: false,
u: {}
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id });
},
showSkuHandler(g) {
this.sku = g;
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
this.showSku = true;
}
},
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
// this.showAuth = false;
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
}
}
};
</script>
<style>
.good-seven {
position: relative;
margin-bottom: 14px;
display: flex;
/* height: 102px; */
border: 1rpx solid transparent;
border-radius: 10rpx;
box-sizing: border-box;
padding: 0 1px 1px 0;
overflow: hidden;
}
.good-seven .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-seven .img-box {
width: 125px;
height: 70px;
border-radius:4px;
overflow: hidden;
box-shadow:0 4px 10px 1px #D2D2D2;
}
.good-seven .good-info {
padding-left: 12px;
flex: 1;
width: 1rpx;
border: 10rpx;
padding-bottom: 0;
display: flex;
flex-direction: column;
/* width:20%; */
}
.good-seven .good-info .good-name {
font-size: 13px;
height: 34px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.good-seven .good-info .good-price-info {
display: flex;
justify-items: center;
justify-content: space-between;
align-items: flex-end;
height: 10px;
flex: 1;
padding-bottom: 10rpx;
}
.good-seven .good-rb-text {
font-size: 11px;
color: #999999;
margin-top: 3px;
margin-left: 2px;
}
.good-seven .good-info .good-price-info .price {
color: #ff4544;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.good-seven .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template> <template>
<view class='Rstudy' :style="{ <view class='Rstudy' :style="{
'padding-top':info.PaddingTop+'px', 'padding-top':goods.PaddingTop+'px',
'padding-right':info.PaddingRight+'px', 'padding-right':goods.PaddingRight+'px',
'padding-bottom':info.PaddingBottom+'px', 'padding-bottom':goods.PaddingBottom+'px',
'padding-left':info.PaddingLeft+'px', 'padding-left':goods.PaddingLeft+'px',
'bottom':posiTop+'px' 'bottom':posiTop+'px'
}" }"
v-if="isshow==true" v-if="isshow==true"
> >
<view class='Rstudy-box' :style="{width:windowWidth+'px'}"> <view class='Rstudy-box' :style="{width:windowWidth+'px'}">
<view class="close" v-if="info.isleft==1" @click="isshow=false"> <view class="close" @click="isshow=false">
<u-icon name="cross" color="#FFF" size="40"></u-icon> <u-icon name="cross" color="#FFF" size="40"></u-icon>
</view> </view>
<view class="content" :style="{width:textWidth+'px'}"> <view class="content" :style="{width:textWidth+'px'}">
<view class="cover" v-if='info.isimg ==1'> <view class="cover">
<image src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601282872605&di=686b8ba4f0e837522a97d77267a2da18&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D2247852322%2C986532796%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1280%26h%3D853" style="width: 100%;height: 100%;border-radius: 5px;"></image> <image :src="goods.Cover" style="width: 100%;height: 100%;border-radius: 5px;"></image>
</view> </view>
<view class="content-r" :style="{width:(textWidth-70-10)+'px'}"> <view class="content-r" :style="{width:(textWidth-70-10)+'px'}">
<text class="content-Name" v-if='info.isName ==1'>vue初级入门最新</text> <text class="content-Name">{{goods.Name}}</text>
<text class="progress" v-if='info.isschedule ==1'>小白入门-ref的使用</text> <view class="progress-box">
<progress percent="40" active stroke-width="3" />
</view> </view>
</view> </view>
<view class="close" v-if="info.isleft==2" @click="isshow=false">
<u-icon name="cross" color="#FFF" size="40"></u-icon>
</view> </view>
</view> </view>
...@@ -31,6 +30,7 @@ ...@@ -31,6 +30,7 @@
<script> <script>
export default{ export default{
props: ['goods'],
data(){ data(){
return{ return{
info:{ info:{
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
}, },
textWidth:0, textWidth:0,
windowWidth:0, windowWidth:0,
isshow:false, isshow:true,
posiTop:0, posiTop:0,
} }
...@@ -70,7 +70,8 @@ ...@@ -70,7 +70,8 @@
padding: 10px; padding: 10px;
display: flex;flex-direction: row; display: flex;flex-direction: row;
align-items: center; align-items: center;
background: rgba(99, 99, 107, 0.8); /* background: rgba(99, 99, 107, 0.8); */
background: rgba(0, 0, 0, 0.6);
border-radius: 5px; border-radius: 5px;
justify-content: space-between; justify-content: space-between;
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<!-- 只是商品 --> <!-- 只是商品 -->
<template> <template>
<!--一行一个--> <!--一行一个-->
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1> <style1 v-if="goods.listStyle == 1" :goods-info="goods"></style1>
<!--一行两个--> <!--一行两个-->
<style2 v-if="goods.listStyle == 2" :goods-info="goods" :good-list="currentList"></style2> <style2 v-if="goods.listStyle == 2" :goods-info="goods"></style2>
<!--左右滚动--> <!--左右滚动-->
<style5 v-if="goods.listStyle == 0" :goods-info="goods" :good-list="currentList"></style5> <style5 v-if="goods.listStyle == 0" :goods-info="goods"></style5>
<!--列表模式--> <!--列表模式-->
<style6 v-if="goods.listStyle == -1" :goods-info="goods" :good-list="currentList"></style6> <style6 v-if="goods.listStyle == -1" :goods-info="goods"></style6>
</template> </template>
</div> </div>
</div> </div>
...@@ -23,7 +23,7 @@ import style5 from './style5'; ...@@ -23,7 +23,7 @@ import style5 from './style5';
import style6 from './style6'; import style6 from './style6';
export default { export default {
// props: ['goods'], props: ['goods'],
components: { components: {
style1, style1,
style2, style2,
...@@ -36,39 +36,39 @@ export default { ...@@ -36,39 +36,39 @@ export default {
mainColor: '', mainColor: '',
activeKey: 0, activeKey: 0,
currentList: [], currentList: [],
goods:{ // goods:{
catPosition:'top', // catPosition:'top',
listStyle:2, // listStyle:2,
showCat:false, // showCat:false,
backgroundColor:'', // backgroundColor:'',
backgroundPicUrl:'', // backgroundPicUrl:'',
goodsStyle:2,//边框模式 // goodsStyle:2,//边框模式
showGoodsName:true, // showGoodsName:true,
showsubtitle:true, // showsubtitle:true,
goodsCoverProportion:'1-1', // goodsCoverProportion:'1-1',
backgroundColor:'#FFF', // backgroundColor:'#FFF',
PaddingTop:10, // PaddingTop:10,
PaddingRight:10, // PaddingRight:10,
PaddingBottom:10, // PaddingBottom:10,
PaddingLeft:10, // PaddingLeft:10,
list:[ // list:[
{id: 367454, // {id: 367454,
name: "高考必考语文作文快速提升作文快速提升", // name: "高考必考语文作文快速提升作文快速提升",
picUrl: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1593499381000_752.jpg", // picUrl: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1593499381000_752.jpg",
subtitle: '本教程共分3个章节', // subtitle: '本教程共分3个章节',
}, // },
{id: 367454, // {id: 367454,
name: "高考必考语文作文快速提升作文快速提升", // name: "高考必考语文作文快速提升作文快速提升",
picUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601282872605&di=686b8ba4f0e837522a97d77267a2da18&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D2247852322%2C986532796%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1280%26h%3D853", // picUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601282872605&di=686b8ba4f0e837522a97d77267a2da18&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D2247852322%2C986532796%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1280%26h%3D853",
subtitle: '本教程共分3个章节', // subtitle: '本教程共分3个章节',
}, // },
{id: 367454, // {id: 367454,
name: "高考必考语文作文快速提升作文快速提升", // name: "高考必考语文作文快速提升作文快速提升",
picUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601282872605&di=686b8ba4f0e837522a97d77267a2da18&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D2247852322%2C986532796%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1280%26h%3D853", // picUrl: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601282872605&di=686b8ba4f0e837522a97d77267a2da18&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D2247852322%2C986532796%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1280%26h%3D853",
subtitle: '本教程共分3个章节', // subtitle: '本教程共分3个章节',
} // }
] // ]
} // }
}; };
}, },
created() { created() {
......
<template> <template>
<div <div :style="{
:style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'paddingLeft':goodsInfo.PaddingLeft+'px',
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '' 'paddingRight':goodsInfo.PaddingRight+'px',
}" 'paddingTop':goodsInfo.PaddingTop+'px',
> 'paddingBottom':goodsInfo.PaddingBottom+'px'
<div }">
v-for="(item, gli) in goodList" <div v-for="(item, gli) in goodsInfo.list" :key="gli" class="good_study_one" @click="openGood(item)" :style="{
:key="gli" borderRadius:goodsInfo.SearchFilletPX+'px'
class="good-one" }">
@click="openGood(item)" <image style="
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<!-- <div class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width: 100%;" /></div> -->
<!-- <image
style="width: calc(100vw - 24px); height: 66vw;"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl"
v-if="goodsInfo.goodsCoverProportion == '3-2'"
/> -->
<image
style="
width: calc(100vw - 24px); width: calc(100vw - 24px);
height: 100vw; height: 100vw;
border-radius: 10rpx 10rpx 0 0; border-radius: 10rpx 10rpx 0 0;
" "
mode='aspectFill' :src="item.picUrl" />
mode='aspectFill' <div class="good-info">
:src="item.picUrl" <div class="good-name" v-if="item.name">{{ item.name }}</div>
/> <div class="good-price-info" v-if="item.lableName">
<div class="good-info" v-if="imgModel==false"> <span class="price">{{ item.lableName }}</span>
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div>
<div class="good-price-info" v-if="goodsInfo.showsubtitle">
<span class="price" >{{ item.subtitle }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -46,35 +28,26 @@ ...@@ -46,35 +28,26 @@
</template> </template>
<script> <script>
import auth from '@/components/auth/index.vue';
import auth from '@/components/auth/index.vue'; export default {
export default {
components: { components: {
auth auth
}, },
props: ['goodList', 'goodsInfo'], props: ['goodsInfo'],
data() { data() {
return { return {
mainColor: '', mainColor: '',
activeKey: 0,
showSku: false, showSku: false,
sku: {}, sku: {},
showAuth: false, showAuth: false,
u: {}, u: {},
imgModel:false
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if(this.goodsInfo.showGoodsName==false && this.goodsInfo.showsubtitle ==false){
this.imgModel=true
}
}, },
methods: { methods: {
openGood(item) { openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -83,7 +56,11 @@ export default { ...@@ -83,7 +56,11 @@ export default {
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id }); if (item.linkUrl) {
uni.navigateTo({
url: item.linkUrl,
});
}
} }
}, },
reloadUserinfo() { reloadUserinfo() {
...@@ -95,59 +72,66 @@ export default { ...@@ -95,59 +72,66 @@ export default {
this.showAuth = false; this.showAuth = false;
} }
} }
}; };
</script> </script>
<style> <style>
.good-one { .good_study_one {
margin: 12px; margin: 12px;
position: relative; position: relative;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
/* padding-bottom: 10rpx; */ border: 1px solid rgb(226, 226, 226);
overflow: hidden; overflow: hidden;
} }
.good-one .tips {
.good_study_one .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-one .guding {
.good_study_one .guding {
position: relative; position: relative;
} }
.good-one .guding .img-box {
.good_study_one .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-one .good-info {
.good_study_one .good-info {
padding: 12rpx; padding: 12rpx;
padding-bottom: 0;
margin-top: -5px; margin-top: -5px;
} }
.good-one .good-info .good-name {
.good_study_one .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-bottom: 13px; margin-bottom: 13px;
} }
.good-one .good-info .good-price-info {
.good_study_one .good-info .good-price-info {
display: flex; display: flex;
} }
.good-one .good-info .good-price-info .price {
.good_study_one .good-info .good-price-info .price {
color: #999999; color: #999999;
font-size: 11px; font-size: 11px;
flex: 1; flex: 1;
} }
.good-one .good-info .good-price-info .buy {
.good_study_one .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
<template> <template>
<view <view style="padding: 12px; padding-bottom: 0;" :style="{
style="padding: 12px; padding-bottom: 0;"
:style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, }">
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '' <view :style="{
}" 'paddingLeft':goodsInfo.PaddingLeft+'px',
> 'paddingRight':goodsInfo.PaddingRight+'px',
'paddingTop':goodsInfo.PaddingTop+'px',
'paddingBottom':goodsInfo.PaddingBottom+'px',
}">
<u-row gutter="24"> <u-row gutter="24">
<u-col span="6" v-for="(item, gli) in goodList" :key="gli"> <u-col span="6" v-for="(item, gli) in goodsInfo.list" :key="gli">
<view <view class="good_study_two" @click="openGood(item)" :style="{borderRadius:goodsInfo.SearchFilletPX+'px'}">
class="good-two"
@click="openGood(item)"
:style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<!-- <view class="tips" v-if="goodsInfo.showGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view> -->
<view class="img-box"> <view class="img-box">
<view class="img-show"> <view class="img-show">
<image <image style="
style="
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx 10rpx 0 0; " mode="aspectFill" :src="item.picUrl" />
"
mode="aspectFill"
:src="item.picUrl"
/>
</view> </view>
</view> </view>
<view class="good-info" v-if="imgModel==false"> <view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> <view class="good-name" v-if="item.name">{{ item.name }}</view>
<view class="good-price-info" v-if="goodsInfo.showsubtitle"> <view class="good-price-info" v-if="item.lableName">
<span class="price" >{{ item.subtitle }}</span> <span class="price">{{ item.lableName }}</span>
</view> </view>
</view> </view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from '@/components/auth/index.vue';
import auth from '@/components/auth/index.vue'; export default {
export default {
components: { components: {
auth auth
}, },
props: ['goodList', 'goodsInfo'], props: ['goodsInfo'],
data() { data() {
return { return {
mainColor: '', mainColor: '',
activeKey: 0,
showSku: false, showSku: false,
showAuth: false, showAuth: false,
u: {}, u: {},
imgModel:false
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if(this.goodsInfo.showGoodsName==false && this.goodsInfo.showsubtitle ==false){
this.imgModel=true
}
}, },
methods: { methods: {
openGood(item) { openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -79,8 +60,11 @@ export default { ...@@ -79,8 +60,11 @@ export default {
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({ url: '/pages/school/courseList?GoodsId=' + item.id }); if (item.linkUrl) {
// uni.navigateTo({ url: '/pages/school/articleList' }); uni.navigateTo({
url: item.linkUrl,
});
}
} }
}, },
reloadUserinfo() { reloadUserinfo() {
...@@ -92,33 +76,38 @@ export default { ...@@ -92,33 +76,38 @@ export default {
this.showAuth = false; this.showAuth = false;
} }
} }
}; };
</script> </script>
<style> <style>
.good-two { .good_study_two {
position: relative; position: relative;
margin-bottom: 12px; margin-bottom: 12px;
border: 1rpx solid transparent; border: 1rpx solid transparent;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
/* padding-bottom: 10rpx; */ border: 1px solid rgb(226, 226, 226);
} box-shadow: 0 4px 10px 1px #e6e5e5;
.good-two .tips { background-color: #fff;
}
.good_study_two .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-two .img-box {
.good_study_two .img-box {
width: 100%; width: 100%;
height: 0; height: 0;
padding-top: 54%; padding-top: 60%;
position: relative; position: relative;
} }
.good-two .img-box .img-show {
.good_study_two .img-box .img-show {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
...@@ -127,36 +116,46 @@ export default { ...@@ -127,36 +116,46 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
.good-two .guding {
.good_study_two .guding {
position: relative; position: relative;
} }
.good-two .guding .img-box {
.good_study_two .guding .img-box {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
} }
.good-two .good-info {
padding: 6rpx; .good_study_two .good-info {
margin-top: -5px; padding: 15rpx;
padding-bottom: 0; }
}
.good-two .good-info .good-name { .good_study_two .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin: 3px 0; margin-bottom: 8px;
color: #1B1D1E;
font-size: 13px; font-size: 13px;
height: 37px; }
}
.good-two .good-info .good-price-info { .good_study_two .good-info .good-price-info {
display: flex; display: flex;
} color: #999999;
.good-two .good-info .good-price-info .price { overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.good_study_two .good-info .good-price-info .price {
color: #999999; color: #999999;
/* flex: 1; */ /* flex: 1; */
font-size: 11px; font-size: 11px;
...@@ -165,9 +164,10 @@ export default { ...@@ -165,9 +164,10 @@ export default {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.good-two .good-info .good-price-info .buy {
.good_study_two .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
<template> <template>
<view <view class="her-scoller-study" :style="{
class="her-scoller" 'background-color': goodsInfo.backgroundColor
:style="{ }">
<view class="her_Two_study" :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
'padding-top':goodsInfo.PaddingTop+'px', 'padding-top':goodsInfo.PaddingTop+'px',
'padding-right':goodsInfo.PaddingRight+'px', 'padding-right':goodsInfo.PaddingRight+'px',
'padding-bottom':goodsInfo.PaddingBottom+'px', 'padding-bottom':goodsInfo.PaddingBottom+'px',
'padding-left':goodsInfo.PaddingLeft+'px', 'padding-left':goodsInfo.PaddingLeft+'px',
}" }">
> <view class="good-five" @click="openGood(item)" v-for="(item, gli) in goodsInfo.list" :style="{borderRadius:goodsInfo.SearchFilletPX+'px'}" :key="gli">
<view <view class="img-box">
class="good-five" <view class="img-show">
@click="openGood(item)" <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.picUrl" />
v-for="(item, gli) in goodList" </view>
:key="gli" </view>
<view class="good-info">
> <view class="good-name" v-if="item.name">{{ item.name }}</view>
<view class="img-box" :style="{'width':imgModel?'173px':'97px','height':imgModel?'100px':'70px'}"><image style="width: 100%; height: 100%;border-radius: 4px;" mode="aspectFill" :src="item.picUrl" /></view> <view class="good-price-info" v-if="item.lableName">
<view class="good-info" v-if="imgModel==false"> <span class="price">{{ item.lableName }}</span>
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view> </view>
<view class="good-price-info" v-if="goodsInfo.showsubtitle">
<span class="price" >{{ item.subtitle }}</span>
</view> </view>
</view> </view>
</view> </view>
...@@ -30,35 +27,25 @@ ...@@ -30,35 +27,25 @@
</view> </view>
</template> </template>
<script> <script>
import auth from '@/components/auth/index.vue';
import auth from '@/components/auth/index.vue'; export default {
export default {
components: { components: {
auth auth
}, },
props: ['goodList', 'goodsInfo'], props: ['goodsInfo'],
data() { data() {
return { return {
mainColor: '', mainColor: '',
activeKey: 0,
showAuth: false, showAuth: false,
u: {}, u: {},
imgModel:false,
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if(this.goodsInfo.showGoodsName==false && this.goodsInfo.showsubtitle ==false){
this.imgModel=true
}
}, },
methods: { methods: {
openGood(item) { openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -67,7 +54,11 @@ export default { ...@@ -67,7 +54,11 @@ export default {
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id }); if (item.linkUrl) {
uni.navigateTo({
url: item.linkUrl,
});
}
} }
}, },
reloadUserinfo() { reloadUserinfo() {
...@@ -79,24 +70,28 @@ export default { ...@@ -79,24 +70,28 @@ export default {
this.showAuth = false; this.showAuth = false;
} }
} }
}; };
</script> </script>
<style> <style>
.her-scoller { .her-scoller-study {
padding: 12px;
}
.her_Two_study{
overflow-x: auto !important; overflow-x: auto !important;
display: flex; display: flex;
white-space: nowrap;
} }
.her-scoller-study .good-five {
.her-scoller .good-five {
position: relative; position: relative;
margin-right: 12px;
width: 30%;
border-radius: 10rpx; border-radius: 10rpx;
display: flex; padding-bottom: 10rpx;
flex-direction: row; border:1px solid rgb(226, 226, 226);
align-items: center; overflow: hidden;
/* float: left; */
} }
.her-scoller .good-five .tips { .her-scoller-study .good-five .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
...@@ -104,49 +99,61 @@ export default { ...@@ -104,49 +99,61 @@ export default {
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.her-scoller .good-five .img-box { .her-scoller-study .good-five .img-box {
width: 97px; width: 100%;
height: 70px; height: 0;
margin-right: 10px; padding-top: 100%;
} position: relative;
.her-scoller .good-five .good-info {
padding: 5px 0 ;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 173px;
height: 70px;
} }
.her-scoller .good-five .good-info .good-name { .her-scoller-study .good-five .img-box .img-show {
font-size: 13px; position: absolute;
height: 34px; left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%; width: 100%;
height: 100%;
overflow: hidden;
z-index: 2;
}
.her-scoller-study .good-five .guding {
position: relative;
}
.her-scoller-study .good-five .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.her-scoller-study .good-five .good-info {
padding: 6rpx;
padding-bottom: 0;
}
.her-scoller-study .good-five .good-info .good-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: block;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
padding-right: 5px; margin-bottom: 4rpx;
font-size: 13px;
width: 100%;
} }
.her-scoller .good-five .good-info .good-price-info { .her-scoller-study .good-five .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }
.her-scoller .good-five .good-info .good-price-info .price { .her-scoller-study .good-five .good-info .good-price-info .price {
color: #999999; color: #999999;
flex: 1; flex: 1;
font-size: 11px; font-size: 12px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.her-scoller .good-five .good-info .good-price-info .buy { .her-scoller-study .good-five .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
......
<template> <template>
<view <view style="width:100%;padding: 12px;" :style="{
style="width:100%;"
:style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, }">
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '', <view :style="{
'padding-top':goodsInfo.PaddingTop+'px', 'padding-top':goodsInfo.PaddingTop+'px',
'padding-right':goodsInfo.PaddingRight+'px', 'padding-right':goodsInfo.PaddingRight+'px',
'padding-bottom':goodsInfo.PaddingBottom+'px', 'padding-bottom':goodsInfo.PaddingBottom+'px',
'padding-left':goodsInfo.PaddingLeft+'px', 'padding-left':goodsInfo.PaddingLeft+'px'
}" }">
> <view class="good-four-study" v-for="(item, gli) in goodsInfo.list" :key="gli" :style="{'borderRadius':goodsInfo.SearchFilletPX+'px'}" @click="openGood(item)">
<view <view class="img-box">
class="good-four" <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.picUrl" />
v-for="(item, gli) in goodList" </view>
:key="gli" <view class="good-info">
@click="openGood(item)" <view class="good-name" v-if="item.name">{{ item.name }}</view>
:style="{ <view class="good-price-info" v-if="item.lableName">
<span class="price">{{ item.lableName }}</span>
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '' </view>
}"
>
<view class="img-box"><image style="width: 100%; height: 100%;border-radius: 4px;" mode="aspectFill" :src="item.picUrl" /></view>
<view class="good-info" v-if="imgModel==false">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
<view class="good-price-info" v-if="goodsInfo.showsubtitle">
<span class="price" >{{ item.subtitle }}</span>
</view> </view>
</view> </view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view> </view>
</template> </template>
<script> <script>
import goodSku from '../goods/goodsku'; import goodSku from '../goods/goodsku';
import auth from '@/components/auth/index.vue'; import auth from '@/components/auth/index.vue';
export default { export default {
components: { components: {
auth auth
}, },
props: ['goodList', 'goodsInfo'], props: ['goodsInfo'],
data() { data() {
return { return {
mainColor: '', mainColor: '',
activeKey: 0,
showAuth: false, showAuth: false,
u: {}, u: {},
imgModel:false
}; };
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
if(this.goodsInfo.showGoodsName==false && this.goodsInfo.showsubtitle ==false){
this.imgModel=true
}
}, },
methods: { methods: {
openGood(item) { openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo'); this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) { if (!this.u) {
this.u = { this.u = {
...@@ -69,7 +53,11 @@ export default { ...@@ -69,7 +53,11 @@ export default {
}; };
this.showAuth = true; this.showAuth = true;
} else { } else {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id }); if (item.linkUrl) {
uni.navigateTo({
url: item.linkUrl,
});
}
} }
}, },
reloadUserinfo() { reloadUserinfo() {
...@@ -81,36 +69,38 @@ export default { ...@@ -81,36 +69,38 @@ export default {
this.showAuth = false; this.showAuth = false;
} }
} }
}; };
</script> </script>
<style> <style>
.good-four { .good-four-study {
position: relative; position: relative;
/* margin-bottom: 14px; */ margin-bottom: 14px;
display: flex; display: flex;
height: 90px; height: 102px;
border: 1rpx solid transparent; border: 1px solid rgb(226, 226, 226);
border-radius: 10rpx; border-radius: 10rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 1px 1px 0; padding: 0 1px 1px 0;
overflow: hidden; overflow: hidden;
padding: 10px 0; }
}
.good-four .tips { .good-four-study .tips {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 4; z-index: 4;
} }
.good-four .img-box {
width: 125px; .good-four-study .img-box {
height: 70px; width: 100px;
} height: 100px;
.good-four .good-info { }
padding: 5px 0 5px 10px;
.good-four-study .good-info {
padding: 12px;
flex: 1; flex: 1;
width: 1rpx; width: 1rpx;
border: 10rpx; border: 10rpx;
...@@ -118,8 +108,9 @@ export default { ...@@ -118,8 +108,9 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* width:20%; */ /* width:20%; */
} }
.good-four .good-info .good-name {
.good-four-study .good-info .good-name {
font-size: 13px; font-size: 13px;
height: 34px; height: 34px;
overflow: hidden; overflow: hidden;
...@@ -127,25 +118,28 @@ export default { ...@@ -127,25 +118,28 @@ export default {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.good-four .good-info .good-price-info {
.good-four-study .good-info .good-price-info {
display: flex; display: flex;
justify-items: center; justify-items: center;
align-items: flex-end; align-items: flex-end;
height: 22px; height: 22px;
flex: 1; flex: 1;
padding-bottom: 10rpx; padding-bottom: 10rpx;
} }
.good-four .good-info .good-price-info .price {
.good-four-study .good-info .good-price-info .price {
color: #999999; color: #999999;
flex: 1; flex: 1;
font-size: 11px; font-size: 14px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.good-four .good-info .good-price-info .buy {
.good-four-study .good-info .good-price-info .buy {
width: 24px; width: 24px;
text-align: right; text-align: right;
} }
</style> </style>
<template>
<div class="goods-box" :class="{ flex: goods.catPosition == 'left' }">
<div :class="{ 'right-slider': goods.catPosition == 'top' }">
<!-- 只是商品 -->
<template>
<!--列表模式-->
<style6 v-if="goods.listStyle == -1" :goods-info="goods"></style6>
<!--左右滚动-->
<style5 v-if="goods.listStyle == 0" :goods-info="goods"></style5>
<!--一行一个-->
<style1 v-if="goods.listStyle == 1" :goods-info="goods"></style1>
</template>
</div>
</div>
</template>
<script>
import style1 from './style1';
import style5 from './style5';
import style6 from './style6';
export default {
props: ['goods'],
components: {
style1,
style5,
style6,
},
data() {
return {
mainColor: '',
currentList: [],
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
if (this.goods.showCat) {
this.currentList = this.goods.catList[0].goodsList;
} else {
this.currentList = this.goods.list;
}
},
methods: {
}
};
</script>
<style>
.style4View {
display: inline-block;
width: 100%;
padding-left: 80px;
box-sizing: border-box;
}
.goods-box {
/* margin: 20rpx 0; */
}
.goods-box .tips {
z-index: 50 !important;
}
.goods-box.flex {
display: flex;
}
.goods-box.flex .left-slider {
width: 80px;
position: absolute;
}
.goods-box.flex .right-slider {
flex: 1;
width: 1rpx;
}
.defaultz .van-sticky {
z-index: 1 !important;
}
.goods-box .van-tabs__scroll {
background: none;
}
.goods-box ._div {
width: 100%;
}
</style>
<template>
<div :style="{
'background-color': goodsInfo.backgroundColor,
'paddingLeft':goodsInfo.PaddingLeft+'px',
'paddingRight':goodsInfo.PaddingRight+'px',
'paddingTop':goodsInfo.PaddingTop+'px',
'paddingBottom':goodsInfo.PaddingBottom+'px'
}">
<div v-for="(item, gli) in goodsInfo.list" :key="gli" class="good_study_one" @click="openGood(item)" :style="{
borderRadius:goodsInfo.SearchFilletPX+'px'
}">
<image style="
width: calc(100vw - 24px);
height: 100vw;
border-radius: 10rpx 10rpx 0 0;
"
mode='aspectFill' :src="item.picUrl" />
<div class="good-info">
<div class="good-name" v-if="item.name">{{ item.name }}</div>
<div>
<view style="display:inline-block;padding: 2px 4px;border-radius: 2px;font-size: 10px;color: #FAF8F9;margin-right:5px"
:style="{background:mainColor}" v-for="(subItem,subIndex) in item.lableNameList" :key="subIndex">
{{subItem}}
</view>
</div>
</div>
</div>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</div>
</template>
<script>
import auth from '@/components/auth/index.vue';
export default {
components: {
auth
},
props: ['goodsInfo'],
data() {
return {
mainColor: '',
showSku: false,
sku: {},
showAuth: false,
u: {},
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
uni.navigateTo({
url: '/pages/school/courseInfo?GoodsId=' + item.id
});
}
},
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
// this.showAuth = false;
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
}
}
};
</script>
<style>
.good_study_one {
margin: 12px;
position: relative;
border: 1rpx solid transparent;
border-radius: 10rpx;
border: 1px solid rgb(226, 226, 226);
overflow: hidden;
}
.good_study_one .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good_study_one .guding {
position: relative;
}
.good_study_one .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.good_study_one .good-info {
padding: 12rpx;
margin-top: -5px;
}
.good_study_one .good-info .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 13px;
}
.good_study_one .good-info .good-price-info {
display: flex;
}
.good_study_one .good-info .good-price-info .price {
color: #999999;
font-size: 11px;
flex: 1;
}
.good_study_one .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<view class="her-scoller-study" :style="{
'background-color': goodsInfo.backgroundColor
}">
<view class="her_Two_study" :style="{
'background-color': goodsInfo.backgroundColor,
'padding-top':goodsInfo.PaddingTop+'px',
'padding-right':goodsInfo.PaddingRight+'px',
'padding-bottom':goodsInfo.PaddingBottom+'px',
'padding-left':goodsInfo.PaddingLeft+'px',
}">
<view class="good-five" @click="openGood(item)" v-for="(item, gli) in goodsInfo.list" :style="{borderRadius:goodsInfo.SearchFilletPX+'px'}" :key="gli">
<view class="img-box">
<view class="img-show">
<image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.picUrl" />
</view>
</view>
<view class="good-info">
<view class="good-name" v-if="item.name">{{ item.name }}</view>
<view>
<view style="display:inline-block;padding: 2px 4px;border-radius: 2px;font-size: 10px;color: #FAF8F9;margin-right:5px"
:style="{background:mainColor}" v-for="(subItem,subIndex) in item.lableNameList" :key="subIndex">
{{subItem}}
</view>
</view>
</view>
</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
<script>
import auth from '@/components/auth/index.vue';
export default {
components: {
auth
},
props: ['goodsInfo'],
data() {
return {
mainColor: '',
showAuth: false,
u: {},
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
},
methods: {
openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
uni.navigateTo({
url: '/pages/school/courseInfo?GoodsId=' + item.id
});
}
},
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
// this.showAuth = false;
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
}
}
};
</script>
<style>
.her-scoller-study {
padding: 12px;
}
.her_Two_study{
overflow-x: auto !important;
display: flex;
white-space: nowrap;
}
.her-scoller-study .good-five {
position: relative;
margin-right: 12px;
width: 30%;
border-radius: 10rpx;
padding-bottom: 10rpx;
border:1px solid rgb(226, 226, 226);
overflow: hidden;
}
.her-scoller-study .good-five .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.her-scoller-study .good-five .img-box {
width: 100%;
height: 0;
padding-top: 100%;
position: relative;
}
.her-scoller-study .good-five .img-box .img-show {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 2;
}
.her-scoller-study .good-five .guding {
position: relative;
}
.her-scoller-study .good-five .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.her-scoller-study .good-five .good-info {
padding: 6rpx;
padding-bottom: 0;
}
.her-scoller-study .good-five .good-info .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: block;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-bottom: 4rpx;
font-size: 13px;
width: 100%;
}
.her-scoller-study .good-five .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: center;
}
.her-scoller-study .good-five .good-info .good-price-info .price {
color: #999999;
flex: 1;
font-size: 12px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.her-scoller-study .good-five .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<view style="width:100%;padding: 12px;" :style="{
'background-color': goodsInfo.backgroundColor,
}">
<view :style="{
'padding-top':goodsInfo.PaddingTop+'px',
'padding-right':goodsInfo.PaddingRight+'px',
'padding-bottom':goodsInfo.PaddingBottom+'px',
'padding-left':goodsInfo.PaddingLeft+'px'
}">
<view class="good-four-study" v-for="(item, gli) in goodsInfo.list" :key="gli" :style="{'borderRadius':goodsInfo.SearchFilletPX+'px'}" @click="openGood(item)">
<view class="img-box">
<image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.picUrl" />
</view>
<view class="good-info">
<view class="good-name" v-if="item.name">{{ item.name }}</view>
<view>
<view style="display:inline-block;padding: 2px 4px;border-radius: 2px;font-size: 10px;color: #FAF8F9;margin-right:5px"
:style="{background:mainColor}" v-for="(subItem,subIndex) in item.lableNameList" :key="subIndex">
{{subItem}}
</view>
</view>
</view>
</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</view>
</template>
<script>
import goodSku from '../goods/goodsku';
import auth from '@/components/auth/index.vue';
export default {
components: {
auth
},
props: ['goodsInfo'],
data() {
return {
mainColor: '',
showAuth: false,
u: {},
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
},
mounted(){
console.log(this.goodsInfo,'gdinfo');
},
methods: {
openGood(item) {
this.u = uni.getStorageSync('mall_UserInfo');
if (!this.u) {
this.u = {
nickName: '未登录',
avatarUrl: ''
};
this.showAuth = true;
} else {
uni.navigateTo({
url: '/pages/school/courseInfo?GoodsId=' + item.id
});
}
},
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
// this.showAuth = false;
},
//关闭登录窗口
gbAuth() {
this.showAuth = false;
}
}
};
</script>
<style>
.good-four-study {
position: relative;
margin-bottom: 14px;
display: flex;
height: 102px;
border: 1px solid rgb(226, 226, 226);
border-radius: 10rpx;
box-sizing: border-box;
padding: 0 1px 1px 0;
overflow: hidden;
}
.good-four-study .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-four-study .img-box {
width: 100px;
height: 100px;
}
.good-four-study .good-info {
padding: 12px;
flex: 1;
width: 1rpx;
border: 10rpx;
padding-bottom: 0;
display: flex;
flex-direction: column;
/* width:20%; */
}
.good-four-study .good-info .good-name {
font-size: 13px;
margin-bottom:5px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.good-four-study .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: flex-end;
height: 22px;
flex: 1;
padding-bottom: 10rpx;
}
.good-four-study .good-info .good-price-info .price {
color: #999999;
flex: 1;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.good-four-study .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
...@@ -56,10 +56,11 @@ ...@@ -56,10 +56,11 @@
<shopinfo v-if="d.id == 'shop-info' " :ad="d.data" :key="di" ref="son"></shopinfo> <shopinfo v-if="d.id == 'shop-info' " :ad="d.data" :key="di" ref="son"></shopinfo>
<guide v-if="d.id == 'drive-guide'" :info="d.data" ref='city'></guide> <guide v-if="d.id == 'drive-guide'" :info="d.data" ref='city'></guide>
<!-- 网课列表 --> <!-- 网课列表 -->
<rgoods v-if="d.id == 'goods'"></rgoods> <rgoods v-if="d.id == 'educationCustom'" :goods="d.data"></rgoods>
<!-- 资讯 -->
<argoods v-if="d.id == 'educationArticle'" :goods="d.data"></argoods>
<!-- 最近学习组件 --> <!-- 最近学习组件 -->
<rstudy v-if='di==item.template.data.length-1'></rstudy> <rstudy v-if="d.id == 'education'" :goods="d.data"></rstudy>
</template> </template>
</view> </view>
</template> </template>
...@@ -119,6 +120,8 @@ import auth from "@/components/auth/index.vue"; ...@@ -119,6 +120,8 @@ import auth from "@/components/auth/index.vue";
import guide from "@/components/guidecar/index.vue"; import guide from "@/components/guidecar/index.vue";
import rstudy from "@/components/study/Rstudy.vue"; import rstudy from "@/components/study/Rstudy.vue";
import rgoods from "@/components/study/index.vue"; import rgoods from "@/components/study/index.vue";
import argoods from "@/components/studyArticle/index.vue";
export default { export default {
data() { data() {
...@@ -176,10 +179,10 @@ export default { ...@@ -176,10 +179,10 @@ export default {
auth, auth,
guide, guide,
rstudy, rstudy,
rgoods rgoods,
argoods
}, },
onLoad(options) { onLoad(options) {
console.log(options, "option");
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment