diff --git a/api/saas.js b/api/saas.js index 588adc6..0cb1718 100644 --- a/api/saas.js +++ b/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, diff --git a/components/sidebar-item/index.wxml b/components/sidebar-item/index.wxml index 1dfe4b0..fb84180 100644 --- a/components/sidebar-item/index.wxml +++ b/components/sidebar-item/index.wxml @@ -5,7 +5,7 @@ hover-class="van-sidebar-item--hover" hover-stay-time="70" bind:tap="onClick"> - {{ title }} + {{ title }} \ No newline at end of file diff --git a/components/sidebar-item/index.wxss b/components/sidebar-item/index.wxss index 217c627..8c4797e 100644 --- a/components/sidebar-item/index.wxss +++ b/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)} \ No newline at end of file +@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)} \ No newline at end of file diff --git a/pages/process/order-list/index.wxml b/pages/process/order-list/index.wxml index aa58b88..af69bec 100644 --- a/pages/process/order-list/index.wxml +++ b/pages/process/order-list/index.wxml @@ -96,6 +96,5 @@ - \ No newline at end of file diff --git a/pages/setting/paper-detial/index.js b/pages/setting/paper-detial/index.js index ad64d09..78f0b20 100644 --- a/pages/setting/paper-detial/index.js +++ b/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 => { diff --git a/pages/setting/paper-detial/index.wxml b/pages/setting/paper-detial/index.wxml index d8f2169..9455b8c 100644 --- a/pages/setting/paper-detial/index.wxml +++ b/pages/setting/paper-detial/index.wxml @@ -1,9 +1,9 @@ - 纸品详情 + 品类详情 - + 删除 - + 保存 diff --git a/pages/setting/paper-select/index.js b/pages/setting/paper-select/index.js index 28d35c2..cddbc48 100644 --- a/pages/setting/paper-select/index.js +++ b/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) diff --git a/pages/setting/paper-select/index.wxml b/pages/setting/paper-select/index.wxml index 3d8d32a..6df3f19 100644 --- a/pages/setting/paper-select/index.wxml +++ b/pages/setting/paper-select/index.wxml @@ -1,20 +1,20 @@ - 选择纸品 + 选择品类 - + - + - + {{item.categoryName}}