Commit 7c179a86 authored by Mac's avatar Mac

1

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