平板端快衣店
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.
 
 
 
 
 

139 lines
3.2 KiB

<template>
<view class="page1">
<view style="position: fixed;top: 0;z-index: 99;height: 70px;width: 100%;display: flex;background: #fff;padding-top: 30px;">
<uni-icons type="left" size='10' @tap="backPage"></uni-icons>
</view>
<view style="width: 100%;position: fixed;top: 70px;height: 50px;z-index: 99;background: #fff;">
<view @tap="topAddShip" style="width: 95%;text-align: center;height: 40px;margin: 0 auto;background: #60F3FF;line-height: 40px;border-radius: 10px;color: #fff;">
新增模板
</view>
</view>
<view style="margin-top:120px;">
<view>
<view class="list-1" v-for="item in categoryList" :key="item" @tap="clickList(item)"
style="height: 40px;line-height: 40px;display: flex;">
<view class="name-tel" style="width: 80%;">
<text style="line-height: 40px;">{{item.printName}}</text>
</view>
<view style="display: flex;width: 20%;">
<view class="name-edit" style="margin-right: 20px;" @tap.stop="delCateName(item)">
删除
</view>
<view class="name-edit" @tap.stop="editCateName(item)">
编辑
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
categoryList: [],
shippList:[],
categoryId:'',
printName:'',
shipId:''
}
},
onShow(){
this.getCategoryList()
},
methods: {
topAddShip(){
uni.navigateTo({
url: "/package1/index/addTemplate"
})
},
getCategoryList(){
this.tui.request("/app/shopprint/getList", "POST", {
shopId:uni.getStorageSync('shopId')
}, false, false).then((res) => {
if (res.code == 200) {
this.categoryList = res.result
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
backPage(){
uni.navigateBack()
},
delCateName(item){
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条模板吗?",
success: function(res) {
uni.showLoading({
title: '加载中...'
})
if (res.confirm) {
that.tui.request("/app/shopprint/delete?id="+item.id, "GET" ,false, false).then((res) => {
if (res.code == 200) {
that.tui.toast('删除成功')
that.getCategoryList()
} else {
that.tui.toast(res.message)
}
}).catch((res) => {})
}
setTimeout(res => {
uni.hideLoading();
}, 500)
}
})
},
editCateName(item){
let qrcode = undefined
let newObj = JSON.parse(item.content)
if(newObj[0].imgUrl != undefined){
uni.setStorageSync('qrcode',newObj[0])
newObj.shift();
}
item.content = newObj
uni.navigateTo({
url: "/package1/index/addTemplate?item="+JSON.stringify(item)
})
},
}
}
</script>
<style lang="scss" scoped>
page,.page1{
height:100%;
font-size: 14px;
background: #fff;
}
.list-1 {
border-bottom: 1px solid #eee;
background: #fff;
margin: 0 auto;
width: 95%;
position: relative;
}
.name-tel {
height: 40px;
line-height: 40px;
}
.name-edit{
width: 60px;
height: 30px;
background: #088FEB;
color: #fff;
line-height: 30px;
text-align: center;
border-radius: 5px;
margin-top: 5px;
}
</style>