From 8f082be548fa078d30e6f76d1ab04d4f56f92381 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 7 Oct 2021 10:57:11 +0800 Subject: [PATCH] no message --- app.js | 2 +- colorui/components/cu-custom.js | 4 ++ colorui/components/cu-custom.wxml | 2 +- colorui/components/cu-custom.wxss | 3 ++ .../detail/item-money-info/money-info.wxml | 25 +++++------ pages/agent/fragment/index.js | 25 ++++++----- pages/agent/fragment/index.wxml | 6 +-- pages/index/index.js | 38 +++++++++++----- pages/index/index.wxml | 6 +-- pages/mall/fragment/index.js | 17 +++---- pages/mall/fragment/index.wxml | 5 ++- pages/mall/search-list/index.js | 44 ++++++++++--------- pages/mall/search-list/index.wxml | 24 +++++----- pages/moment/fragment/index.js | 17 ++----- pages/moment/fragment/index.wxml | 12 ++--- pages/moment/info-item/index.js | 3 -- pages/moment/info-item/index.wxml | 2 +- pages/moment/moment-item/index.js | 10 +++++ 18 files changed, 135 insertions(+), 110 deletions(-) diff --git a/app.js b/app.js index 6b6810c..3a28896 100644 --- a/app.js +++ b/app.js @@ -90,7 +90,7 @@ App({ let pages = getCurrentPages() let page = pages[pages.length - 1] if(page && page.route == 'pages/index/index' && !page.data.inited){ - page.onResume() + // page.setHeightData() } }) }, diff --git a/colorui/components/cu-custom.js b/colorui/components/cu-custom.js index 13a3c5a..3187a2b 100644 --- a/colorui/components/cu-custom.js +++ b/colorui/components/cu-custom.js @@ -36,6 +36,10 @@ Component({ bgImage: { type: String, default: '' + }, + fragment: { + type: Boolean, + default: false } }, /** diff --git a/colorui/components/cu-custom.wxml b/colorui/components/cu-custom.wxml index 8393979..00fe8b0 100644 --- a/colorui/components/cu-custom.wxml +++ b/colorui/components/cu-custom.wxml @@ -1,4 +1,4 @@ - + diff --git a/colorui/components/cu-custom.wxss b/colorui/components/cu-custom.wxss index 67eb8b9..03536be 100644 --- a/colorui/components/cu-custom.wxss +++ b/colorui/components/cu-custom.wxss @@ -1,3 +1,6 @@ /* colorui/components/cu-custom.wxss */ +.top-bg{ + background-image: linear-gradient(127deg, rgba(0,122,255,0.67) 0%, rgba(13,100,227,0.95) 100%); +} \ No newline at end of file diff --git a/pages/agent/detail/item-money-info/money-info.wxml b/pages/agent/detail/item-money-info/money-info.wxml index ef8314d..72828cd 100644 --- a/pages/agent/detail/item-money-info/money-info.wxml +++ b/pages/agent/detail/item-money-info/money-info.wxml @@ -1,14 +1,13 @@ - 首款信息 预计总金额 - {{formate.formateAmount(item.preTotalMoney)}}元 + {{formate.formateAmount(item.preTotalMoney)}}元 结算单价 x 净重 @@ -17,7 +16,7 @@ 首笔应收金额 - {{formate.formateAmount(item.prepayMoney)}}元 + {{formate.formateAmount(item.prepayMoney)}}元 预估总金额 x {{agent.getActivitySettleType(orderInfo.activitySettleType)}} @@ -26,7 +25,7 @@ 代卖费总额 - {{formate.formateAmount(item.proxyAmount) || 0}}元 + {{formate.formateAmount(item.proxyAmount) || 0}}元 代卖费单价 x 净重 @@ -49,7 +48,7 @@ 尾款信息 未结算金额 - {{formate.formateAmount(item.unSettleMoney)}}元 + {{formate.formateAmount(item.unSettleMoney)}}元 单价 x 结算重量 - 首笔应收金额 @@ -66,7 +65,7 @@ @@ -76,12 +75,12 @@ 返还补贴 - {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 + {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 调节费 - {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 + {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 @@ -112,7 +111,7 @@ 代卖费总额 - {{formate.formateAmount(item.surcharge) || 0}}元 + {{formate.formateAmount(item.surcharge) || 0}}元 代卖费单价 x 结算重量 @@ -127,18 +126,18 @@ 纸厂补贴与扣款 - {{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元 + {{formate.formateAmount(item.totalOtherAmount==null?0:item.totalOtherAmount)}}元 返还补贴 - {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 + {{formate.formateAmount(item.refundSubsidy==null?0:item.refundSubsidy)}}元 补贴单价单价 x 结算重量 @@ -148,7 +147,7 @@ 调节费 - {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 + {{formate.formateAmount(item.adjustMoney==null?0:item.adjustMoney)}}元 总收款金额: diff --git a/pages/agent/fragment/index.js b/pages/agent/fragment/index.js index 74978e4..96e9d75 100644 --- a/pages/agent/fragment/index.js +++ b/pages/agent/fragment/index.js @@ -9,12 +9,15 @@ Component({ addGlobalClass: true, multipleSlots: true }, + properties:{ + height: { type: Number, value: 0 }, + customHeight: { type: Number, value: 0 }, + StatusBar: { type: Number, value: 0 } + }, /** * 页面的初始数据 */ data: { - height: app.globalData.safeFragmentHeight - 190, - CustomBar: app.globalData.CustomBar, kg: app.globalData.kg, loading: true, requesting: false, @@ -45,6 +48,8 @@ Component({ this.setData({ hasActivity: result.data }) }) } + // this.fetchRegionList() + // this.fetchPapersList() }, detached: function () { event.remove('EventMessage', this) @@ -52,16 +57,8 @@ Component({ }, methods: { onRestart: function(){ - if (!this.data.firstShow) { - this.setData({ - height: app.globalData.safeFragmentHeight - 190, - StatusBar: app.globalData.StatusBar || 40, - customHeight: app.globalData.customHeight, - tabIndex: 0, - kg: app.globalData.kg, - firstShow: true - }) - this.fetchRegionList() + this.fetchRegionList() + if(!this.data.firstShow){ this.fetchPapersList() } this.data.firstShow = true @@ -95,6 +92,9 @@ Component({ util.navigateTo('/pages/agent/ability/index') }, fetchRegionList: function () { + if(this.data.tabList.length > 0){ + return + } getFactoryCity().then(result => { this.triggerEvent("region", result.data) this.data.cateList = [{ cityId: '', cityName: '全部' }].concat(result.data) @@ -105,6 +105,7 @@ 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 619cf1f..b40c421 100644 --- a/pages/agent/fragment/index.wxml +++ b/pages/agent/fragment/index.wxml @@ -23,13 +23,13 @@ - + - + - + 暂无数据,点击重新加载 diff --git a/pages/index/index.js b/pages/index/index.js index f585d97..6e29a77 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -9,7 +9,6 @@ const event = require('../../utils/event') const storage = require('../../utils/storage') const app = getApp() const qqwxmap = new wxqqmap({ key: 'GAMBZ-CBGCK-GB6J3-A6PJX-F6ZHH-IWFUD'}) -var fragments = [] Page({ data: { @@ -54,7 +53,14 @@ Page({ event.on('EventMessage', this, this.onEvent) wx.showLoading({ title: '加载中', mask: true }) const fheght = (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100 - this.setData({ fragment: fheght, safeBottom: app.globalData.safeBottom, maxDate, minDate, calendar, cityName: this.data.cityName }) + this.setData({ + fragment: fheght, + safeBottom: app.globalData.safeBottom, + maxDate, minDate, calendar, + cityName: this.data.cityName, + customHeight: app.globalData.customHeight, + StatusBar: app.globalData.StatusBar || 40, + }) var authorization = app.globalData.token || storage.get('Authorization') if (authorization) { app.globalData.token = authorization @@ -85,7 +91,7 @@ Page({ defaultIndex: function () { this.data.inited = true this.locationing() - this.onResume() + // this.onResume() if (this.data.path && '/pages/index/index' != this.data.path) { util.navigateTo(this.data.path) } @@ -190,9 +196,9 @@ Page({ }) }, onResume: function () { - fragments[this.data.pageIndex] = fragments[this.data.pageIndex] || this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value) - if (fragments[this.data.pageIndex]) { - fragments[this.data.pageIndex].onRestart() + var fragment = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value) + if (fragment) { + fragment.onRestart() } }, //事件处理函数 @@ -205,6 +211,16 @@ Page({ this.setData({ pageIndex: detail.what }) this.onResume() }, + setHeightData: function(){ + const fheght = (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight) - 100 + this.setData({ + fragment: fheght, + safeBottom: app.globalData.safeBottom, + cityName: this.data.cityName, + customHeight: app.globalData.customHeight, + StatusBar: app.globalData.StatusBar || 40, + }) + }, /** * 生命周期函数--监听页面显示 */ @@ -248,8 +264,9 @@ Page({ }, onConfirm({detail}) { this.setData({ calendar: detail.label }) - if(fragments[1].onCalendarChange){ - fragments[1].onCalendarChange(detail.label) + var fragment = this.selectComponent('#' + this.data.TabList[1].value) + if(fragment && fragment.onCalendarChange){ + fragment.onCalendarChange(detail.label) } }, onImageClick: function () { @@ -277,8 +294,9 @@ Page({ }, clickCity: function(e){ this.setData({cityId: e.currentTarget.dataset.id, visible2: false }) - if(fragments[2].onCityChange){ - fragments[2].onCityChange({detail: {cityId: e.currentTarget.dataset.id}}) + var fragment = this.selectComponent('#' + this.data.TabList[2].value) + if(fragment && fragment.onCityChange){ + fragment.onCityChange({detail: {cityId: e.currentTarget.dataset.id}}) } if(!util.isEmpty(e.currentTarget.dataset.index)){ var item = this.data.cityList[e.currentTarget.dataset.index] diff --git a/pages/index/index.wxml b/pages/index/index.wxml index dcdb11f..4b9f868 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,12 +1,12 @@ -
+
- + - + diff --git a/pages/mall/fragment/index.js b/pages/mall/fragment/index.js index f182008..59a4ec3 100644 --- a/pages/mall/fragment/index.js +++ b/pages/mall/fragment/index.js @@ -14,16 +14,15 @@ Component({ multipleSlots: true }, properties:{ - cityName: { //这个是可以自定义最外层的view的样式 - type: String, - value: '' - } + cityName: { type: String, value: '' }, + height: { type: Number, value: 0 }, + customHeight: { type: Number, value: 0 }, + StatusBar: { type: Number, value: 0 } }, /** * 页面的初始数据 */ data: { - height: app.globalData.safeFragmentHeight - 100, firstShow: false, bannerList: [], momentList: [], @@ -54,13 +53,6 @@ Component({ methods: { onRestart: function () { if(!this.data.firstShow){ - this.setData({ - height: app.globalData.safeFragmentHeight - 100, - StatusBar: app.globalData.StatusBar || 40, - customHeight: app.globalData.customHeight, - CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80), - firstShow: true - }) getPreferList().then(result => { this.setData({ momentList: result.data.records.slice(0, 3) }) }) @@ -141,6 +133,7 @@ Component({ if(this.data.tabIndex == Number(detail.index)){ return } + this.data.tabIndex = Number(detail.index) form.categoryId = typeList[Number(detail.index)].categoryId this.fetchAgentList() }, diff --git a/pages/mall/fragment/index.wxml b/pages/mall/fragment/index.wxml index 8907985..ff09569 100644 --- a/pages/mall/fragment/index.wxml +++ b/pages/mall/fragment/index.wxml @@ -18,8 +18,11 @@ + - + diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index 26c4981..121fd77 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -62,13 +62,16 @@ Page({ return } this.data.tabIndex = Number(detail.index) - if (!app.globalData.userInfo && this.data.tabIndex == 3) { - wx.navigateTo({ url: '/pages/login/index' }) + if(util.isEmpty(this.data.form.searchKey)){ return } this.onSearchList({ detail:{value: this.data.form.searchKey} }) }, onSearchList: function({detail}){ + if (!app.globalData.userInfo && this.data.tabIndex == 3) { + wx.navigateTo({ url: '/pages/login/index' }) + return + } this.data.form.searchKey = detail.value if(util.isEmpty(this.data.form.searchKey)){ util.showToast('请输入要搜索的关键字') @@ -94,57 +97,57 @@ Page({ if(this.data.tabIndex == 0){ getFactoryPrice(this.data.form).then(result => { if (result.data.records.length) { - this.handRespList(result.data.records) + this.handRespList(result.data) } else { - this.setData({ finished: true, requesting: false, loading: false }) + this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } }).catch(err => { - this.setData({ requesting: false, loading: false }) + this.setData({ requesting: false, loading: false, tabIndex: this.data.tabIndex}) util.showToast(err) }) } else if(this.data.tabIndex == 1){ getInformationList(this.data.form).then(result => { if (result.data.records.length) { - this.handRespList(result.data.records) + this.handRespList(result.data) } else { - this.setData({ finished: true, requesting: false, loading: false }) + this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } }).catch(err => { - this.setData({ requesting: false, loading: false }) + this.setData({ requesting: false, loading: false, tabIndex: this.data.tabIndex }) util.showToast(err) }) } else if(this.data.tabIndex == 2){ getProxyOrderList(this.data.form).then(result => { if (result.data.records.length) { - this.handRespList(result.data.records) + this.handRespList(result.data) } else { - this.setData({ finished: true, requesting: false, loading: false }) + this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } }).catch(err => { - this.setData({ requesting: false, loading: false }) + this.setData({ requesting: false, loading: false, tabIndex: this.data.tabIndex }) util.showToast(err) }) } else if(this.data.tabIndex == 3){ getPreferList(this.data.form).then(result => { if (result.data.records.length) { - this.handRespList(result.data.records) + this.handRespList(result.data) } else { - this.setData({ finished: true, requesting: false, loading: false }) + this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } }).catch(err => { - this.setData({ requesting: false, loading: false }) + this.setData({ requesting: false, loading: false, tabIndex: this.data.tabIndex }) util.showToast(err) }) } }, - handRespList: function(respList){ + handRespList: function(data){ let nowList = `taskList[${this.data.taskList.length}]` var num = this.data.form.pageNum - var finished = this.data.form.pageNum >= result.data.pages + var finished = this.data.form.pageNum >= data.pages if (this.data.form.pageNum == 1) { - this.setData({ [nowList]: respList, total: result.data.total, ['form.pageNum']: (num + 1), top: 0, finished, requesting: false, loading: false }) + this.setData({ [nowList]: data.records, total: data.total, ['form.pageNum']: (num + 1), top: 0, finished, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } else { - this.setData({ [nowList]: respList, total: result.data.total, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false }) + this.setData({ [nowList]: data.records, total: data.total, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false, tabIndex: this.data.tabIndex }) } }, tagClick: function(e){ @@ -157,13 +160,14 @@ Page({ onHide: function(){ tdsdk.Page.onHide() }, - onUnload() { + 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) } } } diff --git a/pages/mall/search-list/index.wxml b/pages/mall/search-list/index.wxml index 466a752..00a360a 100644 --- a/pages/mall/search-list/index.wxml +++ b/pages/mall/search-list/index.wxml @@ -7,14 +7,14 @@ - + - - + + 搜索历史 - + {{item}} @@ -31,10 +31,8 @@ - - - + @@ -42,9 +40,13 @@ - - - {{finished?'到底啦~':'加载中...'}} - + + + + + {{finished?'到底啦~':'加载中...'}} + + + \ No newline at end of file diff --git a/pages/moment/fragment/index.js b/pages/moment/fragment/index.js index 312aac6..0b0a12f 100644 --- a/pages/moment/fragment/index.js +++ b/pages/moment/fragment/index.js @@ -13,20 +13,19 @@ Component({ }, properties:{ cityName: { type: String, value: '' }, - height: { type: Number, value: 0 } + height: { type: Number, value: 0 }, + customHeight: { type: Number, value: 0 }, + StatusBar: { type: Number, value: 0 }, + safeBottom: { type: Number, value: 0 } }, /** * 页面的初始数据 */ data: { - fragmentHeight: app.globalData.safeFragmentHeight - 270, - safeBottom: app.globalData.safeBottom, - kg: app.globalData.kg, firstShow: false, noticeList: [], tabList: [ '推荐', '关注', '全部' , '资讯'], tabIndex: 0, - }, lifetimes: { attached: function () { @@ -39,14 +38,6 @@ Component({ methods: { onRestart: function () { if(!this.data.firstShow){ - this.setData({ - fragmentHeight: this.data.height - 167 - app.globalData.customHeight, - StatusBar: app.globalData.StatusBar || 40, - customHeight: app.globalData.customHeight, - safeBottom: app.globalData.safeBottom, - tabIndex: 0, - firstShow: true - }) params.date = util.formatDate(new Date(), 'Y-M-D') } this.data.firstShow = true diff --git a/pages/moment/fragment/index.wxml b/pages/moment/fragment/index.wxml index 4e0731d..a12dbc8 100644 --- a/pages/moment/fragment/index.wxml +++ b/pages/moment/fragment/index.wxml @@ -27,22 +27,22 @@ - + - + - + - + - + - + diff --git a/pages/moment/info-item/index.js b/pages/moment/info-item/index.js index c4df4f8..1bb3f99 100644 --- a/pages/moment/info-item/index.js +++ b/pages/moment/info-item/index.js @@ -12,9 +12,6 @@ Component({ mclick: { type: Boolean, value: true } }, methods: { - onFlodTap: function(){ - this.setData({ unflod: !this.data.unflod }) - }, lookItem: function(e){ util.navigateTo('/pages/article/detail/index?id=' + this.data.item.id) } diff --git a/pages/moment/info-item/index.wxml b/pages/moment/info-item/index.wxml index 5a7d1bb..48acaa4 100644 --- a/pages/moment/info-item/index.wxml +++ b/pages/moment/info-item/index.wxml @@ -1,5 +1,5 @@ - + diff --git a/pages/moment/moment-item/index.js b/pages/moment/moment-item/index.js index 1113b70..4c1a2bc 100644 --- a/pages/moment/moment-item/index.js +++ b/pages/moment/moment-item/index.js @@ -41,6 +41,16 @@ Component({ }) }, lookItem: function(e){ + if(!this.data.item.isCooperate) { + if(!app.globalData.userInfo){ + util.navigateTo('/pages/login/index') + return + } + if(!app.globalData.userInfo.isVIP){ + util.showToast('当前纸厂信息仅仅VIP会员用户可查看') + return + } + } util.navigateTo('/pages/agent/factory/index?id=' + this.data.item.paperMillId) }, fetchItemList: function(){