Commit 7c179a86 authored by Mac's avatar Mac

1

parent 65a1bba7
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
<view class="details"> <view class="details">
<view class="item" v-for="(x, i) in ts" :key="i"> <view class="item" v-for="(x, i) in ts" :key="i">
<view class="ticket"> <view class="ticket">
<image mode="aspectFill" :src="x.CouponIco" style="width: 100%; height: 100%;border-top-left-radius: 5px;border-bottom-left-radius: 5px;" ></image> <image mode="aspectFill" :src="x.coupon_data.couponIco" style="width: 100%; height: 100%;border-top-left-radius: 5px;border-bottom-left-radius: 5px;" ></image>
</view> </view>
<view class="detail"> <view class="detail">
<view class="coupond"> <view class="coupond">
<view class="name">{{x.Name}}</view> <view class="name">{{x.coupon_data.name}}</view>
<view class="rule">{{x.Describe}}</view> <view class="rule">{{x.coupon_data.rule}}</view>
<view class="date" v-if="x.IndateType==2">{{x.StartDate+"-"+x.EndDate}}</view> <view class="date">{{x.start_time+"-"+x.end_time}}</view>
<view class="date" v-if="x.IndateType==1">{{x.StartDate+"-"+x.EndDate}}</view>
</view> </view>
<view class="chosen"> <view class="chosen">
<u-radio-group v-model="currentChosen" > <u-radio-group v-model="currentChosen" >
...@@ -77,8 +77,8 @@ export default { ...@@ -77,8 +77,8 @@ export default {
this.currentChosen = this.current; this.currentChosen = this.current;
this.ts=this.list this.ts=this.list
this.ts.forEach(x=>{ this.ts.forEach(x=>{
x.StartDate=x.StartDate.split(' ')[0].replace(/-/g,'.') x.start_time=x.start_time.split(' ')[0].replace(/-/g,'.')
x.EndDate=x.EndDate.split(' ')[0].replace(/-/g,'.') x.end_time=x.end_time.split(' ')[0].replace(/-/g,'.')
}) })
}, },
methods: { methods: {
......
...@@ -375,22 +375,10 @@ ...@@ -375,22 +375,10 @@
}); });
// #endif // #endif
uni.getLocation({
type: 'wgs84',
success: function(res) {
let position = res.latitude + ',' + res.longitude;
uni.setStorageSync("position", {
position: position
});
that.getCurrentStore()
},
fail: function(err) {
that.getCurrentStore()
}
});
this.init();
this.init();
this.getstore()
let set = uni.getStorageSync("basedata") ? let set = uni.getStorageSync("basedata") ?
uni.getStorageSync("basedata").mall.setting : uni.getStorageSync("basedata").mall.setting :
{}; {};
...@@ -483,6 +471,7 @@ ...@@ -483,6 +471,7 @@
}, 500); }, 500);
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.init(); this.init();
this.getstore()
}, },
methods: { methods: {
...@@ -744,10 +733,28 @@ ...@@ -744,10 +733,28 @@
this.isShowBack(); this.isShowBack();
} }
this.formatBg(); this.formatBg();
}, },
(error) => {} (error) => {}
); );
}, },
getstore(){
let that = this;
uni.getLocation({
type: 'wgs84',
success: function(res) {
let position = res.latitude + ',' + res.longitude;
uni.setStorageSync("position", {
position: position
});
that.getCurrentStore()
},
fail: function(err) {
that.getCurrentStore()
}
});
},
getCurrentStore() { getCurrentStore() {
let storeId = uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ? uni.getStorageSync("storeId") let storeId = uni.getStorageSync("storeId") && uni.getStorageSync("storeId").storeId ? uni.getStorageSync("storeId")
.storeId : 0; .storeId : 0;
......
...@@ -186,7 +186,8 @@ ...@@ -186,7 +186,8 @@
}, },
gostoreDetails(item) { gostoreDetails(item) {
uni.setStorageSync("storeId", {storeId:item.Id});
this.currentChosen = item.Id
uni.navigateTo({ uni.navigateTo({
url: "/pages/reserve/storeDetails?id="+item.Id, url: "/pages/reserve/storeDetails?id="+item.Id,
}); });
......
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
color: #232323; color: #232323;
text-align: right; text-align: right;
display: flex; display: flex;
justify-content: flex-end;
} }
</style> </style>
<template> <template>
...@@ -329,10 +330,10 @@ ...@@ -329,10 +330,10 @@
<view class="info-item"> <view class="info-item">
<text class="info-i-l">套餐卡</text> <text class="info-i-l">套餐卡</text>
<view class="right" > <view class="right" >
<text class="content" v-if="courseList.length>0" @click="showCourseHandler">选择套餐卡 <text class="content" v-if="courseList.length>0 && User_Coupon_Id==0" @click="showCourseHandler">选择套餐卡
</text> </text>
<text class="content" v-else-if="courseList.length==0">暂无套餐卡</text> <text class="content" v-else-if="courseList.length==0">暂无套餐卡</text>
<text class="content" v-else :style="{ color: pricecolor }" @click="showCourseHandler">已优惠0</text> <text class="content" v-else :style="{ color: pricecolor }" @click="showCourseHandler">已优惠{{CouponMoney}}</text>
<u-icon name="ellipsis" size="36" v-if="courseList.length > 0" @click="showCourseHandler"></u-icon> <u-icon name="ellipsis" size="36" v-if="courseList.length > 0" @click="showCourseHandler"></u-icon>
</view> </view>
</view> </view>
...@@ -350,15 +351,16 @@ ...@@ -350,15 +351,16 @@
<view class="submit"> <view class="submit">
<view class="submit-l"> <view class="submit-l">
<text>定金:</text> <text>定金:</text>
<text :style="{'color':mainColor}">¥<text style='font-size: 20px;'>{{goods.price*value}}</text></text> <text :style="{'color':mainColor}">¥<text style='font-size: 20px;'>{{Income*value}}</text></text>
</view> </view>
<u-button <u-button
:disabled = 'Nosubmit'
size="80" size="80"
:ripple="true" :ripple="true"
shape="square" shape="square"
@click="submitOrderHandler()" @click="submitOrderHandler()"
:custom-style="{ :custom-style="{
backgroundColor: mainColor, backgroundColor:Nosubmit==false? mainColor:'#D4D4D4',
height: '80rpx', height: '80rpx',
color: '#FFF', color: '#FFF',
fontSize: '14px' fontSize: '14px'
...@@ -451,6 +453,9 @@ ...@@ -451,6 +453,9 @@
courseList:[], courseList:[],
showCourse:false, showCourse:false,
User_Coupon_Id:0, User_Coupon_Id:0,
Nosubmit:true,
Income:0,
CouponMoney:0,
}; };
}, },
...@@ -467,7 +472,7 @@ ...@@ -467,7 +472,7 @@
this.GetApplOGInfo()//商品详情 this.GetApplOGInfo()//商品详情
} }
this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId; this.payInfo.OpenId=uni.getStorageSync('mall_UserInfo').OpenId;
this.getAllCPList()
}, },
mounted() { mounted() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -500,16 +505,21 @@ ...@@ -500,16 +505,21 @@
console.log(e) console.log(e)
if (e != -1) { if (e != -1) {
this.User_Coupon_Id = e; this.User_Coupon_Id = e;
this.Income = 0;
} this.CouponMoney = this.goods.price*this.value
this.showCoupon = false; // this.courseList.forEach(x=>{
// if(x.CouponId == e){
// this.CouponMoney = x.discount_limit
// }
// })
}
this.showCourse = false;
}, },
showCourseHandler(){ showCourseHandler(){
this.showCourse = true; this.showCourse = true;
}, },
GetAppOGList(){ GetAppOGList(){
this.Nosubmit = true;
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
...@@ -518,29 +528,43 @@ ...@@ -518,29 +528,43 @@
data: {categoryIds:this.categoryIds,StoreId: this.id} data: {categoryIds:this.categoryIds,StoreId: this.id}
}, },
res => { res => {
this.OfflineGoods = res.data; this.OfflineGoods = res.data;
this.GoodsId= 0; this.GoodsId= 0;
this.dayList=[]; this.dayList=[];
this.timeList=[]; this.timeList=[];
this.designerList=[]; this.designerList=[];
this.User_Coupon_Id=0;
if(this.OfflineGoods.length>0){ if(this.OfflineGoods.length>0){
this.GoodsId = this.OfflineGoods[0].id; this.GoodsId = this.OfflineGoods[0].id;
this.GetApplOGInfo() this.GetApplOGInfo()
} }
uni.hideLoading(); uni.hideLoading();
} }
); );
}, },
getAllCPList(){ schoolCoupon(){
let ProductList = [];
let obj = {
GoodsClassId: this.goods.categoryIdList,
GoodsPrice: this.goods.price*this.value,
ProductId: this.goods.id,
StoreId:this.id,
};
ProductList.push(obj);
//获取套餐卡的处理
this.User_Coupon_Id=0,
this.Income = this.goods.price;
this.CouponMoney= 0;
this.request2({ this.request2({
url: '/api/AppletStores/GetAllCouponPageList', url: '/api/AppletStores/GetNoUseCouponList',
data: {pageIndex:1,pageSize:999,StoreId:this.id} data: {ProductList: ProductList}
}, },
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.courseList = res.data.pageData this.courseList = res.data
} }
} }
); );
...@@ -548,7 +572,7 @@ ...@@ -548,7 +572,7 @@
GetApplOGInfo(){ GetApplOGInfo(){
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
}); });
this.request2({ this.request2({
url: '/api/AppletGoods/GetAppletOfflineGoodsInfo', url: '/api/AppletGoods/GetAppletOfflineGoodsInfo',
...@@ -565,6 +589,7 @@ ...@@ -565,6 +589,7 @@
this.timeList = this.dayList[0].TimeList; this.timeList = this.dayList[0].TimeList;
this.selecttime= this.timeList[0]; this.selecttime= this.timeList[0];
this.designerList = res.data.goods.persionList; this.designerList = res.data.goods.persionList;
var richtext = this.goods.detail; var richtext = this.goods.detail;
this.detailContent = richtext; this.detailContent = richtext;
let obj = { let obj = {
...@@ -575,6 +600,8 @@ ...@@ -575,6 +600,8 @@
this.designerList.unshift(obj) this.designerList.unshift(obj)
this.selectdesigner= this.designerList[0].Gender; this.selectdesigner= this.designerList[0].Gender;
this.schoolCoupon();//获取套餐卡
this.Nosubmit = false;
} }
} }
...@@ -583,13 +610,14 @@ ...@@ -583,13 +610,14 @@
}, },
submitOrderHandler(){//提交订单 submitOrderHandler(){//提交订单
let that = this; let that = this;
this.submitOrder = true;
if(that.Mobile==''){ if(that.Mobile==''){
uni.showToast({ uni.showToast({
title:'填写手机号码' title:'填写手机号码',
icon: 'none'
}) })
return return false
} }
this.submitOrder = true;
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: that.goods.template_message_list, tmplIds: that.goods.template_message_list,
complete(res) { complete(res) {
...@@ -599,7 +627,9 @@ ...@@ -599,7 +627,9 @@
form.Mobile = that.Mobile; form.Mobile = that.Mobile;
form.Income = that.goods.price*that.value; form.Income = that.goods.price*that.value;
form.Remark = that.remarks; form.Remark = that.remarks;
form.CouponMoney = 0; form.User_Coupon_Id = this.User_Coupon_Id;//优惠券id
form.User_Coupon_Id = this.User_Coupon_Id;//优惠券id
form.CouponMoney = this.CouponMoney;
form.DetailList = []; form.DetailList = [];
let obj={ let obj={
GoodsId:that.goods.id, GoodsId:that.goods.id,
...@@ -661,7 +691,9 @@ ...@@ -661,7 +691,9 @@
this.selectdesigner = item.Gender this.selectdesigner = item.Gender
}, },
valChange(e){ valChange(e){
this.value = e.value this.value = e.value;
this.schoolCoupon();//获取套餐卡
console.log(e)
}, },
closePay() { closePay() {
this.payBtn = false; this.payBtn = false;
...@@ -669,15 +701,16 @@ ...@@ -669,15 +701,16 @@
}, },
exitPay() { exitPay() {
this.payExit = false; this.payExit = false;
// uni.redirectTo({ uni.redirectTo({
// url: "/pages/order/index/index?status=0", url: "/pages/reserve/personal/orderlist?status=0",
// }); });
}, },
clickDescription(e){ clickDescription(e){
}, },
goodsdetails(){//商品详情 goodsdetails(){//商品详情
// this.goods
uni.navigateTo({ url: "/pages/reserve/goodsDetails?GoodsId=" + this.goods.id });
} }
}, },
}; };
......
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