From fefebe05e4415673bc1ac9ee9b94a2a3a615a2ae Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 2 Mar 2021 16:53:38 +0800 Subject: [PATCH] no message --- pages/agent/ability-item/index.js | 58 ++++++++++ pages/agent/ability-item/index.json | 7 ++ pages/agent/ability-item/index.wxml | 73 ++++++++++++ pages/agent/ability-item/index.wxss | 31 +++++ pages/agent/ability/index.js | 9 +- pages/agent/ability/index.json | 2 +- pages/agent/ability/index.wxml | 5 +- pages/agent/factory-fragment/index.js | 34 +++--- pages/agent/factory-fragment/index.wxml | 2 +- pages/agent/factory/index.js | 4 +- pages/agent/focus-fragment/index.js | 16 +-- pages/api/ztb.js | 5 + pages/article/allNewInfo/index.wxml | 2 +- pages/article/allNewInfo/index.wxss | 116 ------------------- pages/article/attentionPaperFactory/index.js | 6 +- pages/article/feedback/index.wxml | 3 +- pages/home/attentionPaperList/index.js | 2 +- pages/login/index.js | 11 +- utils/util.js | 4 +- 19 files changed, 209 insertions(+), 181 deletions(-) create mode 100644 pages/agent/ability-item/index.js create mode 100644 pages/agent/ability-item/index.json create mode 100644 pages/agent/ability-item/index.wxml create mode 100644 pages/agent/ability-item/index.wxss diff --git a/pages/agent/ability-item/index.js b/pages/agent/ability-item/index.js new file mode 100644 index 0000000..6089ca3 --- /dev/null +++ b/pages/agent/ability-item/index.js @@ -0,0 +1,58 @@ +// pages/message/index.js +const util = require('../../../utils/util') +const app = getApp() + +Component({ + options: { + addGlobalClass: true, + multipleSlots: true + }, + properties: { + item: { type: Object, value: null } + }, + data: { + kg: app.globalData.kg + }, + lifetimes: { + // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 + attached: function () { + this.setData({ kg: app.globalData.kg }) + } + }, + methods: { + // lookItem: function (e) { + // util.navigateTo('/pages/agent/factory/index?id=' + this.data.item.paperMillId) + // }, + unflodItem: function(){ + this.setData({ ['item.fold']: !this.data.item.fold }) + }, + checkTag: function(event){ + var cateIndex = -1 + if(util.isEmpty(this.data.item.cateIndex)){ + cateIndex = event.currentTarget.dataset.ck + } else if(this.data.item.cateIndex != event.currentTarget.dataset.ck){ + cateIndex = event.currentTarget.dataset.ck + } + if(cateIndex >= 0){ + this.setData({ ['item.cateIndex']: cateIndex }) + } + }, + saleGood: function(e){ + if (!app.globalData.userInfo) { + wx.navigateTo({ url: '/pages/login/index' }) + return + } + if(util.isEmpty(this.data.item.cateIndex)){ + util.showToast('请选择一个纸品') + return + } + if(util.isEmpty(this.data.item.paperCategoryList[this.data.item.cateIndex].unitPrice)){ + util.showToast('该纸品暂无报价,无法卖货') + return + } + var categoryId = this.data.item.paperCategoryList[this.data.item.cateIndex].categoryId + wx.navigateTo({ url: '/pages/agent/edit/index?id=' + this.data.item.paperMillId + '&categoryId=' + categoryId }) + } + } + +}) \ No newline at end of file diff --git a/pages/agent/ability-item/index.json b/pages/agent/ability-item/index.json new file mode 100644 index 0000000..4a8859e --- /dev/null +++ b/pages/agent/ability-item/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "wux-button": "/components/button/index", + "wux-image": "/components/image/index" + } +} \ No newline at end of file diff --git a/pages/agent/ability-item/index.wxml b/pages/agent/ability-item/index.wxml new file mode 100644 index 0000000..e60071e --- /dev/null +++ b/pages/agent/ability-item/index.wxml @@ -0,0 +1,73 @@ + + + + + + + + + + {{item.name}} + + {{item.locProvinceName + item.locCityName + item.locDistrictName}} + | + 已代卖:{{formate.formateWeight(item.cumulativeWeight, kg)}} + | + 昨日排队:{{item.yesterdayTotalQuantity}}辆 + 昨日排队:-- + + + + 代卖费: + {{formate.formatePrice2(item.proxypaySurcharge, kg)}} + + + 纸厂账期: + {{item.foreignPaybackIntever}}天 + + + + + + + + + + {{cateItem.categoryName}} + {{formate.formatePrice2(cateItem.unitPrice, kg)}} + 暂无报价 + + + 价格更新:{{item.priceDate}} + + + {{formate.formatePrice(cateItem.floatingPrice, kg)}} + 较昨日 + + + + {{formate.formatePrice(-cateItem.floatingPrice, kg)}} + 较昨日 + + + - + - + + + + + + + + 我要卖货 + + + + {{item.fold ? '点击收起' : '查看全部' }}({{item.paperCategoryList.length}}) + + + + + + + \ No newline at end of file diff --git a/pages/agent/ability-item/index.wxss b/pages/agent/ability-item/index.wxss new file mode 100644 index 0000000..521af89 --- /dev/null +++ b/pages/agent/ability-item/index.wxss @@ -0,0 +1,31 @@ +/* pages/mall/shops/index.wxss */ +.item-content { + background: rgba(255, 255, 255, 1); + padding: 32rpx; +} + +.item-cate { + flex: 5; + padding: 10rpx 30rpx; + border-radius: 10rpx; + border: 1rpx solid #f3f3f3; + background-color: #f3f3f3; +} + +.cate-tag { + background-color: #e6f7ff; + border: 1rpx solid #1890ff; +} + +.image-load { + width: 54px; + height: 54px; + display: flex; + align-items: center; + justify-content: center; +} + +.transform { + transform-origin: 50% 50%; + transform: rotate(180deg); +} diff --git a/pages/agent/ability/index.js b/pages/agent/ability/index.js index 5420ec7..28afd54 100644 --- a/pages/agent/ability/index.js +++ b/pages/agent/ability/index.js @@ -1,5 +1,5 @@ // pages/agent/index/index.js -import { getFactoryPrice } from "../../api/ztb" +import { getActivityList } from "../../api/ztb" const app = getApp() Page({ @@ -16,10 +16,7 @@ Page({ top: 0, orderList: [], form: { - cityId: '', - enableSalesAgent: 1, - pageNum: 1, - listType: 0 + pageNum: 1 } }, /** @@ -49,7 +46,7 @@ Page({ } else { this.setData({ requesting: true }) } - getFactoryPrice(this.data.form).then(result => { + getActivityList(this.data.form).then(result => { if (result.data.records.length) { var respList = result.data.records let nowList = `orderList[${this.data.orderList.length}]` diff --git a/pages/agent/ability/index.json b/pages/agent/ability/index.json index 841a51d..5958f8b 100644 --- a/pages/agent/ability/index.json +++ b/pages/agent/ability/index.json @@ -7,6 +7,6 @@ "refresh-view": "/components/refresher/index", "wux-image": "/components/image/index", "wux-divider": "/components/divider/index", - "agent-item": "/pages/agent/agent-item/index" + "ability-item": "/pages/agent/ability-item/index" } } \ No newline at end of file diff --git a/pages/agent/ability/index.wxml b/pages/agent/ability/index.wxml index f559ab8..2b1a1e9 100644 --- a/pages/agent/ability/index.wxml +++ b/pages/agent/ability/index.wxml @@ -1,7 +1,6 @@ - - 代卖活动 + 拼团活动 @@ -14,7 +13,7 @@ - + diff --git a/pages/agent/factory-fragment/index.js b/pages/agent/factory-fragment/index.js index 361d163..79c242d 100644 --- a/pages/agent/factory-fragment/index.js +++ b/pages/agent/factory-fragment/index.js @@ -1,5 +1,5 @@ // pages/agent/index/index.js -import { getFactoryPrice, getFactoryCity } from "../../api/ztb" +import { getFactoryPrice, getFactoryCity, hasActivity } from "../../api/ztb" const app = getApp() Component({ @@ -28,32 +28,27 @@ Component({ enableSalesAgent: 1, pageNum: 1, listType: 0 - } + }, + firstShow: false }, lifetimes: { // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 attached: function () { this.setData({ height: app.globalData.fragmentHeight - 90, kg: app.globalData.kg }) - this.fetchRegionList() - this.fetchPapersList() + if(app.globalData.userInfo){ + hasActivity().then(result => { + + }) + } } }, methods: { - onEvent: function (message) { - if (message.what == 1100 || message.what == 1101) { - this.data.form = { - cityId: '', - enableSalesAgent: 1, - pageNum: 1, - listType: 1 - } - this.setData({ bidType: 2 }) - this.data.orderList = [] + onRestart: function(){ + if (!this.data.firstShow) { + this.fetchRegionList() this.fetchPapersList() } - }, - onRestart: function(){ - + this.data.firstShow = true }, fetchRegionList: function () { getFactoryCity().then(result => { @@ -65,10 +60,7 @@ Component({ for (let index = 0; index < this.data.cateList.length; index++) { this.data.tabList.push(this.data.cateList[index].cityName) } - this.setData({ - tabList: this.data.tabList, - scrolled: this.data.cateList.length >= 5 - }) + this.setData({ tabList: this.data.tabList, scrolled: this.data.cateList.length >= 5 }) }) }, onTabChange: function ({ detail }) { diff --git a/pages/agent/factory-fragment/index.wxml b/pages/agent/factory-fragment/index.wxml index 251c9ca..99f9741 100644 --- a/pages/agent/factory-fragment/index.wxml +++ b/pages/agent/factory-fragment/index.wxml @@ -4,7 +4,7 @@ - + diff --git a/pages/agent/factory/index.js b/pages/agent/factory/index.js index b3bb785..8e9ea1e 100644 --- a/pages/agent/factory/index.js +++ b/pages/agent/factory/index.js @@ -213,7 +213,7 @@ Page({ }) model.follow = true this.userPushFollowMillFct(model) - setTimeout(() => event.emit('factoryDetails', { what: 1101, desc: 'factoryDetails' }), 1000) + setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) } @@ -224,7 +224,7 @@ Page({ }) model.follow = false this.userPushFollowMillFct(model) - setTimeout(() => event.emit('factoryDetails', { what: 1101, desc: 'factoryDetails' }), 1000) + setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) } }, diff --git a/pages/agent/focus-fragment/index.js b/pages/agent/focus-fragment/index.js index 2b0eb8a..b7b008f 100644 --- a/pages/agent/focus-fragment/index.js +++ b/pages/agent/focus-fragment/index.js @@ -37,17 +37,15 @@ Component({ attached: function () { this.setData({ height: app.globalData.fragmentHeight, kg: app.globalData.kg }) this.fetchPapersList() - event.on('factoryDetails', this, this.onEvent) - event.on('attentionPaperList', this, this.onEvent) + event.on('EventMessage', this, this.onEvent) }, detached: function () { - event.remove('factoryDetails', this) - event.remove('attentionPaperList', this) + event.remove('EventMessage', this) } }, methods: { onEvent: function (message) { - if (message.what == 1100 || message.what == 1101) { + if (message.what == 1100 || message.what == 1101 || message.what == 888) { this.onRefreshList() } }, @@ -123,15 +121,9 @@ Component({ }) } } else { - this.setData({ - finished: true, - requesting: false, - loading: false, - pageNum: 1 - }) + this.setData({ requesting: false, finished: true, loading: false }) } }).catch(err => { - //异常回调 this.setData({ requesting: false, finished: true, loading: false }) }) }, diff --git a/pages/api/ztb.js b/pages/api/ztb.js index 7f50b8c..febd64c 100644 --- a/pages/api/ztb.js +++ b/pages/api/ztb.js @@ -46,6 +46,9 @@ const createProxyOrder = (params) => mPost(`/recycle-service/proxy-sell/create/o const cancelProxyOrder = (id) => mPost(`/recycle-service/proxy-sell/cancel/order/${id}`, null, zconfig) const cancelReservation = (id) => mPost(`/recycle-service/proxy-sell/cancel/reservation/${id}`, null, zconfig) const cancelProxyOrderItem = (id) => mPost(`/recycle-service/proxy-sell/cancel/order-item/${id}`, null, zconfig) + +const hasActivity = () => mGet(`/recycle-service/proxy-sell-activity/get/has-activity`, null, zconfig) +const getActivityList = (params) => mGet(`/recycle-service//proxy-sell-activity/list`, params, zconfig) // /purchase/get/product-list 获取店铺采购商品列表接口 const getProductList = (params) => mGet(`/recycle-service/purchase/get/product-list`, params, zconfig) // /recycle-service/get/store-product-list @@ -157,6 +160,8 @@ export { cancelProxyOrder, cancelReservation, cancelProxyOrderItem, + hasActivity, + getActivityList, getProductList, getStoreProductList, getStoreInfo, diff --git a/pages/article/allNewInfo/index.wxml b/pages/article/allNewInfo/index.wxml index 9c3688d..61fbf4f 100644 --- a/pages/article/allNewInfo/index.wxml +++ b/pages/article/allNewInfo/index.wxml @@ -47,7 +47,7 @@ 最近扣点 操作 - + {{cell.categoryName|| '---'}} {{cell.unitPrice*1000|| 0}} {{cell.floatPrice*1000|| 0}} diff --git a/pages/article/allNewInfo/index.wxss b/pages/article/allNewInfo/index.wxss index 537fede..cef7405 100644 --- a/pages/article/allNewInfo/index.wxss +++ b/pages/article/allNewInfo/index.wxss @@ -3,122 +3,6 @@ page { background-color: white; } -.booking-tool { - width: calc(100% - 20px); - background-color: #008AFF; - position: fixed; - left: 25px; -} - -.roder-add { - display: flex; - justify-content: center; - align-items: center; - width: 100rpx; - height: 100rpx; - background-color: #008AFF; - border-radius: 50rpx; - position: absolute; - top: 24px; - right: 24px; - box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); -} - -.boderLine { - width: 100%; - height: 50rpx; - background-color: #f3f3f3; -} - -.midTietle { - height: 100rpx; - width: 100%; - background-color: white; - display: flex; - justify-content: space-between; - padding: 0rpx 40rpx 0rpx 40rpx; -} - -.midTietleText1 { - height: 100rpx; - line-height: 100rpx; - font-family: PingFangSC-Medium; - font-size: 36rpx; - color: rgba(0, 0, 0, 0.85); - letter-spacing: 0; - text-align: left; -} - -.midTietleText2 { - height: 100rpx; - line-height: 100rpx; - font-family: PingFangSC-Regular; - font-size: 28rpx; - color: rgba(0, 0, 0, 0.65); - letter-spacing: 0; - text-align: right; -} - -.zt { - background-color: white; -} - -.topTitle { - display: flex; - justify-content: space-between; -} - -.topRight { - width: 50%; - height: 60rpx; -} - -.topLeft { - width: 50%; - height: 60rpx; - display: flex; - justify-content: space-between; -} - -.topLeftText { - font-family: PingFangSC-Medium; - font-size: 36rpx; - color: #FFFFFF; - letter-spacing: 0; - height: 60rpx; - line-height: 60rpx; - padding-left: 32rpx; -} - -.topLeftTime { - font-family: PingFangSC-Medium; - font-size: 28rpx; - color: #FFFFFF; - letter-spacing: 0; - height: 60rpx; - line-height: 60rpx; -} - -.topRightText { - font-family: PingFangSC-Medium; - font-size: 28rpx; - color: #FFFFFF; - letter-spacing: 0; - height: 60rpx; - line-height: 60rpx; - float: right; - margin-right: 38.5rpx; -} - -.topRightIcon { - height: 60rpx; - float: right; - display: flex; - align-items: center; - margin-right: 36.3rpx; - margin-top: 10rpx -} - .onDataImg { width: 320rpx; height: 249rpx; diff --git a/pages/article/attentionPaperFactory/index.js b/pages/article/attentionPaperFactory/index.js index b2e6d1f..83458ea 100644 --- a/pages/article/attentionPaperFactory/index.js +++ b/pages/article/attentionPaperFactory/index.js @@ -40,11 +40,9 @@ Page({ this.getFactoryPriceFct(this.data.model) }, toMyInfo: function () { - event.emit('attentionPaperList', { what: 1100, desc: 'attentionPaperList' }) - wx.navigateBack({ - }) + event.emit('EventMessage', { what: 1100, desc: 'attentionPaperList' }) + wx.navigateBack() }, - /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/article/feedback/index.wxml b/pages/article/feedback/index.wxml index 2f86f46..707153b 100644 --- a/pages/article/feedback/index.wxml +++ b/pages/article/feedback/index.wxml @@ -29,10 +29,9 @@ - + - 提交反馈 diff --git a/pages/home/attentionPaperList/index.js b/pages/home/attentionPaperList/index.js index 01f7aaa..fc4878c 100644 --- a/pages/home/attentionPaperList/index.js +++ b/pages/home/attentionPaperList/index.js @@ -36,7 +36,7 @@ Page({ this.getFactoryPriceFct(this.data.model) }, toMyInfo: function () { - event.emit('attentionPaperList', { what: 1100, desc: 'attentionPaperList' }) + event.emit('EventMessage', { what: 1100, desc: 'attentionPaperList' }) wx.navigateBack({}) }, backspace: function () { diff --git a/pages/login/index.js b/pages/login/index.js index 1885717..17525af 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -51,17 +51,13 @@ Page({ }, onLoad: function (options) { if (options.mobile) { - this.setData({ - ['form.mobile']: options.mobile - }) + this.setData({ ['form.mobile']: options.mobile }) } this.wxLogin() var check = storage.get('AgreeCheck') app.globalData.kg = storage.get('ztb-kg') if (check) { - this.setData({ - check: true - }) + this.setData({ check: true }) } }, wxLogin: function () { @@ -103,7 +99,6 @@ Page({ } else { this.setData({ loging: false}) wx.hideLoading() - wx.navigateBack() event.emit('EventMessage', { what: 888, desc: 'Logined' }) getBaseInfo().then(result => { app.globalData.userInfo = result.data @@ -138,7 +133,6 @@ Page({ } getOrderExists().then(result => { wx.hideLoading() - if (Number(result.data) != 1 || !app.evn) { getBaseInfo().then(result => { app.globalData.userInfo = result.data @@ -155,7 +149,6 @@ Page({ this.setData({ loging: false}) }) } else { - getBaseInfo().then(result => { app.globalData.userInfo = result.data this.setData({ loging: false}) diff --git a/utils/util.js b/utils/util.js index a38bbee..279af3d 100644 --- a/utils/util.js +++ b/utils/util.js @@ -188,8 +188,8 @@ const tokenList = [ '/pages/shop/detail/index', '/pages/article/publish/index', '/pages/home/attentionPaperList/index', - '/pages/article/feedback/index' - + '/pages/article/feedback/index', + 'pages/agent/edit/index' ] function navigateTo(url){