Commit 0a44b9a6 by wwh

update

1 parent 9bf9324a
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<view class="row-between mt10"> <view class="row-between mt10">
<text class="muted mr20 xs">库存:{{item.stock}}</text> <text class="muted mr20 xs">库存:{{item.stock}}</text>
<text class="muted mr20 xs">销量:{{item.real_sales}}</text> <text class="muted mr20 xs">销量:{{item.real_sales}}</text>
<view class="opration" @tap="operation({{index}})">操作</view> <view class="opration" @tap.stop="operation({{index}})">操作</view>
<view class="opration-detail" wx:if="{{item.checked}}"> <view class="opration-detail" wx:if="{{item.checked}}">
<view class="opration-item" style="margin-right: 42rpx" @tap="upDownGoods({{item.product_uuid}},'down',{{index}})"> <view class="opration-item" style="margin-right: 42rpx" @tap="upDownGoods({{item.product_uuid}},'down',{{index}})">
<image src="http://static.ledouya.com/FtJ3ABXHZ8N1a9amE3vfWrQ4WwBH"></image> <image src="http://static.ledouya.com/FtJ3ABXHZ8N1a9amE3vfWrQ4WwBH"></image>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
mall_name:encodeURIComponent(wepy.$instance.globalData.mallName), mall_name:encodeURIComponent(wepy.$instance.globalData.mallName),
token:wx.getStorageSync('token') token:wx.getStorageSync('token')
}).then(res=>{ }).then(res=>{
// console.log(res); console.log(res);
let obj={ let obj={
flag:true, flag:true,
url:res url:res
......
<template> <template>
<view> <view>
<view class="container" wx:if="{{industryId == 1}}"> <view class="container" wx:if="{{industryId == 1}}" @tap="closeAll">
<!--TAB 页--> <!--TAB 页-->
<ZanTab :tab="tab" fixed="0" @change.user="change" /> <ZanTab :tab="tab" fixed="0" @change.user="change" />
<!--主内容区域--> <!--主内容区域-->
...@@ -243,6 +243,14 @@ ...@@ -243,6 +243,14 @@
} }
methods = { methods = {
closeAll(){
this.goodsList.forEach(v => {
v.product_info.forEach(v1 => {
v1.checked = false;
});
});
this.$apply();
},
// 点击分类 // 点击分类
switchTab(selectedId) { switchTab(selectedId) {
console.log(selectedId) console.log(selectedId)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view wx:for="{{catagoryList}}" wx:for-index="index" class="nav_h_item {{navIndex==index?'nav_active':''}}" data-index="{{index}}" data-cid="{{item.id}}" @tap="tabClick">{{item.category_name}}</view> <view wx:for="{{catagoryList}}" wx:for-index="index" class="nav_h_item {{navIndex==index?'nav_active':''}}" data-index="{{index}}" data-cid="{{item.id}}" @tap="tabClick">{{item.category_name}}</view>
</scroll-view> </scroll-view>
</view> </view>
<view class='goods-item' wx:for='{{goodsList}}' wx:for-item='item' data-uuid="{{item.product_uuid}}" @tap='goDetail'> <view class='goods-item' wx:for='{{goodsList}}' wx:for-item='item' data-uuid="{{item.product_uuid}}" data-goods="{{item}}" @tap='goDetail'>
<view class='goodsImg-box'> <view class='goodsImg-box'>
<image src='{{item.picture_array[0]}}' class='goods-img'/> <image src='{{item.picture_array[0]}}' class='goods-img'/>
</view> </view>
...@@ -52,8 +52,10 @@ export default class supplyIndex extends wepy.page { ...@@ -52,8 +52,10 @@ export default class supplyIndex extends wepy.page {
}, },
goDetail(e){ goDetail(e){
let goodsId=e.currentTarget.dataset.uuid; let goodsId=e.currentTarget.dataset.uuid;
let goods = e.currentTarget.dataset.goods;
let goodsInfo = JSON.stringify(goods)
wx.navigateTo({ wx.navigateTo({
url:'../../supplyModule/pages/detail?goodsId='+goodsId url:'../../supplyModule/pages/detail?goodsId='+goodsId+'&goodsInfo='+ goodsInfo
}) })
}, },
upDownShelf(e){ upDownShelf(e){
...@@ -83,12 +85,16 @@ export default class supplyIndex extends wepy.page { ...@@ -83,12 +85,16 @@ export default class supplyIndex extends wepy.page {
}).catch() }).catch()
} }
//获取商品列表 //获取商品列表
getList(){ getList(refresh = false){
let data={ let data={
"mode":0, "mode":0,
page:this.pages, page: refresh ? 1 : this.pages,
page_size:10, page_size:10,
} }
if(refresh){
this.goodsList = [];
this.pages = 1;
}
if(this.category_id !=-1){ if(this.category_id !=-1){
data.category_id = this.category_id; data.category_id = this.category_id;
}else{ }else{
...@@ -106,14 +112,13 @@ export default class supplyIndex extends wepy.page { ...@@ -106,14 +112,13 @@ export default class supplyIndex extends wepy.page {
if(this.pages > this.totalPage){ if(this.pages > this.totalPage){
return return
}else { }else {
this.pages ++ ; ++ this.pages ;
this.getList(); this.getList();
} }
} }
onShow(){ onShow(){
this.goodsList = [];
this.getCatagoryList(); this.getCatagoryList();
this.getList(); this.getList(true);
} }
onLoad(){ onLoad(){
// this.getList(); // this.getList();
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
<!---按钮组---> <!---按钮组--->
<view class="btn-groups"> <view class="btn-groups">
<view class="btn-back" @tap='back'>供销主页</view> <view class="btn-back" @tap='back'>供销主页</view>
<view class="btn-upGoods" @tap='shelfGoods'>上架到网店</view> <view class="btn-upGoods" @tap='shelfGoods' wx:if="{{goodsInfo.is_insert == '0'}}">上架到网店</view>
<view class="btn-upGoods is_insert" wx:elif="{{goodsInfo.is_insert == '1'}}">已上架到网店</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -45,7 +46,8 @@ export default class supplyDetail extends wepy.page { ...@@ -45,7 +46,8 @@ export default class supplyDetail extends wepy.page {
], ],
htmlSnip:'', htmlSnip:'',
goodsId:'', goodsId:'',
detailInfo:null detailInfo:null,
goodsInfo:null
} }
data = {...this.def}; data = {...this.def};
methods={ methods={
...@@ -55,8 +57,9 @@ export default class supplyDetail extends wepy.page { ...@@ -55,8 +57,9 @@ export default class supplyDetail extends wepy.page {
}) })
}, },
shelfGoods(){ shelfGoods(){
let goodsInfo = JSON.stringify(this.goodsInfo)
wx.navigateTo({ wx.navigateTo({
url:'/pages/goods/edit?mode=create' url:'/pages/goods/edit?mode=create'+'&supply=1'+'&goodsInfo='+ goodsInfo
}) })
} }
} }
...@@ -64,8 +67,9 @@ export default class supplyDetail extends wepy.page { ...@@ -64,8 +67,9 @@ export default class supplyDetail extends wepy.page {
getDetail(){ getDetail(){
} }
onLoad({goodsId}){ onLoad({goodsId,goodsInfo}){
this.goodsId = goodsId; this.goodsId = goodsId;
this.goodsInfo = JSON.parse(goodsInfo);
Goods.supplyGoodsDetail({product_uuid:goodsId}).then(res=>{ Goods.supplyGoodsDetail({product_uuid:goodsId}).then(res=>{
if(res.error==0 && res.data){ if(res.error==0 && res.data){
...@@ -163,6 +167,9 @@ export default class supplyDetail extends wepy.page { ...@@ -163,6 +167,9 @@ export default class supplyDetail extends wepy.page {
font-weight:400; font-weight:400;
color:#fff; color:#fff;
} }
.is_insert{
background: #aaa;
}
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!