|
|
|
@ -20,7 +20,7 @@ |
|
|
|
<view class="flex-two" v-for="(item, idx) in list" :key="idx" @click="onTargetGoods(item.goods_islicode)"> |
|
|
|
<view class="cate-img-padding"> |
|
|
|
<view v-if="item.goods_image" class="cate-img"> |
|
|
|
<image class="image" mode="scaleToFill" :src="item.goods_image"></image> |
|
|
|
<image class="image" mode="scaleToFill" :src="item.goods_image|gdimg"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<text class="name oneline-hide">{{ item.goods_name }}</text> |
|
|
|
@ -59,7 +59,9 @@ |
|
|
|
import Empty from '@/components/empty' |
|
|
|
import Search from '@/components/search' |
|
|
|
import Secondary from './components/secondary' |
|
|
|
import { rpx2px } from '@/utils/util' |
|
|
|
import { rpx2px,base64ToUint8Array} from '@/utils/util' |
|
|
|
|
|
|
|
import pako from '@/core/pako' |
|
|
|
|
|
|
|
|
|
|
|
// 左侧菜单(固定) |
|
|
|
@ -188,7 +190,7 @@ |
|
|
|
getCatList(){ |
|
|
|
console.log("curindex",this.curIndex) |
|
|
|
let item = menus[this.curIndex] |
|
|
|
console.log(item) |
|
|
|
// console.log(item) |
|
|
|
let type= item.type |
|
|
|
|
|
|
|
if(type>0){ |
|
|
|
@ -209,16 +211,30 @@ |
|
|
|
|
|
|
|
// 绑定数据 |
|
|
|
bindData(rd){ |
|
|
|
|
|
|
|
GoodsApi.nbgoods(rd).then(res=>{ |
|
|
|
this.list = res.data.data |
|
|
|
this.page=res.data.current_page |
|
|
|
console.log("res",res) |
|
|
|
}); |
|
|
|
// |
|
|
|
//this.initList(this.list) |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理列表中的特殊字段 |
|
|
|
initList(newList) { |
|
|
|
newList.data.forEach(item => { |
|
|
|
item.gdimg = pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'}) |
|
|
|
}) |
|
|
|
return newList |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
filters:{ |
|
|
|
gdimg:function(value){ |
|
|
|
return pako.inflateRaw(base64ToUint8Array(value), {to: 'string'}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|