|
@@ -166,9 +166,15 @@ Page({
|
|
|
if (status) {
|
|
|
const { list } = data
|
|
|
if (Array.isArray(list)) {
|
|
|
- const _list = temp.isRefresh
|
|
|
- ? [].concat(list)
|
|
|
- : that.data.originScrollViewData[_tab].list.concat(list)
|
|
|
+ // product_status 商品状态(0未上架1已上架2审核中3审核未通过)
|
|
|
+ // product_sale_at 预售(0非预售 时间戳代表预售时间)
|
|
|
+ const tempList = list.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ ...that.getStatusTextAndColor(item.product_status)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const _list = temp.isRefresh ? [].concat(tempList) : that.data.originScrollViewData[_tab].list.concat(tempList)
|
|
|
|
|
|
that.setData({
|
|
|
['originScrollViewData[' + _tab + '].list']: _list,
|
|
@@ -261,5 +267,26 @@ Page({
|
|
|
this.setData({
|
|
|
booLock: false
|
|
|
})
|
|
|
+ },
|
|
|
+ getStatusTextAndColor(val) {
|
|
|
+ const arr = ['未上架', '已上架', '审核中', '审核未通过']
|
|
|
+ let color = 'col-0'
|
|
|
+ switch (val) {
|
|
|
+ case 1:
|
|
|
+ color = 'col-2'
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ color = 'col-1'
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ color = 'col-3'
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ product_status_text: arr[val] || '',
|
|
|
+ product_status_color: color
|
|
|
+ }
|
|
|
}
|
|
|
})
|