Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
3e841f6432
26 changed files with 120 additions and 56 deletions
  1. 2
      api/ztb.js
  2. 11
      app.json
  3. BIN
      assets/popup/eighty-member.png
  4. BIN
      assets/popup/no-zige.png
  5. BIN
      assets/popup/payment-success.png
  6. BIN
      assets/popup/serve-member.png
  7. 12
      pages/agent/ability/index.js
  8. 4
      pages/agent/factory/index.js
  9. 12
      pages/agent/fragment/index.js
  10. 4
      pages/home/index/index.js
  11. 4
      pages/html/logistics/index.wxss
  12. 29
      pages/index/index.js
  13. 2
      pages/index/index.wxml
  14. 30
      pages/moment/attention/index.js
  15. 33
      pages/moment/recommend/index.js
  16. 2
      pages/morder/detail/index.wxml
  17. 0
      submodel/images/logo_qn.png
  18. 4
      submodel/pages/html/logistics/index.js
  19. 0
      submodel/pages/html/logistics/index.json
  20. 3
      submodel/pages/html/logistics/index.wxml
  21. 3
      submodel/pages/html/logistics/index.wxss
  22. 5
      submodel/pages/html/service/index.js
  23. 0
      submodel/pages/html/service/index.json
  24. 7
      submodel/pages/html/service/index.wxml
  25. 1
      submodel/pages/html/service/index.wxss
  26. 8
      utils/util.js

2
api/ztb.js

@ -16,6 +16,7 @@ const getBaseInfo = () => mGet(`/recycle-service/user/get/base-info`, null, zcon
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)
const hasGetMemberInfo = () => mGet(`/recycle-service/member/query/user-has-get-member`, null, zconfig)
// /get/all-paper-mill 获取全部纸厂列表
const getAllFactoryList = () => mGet(`/recycle-service/get/all-paper-mill`, null, zconfig)
// /get/paper-mill-paper-category-price-list 获取纸厂品类价格信息列表
@ -144,6 +145,7 @@ export {
loginToken,
getBaseInfo,
getPopupInfo,
hasGetMemberInfo,
getBannerList,
getSuccessNotices,
getAllFactoryList,

11
app.json

@ -3,7 +3,6 @@
"pages/index/index",
"pages/login/index",
"pages/home/about/index",
"pages/home/service/index",
"pages/home/mobile/index",
"pages/home/password/index",
"pages/home/setting/index",
@ -72,7 +71,6 @@
"pages/html/bankcard/index",
"pages/html/banner/index",
"pages/html/html/index",
"pages/html/logistics/index",
"pages/html/risk/index",
"pages/html/rules/index",
"pages/html/notice/index",
@ -82,6 +80,15 @@
"pages/moment/paper/index",
"pages/ztbvip/index"
],
"subpackages": [
{
"root": "submodel/",
"pages": [
"pages/html/logistics/index",
"pages/html/service/index"
]
}
],
"permission": {
"scope.userLocation": {
"desc": "您的位置信息将用于获取您所在城市的最新纸厂行情、报价等信息。"

BIN
assets/popup/eighty-member.png

Before After
Width: 750  |  Height: 640  |  Size: 59 KiB

BIN
assets/popup/no-zige.png

Before After
Width: 560  |  Height: 762  |  Size: 32 KiB

BIN
assets/popup/payment-success.png

Before After
Width: 560  |  Height: 762  |  Size: 26 KiB

BIN
assets/popup/serve-member.png

Before After
Width: 750  |  Height: 640  |  Size: 60 KiB

12
pages/agent/ability/index.js

@ -1,5 +1,5 @@
// pages/agent/index/index.js
import { getActivityList } from "../../../api/ztb"
import { hasActivity, getActivityList } from "../../../api/ztb"
const tdsdk = require('../../../libs/tdweapp')
const app = getApp()
@ -10,6 +10,7 @@ Page({
data: {
height: app.globalData.fragmentHeight,
kg: app.globalData.kg,
hasActivity: false,
loading: true,
requesting: false,
finished: false,
@ -25,8 +26,15 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ height: app.globalData.fragmentHeight })
wx.showLoading({ title: '加载中', mask: true })
this.fetchPapersList()
hasActivity().then(result => {
wx.hideLoading()
this.setData({ height: app.globalData.fragmentHeight, hasActivity: result.data })
}).catch(err => {
wx.hideLoading()
this.setData({ height: app.globalData.fragmentHeight })
})
},
// 下拉刷新...
onRefreshList: function () {

4
pages/agent/factory/index.js

@ -186,9 +186,7 @@ Page({
}
},
toService: function () {
wx.navigateTo({
url: '/pages/home/service/index'
})
wx.navigateTo({ url: '/submodel/pages/html/service/index' })
},
onShow: function () {
tdsdk.Page.onShow()

12
pages/agent/fragment/index.js

@ -38,17 +38,12 @@ Component({
},
triggered: false,
firstShow: false,
hasActivity: false
activity: 0
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
event.on('EventMessage', this, this.onEvent)
if(app.globalData.userInfo){
hasActivity().then(result => {
this.setData({ hasActivity: result.data })
})
}
// this.fetchRegionList()
// this.fetchPapersList()
},
@ -60,6 +55,11 @@ Component({
onRestart: function(){
this.fetchRegionList()
if(!this.data.firstShow){
if(app.globalData.userInfo){
hasActivity().then(result => {
this.setData({ activity: result.data ? 2 : 1 })
})
}
this.fetchPapersList()
}
this.data.firstShow = true

4
pages/home/index/index.js

@ -122,9 +122,9 @@ Component({
} else if (e.currentTarget.id == 'tovip') {
util.navigateTo('/pages/ztbvip/index')
} else if (e.currentTarget.id == 'myCus') {
util.navigateTo('/pages/home/service/index')
util.navigateTo('/submodel/pages/html/service/index')
} else if (e.currentTarget.id == 'qnLogistic') {
util.navigateTo('/pages/html/logistics/index')
util.navigateTo('/submodel/pages/html/logistics/index')
} else if (e.currentTarget.id == 'toMyMoney') {
util.navigateTo('/pages/bank/bill/index')
} else if (e.currentTarget.id == 'agent50') {

4
pages/html/logistics/index.wxss

@ -1,4 +0,0 @@
/* pages/html/logistics/index.wxss */
.margin-top{
margin-top:24rpx;
}

29
pages/index/index.js

@ -1,5 +1,5 @@
import { config, getUserInfo } from "../../api/user"
import { zconfig, loginToken, getBaseInfo, getPopupInfo } from "../../api/ztb"
import { zconfig, loginToken, getBaseInfo, getPopupInfo, hasGetMemberInfo } from "../../api/ztb"
import { pconfig } from "../../api/payment"
import { mconfig } from "../../api/moment"
const util = require('../../utils/util')
@ -92,12 +92,24 @@ Page({
defaultIndex: function () {
this.data.inited = true
this.locationing()
// this.onResume()
if (this.data.path && '/pages/index/index' != this.data.path) {
util.navigateTo(this.data.path)
}
if(!app.globalData.userInfo){
this.setData({ landInfo: {otherType: 10, picUrl: '/assets/popup/eighty-member.png'} })
} else {
hasGetMemberInfo().then(result => {
if (!result.data && !this.data.landInfo) {
if(app.globalData.userInfo.isVIP){
this.setData({ landInfo: {otherType: 11, picUrl: '/assets/popup/eighty-member.png'} })
} else {
this.setData({ landInfo: {otherType: 11, picUrl: '/assets/popup/serve-member.png'} })
}
}
})
}
getPopupInfo().then(result => {
if (result.data) {
if (result.data && !this.data.landInfo) {
this.setData({ landInfo: result.data })
}
})
@ -271,11 +283,16 @@ Page({
}
},
onImageClick: function () {
if (this.data.landInfo.redirectInfo.targetView == 'showH5') {
if(this.data.landInfo.otherType == 10){
// 进行会员领取的操作
util.navigateTo('/pages/login/index')
} else if(this.data.landInfo.otherType == 11){
// 进行会员领取的操作
} else if (this.data.landInfo.redirectInfo.targetView == 'showH5') {
util.navigateTo('/pages/html/html/index?link=' + this.data.landInfo.redirectInfo.params.id + '?title=' + this.data.landInfo.title)
return
} else {
util.navigateTarget(this.data.landInfo.redirectInfo)
}
util.navigateTarget(this.data.landInfo.redirectInfo)
this.setData({ visible: false, landInfo: null })
},
toRule: function () {

2
pages/index/index.wxml

@ -29,7 +29,7 @@
</view>
<view class="wux-landscape__inner">
<wux-image width="{{654}}" height="{{680}}" nuit="{{'rpx'}}" src="{{landInfo.picUrl}}"
bind:load="onImageLoad" bind:click="onImageClick">
bind:load="onImageLoad" bind:click="onImageClick" mode="aspectFit">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">
<text class="icon--refresher"></text>
</view>

30
pages/moment/attention/index.js

@ -22,6 +22,7 @@ Component({
requesting: false,
token: true,
finished: false,
dataIndex: 0,
orderList: []
},
lifetimes: {
@ -50,6 +51,7 @@ Component({
onEvent: function (message) {
if(message.what == 888){
if(!app.globalData.userInfo){
this.data.dataIndex = 0
this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, token: false, loading: false })
} else {
this.data.token = true
@ -63,6 +65,7 @@ Component({
if(!app.globalData.userInfo || this.data.requesting){
return
}
this.data.dataIndex = 0
this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, loading: true })
this.fetchList()
},
@ -74,6 +77,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

33
pages/moment/recommend/index.js

@ -22,6 +22,7 @@ Component({
requesting: false,
token: true,
finished: false,
dataIndex: 0,
orderList: []
},
lifetimes: {
@ -60,6 +61,7 @@ Component({
if (this.data.requesting) {
return
}
this.data.dataIndex = 0
this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, loading: true })
this.fetchList()
},
@ -72,23 +74,30 @@ Component({
if (result.data && result.data.records.length) {
var respList = result.data.records
var lastTime = null
// 对返回的消息列表进行处理,将同一天的消息显示在一起
for (let i = 0; i < respList.length; i++) {
if (util.isEmpty(lastTime)) {
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)
}
respList[i].tipsTime = lastTime
} else {
var itemTime = respList[i].latestQuoteTime
if (itemTime.length > 10) {
itemTime = itemTime.substring(0, 10)
}
if (lastTime !== itemTime) {
respList[i].tipsTime = itemTime
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
}
lastTime = itemTime
}
}
let nowList = `orderList[${this.data.orderList.length}]`

2
pages/morder/detail/index.wxml

@ -39,7 +39,7 @@
<view wx:if="{{orderInfo.status == 2 || orderInfo.status == 5}}">
<wux-divider show-text="{{ false }}"></wux-divider>
<wux-cell-group>
<wux-cell title="千鸟物流" is-link url="/pages/html/logistics/index">
<wux-cell title="千鸟物流" is-link url="/submodel/pages/html/logistics/index">
<view slot="header" class="cuIcon-deliver text-blue" style="width:32rpx;height:32rpx;margin-right:12rpx"></view>
</wux-cell>
</wux-cell-group>

assets/image/logo_qn.png → submodel/images/logo_qn.png

pages/html/logistics/index.js → submodel/pages/html/logistics/index.js

@ -1,20 +1,16 @@
// pages/html/logistics/index.js
Page({
/**
* 页面的初始数据
*/
data: {
tel: '135 2762 4895'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
callPhone: function () {
wx.makePhoneCall({
phoneNumber: this.data.tel

pages/html/logistics/index.json → submodel/pages/html/logistics/index.json

pages/html/logistics/index.wxml → submodel/pages/html/logistics/index.wxml

@ -1,10 +1,9 @@
<!--pages/html/logistics/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">千鸟物流</view>
</cu-custom>
<view class="bg-white flex flex-center" style="padding:48rpx 32rpx">
<image src="/assets/image/logo_qn.png" style="width: 112rpx;height:104rpx"></image>
<image src="/submodel/images/logo_qn.png" style="width: 112rpx;height:104rpx"></image>
<view class="text-xl" style="margin-left:24rpx" bindtap="callPhone">
<view class="text-xl">业务负责人:蒋远</view>
<view class="text-xl text-blod" style="margin-top:12rpx">

3
submodel/pages/html/logistics/index.wxss

@ -0,0 +1,3 @@
.margin-top{
margin-top:24rpx;
}

pages/home/service/index.js → submodel/pages/html/service/index.js

@ -1,6 +1,5 @@
// pages/home/service/index.js
import { postFeedback } from '../../../api/saas'
const util = require('../../../utils/util')
import { postFeedback } from '../../../../api/saas'
const util = require('../../../../utils/util')
Page({
/**

pages/home/service/index.json → submodel/pages/html/service/index.json

pages/home/service/index.wxml → submodel/pages/html/service/index.wxml

@ -1,14 +1,11 @@
<!--pages/home/service/index.wxml-->
<!--联系客服-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">联系客服</view>
</cu-custom>
<view class="col-1 bg-white mt-15 min-height350 padding" bindtap="callCustomerPhone">
<!-- <text>400-6881-001</text>
<text>联系客服</text> -->
<view class="text-center" style="margin-top:100rpx">
<text class="text-blue text-xl">020-82516486</text>
<view class="text-center" style="margin-top:60rpx">
<text class="text-blue text-sl">020-82516486</text>
</view>
<view class="text-center mt-15" style="font-size:75rpx">
<text class="cuIcon-servicefill" size="50"></text>

pages/home/service/index.wxss → submodel/pages/html/service/index.wxss

@ -1,4 +1,3 @@
/* pages/home/service/index.wxss */
.mt-15 {
margin-top: 24rpx;
}

8
utils/util.js

@ -189,6 +189,10 @@ const tokenList = [
]
function navigateTo(url){
if(url === '/pages/login/index'){
wx.navigateTo({ url: '/pages/login/index' })
return
}
var white = false
for (let index = 0; index < tokenList.length; index++) {
if(url.indexOf(tokenList[index]) != -1){
@ -229,9 +233,9 @@ function navigateTarget(redirectInfo){
} else if(redirectInfo.targetView == 'showProductList'){
navigateTo('/pages/mall/index/index?type=1')
} else if(redirectInfo.targetView == 'logistics'){
navigateTo('/pages/html/logistics/index')
navigateTo('/submodel/pages/html/logistics/index')
} else if(redirectInfo.targetView == 'contract'){
navigateTo('/pages/home/service/index')
navigateTo('/submodel/pages/html/service/index')
} else if(redirectInfo.targetView == 'myAddress'){
navigateTo('/pages/adress/list/index')
} else if(redirectInfo.targetView == 'myBankCard'){

Loading…
Cancel
Save