Browse Source

no message

featrue/v4.3
xpz2018 5 years ago
parent
commit
cc9ffe0247
8 changed files with 93 additions and 99 deletions
  1. 4
      pages/agent/agent-item/index.wxml
  2. 8
      pages/agent/edit/index.js
  3. 4
      pages/agent/factory/index.wxml
  4. 47
      pages/article/allNewInfo/index.js
  5. 47
      pages/article/allNewInfo/index.wxml
  6. 52
      pages/article/newInfo/index.wxml
  7. 21
      pages/article/newInfo/index.wxss
  8. 9
      pages/formate.wxs

4
pages/agent/agent-item/index.wxml

@ -79,13 +79,13 @@
function priceItem(item, kg) {
if(kg){
if(item.publicSubsidies && Number(item.publicSubsidies) > 0){
let price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
var price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
return (parseFloat(price)).toFixed(3) + '元/KG'
}
return (parseFloat(item.unitPrice)).toFixed(3) + '元/KG'
} else {
if(item.publicSubsidies && Number(item.publicSubsidies) > 0){
let price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
var price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
return (parseFloat(price) * 1000).toFixed(1) + '元/吨'
}
return (parseFloat(item.unitPrice) * 1000).toFixed(1) + '元/吨'

8
pages/agent/edit/index.js

@ -53,7 +53,6 @@ Page({
//异常回调
})
getFactoryPriceDetail(options.id).then(result => {
//成功回调
this.data.cateList = []
if(result.data.paperCategoryList && result.data.paperCategoryList.length){
for (let index = 0; index < result.data.paperCategoryList.length; index++) {
@ -62,7 +61,12 @@ Page({
if(options.unitPrice){
this.data.form.unitPrice = Number(options.unitPrice)
} else {
this.data.form.unitPrice = element.unitPrice
if(element.publicSubsidies && Number(element.publicSubsidies) > 0){
this.data.form.publicSubsidies = element.publicSubsidies
this.data.form.unitPrice = math.plus(element.unitPrice, element.publicSubsidies)
} else {
this.data.form.unitPrice = element.unitPrice
}
}
this.data.cateName = element.categoryName
}

4
pages/agent/factory/index.wxml

@ -182,13 +182,13 @@
function priceItem(item, kg) {
if(kg){
if(item.publicSubsidies && Number(item.publicSubsidies) > 0){
let price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
var price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
return (parseFloat(price)).toFixed(3) + '元/KG'
}
return (parseFloat(item.unitPrice)).toFixed(3) + '元/KG'
} else {
if(item.publicSubsidies && Number(item.publicSubsidies) > 0){
let price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
var price = parseFloat(item.unitPrice) + parseFloat(item.publicSubsidies)
return (parseFloat(price) * 1000).toFixed(1) + '元/吨'
}
return (parseFloat(item.unitPrice) * 1000).toFixed(1) + '元/吨'

47
pages/article/allNewInfo/index.js

@ -1,8 +1,6 @@
const util = require('../../../utils/util')
const app = getApp()
import {
getPaperMillOfInformationList
} from "../../api/ztb"
import { getPaperMillOfInformationList } from "../../api/ztb"
Page({
@ -10,7 +8,7 @@ Page({
* 页面的初始数据
*/
data: {
height: app.globalData.safeFragmentHeight - 190,
height: app.globalData.fragmentHeight - 80,
safeBottom: app.globalData.safeBottom,
orderList: [],
tableSgin: null,
@ -30,11 +28,9 @@ Page({
this.setData({
StatusBar: app.globalData.StatusBar || 40,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
height: app.globalData.fragmentHeight - 80
})
this.getPaperMillOfInformationListFct({
queryWay: 1
})
this.getPaperMillOfInformationListFct({ queryWay: 1 })
},
toPage: function (e) {
if (e.currentTarget.id == 'toqb') {
@ -53,49 +49,36 @@ Page({
changeTable: function (e) {
var a = e.currentTarget.id
if (e.currentTarget.id === this.data.tableSgin) {
this.setData({
tableSgin: null
})
this.setData({ tableSgin: null })
} else {
this.setData({
tableSgin: e.currentTarget.id
})
this.setData({ tableSgin: e.currentTarget.id })
}
},
getPaperMillOfInformationListFct(model) {
this.setData({
loading: true
})
this.setData({ loading: true })
wx.showLoading({ title: '加载中' })
getPaperMillOfInformationList(model).then(res => {
this.setData({
orderList: res.data
})
this.setData({
loading: false
})
this.setData({ orderList: res.data, loading: false })
wx.hideLoading()
}).catch((e) => {
wx.hideLoading()
})
},
changeSort:function(){
if(this.data.pximg=='/assets/info/px-mr.png'){
this.setData({
pximg:'/assets/info/px-sx.png'
})
this.setData({ pximg:'/assets/info/px-sx.png' })
this.data.querFrom.priceSort=1
this.getPaperMillOfInformationListFct(this.data.querFrom)
return
}
if(this.data.pximg=='/assets/info/px-sx.png'){
this.setData({
pximg:'/assets/info/px-jx.png'
})
this.setData({ pximg:'/assets/info/px-jx.png' })
this.data.querFrom.priceSort=0
this.getPaperMillOfInformationListFct(this.data.querFrom)
return
}
if(this.data.pximg=='/assets/info/px-jx.png'){
this.setData({
pximg:'/assets/info/px-mr.png'
})
this.setData({ pximg:'/assets/info/px-mr.png' })
this.data.querFrom.priceSort=0
this.getPaperMillOfInformationListFct(this.data.querFrom)
return

47
pages/article/allNewInfo/index.wxml

@ -3,17 +3,16 @@
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">全部纸厂</view>
</cu-custom>
<view style="width:100%;height:15rpx;"></view>
<view class="zt">
<view class="flex flex-justify" style="width:100%;height:80rpx;lineheight:80rpx;font-size: 28px;color: rgba(0,0,0,0.65);letter-spacing: 0;padding: 0rpx 40rpx 0rpx 40rpx;">
<view class="text-df text-gray" style="flex:1.2;overflow: hidden;">纸厂名称</view>
<view class="text-df text-gray" style="flex:1;text-align: center" bindtap="changeSort">价格涨跌<image style="width:30rpx;height:30rpx" src="{{pximg}}"></image>
<view class="flex flex-justify" style="width:100%;height:80rpx;font-size: 28px;color: rgba(0,0,0,0.65);letter-spacing: 0;padding: 0rpx 32rpx;">
<view class="text-df text-gray" style="flex:1;overflow: hidden;">纸厂名称</view>
<view class="text-df text-gray flex flex-center" style="flex:1;text-align: center" bindtap="changeSort">
<view>价格涨跌</view>
<image style="width:30rpx;height:30rpx" src="{{pximg}}"></image>
</view>
<view class="text-df text-gray" style="flex:1;text-align: center">纸厂排队</view>
<view class="text-df text-gray" style="flex:1;text-align: center">最近扣点</view>
<view class="text-df text-gray" style="flex:0.5;text-align: center"></view>
<view class="text-df text-gray" style="flex:0.8;text-align:flex-start">最近扣点</view>
</view>
<scroll-view scroll-y="true" style='max-height:1050rpx;width:100%;background-color:white'>
<scroll-view scroll-y="true" style='height:{{height}}rpx;width:100%;background-color:white'>
<view class="img-nodata" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" />
<image class="onDataImg" src="/assets/info/noData.png" wx:else></image>
@ -24,21 +23,26 @@
<!-- <view class="bg-white" wx:else> -->
<view class="bg-white">
<view wx:for="{{orderList}}" wx:key="index" class="tableStyle">
<view class="flex flex-justify" style="border-top:2rpx solid #f3f3f3;margin-top:20rpx;padding: 0rpx 40rpx 0rpx 40rpx;"
id="toFactoryDetails" data-factoryId="{{item.paperMillId}}" catchtap="toPage">
<!-- <text class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}%</text> -->
<view class="text-df text-balck" style="flex:1.2" style="position: relative;">{{item.shortName}}<view wx:if="{{item.hasFollowed==true}}" class="yesAttention">已关注</view><view wx:if="{{item.hasFollowed==false}}" class="noAttention">未关注</view></view>
<view class="text-df {{item.biggestFloatPrice>0?'text-red':(item.biggestFloatPrice<0?'text-green':'text-black')}}" style="flex:1;text-align: center">{{item.biggestFloatPrice*1000||0}} </view>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}辆</view>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.minimumDeductionPoint || 0}}%</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin==item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryUp.png"></image>
<view class="flex flex-justify" style="border-top:2rpx solid #f3f3f3;padding: 0rpx 32rpx;" id="toFactoryDetails" data-factoryId="{{item.paperMillId}}" catchtap="toPage">
<view class="text-df text-balck" style="flex:1">{{item.shortName}}
<view wx:if="{{item.hasFollowed==true}}" class="yesAttention">已关注</view>
<view wx:if="{{item.hasFollowed==false}}" class="noAttention">未关注</view>
</view>
<view class="text-df {{item.biggestFloatPrice>0?'text-red':(item.biggestFloatPrice<0?'text-green':'text-black')}}" style="flex:1">
<text style="margin-left:40rpx">{{ formate.formateDrice(item.unitPrice)}}</text>
<text wx:if="{{item.biggestFloatPrice != 0}}" style="margin-left: 12rpx">{{ item.biggestFloatPrice > 0 ? '+' : '' }}{{ formate.formateDrice(item.biggestFloatPrice)}}</text>
</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin !== item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryDown.png"></image>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}辆</view>
<view class="flex flex-center text-df text-balck" style="flex:1;text-align: center">
<view style="flex:1.5;text-align: center">{{item.minimumDeductionPoint || 0}}%</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin==item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryUp.png"></image>
</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin !== item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryDown.png"></image>
</view>
</view>
</view>
<view wx:if="{{tableSgin==item.paperMillId}}" style="width:100%;background-color:#f3f3f3;padding-left:10rpx;padding:10rpx 24rpx 15rpx 24rpx">
<view class="flex flex-justify" style="">
<view class="text-df text-gray" style="flex:1;text-align: center">品类</view>
@ -63,5 +67,4 @@
<!-- <view class="gzBtn" id="toAttentionPaperFctory" bindtap="toPage">
<view class="gzBtnIcon"><image style="width:36rpx;height:36rpx" src="/assets/info/addgzicon.png"></image></view>
<view class="gzBtnText">关注纸厂</view>
</view> -->
</view>
</view> -->

52
pages/article/newInfo/index.wxml

@ -5,44 +5,42 @@
<view class="cu-bar fixed " style="height:{{CustomBar}}px;padding-top:{{StatusBar}}rpx;border-bottom:none">
<view class="content" style="top:{{StatusBar}}rpx;color:black;font-size:36rpx">
</view>
<view class="topLeftText" style="margin-top:15rpx">纸厂情报</view>
<view class="topRightText" style="margin-top:15rpx" id="toAllFactory" bindtap="toPage">全部纸厂></view>
<view class="topLeftText flex" style="margin-top:15rpx">
<view>纸厂情报</view>
<view class="topRightText" style="margin-left:24rpx" id="toAllFactory" bindtap="toPage">全部纸厂></view>
</view>
</view>
</view>
<!-- <view style="height:15rpx;width:100%"></view> -->
<view style="width:100%;height:70rpx;background-color:#F4F4F4;" class="topTitle">
<view class="topLeft">
<view class="flex flex-justify" style="width:100%;height:80rpx;background-color:#F4F4F4;" class="topTitle">
<view class="topLeft flex flex-center">
<picker mode="date" value="{{curDate}}" start="2015-09-01" end="2099-09-01" bindchange="curDateChange">
<view class="piker">
{{curDate}}
<view style="width:16rpx;height:70rpx; display: flex;align-items: center;float: right;margin-left:10rpx">
<view style="width:16rpx;height:80rpx; display: flex;align-items: center;float: right;margin-left:10rpx">
<image style="width:16rpx;height:16rpx" src="/assets/info/timeDown.png"></image>
</view>
</view>
</picker>
</view>
<view class="topRight" style="color:rgba(0,0,0,0.40);" id='tofeedback' bindtap="toPage">
<view style="color:rgba(0,0,0,0.40);" id='tofeedback' bindtap="toPage">
<view class="topRight-icon">
<image style="width:31.3rpx;height:32.4rpx" src="/assets/info/feedback.png"></image>
</view>
<view class="topRight-text">反馈情报
</view>
</view>
</view>
</view>
<scroll-view scroll-y="true" style='max-height:{{scorllHeight-70}}rpx;width:100%;background-color:white'>
<view style="width:100%;height:15rpx;"></view>
<scroll-view scroll-y="true" style='max-height:{{scorllHeight-80}}rpx;width:100%;background-color:white'>
<view class="zt">
<view class="flex flex-justify" style="width:100%;height:80rpx;lineheight:80rpx;font-size: 28px;color: rgba(0,0,0,0.65);letter-spacing: 0;padding: 0rpx 40rpx 0rpx 40rpx;">
<view class="text-df text-gray" style="flex:1.2;overflow: hidden;">纸厂名称</view>
<view class="flex flex-justify" style="width:100%;height:80rpx;font-size: 28px;color: rgba(0,0,0,0.65);letter-spacing: 0;padding: 0rpx 32rpx;">
<view class="text-df text-gray" style="flex:1;overflow: hidden;">纸厂名称</view>
<view class="text-df text-gray" style="flex:1;text-align: center" bindtap="changeSort">
<text>价格涨跌</text>
<image style="width:24rpx;height:24rpx" src="{{pximg}}"></image>
</view>
<view class="text-df text-gray" style="flex:1;text-align: center">纸厂排队</view>
<view class="text-df text-gray" style="flex:1;text-align: center">最近扣点</view>
<view class="text-df text-gray" style="flex:0.5;text-align: center"></view>
<view class="text-df text-gray" style="flex:0.8;text-align: center">最近扣点</view>
</view>
<view class="img-nodata" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
@ -54,17 +52,21 @@
</view>
<view class="bg-white">
<view wx:for="{{orderList}}" wx:key="index" class="tableStyle">
<view class="flex flex-justify" style="border-top:2rpx solid #f3f3f3;margin-top:20rpx;padding: 0rpx 40rpx 0rpx 40rpx;" id="toFactoryDetails" data-factoryId="{{item.paperMillId}}" catchtap="toPage">
<!-- <text class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}%</text> -->
<view class="text-df text-balck" style="flex:1.2">{{item.shortName}}</view>
<view class="text-df {{item.biggestFloatPrice>0?'text-red':(item.biggestFloatPrice<0?'text-green':'text-black')}}" style="flex:1;text-align: center">{{item.biggestFloatPrice*1000 || 0}} </view>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}辆</view>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.minimumDeductionPoint || 0}}%</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin==item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryUp.png"></image>
<view class="flex flex-justify" style="border-top:2rpx solid #f3f3f3;padding: 0rpx 32rpx;" id="toFactoryDetails" data-factoryId="{{item.paperMillId}}" catchtap="toPage">
<view class="text-df text-balck" style="flex:1">{{item.shortName}}</view>
<view class="text-df {{item.biggestFloatPrice>0?'text-red':(item.biggestFloatPrice<0?'text-green':'text-black')}}" style="flex:1">
<text style="margin-left:40rpx">{{ formate.formateDrice(item.unitPrice)}}</text>
<text wx:if="{{item.biggestFloatPrice != 0}}" style="margin-left: 12rpx">{{ item.biggestFloatPrice > 0 ? '+' : '' }}{{ formate.formateDrice(item.biggestFloatPrice)}}</text>
</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin !== item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryDown.png"></image>
<view class="text-df text-balck" style="flex:1;text-align: center">{{item.yesterdayTotalQuantity || 0}}辆</view>
<view class="flex flex-center text-df text-balck" style="flex:0.8;text-align: center">
<view style="flex:1.5;text-align: center">{{item.minimumDeductionPoint || 0}}%</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin==item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryUp.png"></image>
</view>
<view class="text-df text-balck" style="flex:0.5;text-align: center" id="{{item.paperMillId}}" catchtap="changeTable" wx:if="{{tableSgin !== item.paperMillId}}">
<image style="width:28rpx;height:28rpx;" src="/assets/info/factoryDown.png"></image>
</view>
</view>
</view>
@ -94,7 +96,7 @@
<view class="midTietleText1">行业情报</view>
<view class="midTietleText2" id="toqb" bindtap="toPage">更多资讯></view>
</view>
<view style="width:100%;height:5rpx;background-color:#f3f3f3"></view>
<view style="width:100%;height:2rpx;background-color:#f3f3f3"></view>
<!-- background-image:url(https://ossweb-img.qq.com/images/lol/img/champion/Morgana.png); -->
<view class="bottomView" wx:for="{{factoryList}}" wx:key="index" id="{{item.id}}" bindtap="toPageDetails">
<view class="bottomViewleft">

21
pages/article/newInfo/index.wxss

@ -75,7 +75,7 @@ page {
.topLeft {
width: 50%;
height: 60rpx;
height: 80rpx;
display: flex;
justify-content: space-between;
}
@ -107,17 +107,13 @@ page {
letter-spacing: 0;
height: 60rpx;
line-height: 60rpx;
position: absolute;
left: 196rpx;
}
.topRight-text{
height: 70rpx;
width: 112rpx;
height: 80rpx;
width: 200rpx;
text-align: right;
line-height: 70rpx;
float: right;
margin-right: 10rpx;
line-height: 80rpx;
}
.topRight-icon{
float: right;
@ -127,7 +123,6 @@ page {
margin-right: 35rpx;
}
.topRightIcon {
height: 60rpx;
float: right;
@ -179,7 +174,7 @@ page {
width: 750rpx;
height: 228rpx;
padding: 24rpx 32rpx 24rpx 32rpx;
border-bottom: 2px solid #f3f3f3;
border-bottom: 1px solid #f3f3f3;
}
.bottomViewleft {
@ -237,8 +232,8 @@ page {
}
.piker {
height: 70rpx;
line-height: 70rpx;
height: 80rpx;
line-height: 80rpx;
font-family: PingFangSC-Medium;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.40);

9
pages/formate.wxs

@ -76,6 +76,12 @@ var numberUtil = {
}
return ''
},
formateDrice: function (value) {
if (value || value == 0) {
return (parseFloat(value) * 1000).toFixed(0)
}
return '- -'
},
substring: function(str, start, end){
if(str){
return str.substring(start, end)
@ -96,5 +102,6 @@ module.exports = {
formatePrice: numberUtil.formatePrice,
formatePrice2: numberUtil.formatePrice2,
substring: numberUtil.substring,
forWeight: numberUtil.forWeight
forWeight: numberUtil.forWeight,
formateDrice: numberUtil.formateDrice
}
Loading…
Cancel
Save