店铺主页调整及主页店铺二维码跳转支持

This commit is contained in:
chenbo 2020-12-02 14:04:58 +08:00
parent e209aefe2c
commit 1f4ad93162
10 changed files with 92 additions and 30 deletions

View File

@ -1,14 +1,15 @@
<view class="container">
<view class="brand-list">
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="h">
<view class="l">{{item.name}}</view>
<view class="r">进店看看</view>
</view>
<view class="img-bg">
<image src="{{item.picUrl}}" background-size="cover"></image>
</view>
<view class="txt-box">
<view class="line">
<text class="name">{{item.name}}</text>
<text class="s">|</text>
<text class="price">{{item.floorPrice}}元起</text>
</view>
</view>
</navigator>

View File

@ -1,24 +1,25 @@
.brand-list .item {
display: block;
width: 750rpx;
height: 416rpx;
height: 500rpx;
position: relative;
margin-bottom: 4rpx;
background: #fff;
margin-top: 5rpx;
margin-bottom: 30rpx;
}
.brand-list .item .img-bg {
position: absolute;
left: 0;
top: 0;
z-index: 0;
width: 750rpx;
height: 417rpx;
height: 400rpx;
overflow: hidden;
}
.brand-list .item .img-bg image {
width: 750rpx;
height: 416rpx;
height: 400rpx;
}
.brand-list .item .txt-box {
@ -28,7 +29,7 @@
display: table;
z-index: 0;
width: 750rpx;
height: 417rpx;
height: 317rpx;
}
.brand-list .item .line {
@ -50,3 +51,31 @@
padding: 0 10rpx;
font-size: 40rpx;
}
.brand-list .h {
height: 100rpx;
line-height: 100rpx;
margin-left: 31.25rpx;
padding-right: 31.25rpx;
border-bottom: 1px solid #f4f4f4;
font-size: 30rpx;
color: #333;
}
.brand-list .h .l {
float: left;
}
.brand-list .h .r {
float: right;
margin-top: 19rpx;
height: 64.5rpx;
margin-right: 5rpx;
line-height: 64.5rpx;
text-align: center;
padding: 0 20rpx;
border-radius: 8rpx;
font-size: 28rpx;
color: #fff;
background: #85c43f;
}

View File

@ -13,6 +13,20 @@ Page({
size: 10,
totalPages: 1
},
onShareAppMessage: function () {
let that = this;
let userInfo = wx.getStorageSync('userInfo');
let shareUserId = 1;
if (userInfo) {
shareUserId = userInfo.userId;
}
console.log('/pages/index/index?scene=brand,' + that.data.brand.id+'&shareUserId=' + shareUserId);
return {
title: that.data.brand.name,
//desc: that.data.brand.desc,
path: '/pages/index/index?scene=brand,' + that.data.brand.id + '&shareUserId=' + shareUserId
}
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
var that = this;

View File

@ -4,8 +4,6 @@
<image class="img" src="{{brand.picUrl}}" background-size="cover"></image>
<view class="info-box">
<view class="info">
<text class="txt">{{brand.name}}</text>
<text class="line"></text>
</view>
</view>
</view>
@ -20,7 +18,7 @@
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
<text class="price jhx_f8">¥{{iitem.retailPrice}}</text>
</navigator>
</block>
</view>

View File

@ -53,11 +53,11 @@ page {
width: 100%;
height: auto;
overflow: hidden;
padding: 41.5rpx 31.25rpx;
padding: 21.5rpx 31.25rpx;
font-size: 30rpx;
color: #666;
line-height: 41.5rpx;
text-align: center;
text-align: left;
}
.cate-item .b {
@ -107,5 +107,4 @@ page {
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
}

View File

@ -82,7 +82,7 @@ page {
}
.sort-box .item.active .txt {
color: #b4282d;
color: #ec4223;
}
.sort-box .item.by-price {
@ -122,8 +122,8 @@ page {
}
.sort-box-category .item.active {
color: #b4282d;
border: 1px solid #b4282d;
color: #ec4223;
border: 1px solid #ec4223;
}
.cate-item .b {
@ -173,5 +173,5 @@ page {
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
color: #ec4223;
}

View File

@ -96,6 +96,14 @@ Page({
wx.navigateTo({
url: '../goods/goods?grouponId=' + id
});
} else if (_type == 'brand') {
wx.navigateTo({
url: '../brandDetail/brandDetail?id=' + id
});
} else if (_type == 'topic') {
wx.navigateTo({
url: '../topicDetail/topicDetail?id=' + id
});
} else {
if (id != null){
wx.setStorageSync('shareUserId', id);
@ -160,7 +168,6 @@ Page({
})
}
},
onHide: function() {
// 页面隐藏

View File

@ -82,7 +82,7 @@ page {
}
.sort-box .item.active .txt {
color: #b4282d;
color: #ec4223;
}
.sort-box .item.by-price {
@ -122,8 +122,8 @@ page {
}
.sort-box-category .item.active {
color: #b4282d;
border: 1px solid #b4282d;
color: #ec4223;
border: 1px solid #ec4223;
}
.cate-item .b {
@ -173,5 +173,5 @@ page {
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
color: #ec4223;
}

View File

@ -127,8 +127,8 @@ page {
}
.search-keywords .item.active {
color: #b4282d;
border: 1px solid #b4282d;
color: #ec4223;
border: 1px solid #ec4223;
}
.shelper-list {
@ -183,7 +183,7 @@ page {
}
.sort-box .item.active .txt {
color: #b4282d;
color: #ec4223;
}
.sort-box .item.by-price {
@ -223,8 +223,8 @@ page {
}
.sort-box-category .item.active {
color: #b4282d;
border: 1px solid #b4282d;
color: #ec4223;
border: 1px solid #ec4223;
}
.cate-item {
@ -309,7 +309,7 @@ page {
height: 30rpx;
text-align: center;
font-size: 30rpx;
color: #b4282d;
color: #ec4223;
}
.search-result-empty {

View File

@ -12,6 +12,20 @@ Page({
commentList: [],
topicGoods: []
},
onShareAppMessage: function () {
let that = this;
let userInfo = wx.getStorageSync('userInfo');
let shareUserId = 1;
if (userInfo) {
shareUserId = userInfo.userId;
}
console.log('/pages/index/index?scene=topic,' + that.data.topic.id + '&shareUserId=' + shareUserId);
return {
title: that.data.topic.subtitle,
//desc: that.data.brand.desc,
path: '/pages/index/index?scene=topic,' + that.data.topic.id + '&shareUserId=' + shareUserId
}
},
onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数
var that = this;