Browse Source

no message

featrue/v4.3
xpz2018 5 years ago
parent
commit
fefebe05e4
19 changed files with 209 additions and 181 deletions
  1. 58
      pages/agent/ability-item/index.js
  2. 7
      pages/agent/ability-item/index.json
  3. 73
      pages/agent/ability-item/index.wxml
  4. 31
      pages/agent/ability-item/index.wxss
  5. 9
      pages/agent/ability/index.js
  6. 2
      pages/agent/ability/index.json
  7. 5
      pages/agent/ability/index.wxml
  8. 34
      pages/agent/factory-fragment/index.js
  9. 2
      pages/agent/factory-fragment/index.wxml
  10. 4
      pages/agent/factory/index.js
  11. 16
      pages/agent/focus-fragment/index.js
  12. 5
      pages/api/ztb.js
  13. 2
      pages/article/allNewInfo/index.wxml
  14. 116
      pages/article/allNewInfo/index.wxss
  15. 6
      pages/article/attentionPaperFactory/index.js
  16. 3
      pages/article/feedback/index.wxml
  17. 2
      pages/home/attentionPaperList/index.js
  18. 11
      pages/login/index.js
  19. 4
      utils/util.js

58
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 })
}
}
})

7
pages/agent/ability-item/index.json

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"wux-button": "/components/button/index",
"wux-image": "/components/image/index"
}
}

73
pages/agent/ability-item/index.wxml

@ -0,0 +1,73 @@
<!--pages/message/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<view class="flex flex-justify item-content">
<wux-image width="{{54}}" height="{{54}}" shape="rounded" lazyLoad="true" src="{{item.logoImg}}" mode="aspectFill">
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image>
<image class="image-load" slot="error" src="/assets/image/def_image.png"></image>
<image class="image-load" slot="empty" src="/assets/image/def_image.png"></image>
</wux-image>
<view style="margin-left:24rpx;flex:1">
<view class="text-sg text-cut text-bold">{{item.name}}</view>
<view class="text-xs text-gray" style="margin-top:4rpx">
<text>{{item.locProvinceName + item.locCityName + item.locDistrictName}}</text>
<text class="text-gray" style="margin: 0rpx 8rpx" wx:if="{{item.cumulativeWeight > 0}}">|</text>
<text wx:if="{{item.cumulativeWeight > 0}}">已代卖:{{formate.formateWeight(item.cumulativeWeight, kg)}}</text>
<text class="text-gray" style="margin: 0rpx 8rpx">|</text>
<text wx:if="{{item.yesterdayTotalQuantity && item.yesterdayTotalQuantity >= 0}}">昨日排队:{{item.yesterdayTotalQuantity}}辆</text>
<text wx:else>昨日排队:--</text>
</view>
<view class="flex text-df" style="margin-top:4rpx">
<view class="flex" wx:if="{{item.proxypaySurcharge}}">
<text class="text-black">代卖费:</text>
<text class="text-red">{{formate.formatePrice2(item.proxypaySurcharge, kg)}}</text>
</view>
<view class="flex" style="margin-left:64rpx" wx:if="{{item.foreignPaybackIntever}}">
<text class="text-black">纸厂账期:</text>
<text class="text-red">{{item.foreignPaybackIntever}}天</text>
</view>
</view>
</view>
<text class="cuIcon-right text-gray" style="font-size:18px"></text>
</view>
<view class="bg-white" style="padding:0rpx 32rpx 10rpx 32rpx">
<view class="flex" wx:for-item="cateItem" wx:for-index="ck" wx:for="{{item.paperCategoryList}}" wx:key="ck" wx:if="{{item.fold || ck < 3}}" style="margin-bottom: 20rpx">
<view class="item-cate {{item.cateIndex == ck ? 'cate-tag' : ''}}" data-page="{{pageIndex}}" data-index="{{index}}" data-ck="{{ck}}" catchtap="checkTag">
<view class="flex flex-justify">
<view class="text-sg text-black">{{cateItem.categoryName}}</view>
<text class="text-sg text-black" wx:if="{{cateItem.unitPrice}}">{{formate.formatePrice2(cateItem.unitPrice, kg)}}</text>
<text class="text-sg text-gray" wx:else>暂无报价</text>
</view>
<view class="flex flex-justify text-xs text-gray" style="margin-top:4rpx">
<text>价格更新:{{item.priceDate}}</text>
<view class="flex flex-center" style="padding:6rpx 0rpx" wx:if="{{cateItem.floatingPrice > 0}}">
<text class="cuIcon-refresharrow text-red transform" style="font-size:24rpx;margin-top:2rpx;"></text>
<text class="text-red text-xs" style="padding-top:2rpx">{{formate.formatePrice(cateItem.floatingPrice, kg)}}</text>
<text class="text-xs text-gray" style="margin-left:16rpx">较昨日</text>
</view>
<view class="flex flex-center text-df" style="padding:6rpx 0rpx" wx:elif="{{cateItem.floatingPrice < 0}}">
<text class="cuIcon-refresharrow text-green" style="font-size:24rpx;margin-top:2rpx;"></text>
<text class="text-green text-xs" style="padding-top:2rpx">{{formate.formatePrice(-cateItem.floatingPrice, kg)}}</text>
<text class="text-xs text-gray" style="margin-left:16rpx">较昨日</text>
</view>
<view class="flex flex-center text-sg" style="margin-left:24rpx" wx:else>
<text class="text-xl text-gray">-</text>
<text class="text-xl text-gray" style="margin-left:4rpx">-</text>
</view>
</view>
</view>
</view>
<view class="flex" style="padding: 4rpx 0rpx 16rpx 0rpx;" wx:if="{{item.paperCategoryList.length > 0}}">
<view style="flex:1"></view>
<view style="flex:1.2">
<wux-button block type="positive" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-button>
</view>
<view class="flex flex-center" style="flex:1;justify-content: flex-end">
<view data-page="{{pageIndex}}" data-index="{{index}}" catchtap="unflodItem" wx:if="{{item.paperCategoryList.length > 3}}">
<text class="text-blue text-df">{{item.fold ? '点击收起' : '查看全部' }}({{item.paperCategoryList.length}})</text>
</view>
<view style="margin-left:4rpx;padding-top:8rpx" data-page="{{pageIndex}}" data-index="{{index}}" catchtap="unflodItem" wx:if="{{item.paperCategoryList.length > 3}}">
<text class="cuIcon-{{item.fold ? 'fold' : 'unfold'}} text-blue" style="font-size:16px;"></text>
</view>
</view>
</view>
</view>

31
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);
}

9
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}]`

2
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"
}
}

5
pages/agent/ability/index.wxml

@ -1,7 +1,6 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">代卖活动</view>
<view slot="content">拼团活动</view>
</cu-custom>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
@ -14,7 +13,7 @@
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<view wx:for="{{pageItem}}" wx:key="index">
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view>
<agent-item item="{{item}}"></agent-item>
<ability-item item="{{item}}"></ability-item>
</view>
</view>
<!--加载更多的UI-->

34
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 }) {

2
pages/agent/factory-fragment/index.wxml

@ -4,7 +4,7 @@
<view class="nav bg-white fixed" style="top:{{CustomBar}}px;height:90rpx;" wx:if="{{tabList.length}}">
<wux-tabi scroll="{{scrolled}}" tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi>
</view>
<view class="bg-white" style="height:90rpx;width:100%" wx:if="{{tabList.length}}"></view>
<view class="bg-white" style="height:90rpx;width:100%"></view>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
<view class="bg-white list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">

4
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)
}
},

16
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 })
})
},

5
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,

2
pages/article/allNewInfo/index.wxml

@ -47,7 +47,7 @@
<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>
<view class="flex flex-justify" style="margin-top:20rpx" wx:for="{{ item.paperCategoryList }}" wx:for-item="cell" wx:key="cell.categoryId" style="background-color:white;margin-top:10rpx">
<view class="flex flex-justify" style="margin-top:20rpx" wx:for="{{ item.paperCategoryList }}" wx:for-item="cell" wx:key="index" style="background-color:white;margin-top:10rpx">
<view class="text-df {{cell.categoryName>0?'text-red':(cell.categoryName<0?'text-green':'text-black')}}" style="flex:1;text-align: center">{{cell.categoryName|| '---'}}</view>
<view class="text-df {{cell.unitPrice>0?'text-red':(cell.unitPrice<0?'text-green':'text-black')}}" style="flex:1;text-align: center" style="flex:1;text-align: center">{{cell.unitPrice*1000|| 0}}</view>
<view class="text-df {{cell.floatPrice>0?'text-red':(cell.floatPrice<0?'text-green':'text-black')}}" style="flex:1;text-align: center" style="flex:1;text-align: center">{{cell.floatPrice*1000|| 0}}</view>

116
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;

6
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()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

3
pages/article/feedback/index.wxml

@ -29,10 +29,9 @@
</view>
<view style="padding-left:32rpx;padding-right:32rpx">
<view class="textareaView">
<textarea class="textarea" placeholder="请输入反馈内容,最多200字" value='{{postForm.content}}' bindinput='textareaBindblur'></textarea>
<textarea class="textarea" placeholder="请输入反馈内容,最多200字" value='{{postForm.content}}' style="padding:16rpx" bindinput='textareaBindblur'></textarea>
</view>
</view>
</view>
<view class="view4" bindtap="subFeedBack">
<view class="sbtn">提交反馈</view>

2
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 () {

11
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})

4
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){

Loading…
Cancel
Save