diff --git a/api/ztb.js b/api/ztb.js index a2ea044..6c33b68 100644 --- a/api/ztb.js +++ b/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, diff --git a/app.json b/app.json index b15a050..4d223fb 100644 --- a/app.json +++ b/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": "您的位置信息将用于获取您所在城市的最新纸厂行情、报价等信息。" diff --git a/assets/popup/eighty-member.png b/assets/popup/eighty-member.png new file mode 100644 index 0000000..b0adaf0 Binary files /dev/null and b/assets/popup/eighty-member.png differ diff --git a/assets/popup/no-zige.png b/assets/popup/no-zige.png new file mode 100644 index 0000000..f1f94cb Binary files /dev/null and b/assets/popup/no-zige.png differ diff --git a/assets/popup/payment-success.png b/assets/popup/payment-success.png new file mode 100644 index 0000000..d3d2c9f Binary files /dev/null and b/assets/popup/payment-success.png differ diff --git a/assets/popup/serve-member.png b/assets/popup/serve-member.png new file mode 100644 index 0000000..c642d63 Binary files /dev/null and b/assets/popup/serve-member.png differ diff --git a/pages/agent/ability/index.js b/pages/agent/ability/index.js index 6f604d0..b084101 100644 --- a/pages/agent/ability/index.js +++ b/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 () { diff --git a/pages/agent/factory/index.js b/pages/agent/factory/index.js index 28b1cce..847f27a 100644 --- a/pages/agent/factory/index.js +++ b/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() diff --git a/pages/agent/fragment/index.js b/pages/agent/fragment/index.js index fb67413..13a5c0c 100644 --- a/pages/agent/fragment/index.js +++ b/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 diff --git a/pages/home/index/index.js b/pages/home/index/index.js index 3450a5c..d867564 100644 --- a/pages/home/index/index.js +++ b/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') { diff --git a/pages/html/logistics/index.wxss b/pages/html/logistics/index.wxss deleted file mode 100644 index dbf5961..0000000 --- a/pages/html/logistics/index.wxss +++ /dev/null @@ -1,4 +0,0 @@ -/* pages/html/logistics/index.wxss */ -.margin-top{ - margin-top:24rpx; -} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index aa20025..de5351c 100644 --- a/pages/index/index.js +++ b/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 () { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 317da30..0052a5c 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -29,7 +29,7 @@ + bind:load="onImageLoad" bind:click="onImageClick" mode="aspectFit"> diff --git a/pages/moment/attention/index.js b/pages/moment/attention/index.js index fa3e139..b705b10 100644 --- a/pages/moment/attention/index.js +++ b/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 diff --git a/pages/moment/recommend/index.js b/pages/moment/recommend/index.js index 0d57e83..5d41ab9 100644 --- a/pages/moment/recommend/index.js +++ b/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}]` diff --git a/pages/morder/detail/index.wxml b/pages/morder/detail/index.wxml index 0c2ce6f..c4b2984 100644 --- a/pages/morder/detail/index.wxml +++ b/pages/morder/detail/index.wxml @@ -39,7 +39,7 @@ - + diff --git a/assets/image/logo_qn.png b/submodel/images/logo_qn.png similarity index 100% rename from assets/image/logo_qn.png rename to submodel/images/logo_qn.png diff --git a/pages/html/logistics/index.js b/submodel/pages/html/logistics/index.js similarity index 87% rename from pages/html/logistics/index.js rename to submodel/pages/html/logistics/index.js index d2a1edf..21e4319 100644 --- a/pages/html/logistics/index.js +++ b/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 diff --git a/pages/html/logistics/index.json b/submodel/pages/html/logistics/index.json similarity index 100% rename from pages/html/logistics/index.json rename to submodel/pages/html/logistics/index.json diff --git a/pages/html/logistics/index.wxml b/submodel/pages/html/logistics/index.wxml similarity index 89% rename from pages/html/logistics/index.wxml rename to submodel/pages/html/logistics/index.wxml index 0220a7e..5061be4 100644 --- a/pages/html/logistics/index.wxml +++ b/submodel/pages/html/logistics/index.wxml @@ -1,10 +1,9 @@ - 千鸟物流 - + 业务负责人:蒋远 diff --git a/submodel/pages/html/logistics/index.wxss b/submodel/pages/html/logistics/index.wxss new file mode 100644 index 0000000..07873b2 --- /dev/null +++ b/submodel/pages/html/logistics/index.wxss @@ -0,0 +1,3 @@ +.margin-top{ + margin-top:24rpx; +} \ No newline at end of file diff --git a/pages/home/service/index.js b/submodel/pages/html/service/index.js similarity index 86% rename from pages/home/service/index.js rename to submodel/pages/html/service/index.js index 4096006..de04b8c 100644 --- a/pages/home/service/index.js +++ b/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({ /** diff --git a/pages/home/service/index.json b/submodel/pages/html/service/index.json similarity index 100% rename from pages/home/service/index.json rename to submodel/pages/html/service/index.json diff --git a/pages/home/service/index.wxml b/submodel/pages/html/service/index.wxml similarity index 78% rename from pages/home/service/index.wxml rename to submodel/pages/html/service/index.wxml index 17fa7e6..cb8c785 100644 --- a/pages/home/service/index.wxml +++ b/submodel/pages/html/service/index.wxml @@ -1,14 +1,11 @@ - 联系客服 - - - 020-82516486 + + 020-82516486 diff --git a/pages/home/service/index.wxss b/submodel/pages/html/service/index.wxss similarity index 86% rename from pages/home/service/index.wxss rename to submodel/pages/html/service/index.wxss index f88eff5..3098cda 100644 --- a/pages/home/service/index.wxss +++ b/submodel/pages/html/service/index.wxss @@ -1,4 +1,3 @@ -/* pages/home/service/index.wxss */ .mt-15 { margin-top: 24rpx; } diff --git a/utils/util.js b/utils/util.js index 6024e29..de41170 100644 --- a/utils/util.js +++ b/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'){