浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 3 年之前
父节点
当前提交
f64d60cfb3
共有 5 个文件被更改,包括 90 次插入99 次删除
  1. 2 1
      pages.json
  2. 1 1
      pages/public/login.vue
  3. 2 2
      pages/public/login_account_number.vue
  4. 79 51
      pages/sale/information.vue
  5. 6 44
      pages/sale/newsinfo.vue

+ 2 - 1
pages.json

@@ -120,7 +120,8 @@
 				"navigationStyle": "custom",
 				"app-plus": {
 					"titleNView": false,
-					"animationType": "slide-in-bottom"
+					"animationType": "slide-in-bottom",
+					"softinputMode": "adjustPan"
 				}
 			}
 		},

+ 1 - 1
pages/public/login.vue

@@ -11,8 +11,8 @@
 				<image v-if='phone!=""' @click='phone=""' class='close' src='../../static/img/login/guanbi@2x.png'></image>
 			</view>
 			<button @click='gocode' :class='codestatus?"active":""' class='verificationCode'>获取验证码</button>
+			<button @click='goregister' class='verificationCode active'>手机号一键注册</button>
 			<view @click='gonumber' style='text-align:center;color:#6A6A6A;margin-top:10px;'>使用账号密码登录</view>
-		    <button @click='goregister' class='register'>手机号一键注册</button>
 		</view>
 		<view v-if="loginType === 'phone'" class="register-section">
 			还没有账号?

+ 2 - 2
pages/public/login_account_number.vue

@@ -16,11 +16,11 @@
 				<image v-if='password!=""' @click='password=""' class='close2' src='../../static/img/login/guanbi@2x.png'></image>
 			</view>
 			<button :class='phone!=""&&password!=""?"active":""' @click='passlogin' class='verificationCode'>登录</button>
+			<button @click='goregister' class='verificationCode active'>手机号一键注册</button>
 			<view class='flex' style='color:#6A6A6A;margin-top:10px;'>
 				<view style='flex:1;text-align:center;border-right:1px solid #E8E9ED;' @click="forgetpass()">忘记密码</view>
 				<view @click='gocode' style='flex:1;text-align:center;'>验证码登录</view>
 			</view>
-		    <button @click='goregister' class='register'>手机号一键注册</button>
 		</view>
 		</view>
 	</view>
@@ -921,7 +921,7 @@ username: "13333333333"}).then(res1 => {
 		color:#fff;
 	}
 	.register{
-		position:absolute;
+		/* position:absolute; */
 		bottom:20px;
 		left:50%;
 		transform: translateX(-50%);

+ 79 - 51
pages/sale/information.vue

@@ -11,8 +11,8 @@
 		<!-- 头部轮播 -->
 		<view class="carousel-section">
 			<swiper class="screen-swiper header-swiper" ::class="dotStyle?'square-dot':'round-dot'"
-				:indicator-dots="true" :circular="true" :autoplay="true" interval="5000"
-				@change="swiperChange" indicator-color="#8799a3" indicator-active-color="#0081ff">
+				:indicator-dots="true" :circular="true" :autoplay="true" interval="5000" @change="swiperChange"
+				indicator-color="#8799a3" indicator-active-color="#0081ff">
 				<swiper-item class="swiper-item" v-for="(item,index) in carouselList" :key="index"
 					:class="cardCur==index?'text-white':''" @click="naviageToPage(item.url)">
 					<image :src="item.imgUrl"></image>
@@ -31,8 +31,8 @@
 				<view class='title'>工厂价格</view>
 				<view style='color:#B2B3BB;' @click='more("/pages/sale/plant")'>更多</view>
 			</view>
-			<swiper class="screen-swiper header-swiper" :autoplay="true" interval="3000" duration="500" :circular="true" :acceleration="true"
-				style="min-height: 380px;">
+			<swiper class="screen-swiper header-swiper" :autoplay="true" interval="3000" duration="500" :circular="true"
+				:acceleration="true" style="min-height: 380px;">
 				<swiper-item class="" v-for="(item1,index) in factoryPriceData.list" :key="index">
 					<view class='guess-section-wrap-item clearfix' v-for='(item,index1) in item1' :key="index1">
 						<view class='factory'>{{item.factory}}</view>
@@ -58,9 +58,10 @@
 				<view style='color:#B2B3BB;' @click='more("/pages/sale/portprice")'>更多</view>
 			</view>
 			<!-- <uni-notice-bar scrollable="true" single="true" background-color="white" :portList="portList" ></uni-notice-bar> -->
-				<swiper class="screen-swiper header-swiper-port" :autoplay="true" interval="0" duration="60000" :circular="true" :acceleration="true">
-					<swiper-item class="" v-for="(item1,index) in portPriceData.list" :key="index">
-						<view class='guess-section-wrap-item clearfix' v-for='(item,index1) in item1' :key="index1">
+			<swiper class="screen-swiper header-swiper-port" :autoplay="true" interval="0" duration="60000"
+				:circular="true" :acceleration="true">
+				<swiper-item class="" v-for="(item1,index) in portPriceData.list" :key="index">
+					<view class='guess-section-wrap-item clearfix' v-for='(item,index1) in item1' :key="index1">
 						<view class='factory'>{{item.port}}</view>
 						<view class='wrap'>{{item.goodsName}}</view>
 						<view class='price'>
@@ -75,19 +76,19 @@
 							<text v-if='item.comparePrice==0' class='yesterday'>-</text>
 						</view>
 						<view style='color:#B2B3BB;' class='flex'>
-							<view style='margin-right:10px;'>
+							<view class="port-number-style">
 								<image style='width:11px;height:11px;' src='../../static/img/homepage/water@3x.png'>
 								</image>
 								<={{item.waterContent}} </view>
-									<view>
+									<view class="port-number-style">
 										<image style='width:11px;height:11px;'
 											src='../../static/img/homepage/unitweight@3x.png'></image>
 										>={{item.bulkDensity}}
 									</view>
-									</view>
+							</view>
 						</view>
-					</swiper-item>
-				</swiper>
+				</swiper-item>
+			</swiper>
 		</view>
 		<view class="guess-section-wrap1">
 			<view style='padding:15px;' class='flex justify-between'>
@@ -163,7 +164,7 @@
 				infoList1: [],
 				statusBarHeight: "height:",
 				factoryPriceData: {},
-				portPriceData:{}
+				portPriceData: {}
 			};
 		},
 		onReady() {},
@@ -256,7 +257,9 @@
 			this.loadData()
 			var userInfo = uni.getStorageSync("userInfo")
 			var that = this
-			this.$api.doRequest('get', '/salePlanInfo/getTips', {phone:userInfo.phone}).then(res => {
+			this.$api.doRequest('get', '/salePlanInfo/getTips', {
+				phone: userInfo.phone
+			}).then(res => {
 				if (res.data.data) {
 					let name = 'myTip';
 					let value = res.data.data.myTip;
@@ -264,10 +267,10 @@
 						name,
 						value
 					});
-					if(value != 0){
+					if (value != 0) {
 						uni.setTabBarBadge({
-							index:3,
-							text:value+""
+							index: 3,
+							text: value + ""
 						})
 					}
 					name = 'taskTip';
@@ -308,47 +311,64 @@
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		methods: {
-			makeportScrollData(valList) {
-				debugger
+			// makeportScrollData(valList) {
+			// 	console.log(valList)
+			// 	let _rowCount = valList.length;
+			// 	let _pageSize = 2
+			// 	let _newArray = []
+			// 	if (_rowCount == null || _rowCount == "") {
+			// 		this.portPriceData.totalPage = 0;
+			// 	} else {
+			// 		if (_pageSize != 0 && _rowCount % _pageSize == 0) {
+			// 			this.portPriceData.totalPage = parseInt(_rowCount / _pageSize)
+			// 		}
+			// 		if (_pageSize != 0 && _rowCount % _pageSize != 0) {
+			// 			this.portPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
+			// 		}
+			// 	}
+			// 	for (let i = 0; i < valList.length; i += 2) {
+			// 		_newArray.push(valList.slice(i, i + 2))
+			// 	}
+			// 	this.portPriceData.list = _newArray
+			// },
+			makeScrollData(valList, size) {
 				console.log(valList)
 				let _rowCount = valList.length;
-				let _pageSize = 2
+				let _pageSize = size
 				let _newArray = []
 				if (_rowCount == null || _rowCount == "") {
-					this.portPriceData.totalPage = 0;
+					if (size == 8) {
+
+						this.factoryPriceData.totalPage = 0;
+					} else {
+						this.portPriceData.totalPage = 0;
+					}
 				} else {
 					if (_pageSize != 0 && _rowCount % _pageSize == 0) {
-						this.portPriceData.totalPage = parseInt(_rowCount / _pageSize)
+						if (size == 8) {
+							this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize)
+						} else {
+							this.portPriceData.totalPage = parseInt(_rowCount / _pageSize)
+						}
 					}
 					if (_pageSize != 0 && _rowCount % _pageSize != 0) {
-						this.portPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
+						if (size == 8) {
+
+							this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
+						} else {
+							this.portPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
+						}
 					}
 				}
-				for (let i = 0; i < valList.length; i += 2) {
-					_newArray.push(valList.slice(i, i + 2))
+				for (let i = 0; i < valList.length; i += size) {
+					_newArray.push(valList.slice(i, i + size))
 				}
-				this.portPriceData.list = _newArray
-			},
-			makeScrollData(valList) {
-				debugger
-				console.log(valList)
-				let _rowCount = valList.length;
-				let _pageSize = 8
-				let _newArray = []
-				if (_rowCount == null || _rowCount == "") {
-					this.factoryPriceData.totalPage = 0;
+				if (size == 8) {
+					this.factoryPriceData.list = _newArray
 				} else {
-					if (_pageSize != 0 && _rowCount % _pageSize == 0) {
-						this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize)
-					}
-					if (_pageSize != 0 && _rowCount % _pageSize != 0) {
-						this.factoryPriceData.totalPage = parseInt(_rowCount / _pageSize) + 1;
-					}
+					this.portPriceData.list = _newArray
 				}
-				for (let i = 0; i < valList.length; i += 8) {
-					_newArray.push(valList.slice(i, i + 8))
-				}
-				this.factoryPriceData.list = _newArray
+
 			},
 			more(url) {
 				console.log(url)
@@ -421,7 +441,7 @@
 				}).then(res => {
 					let data = res.data
 					that.plantList = data
-					that.makeScrollData(that.plantList)
+					that.makeScrollData(that.plantList, 8)
 					uni.hideLoading()
 				})
 				// 港口价格
@@ -440,7 +460,7 @@
 				}).then(res => {
 					let data = res.data
 					that.portList = data
-					that.makeportScrollData(that.portList)
+					that.makeScrollData(that.portList, 2)
 					uni.hideLoading()
 				})
 				// 新闻内容
@@ -588,8 +608,8 @@
 				uni.showLoading({
 					title: '正在加载',
 				})
-				var pages=that.pages
-				var limit=that.limit
+				var pages = that.pages
+				var limit = that.limit
 				that.$api.request('news', 'getNewsInfo', {
 					category: 2,
 					page: 1,
@@ -870,7 +890,8 @@
 		width: 38vw;
 		background: #F9F9FA;
 		padding: 10px;
-		margin: 10px;
+		
+		margin: 20rpx;
 		border-radius: 3px;
 		// width:50%;
 	}
@@ -1132,7 +1153,14 @@
 		padding-right: 40rpx;
 		margin-bottom: 26rpx;
 	}
-	.header-swiper-port{
+
+	.header-swiper-port {
 		height: 120px;
+		min-height: 120px;
+	}
+	.port-number-style{
+		display: flex;
+		align-items: center;
+		margin-right: 14rpx;
 	}
 </style>

+ 6 - 44
pages/sale/newsinfo.vue

@@ -125,7 +125,7 @@
 				}, 1000);
 			},
 			computed: {
-				...mapState(['hasLogin', 'userInfo'])
+				...mapState(['hasLogin', 'userInfo']),
 			},
 			methods: {
 				
@@ -209,55 +209,15 @@
 					})
 				},
 				getIndexSaleData() {
-					// const that = this
-					// var pages = that.pages
-					// var limit = that.limit
-					// uni.showLoading({
-					// 	title: '正在加载'
-					// })
-					// that.$api.request('integral', 'getIndexSaleData', {
-					// 	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'
-					// 	}
-					// 	if(data.saleInfo.length < that.limit){
-					// 		if (that.pages > 1) {
-					// 			that.pages -= 1
-					// 		}
-					// 		that.isLoadMore = true
-					// 		that.loadStatus = 'nomore'
-					// 	}
-					// 	uni.hideLoading()
-					// })
 					const that = this
 					var pages=that.pages
 					var limit=that.limit
 								   
 					uni.showLoading({
-						title: '正在加载',
-						mask:true
+						title: '正在加载'
 					})
 					that.$api.request('news', 'getNewsInfo', {
-						category:this.category,
+						category:2,
 						page: pages,
 						limit:limit
 					},failres => {
@@ -270,7 +230,9 @@
 						let data = res.data
 						if(data.length > 0){
 							for(var k =0;k<data.length;k++){
-								data[k].gmtUpdate=formatDate(Date.parse(data[k].gmtUpdate))
+								if(data[k].title.length > 20){
+									data[k].title = data[k].title.substring(0,20) + "..."
+								}
 							}
 							that.newsInfo = that.newsInfo.concat(data)
 							that.isLoadMore=false