diff --git a/app.json b/app.json
index ad3923f..b15a050 100644
--- a/app.json
+++ b/app.json
@@ -63,7 +63,6 @@
"pages/withdrawal/vcheckout/index",
"pages/withdrawal/payment/index",
"pages/purchase/index/index",
- "pages/purchase/ability/index",
"pages/purchase/create/index",
"pages/purchase/detail/index",
"pages/message/index/index",
diff --git a/pages/agent/detail/index.js b/pages/agent/detail/index.js
index 1f02974..477b5d1 100644
--- a/pages/agent/detail/index.js
+++ b/pages/agent/detail/index.js
@@ -3,6 +3,7 @@ import { getProxyOrderInfo, cancelProxyOrder, cancelReservation, cancelProxyOrde
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const event = require('../../../utils/event')
+const tdsdk = require('../../../libs/tdweapp')
const app = getApp()
Page({
@@ -72,14 +73,11 @@ Page({
orderInfoStepLs[index1].orderItemTimeList[i] = element1.orderItemTimeList[i]
}
});
- this.setData({
- orderInfoStep: orderInfoStepLs
- })
+ this.setData({ orderInfoStep: orderInfoStepLs })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
- console.log(err)
})
},
getStr: function (index) {
@@ -200,9 +198,7 @@ Page({
})
},
editOrder: function () {
- wx.navigateTo({
- url: '/pages/agent/edit/index?orderId=' + this.data.orderInfo.orderId
- })
+ wx.navigateTo({ url: '/pages/agent/edit/index?orderId=' + this.data.orderInfo.orderId })
},
clipboard: function () {
wx.setClipboardData({
@@ -211,6 +207,15 @@ Page({
util.showToast('复制成功')
}
})
+ },
+ onShow: function () {
+ tdsdk.Page.onShow()
+ },
+ onHide: function(){
+ tdsdk.Page.onHide()
+ },
+ onUnload: function () {
+ tdsdk.Page.onUnload()
}
})
\ No newline at end of file
diff --git a/pages/agent/factory/index.js b/pages/agent/factory/index.js
index eee7d92..920a5a5 100644
--- a/pages/agent/factory/index.js
+++ b/pages/agent/factory/index.js
@@ -2,6 +2,7 @@
import { getFactoryPriceDetail, userPushFollowMill } from "../../../api/ztb"
import { getPreferList } from "../../../api/moment"
const event = require('../../../utils/event')
+const tdsdk = require('../../../libs/tdweapp.js')
const util = require('../../../utils/util')
const app = getApp()
@@ -197,7 +198,14 @@ Page({
url: '/pages/home/service/index'
})
},
+ onShow: function () {
+ tdsdk.Page.onShow()
+ },
+ onHide: function(){
+ tdsdk.Page.onHide()
+ },
onUnload: function () {
+ tdsdk.Page.onUnload()
event.remove('EventMessage', this)
},
onAttentionChange: function (e) {
diff --git a/pages/purchase/ability/index.js b/pages/purchase/ability/index.js
deleted file mode 100644
index 28044ba..0000000
--- a/pages/purchase/ability/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// pages/agent/index/index.js
-import { paperCategoryList, getProductList } from "../../../api/ztb"
-const app = getApp()
-
-Page({
- /**
- * 页面的初始数据
- */
- data: {
- height: app.globalData.fragmentHeight - 100,
- kg: app.globalData.kg,
- loading: true,
- requesting: false,
- finished: false,
- cateList: [],
- cateScroll: false,
- top: 0,
- orderList: [],
- form: {
- firstCategoryId: '',
- pageNum: 1,
- pageSize:15
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({ height: app.globalData.fragmentHeight, kg: app.globalData.kg, CustomBar: app.globalData.CustomBar })
- this.fetchCateList()
- this.fetchGoodsList()
- },
- fetchCateList: function(){
- paperCategoryList({ type: 1 }).then(result => {
- var cateList = [{id: '', name: '全部'}].concat(result.data)
- this.setData({ cateList: cateList, cateScroll: cateList.length >= 5 })
- })
- },
- onCategoryChange: function (e) {
- if (this.data.form.firstCategoryId == e.detail.key) {
- return
- }
- this.setData({ ['form.firstCategoryId']: e.detail.key })
- this.onRefreshList()
- },
- // 下拉刷新...
- onRefreshList: function () {
- if (this.data.requesting) {
- return
- }
- this.setData({
- orderList: [],
- ['form.pageNum']: 1,
- loading: true,
- finished: false
- })
- this.fetchGoodsList()
- },
- // 获取特价列表
- fetchGoodsList: function () {
- if (this.data.requesting || this.data.finished) {
- return
- }
- if (this.data.loading) {
- this.data.requesting = true
- } else {
- this.setData({ requesting: true })
- }
- getProductList(this.data.form).then(result => {
- //成功回调
- if (result.data.records.length) {
- var respList = result.data.records
- let nowList = `orderList[${this.data.orderList.length}]`
- var num = result.data.current
- var finished = result.data.current >= result.data.pages
- if(this.data.form.pageNum == 1){
- this.setData({
- [nowList]: respList,
- total: result.data.total,
- ['form.pageNum']: (num + 1),
- top: 0,
- finished,
- requesting: false,
- loading: false
- })
- } else {
- this.setData({
- [nowList]: respList,
- total: result.data.total,
- ['form.pageNum']: (num + 1),
- finished,
- requesting: false,
- loading: false
- })
- }
- } else {
- this.setData({ finished: true, requesting: false, loading: false })
- }
- }).catch(err => {
- this.setData({ requesting: false, loading: false })
- })
- },
- lookItem: function (e) {
- var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
- wx.navigateTo({ url: '/pages/purchase/detail/index?id=' + item.id })
- }
-
-})
\ No newline at end of file
diff --git a/pages/purchase/ability/index.json b/pages/purchase/ability/index.json
deleted file mode 100644
index c575381..0000000
--- a/pages/purchase/ability/index.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "usingComponents": {
- "wux-skeleton": "/components/skeleton/index",
- "wux-skeleton-avatar": "/components/skeleton-avatar/index",
- "wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
- "refresh-view": "/components/refresher/index",
- "wux-image": "/components/image/index",
- "wux-divider": "/components/divider/index",
- "purchase-item": "/pages/purchase/purchase-item/index"
- }
-}
\ No newline at end of file
diff --git a/pages/purchase/ability/index.wxml b/pages/purchase/ability/index.wxml
deleted file mode 100644
index 0993edb..0000000
--- a/pages/purchase/ability/index.wxml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- 采购商品
-
-
-
-
-
-
- {{loading? '正在加载' : '暂无数据'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{finished?'到底啦~':'加载中...'}}
-
-
-
-
-
diff --git a/pages/purchase/ability/index.wxss b/pages/purchase/ability/index.wxss
deleted file mode 100644
index 5f317d3..0000000
--- a/pages/purchase/ability/index.wxss
+++ /dev/null
@@ -1,2 +0,0 @@
-/* pages/agent/index/index.wxss */
-
\ No newline at end of file
diff --git a/pages/purchase/detail/index.js b/pages/purchase/detail/index.js
index 49d797f..a9b9b2d 100644
--- a/pages/purchase/detail/index.js
+++ b/pages/purchase/detail/index.js
@@ -1,6 +1,7 @@
// pages/order/order-info/index.js
import { getPurchaseInfo } from "../../../api/ztb"
const util = require('../../../utils/util')
+const tdsdk = require('../../../libs/tdweapp')
const app = getApp()
Page({
@@ -144,4 +145,13 @@ Page({
success: function (res) {}
}
},
+ onShow: function () {
+ tdsdk.Page.onShow()
+ },
+ onHide: function(){
+ tdsdk.Page.onHide()
+ },
+ onUnload: function () {
+ tdsdk.Page.onUnload()
+ }
})
\ No newline at end of file