You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.2 KiB

<template>
<view class="templist-box">
<view class="list">
3 years ago
<view class="item acea-row row-between-wrapper" v-for="(item,index) in tempList" :key="index" @tap="choseTemp(item)">
<view class="temp-name">
{{index + 1}}{{item.name}}
</view>
3 years ago
<view class="handle-btn" @tap.stop="del(item)">
<image src="../../../static/images/del-goods.png"></image>
</view>
</view>
</view>
3 years ago
<view class="btn-box" @tap.stop="toTemp">新增运费模板</view>
</view>
</template>
<script>
import { getTempList } from '@/api/user'
export default{
data(){
return {
tempList: []
}
},
3 years ago
onShow(){
this.getTempList()
3 years ago
},
mounted(){
3 years ago
},
onPullDownRefresh(){
this.getTempList()
},
methods:{
3 years ago
choseTemp(item){
console.log(item,'item')
let pages = getCurrentPages();
console.log(pages,'pages')
let page = pages[pages.length -2]
if(page.route == 'pages/life/addGoods/index'){
page.$vm.temp = item.name
page.$vm.tempId = item.id
uni.navigateBack({
delta: 1
})
}
},
del(item){
},
getTempList(){
getTempList().then((res)=>{
// console.log(res)
this.tempList = res.data.content
3 years ago
uni.stopPullDownRefresh()
})
},
toTemp(){
uni.navigateTo({
url:'/pages/life/temp/index'
})
}
}
}
</script>
<style lang="less">
.templist-box{
width: 100%;
min-height: 100vh;
background: #F5F6F7;
padding: 30rpx 20rpx 110rpx;
position: relative;
.list{
width: 100%;
padding-bottom: 60rpx;
.item{
width: 100%;
background: #fff;
padding: 24rpx;
color: #000;
font-size: 28rpx;
margin-bottom: 12rpx;
.temp-name{
width: 80%;
height: 50rpx;
line-height: 50rpx;
}
.handle-box{
width: 100%;
height: 46rpx;
border-top: 2rpx solid #F8F7F7;
3 years ago
}
.handle-btn{
margin-left: 12rpx;
image{
width: 29rpx;
height: 29rpx;
}
}
}
}
.btn-box{
width: 690rpx;
height: 76rpx;
line-height: 76rpx;
text-align: center;
font-size: 34rpx;
font-weight: 500;
border-radius: 40rpx;
background: linear-gradient(134deg, #FFA782 0%, #FF6D31 100%);
color: #fff;
position: fixed;
bottom: 30rpx;
left: 30rpx;
}
}
</style>