Browse Source

no message

featrue/v4.1
xpz2018 5 years ago
parent
commit
5504d2e478
6 changed files with 42 additions and 29 deletions
  1. 4
      pages/api/moment.js
  2. 8
      pages/api/ztb.js
  3. 21
      pages/index/index.js
  4. 2
      pages/index/index.wxml
  5. 23
      pages/mall/index/index.js
  6. 13
      pages/mall/price-index/index.js

4
pages/api/moment.js

@ -32,6 +32,7 @@ const likeMoment = (params) => mPost(`/information-center/article-reply/like-or-
const likeComment = (params) => mPost(`/information-center/article-reply/like-or-cancel/reply`, params, mconfig) const likeComment = (params) => mPost(`/information-center/article-reply/like-or-cancel/reply`, params, mconfig)
// /article-reply/reply 评论 // /article-reply/reply 评论
const commentMoment = (params) => mPost(`/information-center/article-reply/reply`, params, mconfig) const commentMoment = (params) => mPost(`/information-center/article-reply/reply`, params, mconfig)
const getCategoryPrice = (params) => mGet(`/information-center/getPaperCategoryPrice`, params, mconfig)
export { export {
mconfig, mconfig,
@ -46,5 +47,6 @@ export {
getCommentList, getCommentList,
likeMoment, likeMoment,
likeComment, likeComment,
commentMoment
commentMoment,
getCategoryPrice
} }

8
pages/api/ztb.js

@ -12,6 +12,9 @@ const zconfig = {
const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, zconfig) const loginToken = (params) => mPost(`/recycle-user-center/authorize/get/product-line-token/by/login-token`, params, zconfig)
///user/get/base-info基本信息 ///user/get/base-info基本信息
const getBaseInfo = () => mGet(`/recycle-service/user/get/base-info`, null, zconfig) const getBaseInfo = () => mGet(`/recycle-service/user/get/base-info`, null, zconfig)
const getPopupInfo = () => mGet(`/recycle-service/popup/get/popup`, null, zconfig)
const getBannerList = (type) => mGet(`/recycle-service/banner/get/banner-list/${type}`, null, zconfig)
const getSuccessNotices = () => mPost(`/recycle-service/get/recently-order-success-list`, null, zconfig)
// /get/all-paper-mill 获取全部纸厂列表 // /get/all-paper-mill 获取全部纸厂列表
const getAllFactoryList = () => mGet(`/recycle-service/get/all-paper-mill`, null, zconfig) const getAllFactoryList = () => mGet(`/recycle-service/get/all-paper-mill`, null, zconfig)
// /get/paper-mill-paper-category-price-list 获取纸厂品类价格信息列表 // /get/paper-mill-paper-category-price-list 获取纸厂品类价格信息列表
@ -80,10 +83,15 @@ const confirmBidding = (params) => mPost(`/recycle-service/confirm/bidding`, par
const cancelBidding = (id) => mPost(`/recycle-service/cancel/bidding-activity/${id}`, null, zconfig) const cancelBidding = (id) => mPost(`/recycle-service/cancel/bidding-activity/${id}`, null, zconfig)
const getMyBidding = (id) => mGet(`/recycle-service/get/my-bidding/${id}`, null, zconfig) const getMyBidding = (id) => mGet(`/recycle-service/get/my-bidding/${id}`, null, zconfig)
export { export {
zconfig, zconfig,
loginToken, loginToken,
getBaseInfo, getBaseInfo,
getPopupInfo,
getBannerList,
getSuccessNotices,
getAllFactoryList, getAllFactoryList,
getFactoryPrice, getFactoryPrice,
getFactoryCity, getFactoryCity,

21
pages/index/index.js

@ -1,7 +1,8 @@
import { config, getUserInfo} from "../api/user" import { config, getUserInfo} from "../api/user"
import { zconfig, loginToken } from "../api/ztb"
import { zconfig, loginToken, getPopupInfo } from "../api/ztb"
import { mconfig } from "../api/moment" import { mconfig } from "../api/moment"
const event = require('../../utils/event.js')
const util = require('../../utils/util')
const event = require('../../utils/event')
const storage = require('../../utils/storage') const storage = require('../../utils/storage')
const app = getApp() const app = getApp()
@ -108,6 +109,11 @@ Page({
if(this.data.path){ if(this.data.path){
wx.navigateTo({ url: this.data.path }) wx.navigateTo({ url: this.data.path })
} }
getPopupInfo().then(result => {
if(result.data){
this.setData({ landInfo: result.data })
}
})
return return
} }
loginToken({loginToken: app.globalData.token}).then(result => { loginToken({loginToken: app.globalData.token}).then(result => {
@ -119,14 +125,23 @@ Page({
if(this.data.path){ if(this.data.path){
wx.navigateTo({ url: this.data.path }) wx.navigateTo({ url: this.data.path })
} }
getPopupInfo().then(result => {
if(result.data){
this.setData({ landInfo: result.data })
}
})
// event.emit('EventMessage', { what: 888, desc: 'Logined' }) // event.emit('EventMessage', { what: 888, desc: 'Logined' })
}).catch(err => { }).catch(err => {
console.log(err)
wx.hideLoading() wx.hideLoading()
this.onResume() this.onResume()
if(this.data.path){ if(this.data.path){
wx.navigateTo({ url: this.data.path }) wx.navigateTo({ url: this.data.path })
} }
getPopupInfo().then(result => {
if(result.data){
this.setData({ landInfo: result.data })
}
})
}) })
}, },
onResume: function(){ onResume: function(){

2
pages/index/index.wxml

@ -28,7 +28,7 @@
<text class="cuIcon-roundclose text-white" style="font-size:64rpx"></text> <text class="cuIcon-roundclose text-white" style="font-size:64rpx"></text>
</view> </view>
<view class="wux-landscape__inner"> <view class="wux-landscape__inner">
<wux-image width="{{654}}" height="{{680}}" nuit="{{'rpx'}}" src="{{'http://cdn.skyvow.cn/redpacket.png'}}"
<wux-image width="{{654}}" height="{{680}}" nuit="{{'rpx'}}" src="{{landInfo.picUrl}}"
bind:load="onImageLoad" bind:click="onImageClick"> bind:load="onImageLoad" bind:click="onImageClick">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx"> <view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">
<text class="icon--refresher"></text> <text class="icon--refresher"></text>

23
pages/mall/index/index.js

@ -1,6 +1,5 @@
// pages/message/index.js // pages/message/index.js
import { getFactoryPrice, getProductList, getMiniProxyList } from "../../api/ztb"
const request = require('../../../utils/request') //导入模块
import { getFactoryPrice, getProductList, getMiniProxyList, getBannerList, getSuccessNotices } from "../../api/ztb"
const event = require('../../../utils/event') const event = require('../../../utils/event')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const app = getApp() const app = getApp()
@ -63,8 +62,11 @@ Component({
this.onRefreshList() this.onRefreshList()
} }
this.data.firstShow = true this.data.firstShow = true
if(!this.data.noticeList.length){
this.fetchBannerList()
if(!this.data.bannerList.length){
getBannerList(1).then(result => {
this.setData({ bannerList: result.data })
}).catch(err => {
})
} }
if(!this.data.noticeList.length){ if(!this.data.noticeList.length){
this.fetchNoticeList() this.fetchNoticeList()
@ -130,22 +132,12 @@ Component({
this.fetchAgentList() this.fetchAgentList()
} }
}, },
fetchBannerList: function(){
// /banner/get/banner-list/{type} 获取banner
request.get('/recycle-service/banner/get/banner-list/1').then(result => {
//成功回调
this.setData({ bannerList: result.data })
}).catch(err => {
})
},
fetchNoticeList: function(){ fetchNoticeList: function(){
if (this.data.loopRequesting) { if (this.data.loopRequesting) {
return return
} }
this.data.loopRequesting = true this.data.loopRequesting = true
// /get/recently-order-success-list获取最近成交订单的列表
request.post('/recycle-service/get/recently-order-success-list').then(result => {
//成功回调
getSuccessNotices().then(result => {
this.data.loopRequesting = false this.data.loopRequesting = false
this.data.noticeList = [] this.data.noticeList = []
if(result.data && result.data.length){ if(result.data && result.data.length){
@ -155,7 +147,6 @@ Component({
this.setData({noticeList: this.data.noticeList}) this.setData({noticeList: this.data.noticeList})
} }
}).catch(err => { }).catch(err => {
//异常回调
this.data.loopRequesting = false this.data.loopRequesting = false
}) })
}, },

13
pages/mall/price-index/index.js

@ -1,10 +1,10 @@
// pages/moment/price/index.js // pages/moment/price/index.js
const request = require('../../../utils/request') //导入模块
import { getCategoryPrice } from "../../api/moment"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const math = require('../../../utils/math') const math = require('../../../utils/math')
const storage = require('../../../utils/storage') const storage = require('../../../utils/storage')
const event = require('../../../utils/event.js')
var wxCharts = require('../../../utils/wxcharts.js')
const event = require('../../../utils/event')
var wxCharts = require('../../../utils/wxcharts')
const app = getApp() const app = getApp()
var lineChart = null var lineChart = null
const colors = ['#FF4229', '#FFAD2A', '#297BFF', '#29FF46', '#AD29FF'] const colors = ['#FF4229', '#FFAD2A', '#297BFF', '#29FF46', '#AD29FF']
@ -56,9 +56,7 @@ Page({
} else { } else {
this.setData({ requesting: true }) this.setData({ requesting: true })
} }
// /recycle-service/get/paper-mill-received-weight-list/on-today
request.get('/information-center/getPaperCategoryPrice').then(result => {
//成功回调
getCategoryPrice().then(result => {
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]` let nowList = `orderList[${this.data.orderList.length}]`
@ -106,8 +104,7 @@ Page({
if(!util.isEmpty(cateIds)){ if(!util.isEmpty(cateIds)){
this.data.idList = cateIds this.data.idList = cateIds
} }
request.get('/information-center/getPaperCategoryPrice', {idList: this.data.idList}).then(result => {
//成功回调
getCategoryPrice({idList: this.data.idList}).then(result => {
if(result.data.length <= 0){ if(result.data.length <= 0){
return return
} }

Loading…
Cancel
Save