Commit e3938d3a by 施宇

111

parent 1998ad43
{
"pages": [
"pages/tab/home/home",
"pages/tab/price/price",
"pages/tab/home/home",
"pages/tab/message/message",
"pages/tab/good/good",
"pages/tab/me/me",
"pages/search/index/index"
"pages/search/index/index",
"pages/searchresult/index"
],
"window": {
"backgroundTextStyle": "light",
......
/**app.wxss**/
/**app.wxss**/
page {
font-size: 16px;
font-family: PingFangSC-Regular;
height: 100%;
}
image {
......
......@@ -9,6 +9,9 @@ Component({
properties: {
priceList:{
type:Array
},
priceType:{
type:Number
}
},
......
<!--components/priceItem/priceItem.wxml-->
<block>
<view class="price-item" wx:for="{{priceList}}" wx:key="*this">
<view class="item-header px-hr-bottom row verCenter bothSide">
<view class="row verCenter">
<text class="mark bao" wx:if="{{item.type==1}}">报</text>
<text class="mark xun" wx:else>询</text>
<text class="name ellipsis">{{item.name}}</text>
</view>
<text class="price">¥{{item.price}}</text>
<!-- 首页的数据展示 -->
<block wx:if="{{priceType==1}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="*this">
<view class="item-header px-hr-bottom row verCenter bothSide">
<view class="row verCenter">
<text class="mark bao" wx:if="{{item.type==1}}">报</text>
<text class="mark xun" wx:else>询</text>
<text class="name ellipsis">{{item.name}}</text>
</view>
<text class="price">¥{{item.price}}</text>
</view>
<view class="item-middle row verCenter">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand}}</text>
<text class="num"><text>数量:</text>{{item.num}}PCS</text>
</view>
<view class="item-footer row bothSide verCenter ">
<text class="address ellipsis">备注:{{item.desc}}</text>
<text class="time">{{item.time}}</text>
</view>
</view>
<view class="item-middle row verCenter">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand}}</text>
<text class="num"><text>数量:</text>{{item.num}}PCS</text>
</block>
<!-- 搜索页的商品展示 -->
<block wx:if="{{priceType==2}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="*this">
<view class="item-header px-hr-bottom row verCenter bothSide">
<view class="row verCenter">
<text class="mark bao" wx:if="{{item.type==1}}">贸易商</text>
<text class="mark bao" wx:elif="{{item.type==2}}">代理商</text>
<text class="mark bao" wx:else>原厂</text>
<text class="company ellipsis">{{item.company}}</text>
</view>
<text class="time">{{item.time}}</text>
</view>
<view class="item-middle row verCenter bothSide item-middle2">
<text class="name ellipsis">{{item.name}}</text>
<text class="price">¥{{item.price}}</text>
</view>
<view class="item-footer row verCenter ">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand}}</text>
<text class="num"><text>库存:</text>{{item.num}}PCS</text>
</view>
</view>
<view class="item-footer row bothSide verCenter ">
<text class="address ellipsis">备注:{{item.desc}}</text>
<text class="time">{{item.time}}</text>
</block>
<!-- 搜索页面询价展示 -->
<block wx:if="{{priceType==3}}">
<view class="price-item" wx:for="{{priceList}}" wx:key="*this">
<view class="item-header px-hr-bottom row verCenter bothSide">
<view class="row verCenter">
<text class="mark xun">询价</text>
<text class="company ellipsis">{{item.company}}</text>
</view>
<text class="time">{{item.time}}</text>
</view>
<view class="item-middle row verCenter bothSide item-middle2">
<text class="name ellipsis">{{item.name}}</text>
<block wx:if="{{item.count}}">
<text class="num-bj">{{item.count}}个报价</text>
</block>
<block wx:else>
<text class="no-bj">等待报价</text>
</block>
</view>
<view class="item-middle row verCenter">
<text class="brand ellipsis"><text>品牌:</text>{{item.brand}}</text>
<text class="num"><text>数量:</text>{{item.num}}PCS</text>
</view>
<view class="item-footer row">
<text class="address ellipsis">备注:{{item.desc}}</text>
</view>
</view>
</view>
</block>
</block>
\ No newline at end of file
......@@ -15,7 +15,7 @@
.item-header .mark {
border-radius: 2px;
font-size: 12px;
font-size: 24rpx;
color: #fff;
padding: 2rpx 10rpx;
margin-right: 24rpx;
......@@ -29,18 +29,38 @@
background: #61a0f2;
}
.item-header .name, .item-header .price {
.price-item .name, .price-item .price, .price-item .num-bj,
.price-item .no-bj {
font-weight: 600;
font-family: PingFangSC-Semibold;
}
.price-item .num-bj,
.price-item .no-bj{
font-size: 28rpx;
}
.price-item .num-bj{
color:#EAA217;
}
.price-item .no-bj{
color:#61A0F2;
}
.item-header .name {
.p
.price-item .name, .price-item .company {
color: #515559;
margin-right: 24rpx;
}
.item-header .price {
font-size: 14px;
.price-item .name {
font-size: 32rpx;
}
.price-item .company {
font-size: 26rpx;
}
.price-item .price {
font-size: 28rpx;
color: #ea1717;
}
......@@ -50,16 +70,20 @@
white-space: nowrap;
}
.item-middle .brand, .item-middle .num {
font-size: 13px;
.item-middle.item-middle2 {
padding-bottom: 24rpx;
}
.price-item .brand, .price-item .num {
font-size: 26rpx;
color: #515559;
}
.item-middle .num {
.price-item .num {
margin-left: 62rpx;
}
.item-middle .brand text, .item-middle .num text {
.price-item .brand text, .price-item .num text {
color: #8a9299;
}
......@@ -70,11 +94,12 @@
}
.item-footer .address {
color: #8A9299;
font-size: 13px;
color: #8a9299;
font-size: 26rpx;
}
.item-footer .time {
color: #ADB6BF;
font-size: 11px;
.price-item .time {
color: #adb6bf;
font-size: 22rpx;
white-space: nowrap;
}
<!--pages/search/index/index.wxml-->
<view class="search-view">
<view class="search-section">
<cover-image class="search-icon" src="/res/images/icons/search-icon.png"></cover-image>
<icon class="icon iconfont iconiconxiantiaoshouji8"></icon>
<input placeholder='请输入芯片型号' placeholder-class="placeholderClass" bindtap="toSearch"></input>
</view>
<text class="icon iconfont iconChevron" style="font-size:100px;color:red"></text>
<view class="rm_search">
<text class="title">热门搜索</text>
<view class="rm_ls_content row">
<view class="search-item">LM358</view>
<view class="search-item">TJA1027</view>
<view class="search-item">贴片电阻330k</view>
<view class="search-item">PFB0824GHE</view>
<view class="search-item">T6738-4K</view>
<view class="search-item">ECW-FA2J155J</view>
</view>
</view>
<view class="ls_search">
<view class="title_view row bothSide verCenter">
<text class="title">搜索历史</text>
<icon class="icon iconfont iconiconxiantiaoshouji7"></icon>
</view>
<view class="rm_ls_content row">
<view class="search-item">LM358</view>
<view class="search-item">TJA1027</view>
<view class="search-item">贴片电阻330k</view>
<view class="search-item">PFB0824GHE</view>
<view class="search-item">T6738-4K</view>
<view class="search-item">ECW-FA2J155J</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/search/index/index.wxss */
.search-section {
padding: 15rpx 24rpx;
position: relative;
}
.search-section .search-icon {
.search-section .icon {
position: absolute;
height: 32rpx;
width: 32rpx;
top: 28rpx;
left:49rpx;
font-size: 40rpx;
color: #adb6bf;
top: 17rpx;
left: 49rpx;
}
.search-section input {
background: #fff;
height: 58rpx;
border-radius: 50rpx;
padding: 0 18rpx 0 75rpx;
box-sizing: border-box;
background-color: #F0F4F7;
font-size: 12px;
background-color: #f0f4f7;
font-size: 24rpx;
}
.search-section .placeholderClass {
color: #ADB6BF;
}
\ No newline at end of file
color: #adb6bf;
}
.title {
font-weight: 600;
font-size: 28rpx;
color: #515559;
}
.title::before {
content: "";
background: #1177b9;
display: inline-block;
vertical-align: middle;
margin-right: 17rpx;
height: 30rpx;
width: 2px;
}
.rm_search, .ls_search {
padding: 0 24rpx;
}
.rm_search {
margin-top: 32rpx;
}
.ls_search {
margin-top: 48rpx;
}
.ls_search .icon {
font-size: 40rpx;
color: #8a9299;
}
.rm_ls_content {
padding: 24rpx 21rpx 0;
flex-wrap: wrap;
}
.rm_ls_content .search-item {
font-size: 26rpx;
color: #8a9299;
margin: 0 32rpx 24rpx 0;
}
// pages/searchresult/index.js
let arr = [
{
type: 2,
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company:"深圳市猎芯科技有限公司"
},
{
type: 1,
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "朗新科技股份有限公司"
},
{
type: 3,
name: "STM32F407ZGT6",
price: "100.012",
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
time: "05-10 10:15",
company: "深圳邦马特科技有限公司"
}
];
let arr1 = [{
company: "深圳邦马特科技有限公司",
time: "05-10 10:15",
name: "STM32F407ZGT6",
count:5,
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
}, {
company: "深圳邦马特科技有限公司",
time: "05-10 10:15",
name: "STM32F407ZGT6",
count: 5,
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
}, {
company: "深圳邦马特科技有限公司",
time: "05-10 10:15",
name: "STM32F407ZGT6",
count: 5,
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
}, {
company: "深圳邦马特科技有限公司",
time: "05-10 10:15",
name: "STM32F407ZGT6",
count: 5,
brand: "Texas InstrumentsTexas",
num: "100,000",
desc: "深圳地区原装现货深圳地区原装现货",
}]
Page({
/**
* 页面的初始数据
*/
data: {
priceList: undefined,
isGet: false,
tabIndex:1,
type:2
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let seft = this;
wx.showLoading({
title: '加载中',
})
setTimeout(() => {
wx.hideLoading()
seft.setData({ priceList: [] })
}, 2000)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.isGet) {
return
} else {
wx.showLoading({
title: '加载中',
})
this.setData({ isGet: true });
let arr = this.data.priceList.concat(this.data.priceList);
let seft = this;
setTimeout(() => {
wx.hideLoading();
seft.setData({ priceList: arr, isBottom: false, isGet: false })
}, 2000)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
switchTab:function(e){
let i = e.currentTarget.dataset.index;
if(i == this.data.tabIndex){
return
}else{
if(i == 1){
this.setData({
tabIndex: i,
priceList: arr,
type: 2
});
}else{
this.setData({
tabIndex: i,
priceList: arr1,
type: 3
});
}
}
}
})
\ No newline at end of file
{
"usingComponents": {
"priceItem": "/components/priceItem/priceItem"
}
}
\ No newline at end of file
<!--pages/searchresult/index.wxml-->
<view class="searchresult-view">
<view class="search-section">
<icon class="icon iconfont iconiconxiantiaoshouji8"></icon>
<input placeholder='请输入芯片型号' placeholder-class="placeholderClass" bindtap="toSearch"></input>
</view>
<view class="searchresult-tab row">
<view bindtap="switchTab" class="{{tabIndex == 1&&'active'}}" data-index="1">
<text>商品</text>
<text class="active-bg"></text>
</view>
<view bindtap="switchTab" class="{{tabIndex == 2&&'active'}}" data-index="2">
<text>询价</text>
<text class="active-bg"></text>
</view>
</view>
<view class="searchresult-content">
<view wx:if="{{priceList&&priceList.length==0}}" class="nodata">
<cover-image src="/res/images/imgs/nodata.png" class="img"></cover-image>
<view class="h3">未搜索到相关信息</view>
<view class="p">您还可以发布询价。</view>
<view class="nodata_fb fb_btn">
<text>快速发布询价</text>
</view>
</view>
<priceItem price-list="{{priceList}}" wx:if="{{priceList&&priceList.length!==0}}" price-type="{{type}}"></priceItem>
</view>
<view class="fast_fb fb_btn" wx:if="{{priceList&&priceList.length!==0}}">
<text>快速发布询价</text>
</view>
<view class="concat_custom" wx:if="{{priceList&&priceList.length==0}}">
<icon class="icon iconfont iconiconxiantiaoshouji11"></icon>
<text>快速发布询价</text>
</view>
</view>
\ No newline at end of file
/* pages/searchresult/index.wxss */
.searchresult-view {
min-height: 100%;
position: relative;
padding-bottom: 234rpx;
box-sizing: border-box;
}
.search-section {
padding: 15rpx 24rpx;
position: relative;
}
.search-section .icon {
position: absolute;
font-size: 40rpx;
color: #adb6bf;
top: 17rpx;
left: 49rpx;
}
.search-section input {
background: #fff;
height: 58rpx;
border-radius: 50rpx;
padding: 0 18rpx 0 75rpx;
box-sizing: border-box;
background-color: #f0f4f7;
font-size: 24rpx;
}
.search-section .placeholderClass {
color: #adb6bf;
}
.searchresult-tab {
height: 88rpx;
line-height: 88rpx;
text-align: center;
}
.searchresult-tab view {
font-size: 32rpx;
flex: 1;
font-weight: 600;
position: relative;
color: #515559;
}
.searchresult-tab view.active {
color: #0d84d1;
}
.searchresult-tab view.active .active-bg {
position: absolute;
display: inline-block;
width: 68rpx;
height: 25rpx;
background-color: rgba(13, 132, 209, 0.1);
bottom: 15rpx;
left: 50%;
margin-left: -34rpx;
border-radius: 30rpx;
}
.fb_btn {
height: 98rpx;
background-color: #0d84d1;
color: #fff;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
border-radius: 8rpx;
box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3);
}
.fast_fb {
position: absolute;
bottom: 68rpx;
left: 55rpx;
right: 55rpx;
}
.nodata {
text-align: center;
}
.nodata .img {
width: 600rpx;
height: 393rpx;
margin: 0 auto;
}
.nodata .h3 {
font-weight: 600;
font-size: 48rpx;
color: #2e3033;
}
.nodata .p {
font-size: 26rpx;
color: #8a9299;
margin-top: 14rpx;
}
.nodata_fb {
margin: 40rpx 55rpx;
}
.concat_custom {
position: absolute;
bottom: 68rpx;
left: 0;
right: 0;
text-align: center;
color:#61A0F2;
font-size: 28rpx;
}
.concat_custom .icon{
font-size: 40rpx;
margin-right:16rpx;
vertical-align: sub;
}
<!--pages/tab/home/home.wxml-->
<view class="home-view">
<view class="search-section">
<cover-image class="search-icon" src="/res/images/icons/search-icon.png"></cover-image>
<icon class="icon iconfont iconiconxiantiaoshouji8"></icon>
<input placeholder='请输入芯片型号' placeholder-class="placeholderClass" bindtap="toSearch"></input>
</view>
<view class="home-content">
......@@ -44,7 +44,7 @@
</view>
</view>
<view class="more-item">
<cover-image src="/res/images/icons/more-adv.png" class="img"></cover-image>
<icon class="icon iconfont iconiconxiantiaoshouji6"></icon>
</view>
</view>
</view>
......@@ -54,12 +54,12 @@
<view class="price-title">
<view class="price-title-content row bothSide verCenter px-hr-bottom ">
<text>我的询报价</text>
<cover-image src="/res/images/icons/home-refresh-icon.png" class="img"></cover-image>
<icon class="icon iconfont iconiconxiantiaoshouji5"></icon>
</view>
</view>
<view class="price-content">
<view wx:if="{{priceList&&priceList.length==0}}">暂无数据</view>
<priceItem price-list="{{priceList}}" wx:if="{{priceList&&priceList.length!==0}}"></priceItem>
<priceItem price-list="{{priceList}}" wx:if="{{priceList&&priceList.length!==0}}" price-type="1"></priceItem>
</view>
</view>
</view>
......
......@@ -13,11 +13,11 @@
right: 0;
}
.search-section .search-icon {
.search-section .icon {
position: absolute;
height: 40rpx;
width: 40rpx;
top: 53rpx;
font-size: 40rpx;
color:#686E73;
top: 46rpx;
left: 49rpx;
}
......@@ -32,7 +32,7 @@
.search-section .placeholderClass {
color: #515559;
font-size: 16px;
font-size: 32rpx;
}
.home-content {
......@@ -52,7 +52,7 @@
}
.function-item .text {
font-size: 13px;
font-size: 26rpx;
color: #8a9299;
margin-top: 11rpx;
}
......@@ -84,7 +84,7 @@
}
.adv-mark {
font-size: 12px;
font-size: 24rpx;
color: #61a0f2;
background: #f0f6fa;
border-radius: 2rpx;
......@@ -94,13 +94,13 @@
}
.adv-num {
font-size: 14px;
font-size: 28rpx;
color: #515559;
margin-left: 24rpx;
}
.adv-time {
font-size: 12px;
font-size: 24rpx;
color: #8a9299;
margin-left: 27rpx;
}
......@@ -108,10 +108,15 @@
.more-item {
flex: 0 1 40rpx;
}
.more-item .icon{
color:#ADB6BF;
font-size: 40rpx;
}
.price-title {
height: 88rpx;
font-size: 14px;
font-size: 28rpx;
font-weight: 600;
color: #515559;
padding-left: 25rpx;
......@@ -132,8 +137,8 @@
width: 2px;
}
.my-price .img {
height: 40rpx;
width: 40rpx;
.my-price .icon {
color:#ADB6BF;
font-size: 40rpx;
}
......@@ -5,7 +5,7 @@ Page({
* 页面的初始数据
*/
data: {
tabIndex:1
},
/**
......@@ -62,5 +62,29 @@ Page({
*/
onShareAppMessage: function () {
},
switchTab: function (e) {
let i = e.currentTarget.dataset.index;
if (i == this.data.tabIndex) {
return
} else {
if (i == 1) {
this.setData({
tabIndex: i,
// priceList: arr,
// type: 2
});
} else {
this.setData({
tabIndex: i,
// priceList: arr1,
// type: 3
});
}
}
}
})
\ No newline at end of file
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "询报价"
}
\ No newline at end of file
<!--pages/tab/price/price.wxml-->
<text>pages/tab/price/price.wxml</text>
<view class="price-view">
<view class="searchresult-tab row">
<view bindtap="switchTab" class="{{tabIndex == 1&&'active'}}" data-index="1">
<text>我的询价</text>
<text class="active-bg"></text>
</view>
<view bindtap="switchTab" class="{{tabIndex == 2&&'active'}}" data-index="2">
<text>我的报价</text>
<text class="active-bg"></text>
</view>
</view>
</view>
\ No newline at end of file
/* pages/tab/price/price.wxss */
\ No newline at end of file
/* pages/tab/price/price.wxss */
.searchresult-tab {
height: 88rpx;
line-height: 88rpx;
text-align: center;
}
.searchresult-tab view {
font-size: 32rpx;
flex: 1;
font-weight: 600;
position: relative;
color: #515559;
}
.searchresult-tab view.active {
color: #0d84d1;
}
.searchresult-tab view.active .active-bg {
position: absolute;
display: inline-block;
width: 68rpx;
height: 25rpx;
background-color: rgba(13, 132, 209, 0.1);
bottom: 15rpx;
left: 50%;
margin-left: -34rpx;
border-radius: 30rpx;
}
.fb_btn {
height: 98rpx;
background-color: #0d84d1;
color: #fff;
line-height: 98rpx;
text-align: center;
font-size: 32rpx;
border-radius: 8rpx;
box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3);
}
.fast_fb {
position: absolute;
bottom: 68rpx;
left: 55rpx;
right: 55rpx;
}
.nodata {
text-align: center;
}
.nodata .img {
width: 600rpx;
height: 393rpx;
margin: 0 auto;
}
.nodata .h3 {
font-weight: 600;
font-size: 48rpx;
color: #2e3033;
}
.nodata .p {
font-size: 26rpx;
color: #8a9299;
margin-top: 14rpx;
}
.nodata_fb {
margin: 40rpx 55rpx;
}
.concat_custom {
position: absolute;
bottom: 68rpx;
left: 0;
right: 0;
text-align: center;
color:#61A0F2;
font-size: 28rpx;
}
.concat_custom .icon{
font-size: 40rpx;
margin-right:16rpx;
vertical-align: sub;
}
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 sign in to comment