|
|
@@ -0,0 +1,190 @@
|
|
|
+<template>
|
|
|
+ <view class="shop-listType_box">
|
|
|
+ <view class="shop-type_box">
|
|
|
+ <view v-for="item in categoryData" :key="item.id" :class="[categoryId===item.id?'active':'']" @click="changeCategory(item)" > {{item.categoryName}} </view>
|
|
|
+ </view>
|
|
|
+ <view class="shop-show_box">
|
|
|
+ <view v-for="item in goodsInfoList" :key="item.id" class="show-shop_box">
|
|
|
+ <view class="item-detail" @click="popAddModelFn(item)">
|
|
|
+ <image class="img" :src="item.cover" mode="scaleToFill" ></image>
|
|
|
+ <view class="shop-info_price">
|
|
|
+ <view>
|
|
|
+ <view>{{item.name}}</view>
|
|
|
+ <view>¥{{parseFloat(item.price)}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <slot name="footer"></slot>
|
|
|
+
|
|
|
+ <!-- 开单选花材输入数量和金额 -->
|
|
|
+ <uni-popup ref="kdSelectNumPriceRef" background-color="#fff" type="center" :animation="false">
|
|
|
+ <kdSelectNumPrice @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></kdSelectNumPrice>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import settlePop from './settle-pop.vue'
|
|
|
+import { getClass } from '@/api/category/index'
|
|
|
+import { getGoodsList } from '@/api/goods/index'
|
|
|
+import productMins from "@/mixins/product";
|
|
|
+import kdSelectNumPrice from '@/components/app-kd-select-num-price.vue'
|
|
|
+export default {
|
|
|
+ name:'rightItemArea',
|
|
|
+ components:{ settlePop,kdSelectNumPrice },
|
|
|
+ mixins: [productMins],
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ categoryData:[],
|
|
|
+ categoryId: '',
|
|
|
+ goodsInfoList:[],
|
|
|
+ selectJobType:'bill',
|
|
|
+ selectJobId:0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ customId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ customId:{
|
|
|
+ handler(newCustomId){
|
|
|
+ this.selectJobId = newCustomId
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ popAddModelFn(info) {
|
|
|
+ this.$util.hitRemind()
|
|
|
+ this.showAddModelFn({ ...info, buyNum: 1, unitPrice: info.price,unitType:0})
|
|
|
+ },
|
|
|
+ init(){
|
|
|
+ getClass().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.categoryData = res.data
|
|
|
+ this.categoryId = this.categoryData[0].id
|
|
|
+ this.getGoodsData()
|
|
|
+ //this.initStorageData()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getGoodsData(){
|
|
|
+ getGoodsList({cId:this.categoryId}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.goodsInfoList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeCategory(item){
|
|
|
+ this.$util.hitRemind()
|
|
|
+ if(item.id === this.categoryId){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.categoryId = item.id
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.shop-listType_box {
|
|
|
+ height: 100%;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ box-sizing: border-box;
|
|
|
+ & .shop-show_box{
|
|
|
+ & .show-shop_box{
|
|
|
+ & .item-detail{
|
|
|
+ position: relative;
|
|
|
+ margin-right: 9upx;
|
|
|
+ margin-bottom: 6upx;
|
|
|
+ width: 82upx;
|
|
|
+ height: 82upx;
|
|
|
+ & .img {
|
|
|
+ width: 82upx;
|
|
|
+ height: 82upx;
|
|
|
+ }
|
|
|
+ .shop-info_price {
|
|
|
+ position: absolute;
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ font-size: 12upx;
|
|
|
+ color: #ffffff;
|
|
|
+ height:25upx;
|
|
|
+ & > view {
|
|
|
+ font-size: 10upx;
|
|
|
+ & > view:nth-child(1) {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow:ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ width:90%;
|
|
|
+ }
|
|
|
+ & > view:nth-child(2) {
|
|
|
+ font-size:8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .shop-type_box {
|
|
|
+ max-height: 300upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow-y: scroll;
|
|
|
+ & > view {
|
|
|
+ border:1px solid #e4e4e4;
|
|
|
+ padding: 12upx 0upx;
|
|
|
+ font-size: 15px;
|
|
|
+ min-width: 75upx;
|
|
|
+ text-align: center;
|
|
|
+ &.active {
|
|
|
+ background-color: #428369;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .shop-show_box {
|
|
|
+ flex: 1;
|
|
|
+ padding: 2upx;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow-y: scroll;
|
|
|
+ overflow-x: hidden;
|
|
|
+ }
|
|
|
+ & .shop-footer_box {
|
|
|
+ height: 40upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ & > view {
|
|
|
+ height: 40upx;
|
|
|
+ padding: 5upx 25upx;
|
|
|
+ border-radius: 5upx;
|
|
|
+ font-size: 14upx;
|
|
|
+ margin: 0 10upx;
|
|
|
+ vertical-align: middle;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ &.btn-breakage {
|
|
|
+ background-color: #da9f5a;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ &.btn-account {
|
|
|
+ background-color: #009966;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|