Commit 7661d345 authored by Mac's avatar Mac

卡包

parent 1b604318
......@@ -456,6 +456,10 @@
}
},{
"path":"draw"
},{
"path":"personal/myVipList"
},{
"path":"personal/vipDetail"
}
]
},
......
......@@ -258,11 +258,14 @@
uni.showLoading({
title: '加载中'
});
let storeId = uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ? uni.getStorageSync("storeId")
.storeId : 0;
if(this.storeId==0){
this.storeId = uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ? uni.getStorageSync("storeId")
.storeId : 0;
}
this.request2({
url: '/api/AppletStores/GetReserveCouponDetail',
data: {ID:this.ID,StoreId:storeId}
data: {ID:this.ID,StoreId:this.storeId}
},
res => {
if (res.resultCode == 1) {
......
<template>
</template>
<script>
</script>
<style>
</style>
<style scoped>
.vipDetail {
width: 100%;
height: 100vh;
background: #FAF8F9;
font-family: aa;
padding: 15px;
}
.vipDetail .vipd_top{
width: 100%;
height: 194px;
border-radius: 10px;
overflow: hidden;
position: relative;
}
.vipDetail .submit{
width: 100%;
height: 60px;
background: #FFF;
position: fixed;
left: 0;
bottom: 0;
padding: 0 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
z-index: 99;
}
.vipDetail .bj {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
.vipDetail .btext{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
font-size: 12px;
color: #FFF;
padding: 15px;
}
</style>
<template>
<view class="vipDetail" v-if="loading">
<view class="vipd_top">
<image mode="aspectFill" :src="cdetail.CardBagIco" style="width: 100%;height: 100%;border-radius: 10px;"></image>
<view class="bj"></view>
<view class="btext">
<text>{{cdetail.Name}}</text>
</view>
</view>
<view class="submit">
<text>{{cdetail.Name}}</text>
<u-button
size="80"
:ripple="true"
shape="circle"
@click="submitreceive()"
:custom-style="{
backgroundColor:mc,
height: '80rpx',
color: '#FFF',
fontSize: '14px',
}"
>
{{cdetail.MemberNum>0?'去使用':'立即领取'}}
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "会员卡详情",
mc: "",
loading: false,
ID:0,
storeId:0,
cdetail:{},
current:0,
submitOrder:false,
cstore:0,
};
},
onLoad(option) {
console.log(option)
this.mc = this.$uiConfig.mainColor;
if(option && option.ID){
this.ID = option.ID
}
if(option && option.storeId){
this.storeId = option.storeId
}
this.getDetail()//获取套餐卡详情
},
mounted() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
getDetail(){
uni.showLoading({
title: '加载中'
});
this.request2({
url: '/api/AppletStores/GetReserveCardBagDetail',
data: {ID:this.ID,StoreId:this.storeId}
},
res => {
if (res.resultCode == 1) {
this.loading = true
this.cdetail=res.data
}
uni.hideLoading();
}
);
},
submitreceive(){
if(this.cdetail.MemberNum==0){
this.request2({
url: '/api/AppletStores/GrantCoupon',
data: {CouponId:this.ID,StoreId:this.storeId}
},
res => {
if (res.resultCode == 1) {
uni.showToast({
title: res.message,
icon: "none",
});
this.cdetail.MemberNum=1
}
}
);
}else{
let data = []
let g = this.cdetail
if(g.UseType==1 || g.UseType==2){
g.ProductList.forEach(x=>{
data.push(x.ProductId)
})
let id = data.toString()
uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id+'&UseType='+g.UseType });
}else{
uni.redirectTo({ url: '/pages/goods/list'});
}
}
},
},
};
</script>
......@@ -303,6 +303,34 @@
font-size: 14px;
color: #FFFFFF;
}
.d-t-box{
width: 150px;
height: 75px;
border-radius: 6px;
overflow: hidden;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
.bj {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.2);
border-radius: 6px;
}
.btext{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
font-size: 12px;
color: #FFF;
padding: 5px;
}
</style>
<template>
<view class='storeDetails'
......@@ -444,16 +472,25 @@
</view>
</view>
</view>
<view class="title-c" >
卡包
<view class="title-c" v-if="vipList.length>0">
会员卡
</view>
<view class="cardbag">
<view v-if="allCoupon.length==0" style="width: 100%;height: 50px;line-height: 50px;text-align: center;" >
暂无任何卡包~
<view class="cardbag" v-if="vipList.length>0">
<view v-if="vipList.length==0" style="width: 100%;height: 50px;line-height: 50px;text-align: center;" >
暂无任何会员卡~
</view>
<view v-for="(cl, ci) in vipList" :key="ci" @click="govipD(cl)" v-if="vipList.length>0">
<view class="setmeal-item u-skeleton-rect" :style="{'margin-left':ci==0?'15px':'0','margin-right': ci+1==vipList.length?'15px':'5px','width':'150px'}">
<view class="d-t-box">
<image mode="aspectFill" :src="cl.CardBagIco" style="width: 100%;height: 100%;border-radius: 6px;"></image>
<view class="bj"></view>
<view class="btext">
<text>{{cl.Name}}</text>
</view>
</view>
</view>
</view>
<!-- TOdo 卡包的列表-->
<view style="width: 100%;height: 200px;"></view>
</view>
<view class="title-c" @click="goPersonal" v-if="personalList.length>0">
......@@ -589,7 +626,7 @@
couponMessage: "",
list:[
{name: '优惠'},
{name: '卡包'},
{name: '会员卡'},
{name: '设计师'},
{name: '评价'},
{name: '价目表'},
......@@ -601,7 +638,7 @@
headH:68,
stickyH:0,
setmealH:0,//套餐卡的高度
cardbagH:0,//卡包的高度
cardbagH:0,//会员卡的高度
designerH:0,//设计师的高度
richtextH:0,//富文本的高度
richtextH2:0,//富文本的高度
......@@ -615,6 +652,7 @@
detailContent2:'',
personalList:[],
allCoupon:[],
vipList:[],
count:0,
positionObj:{} //位置
}
......@@ -626,6 +664,7 @@
} else {
this.id = option.GoodsId ? option.GoodsId : 2;
}
if (option && option.custom_params) {
let custom_params = JSON.parse(decodeURIComponent(option.custom_params));
if (custom_params.user_id) {
......@@ -862,6 +901,29 @@
}
}
}
this.getViplist()
}
}
);
},
getViplist(){
this.request2({
url: '/api/AppletStores/GetAllCardBagList',
data: {pageIndex:1,pageSize:999,StoreId:this.id}
},
res => {
if (res.resultCode == 1) {
this.vipList = res.data.pageData
if(this.vipList.length==0){
for(let i=0;i<this.list.length;i++){
if(this.list[i].name=='会员卡'){
this.list.splice(i,1)
}
}
}
}
}
);
......@@ -895,7 +957,7 @@
uni.pageScrollTo({
scrollTop: that.setmealH - that.headH -40-30
})
}else if(that.list[e].name=='卡包'){
}else if(that.list[e].name=='会员卡'){
uni.pageScrollTo({
scrollTop: that.cardbagH - that.headH -40-30
})
......@@ -1039,6 +1101,13 @@
url: "/pages/reserve/designerDetail?ID="+item.ID+'&storeId='+this.id,
})
},
govipD(item){//会员卡详情
console.log(this.id)
uni.navigateTo({
url: "/pages/reserve/personal/vipDetail?ID="+item.CouponId+'&storeId='+this.id,
})
},
lookLocation(storeAddress){
uni.openLocation({
latitude: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment