|
@@ -3,7 +3,6 @@ import {
|
|
|
} from "../../utils/api";
|
|
} from "../../utils/api";
|
|
|
const _Http = new ApiModel();
|
|
const _Http = new ApiModel();
|
|
|
Page({
|
|
Page({
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 页面的初始数据
|
|
* 页面的初始数据
|
|
|
*/
|
|
*/
|
|
@@ -15,12 +14,14 @@ Page({
|
|
|
loadMore: true, //加载更多
|
|
loadMore: true, //加载更多
|
|
|
fisadministrator: false, //是否主账号
|
|
fisadministrator: false, //是否主账号
|
|
|
searchContent: "", //模糊搜索字段
|
|
searchContent: "", //模糊搜索字段
|
|
|
|
|
+ onShowFlush: false, //是否触发onShow刷新
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
*/
|
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
|
|
|
+ this.gettingData(this.data.active);
|
|
|
this.setData({
|
|
this.setData({
|
|
|
fisadministrator: (wx.getStorageSync('userData').fisadministrator == 1) ? true : false
|
|
fisadministrator: (wx.getStorageSync('userData').fisadministrator == 1) ? true : false
|
|
|
})
|
|
})
|
|
@@ -56,7 +57,8 @@ Page({
|
|
|
active: e.detail.index,
|
|
active: e.detail.index,
|
|
|
pageNumber: 1, //请求页号
|
|
pageNumber: 1, //请求页号
|
|
|
pageTotal: 1, //总页码
|
|
pageTotal: 1, //总页码
|
|
|
- loadMore: true //加载更多
|
|
|
|
|
|
|
+ loadMore: true, //加载更多
|
|
|
|
|
+ productList: [],
|
|
|
})
|
|
})
|
|
|
this.gettingData(index, this.data.searchContent)
|
|
this.gettingData(index, this.data.searchContent)
|
|
|
},
|
|
},
|
|
@@ -84,12 +86,14 @@ Page({
|
|
|
"content": {
|
|
"content": {
|
|
|
"getdatafromdbanyway": true,
|
|
"getdatafromdbanyway": true,
|
|
|
"pageNumber": this.data.pageNumber,
|
|
"pageNumber": this.data.pageNumber,
|
|
|
- "pageSize": 20,
|
|
|
|
|
|
|
+ "pageSize": 8,
|
|
|
"where": where
|
|
"where": where
|
|
|
}
|
|
}
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
- if (res.msg != '成功') return;
|
|
|
|
|
- console.log(res)
|
|
|
|
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
|
|
+ title: res.data,
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ })
|
|
|
/* 拼接列表 */
|
|
/* 拼接列表 */
|
|
|
let productList = [];
|
|
let productList = [];
|
|
|
if (this.data.pageNumber != 1) {
|
|
if (this.data.pageNumber != 1) {
|
|
@@ -110,6 +114,8 @@ Page({
|
|
|
index
|
|
index
|
|
|
} = e.currentTarget.dataset;
|
|
} = e.currentTarget.dataset;
|
|
|
const data = JSON.stringify(this.data.productList[index])
|
|
const data = JSON.stringify(this.data.productList[index])
|
|
|
|
|
+ //刷新页面
|
|
|
|
|
+ this.isOnShow();
|
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
|
url: '/pages/productManagement/change?data=' + data,
|
|
url: '/pages/productManagement/change?data=' + data,
|
|
|
})
|
|
})
|
|
@@ -120,12 +126,24 @@ Page({
|
|
|
onReady: function () {
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ //允许onshow刷新
|
|
|
|
|
+ isOnShow() {
|
|
|
|
|
+ console.log("调用")
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ onShowFlush: true
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
*/
|
|
|
onShow: function () {
|
|
onShow: function () {
|
|
|
- this.gettingData(this.data.active)
|
|
|
|
|
|
|
+ //重新获取数据列表
|
|
|
|
|
+ if (this.data.onShowFlush) {
|
|
|
|
|
+ this.gettingData(this.data.active)
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ onShowFlush: false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|