Commit b402c7de authored by 罗超's avatar 罗超

修复部分样式

parent 2d95d6d1
<template>
<view class="goods-box">
<view>
<!-- 只是商品 -->
<template>
<!--一行一个-->
<style1 v-if="goods.listStyle == 1" :goods-info="goods" :good-list="currentList"></style1>
<!--一行两个-->
<style2 v-if="goods.listStyle == 2" :goods-info="goods" :good-list="currentList"></style2>
<!--一行三个-->
<style3 v-if="goods.listStyle == 3" :goods-info="goods" :good-list="currentList"></style3>
<!--左右滚动-->
<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>
</template>
</view>
</view>
</template>
<script>
import style1 from './style1';
import style2 from './style2';
import style3 from './style3';
import style4 from './style4';
import style5 from './style5';
import style6 from './style6';
import sidebar from '../sidebar/index';
export default {
props: ['goods'],
components: {
style1,
style2,
style3,
style4,
style5,
style6,
sidebar
},
data() {
return {
mainColor: '',
activeKey: 0,
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: {
tabChangeHandler(i) {
this.currentList = this.goods.catList[i].goodsList;
this.activeKey = i;
}
}
};
</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,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<div
v-for="(item, gli) in goodList"
:key="gli"
class="good-one"
@click="openGood(item)"
: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||goodsInfo.customizeGoodsTag">
<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);
height: 100vw;
border-radius: 10rpx 10rpx 0 0;
"
v-if="goodsInfo.goodsCoverProportion == '1-1'"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl"
/>
<div class="good-info">
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div>
<div class="good-price-info">
<span class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</span>
<span 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="btnStyle"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>{{ goodsInfo.buyBtnText }}</u-button>
</span>
</div>
</div>
</div>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
</div>
</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: {},
btnStyle: {},
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.btnStyle = {
backgroundColor: this.goodsInfo.buttonColor ?? this.mainColor,
color:
this.goodsInfo.buyBtnStyle == 2 || this.goodsInfo.buyBtnStyle == 4
? this.goodsInfo.buttonColor
: "#FFF",
};
},
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-one {
margin: 12px;
position: relative;
border: 1rpx solid transparent;
border-radius: 10rpx;
padding-bottom: 10rpx;
overflow: hidden;
}
.good-one .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-one .guding {
position: relative;
}
.good-one .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.good-one .good-info {
padding: 12rpx;
padding-bottom: 0;
margin-top: -5px;
}
.good-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-one .good-info .good-price-info {
display: flex;
}
.good-one .good-info .good-price-info .price {
color: #ff4544;
font-size: 14px;
flex: 1;
}
.good-one .good-info .good-price-info .buy {
width: 24px;
text-align: right;
flex: 1;
}
</style>
<template>
<view
style="padding: 12px; padding-bottom: 0;"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<u-row gutter="24">
<u-col span="6" v-for="(item, gli) in goodList" :key="gli">
<view
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||goodsInfo.customizeGoodsTag">
<image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" />
</view>
<view class="img-box">
<view class="img-show">
<image
style="
width: 100%;
height: 100%;
border-radius: 10rpx 10rpx 0 0;
"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl"
/>
</view>
</view>
<view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
<view class="good-price-info">
<view class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</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>
</u-col>
</u-row>
<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-two {
position: relative;
margin-bottom: 12px;
border: 1rpx solid transparent;
border-radius: 10rpx;
overflow: hidden;
padding-bottom: 10rpx;
}
.good-two .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-two .img-box {
width: 100%;
height: 0;
padding-top: 100%;
position: relative;
}
.good-two .img-box .img-show {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.good-two .guding {
position: relative;
}
.good-two .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.good-two .good-info {
padding: 6rpx;
margin-top: -5px;
padding-bottom: 0;
}
.good-two .good-info .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin: 3px 0;
font-size: 13px;
height: 37px;
}
.good-two .good-info .good-price-info {
display: flex;
}
.good-two .good-info .good-price-info .price {
color: #ff4544;
flex: 1;
font-size: 14px;
}
.good-two .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<div
style="padding: 12px; padding-bottom: 0;"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<u-row gutter="24">
<u-col span="4" v-for="(item, gli) in goodList" :key="gli">
<div
class="good-three"
@click="openGood(item)"
: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||goodsInfo.customizeGoodsTag">
<image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" />
</div>
<div class="img-box">
<div class="img-show">
<image
style="
width: 100%;
height: 100%;
border-radius: 10rpx 10rpx 0 0;
"
:mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src="item.picUrl"
/>
</div>
</div>
<div class="good-info">
<div class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</div>
<div class="good-price-info">
<view class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</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>
</div>
</div>
</div>
</u-col>
</u-row>
<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>
</div>
</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-three {
position: relative;
margin-bottom: 12px;
border: 1rpx solid transparent;
border-radius: 10rpx;
overflow: hidden;
padding-bottom: 5px;
}
.good-three .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-three .img-box {
width: 100%;
height: 0;
padding-top: 100%;
position: relative;
}
.good-three .img-box .img-show {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.good-three .guding {
position: relative;
}
.good-three .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.good-three .good-info {
padding: 6rpx;
margin-top: -5px;
padding-bottom: 0;
}
.good-three .good-info .good-name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin: 3px 0;
font-size: 13px;
word-break: break-all;
height: 37px;
}
.good-three .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: center;
}
.good-three .good-info .good-price-info .price {
color: #ff4544;
flex: 1;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.good-three .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<view
style="padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
class="good-four"
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||goodsInfo.customizeGoodsTag"><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 class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</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" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></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;
}
//格式化价格添加.00
// getPrice(value){
// var html,_val;
// value =Number(value).toFixed(2);
// if(value==0){
// value=0;
// return html = "¥0";
// }else if(value.split('.')[1].substring(1)==0){
// value = Number(value).toFixed(2);
// }
// _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1];
// }
}
};
</script>
<style>
.good-four {
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-four .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-four .img-box {
width: 100px;
height: 100px;
}
.good-four .good-info {
padding: 12px;
flex: 1;
width: 1rpx;
border: 10rpx;
padding-bottom: 0;
display: flex;
flex-direction: column;
/* width:20%; */
}
.good-four .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-four .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: flex-end;
height: 22px;
flex: 1;
padding-bottom: 10rpx;
}
.good-four .good-info .good-price-info .price {
color: #ff4544;
flex: 1;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.good-four .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<view
class="her-scoller"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
class="good-five"
@click="openGood(item)"
v-for="(item, gli) in goodList"
:key="gli"
: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||goodsInfo.customizeGoodsTag"><image :src="goodsInfo.goodsTagPicUrl" mode="widthFix" style="width:100%" /></view>
<view class="img-box">
<view class="img-show">
<image style="width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;" :mode="goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'" :src="item.picUrl" />
</view>
</view>
<view class="good-info">
<view class="good-name" v-if="goodsInfo.showGoodsName">{{ item.name }}</view>
<view class="good-price-info">
<view class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</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" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></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>
.her-scoller {
overflow-x: auto !important;
padding: 12px;
display: flex;
white-space: nowrap;
}
/* .her-scoller::after {
clear: both;
content: " ";
display: block;
} */
.her-scoller .good-five {
position: relative;
margin-right: 12px;
width: 30%;
border: 1rpx solid transparent;
border-radius: 10rpx;
padding-bottom: 10rpx;
/* float: left; */
}
.her-scoller .good-five .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.her-scoller .good-five .img-box {
width: 100%;
height: 0;
padding-top: 100%;
position: relative;
}
.her-scoller .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 .good-five .guding {
position: relative;
}
.her-scoller .good-five .guding .img-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
}
.her-scoller .good-five .good-info {
padding: 6rpx;
padding-bottom: 0;
}
.her-scoller .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 .good-five .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: center;
}
.her-scoller .good-five .good-info .good-price-info .price {
color: #ff4544;
flex: 1;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.her-scoller .good-five .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<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-four"
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||goodsInfo.customizeGoodsTag"><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 class="price" :style="{ color: mainColor }">
<text style="font-size:13px;margin-right:5px"></text>
<text>{{ item.pintuanPrice }}</text>
</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-four {
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-four .tips {
width: 64rpx;
height: 64rpx;
position: absolute;
top: 0;
left: 0;
z-index: 4;
}
.good-four .img-box {
width: 100px;
height: 100px;
}
.good-four .good-info {
padding: 12px;
flex: 1;
width: 1rpx;
border: 10rpx;
padding-bottom: 0;
display: flex;
flex-direction: column;
/* width:20%; */
}
.good-four .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-four .good-info .good-price-info {
display: flex;
justify-items: center;
align-items: flex-end;
height: 22px;
flex: 1;
padding-bottom: 10rpx;
}
.good-four .good-info .good-price-info .price {
color: #ff4544;
flex: 1;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.good-four .good-info .good-price-info .buy {
width: 24px;
text-align: right;
}
</style>
<template>
<div class="quicknav">
<div class="box" v-if="showNavs">
<div class="nav-item" v-if="navs.home.opened" @click="goHome">
<view class="quicknav">
<view class="box" v-if="showNavs">
<view class="nav-item" v-if="navs.home.opened" @click="goHome">
<img :src="navs.home.picUrl" />
</div>
</view>
<button
class="nav-item"
v-if="navs.customerService.opened"
......@@ -13,12 +13,12 @@
>
<img :src="navs.customerService.picUrl" />
</button>
<div class="nav-item" v-if="navs.tel.opened" @click="goPhone(navs.tel.number)">
<view class="nav-item" v-if="navs.tel.opened" @click="goPhone(navs.tel.number)">
<img :src="navs.tel.picUrl" />
</div>
<div class="nav-item" v-if="navs.web.opened" @click="goUrl(navs.web.url)">
</view>
<view class="nav-item" v-if="navs.web.opened" @click="goUrl(navs.web.url)">
<img :src="navs.web.picUrl" />
</div>
</view>
<navigator
v-if="navs.mApp.opened"
target="miniProgram"
......@@ -30,25 +30,25 @@
>
<img :src="navs.mApp.picUrl" />
</navigator>
<div
<view
class="nav-item"
v-if="navs.mapNav.opened"
@click="goLocation(navs.mapNav.location)"
>
<img :src="navs.mapNav.picUrl" />
</div>
<div
</view>
<view
class="nav-item"
v-if="navs.customize.opened"
@click="goLink(navs.customize.link_url)"
>
<img :src="navs.customize.picUrl" />
</div>
</div>
<div class="nav-item" v-if="showArrow" @click="changeShow">
</view>
</view>
<view class="nav-item" v-if="showArrow" @click="changeShow">
<img :src="arrowImg" />
</div>
</div>
</view>
</view>
</template>
<script>
......@@ -69,7 +69,7 @@ export default {
this.currentParent = `/${this.$parent.$mp.page.route}`;
},
methods: {
changeShow(e) {
changeShow() {
this.showNavs = !this.showNavs;
this.arrowImg = this.showNavs
? this.navs.openedPicUrl
......@@ -78,9 +78,7 @@ export default {
goHome() {
let t = getCurrentPages();
let crtPath = "/" + t[t.length - 1].route;
if (crtPath != "/pages/index/index") {
uni.redirectTo({ url: "/pages/index/index" });
}
},
goLink(url) {
if (url && url.length > 0) {
......
......@@ -16,7 +16,6 @@
:input-align="styleStr.textPosition"
:value="val"
:bg-color="styleStr.color"
:disabled="true"
:text-color="styleStr.textColor"
:radius="styleStr.radius"
:show-action="false"
......
......@@ -144,8 +144,11 @@ export default {
crtPath: "",
};
},
created() {},
created() {
console.log('A join...')
},
mounted() {
console.log('B join...')
this.flagTypeInfo = this.$uiConfig.is_bang;
let tempSystem = uni.getSystemInfoSync();
this.platforms = tempSystem.platform;
......@@ -166,9 +169,19 @@ export default {
this.activeHandler();
},3000)
}
this.activeHandler();
},
// activated(){
// if(uni.getStorageSync("navs")){
// this.navs = uni.getStorageSync("navs")??[];
// }else{
// setTimeout(()=>{
// this.navs = uni.getStorageSync("navs")??[];
// this.activeHandler();
// },3000)
// }
// this.activeHandler();
// },
methods: {
activeHandler() {
let t = getCurrentPages();
......@@ -181,6 +194,7 @@ export default {
queryString="?"+queryString.substring(1,queryString.length)
}
this.crtPath = "/" + t[t.length - 1].route+queryString;
console.log(this.crtPath)
this.navs.forEach((x, i) => {
if (x.url == this.crtPath) {
this.active = i;
......
......@@ -2,10 +2,22 @@
<view class="goods">
<view class="u-skeleton" v-if="isExsitGoods">
<view class="u-skeleton-rect">
<u-swiper :list="g.pic_url" height="100" unit="vw" :interval="10000" name="pic_url" :border-radius="0" @click="previewImage"></u-swiper>
<u-swiper
:list="g.pic_url"
height="100"
unit="vw"
:interval="10000"
name="pic_url"
:border-radius="0"
@click="previewImage"
></u-swiper>
<!-- TODO 分销价格未做 is_share_price -->
<view class="is_share" v-if="g.share > 0" style="top:240px;">
<image src="@/static/images/icon/WechatIMG424.png" style="width: 20px; margin-left: 12px; opacity: 1;height: auto;" mode="widthFix" />
<image
src="@/static/images/icon/WechatIMG424.png"
style="width: 20px; margin-left: 12px; opacity: 1;height: auto;"
mode="widthFix"
/>
<view
style="
display: flex;
......@@ -21,7 +33,11 @@
</view>
</view>
<view class="is_share" v-if="g.myBuyCommission > 0">
<image src="@/static/images/icon/WechatIMG424.png" style="width: 20px; margin-left: 12px; opacity: 1;height: auto;" mode="widthFix" />
<image
src="@/static/images/icon/WechatIMG424.png"
style="width: 20px; margin-left: 12px; opacity: 1;height: auto;"
mode="widthFix"
/>
<view
style="
display: flex;
......@@ -39,11 +55,12 @@
</view>
<view class="g-info">
<view class="g-name u-skeleton-rect">
<view v-if="g.marketingLogo.iswords&&g.marketingLogo.iswords==1 && g.marketingLogo.words!=''" class="Logo" :style=
"{color: g.marketingLogo.wordsColor,
background:g.marketingLogo.wordsBack ,}">
{{g.marketingLogo.words}}
</view>
<view
v-if="g.marketingLogo.iswords&&g.marketingLogo.iswords==1 && g.marketingLogo.words!=''"
class="Logo"
:style="{color: g.marketingLogo.wordsColor,
background:g.marketingLogo.wordsBack ,}"
>{{g.marketingLogo.words}}</view>
<image
v-if="g.marketingLogo.iswords&&g.marketingLogo.iswords==2&& g.marketingLogo.ico!=''"
mode="heightFix"
......@@ -56,7 +73,9 @@
<view class="left">
<view class="price u-skeleton-rect" :style="{ color: mc }">
<text class="small"></text>
<text class="numfont">{{ g.price_min == g.price_max ? g.price_min : g.price_min + '-' + g.price_max }}</text>
<text
class="numfont"
>{{ g.price_min == g.price_max ? g.price_min : g.price_min + '-' + g.price_max }}</text>
</view>
<!-- TODO is_common_user_member_price 普通用户会员价 -->
<!-- TODO is_member_user_member_price 会员用户会员价 -->
......@@ -74,13 +93,24 @@
<view class="sku-box u-skeleton-rect" style="align-items: flex-start;">
<view class="label" style="margin-top: 5px;">活动</view>
<view class="content" style="display: flex;flex-direction: column">
<view style="display: flex;flex-direction: row;align-items: center;margin-bottom: 5px;" v-if="g.goods_marketing_award.integral.title != ''">
<view
style="display: flex;flex-direction: row;align-items: center;margin-bottom: 5px;"
v-if="g.goods_marketing_award.integral.title != ''"
>
<u-tag text="送积分" type="error" />
<text style="margin-left: 5px; font-size: 12px;">{{ g.goods_marketing_award.integral.title }}</text>
<text
style="margin-left: 5px; font-size: 12px;"
>{{ g.goods_marketing_award.integral.title }}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center" v-if="g.goods_marketing_award.PresentFXGradeMsg != ''" @click="goVIP">
<view
style="display: flex;flex-direction: row;align-items: center"
v-if="g.goods_marketing_award.PresentFXGradeMsg != ''"
@click="goVIP"
>
<u-tag text="送会员" type="error" />
<text style="margin-left: 5px; font-size: 12px;">{{ g.goods_marketing_award.PresentFXGradeMsg }}</text>
<text
style="margin-left: 5px; font-size: 12px;"
>{{ g.goods_marketing_award.PresentFXGradeMsg }}</text>
</view>
<view
......@@ -88,10 +118,9 @@
@click="goUrl(g.FreeShippingUrl)"
v-if="g.freeShippingName != null && g.freeShippingName != '' && (g.fullMoneyPinkage > 0 || g.fullNumPinkage > 0)"
>
<view style="color: #fa3534;background: #fef0f0;padding: 12rpx 22rpx; font-size: 22rpx;margin-right: 5px;border: 1px solid #fde2e2;border-radius: 6rpx;">
{{ g.freeShippingName != null ? g.freeShippingName : '' }}
</view>
<view
style="color: #fa3534;background: #fef0f0;padding: 12rpx 22rpx; font-size: 22rpx;margin-right: 5px;border: 1px solid #fde2e2;border-radius: 6rpx;"
>{{ g.freeShippingName != null ? g.freeShippingName : '' }}</view>
{{ g.fullMoneyPinkage > 0 && g.fullNumPinkage == 0 ? g.fullMoneyPinkage + '元包邮' : '' }}
{{ g.fullMoneyPinkage == 0 && g.fullNumPinkage > 0 ? g.fullNumPinkage + '件包邮' : '' }}
</view>
......@@ -102,7 +131,7 @@
g.freeShippingName!=null && g.freeShippingName !='' &&(g.fullMoneyPinkage == 0 && g.fullNumPinkage==0)
">
<text>暂无活动</text>
</view> -->
</view>-->
</view>
</view>
<view class="sku-box u-skeleton-rect" style="align-items: flex-start;" v-if="sku.length > 0">
......@@ -110,23 +139,39 @@
<view class="content">
<view class="sku-chosen" @click="chosenSku">
<view class="sku">{{ currentSku.attr_list.length > 0 ? '已' : '请' }}选择 {{ sku }}</view>
<view class="arrow"><u-icon name="arrow" :size="32" color="#111"></u-icon></view>
<view class="arrow">
<u-icon name="arrow" :size="32" color="#111"></u-icon>
</view>
</view>
<view class="suk-item" style="flex-wrap: wrap;">
<template v-if="skuimage.length > 0">
<view v-for="(x, i) in skuimage" class="item img" style="margin-bottom: 5px;" :key="i"><image :src="x" style="width: 100%; height: 100%;" /></view>
<view class="item" v-if="g.attr_groups[0].attr_list.length > 1">
{{ g.attr_groups[0].attr_list.length }}{{ g.attr_groups[0].attr_group_name }}可选
<view
v-for="(x, i) in skuimage"
class="item img"
style="margin-bottom: 5px;"
:key="i"
>
<image :src="x" style="width: 100%; height: 100%;" />
</view>
<view
class="item"
v-if="g.attr_groups[0].attr_list.length > 1"
>{{ g.attr_groups[0].attr_list.length }}{{ g.attr_groups[0].attr_group_name }}可选</view>
</template>
<template v-else>
<template v-for="(x, i) in g.attr_groups[0].attr_list">
<view class="item" v-if="i < 5" :key="i" style="margin-bottom: 5px;">{{ x.attr_name }}</view>
<view
class="item"
v-if="i < 5"
:key="i"
style="margin-bottom: 5px;"
>{{ x.attr_name }}</view>
</template>
<view class="item" v-if="g.attr_groups[0].attr_list.length > 1">
共{{ g.attr_groups[0].attr_list.length }}种{{ g.attr_groups[0].attr_group_name }}可选
</view>
<view
class="item"
v-if="g.attr_groups[0].attr_list.length > 1"
>共{{ g.attr_groups[0].attr_list.length }}种{{ g.attr_groups[0].attr_group_name }}可选</view>
</template>
</view>
</view>
......@@ -137,16 +182,26 @@
<view class="content">{{ g.express == '' ? '免运费' : '¥' + g.express }}</view>
</view>
<view class="sku-box u-skeleton-rect" style="margin-top: -10;" v-if="g.goods_marketing.shipping != ''">
<view
class="sku-box u-skeleton-rect"
style="margin-top: -10;"
v-if="g.goods_marketing.shipping != ''"
>
<view class="label">包邮</view>
<view class="content">{{ g.goods_marketing.shipping }}</view>
</view>
<view class="sku-box u-skeleton-rect" style="margin-top: -10;" v-if="g.goods_marketing.limit != ''">
<view
class="sku-box u-skeleton-rect"
style="margin-top: -10;"
v-if="g.goods_marketing.limit != ''"
>
<view class="label">限购</view>
<view class="content">{{ g.goods_marketing.limit }}</view>
</view>
<view class="sku-box u-skeleton-rect" v-if="comments.length == 0 && setting.is_comment == 1"><view class="label">暂无评论信息</view></view>
<view class="sku-box u-skeleton-rect" v-if="comments.length == 0 && setting.is_comment == 1">
<view class="label">暂无评论信息</view>
</view>
<view class="comment" v-if="comments.length > 0">
<view class="chead">
<u-section
......@@ -176,10 +231,22 @@
<h-parse :content="detailContent" @navigate="clickDescription"></h-parse>
</view>
<u-divider :margin-top="20" :margin-bottom="20" bg-color="transparent">或许你喜欢</u-divider>
<view style="width: calc(100vw - 20px); margin-left: 10px; overflow: hidden;"><goodlist :list="recommend"></goodlist></view>
<view style="width: calc(100vw - 20px); margin-left: 10px; overflow: hidden;">
<goodlist :list="recommend"></goodlist>
</view>
<u-skeleton v-if="loading" :loading="true" :animation="true" bgcolor="#FFF"></u-skeleton>
<goodsaction v-if="!loading" :good-name="g.name" :cover-pic="g.cover_pic" :favorite="g.favorite" :good-id="id" :total-stock ='g.totalStock' :status='g.status' @joincar="joinCar" @buy="buy"></goodsaction>
<goodsaction
v-if="!loading"
:good-name="g.name"
:cover-pic="g.cover_pic"
:favorite="g.favorite"
:good-id="id"
:total-stock="g.totalStock"
:status="g.status"
@joincar="joinCar"
@buy="buy"
></goodsaction>
<goodsku
v-if="!loading && showSku"
border-radius="10"
......@@ -193,23 +260,35 @@
></goodsku>
</view>
<u-empty text="没有找到商品,或商品已下架" mode="favor" v-if="!isExsitGoods"></u-empty>
<share :good-id="id" v-if="showShare" :good-name="g.name" :images="g.pic_url" :advertising="g.advertising" @close="closeShare"></share>
<share
:good-id="id"
v-if="showShare"
:good-name="g.name"
:images="g.pic_url"
:advertising="g.advertising"
@close="closeShare"
></share>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<coupon v-if="showCoupons" :coupon-message="couponMessage" @goLook="goLook" @closeBtn="closeBtn"></coupon>
<coupon
v-if="showCoupons"
:coupon-message="couponMessage"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</view>
</template>
<script>
// #ifdef APP-NVUE
const dom = weex.requireModule('dom');
const dom = weex.requireModule("dom");
// #endif
import goodlist from '@/components/goods/list';
import goodsaction from './components/goodsaction';
import goodsku from '@/components/goods/goodsku';
import auth from '@/components/auth/index';
import coupon from '@/components/coupons/coupons';
import share from './components/share/share';
import hParse from '@/components/u-parse/parse.vue';
import goodlist from "@/components/goods/list";
import goodsaction from "./components/goodsaction";
import goodsku from "@/components/goods/goodsku";
import auth from "@/components/auth/index";
import coupon from "@/components/coupons/coupons";
import share from "./components/share/share";
import hParse from "@/components/u-parse/parse.vue";
export default {
data() {
return {
......@@ -217,20 +296,20 @@ export default {
loading: true,
g: {},
imgs: [],
mc: '',
sku: '',
mc: "",
sku: "",
skuimage: [],
comments: [],
secondary: '',
detailContent: '',
secondary: "",
detailContent: "",
recommend: [],
showSku: false,
ot: 0,
currentSku: {},
isExsitGoods: true,
pageTitle: '商品详情',
pageTitle: "商品详情",
setting: {},
prevPage: '',
prevPage: "",
//自定义接手传递
opTionObj: {},
showShare: false,
......@@ -238,14 +317,14 @@ export default {
pageIndex: 1,
pageSize: 20,
GoodsId: 0,
CommentGrade: 0
CommentGrade: 0,
},
showAuth: false,
showCoupons: false,
couponMessage: '',
couponMessage: "",
isAllowShare: 1,
u: {},
vipState: {}
vipState: {},
};
},
components: {
......@@ -255,11 +334,11 @@ export default {
auth,
coupon,
share,
hParse
hParse,
},
onLoad(option) {
this.opTionObj = option;
console.log(option, 'option');
console.log(option, "option");
if (option && option.id) {
this.id = option.id ? option.id : 29; //40887 59512 46942
......@@ -270,21 +349,21 @@ export default {
let custom_params = JSON.parse(decodeURIComponent(option.custom_params));
console.log(custom_params);
if (custom_params.user_id) {
uni.setStorageSync('pid', { pid: custom_params.user_id });
uni.setStorageSync("pid", { pid: custom_params.user_id });
}
}
if (option && option.user_id) {
uni.setStorageSync('pid', { pid: option.user_id });
uni.setStorageSync("pid", { pid: option.user_id });
}
if (uni.getStorageSync('AnchorName')) {
if (uni.getStorageSync("AnchorName")) {
//如果有主播名称了先清除
uni.removeStorageSync('AnchorName');
uni.removeStorageSync("AnchorName");
}
if (option && option.AnchorName) {
//当传过来有主播名称的时候 存入缓存
uni.setStorageSync('AnchorName', { AnchorName: option.AnchorName });
uni.setStorageSync("AnchorName", { AnchorName: option.AnchorName });
}
this.u = uni.getStorageSync('mall_UserInfo');
this.u = uni.getStorageSync("mall_UserInfo");
// if (!this.u) {
// this.u = {
// nickName: "未登录",
......@@ -302,38 +381,52 @@ export default {
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.setting = uni.getStorageSync('basedata').mall.setting;
this.setting = uni.getStorageSync("basedata").mall.setting;
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
menus: ["shareAppMessage", "shareTimeline"],
});
},
onShareTimeline() {
setTimeout(() => {
console.log('分享调用');
console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync('mall_UserInfo') ? uni.getStorageSync('mall_UserInfo').UserId : 0;
let title = this.g.app_share_title != null && this.g.app_share_title != '' ? this.g.app_share_title : this.g.name;
let imageUrl = this.g.app_share_pic != null && this.g.app_share_pic != '' ? this.g.app_share_pic : this.g.pic_url[0].pic_url;
let uid = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo").UserId
: 0;
let title =
this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title
: this.g.name;
let imageUrl =
this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic
: this.g.pic_url[0].pic_url;
let id = this.id;
return {
title: title,
query: 'id=' + this.id + '&user_id=' + uid,
imageUrl: imageUrl
query: "id=" + this.id + "&user_id=" + uid,
imageUrl: imageUrl,
};
},
onShareAppMessage(res) {
setTimeout(() => {
console.log('分享调用');
console.log("分享调用");
this.getReceive();
}, 2500);
let u = uni.getStorageSync('mall_UserInfo');
let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
return {
title: this.g.app_share_title != null && this.g.app_share_title != '' ? this.g.app_share_title : this.g.name,
path: '/pages/goods/goods?id=' + this.id + '&user_id=' + uid,
imageUrl: this.g.app_share_pic != null && this.g.app_share_pic != '' ? this.g.app_share_pic : this.g.pic_url[0].pic_url
title:
this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title
: this.g.name,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid,
imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic
: this.g.pic_url[0].pic_url,
};
},
mounted() {
......@@ -348,9 +441,10 @@ export default {
initImages() {
// let that = this;
let info = uni.createSelectorQuery().in(this);
info.select('.goods')
.boundingClientRect(data => {
console.log('得到布局位置信息' + JSON.stringify(data));
info
.select(".goods")
.boundingClientRect((data) => {
console.log("得到布局位置信息" + JSON.stringify(data));
})
.exec();
// info
......@@ -367,7 +461,7 @@ export default {
// });
},
reloadUserinfo() {
this.u = uni.getStorageSync('mall_UserInfo');
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth = false;
this.init();
this.initPage();
......@@ -378,30 +472,32 @@ export default {
},
initPage() {
let currentPages = getCurrentPages();
let u = '/' + currentPages[currentPages.length - 1].route;
let pages = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').bar_title : [];
pages.forEach(x => {
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = uni.getStorageSync("basedata")
? uni.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle
title: this.pageTitle,
});
},
clickCommentHandler() {
uni.navigateTo({
url: '/pages/goods/comment-list?id=' + this.id
url: "/pages/goods/comment-list?id=" + this.id,
});
},
getVipId() {
//获取会员ID
this.request2(
{
url: '/api/AppletGoods/GetAppletVipGradeInfo',
data: {}
url: "/api/AppletGoods/GetAppletVipGradeInfo",
data: {},
},
res => {
(res) => {
if (res.data) {
this.vipState = res.data.VIPModel;
}
......@@ -413,44 +509,44 @@ export default {
//跳转到购买的页面查看
let GradeId = this.vipState.Id;
uni.navigateTo({
url: '/pages/share/buyInterest/index?showLook=1&GradeId=' + GradeId
url: "/pages/share/buyInterest/index?showLook=1&GradeId=" + GradeId,
});
},
init() {
this.loading = true;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsInfo',
url: "/api/AppletGoods/GetAppletGoodsInfo",
data: {
GoodsId: this.id
}
GoodsId: this.id,
},
},
res => {
(res) => {
if (res.resultCode == 1) {
this.g = res.data.goods;
this.g.totalStock=0;
this.g.attr.forEach(x=>{
this.g.totalStock+=x.stock
})
this.g.marketingLogo = JSON.parse(this.g.marketingLogo)
this.g.totalStock = 0;
this.g.attr.forEach((x) => {
this.g.totalStock += x.stock;
});
this.g.marketingLogo = JSON.parse(this.g.marketingLogo);
this.isAllowShare = res.data.goods.isAllowShare; //1为可以分享 2为不能分享
if (this.isAllowShare == 2) {
//隐藏分享的按钮
wx.hideShareMenu({
menus: ['shareAppMessage', 'shareTimeline']
menus: ["shareAppMessage", "shareTimeline"],
});
}
this.g.pic_url.forEach(x => {
this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url);
});
if (this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach((x, i) => {
if (i > 0) {
this.sku += ',';
this.sku += ",";
}
this.sku += x.attr_group_name;
});
this.g.attr_groups[0].attr_list.forEach(x => {
this.g.attr_groups[0].attr_list.forEach((x) => {
if (x.pic_url) {
this.skuimage.push(x.pic_url);
}
......@@ -482,30 +578,36 @@ export default {
urls: this.imgs,
current: i,
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,' + (data.index + 1) + '张图片');
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function (data) {
console.log(
"选中了第" +
(data.tapIndex + 1) +
"个按钮,第" +
(data.index + 1) +
"张图片"
);
},
fail: function(err) {
fail: function (err) {
console.log(err.errMsg);
}
}
},
},
});
},
initComments() {
this.msg.GoodsId = this.id;
this.request2(
{
url: '/api/AppletOrder/GetAppletGoodsCommentPageList',
data: this.msg
url: "/api/AppletOrder/GetAppletGoodsCommentPageList",
data: this.msg,
},
res => {
(res) => {
this.comments = res.data.pageData;
// this.initRecommend();
},
err => {
this.u = uni.getStorageSync('mall_UserInfo');
(err) => {
this.u = uni.getStorageSync("mall_UserInfo");
this.init();
this.initPage();
}
......@@ -514,12 +616,12 @@ export default {
initRecommend() {
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsRecommendListForZY',
url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: {
RecommendType: 1
}
RecommendType: 1,
},
},
res => {
(res) => {
this.recommend = res.data.List;
}
);
......@@ -527,16 +629,16 @@ export default {
setFootMarkInfo(id) {
this.request2(
{
url: '/api/AppletUser/SetUserFootMarkInfo',
url: "/api/AppletUser/SetUserFootMarkInfo",
data: {
GoodsId: id
}
GoodsId: id,
},
res => {}
},
(res) => {}
);
},
joinCar() {
console.log('触发1');
console.log("触发1");
this.showSku = true;
this.ot = 0;
},
......@@ -553,19 +655,19 @@ export default {
}
},
closeSkuChosen(obj) {
this.sku = '';
this.sku = "";
if (obj) {
this.currentSku = obj;
obj.attr_list.forEach((x, i) => {
if (i > 0) {
this.sku += ',';
this.sku += ",";
}
this.sku += `"${x.attr_name}" `;
});
} else {
this.g.attr_groups.forEach((x, i) => {
if (i > 0) {
this.sku += ',';
this.sku += ",";
}
this.sku += x.attr_group_name;
});
......@@ -582,13 +684,13 @@ export default {
// 1-分享,2-购买并付款
this.request2(
{
url: '/api/AppletUser/ShareCoupon',
url: "/api/AppletUser/ShareCoupon",
data: {
TriggerType: 1
}
TriggerType: 1,
},
},
res => {
console.log(res, 'res');
(res) => {
console.log(res, "res");
if (res.couponResultCode == 1) {
this.couponMessage = res.couponMessage;
this.showCoupons = true;
......@@ -599,7 +701,7 @@ export default {
goLook() {
this.showCoupons = true;
uni.navigateTo({
url: '/pages/coupon/index/index'
url: "/pages/coupon/index/index",
});
},
closeBtn() {
......@@ -607,17 +709,17 @@ export default {
},
goUrl(url) {
uni.navigateTo({
url: url
url: url,
});
}
}
},
},
};
</script>
<style>
@font-face {
font-family: 'oswald';
src: url('https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf');
font-family: "oswald";
src: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/smallapp/Oswald-Regular.ttf");
}
.goods {
height: 100%;
......@@ -655,7 +757,7 @@ export default {
font-size: 16px;
}
.goods .numfont {
font-family: 'oswald';
font-family: "oswald";
font-weight: unset;
}
.goods .g-info .g-price-box .left .sell {
......@@ -790,8 +892,7 @@ export default {
top: 300px;
right: 0;
}
.goods .Logo{
.goods .Logo {
padding: 1px 5px;
display: inline-block;
font-size: 22rpx;
......
......@@ -48,6 +48,7 @@
<checkform v-if="d.id == 'form'" :forms="d.data" :key="di"></checkform>
<addialog v-if="d.id == 'modal' && d.data.opened" :ads="d.data" :key="di"></addialog>
<quicknav v-if="d.id == 'quick-nav' && d.data.navSwitch == 1" :navs="d.data" :key="di"></quicknav>
<pingtuan v-if="d.id == 'pintuan'" :goods="d.data" :key="di"></pingtuan>
</template>
</view>
</template>
......@@ -99,6 +100,7 @@ import checkform from "@/components/checkform/index";
import addialog from "@/components/addialog/index";
import quicknav from "@/components/quicknav/index";
import coupon from "@/components/coupons/coupons";
import pingtuan from "@/components/pingtuan/index";
export default {
data() {
return {
......@@ -140,6 +142,7 @@ export default {
addialog,
quicknav,
coupon,
pingtuan,
},
onLoad(options) {
console.log(options, "option");
......@@ -157,9 +160,28 @@ export default {
this.contentHeight = this.$utils.calcContentHeight(c);
if (options && options.page_id) {
this.pageId = options.page_id;
let queryString = "";
for (var k in options) {
queryString += `&${k}=${options[k]}`;
}
if (queryString != "") {
queryString =
"/pages/index/index?" + queryString.substring(1, queryString.length);
}
let p = 0;
if (uni.getStorageSync("navs")) {
uni.getStorageSync("navs").forEach(x=>{
if (x.url == queryString) {
p=1;
}
})
}
if (p == 0) {
this.showtabs = false;
this.contentHeight = this.$utils.calcContentHeight();
}
}
if (options && options.custom_params) {
let custom_params = JSON.parse(decodeURIComponent(options.custom_params));
console.log(custom_params);
......@@ -181,16 +203,16 @@ export default {
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
if(uni.getStorageSync('mall_UserInfo')){
let uid=uni.getStorageSync('mall_UserInfo').UserId
if (uni.getStorageSync("mall_UserInfo")) {
let uid = uni.getStorageSync("mall_UserInfo").UserId;
wx.getUserInfo({
success: function (res) {
let msg={
Id:uid,
AliasName:res.userInfo.nickName,
Photo:res.userInfo.avatarUrl
}
that.updateuserinfo(msg)
let msg = {
Id: uid,
AliasName: res.userInfo.nickName,
Photo: res.userInfo.avatarUrl,
};
that.updateuserinfo(msg);
},
});
}
......@@ -253,7 +275,7 @@ export default {
},
methods: {
updateuserinfo(msg){
updateuserinfo(msg) {
this.request2(
{
url: "/api/MemberUser/SetMemberPhoto",
......@@ -413,6 +435,64 @@ export default {
y.templateBg = { titleColor: "#000" };
}
});
this.myPageData.home_pages.navs[0].template.data.push({
id: "pintuan",
permission_key: "pintuan",
data: {
buttonColor: "#ff4544",
list: [
{
id: 179402,
name:
"日本POLA宝丽黑BA限定小礼盒(黑ba水20ml +黑ba乳液15ml +黑ba面霜5g +黑ba唇颊膏2g)",
picUrl:
"https://cdnimg.iotweixin.com/uploads/mall1285/20200506/904171cab7db2201f6f35c0ca5bb0a93.png",
price: "388.00",
peopleNum: 2,
pintuanPrice: "348.00",
},
{
id: 178355,
name:
"日本珂润(Curel)润浸保湿 滋养乳霜 40g 敏感肌专用 神经酰胺护理 抵抗外部刺激",
picUrl:
"https://cdnimg.iotweixin.com/uploads/mall1285/20200503/979653726a7bc1df0e24464f94b404bd.jpg",
price: "180.00",
peopleNum: 2,
pintuanPrice: "180.00",
},
{
id: 178352,
name: "500g 干羊肚菌 干货 煲汤菌 菌中之王 包邮",
picUrl:
"https://cdnimg.iotweixin.com/uploads/mall1285/20200311/358dd9acf5dafd3cab2c05be3354400c.png",
price: "780.00",
peopleNum: 3,
pintuanPrice: "680.00",
},
],
listStyle: 1,
textStyle: 1,
fill: 1,
goodsCoverProportion: "1-1",
goodsStyle: 1,
showGoodsName: true,
showBuyBtn: true,
buyBtnStyle: 1,
buyBtnText: "去拼团",
showGoodsTag: false,
customizeGoodsTag: false,
goodsTagPicUrl: "",
showImg: false,
backgroundColor: "#fff",
backgroundPicUrl: "",
position: 5,
mode: 1,
backgroundHeight: 100,
backgroundWidth: 100,
borderBackground: "#ffffff",
},
});
},
getReceive() {
//分享进入调取领券接口
......
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