|
|
@@ -0,0 +1,210 @@
|
|
|
+<template>
|
|
|
+ <view class="shop-listType_box">
|
|
|
+ <view class="shop-type_box">
|
|
|
+ <view
|
|
|
+ v-for="item in shopListType"
|
|
|
+ :key="item.id"
|
|
|
+ :class="[selectTypeId===item.id?'active':'']"
|
|
|
+ @click="changeType(item)"
|
|
|
+ >
|
|
|
+ {{item.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="shop-show_box">
|
|
|
+ <view
|
|
|
+ @click="selectItemChange(item)"
|
|
|
+ v-for="item in currenTypeShopList"
|
|
|
+ :key="item.id"
|
|
|
+ class="show-shop_box">
|
|
|
+ <image
|
|
|
+ class="img"
|
|
|
+ src="https://file02.16sucai.com/d/file/2014/0829/372edfeb74c3119b666237bd4af92be5.jpg"
|
|
|
+ mode="scaleToFill"
|
|
|
+ />
|
|
|
+ <view class="shop-info_price">
|
|
|
+ <view>
|
|
|
+ <view>{{item.name}}</view>
|
|
|
+ <view>¥{{item.price}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="shop-footer_box">
|
|
|
+ <view class="btn-breakage">
|
|
|
+ 报损
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ @click="settle"
|
|
|
+ class="btn-account">
|
|
|
+ 结算
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <uniPopup
|
|
|
+ :show.sync="isShowFllowNum"
|
|
|
+ type="top"
|
|
|
+ maxHeight="90vh"
|
|
|
+ >
|
|
|
+ <keyboardSetFlower :selectItem="selectItem"></keyboardSetFlower>
|
|
|
+ </uniPopup>
|
|
|
+ <uniPopup
|
|
|
+ :show.sync="isShowSettle"
|
|
|
+ type="top"
|
|
|
+ maxHeight="90vh"
|
|
|
+ >
|
|
|
+ <selectSettle></selectSettle>
|
|
|
+ </uniPopup>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import uniPopup from '@/components/uni-popup'
|
|
|
+ import selectSettle from './select-settle.vue'
|
|
|
+ import keyboardSetFlower from '@/components/app-boardSet-flower.vue'
|
|
|
+ import { showClass,showList } from '@/api/home/index'
|
|
|
+ export default {
|
|
|
+ name:'shopTypeSelect',
|
|
|
+ components:{
|
|
|
+ uniPopup,
|
|
|
+ selectSettle,
|
|
|
+ keyboardSetFlower
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ shopListType:[],
|
|
|
+ selectTypeId: '',
|
|
|
+ arrShop:[],
|
|
|
+ currenTypeShopList:[],
|
|
|
+ isShowFllowNum: false,
|
|
|
+ isShowSettle: false,
|
|
|
+ selectItem:{}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ async init(){
|
|
|
+ try {
|
|
|
+ let { data } = await showClass()
|
|
|
+ this.shopListType = data
|
|
|
+ this.selectTypeId = this.shopListType[0].id
|
|
|
+ this.getShowList()
|
|
|
+ }catch(err){
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getShowList(){
|
|
|
+ try {
|
|
|
+ let { data:{list} } = await showList({})
|
|
|
+ this.arrShop = list
|
|
|
+ this.updateCurrentShop()
|
|
|
+ }catch(err){
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateCurrentShop(){
|
|
|
+ this.currenTypeShopList = this.arrShop[this.selectTypeId]
|
|
|
+ },
|
|
|
+ changeType(item){
|
|
|
+ if(item.id === this.selectTypeId) return false
|
|
|
+ this.selectTypeId = item.id
|
|
|
+ this.updateCurrentShop()
|
|
|
+ },
|
|
|
+ selectItemChange(item){
|
|
|
+ this.selectItem = {
|
|
|
+ ...item,
|
|
|
+ currentUnit:item.bigUnit,
|
|
|
+ currentUnitPrice: item.bigPrice,
|
|
|
+ currentNum: 0
|
|
|
+ }
|
|
|
+ this.isShowFllowNum = true
|
|
|
+ },
|
|
|
+ settle(){
|
|
|
+ this.isShowSettle = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .shop-listType_box {
|
|
|
+ height: 100%;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ box-sizing: border-box;
|
|
|
+ & .shop-type_box {
|
|
|
+ max-height: 300rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow-y: scroll;
|
|
|
+ & > view {
|
|
|
+ border:1px solid #e4e4e4;
|
|
|
+ padding: 8rpx 5rpx;
|
|
|
+ font-size: 14px;
|
|
|
+ min-width: 80rpx;
|
|
|
+ text-align: center;
|
|
|
+ &.active {
|
|
|
+ background-color: #428369;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .shop-show_box {
|
|
|
+ flex: 1;
|
|
|
+ padding: 5rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow-y: scroll;
|
|
|
+ overflow-x: hidden;
|
|
|
+ & .show-shop_box {
|
|
|
+ position: relative;
|
|
|
+ width: 18%;
|
|
|
+ margin-right: 1%;
|
|
|
+ margin-bottom: 1%;
|
|
|
+ height: 70rpx;
|
|
|
+ & .img {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .shop-info_price {
|
|
|
+ position: absolute;
|
|
|
+ // height: 25rpx;
|
|
|
+ background-color: rgba(0, 0, 0, 0.2);
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ font-size: 12rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ & > view {
|
|
|
+ font-size: 12rpx;
|
|
|
+ & > view:nth-child(1) {
|
|
|
+ // margin-bottom: 2rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .shop-footer_box {
|
|
|
+ height: 40rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ & > view {
|
|
|
+ height: 40rpx;
|
|
|
+ padding: 5rpx 25rpx;
|
|
|
+ border-radius: 5rpx;
|
|
|
+ font-size: 14rpx;
|
|
|
+ margin: 0 10rpx;
|
|
|
+ vertical-align: middle;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ &.btn-breakage {
|
|
|
+ background-color: #da9f5a;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ &.btn-account {
|
|
|
+ background-color: #009966;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|