Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
王文桦
/
sxBusinessMp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0a44b9a6
authored
Jun 05, 2020
by
wwh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
1 parent
9bf9324a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
src/components/goods/item.wpy
src/pages/goods/list.wpy
src/pages/supply/index.wpy
src/supplyModule/pages/detail.wpy
src/components/goods/item.wpy
View file @
0a44b9a
...
...
@@ -21,7 +21,7 @@
<view class="row-between mt10">
<text class="muted mr20 xs">库存:{{item.stock}}</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-item" style="margin-right: 42rpx" @tap="upDownGoods({{item.product_uuid}},'down',{{index}})">
<image src="http://static.ledouya.com/FtJ3ABXHZ8N1a9amE3vfWrQ4WwBH"></image>
...
...
@@ -111,7 +111,7 @@
mall_name:encodeURIComponent(wepy.$instance.globalData.mallName),
token:wx.getStorageSync('token')
}).then(res=>{
//
console.log(res);
console.log(res);
let obj={
flag:true,
url:res
...
...
src/pages/goods/list.wpy
View file @
0a44b9a
<template>
<view>
<view class="container" wx:if="{{industryId == 1}}">
<view class="container" wx:if="{{industryId == 1}}"
@tap="closeAll"
>
<!--TAB 页-->
<ZanTab :tab="tab" fixed="0" @change.user="change" />
<!--主内容区域-->
...
...
@@ -243,6 +243,14 @@
}
methods = {
closeAll(){
this.goodsList.forEach(v => {
v.product_info.forEach(v1 => {
v1.checked = false;
});
});
this.$apply();
},
// 点击分类
switchTab(selectedId) {
console.log(selectedId)
...
...
src/pages/supply/index.wpy
View file @
0a44b9a
...
...
@@ -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>
</scroll-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'>
<image src='{{item.picture_array[0]}}' class='goods-img'/>
</view>
...
...
@@ -52,8 +52,10 @@ export default class supplyIndex extends wepy.page {
},
goDetail(e){
let goodsId=e.currentTarget.dataset.uuid;
let goods = e.currentTarget.dataset.goods;
let goodsInfo = JSON.stringify(goods)
wx.navigateTo({
url:'../../supplyModule/pages/detail?goodsId='+goodsId
url:'../../supplyModule/pages/detail?goodsId='+goodsId
+'&goodsInfo='+ goodsInfo
})
},
upDownShelf(e){
...
...
@@ -83,12 +85,16 @@ export default class supplyIndex extends wepy.page {
}).catch()
}
//获取商品列表
getList(){
getList(
refresh = false
){
let data={
"mode":0,
page:this.pages,
page:
refresh ? 1 :
this.pages,
page_size:10,
}
if(refresh){
this.goodsList = [];
this.pages = 1;
}
if(this.category_id !=-1){
data.category_id = this.category_id;
}else{
...
...
@@ -106,14 +112,13 @@ export default class supplyIndex extends wepy.page {
if(this.pages > this.totalPage){
return
}else {
this.pages ++
;
++ this.pages
;
this.getList();
}
}
onShow(){
this.goodsList = [];
this.getCatagoryList();
this.getList();
this.getList(
true
);
}
onLoad(){
// this.getList();
...
...
src/supplyModule/pages/detail.wpy
View file @
0a44b9a
...
...
@@ -27,7 +27,8 @@
<!---按钮组--->
<view class="btn-groups">
<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>
</template>
...
...
@@ -45,7 +46,8 @@ export default class supplyDetail extends wepy.page {
],
htmlSnip:'',
goodsId:'',
detailInfo:null
detailInfo:null,
goodsInfo:null
}
data = {...this.def};
methods={
...
...
@@ -55,8 +57,9 @@ export default class supplyDetail extends wepy.page {
})
},
shelfGoods(){
let goodsInfo = JSON.stringify(this.goodsInfo)
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 {
getDetail(){
}
onLoad({goodsId}){
onLoad({goodsId
,goodsInfo
}){
this.goodsId = goodsId;
this.goodsInfo = JSON.parse(goodsInfo);
Goods.supplyGoodsDetail({product_uuid:goodsId}).then(res=>{
if(res.error==0 && res.data){
...
...
@@ -163,6 +167,9 @@ export default class supplyDetail extends wepy.page {
font-weight:400;
color:#fff;
}
.is_insert{
background: #aaa;
}
}
}
</style>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment