|
@@ -1,62 +1,78 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <view>
|
|
|
- <picker @change="locationChange" :value="location" :range="locationType">
|
|
|
+ <view style='background:#fff;border-bottom:1px solid #EEE;padding-bottom:10px;'>
|
|
|
+ <view class="cu-bar search">
|
|
|
+ <view style='position:absolute;left:30px;top:50%;transform: translateY(-50%);'>
|
|
|
+ <picker style='display:inline-block;' @change="locationChange" :value="location" :range="locationType">
|
|
|
<view class="picker">
|
|
|
{{location>-1?locationType[location]:'请选择'}}
|
|
|
</view>
|
|
|
</picker>
|
|
|
+ <image style='width:10px;height:6px;margin-left:4px;position:relative;top:-2px;' src='../../static/img/jiaoyi/down.png'></image>
|
|
|
</view>
|
|
|
- <view class='tag tag-bule radius line-pink'>采购</view>
|
|
|
- <view class='tag tag-bule radius line-pink'>销售</view>
|
|
|
- <view class="cu-bar search bg-white">
|
|
|
<view class="search-form round" @click="naviageToPage('/pageA/product/lookup?TabCur=')">
|
|
|
- <text style='color: #ccc;' class="cuIcon-search"></text>
|
|
|
+ <text style='color: #ccc;text-indent:56px;' class="cuIcon-search"></text>
|
|
|
<input type="text" placeholder="请输入货名或标题" confirm-type="search"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class='tag tag-bule radius line-pink' @click="sousuo">玉米</view>
|
|
|
- <view class='tag tag-bule radius line-pink' @click="sousuo">大豆</view>
|
|
|
- <view class='tag tag-bule radius line-pink' @click="sousuo">小麦</view>
|
|
|
- <view class='tag tag-bule radius line-pink' @click="sousuo">水稻</view>
|
|
|
- <view class='tag tag-bule radius line-pink' @click="sousuo">高粱</view>
|
|
|
- <view class="introduce-section">
|
|
|
+ <view style='margin:0 15px;'>
|
|
|
+ <view class='tag radius line-pink' @click="sousuo('玉米')">玉米</view>
|
|
|
+ <view class='tag radius line-pink' @click="sousuo('大豆')">大豆</view>
|
|
|
+ <view class='tag radius line-pink' @click="sousuo('小麦')">小麦</view>
|
|
|
+ <view class='tag radius line-pink' @click="sousuo('水稻')">水稻</view>
|
|
|
+ <view class='tag radius line-pink' @click="sousuo('高粱')">高粱</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style='background:#fff;padding:0 15px;'>
|
|
|
+ <view @click='tabcarchange(0)' class='line' :class='TabCur==0?"active":""'>采购</view>
|
|
|
+ <view @click='tabcarchange(1)' class='line' :class='TabCur==1?"active":""'>销售</view>
|
|
|
+ </view>
|
|
|
+ <view v-if='buyInfo.length>0' class="introduce-section">
|
|
|
<view v-for="(item, index) in buyInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
|
|
|
<view class="price-box">
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
- <template v-if='item.isFutures==0'>
|
|
|
-
|
|
|
- <view v-if="item.price !== 0" class="title-tip">
|
|
|
- <text class="price-tip">¥</text>
|
|
|
- <text class="price">{{item.price}}</text>
|
|
|
- <text class="price-tip">元/吨</text>
|
|
|
- </view>
|
|
|
- <view v-else class="title-tip">
|
|
|
- <text>市场价</text>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <view class="title-tip" v-if='item.isFutures==1'>
|
|
|
- <text style='color:#828282;margin-bottom:10rpx;display:inline-block;'
|
|
|
- class="price-tip">今日基差</text>
|
|
|
- <view>
|
|
|
- <text class="price-tip">¥</text>
|
|
|
- <text class="price">{{item.basis}}</text>
|
|
|
- <text class="price-tip">元/吨</text>
|
|
|
+ <view class='flex justify-between'>
|
|
|
+ <view class='address'>
|
|
|
+ {{item.receivePrivate}}{{item.receiveCity}}{{item.receiveArea}}{{item.receiveWarehouse}}
|
|
|
</view>
|
|
|
+ <view class='price' v-if='item.procurementPlanType=="期货"'>{{item.basisPrice}}<text style='font-size:13px;color:#333333;'>元/吨</text></view>
|
|
|
+ <view class='price' v-if='item.procurementPlanType=="现货"'>{{item.unitPrice}}<text style='font-size:13px;color:#333;'>元/吨</text></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='flex justify-between'>
|
|
|
+ <view>
|
|
|
+ <view class='tag1 tag-bule radius line-pink' v-if='item.procurementPlanType=="现货"'>现货</view>
|
|
|
+ <view class='tag1 tag-bule radius line-pink' v-if='item.procurementPlanType=="期货"'>期货</view>
|
|
|
+ <view class='tag1 tag-yellow radius line-green'>{{item.goodsName}}</view>
|
|
|
+ <view class='tag1 tag-red radius line-yellow'>{{item.weight}}吨</view>
|
|
|
</view>
|
|
|
+ <view style='color:#878C9C;padding-top:5px;' v-if='item.procurementPlanType=="期货"'>今日基差</view>
|
|
|
+ <view style='color:#878C9C;padding-top:5px;' v-if='item.procurementPlanType=="现货"'>采购价格</view>
|
|
|
</view>
|
|
|
- <view class='tag tag-bule radius line-pink' v-if='item.isFutures==0'>现货</view>
|
|
|
- <view class='tag tag-bule radius line-pink' v-if='item.isFutures==1'>期货</view>
|
|
|
- <view class='tag tag-green radius line-green'>{{item.goodsName}}</view>
|
|
|
- <view class='tag tag-yellow radius line-yellow'>易粮易运</view>
|
|
|
</view>
|
|
|
<view v-show="isLoadMore">
|
|
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view style='height:65vh;background:#F5F6FA;line-height:65vh;text-align:center;' v-if='buyInfo.length==0'>
|
|
|
+ 当前暂无结果
|
|
|
+ </view>
|
|
|
<u-back-top :scroll-top="scrollTop" tips="顶部" :custom-style="{backgroundColor: '#a0cfff',color: '#2979ff'}"
|
|
|
:iconStyle="{color: '#2979ff',fontSize: '34rpx'}" mode="square" icon="arrow-up"></u-back-top>
|
|
|
- <drag-button :isDock="true" :existTabBar="true" :isIcon="true" text="发布" location="20" @btnClick="fabu" />
|
|
|
+ <view>
|
|
|
+ <view
|
|
|
+ id="_drag_button"
|
|
|
+ class="drag"
|
|
|
+ style="right:0;bottom:60px;"
|
|
|
+ @touchstart="touchstart"
|
|
|
+ @touchmove.stop.prevent="touchmove"
|
|
|
+ @touchend="touchend"
|
|
|
+ @click.stop.prevent="fabu"
|
|
|
+ >
|
|
|
+ <image class='side-bg' src='../../static/img/jiaoyi/ic_fabu@3x.png'></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <drag-button :isDock="true" :existTabBar="true" :isIcon="true" text="发布" location="20" @btnClick="fabu" /> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -67,15 +83,15 @@
|
|
|
return {
|
|
|
PageCur: "buy",
|
|
|
buyInfo: [],
|
|
|
- pages: 1, //页数
|
|
|
limit: 10, //每次取条目数
|
|
|
loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
|
isLoadMore: false, //是否加载中
|
|
|
showTran: true,
|
|
|
scrollTop: 0,
|
|
|
- pageSize:1,
|
|
|
+ pageSize:10,
|
|
|
searchKeyWord:'',
|
|
|
- currentPage:10,
|
|
|
+ receivePrivate:'',
|
|
|
+ currentPage:1,
|
|
|
categoryList: [{
|
|
|
title: '我要买粮',
|
|
|
id: '0'
|
|
@@ -86,9 +102,9 @@
|
|
|
TabCur: 0,
|
|
|
current: 1,
|
|
|
location: 0,
|
|
|
- locationType: ['黑龙江省', '河南省', '山东省', '安徽省', '吉林省', '河北省', '江苏省', '内蒙古自治区', '四川省', '湖南省', '湖北省', '辽宁省',
|
|
|
- '江西省', '云南省', '新疆维吾尔自治区', '山西省', '广西壮族自治区', '陕西省', '广东省', '甘肃省', '重庆市', '贵州省', '浙江省', '福建省',
|
|
|
- '宁夏回族自治区', '天津市', '海南省', '青海省', '西藏自治区', '上海市', '北京市'
|
|
|
+ locationType: ['全国','黑龙江', '河南', '山东', '安徽', '吉林', '河北', '江苏', '内蒙古', '四川', '湖南', '湖北', '辽宁',
|
|
|
+ '江西', '云南', '新疆', '山西', '广西', '陕西', '广东', '甘肃', '重庆', '贵州', '浙江', '福建',
|
|
|
+ '宁夏', '天津', '海南', '青海', '西藏', '上海', '北京'
|
|
|
]
|
|
|
}
|
|
|
},
|
|
@@ -96,31 +112,20 @@
|
|
|
uni.showTabBar()
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- // console.log("buy onload")
|
|
|
- // // #ifdef H5
|
|
|
- // this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
|
|
|
- // // #endif
|
|
|
- // this.cateId = options.tid ? options.tid : 0;
|
|
|
- // this.keywords = options.keywords ? options.keywords : ''
|
|
|
- // this.loadData();
|
|
|
- this.$api.doRequest('get', '/procurementPlanInfo/selectProcurementPlanInfo',{pageSize:this.pageSize,
|
|
|
- currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.errmsg,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
+ console.log("buy onload")
|
|
|
+ // #ifdef H5
|
|
|
+ this.headerTop = document.getElementsByTagName('uni-page-head')[0].offsetHeight + 'px';
|
|
|
+ // #endif
|
|
|
+ this.cateId = options.tid ? options.tid : 0;
|
|
|
+ this.keywords = options.keywords ? options.keywords : ''
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
onPageScroll(e) {
|
|
|
this.scrollTop = e.scrollTop;
|
|
|
},
|
|
|
//下拉刷新
|
|
|
onPullDownRefresh() {
|
|
|
- this.pages = 1
|
|
|
+ this.pageSize = 1
|
|
|
this.isLoadMore = false
|
|
|
this.loadStatus = 'loading'
|
|
|
this.loadData()
|
|
@@ -133,6 +138,22 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ sousuo(name){
|
|
|
+ var page = '/pageA/product/lookup?TabCur=' + this.TabCur+'&searchKeyWord='+name
|
|
|
+ uni.navigateTo({
|
|
|
+ url: page,
|
|
|
+ fail() {
|
|
|
+ uni.switchTab({
|
|
|
+ url: page
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tabcarchange(status){
|
|
|
+ this.TabCur=status
|
|
|
+ this.pageSize = 1
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
naviageToPage(page) {
|
|
|
page = page + this.TabCur
|
|
|
uni.navigateTo({
|
|
@@ -145,18 +166,30 @@
|
|
|
})
|
|
|
},
|
|
|
locationChange(e) {
|
|
|
- this.location = e.detail.value
|
|
|
+
|
|
|
+ this.receivePrivate = e.detail.value
|
|
|
+ this.pageSize = 1
|
|
|
+ this.loadData()
|
|
|
},
|
|
|
tabSelect(e) {
|
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
|
this.category = this.TabCur
|
|
|
- this.pages = 1
|
|
|
+ this.pageSize = 1
|
|
|
this.loadData()
|
|
|
},
|
|
|
fabu() {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageB/trust/trust`
|
|
|
+ uni.showActionSheet({
|
|
|
+ itemList: ['我要买粮', '我要卖粮'],
|
|
|
+ success (res) {
|
|
|
+ console.log(res.tapIndex)
|
|
|
+ },
|
|
|
+ fail (res) {
|
|
|
+ console.log(res.errMsg)
|
|
|
+ }
|
|
|
})
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: `/pageB/trust/trust`
|
|
|
+ // })
|
|
|
},
|
|
|
//加载商品 ,带下拉刷新和上滑加载
|
|
|
async loadData(type = 'add', loading) {
|
|
@@ -171,11 +204,11 @@
|
|
|
} else {
|
|
|
param1 = 'buy'
|
|
|
}
|
|
|
-
|
|
|
- console.log(11111)
|
|
|
- this.$api.doRequest('get', '/procurementPlanInfo/selectProcurementPlanInfo',{pageSize:this.pageSize,
|
|
|
-currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
- console.log(res)
|
|
|
+ this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
+ showFlag:1,
|
|
|
+currentPage:this.currentPage,searchKeyWord:this.searchKeyWord,receivePrivate:this.receivePrivate}).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ this.buyInfo=res.data.data.records
|
|
|
})
|
|
|
.catch(res => {
|
|
|
uni.showToast({
|
|
@@ -221,7 +254,7 @@ currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
//详情
|
|
|
navToDetailPage(item) {
|
|
|
let id = item.id;
|
|
|
- if (item.price === 0) {
|
|
|
+ if (item.unitPrice === 0) {
|
|
|
this.contactUs();
|
|
|
} else {
|
|
|
if (this.TabCur == 0) {
|
|
@@ -295,55 +328,81 @@ currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
<style>
|
|
|
page,
|
|
|
.content {
|
|
|
- // background: $page-color-base;
|
|
|
+ background: #F5F6FA;
|
|
|
+ }
|
|
|
+ .line{
|
|
|
+ display:inline-block;
|
|
|
+ padding:5px;
|
|
|
+ position:relative;
|
|
|
+ font-size:17px;
|
|
|
+ }
|
|
|
+ .line.active{
|
|
|
+ font-size:19px;
|
|
|
+ font-weight: 900;
|
|
|
+ }
|
|
|
+ .line.active:after{
|
|
|
+ content:'';
|
|
|
+ display:block;
|
|
|
+ position:absolute;
|
|
|
+ width:18px;
|
|
|
+ left:50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ bottom:0;
|
|
|
+ border-bottom:1px solid #22C572;
|
|
|
}
|
|
|
-
|
|
|
.cu-tag.badge {
|
|
|
right: 26rpx;
|
|
|
}
|
|
|
-
|
|
|
.cu-item {
|
|
|
height: 80rpx;
|
|
|
display: inline-block;
|
|
|
line-height: 80rpx;
|
|
|
}
|
|
|
-
|
|
|
.search-form {
|
|
|
- background: #fff;
|
|
|
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
|
+ background: #F5F6F9;
|
|
|
}
|
|
|
-
|
|
|
.title-tip {
|
|
|
color: #E63113;
|
|
|
text-align: right;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ .tag1 {
|
|
|
+ background:#F5F6F9;
|
|
|
+ padding: 5px;
|
|
|
+ color:#333333;
|
|
|
+ display: inline-flex;
|
|
|
+ font-size: 22rpx;
|
|
|
+ border-radius: 3px;
|
|
|
+ margin: 3px;
|
|
|
+ }
|
|
|
+ .tag {
|
|
|
+ background:#F5F6F9;
|
|
|
+ padding: 7px 12px;
|
|
|
+ color:#333333;
|
|
|
+ display: inline-flex;
|
|
|
+ font-size: 22rpx;
|
|
|
+ border-radius: 15px;
|
|
|
+ margin: 3px;
|
|
|
+ }
|
|
|
.tag-bule {
|
|
|
- background: #CDE7FB;
|
|
|
- color: #0B4572;
|
|
|
+ background: #EBEEFA;
|
|
|
+ color: #5C76DF;
|
|
|
}
|
|
|
-
|
|
|
.tag-green {
|
|
|
background: #C6F7BC;
|
|
|
color: #065112;
|
|
|
}
|
|
|
-
|
|
|
.tag-yellow {
|
|
|
- background: #FBF4B1;
|
|
|
- color: #5C4409;
|
|
|
+ background: #F9F2EA;
|
|
|
+ color: #BE9C69;
|
|
|
}
|
|
|
-
|
|
|
- .tag {
|
|
|
- padding: 5px;
|
|
|
- display: inline-flex;
|
|
|
- font-size: 22rpx;
|
|
|
- margin: 3px;
|
|
|
+ .tag-red {
|
|
|
+ background: #FEECE6;
|
|
|
+ color: #FE6430;
|
|
|
}
|
|
|
-
|
|
|
.text-white {
|
|
|
color: #fff;
|
|
|
}
|
|
|
-
|
|
|
.text-white text {
|
|
|
position: relative;
|
|
|
z-index: 2;
|
|
@@ -586,26 +645,37 @@ currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.introduce-section .title{
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: bold;
|
|
|
+ height:40px;
|
|
|
+ line-height: 40px;
|
|
|
+ flex: 2.5;
|
|
|
+ border-bottom:1px solid #EEEEEE;
|
|
|
+}
|
|
|
+.introduce-section .address{
|
|
|
+ color:#878C9C;
|
|
|
+ font-size:12px;
|
|
|
+ padding:15px 0 10px;
|
|
|
+}
|
|
|
+.introduce-section .price{
|
|
|
+ padding:10px 0 10px;
|
|
|
+ color:#FD714F;
|
|
|
+ font-size:19px;
|
|
|
+ font-weight:700;
|
|
|
+}
|
|
|
/* 销售信息 */
|
|
|
.introduce-section {
|
|
|
background: #fff;
|
|
|
- padding: 20upx 30upx;
|
|
|
- padding-bottom: 100upx;
|
|
|
+ padding: 0upx 30upx 20upx;
|
|
|
+ margin:10px;
|
|
|
+ border-radius:4px;
|
|
|
|
|
|
.guess-item {
|
|
|
padding-bottom: 20upx;
|
|
|
border-bottom: 1px solid #ccc;
|
|
|
}
|
|
|
|
|
|
- .title {
|
|
|
- font-size: 28upx;
|
|
|
- color: $font-color-dark;
|
|
|
- font-weight: bold;
|
|
|
- height: 50upx;
|
|
|
- line-height: 50upx;
|
|
|
- flex: 2.5;
|
|
|
- }
|
|
|
-
|
|
|
.title-tip {
|
|
|
flex: 1;
|
|
|
}
|
|
@@ -652,4 +722,27 @@ currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .side-bg{
|
|
|
+ position:absolute;
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+ .drag {
|
|
|
+ position:relative;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: $uni-text-color-inverse;
|
|
|
+ width: 64px;
|
|
|
+ height: 64px;
|
|
|
+ background:transparent;
|
|
|
+ font-size: $uni-font-size-sm;
|
|
|
+ position: fixed;
|
|
|
+ z-index: 9;
|
|
|
+
|
|
|
+ &.transition {
|
|
|
+ transition: left .3s ease,top .3s ease;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|