Browse Source

1、首页弹窗,支持跳转到活动列表;

2、价格指数默认选择5个纸品;
3、纸厂列表、活动列表、纸厂详情增加停止收货
featrue/v4.3
xpz2018 5 years ago
parent
commit
22cdc7fe05
14 changed files with 79 additions and 93 deletions
  1. 2
      app.js
  2. 4
      components/dialog/index.wxml
  3. 9
      pages/agent/ability-item/index.js
  4. 1
      pages/agent/ability-item/index.json
  5. 6
      pages/agent/ability-item/index.wxml
  6. 9
      pages/agent/agent-item/index.js
  7. 1
      pages/agent/agent-item/index.json
  8. 4
      pages/agent/agent-item/index.wxml
  9. 9
      pages/agent/factory/index.js
  10. 1
      pages/agent/factory/index.json
  11. 4
      pages/agent/factory/index.wxml
  12. 102
      pages/mall/price-index/index.js
  13. 5
      pages/moment/paper/index.js
  14. 15
      utils/util.js

2
app.js

@ -1,7 +1,7 @@
//app.js
App({
//----------------------------------------------globalData--------------------------------------
evn: 1,//0:开发环境,1:测试环境,2:生产环境
evn: 2,//0:开发环境,1:测试环境,2:生产环境
tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'],
agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'oLbv-IyJOia2tenh64_Lc8xeAzwgzu3gh1vFJ1Se-ME'],
version: 152,

4
components/dialog/index.wxml

@ -1,6 +1,6 @@
<wux-popup visible="{{ in }}" z-index="{{ zIndex }}" closable="{{ closable }}" mask="{{ mask }}" mask-closable="{{ maskClosable }}" bind:close="onClose" bind:closed="onClosed">
<view slot="header" class="text-xl">{{ title }}</view>
<view wx:if="{{ content || prompt }}">
<view wx:if="{{ content || prompt }}" style="padding: 24rpx 0rpx">
<view class="{{ classes.prompt }}" wx:if="{{ prompt && !offer }}">
<label>
<input type="{{ prompt.fieldtype }}" class="{{ classes.input }}" value="{{ prompt.response }}" password="{{ prompt.password }}" placeholder="{{ prompt.placeholder }}" maxlength="{{ maxlength }}" bindinput="bindinput" />
@ -13,7 +13,7 @@
<text class="text-df text-black">{{ content }}</text>
</view>
<text wx:else>{{ content }}</text>
<view style="display: flex;margin-top:24rpx;margin-bottom:12rpx;justify-content: center;" wx:if="{{ prompt && offer }}">
<view style="display: flex;margin-top:12rpx;margin-bottom:12rpx;justify-content: center;" wx:if="{{ prompt && offer }}">
<wux-input-number value="{{ prompt.response }}" controlled longpress="{{true}}" offer="true" disabled="{{false}}" min="{{min}}" step="{{ step }}" bind:change="onNumChange" />
</view>
</view>

9
pages/agent/ability-item/index.js

@ -42,6 +42,15 @@ Component({
wx.navigateTo({ url: '/pages/login/index' })
return
}
if(!this.data.item.isOperations){
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
this.wuxDialog.alert({
resetOnClose: true,
title: '温馨提示',
content: '该纸厂已暂停接单,请联系相关负责人!'
})
return
}
if(util.isEmpty(this.data.item.cateIndex)){
util.showToast('请选择一个纸品')
return

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

@ -3,6 +3,7 @@
"usingComponents": {
"wux-button": "/components/button/index",
"wux-image": "/components/image/index",
"wux-dialog": "/components/dialog/index",
"wux-tag": "/components/tag/index"
}
}

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

@ -30,7 +30,7 @@
<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">
<wux-button block type="positive" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-button>
<wux-button block type="{{item.isOperations? 'positive' : 'stable'}}" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-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}}">
@ -41,4 +41,6 @@
</view>
</view>
</view>
</view>
</view>
<wux-dialog id="wux-dialog" />

9
pages/agent/agent-item/index.js

@ -53,6 +53,15 @@ Component({
wx.navigateTo({ url: '/pages/login/index' })
return
}
if(!this.data.item.isOperations){
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
this.wuxDialog.alert({
resetOnClose: true,
title: '温馨提示',
content: '该纸厂已暂停接单,请联系相关负责人!'
})
return
}
if(util.isEmpty(this.data.cateIndex)){
util.showToast('请选择一个纸品')
return

1
pages/agent/agent-item/index.json

@ -2,6 +2,7 @@
"component": true,
"usingComponents": {
"wux-button": "/components/button/index",
"wux-dialog": "/components/dialog/index",
"wux-image": "/components/image/index"
}
}

4
pages/agent/agent-item/index.wxml

@ -62,7 +62,7 @@
<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">
<wux-button block type="positive" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-button>
<wux-button block type="{{item.isOperations? 'positive' : 'stable'}}" size="sale" data-page="{{pageIndex}}" data-index="{{index}}" bind:click="saleGood">我要卖货</wux-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}}">
@ -75,6 +75,8 @@
</view>
</view>
<wux-dialog id="wux-dialog" />
<wxs module="priceItem">
function priceItem(item, kg) {
if(kg){

9
pages/agent/factory/index.js

@ -135,6 +135,15 @@ Page({
})
return
}
if(!this.data.factoryDetail.isOperations){
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
this.wuxDialog.alert({
resetOnClose: true,
title: '温馨提示',
content: '该纸厂已暂停接单,请联系相关负责人!'
})
return
}
var item = this.data.factoryDetail.paperCategoryList[this.data.cateIndex]
if (util.isEmpty(item.unitPrice)) {
util.showToast('该纸品暂无报价,无法卖货')

1
pages/agent/factory/index.json

@ -8,6 +8,7 @@
"wux-sticky": "/components/sticky/index",
"fold-text": "/components/fold-text/index",
"wux-divider": "/components/divider/index",
"wux-dialog": "/components/dialog/index",
"article-item": "/pages/article/article-item/index"
}
}

4
pages/agent/factory/index.wxml

@ -168,7 +168,7 @@
</button>
</view>
<view style="width:100%">
<wux-button block type="positive" bind:click="saleGood">我要卖货</wux-button>
<wux-button block type="{{factoryDetail.isOperations? 'positive' : 'stable'}}" bind:click="saleGood">我要卖货</wux-button>
</view>
</view>
@ -178,6 +178,8 @@
</view>
</view>
<wux-dialog id="wux-dialog" />
<wxs module="priceItem">
function priceItem(item, kg) {
if(kg){

102
pages/mall/price-index/index.js

@ -1,5 +1,5 @@
// pages/moment/price/index.js
import { getCategoryPrice } from "../../api/moment"
import { getCategoryList, getCategoryPrice } from "../../api/moment"
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const storage = require('../../../utils/storage')
@ -28,85 +28,41 @@ Page({
*/
onLoad: function (options) {
event.on('EventMessage', this, this.onEvent)
this.fetchChartList()
var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId)
if(!util.isEmpty(cateIds)){
this.data.idList = cateIds
this.fetchChartList()
} else {
wx.showLoading({ title: '加载中', mask: true })
getCategoryList().then(result => {
this.data.idList = ''
var size = result.data.records.length >= 5 ? 5 : result.data.records.length
for (let index = 0; index < size; index++) {
if(util.isEmpty(this.data.idList)){
this.data.idList = result.data.records[index].id
} else {
this.data.idList += ',' + result.data.records[index].id
}
}
this.fetchChartList()
wx.hideLoading()
}).catch(err => {
//异常回调
wx.hideLoading()
})
}
},
onEvent: function (message) {
if (message.what == 502) {
var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId)
if(!util.isEmpty(cateIds)){
this.data.idList = cateIds
}
this.fetchChartList()
}
},
// 下拉刷新...
onRefreshList: function () {
if (this.data.requesting) {
return
}
this.setData({
orderList: [],
['form.pageNum']: 1,
loading: true,
height: app.globalData.fragmentHeight,
finished: false
})
this.fetchPapersList()
},
// 获取特价列表
fetchPapersList: function () {
if (this.data.requesting || this.data.finished) {
return
}
if (this.data.loading) {
this.data.requesting = true
} else {
this.setData({ requesting: true })
}
getCategoryPrice().then(result => {
if (result.data.records.length) {
var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]`
var num = result.data.current
var finished = result.data.current >= result.data.pages
if(this.data.form.pageNum == 1){
this.setData({
[nowList]: respList,
total: result.data.total,
['form.pageNum']: (num + 1),
top: 0,
finished,
requesting: false,
loading: false
})
} else {
this.setData({
[nowList]: respList,
total: result.data.total,
['form.pageNum']: (num + 1),
finished,
requesting: false,
loading: false
})
}
} else {
this.setData({
finished: true,
requesting: false,
loading: false
})
}
}).catch(err => {
//异常回调
this.setData({
requesting: false,
finished: true,
loading: false
})
})
},
//***********************************fetchChartList*****************************************//
fetchChartList: function(){
var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId)
if(!util.isEmpty(cateIds)){
this.data.idList = cateIds
}
getCategoryPrice({idList: this.data.idList}).then(result => {
if(result.data.length <= 0){
return
@ -199,7 +155,7 @@ Page({
height: 200,
dataLabel: false,
dataPointShape: 'circle',
enableScroll: true,
enableScroll: false,
extra: { lineStyle: 'curve' }
}, this)
},

5
pages/moment/paper/index.js

@ -18,10 +18,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.showLoading({
title: '加载中',
mask: true
})
wx.showLoading({ title: '加载中', mask: true })
this.data.cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId)
if(!util.isEmpty(this.data.cateIds)){
this.data.cateIdList = this.data.cateIds.toString().split(',')

15
utils/util.js

@ -159,15 +159,9 @@ function checkId(id) {
sum += parseInt(id_array[k]) * parseInt(c[k]);
}
if (id_array[17].toUpperCase() != b[sum % 11].toUpperCase()) {
return {
'status': 0,
'msg': '身份证校验码不合规'
}
}
return {
'status': 1,
'msg': '校验通过'
return { status: 0, msg: '身份证校验码不合规' }
}
return { status: 1, msg: '校验通过' }
}
const tokenList = [
@ -189,7 +183,8 @@ const tokenList = [
'/pages/article/publish/index',
'/pages/home/attentionPaperList/index',
'/pages/article/feedback/index',
'pages/agent/edit/index'
'pages/agent/edit/index',
'/pages/agent/ability/index'
]
function navigateTo(url){
@ -256,6 +251,8 @@ function navigateTarget(redirectInfo){
navigateTo('/pages/morder/index/index')
} else if(redirectInfo.targetView == 'createArticle'){
navigateTo('/pages/article/publish/index')
} else if(redirectInfo.targetView == 'proxySellActivity'){
navigateTo('/pages/agent/ability/index')
}
}

Loading…
Cancel
Save