diff --git a/api/moment.js b/api/moment.js index e5db672..1abebba 100644 --- a/api/moment.js +++ b/api/moment.js @@ -15,6 +15,7 @@ const postMoment = (params) => mPost(`/information-center/article/save/Article`, // /article/update/Article/{id} 编辑文章 const updateMoment = (id, params) => mPost(`/information-center/article/update/Article/${id}`, params, mconfig) // /article/get/Article-list/文章列表 +const getPreferType = (params) => mGet(`/information-center/article-category/get/article-category-list`, params, mconfig) const getPreferList = (params) => mGet(`/information-center/article/get/Article-list/`, params, mconfig) // /article/get/Article-view-list 浏览文章历史列表 const getViewedList = (params) => mGet(`/information-center/article/get/Article-view-list`, params, mconfig) @@ -44,6 +45,7 @@ const getMillPaperList = (params) => mGet(`/ztb-market-information-service/get/p export { mconfig, + getPreferType, getPreferList, postMoment, updateMoment, diff --git a/colorui/main.wxss b/colorui/main.wxss index d5e4f37..a1e9608 100644 --- a/colorui/main.wxss +++ b/colorui/main.wxss @@ -987,7 +987,7 @@ button.icon.lg { .cu-custom .cu-bar { min-height: 0px; - padding-right: 212rpx; + padding-right: 102px; z-index: 99; /* box-shadow: 0rpx 0rpx 0rpx; */ box-shadow: 0 -1rpx 2rpx rgba(0, 0, 0, 0.01) diff --git a/pages/agent/factory/index.json b/pages/agent/factory/index.json index 82796ef..f3fc945 100644 --- a/pages/agent/factory/index.json +++ b/pages/agent/factory/index.json @@ -8,6 +8,8 @@ "wux-sticky": "/components/sticky/index", "fold-text": "/components/fold-text/index", "wux-divider": "/components/divider/index", - "article-item": "/pages/article/article-item/index" + "info-item": "/pages/moment/info-item/index", + "article-item": "/pages/article/article-item/index", + "wux-popup": "/components/popup/index" } } \ No newline at end of file diff --git a/pages/agent/factory/index.wxml b/pages/agent/factory/index.wxml index d05df3a..fc03860 100644 --- a/pages/agent/factory/index.wxml +++ b/pages/agent/factory/index.wxml @@ -92,8 +92,9 @@ - - + + @@ -176,6 +177,20 @@ + + + + + + + + + 活动规则 + + + + function priceItem(item, kg) { if(kg){ @@ -192,5 +207,5 @@ return (parseFloat(item.unitPrice) * 1000).toFixed(1) + '元/吨' } } - module.exports = priceItem; + module.exports = priceItem \ No newline at end of file diff --git a/pages/agent/factory/index.wxss b/pages/agent/factory/index.wxss index dee8fd2..9f91e08 100644 --- a/pages/agent/factory/index.wxss +++ b/pages/agent/factory/index.wxss @@ -91,3 +91,25 @@ transform-origin: 50% 50%; transform: rotate(180deg); } + + +.wux-landscape{ + width: 100%; + max-width: 750rpx; +} + +.wux-landscape__popup { + background-color: transparent!important +} + +.wux-landscape__popup-body { + padding: 0!important +} +.wux-landscape__inner { + line-height: 1.5; + color: rgba(0,0,0,.65) +} +.wux-landscape__inner > image { + width: 100%; + max-width: 100% +} \ No newline at end of file diff --git a/pages/agent/fragment/index.js b/pages/agent/fragment/index.js index 96e9d75..fb67413 100644 --- a/pages/agent/fragment/index.js +++ b/pages/agent/fragment/index.js @@ -12,7 +12,8 @@ Component({ properties:{ height: { type: Number, value: 0 }, customHeight: { type: Number, value: 0 }, - StatusBar: { type: Number, value: 0 } + StatusBar: { type: Number, value: 0 }, + customWidth: { type: Number, value: 0 } }, /** * 页面的初始数据 @@ -105,7 +106,6 @@ Component({ }) }, onCityChange: function({ detail }){ - console.log('onCityChange>>>>') for (let index = 0; index < this.data.cateList.length; index++) { if(this.data.cateList[index].cityId == detail.cityId){ detail.index = index diff --git a/pages/agent/fragment/index.wxml b/pages/agent/fragment/index.wxml index 3914dc2..c89fdb4 100644 --- a/pages/agent/fragment/index.wxml +++ b/pages/agent/fragment/index.wxml @@ -1,8 +1,8 @@ - - + + 输入纸名/品名/纸厂/规格 diff --git a/pages/article/detail/index.json b/pages/article/detail/index.json index 0402d9d..770f6af 100644 --- a/pages/article/detail/index.json +++ b/pages/article/detail/index.json @@ -5,6 +5,7 @@ "sudoku-image": "/components/sudoku-image/index", "wux-divider": "/components/divider/index", "refresh-view": "/components/refresher/index", - "wux-tag": "/components/tag/index" + "wux-tag": "/components/tag/index", + "wux-popup": "/components/popup/index" } } \ No newline at end of file diff --git a/pages/article/detail/index.wxml b/pages/article/detail/index.wxml index 5473f4f..70b09ac 100644 --- a/pages/article/detail/index.wxml +++ b/pages/article/detail/index.wxml @@ -164,4 +164,18 @@ - \ No newline at end of file + + + + + + + + + + + 活动规则 + + + \ No newline at end of file diff --git a/pages/article/detail/index.wxss b/pages/article/detail/index.wxss index 693337b..1815d17 100644 --- a/pages/article/detail/index.wxss +++ b/pages/article/detail/index.wxss @@ -194,5 +194,25 @@ font-size: 48rpx; color: #3539F8; margin-bottom: 30rpx; +} +.wux-landscape{ + width: 100%; + max-width: 750rpx; +} + +.wux-landscape__popup { + background-color: transparent!important +} + +.wux-landscape__popup-body { + padding: 0!important +} +.wux-landscape__inner { + line-height: 1.5; + color: rgba(0,0,0,.65) +} +.wux-landscape__inner > image { + width: 100%; + max-width: 100% } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 6e29a77..aa20025 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -55,10 +55,11 @@ Page({ const fheght = (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100 this.setData({ fragment: fheght, - safeBottom: app.globalData.safeBottom, + safeBottom: app.globalData.safeBottom, maxDate, minDate, calendar, cityName: this.data.cityName, customHeight: app.globalData.customHeight, + customWidth: app.globalData.Custom.left, StatusBar: app.globalData.StatusBar || 40, }) var authorization = app.globalData.token || storage.get('Authorization') diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 4b9f868..317da30 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,12 +1,12 @@ -
+
- + - + @@ -76,7 +76,6 @@ - function tabImage(tabIndex, index) { if (index == 0) { diff --git a/pages/mall/fragment/index.js b/pages/mall/fragment/index.js index 59a4ec3..2fcc8a9 100644 --- a/pages/mall/fragment/index.js +++ b/pages/mall/fragment/index.js @@ -17,7 +17,8 @@ Component({ cityName: { type: String, value: '' }, height: { type: Number, value: 0 }, customHeight: { type: Number, value: 0 }, - StatusBar: { type: Number, value: 0 } + StatusBar: { type: Number, value: 0 }, + customWidth: { type: Number, value: 0 } }, /** * 页面的初始数据 diff --git a/pages/mall/fragment/index.wxml b/pages/mall/fragment/index.wxml index a0b4ab5..1d3a9db 100644 --- a/pages/mall/fragment/index.wxml +++ b/pages/mall/fragment/index.wxml @@ -1,19 +1,19 @@ - + {{cityName}} - + 输入关键字搜索 - - + + @@ -22,7 +22,7 @@ 商品详情 --> - + @@ -93,13 +93,13 @@ - - 查看更多行情 - - + 暂无数据 + + 查看更多行情 + \ No newline at end of file diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index 121fd77..b3852e7 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -37,6 +37,9 @@ Page({ if(options.tab) { this.data.tabIndex = Number(options.tab) } + var min = new Date() + min.setHours(0, 0, 0) + this.data.form.date = util.formatDate(min, 'Y-M-D') this.setData({height: app.globalData.fragmentHeight - 100, tabIndex: this.data.tabIndex}) }, clearHistory: function(){ @@ -161,14 +164,9 @@ Page({ tdsdk.Page.onHide() }, onUnload: function() { - console.log('onUnload>>>') tdsdk.Page.onUnload() if(this.data.rearchStringList.length){ - try { - wx.setStorageSync('mall-search', this.data.rearchStringList.toString()) - } catch (e) { - console.log(e) - } + storage.put('mall-search', this.data.rearchStringList.toString()) } } }) \ No newline at end of file diff --git a/pages/moment/fragment/index.js b/pages/moment/fragment/index.js index 15daec6..de997a5 100644 --- a/pages/moment/fragment/index.js +++ b/pages/moment/fragment/index.js @@ -16,7 +16,8 @@ Component({ height: { type: Number, value: 0 }, customHeight: { type: Number, value: 0 }, StatusBar: { type: Number, value: 0 }, - safeBottom: { type: Number, value: 0 } + safeBottom: { type: Number, value: 0 }, + customWidth: { type: Number, value: 0 } }, /** * 页面的初始数据 @@ -68,6 +69,10 @@ Component({ if(fragment && fragment.calendarChange){ fragment.calendarChange(date) } + fragment = this.selectComponent('#theall') + if(fragment && fragment.calendarChange){ + fragment.calendarChange(date) + } }, chooseCity: function(){ wx.navigateTo({url: `/pages/home/city-select/index?type=1` }) diff --git a/pages/moment/fragment/index.wxml b/pages/moment/fragment/index.wxml index a12dbc8..5f69c0f 100644 --- a/pages/moment/fragment/index.wxml +++ b/pages/moment/fragment/index.wxml @@ -1,17 +1,17 @@ - + {{cityName}} - + 输入关键字搜索 - + diff --git a/pages/moment/index.wxs b/pages/moment/index.wxs new file mode 100644 index 0000000..98f8bc4 --- /dev/null +++ b/pages/moment/index.wxs @@ -0,0 +1,33 @@ +function isEmpty(val) { + return typeof val === 'undefined' || val === '' || val === null +} + +function formateDate(datetime) { + if (isEmpty(datetime)) { + return '' + } + var date = getDate(datetime.trim()) + var today = getDate() + var week = '' + if (date.toString().substring(0, 15) === today.toString().substring(0, 15)) { + week = '(今天)' + } else if (date.getTime() > today.getTime()) { + week = '(明天)' + } + return week + datetime +} + +function formateText(text, length) { + if (!text) { + return '' + } + if (text.length <= length) { + return text + } + return text.substring(0, length) +} + +module.exports = { + formateDate: formateDate, + formateText: formateText +} \ No newline at end of file diff --git a/pages/moment/info-item/index.js b/pages/moment/info-item/index.js index d315dba..fd81d1e 100644 --- a/pages/moment/info-item/index.js +++ b/pages/moment/info-item/index.js @@ -16,6 +16,9 @@ Component({ util.navigateTo('/pages/article/detail/index?id=' + this.data.item.id) }, lookFactory: function(){ + if(!this.data.mclick){ + return + } util.navigateTo(`/pages/agent/factory/index?id=${this.data.item.millPaperId}`) } } diff --git a/pages/moment/info-item/index.wxml b/pages/moment/info-item/index.wxml index d76fcef..0d025f3 100644 --- a/pages/moment/info-item/index.wxml +++ b/pages/moment/info-item/index.wxml @@ -1,13 +1,13 @@ - + - + {{item.shortName || item.millPaperName}} - {{item.createTime}} + {{item.createTime}} {{item.readingQuantity}}次阅读 diff --git a/pages/moment/information/index.js b/pages/moment/information/index.js index 13adc68..0504c63 100644 --- a/pages/moment/information/index.js +++ b/pages/moment/information/index.js @@ -1,5 +1,5 @@ // pages/message/index.js -import { getInformationList } from "../../../api/moment" +import { getPreferType, getPreferList } from "../../../api/moment" const util = require('../../../utils/util') const app = getApp() @@ -12,6 +12,10 @@ Component({ height: { type: Number, value: 0 } }, data: { + tabList: [], + tabIndex: 0, + typeList: [], + scrolled: false, form: { pageNum: 1, pageSize: 10 @@ -23,17 +27,47 @@ Component({ }, methods: { onRestart: function () { + this.fetchTypeList() if(!this.firstShow){ - // this.fetchList() + this.fetchList() } this.firstShow = true }, - fetchList: function(){ + fetchTypeList: function(){ + if(this.data.tabList.length > 0){ + return + } + getPreferType().then(result => { + this.data.typeList = [{ id: '', name: '全部' }].concat(result.data) + for (let index = 0; index < this.data.typeList.length; index++) { + this.data.tabList.push(this.data.typeList[index].name) + } + this.setData({ tabList: this.data.tabList, scrolled: this.data.typeList.length >= 5 }) + }) + }, + onTabChange: function ({ detail }) { + if (this.data.tabIndex == Number(detail.index)) { + return + } + this.data.tabIndex = Number(detail.index) + this.data.form.categoryId = this.data.typeList[this.data.tabIndex].id + this.onRefreshList() + }, + // 下拉刷新... + onRefreshList: function () { if (this.data.requesting) { return } - this.data.requesting = true - getInformationList(this.data.form).then(result => { + this.setData({ orderList: [], tabIndex: this.data.tabIndex, ['form.pageNum']: 1, loading: true, finished: false }) + this.fetchList() + }, + fetchList: function(){ + if (this.data.requesting || this.data.finished) { + return + } + // this.data.requesting = true + this.setData({ requesting: true }) + getPreferList(this.data.form).then(result => { if (result.data && result.data.records.length) { var respList = result.data.records let nowList = `orderList[${this.data.orderList.length}]` diff --git a/pages/moment/information/index.wxml b/pages/moment/information/index.wxml index 0c678c0..65a615a 100644 --- a/pages/moment/information/index.wxml +++ b/pages/moment/information/index.wxml @@ -1,5 +1,16 @@ - + + + + + + + + + + diff --git a/pages/moment/moment-item/index.wxml b/pages/moment/moment-item/index.wxml index 58fdefd..aae2efa 100644 --- a/pages/moment/moment-item/index.wxml +++ b/pages/moment/moment-item/index.wxml @@ -1,6 +1,7 @@ -{{item.tipsTime}} + +{{moment.formateDate(item.tipsTime)}} {{item.shortName}} @@ -14,7 +15,7 @@ {{item.typicalFloatingQuotedPrice}} - + 更新时间:{{moment.formateText(item.latestQuoteTime, 10)}} {{item.retainedReceivedQuantity || '- -'}} {{item.startDeductionPoints}} @@ -52,4 +53,32 @@ 代卖 - \ No newline at end of file + + + + function formateTime(lasttime) { + if (index == 0) { + if(tabIndex == index){ + return '/assets/tabs/tab-host-blue.png' + } + return '/assets/tabs/tab-host-gray.png' + } else if (index == 1) { + if(tabIndex == index){ + return '/assets/tabs/tab-infi-blue.png' + } + return '/assets/tabs/tab-infi-gray.png' + } else if (index == 2) { + if(tabIndex == index){ + return '/assets/tabs/tab-trans-blue.png' + } + return '/assets/tabs/tab-trans-gray.png' + } else if (index == 3) { + if(tabIndex == index){ + return '/assets/tabs/tab-self-blue.png' + } + return '/assets/tabs/tab-self-gray.png' + } + return '' + } + module.exports = formateTime + \ No newline at end of file diff --git a/pages/moment/moment-item/index.wxss b/pages/moment/moment-item/index.wxss index d62ce86..35099ed 100644 --- a/pages/moment/moment-item/index.wxss +++ b/pages/moment/moment-item/index.wxss @@ -11,6 +11,14 @@ margin-top: 4rpx; } +.item-tips{ + height: 64rpx; + line-height: 64rpx; + text-align: center; + background-color: #F7F8FA; + color: #888888; +} + .item-content{ padding:16rpx 24rpx; border-bottom: 1rpx solid #f3f3f3; diff --git a/pages/moment/theall/index.js b/pages/moment/theall/index.js index 7f51268..eb304e1 100644 --- a/pages/moment/theall/index.js +++ b/pages/moment/theall/index.js @@ -23,6 +23,7 @@ Component({ pageNum: 1, pageSize: 10 }, + dataIndex: 0, loading: true, requesting: false, finished: false, @@ -54,6 +55,7 @@ Component({ this.data.tabIndex = Number(detail.index) this.data.form.proviceId = area.list[this.data.tabIndex].data[this.data.pIndex].code var proviceList = this.getProviceListByIndex(this.data.tabIndex) + this.data.dataIndex = 0 this.setData({ pIndex: 0, proviceList, orderList: [], ['form.pageNum']: 1, finished: false, loading: true }) this.fetchList() }, @@ -65,10 +67,15 @@ Component({ this.data.form.proviceId = area.list[this.data.tabIndex].data[this.data.pIndex].code this.onRefreshList() }, + calendarChange: function(date){ + this.data.form.date = date + this.onRefreshList() + }, onRefreshList: function(){ if (this.data.requesting) { return } + this.data.dataIndex = 0 this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, loading: true }) this.fetchList() }, @@ -80,6 +87,33 @@ Component({ getInformationList(this.data.form).then(result => { if (result.data && result.data.records.length) { var respList = result.data.records + var lastTime = null + if(this.data.dataIndex < 2){ + // 对返回的消息列表进行处理,将同一天的消息显示在一起 + var qrtime = new Date(this.data.form.date).getTime() + for (let i = 0; i < respList.length; i++) { + if(this.data.dataIndex == 2){ + continue + } + lastTime = respList[i].latestQuoteTime + if (lastTime.length > 10) { + lastTime = lastTime.substring(0, 10) + } + var itemtime = new Date(lastTime).getTime() + if(this.data.dataIndex == 0){ + if(itemtime > qrtime){ + this.data.dataIndex = 1 + respList[i].tipsTime = lastTime + } else { + this.data.dataIndex = 2 + respList[i].tipsTime = this.data.form.date + } + } else if(this.data.dataIndex == 1 && itemtime <= qrtime){ + this.data.dataIndex = 2 + respList[i].tipsTime = this.data.form.date + } + } + } let nowList = `orderList[${this.data.orderList.length}]` var num = this.data.form.pageNum var finished = this.data.form.pageNum >= result.data.pages diff --git a/pages/ztbvip/index.js b/pages/ztbvip/index.js index e1c682b..33ca57d 100644 --- a/pages/ztbvip/index.js +++ b/pages/ztbvip/index.js @@ -49,9 +49,6 @@ Page({ util.navigateTo('/pages/home/idcard/index') } }, - /** - * 点击选择会员资费类型事件 - */ onGridTap:function(e){ var divIndexId=e.currentTarget.dataset.index this.setData({ divIndex:this.data.iconList[divIndexId].id }) diff --git a/pages/ztbvip/index.wxml b/pages/ztbvip/index.wxml index 5d2f75f..0bc9601 100644 --- a/pages/ztbvip/index.wxml +++ b/pages/ztbvip/index.wxml @@ -3,8 +3,8 @@ 纸通宝会员 - - +