Browse Source

no message

feature/v2.3
xpz2018 4 years ago
parent
commit
e58e65b35d
8 changed files with 21 additions and 16 deletions
  1. 2
      api/saas.js
  2. 2
      components/sidebar-item/index.wxml
  3. 2
      components/sidebar-item/index.wxss
  4. 1
      pages/process/order-list/index.wxml
  5. 6
      pages/setting/paper-detial/index.js
  6. 6
      pages/setting/paper-detial/index.wxml
  7. 10
      pages/setting/paper-select/index.js
  8. 8
      pages/setting/paper-select/index.wxml

2
api/saas.js

@ -37,6 +37,7 @@ const getFactoryOrderList = (params) => mGet(`/ztb-factory/factory/wechat-applet
const getFactoryOrderInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/order-detail/${id}`, null, sconfig)
const getPaperList = (params) => mGet(`/ztb-factory/factory/get/all-product`, params, sconfig)
const getCategoryList = () => mGet(`/recycle-service/get/product-category-list`, null, sconfig)
const getProductList = () => mGet(`/ztb-factory/get/all-common-product`, null, sconfig)
const getPaperPrice = (params) => mGet(`/ztb-factory/factory/get/product-price-list`, params, sconfig)
const getPaperInfo = (id) => mGet(`/ztb-factory/factory/get/product-price/${id}`, null, sconfig)
const savePaperPrice = (params) => mPost(`/ztb-factory/factory/save/product-price`, params, sconfig)
@ -120,6 +121,7 @@ export {
createInOrder,
getPaperPrice,
getCategoryList,
getProductList,
getPaperInfo,
savePaperPrice,
editPaperPrice,

2
components/sidebar-item/index.wxml

@ -5,7 +5,7 @@
hover-class="van-sidebar-item--hover" hover-stay-time="70" bind:tap="onClick">
<view class="van-sidebar-item__text">
<van-info wx:if="{{ info !== null || dot }}" dot="{{ dot }}" info="{{ info }}" custom-style="right: 4px" />
<view style="text-overflow: ellipsis;white-space: nowrap;width:100%" wx:if="{{ title }}">{{ title }}</view>
<view class="{{ selected ? 'text-blue' : 'text-black' }}" style="text-overflow: ellipsis;white-space: nowrap;width:100%" wx:if="{{ title }}">{{ title }}</view>
<slot wx:else name="title" />
</view>
</view>

2
components/sidebar-item/index.wxss

@ -1 +1 @@
@import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;word-wrap:break-word;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:20px 12px 20px 8px;padding:var(--sidebar-padding,20px 12px 20px 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:24px;line-height:var(--sidebar-line-height,24px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#008AFF;border-color:var(--sidebar-selected-border-color,#008AFF)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)}
@import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;word-wrap:break-word;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:24rpx 12px 24rpx 8px;padding:var(--sidebar-padding,24rpx 12px 24rpx 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:24px;line-height:var(--sidebar-line-height,24px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#008AFF;border-color:var(--sidebar-selected-border-color,#008AFF)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)}

1
pages/process/order-list/index.wxml

@ -96,6 +96,5 @@
<van-button round type="info" icon="plus" bind:click="addOrder" custom-style="width: 100rpx;height: 100rpx;"></van-button>
</view>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/>

6
pages/setting/paper-detial/index.js

@ -1,7 +1,7 @@
// pages/setting/paper-detial/index.js
import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog'
import { getPaperInfo, getCategoryList, savePaperPrice, editPaperPrice, delePaperPrice } from "../../../api/saas"
import { getPaperInfo, getProductList, savePaperPrice, editPaperPrice, delePaperPrice } from "../../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
@ -20,7 +20,7 @@ Scene({
onLoad: function (options) {
if(options.id){
wx.showLoading({ title: '正在获取', mask: true })
getCategoryList().then(result => {
getProductList().then(result => {
this.setData({ paperList: result.data })
}).catch(err => {
util.showToast(err)
@ -34,7 +34,7 @@ Scene({
})
} else {
wx.showLoading({ title: '正在获取', mask: true })
getCategoryList().then(result => {
getProductList().then(result => {
this.setData({ paperList: result.data })
wx.hideLoading()
}).catch(err => {

6
pages/setting/paper-detial/index.wxml

@ -1,9 +1,9 @@
<!--pages/setting/paper-detial/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content" style="color:black;font-size:18px">品详情</view>
<view slot="content" style="color:black;font-size:18px">品详情</view>
</cu-custom>
<van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="点击可以修改品信息" />
<van-notice-bar color="#1989fa" background="#008AFF" left-icon="info-o" text="点击可以修改品信息" />
<van-field title-width="360rpx" required value="{{form.categoryName }}" readonly input-align="right" label="品类名称:" is-link arrow-direction="down"
bindtap="chooseMethod" placeholder="请选择品类"/>
<van-field title-width="360rpx" id="productName" value="{{ form.productName || form.categoryName }}" label="品类别名:"
@ -14,7 +14,7 @@
placeholder="请输入最高收货价格(选填)" input-align="right" clearable type="digit" bind:input="bindInput" />
<view style="margin-top:48rpx;padding:48rpx 32rpx">
<van-button block type="danger" bind:click="deleteForm" wx:if="{{ form.id}}">删除</van-button>
<view style="height:36rpx" wx:if="{{ form.id}}"></view>
<view style="height:36rpx" wx:if="{{ form.id }}"></view>
<van-button block type="info" bind:click="submitForm">保存</van-button>
</view>

10
pages/setting/paper-select/index.js

@ -6,7 +6,11 @@ Component({
properties: {
visible: { type: Boolean, value: false },
cIndex: { type: Number, value: -1 },
paperList: { type: Array, value: [] }
paperList: {
type: Array,
value: [],
observer: 'updateSubItems'
}
},
data: {
activeIndex: 0,
@ -14,11 +18,11 @@ Component({
},
methods: {
onClickNav: function({detail}){
console.log(detail)
this.setData({ activeIndex: Number(detail), cIndex: -1 })
},
onConfirm: function(e){
this.data.cIndex = e.currentTarget.dataset.index
var item = this.data.paperList[this.data.cIndex]
var item = this.data.paperList[this.data.activeIndex].smallProductCategoryInfoList[this.data.cIndex]
wx.nextTick(() => {
this.setData({ visible: false, cIndex: this.data.cIndex })
this.triggerEvent('select', item)

8
pages/setting/paper-select/index.wxml

@ -1,20 +1,20 @@
<van-popup position="bottom" show="{{ visible }}" bind:close="onHide" z-index="29">
<view class="van-picker__toolbar van-hairline--top-bottom toolbar-class">
<view class="van-picker__cancel" hover-stay-time="70"></view>
<view class="van-picker__title van-ellipsis">选择品</view>
<view class="van-picker__title van-ellipsis">选择品</view>
<view class="van-picker__confirm flex flex-cener" hover-class="van-picker__confirm--hover" hover-stay-time="70" bindtap="onHide">
<van-icon name="cross" size="24" color="#999999" />
</view>
</view>
<view class="flex" style="height:580rpx;">
<scroll-view scroll-y class="van-tree-select__nav" style="height:100%;width: 200rpx;">
<scroll-view scroll-y class="van-tree-select__nav" style="height:100%;width: 200rpx;background-color: #F7F8FA;border-right: 1rpx solid #f3f3f3">
<van-sidebar active-key="{{ activeIndex }}" bind:change="onClickNav" custom-class="van-tree-select__nav__inner">
<van-sidebar-item wx:for="{{ items }}" wx:key="index" title="{{ item.text }}" />
<van-sidebar-item wx:for="{{ paperList }}" wx:key="index" title="{{ item.name }}" />
</van-sidebar>
</scroll-view>
<scroll-view scroll-y="true" style="height:100%;flex: 1;padding: 12rpx 0rpx">
<van-grid column-num="2" border="{{fasle}}">
<van-grid-item use-slot wx:for="{{ paperList }}" wx:key="index" content-style="padding:12rpx">
<van-grid-item use-slot wx:for="{{ paperList[activeIndex].smallProductCategoryInfoList }}" wx:key="index" content-style="padding:12rpx">
<van-button plain type="{{index == cIndex ? 'info' : 'default'}}" custom-style="height:88rpx;width:228rpx;padding: 0rpx" data-index="{{index}}" bind:click="onConfirm">{{item.categoryName}}</van-button>
</van-grid-item>
</van-grid>

Loading…
Cancel
Save