|
@@ -25,10 +25,10 @@ Page({
|
|
|
this.setData({
|
|
|
userrole: wx.getStorageSync('userrole')
|
|
|
})
|
|
|
- this.getDetail();
|
|
|
+ this.getDetail(true);
|
|
|
},
|
|
|
/* 获取详情 */
|
|
|
- getDetail() {
|
|
|
+ getDetail(init = false) {
|
|
|
let content = this.data.content;
|
|
|
if (sys_enterpriseid) content.sys_enterpriseid = sys_enterpriseid;
|
|
|
_Http.basic({
|
|
@@ -40,17 +40,11 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
- if (res.data.item.length == 0) {
|
|
|
- wx.showToast({
|
|
|
- title: '未查询到商品',
|
|
|
- icon: "none",
|
|
|
- mask: true
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- wx.navigateBack();
|
|
|
- }, 500)
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (res.data.item.length == 0) return wx.showToast({
|
|
|
+ title: '未查询到商品',
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
this.handleFiles(res.data.item[0].attinfos)
|
|
|
const CNY = sum => currency(sum, {
|
|
|
symbol: "¥",
|
|
@@ -61,11 +55,13 @@ Page({
|
|
|
this.setData({
|
|
|
detail: res.data.item[0],
|
|
|
content: Object.assign(this.data.content, res.data.rows[0]),
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (init) this.setData({
|
|
|
specRows: res.data.specRows,
|
|
|
cheekRows: res.data.cheekRows,
|
|
|
materialRows: res.data.materialRows,
|
|
|
colorRows: res.data.colorRows,
|
|
|
- loading: false
|
|
|
})
|
|
|
})
|
|
|
},
|