Browse Source

no message

feature/v1.4
xpz2018 5 years ago
parent
commit
339c988997
11 changed files with 151 additions and 59 deletions
  1. 61
      pages/agent/ability-item/index.js
  2. 8
      pages/agent/ability-item/index.json
  3. 42
      pages/agent/ability-item/index.wxml
  4. 23
      pages/agent/ability-item/index.wxss
  5. 55
      pages/agent/ability-list/index.js
  6. 4
      pages/agent/ability-list/index.json
  7. 8
      pages/agent/ability-list/index.wxml
  8. 2
      pages/agent/ability-list/index.wxss
  9. 4
      pages/agent/factory-detail/index.wxml
  10. 2
      pages/home/factory-list/index.wxml
  11. 1
      pages/htmls/banner/index.js

61
pages/agent/ability-item/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}` })
}
}
})

8
pages/agent/ability-item/index.json

@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-button": "/components/button/index",
"van-image": "/components/image/index",
"van-tag": "/components/tag/index"
}
}

42
pages/agent/ability-item/index.wxml

@ -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>

23
pages/agent/ability-item/index.wxss

@ -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);
}

55
pages/agent/ability-list/index.js

@ -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 () {
}
})

4
pages/agent/ability-list/index.json

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"notification": "/pages/message/notification/index"
}
}

8
pages/agent/ability-list/index.wxml

@ -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"/>

2
pages/agent/ability-list/index.wxss

@ -1 +1 @@
/* pages/agent/ability-list/index.wxss */
/* pages/message/detail/index.wxss */

4
pages/agent/factory-detail/index.wxml

@ -110,7 +110,7 @@
</view>
<view class="text-df" style="padding: 20rpx 0rpx">{{item.inspectionNote || '暂无信息'}}</view>
</view>
<view style="height:30rpx"></view>
<view style="height:{{120 + safeBottom}}rpx"></view>
</view>
<view class="bg-white" style="display:{{tabIndex == 2 ? 'block' : 'none'}}">
<view style="padding: 24rpx 30rpx;">
@ -141,7 +141,7 @@
</view>
<view class="text-df" style="padding: 30rpx 0rpx">{{factoryDetail.attentionsRegulations}}</view>
</view>
<view style="height:30rpx"></view>
<view style="height:{{120 + safeBottom}}rpx"></view>
</view>
</view>
</van-sticky>

2
pages/home/factory-list/index.wxml

@ -60,6 +60,6 @@
</view>
<van-dialog use-slot title="{{nowItem.id ? '修改渠道' : '创建渠道'}}" show="{{ show }}" transition="fade" show-cancel-button bind:close="onClose" bind:confirm="onConfirm">
<input class="dialog-input" value="{{nowItem.name}}" placeholder-style="color:#aaa;" maxlength="8" placeholder="请输入纸厂名称" bindinput="bindInput" />
<input class="dialog-input" value="{{nowItem.name}}" placeholder-style="color:#aaa;" maxlength="16" placeholder="请输入纸厂名称" bindinput="bindInput" />
</van-dialog>
<notification id="qn-notification" />

1
pages/htmls/banner/index.js

@ -23,6 +23,7 @@ Scene({
wx.showLoading({ title: '处理中', mask: true })
this.setData({
fheight: app.globalData.fragmentHeight,
height: app.globalData.fragmentHeight,
StatusBar: app.globalData.StatusBar || 40,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
src: options.src

Loading…
Cancel
Save