Selaa lähdekoodia

前端小程序 sdy

zhongtianhaoyuan 3 vuotta sitten
vanhempi
commit
6c8f23aaef

+ 407 - 0
pageA/product/business_buy.vue

@@ -0,0 +1,407 @@
+<template>
+	<view class="container">
+		<view  class="cu-form-group">
+			<view class="title">卖方</view>
+			<view class="title">{{seller}}</view>
+		</view>
+		<view  class="cu-form-group">
+			<view class="title">买方</view>
+			<view class="title">{{sellerPhone}}</view>
+		</view>
+		<view   class="cu-form-group margin-top">
+			<view class="title">收货地区</view>
+				<view class="title">{{sellerPhone}}</view>
+			</picker>
+		</view>
+		<view   class="cu-form-group ">
+			<view class="title">收货库</view>
+				<view class="title">{{sellerPhone}}</view>
+			</picker>
+		</view>
+		<view v-if='companyId!=2' class="cu-form-group">
+			<view class="title">货名</view>
+			<input placeholder="请填写" name="input" @input="addressInput"></input>
+		</view>
+		<view class="cu-form-group">
+			<view class="title">最小成交量(吨)</view>
+			<view class="title">{{minSale}}</view>
+		</view>
+		<view v-if="companyId==2" class="cu-form-group">
+			<view  class="title">今日基差(元/吨)</view>
+				<view class="picker">
+					{{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}}
+				</view>
+			
+		</view>
+		<view v-else class="cu-form-group">
+			<view  class="title">采购单价(元/吨)</view>
+				<view class="picker">
+					{{invoiceTypeIndex>-1?invoiceType[invoiceTypeIndex]:'请选择'}}
+				</view>
+		</view>
+		<view class="cu-form-group margin-top">
+			<view class="title">发票类型</view>
+			<input placeholder="请填写" name="input" @input="countInput"></input>
+		</view>
+		<view  class="cu-form-group">
+			<view class="title">出售数量(吨)</view>
+			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		</view>
+		<view  class="cu-form-group">
+			<view class="title">包装方式</view>
+			<picker @change="packingChange" :value="packingIndex" :range="packingType">
+				<view class="picker">
+					{{packingIndex>-1?packingType[packingIndex]:'请选择'}}
+				</view>
+			</picker>
+		</view>
+		<view class="cu-form-group align-start">
+			<view class="title">袋装备注</view>
+			<textarea maxlength="-1" :disabled="modalName!=null" @input="textareaInput" placeholder="请填写包装规格、质量、包装物要求。例:50kg袋装、大粒、彩包"></textarea>
+		</view>
+		<view class="cu-form-group align-start">
+			<view class="title">点价(元/吨)</view>
+			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		</view>
+		<view class="cu-form-group align-start">
+			<view class="title">发票费用(元/吨)</view>
+			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		</view>
+		<view class="cu-form-group align-start">
+			<view class="title">包装费(元/吨)</view>
+		<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		</view>
+		<view class="cu-form-group align-start">
+			<view class="title">结算价格</view>
+			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		</view>
+		<view class="padding flex flex-direction">
+			<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+			data() {
+				return {
+					tradeInfo:{
+						salebuyId:0,
+						packing:'',
+						memo:'',
+						buyer:'',
+						buyerPhone:'',
+						unitPrice:0,
+						address:'',
+						count:0,
+						province:'',
+						area:'',
+						priceType:'',
+						invoiceType:'',
+						acceptType:'',
+						seller:'',
+						sellerPhone:'',
+						packingMoney:0,
+						type:0,
+					},
+					invoiceTypeIndex:0,
+					invoiceTypeIndex1:0,
+					acceptTypeIndex:0,
+					priceTypeIndex:0,
+					bankNameIndex:0,
+					packingIndex:0,
+					packingType: ['散装', '袋装'],
+					invoiceType: ['不开发票', '普通发票', '增值税发票'],
+					invoiceType1: ['不开发票','增值税发票'],
+					acceptType: ['第三方检验(国家检验资质)', '交收地库或港出具的检验', '现场看货','其他'],
+					priceType: ['库内价', '到库价', '到港价'],
+					priceTypeIndex1:'库内价',
+					region: [],
+					salebuyId:0,
+					memo:'',
+					buyer:'',
+					buyerPhone:'',
+					unitPrice:0,
+					address:'',
+					count:0,
+					price:'库内价',
+					invoice:'不开发票',
+					accept:'',
+					seller:'',
+					sellerPhone:'',
+					minSale:'',
+					province:'',
+					city:'',
+					area:'',
+					storeName:'',
+					exsitCount:0,
+					isFutures:'',
+					bankNameList:'',
+					Company:[],
+					companyId:'',
+					tradeCompanyId:'',
+					basis:0,
+					basisBig:0,
+					basisSmall:0,
+					invoiceMoney:0,
+					unloadingFee:0,
+					packingMoney:0,
+					packing:'散装'
+				};
+			},
+			onLoad(options) {
+				this.salebuyId = options.id
+				this.seller = options.seller
+				this.sellerPhone = options.sellerPhone
+				this.isFutures = options.isFutures
+				this.minSale = options.minSale
+				this.companyId=options.companyId
+				this.province = options.province
+				this.city = options.city
+				this.area = options.area
+				this.storeName=options.storeName
+				this.exsitCount = Math.floor(options.exsitCount * 100) / 100
+				this.basis = options.basis
+				this.basisBig = options.basisBig
+				this.basisSmall = options.basisSmall
+				this.unloadingFee = options.unloadingFee
+			},
+			onShow() {
+				var that=this
+				this.$api.request('company', 'getCompany', failres => {
+					that.$api.msg(failres.errmsg)
+					uni.hideLoading()
+				}).then(res => {
+					if(res.data.code=='SUCCESS'){
+						var data=[]
+						this.Company=res.data.data
+						if(res.data.data){
+							for(let i=0;i<res.data.data.length;i++){
+								data.push(res.data.data[i].companyName+' '+res.data.data[i].companyPhone)
+							}
+						}
+						if(this.Company){
+							this.buyer =this.Company[0].companyName
+							this.buyerPhone=this.Company[0].companyPhone
+							this.tradeCompanyId=this.Company[0].id
+						}
+						that.bankNameList=data
+						uni.hideLoading()
+					}else{
+						that.$api.msg(res.data.code)
+						uni.hideLoading()
+					}
+				})
+				// uni.getLocation({
+				//     type: 'wgs84',
+				// 	geocode:true,
+				//     success: function (res) {
+				//         console.log('当前位置的经度:' + res.longitude);
+				//         console.log('当前位置的纬度:' + res.latitude);
+				//     }
+				// });
+			},
+			methods: {
+				InvoiceTypeChange(e) {
+					this.invoiceTypeIndex = e.detail.value
+					this.invoice = this.invoiceType[this.invoiceTypeIndex];
+					
+				},
+				InvoiceTypeChange1(e) {
+					this.invoiceTypeIndex1 = e.detail.value
+					this.invoice = this.invoiceType1[this.invoiceTypeIndex1];
+					if(this.invoiceTypeIndex1 == 0){
+						this.invoiceMoney = 0
+					}
+					else{
+						this.invoiceMoney = 20
+					}
+				},
+				bankNameChange(e){
+					this.bankNameIndex=e.detail.value
+					this.buyer =this.Company[e.detail.value].companyName
+					this.buyerPhone=this.Company[e.detail.value].companyPhone
+					this.tradeCompanyId=this.Company[e.detail.value].id
+				},
+				AcceptTypeChange(e) {
+					this.acceptTypeIndex = e.detail.value
+					this.accept = this.acceptType[this.acceptTypeIndex];
+				},
+				packingChange(e){
+					this.packingIndex = e.detail.value
+					this.packing = this.packingType[this.packingIndex];
+					if(this.packingIndex == 0){
+						this.packingMoney = 0
+					}
+					else if(this.packingIndex == 1){
+						this.packingMoney = this.basisBig - this.basis
+					}
+					else if(this.packingIndex == 2){
+						this.packingMoney = this.basisSmall - this.basis
+					}
+				},
+				changeZhihang(){
+					uni.navigateTo({
+						url: '/pageA/pages/newcompany'
+					})
+				},
+				PriceTypeChange(e) {
+					this.priceTypeIndex = e.detail.value
+					this.price = this.priceType[this.priceTypeIndex]
+				},
+				RegionChange(e) {
+					this.region = e.detail.value
+					this.province = this.region[0];
+					this.area = this.region[0]+this.region[1]+this.region[2];
+				},
+				textareaInput(e) {
+					this.memo = e.detail.value
+				},
+				packingInput(e){
+					this.packing = e.detail.value
+				},
+				buyerInput(e){
+					this.buyer = e.detail.value
+				},
+				buyerPhoneInput(e){
+					this.buyerPhone = e.detail.value
+				},
+				unitPriceInput(e){
+					this.unitPrice = e.detail.value
+				},
+				addressInput(e){
+					this.address = e.detail.value
+				},
+				countInput(e){
+					this.count = e.detail.value
+				},
+				commit(){
+					const that = this
+					if ( that.companyId !=2 && !that.area ) {
+						that.$api.msg('请选择省市区');
+						return
+					}
+					if ( that.companyId !=2&& !that.address) {
+						that.$api.msg('请填写详细交收地址')
+						return
+					}
+					if (!that.price) {
+						that.$api.msg('请选择价格类型')
+						return
+					}
+					if (!that.invoice) {
+						that.$api.msg('请选择发票类型')
+						return
+					}
+					// if(!that.accept&&that.isFutures==0){
+					// 	that.$api.msg('请选择质量验收方式');
+					// 	return
+					// }
+					if(!that.unitPrice){
+						that.$api.msg('请填写协议价格(元/吨)');
+						return
+					}
+					if(!that.count){
+						that.$api.msg('请填写购买数量(吨)');
+						return
+					}
+					if(Number(that.count) < Number(that.minSale)){
+						that.$api.msg('购买数量不能小于最小成交量');
+						return
+					}
+					if(!that.tradeCompanyId){
+						that.$api.msg('请选择公司名头');
+						return
+					}
+					// if(that.count > that.exsitCount){
+					// 	that.$api.msg('购买数量大于库存量');
+					// 	return
+					// }
+					//this.$api.prePage()获取上一页实例,可直接调用上页所有数据和方法,在App.vue定义
+					
+					//this.$api.msg(`地址${this.manageType=='edit' ? '修改': '添加'}成功`);
+					that.tradeInfo.salebuyId = that.salebuyId
+					that.tradeInfo.buyer = that.buyer
+					that.tradeInfo.buyerPhone = that.buyerPhone
+					that.tradeInfo.priceType = that.price
+					that.tradeInfo.unitPrice = that.unitPrice
+					that.tradeInfo.province = that.province
+					that.tradeInfo.area = that.area
+					that.tradeInfo.address = that.address
+					that.tradeInfo.count = that.count
+					that.tradeInfo.acceptType = that.accept
+					that.tradeInfo.invoiceType = that.invoice
+					that.tradeInfo.packing = that.packing
+					that.tradeInfo.packingMoney = that.packingMoney
+					that.tradeInfo.memo = that.memo
+					that.tradeInfo.seller = that.seller
+					that.tradeInfo.sellerPhone = that.sellerPhone
+					that.tradeInfo.tradeCompanyId = that.tradeCompanyId
+					that.tradeInfo.invoiceMoney = that.invoiceMoney
+					// that.tradeInfo.unloadingFee = that.unloadingFee
+					uni.showLoading({
+						title: '正在提交',
+						mask:true
+					})
+					that.$api.request('trade', 'addTrade',that.tradeInfo, failres => {
+						uni.hideLoading()
+						that.$api.msg(failres.errmsg);
+						
+					}).then(res => {
+						uni.hideLoading()
+						uni.showModal({
+							title: '提示',
+							content: "交易申请提交成功",
+							showCancel: false,
+							confirmText: '确定',
+							success: () => {
+								uni.navigateBack({
+									delta: 2
+								})
+							}
+						})
+						// that.$api.prePage().refreshList(data, that.manageType);
+					})
+				
+				}
+			}
+		}
+</script>
+
+<style scoped>
+	.cu-form-group input {
+		text-align: right;
+	}
+	.cu-form-group textarea {
+		text-align: right;
+	}
+	.margin-bottom{
+		margin-bottom:30px;
+	}
+	.c-row {
+	    display: -webkit-box;
+	    display: -webkit-flex;
+	    display: flex;
+	    -webkit-box-align: center;
+	    -webkit-align-items: center;
+	    align-items: center;
+	    padding: 20rpx 30rpx;
+	    position: relative;
+	}
+	.con-list {
+	    -webkit-box-flex: 1;
+	    -webkit-flex: 1;
+	    flex: 1;
+	    display: -webkit-box;
+	    display: -webkit-flex;
+	    display: flex;
+	    -webkit-box-orient: vertical;
+	    -webkit-box-direction: normal;
+	    -webkit-flex-direction: column;
+	    flex-direction: column;
+	    color: #303133;
+	    line-height: 40rpx;
+	    text-align: right;
+	    padding-right: 20rpx;
+	}
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 844 - 0
pageA/product/buydetails.vue


+ 248 - 0
pageA/product/lookup.vue

@@ -0,0 +1,248 @@
+<template>
+	<view class="content">
+		<view class="search-box">
+			<!-- mSearch组件 如果使用原样式,删除组件元素-->
+			<mSearch class="mSearch-input-box" :mode="2" button="inside" :placeholder="defaultKeyword" @search="doSearch(false)" @input="inputChange" @confirm="doSearch(false)" v-model="keyword"></mSearch>
+			<!-- 原样式 如果使用原样式,恢复下方注销代码 -->
+			<!-- 			
+			<view class="input-box">
+				<input type="text" :placeholder="defaultKeyword" @input="inputChange" v-model="keyword" @confirm="doSearch(false)"
+				 placeholder-class="placeholder-class" confirm-type="search">
+			</view>
+			<view class="search-btn" @tap="doSearch(false)">搜索</view> 
+			-->
+			<!-- 原样式 end -->
+		</view>
+		<view class="search-keyword" @touchstart="blur">
+			<scroll-view class="keyword-list-box" v-show="isShowKeywordList" scroll-y>
+				<view class="keyword-entry" hover-class="keyword-entry-tap" v-for="row in keywordList" :key="row.keyword">
+					<view class="keyword-text" @tap="doSearch(row.keyword)">
+						<rich-text :nodes="row.htmlStr"></rich-text>
+					</view>
+					<view class="keyword-img" @tap="setkeyword(row)">
+						<image src="/static/HM-search/back.png"></image>
+					</view>
+				</view>
+			</scroll-view>
+			<scroll-view class="keyword-box" v-show="!isShowKeywordList" scroll-y>
+				<view class="keyword-block" v-if="oldKeywordList.length>0">
+					<view class="keyword-list-header">
+						<view>历史搜索</view>
+						<view>
+							<!-- <image @tap="oldDelete" src="./static/delete.png"></image> -->
+							<text class="cuIcon-delete text-gray " @tap="oldDelete" ></text>
+							
+						</view>
+					</view>
+					<view class="keyword">
+						<view v-for="(keyword,index) in oldKeywordList" @tap="doSearch(keyword)" :key="index">{{keyword}}</view>
+					</view>
+				</view>
+				 <view class="keyword-block">
+					<view class="keyword-list-header">
+						<view>推荐搜索</view>
+						<view>
+							 <image @tap="hotToggle" :src="'/static/HM-search/attention'+forbid+'.png'"></image> 
+						</view>
+					</view>
+					<view class="keyword" v-if="forbid==''">
+						<view v-for="(keyword,index) in hotKeywordList" @tap="doSearch(keyword)" :key="index">{{keyword}}</view>
+					</view>
+				</view> 
+			</scroll-view>
+		</view>
+	</view>
+</template>
+
+<script>
+	//引用mSearch组件,如不需要删除即可
+	import mSearch from '@/components/mehaotian-search-revision.vue';
+	export default {
+		data() {
+			return {
+				defaultKeyword: "",
+				keyword: "",
+				oldKeywordList: [],
+				hotKeywordList: ["玉米","大豆","小麦","水稻","高粱","玉米淀粉","豆粕"],
+				keywordList: [],
+				forbid: '',
+				isShowKeywordList: false,
+				TabCur:0,
+			}
+		},
+		onLoad(options) {
+			this.TabCur = options.TabCur
+			this.init();
+		},
+		components: {
+			//引用mSearch组件,如不需要删除即可
+			mSearch
+		},
+		methods: {
+			init() {
+				this.loadDefaultKeyword();
+				this.loadOldKeyword();
+				// this.loadHotKeyword();
+
+			},
+			blur(){
+				uni.hideKeyboard()
+			},
+			
+			tabSelect(e) {
+				if(e.currentTarget.dataset.id){
+					this.TabCur = e.currentTarget.dataset.id;
+				}
+				else{
+					this.TabCur = e.target.current;
+				}
+				this.pages = 1
+				this.isLoadMore = false
+				this.loadData()
+			},
+			//加载默认搜索关键字
+			loadDefaultKeyword() {
+				//定义默认搜索关键字,可以自己实现ajax请求数据再赋值,用户未输入时,以水印方式显示在输入框,直接不输入内容搜索会搜索默认关键字
+				this.defaultKeyword = "默认关键字";
+			},
+			//加载历史搜索,自动读取本地Storage
+			loadOldKeyword() {
+				uni.getStorage({
+					key: 'OldKeys',
+					success: (res) => {
+						var OldKeys = JSON.parse(res.data);
+						this.oldKeywordList = OldKeys;
+					}
+				});
+			},
+			//监听输入
+			inputChange(event) {
+				//兼容引入组件时传入参数情况
+				var keyword = event.detail?event.detail.value:event;
+				// if (!keyword) {
+				// 	this.keywordList = [];
+				// 	this.isShowKeywordList = false;
+				// 	return;
+				// }
+				// this.isShowKeywordList = true;
+				// //以下示例截取淘宝的关键字,请替换成你的接口
+				// uni.request({
+				// 	url: 'https://suggest.taobao.com/sug?code=utf-8&q=' + keyword, //仅为示例
+				// 	success: (res) => {
+				// 		this.keywordList = this.drawCorrelativeKeyword(res.data.result, keyword);
+				// 	}
+				// });
+			},
+			//高亮关键字
+			drawCorrelativeKeyword(keywords, keyword) {
+				var len = keywords.length,
+					keywordArr = [];
+				for (var i = 0; i < len; i++) {
+					var row = keywords[i];
+					//定义高亮#9f9f9f
+					var html = row[0].replace(keyword, "<span style='color: #9f9f9f;'>" + keyword + "</span>");
+					html = '<div>' + html + '</div>';
+					var tmpObj = {
+						keyword: row[0],
+						htmlStr: html
+					};
+					keywordArr.push(tmpObj)
+				}
+				return keywordArr;
+			},
+			//顶置关键字
+			setkeyword(data) {
+				this.keyword = data.keyword;
+			},
+			//清除历史搜索
+			oldDelete() {
+				uni.showModal({
+					content: '确定清除历史搜索记录?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							this.oldKeywordList = [];
+							uni.removeStorage({
+								key: 'OldKeys'
+							});
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			},
+			//热门搜索开关
+			hotToggle() {
+				this.forbid = this.forbid ? '' : '_forbid';
+			},
+			//执行搜索
+			doSearch(key) {
+				console.log(key)
+				console.log(this.keyword)
+				key = key ? key : this.keyword ? this.keyword : this.defaultKeyword;
+				this.keyword = key;
+				this.saveKeyword(key); //保存为历史 
+				var TabCur = this.TabCur
+				uni.navigateTo({
+					url: `/pageA/product/querylist?keywords=${key}&TabCur=${TabCur}`
+				})
+			},
+			//保存关键字到历史记录
+			saveKeyword(keyword) {
+				uni.getStorage({
+					key: 'OldKeys',
+					success: (res) => {
+						console.log(res.data);
+						var OldKeys = JSON.parse(res.data);
+						var findIndex = OldKeys.indexOf(keyword);
+						if (findIndex == -1) {
+							OldKeys.unshift(keyword);
+						} else {
+							OldKeys.splice(findIndex, 1);
+							OldKeys.unshift(keyword);
+						}
+						//最多10个纪录
+						OldKeys.length > 10 && OldKeys.pop();
+						uni.setStorage({
+							key: 'OldKeys',
+							data: JSON.stringify(OldKeys)
+						});
+						this.oldKeywordList = OldKeys; //更新历史搜索
+					},
+					fail: (e) => {
+						var OldKeys = [keyword];
+						uni.setStorage({
+							key: 'OldKeys',
+							data: JSON.stringify(OldKeys)
+						});
+						this.oldKeywordList = OldKeys; //更新历史搜索
+					}
+				});
+			}
+		}
+	}
+</script>
+<style>
+	view{display:block;}
+	.search-box {width:100%;background-color:rgb(242,242,242);padding:15upx 2.5%;display:flex;justify-content:space-between;}
+	.search-box .mSearch-input-box{width: 100%;}
+	.search-box .input-box {width:85%;flex-shrink:1;display:flex;justify-content:center;align-items:center;}
+	.search-box .search-btn {width:15%;margin:0 0 0 2%;display:flex;justify-content:center;align-items:center;flex-shrink:0;font-size:28upx;color:#fff;background:linear-gradient(to right,#ff9801,#ff570a);border-radius:60upx;}
+	.search-box .input-box>input {width:100%;height:60upx;font-size:32upx;border:0;border-radius:60upx;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0 3%;margin:0;background-color:#ffffff;}
+	.placeholder-class {color:#9e9e9e;}
+	.search-keyword {width:100%;background-color:rgb(242,242,242);}
+	.keyword-list-box {height:calc(100vh - 110upx);padding-top:10upx;border-radius:20upx 20upx 0 0;background-color:#fff;}
+	.keyword-entry-tap {background-color:#eee;}
+	.keyword-entry {width:94%;height:80upx;margin:0 3%;font-size:30upx;color:#333;display:flex;justify-content:space-between;align-items:center;border-bottom:solid 1upx #e7e7e7;}
+	.keyword-entry image {width:60upx;height:60upx;}
+	.keyword-entry .keyword-text,.keyword-entry .keyword-img {height:80upx;display:flex;align-items:center;}
+	.keyword-entry .keyword-text {width:90%;}
+	.keyword-entry .keyword-img {width:10%;justify-content:center;}
+	.keyword-box {height:calc(100vh - 110upx);border-radius:20upx 20upx 0 0;background-color:#fff;}
+	.keyword-box .keyword-block {padding:10upx 0;}
+	.keyword-box .keyword-block .keyword-list-header {width:94%;padding:10upx 3%;font-size:27upx;color:#333;display:flex;justify-content:space-between;}
+	.keyword-box .keyword-block .keyword-list-header image {width:40upx;height:40upx;}
+	.keyword-box .keyword-block .keyword {width:94%;padding:3px 3%;display:flex;flex-flow:wrap;justify-content:flex-start;}
+	.keyword-box .keyword-block .hide-hot-tis {display:flex;justify-content:center;font-size:28upx;color:#6b6b6b;}
+	.keyword-box .keyword-block .keyword>view {display:flex;justify-content:center;align-items:center;border-radius:60upx;padding:0 20upx;margin:10upx 20upx 10upx 0;height:60upx;font-size:28upx;background-color:rgb(242,242,242);color:#6b6b6b;}
+</style>

+ 919 - 0
pageA/product/querylist.vue

@@ -0,0 +1,919 @@
+<template>
+	<view class="content">
+		<scroll-view scroll-x class="bg-white nav">
+			<view class="flex text-center">
+				<view class="cu-item flex-sub" :class="0==TabCur?'text-orange cur':''" @tap="tabSelect" data-id="0">
+					<text class="cuIcon-text"></text> 销售信息
+				</view>
+				<view class="cu-item flex-sub" :class="1==TabCur?'text-orange cur':''" @tap="tabSelect" data-id="1">
+					<text class="cuIcon-cartfill"></text> 采购信息
+				</view>
+			<!-- 	<view  v-if="showTran" class="cu-item flex-sub" :class="2==TabCur?'text-orange cur':''" @tap="tabSelect" data-id="2">
+					<text class="cuIcon-deliver"></text> 货源信息
+				</view>
+				<view v-if="showTran" class="cu-item flex-sub" :class="3==TabCur?'text-orange cur':''" @tap="tabSelect" data-id="3">
+					<text class="cuIcon-group"></text> 车辆信息
+				</view> -->
+			</view>
+		</scroll-view>
+		<swiper :current="TabCur" class="swiper-box" duration="300" @change="tabSelect">
+			<swiper-item class="tab-content" data-id="1">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="onReachBottomTmp">
+					<block v-if="TabCur==0">
+						<view class="introduce-section">
+							<view v-for="(item, index) in saleInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
+								<view class="price-box">
+									<view class="title">{{item.title}}</view>
+									<view class="title-tip" v-if='item.isFutures==0'>
+										<text class="price-tip">¥</text>
+										<text class="price">{{item.price}}</text>
+										<text class="price-tip">元/吨</text>
+									</view>
+									<view class="title-tip" v-if='item.isFutures==1'>
+										<text class="price-tip">今日基差</text>&nbsp;
+										<text class="price-tip">¥</text>
+										<text class="price">{{item.basis}}</text>
+									</view>
+								</view>
+								<view class='cu-tag radius line-pink' v-if='item.isFutures==0'>现货</view>
+								<view class='cu-tag radius line-pink' v-if='item.isFutures==1'>期货</view>
+								<view class='cu-tag radius line-green'>{{item.goodsName}}</view>
+								<view class='cu-tag radius line-yellow'>易粮易运</view>
+							</view>
+							<view v-show="isLoadMore">
+								<uni-load-more :status="loadStatus"></uni-load-more>
+							</view>
+						</view>
+					</block>
+					</scroll-view>
+			</swiper-item>
+			<swiper-item class="tab-content" data-id="2">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="onReachBottomTmp">
+					<block v-if="TabCur==1">
+					<view 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 class="price-tip">今日基差</text>&nbsp;
+									<text class="price-tip">¥</text>
+									<text class="price">{{item.basis}}</text>
+								</view>
+								
+							</view>
+							<view class='cu-tag radius line-pink' v-if='item.isFutures==0'>现货</view>
+							<view class='cu-tag radius line-pink' v-if='item.isFutures==1'>期货</view>
+							<view class='cu-tag radius line-green'>{{item.goodsName}}</view>
+							<view class='cu-tag radius line-yellow'>易粮易运</view>
+						</view>
+						<view v-show="isLoadMore">
+							<uni-load-more :status="loadStatus"></uni-load-more>
+						</view>
+					</view>
+					
+				</block>
+				</scroll-view>
+			</swiper-item>
+			<!-- <swiper-item class="tab-content" data-id="3">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="onReachBottomTmp">
+					<block v-if="TabCur==2">
+					<view class="guess-section">
+						<view 
+							v-for="(item, index) in tranInfo" :key="index"
+							class="guess-item"
+							@click="navToDetailPage(item)"
+						>
+						<view class="flex justify-between padding-xs ">
+						  <view class="flex-sub padding-xs">
+							  <view class="cu-capsule radius">
+							  	<view class="cu-tag bg-blue">
+							  		{{item.startPlace }}
+							  	</view>
+							  	<view class="cu-tag line-blue">
+							  		{{item.endPlace }}
+							  	</view>
+							  </view>
+						  </view>
+						 
+						  <view class=" padding-xs">
+							  <view v-if="item.status == 0" class="cu-capsule radius">
+								<view  class="cu-tag bg-green">
+									可承运
+								</view>
+								<view class="cu-tag line-green">
+									 <text class="text-price">{{item.price }}</text>
+								</view>
+							  </view>
+							  <view v-else class="cu-capsule radius">
+							  	<view  class="cu-tag bg-red">
+							  		已结束
+							  	</view>
+							  	<view class="cu-tag line-red">
+							  		 <text class="text-price">{{item.price }}</text>
+							  	</view>
+							  </view>
+						  </view>
+						</view>
+						<view class="flex justify-between padding-xs">
+							<view class="flex-sub padding-xs">
+							  <view class="cu-capsule radius">
+								<view class="cu-tag bg-orange">
+									{{item.goodsName}}
+								</view>
+								<view class="cu-tag line-orange">
+									{{numFilter(item.total - item.tranCount) }}吨
+								</view>
+							  </view>
+							</view>
+							<view class=" text-sm padding-xs">
+								<view class=" text-sm padding-xs">
+									<text class="text-gray  text-sm text-right padding-xs-tmp ">{{item.gmtUpdate}}</text>
+								</view>
+							</view>
+						</view>
+						</view>
+						<view v-show="isLoadMore">
+						    <uni-load-more :status="loadStatus" ></uni-load-more>
+						</view>
+					</view>
+				</block>
+				</scroll-view>
+			</swiper-item> -->
+			<!-- <swiper-item class="tab-content" data-id="0">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="onReachBottomTmp">
+					<block v-if="TabCur==3">
+					<view class="guess-section">
+						<view 
+							v-for="(item, index) in carInfo" :key="index"
+							class="guess-item"
+							@click="navToDetailPage(item)"
+						>
+						<view class="flex justify-between padding-xs ">
+						  <view class="flex-sub padding-xs">
+							  <view class="cu-capsule radius">
+							  	<view class="cu-tag bg-blue">
+							  		{{item.startPlace }}
+							  	</view>
+							  	<view class="cu-tag line-blue">
+							  		{{item.endPlace }}
+							  	</view>
+							  </view>
+						  </view>
+						 
+						  <view class=" padding-xs">
+							  <view v-if="item.status == 2" class="cu-capsule radius">
+								<view  class="cu-tag bg-green">
+									可委托
+								</view>
+								<view class="cu-tag line-green">
+									 <text class="text-price">{{item.price }}</text>
+								</view>
+							  </view>
+							  <view v-else class="cu-capsule radius">
+							  	<view  class="cu-tag bg-red">
+							  		已承运
+							  	</view>
+							  	<view class="cu-tag line-red">
+							  		 <text class="text-price">{{item.price }}</text>
+							  	</view>
+							  </view>
+						  </view>
+						</view>
+						<view class="flex justify-between padding-xs">
+							<view class="flex-sub padding-xs">
+							  <view class="cu-capsule radius">
+								<view class="cu-tag bg-orange">
+									{{item.driver}}
+								</view>
+								<view class="cu-tag line-orange">
+									{{item.carNo}}
+								</view>
+							  </view>
+							</view>
+							<view class=" text-sm padding-xs">
+								<view class=" text-sm padding-xs">
+									<text class="text-gray  text-sm text-right padding-xs-tmp ">{{item.gmtUpdate}}</text>
+								</view>
+							</view>
+						</view>
+						</view>
+						<view v-show="isLoadMore">
+						    <uni-load-more :status="loadStatus" ></uni-load-more>
+						</view>
+					</view>
+				</block>
+				
+				</scroll-view>
+			</swiper-item> -->
+		</swiper>
+	</view>
+</template>
+
+<script>
+	export default {
+		
+		data() {
+			return {
+				titleNViewBackground: '',
+				swiperCurrent: 0,
+				swiperLength: 0,
+				carouselList: [],
+				windowSpuList: [],
+				categoryPickList: [],
+				categoryButtomList: [],
+				salesTop: [],
+				saleInfo: [],
+				buyInfo: [],
+				tranInfo:[],
+				carInfo:[],
+				banner: undefined,
+				isVip: false,
+				pages:1,//页数
+				limit:10 ,//每次取条目数
+				loadStatus:'loading',  //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore:false  ,//是否加载中
+				TabCur: 0,
+				swiperHeight:'',
+				showTran:true
+			};
+		},
+		onShow() {
+			this.showTran = uni.getStorageSync("showTran")
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.pages = 1
+			this.isLoadMore = false
+			this.loadStatus = 'loading'
+			this.loadData()
+		},
+		onLoad(options) {
+			// #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.TabCur = options.TabCur
+			this.loadData();
+		},
+		onPageScroll(e) {
+			//兼容iOS端下拉时顶部漂移
+			if (e.scrollTop >= 0) {
+				this.headerPosition = "fixed";
+			} else {
+				this.headerPosition = "absolute";
+			}
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.pages = 1
+			this.isLoadMore = false
+			this.loadStatus = 'loading'
+			this.loadData()
+		},
+		onReachBottom(){  //上拉触底函数
+		  if(!this.isLoadMore){  //此处判断,上锁,防止重复请求
+				this.isLoadMore=true
+				this.pages += 1
+				this.getIndexSaleData()
+		  }
+		},
+		methods: {
+			numFilter (value) {
+				if(!value){
+					return 0
+				}
+				// 截取当前数据到小数点后两位
+				let realVal = parseFloat(value).toFixed(2)
+				return realVal
+			},
+			tabSelect(e) {
+				if(e.currentTarget.dataset.id){
+					this.TabCur = e.currentTarget.dataset.id;
+				}
+				else{
+					this.TabCur = e.target.current;
+				}
+				this.pages = 1
+				this.isLoadMore = false
+				this.loadData()
+			},
+			//加载商品 ,带下拉刷新和上滑加载
+			async loadData() {
+				uni.setNavigationBarTitle({
+					title:"搜索关键字:"+this.keywords
+				});
+				const that = this
+				uni.showLoading({
+					title: '正在加载',
+					mask:true
+				})
+				if(this.TabCur == 0){
+					that.$api.request('goods', 'getSaleInfo',{
+						keywords: this.keywords,
+						page: this.pages,
+						limit:this.limit
+					}, failres => {
+						that.$api.msg(failres.errmsg)
+						this.isLoadMore = false
+						this.loadStatus = 'nomore'
+						if(this.pages>1){this.pages=1}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data.saleInfo){
+							that.saleInfo = data.saleInfo
+						}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					})
+				}
+				else if(this.TabCur == 1){
+					that.$api.request('buy', 'getBuyListInfo',{
+						keywords: this.keywords,
+						page: this.pages,
+						limit:this.limit
+					}, failres => {
+						that.$api.msg(failres.errmsg)
+						this.isLoadMore = false
+						this.loadStatus = 'nomore'
+						if(this.pages>1){this.pages=1}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data){
+							that.buyInfo = data
+						}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					})
+				}
+				else if(this.TabCur == 2){
+					that.$api.request('tran', 'getTranListInfo',{
+						keywords: this.keywords,
+						page: this.pages,
+						limit:this.limit
+					}, failres => {
+						that.$api.msg(failres.errmsg)
+						this.isLoadMore = false
+						this.loadStatus = 'nomore'
+						if(this.pages>1){this.pages=1}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					}).then(res => {
+						let data = res.data
+						console.log(data.tranInfo)
+						//销售信息
+						if(data.tranInfo){
+							that.tranInfo = data.tranInfo
+						}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					})
+				}
+				else if(this.TabCur == 3){
+					that.$api.request('tran', 'getCarListInfo',{
+						keywords: this.keywords,
+						page: this.pages,
+						limit:this.limit
+					}, failres => {
+						that.$api.msg(failres.errmsg)
+						this.isLoadMore = false
+						this.loadStatus = 'nomore'
+						if(this.pages>1){this.pages=1}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					}).then(res => {
+						let data = res.data
+						console.log(data.carInfo)
+						//销售信息
+						if(data.carInfo){
+							that.carInfo = data.carInfo
+						}
+						uni.hideLoading()
+						uni.stopPullDownRefresh()
+					})
+				}
+				
+			},
+			//详情
+			navToDetailPage(item) {
+				//测试数据没有写id,用title代替
+				let id = item.id;
+				if(this.TabCur == 0){
+					uni.navigateTo({
+						url: `/pageA/product/buydetails?id=${id}`
+					})
+				}
+				else if(this.TabCur == 1){
+					uni.navigateTo({
+						url: `/pageA/product/buydetails?id=${id}`
+					})
+				}
+				// else if(this.TabCur == 2){
+				// 	uni.navigateTo({
+				// 		url: `/pages/tran/tran_detail?id=${id}`
+				// 	})
+				// }
+				// else if(this.TabCur == 3){
+				// 	uni.navigateTo({
+				// 		url: `/pages/tran/car_detail?id=${id}`
+				// 	})
+				// }
+				
+			},
+			onReachBottomTmp(){  //上拉触底函数
+			  if(!this.isLoadMore){  //此处判断,上锁,防止重复请求
+					this.isLoadMore=true
+					this.pages += 1
+					this.getIndexSaleData()
+			  }
+			},
+			getIndexSaleData(){
+				const that = this
+			    var pages=that.pages
+			    var limit=that.limit
+			   
+			    uni.showLoading({
+			    	title: '正在加载',
+					mask:true
+			    })
+				if(this.TabCur == 0){
+					that.$api.request('goods', 'getSaleListInfo', {
+						keywords: this.keywords,
+						page: pages,
+						limit:limit
+					},failres => {
+						that.$api.msg(failres.errmsg)
+						that.isLoadMore=false
+						that.loadStatus = 'nomore'
+						if(that.pages>1){that.pages-=1}
+						uni.hideLoading()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data.saleInfo.length > 0){
+							that.saleInfo = that.saleInfo.concat(data.saleInfo)
+							that.isLoadMore=false
+						}
+						else{
+							if(that.pages>1){that.pages-=1}						
+							that.isLoadMore=true
+							that.loadStatus = 'nomore'
+						}
+						uni.hideLoading()
+					})
+				}
+				else if(this.TabCur == 1){
+					that.$api.request('buy', 'getBuyListInfo', {
+						keywords: this.keywords,
+						page: pages,
+						limit:limit
+					},failres => {
+						that.$api.msg(failres.errmsg)
+						that.isLoadMore=false
+						that.loadStatus = 'nomore'
+						if(that.pages>1){that.pages-=1}
+						uni.hideLoading()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data.length > 0){
+							that.buyInfo = that.buyInfo.concat(data)
+							that.isLoadMore=false
+						}
+						else{
+							if(that.pages>1){that.pages-=1}						
+							that.isLoadMore=true
+							that.loadStatus = 'nomore'
+						}
+						uni.hideLoading()
+					})
+				}
+				else if(this.TabCur == 2){
+					that.$api.request('tran', 'getTranListInfo', {
+						keywords: this.keywords,
+						page: pages,
+						limit:limit
+					},failres => {
+						that.$api.msg(failres.errmsg)
+						that.isLoadMore=false
+						that.loadStatus = 'nomore'
+						if(that.pages>1){that.pages-=1}
+						uni.hideLoading()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data.tranInfo.length > 0){
+							that.tranInfo = that.tranInfo.concat(data.tranInfo)
+							that.isLoadMore=false
+						}
+						else{
+							if(that.pages>1){that.pages-=1}						
+							that.isLoadMore=true
+							that.loadStatus = 'nomore'
+						}
+						uni.hideLoading()
+					})
+				}
+				else if(this.TabCur == 3){
+					that.$api.request('tran', 'getCarListInfo', {
+						keywords: this.keywords,
+						page: pages,
+						limit:limit
+					},failres => {
+						that.$api.msg(failres.errmsg)
+						that.isLoadMore=false
+						that.loadStatus = 'nomore'
+						if(that.pages>1){that.pages-=1}
+						uni.hideLoading()
+					}).then(res => {
+						let data = res.data
+						//销售信息
+						if(data.carInfo.length > 0){
+							that.carInfo = that.carInfo.concat(data.carInfo)
+							that.isLoadMore=false
+						}
+						else{
+							if(that.pages>1){that.pages-=1}						
+							that.isLoadMore=true
+							that.loadStatus = 'nomore'
+						}
+						uni.hideLoading()
+					})
+				}
+			    
+			}
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	page,
+	.content {
+		background: $page-color-base;
+		height: 100%;
+	}
+	.navbar {
+		position: fixed;
+		left: 0;
+		top: var(--window-top);
+		display: flex;
+		width: 100%;
+		height: 80upx;
+		background: #fff;
+		box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
+		z-index: 10;
+
+		.nav-item {
+			flex: 1;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			font-size: 30upx;
+			color: $font-color-dark;
+			position: relative;
+
+			&.current {
+				color: $base-color;
+
+				&:after {
+					content: '';
+					position: absolute;
+					left: 50%;
+					bottom: 0;
+					transform: translateX(-50%);
+					width: 120upx;
+					height: 0;
+					border-bottom: 4upx solid $base-color;
+				}
+			}
+		}
+
+		.p-box {
+			display: flex;
+			flex-direction: column;
+
+			.yticon {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 30upx;
+				height: 14upx;
+				line-height: 1;
+				margin-left: 4upx;
+				font-size: 26upx;
+				color: #888;
+
+				&.active {
+					color: $base-color;
+				}
+			}
+
+			.xia {
+				transform: scaleY(-1);
+			}
+		}
+
+		.cate-item {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			width: 80upx;
+			position: relative;
+			font-size: 44upx;
+
+			&:after {
+				content: '';
+				position: absolute;
+				left: 0;
+				top: 50%;
+				transform: translateY(-50%);
+				border-left: 1px solid #ddd;
+				width: 0;
+				height: 36upx;
+			}
+		}
+	}
+
+	/* 分类 */
+	.cate-mask {
+		position: fixed;
+		left: 0;
+		top: var(--window-top);
+		bottom: 0;
+		width: 100%;
+		background: rgba(0, 0, 0, 0);
+		z-index: 95;
+		transition: .3s;
+
+		.cate-content {
+			width: 630upx;
+			height: 100%;
+			background: #fff;
+			float: right;
+			transform: translateX(100%);
+			transition: .3s;
+		}
+
+		&.none {
+			display: none;
+		}
+
+		&.show {
+			background: rgba(0, 0, 0, .4);
+
+			.cate-content {
+				transform: translateX(0);
+			}
+		}
+	}
+
+	.cate-list {
+		display: flex;
+		flex-direction: column;
+		height: 100%;
+
+		.cate-item {
+			display: flex;
+			align-items: center;
+			height: 90upx;
+			padding-left: 30upx;
+			font-size: 28upx;
+			color: #555;
+			position: relative;
+		}
+
+		.two {
+			height: 64upx;
+			color: #303133;
+			font-size: 30upx;
+			background: #f8f8f8;
+		}
+
+		.active {
+			color: $base-color;
+		}
+	}
+
+	/* 商品列表 */
+	.goods-list {
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 30upx;
+		background: #fff;
+
+		.goods-item {
+			display: flex;
+			flex-direction: column;
+			width: 48%;
+			padding-bottom: 40upx;
+
+			&:nth-child(2n+1) {
+				margin-right: 4%;
+			}
+		}
+
+		.image-wrapper {
+			width: 100%;
+			height: 330upx;
+			border-radius: 3px;
+			overflow: hidden;
+
+			image {
+				width: 100%;
+				height: 100%;
+				opacity: 1;
+			}
+		}
+
+		.title {
+			font-size: $font-lg;
+			color: $font-color-dark;
+			line-height: 80upx;
+		}
+
+		.price-box {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding-right: 10upx;
+			font-size: 24upx;
+			color: $font-color-light;
+		}
+
+		.price {
+			font-size: $font-lg;
+			color: $uni-color-primary;
+			line-height: 1;
+
+			&:before {
+				content: '¥';
+				font-size: 26upx;
+			}
+		}
+		
+	}
+	.guess-section{
+		display:flex;
+		flex-wrap:wrap;
+		padding: 0 30upx;
+		background: #fff;
+		.guess-item{
+			display:flex;
+			flex-direction: column;
+			width: 98%;
+			border-bottom:1px solid #ccc;
+		}
+		.image-wrapper{
+			width: 100%;
+			height: 330upx;
+			border-radius: 3px;
+			overflow: hidden;
+			image{
+				width: 100%;
+				height: 100%;
+				opacity: 1;
+			}
+		}
+		.title{
+			font-size: $font-lg;
+			color: #121212;
+		}
+		.price-orther{
+			font-size: $font-sm;
+			color:$font-color-base;
+		}
+		.price{
+			font-size: 64rpx;
+			color: #39b54a;
+			line-height: 1;
+			padding-right: 10upx;
+		}
+		
+		.goods1{
+			font-size: $font-sm;
+			color: $font-color-base;
+		}
+		.goods2{
+			font-size: $font-sm;
+			color: $font-color-base;
+			padding-left: 10%;
+		}
+		.goods3{
+			font-size: $font-sm;
+			color: $font-color-base;
+			padding-left: 10%;
+		}
+		.goods4{
+			font-size: $font-sm;
+			color: #ff5500;
+		}
+		.goods5{
+			font-size: $font-sm;
+			color: $font-color-base;
+		}
+		.view-item{
+			width: 100%;
+			// line-height: 40upx;
+			padding-top: 10upx;
+		}
+		.confirm-btn {
+			margin-left: 20%;
+		}
+		.date-time {
+			margin-left: 30%;
+		}
+		.padding-xs-tmp {
+			padding: 15upx 10upx 10upx 10upx;
+		}
+		
+	}
+	.swiper-box {
+		height: calc(100% - 40px);
+	}
+	.list-scroll-content {
+		height: 100%;
+	}
+	.uni-swiper-item {
+		height: auto;
+	}
+	/* 销售信息 */
+	.introduce-section {
+		background: #fff;
+		padding: 20upx 30upx;
+		padding-bottom: 100upx;
+		.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;
+		}
+		.price-box {
+			display: flex;
+			align-items: baseline;
+			height: 70upx;
+			padding: 10upx 0;
+			font-size: 26upx;
+			color: $uni-color-primary;
+		}
+	
+		.price {
+			font-size: $font-lg + 2upx;
+		}
+	
+		.m-price {
+			margin: 0 12upx;
+			color: $font-color-light;
+			text-decoration: line-through;
+		}
+	
+		.coupon-tip {
+			align-items: center;
+			padding: 4upx 10upx;
+			background: $uni-color-primary;
+			font-size: $font-sm;
+			color: #fff;
+			border-radius: 6upx;
+			line-height: 1;
+			transform: translateY(-4upx);
+		}
+	
+		.bot-row {
+			display: flex;
+			align-items: center;
+			height: 50upx;
+			font-size: $font-sm;
+			color: $font-color-light;
+	
+			view {
+				flex: 1;
+			}
+		}
+	}
+</style>

+ 55 - 2
pages.json

@@ -18,7 +18,7 @@
 				},
 				
 				{
-					"pagePath": "pages/buy/transaction",
+					"pagePath": "pages/business/business",
 					"iconPath":"static/img/jiaoyi.png",
 					"selectedIconPath":"static/img/jiaoyi_check.png",
 					"text": "交易"
@@ -298,6 +298,33 @@
 		}
 		
         
+        ,{
+            "path" : "pages/buy/purchase/purchase",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/buy/purchase/purchase",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/business/business",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "交易",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"subpackages": [
 			{
@@ -345,12 +372,24 @@
 						"navigationBarTitleText": "搜索"
 					}
 				},
+				{
+					"path": "product/lookup",
+					"style": {
+						"navigationBarTitleText": "搜索"
+					}
+				},
 				{
 					"path": "product/detail",
 					"style": {
 						"navigationBarTitleText": "销售详情"
 					}
 				}, 
+				{
+					"path": "product/buydetails",
+					"style": {
+						"navigationBarTitleText": "详情"
+					}
+				}, 
 				{
 					"path": "product/detail_buy",
 					"style": {
@@ -366,13 +405,27 @@
 					"style": {
 						"navigationBarTitleText": "交易信息"
 					}
-				}, {
+				},
+				{
+					"path": "product/business_buy",
+					"style": {
+						"navigationBarTitleText": "订单"
+					}
+				},
+				{
 				    "path" : "product/list",
 				    "style" : {
 						"enablePullDownRefresh": true,
 						"navigationBarTitleText": "销售信息"
 					}
 				},
+				{
+				    "path" : "product/querylist",
+				    "style" : {
+						"enablePullDownRefresh": true,
+						"navigationBarTitleText": "销售信息"
+					}
+				},
 				{
 				    "path" : "product/detail_upload",
 				    "style" :                                                                                    

+ 632 - 0
pages/business/business.vue

@@ -0,0 +1,632 @@
+<template>
+	<view>
+		<view>	
+			<picker @change="locationChange" :value="location" :range="locationType">
+				<view class="picker">
+					{{location>-1?locationType[location]:'请选择'}}
+				</view>
+			</picker>
+		</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>
+				<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 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>&nbsp;
+						<view>
+							<text class="price-tip">¥</text>
+							<text class="price">{{item.basis}}</text>
+							<text class="price-tip">元/吨</text>
+						</view>
+					</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>
+		<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>
+</template>
+
+<script>
+	export default {
+		name: "business",
+		data() {
+			return {
+				PageCur: "buy",
+				buyInfo: [],
+				pages: 1, //页数
+				limit: 10, //每次取条目数
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
+				showTran: true,
+				scrollTop: 0,
+				categoryList: [{
+					title: '我要买粮',
+					id: '0'
+				}, {
+					title: '我要卖粮',
+					id: '1'
+				}],
+				TabCur: 0,
+				current: 1,
+				location: 0,
+				locationType: ['黑龙江省', '河南省', '山东省', '安徽省', '吉林省', '河北省', '江苏省', '内蒙古自治区', '四川省', '湖南省', '湖北省', '辽宁省',
+					'江西省', '云南省', '新疆维吾尔自治区', '山西省', '广西壮族自治区', '陕西省', '广东省', '甘肃省', '重庆市', '贵州省', '浙江省', '福建省',
+					'宁夏回族自治区', '天津市', '海南省', '青海省', '西藏自治区', '上海市', '北京市'
+				]
+			}
+		},
+		onShow() {
+			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();
+		},
+		onPageScroll(e) {
+			this.scrollTop = e.scrollTop;
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.pages = 1
+			this.isLoadMore = false
+			this.loadStatus = 'loading'
+			this.loadData()
+		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.pages += 1
+				this.getIndexBuyData()
+			}
+		},
+		methods: {
+			naviageToPage(page) {
+				page = page + this.TabCur
+				uni.navigateTo({
+					url: page,
+					fail() {
+						uni.switchTab({
+							url: page
+						})
+					}
+				})
+			},
+			locationChange(e) {
+				this.location = e.detail.value
+			},
+			tabSelect(e) {
+				this.TabCur = e.currentTarget.dataset.id;
+				this.category = this.TabCur
+				this.pages = 1
+				this.loadData()
+			},
+			fabu() {
+				uni.navigateTo({
+					url: `/pageB/trust/trust`
+				})
+			},
+			//加载商品 ,带下拉刷新和上滑加载
+			async loadData(type = 'add', loading) {
+				const that = this
+				uni.showLoading({
+					title: '正在加载',
+					mask: true
+				})
+				var param1 = ''
+				var param2 = ''
+				if (that.TabCur == 0) {
+					param1 = 'integral'
+					param2 = 'getIndexData'
+				} else {
+					param1 = 'buy'
+					param2 = 'getBuyListInfo'
+				}
+				console.log(param1, param2)
+				that.$api.request(param1, param2, {
+					page: 1,
+					limit: 10
+				}, failres => {
+					that.$api.msg(failres.errmsg)
+					that.isLoadMore = false
+					that.loadStatus = 'nomore'
+					if (that.pages > 1) {
+						that.pages -= 1
+					}
+					uni.hideLoading()
+				}).then(res => {
+					let data = null
+					if (that.TabCur == 0) {
+						data = res.data.saleInfo
+					} else {
+						data = res.data
+					}
+					uni.stopPullDownRefresh()
+
+					//采购信息
+					if (data.length > 0) {
+						that.buyInfo = data
+						that.isLoadMore = false
+					} else {
+						if (that.pages > 1) {
+							that.pages -= 1
+						}
+						that.isLoadMore = true
+						that.loadStatus = 'nomore'
+					}
+					uni.hideLoading()
+				})
+			},
+			//详情
+			navToDetailPage(item) {
+				let id = item.id;
+				if (item.price === 0) {
+					this.contactUs();
+				} else {
+					if (this.TabCur == 0) {
+						uni.navigateTo({
+							url: `/pageA/product/detail?id=${id}`
+						})
+					} else {
+						uni.navigateTo({
+							url: `/pageA/product/detail_buy?id=${id}`
+						})
+					}
+
+				}
+			},
+			contactUs() {
+				const that = this
+				uni.makePhoneCall({
+					// 手机号
+					phoneNumber: '15145408888',
+					// 成功回调
+					success: (res) => {
+						console.log('调用成功!')
+					},
+					// 失败回调
+					fail: (res) => {
+						console.log('调用失败!')
+					}
+				});
+			},
+			getIndexBuyData() {
+				const that = this
+				var pages = that.pages
+				var limit = that.limit
+
+				uni.showLoading({
+					title: '正在加载',
+					mask: true
+				})
+				that.$api.request('buy', 'getBuyListInfo', {
+					page: pages,
+					limit: limit
+				}, failres => {
+					that.$api.msg(failres.errmsg)
+					that.isLoadMore = false
+					that.loadStatus = 'nomore'
+					if (that.pages > 1) {
+						that.pages -= 1
+					}
+					uni.hideLoading()
+				}).then(res => {
+					let data = res.data
+					//采购信息
+					if (data.length > 0) {
+						that.buyInfo = that.buyInfo.concat(data)
+						that.isLoadMore = false
+					} else {
+						if (that.pages > 1) {
+							that.pages -= 1
+						}
+						that.isLoadMore = true
+						that.loadStatus = 'nomore'
+					}
+					uni.hideLoading()
+				})
+			}
+
+		}
+	}
+</script>
+
+<style>
+	page,
+	.content {
+		// background: $page-color-base;
+	}
+
+	.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);
+	}
+
+	.title-tip {
+		color: #E63113;
+		text-align: right;
+	}
+
+	.tag-bule {
+		background: #CDE7FB;
+		color: #0B4572;
+	}
+
+	.tag-green {
+		background: #C6F7BC;
+		color: #065112;
+	}
+
+	.tag-yellow {
+		background: #FBF4B1;
+		color: #5C4409;
+	}
+
+	.tag {
+		padding: 5px;
+		display: inline-flex;
+		font-size: 22rpx;
+		margin: 3px;
+	}
+
+	.text-white {
+		color: #fff;
+	}
+
+	.text-white text {
+		position: relative;
+		z-index: 2;
+		background: linear-gradient(45deg, #3DC146, #B2D612);
+		padding: 5px 10px;
+		border-radius: 38rpx;
+	}
+
+	.guess-section {
+		padding-bottom: 100upx;
+		display: flex;
+		flex-wrap: wrap;
+		padding: 0 30upx;
+		background: #fff;
+
+		.guess-item {
+			display: flex;
+			flex-direction: column;
+			width: 98%;
+			border-bottom: 1px solid #ccc;
+		}
+
+		.image-wrapper {
+			width: 100%;
+			height: 330upx;
+			border-radius: 3px;
+			overflow: hidden;
+
+			image {
+				width: 100%;
+				height: 100%;
+				opacity: 1;
+			}
+		}
+
+		.title {
+			font-size: $font-lg;
+			color: #121212;
+		}
+
+		.price-orther {
+			font-size: $font-sm;
+			color: $font-color-base;
+		}
+
+		.price {
+			font-size: 64rpx;
+			color: #39b54a;
+			line-height: 1;
+			padding-right: 10upx;
+		}
+
+		.goods1 {
+			font-size: $font-sm;
+			color: $font-color-base;
+		}
+
+		.goods2 {
+			font-size: $font-sm;
+			color: $font-color-base;
+			padding-left: 10%;
+		}
+
+		.goods3 {
+			font-size: $font-sm;
+			color: $font-color-base;
+			padding-left: 10%;
+		}
+
+		.goods4 {
+			font-size: $font-sm;
+			color: #ff5500;
+		}
+
+		.goods5 {
+			font-size: $font-sm;
+			color: $font-color-base;
+		}
+
+		.view-item {
+			width: 100%;
+			// line-height: 40upx;
+			padding-top: 10upx;
+		}
+
+		.confirm-btn {
+			margin-left: 20%;
+		}
+
+		.date-time {
+			margin-left: 30%;
+		}
+
+		.padding-xs-tmp {
+			padding: 15upx 10upx 10upx 10upx;
+		}
+	}
+
+	.navbar {
+		position: fixed;
+		left: 0;
+		top: var(--window-top);
+		display: flex;
+		width: 100%;
+		height: 80upx;
+		background: #fff;
+		box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
+		z-index: 10;
+
+		.nav-item {
+			flex: 1;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			font-size: 30upx;
+			color: $font-color-dark;
+			position: relative;
+
+			&.current {
+				color: $base-color;
+
+				&:after {
+					content: '';
+					position: absolute;
+					left: 50%;
+					bottom: 0;
+					transform: translateX(-50%);
+					width: 120upx;
+					height: 0;
+					border-bottom: 4upx solid $base-color;
+				}
+			}
+		}
+
+		.p-box {
+			display: flex;
+			flex-direction: column;
+
+			.yticon {
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				width: 30upx;
+				height: 14upx;
+				line-height: 1;
+				margin-left: 4upx;
+				font-size: 26upx;
+				color: #888;
+
+				&.active {
+					color: $base-color;
+				}
+			}
+
+			.xia {
+				transform: scaleY(-1);
+			}
+		}
+
+		.cate-item {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
+			width: 80upx;
+			position: relative;
+			font-size: 44upx;
+
+			&:after {
+				content: '';
+				position: absolute;
+				left: 0;
+				top: 50%;
+				transform: translateY(-50%);
+				border-left: 1px solid #ddd;
+				width: 0;
+				height: 36upx;
+			}
+		}
+	}
+
+	/* 分类 */
+	.cate-mask {
+		position: fixed;
+		left: 0;
+		top: var(--window-top);
+		bottom: 0;
+		width: 100%;
+		background: rgba(0, 0, 0, 0);
+		z-index: 95;
+		transition: .3s;
+
+		.cate-content {
+			width: 630upx;
+			height: 100%;
+			background: #fff;
+			float: right;
+			transform: translateX(100%);
+			transition: .3s;
+		}
+
+		&.none {
+			display: none;
+		}
+
+		&.show {
+			background: rgba(0, 0, 0, .4);
+
+			.cate-content {
+				transform: translateX(0);
+			}
+		}
+	}
+
+	.cate-list {
+		display: flex;
+		flex-direction: column;
+		height: 100%;
+
+		.cate-item {
+			display: flex;
+			align-items: center;
+			height: 90upx;
+			padding-left: 30upx;
+			font-size: 28upx;
+			color: #555;
+			position: relative;
+		}
+
+		.two {
+			height: 64upx;
+			color: #303133;
+			font-size: 30upx;
+			background: #f8f8f8;
+		}
+
+		.active {
+			color: $base-color;
+		}
+	}
+
+	/* 销售信息 */
+	.introduce-section {
+		background: #fff;
+		padding: 20upx 30upx;
+		padding-bottom: 100upx;
+
+		.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;
+		}
+
+		.price-box {
+			display: flex;
+			align-items: baseline;
+			height: 70upx;
+			padding: 10upx 0;
+			font-size: 26upx;
+			color: $uni-color-primary;
+		}
+
+		.price {
+			font-size: $font-lg + 2upx;
+		}
+
+		.m-price {
+			margin: 0 12upx;
+			color: $font-color-light;
+			text-decoration: line-through;
+		}
+
+		.coupon-tip {
+			align-items: center;
+			padding: 4upx 10upx;
+			background: $uni-color-primary;
+			font-size: $font-sm;
+			color: #fff;
+			border-radius: 6upx;
+			line-height: 1;
+			transform: translateY(-4upx);
+		}
+
+		.bot-row {
+			display: flex;
+			align-items: center;
+			height: 50upx;
+			font-size: $font-sm;
+			color: $font-color-light;
+
+			view {
+				flex: 1;
+			}
+		}
+	}
+</style>

+ 22 - 0
pages/buy/purchase/purchase.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä