门店管理新增创建按钮

This commit is contained in:
唐明明
2021-09-30 15:44:08 +08:00
8 changed files with 64 additions and 20 deletions

View File

@@ -36,7 +36,7 @@
<label class="inputs-label">门店地址</label>
<textarea class="inputs-textarea" v-model="address" placeholder="输入门店地址" auto-height/>
<view class="addrss-icon" @click="onLocation">
<uni-icons type="location-filled" size="20" color="#c82626"></uni-icons>
<uni-icons type="location-filled" size="20" color="#8b64fd"></uni-icons>
</view>
</view>
</view>
@@ -49,7 +49,7 @@
</view>
<view class="basisc-btn">
<button class="add-modules" type="default" @click="onDeleteShop" v-if="type === 'edit'">删除</button>
<button class="btn" type="default" @click="createShop">{{type === 'add' ? '创建': '保存'}}</button>
<button class="btn" :class="{'btn-100': type != 'edit'}" type="default" @click="createShop">{{type === 'add' ? '创建': '保存'}}</button>
</view>
</view>
</template>
@@ -253,7 +253,9 @@
&::after {
border: none;
}
&.btn-100{
width: 100%;
}
&[disabled] {
background: rgba($color: $mian-color, $alpha: .6);
}

View File

@@ -1,6 +1,10 @@
<template>
<view class="lists">
<block v-if="lists.length > 0">
<view class="header-flex">
门店数量{{total}}
<view class="add-btn" @click="$Router.push({name: 'shopCreate'})">添加门店</view>
</view>
<view class="lists-item" v-for="(item, index) in lists" :key="index" @click="$Router.push({name: 'shopCreate', params: { id: item.store_id }})">
<view class="header">
<image class="logo" :src="item.cover" mode="aspectFill"></image>
@@ -28,19 +32,37 @@
export default {
data() {
return {
lists: []
lists: [],
total: 0
};
},
onShow(){
shops().then(res => {
console.log(res)
this.lists = res.data
this.total = res.page.total
})
}
}
</script>
<style lang="scss">
// 添加员工header
.header-flex{
background: white;
padding: ($padding/2) $padding;
display: flex;
justify-content: space-between;
margin-bottom: $margin - 10;
line-height: 60rpx;
color: $text-gray;
.add-btn{
background: $mian-color;
color: white;
width: 150rpx;
text-align: center;
font-size: $title-size-m;
}
}
// 空提示
.list-null{
width: 100vw;