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.
112 lines
2.8 KiB
112 lines
2.8 KiB
<template>
|
|
<view class="all-container pd-main backcor6 font15">
|
|
<view class=" width100 mart10">
|
|
<button class="btns " @click.stop="clickToAdd()">新增</button>
|
|
</view>
|
|
<view class="mart20 backcorfff">
|
|
<view class="dis-flex height40 bor-botm1">
|
|
<view class="flex-1 fotct fontwig6 " ></view>
|
|
<view class="flex-1 fotct fontwig6">名称</view>
|
|
<view class="flex-1 fotct fontwig6">价格</view>
|
|
<!-- <view class="flex-1 fotct fontwig6">规格</view> -->
|
|
<view class="flex-1 fotct fontwig6">有效期</view>
|
|
<view class="flex-1 fotct fontwig6">操作</view>
|
|
</view>
|
|
|
|
<view class="dis-flex bor-botm1 paddtop5 paddbotm5 " v-for="(item,index) in storeGroupList" :key="index">
|
|
<view class="flex-1 fotct">
|
|
<image :src="imgUrl+item.img" @click.stop="previewImage(imgUrl+item.img)" mode="aspectFit" class="width100 height60 verc"></image>
|
|
</view>
|
|
<view class="flex-1 fotct text1">{{item.name}}</view>
|
|
<view class="flex-1 fotct text1">{{item.price}}</view>
|
|
|
|
<view class="flex-1 fotct text1">{{item.validity}}</view>
|
|
<view class="flex-1 fotct fcor41c" @click.stop="clickToEdit(item)">编辑</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getStoreGroupList
|
|
} from '@/Utils/groupBuying.js';
|
|
const app = getApp();
|
|
export default {
|
|
data(){
|
|
return{
|
|
imgUrl: app.globalData.imgUrl, //图片访问地址
|
|
storeId:'',//门店id
|
|
storeGroupList:[],//门店团购列表
|
|
}
|
|
},
|
|
onLoad(options){
|
|
if(options.storeId){
|
|
this.storeId = options.storeId;
|
|
this.getStoreGroupList()
|
|
}
|
|
},
|
|
methods:{
|
|
clickToAdd(){
|
|
let that = this;
|
|
uni.navigateTo({
|
|
url:"./groupProductAdd?status=1&storeId="+that.storeId
|
|
})
|
|
},
|
|
clickToEdit(item){
|
|
let that = this;
|
|
uni.navigateTo({
|
|
url:"./groupProductAdd?status=2&id="+item.id+"&storeId="+that.storeId
|
|
})
|
|
},
|
|
// 根据门店id 查询门店团购内容
|
|
getStoreGroupList(){
|
|
let params={
|
|
storeId:this.storeId
|
|
}
|
|
uni.showLoading({
|
|
title:"加载中",
|
|
mask:true
|
|
})
|
|
getStoreGroupList(params).then(res=>{
|
|
uni.hideLoading();
|
|
if (res.return_code == '000000') {
|
|
if(res.return_data.length>0){
|
|
this.storeGroupList = res.return_data
|
|
}
|
|
}else{
|
|
uni.showToast({
|
|
title: res.return_msg,
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
})
|
|
},
|
|
// 预览
|
|
previewImage(img){
|
|
uni.previewImage({
|
|
current: 0,
|
|
indicator: "number",
|
|
loop: "true",
|
|
urls:[img]
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.btns {
|
|
width: 21%;
|
|
height: 35px;
|
|
line-height: 35px;
|
|
background-color: #0083f5;
|
|
color: #FFFFFF;
|
|
font-weight: bold;
|
|
font-size: 12px;
|
|
padding: 0px;
|
|
margin: 0 0 0 auto;
|
|
}
|
|
</style> |