11 changed files with 151 additions and 59 deletions
Split View
Diff Options
-
61pages/agent/ability-item/index.js
-
8pages/agent/ability-item/index.json
-
42pages/agent/ability-item/index.wxml
-
23pages/agent/ability-item/index.wxss
-
55pages/agent/ability-list/index.js
-
4pages/agent/ability-list/index.json
-
8pages/agent/ability-list/index.wxml
-
2pages/agent/ability-list/index.wxss
-
4pages/agent/factory-detail/index.wxml
-
2pages/home/factory-list/index.wxml
-
1pages/htmls/banner/index.js
@ -0,0 +1,61 @@ |
|||
// pages/message/index.js
|
|||
const util = require('../../../utils/util') |
|||
const app = getApp() |
|||
|
|||
Component({ |
|||
options: { |
|||
addGlobalClass: true, |
|||
multipleSlots: true |
|||
}, |
|||
properties: { |
|||
item: { type: Object, value: null } |
|||
}, |
|||
data: { |
|||
cateIndex: 0 |
|||
}, |
|||
methods: { |
|||
lookItem: function (e) { |
|||
wx.navigateTo({ url: `/pages/agent/factory-detail/index?id=${this.data.item.paperMillId}`}) |
|||
}, |
|||
toAbilityRule: function (e) { |
|||
util.navigateTarget(this.data.item.redirectInfo) |
|||
}, |
|||
unflodItem: function(){ |
|||
this.setData({ ['item.fold']: !this.data.item.fold }) |
|||
}, |
|||
checkTag: function(e){ |
|||
var cateIndex = -1 |
|||
if(util.isEmpty(this.data.cateIndex)){ |
|||
cateIndex = e.currentTarget.dataset.ck |
|||
} else if(this.data.cateIndex != e.currentTarget.dataset.ck){ |
|||
cateIndex = e.currentTarget.dataset.ck |
|||
} |
|||
if(cateIndex >= 0){ |
|||
this.setData({ cateIndex }) |
|||
} |
|||
}, |
|||
saleGood: function(e){ |
|||
if (!app.userInfo) { |
|||
wx.navigateTo({ url: '/pages/login/index' }) |
|||
return |
|||
} |
|||
if(!this.data.item.isOperations){ |
|||
util.showToast('该纸厂已暂停接单,请联系相关负责人!') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.cateIndex)){ |
|||
util.showToast('请选择一个纸品') |
|||
return |
|||
} |
|||
if(util.isEmpty(this.data.item.paperCategoryList[this.data.cateIndex].unitPrice)){ |
|||
util.showToast('该纸品暂无报价,无法卖货') |
|||
return |
|||
} |
|||
var categoryId = this.data.item.paperCategoryList[this.data.cateIndex].categoryId |
|||
var activityId = this.data.item.activityId |
|||
var unitPrice = this.data.item.paperCategoryList[this.data.item.cateIndex].unitPrice |
|||
wx.navigateTo({ url: `/pages/agent/appointment/index?id=${this.data.item.paperMillId}&categoryId=${categoryId}&activityId=${activityId}&unitPrice=${unitPrice}` }) |
|||
} |
|||
} |
|||
|
|||
}) |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"component": true, |
|||
"usingComponents": { |
|||
"van-button": "/components/button/index", |
|||
"van-image": "/components/image/index", |
|||
"van-tag": "/components/tag/index" |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
<!--pages/message/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<view class="flex flex-justify item-content"> |
|||
<van-image use-loading-slot width="108rpx" height="108rpx" radius="4" lazy-load src="{{item.logoImg}}"> |
|||
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image> |
|||
</van-image> |
|||
<view style="margin-left:24rpx;flex:1"> |
|||
<view class="text-sg text-cut text-bold">{{item.activityName}}</view> |
|||
<view class="text-xs text-gray" style="margin-top:4rpx"> |
|||
<view class="text-df text-black">{{item.name}}</view> |
|||
<view>时间:{{formate.substring(item.startTime, 0, 10)}}至{{formate.substring(item.endTime, 0, 10)}}</view> |
|||
</view> |
|||
</view> |
|||
<van-tag bind:click="toAbilityRule" wx:if="{{item.redirectInfo}}"> |
|||
<text class="text-df">活动规则</text> |
|||
</van-tag> |
|||
</view> |
|||
<view class="bg-white" style="padding:0rpx 32rpx 10rpx 32rpx"> |
|||
<view class="flex" wx:for-item="cateItem" wx:for-index="ck" wx:for="{{item.paperCategoryList}}" wx:key="ck" wx:if="{{item.fold || ck < 3}}" style="margin-bottom: 20rpx"> |
|||
<view class="item-cate {{item.cateIndex == ck ? 'cate-tag' : ''}}" data-page="{{pageIndex}}" data-index="{{index}}" data-ck="{{ck}}" catchtap="checkTag"> |
|||
<view class="flex flex-justify" style="padding: 8rpx 0rpx"> |
|||
<view class="text-sg text-black">{{cateItem.categoryName}}</view> |
|||
<text class="text-sg text-black" wx:if="{{cateItem.unitPrice}}">{{formate.formatePrice(cateItem.unitPrice)}}元/吨</text> |
|||
<text class="text-sg text-gray" wx:else>暂无报价</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="flex" style="padding: 4rpx 0rpx 16rpx 0rpx;" wx:if="{{item.paperCategoryList.length > 0}}"> |
|||
<view style="flex:1"></view> |
|||
<view style="flex:1.2"> |
|||
<van-button type="{{item.isOperations? 'info' : 'default'}}" custom-style="width: 100%;height:80rpx;border-radius:10rpx" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</van-button> |
|||
</view> |
|||
<view class="flex flex-center" style="flex:1;justify-content: flex-end"> |
|||
<view data-page="{{pageIndex}}" data-index="{{index}}" catchtap="unflodItem" wx:if="{{item.paperCategoryList.length > 3}}"> |
|||
<text class="text-blue text-df">{{item.fold ? '点击收起' : '查看全部' }}({{item.paperCategoryList.length}})</text> |
|||
</view> |
|||
<view style="margin-left:4rpx;padding-top:8rpx" data-page="{{pageIndex}}" data-index="{{index}}" catchtap="unflodItem" wx:if="{{item.paperCategoryList.length > 3}}"> |
|||
<text class="cuIcon-{{item.fold ? 'fold' : 'unfold'}} text-blue" style="font-size:16px;"></text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
@ -0,0 +1,23 @@ |
|||
/* pages/mall/shops/index.wxss */ |
|||
.item-content { |
|||
background: rgba(255, 255, 255, 1); |
|||
padding: 32rpx; |
|||
} |
|||
|
|||
.item-cate { |
|||
flex: 5; |
|||
padding: 10rpx 30rpx; |
|||
border-radius: 10rpx; |
|||
border: 1rpx solid #f3f3f3; |
|||
background-color: #f3f3f3; |
|||
} |
|||
|
|||
.cate-tag { |
|||
background-color: #e6f7ff; |
|||
border: 1rpx solid #1890ff; |
|||
} |
|||
|
|||
.transform { |
|||
transform-origin: 50% 50%; |
|||
transform: rotate(180deg); |
|||
} |
|||
@ -1,66 +1,17 @@ |
|||
// pages/agent/ability-list/index.js
|
|||
Page({ |
|||
// pages/message/detail/index.js
|
|||
import Scene from '../../index/scene' |
|||
|
|||
Scene({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -1,3 +1,5 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
"usingComponents": { |
|||
"notification": "/pages/message/notification/index" |
|||
} |
|||
} |
|||
@ -1,2 +1,6 @@ |
|||
<!--pages/agent/ability-list/index.wxml--> |
|||
<text>pages/agent/ability-list/index.wxml</text> |
|||
<!--pages/message/detail/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">消息情况</view> |
|||
</cu-custom> |
|||
|
|||
<notification id="qn-notification"/> |
|||
@ -1 +1 @@ |
|||
/* pages/agent/ability-list/index.wxss */ |
|||
/* pages/message/detail/index.wxss */ |
|||
Write
Preview
Loading…
Cancel
Save