|
@@ -13,28 +13,31 @@ Page({
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
- onLoad(options) {
|
|
|
|
|
|
+ async onLoad(options) {
|
|
this.setData({
|
|
this.setData({
|
|
dataType: options.type
|
|
dataType: options.type
|
|
})
|
|
})
|
|
- _Http.basic({
|
|
|
|
|
|
+ const params = {
|
|
"classname": "saletool.sharematerial.sharematerial",
|
|
"classname": "saletool.sharematerial.sharematerial",
|
|
"method": "selectDetail",
|
|
"method": "selectDetail",
|
|
"content": {
|
|
"content": {
|
|
"sat_sharematerialid": options.id
|
|
"sat_sharematerialid": options.id
|
|
}
|
|
}
|
|
- }).then(res => {
|
|
|
|
- console.log("详情", res)
|
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
|
- title: res.msg,
|
|
|
|
- icon: "none"
|
|
|
|
- })
|
|
|
|
|
|
+ };
|
|
|
|
+ const res = wx.getStorageSync('userMsg').token ? await _Http.basic(params) : await _Http.base(params);
|
|
|
|
+ if (res.msg != '成功') await _Http.base(params);
|
|
|
|
+ if (res.msg == '成功') {
|
|
let data = res.data;
|
|
let data = res.data;
|
|
if (data.attinfos.length) data.attinfos = MFT.fileList(data.attinfos);
|
|
if (data.attinfos.length) data.attinfos = MFT.fileList(data.attinfos);
|
|
this.setData({
|
|
this.setData({
|
|
detailsData: data
|
|
detailsData: data
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: res.msg,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
openFile(e) {
|
|
openFile(e) {
|
|
checkFile.checkFile(e.currentTarget.dataset.item);
|
|
checkFile.checkFile(e.currentTarget.dataset.item);
|