Commit b17efaae authored by 罗超's avatar 罗超

新增咖啡

parent 19f253de
<template> <template>
<view class="coffeeBuy"> <view class="coffeeBuy">
<view class="topBox" :style="{paddingTop:`${statusNavBar}px`}"> <view class="topBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/banner2.png" <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/banner2.png"
mode="widthFix" class="bg"></image> mode="widthFix" class="bg"></image>
<u-sticky :offset-top="statusNavBar"> <u-sticky >
<view class="nav"> <view class="nav" :style="{paddingTop:`${statusNavBar}px`}">
<u-icon name="arrow-left" size="40" color="#fff" @click="back"></u-icon> <u-icon name="arrow-left" size="40" color="#fff" @click="back"></u-icon>
<view class="title"> <view class="title">
购买 购买
...@@ -150,6 +150,8 @@ ...@@ -150,6 +150,8 @@
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #3E766E;
box-sizing: content-box;
.title { .title {
font-size: 30rpx; font-size: 30rpx;
......
<template>
<view>
<u-popup v-model="showDig" :maskCloseAble="false" mode="center" @close="closePopup">
<view style="margin: 60rpx;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup3.png"
mode="widthFix" style="width:546rpx;height:auto;display: block;"></image>
<view class="viewBox">
<view class="cup">
1杯
</view>
<view class="successText">
核销成功
</view>
<view class="user">
小猪
</view>
</view>
<view class="closeIcon" @click="closePopup">
<u-icon name="close" color="#fefefe" size="60"></u-icon>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
// model: {
// prop: 'show',
// event: "change"
// },
props: {
show:{
type:Boolean,
default: false,
}
},
watch:{
show(val){
this.showDig=val
}
},
data() {
return {
showDig:false
}
},
methods: {
closePopup() {
this.$emit("close");
}
},
}
</script>
<style lang="scss" scoped>
.viewBox {
width: 546rpx;
height: 286rpx;
background-color: #FFFFFF;
border-radius: 0rpx 0rpx 24rpx 24rpx;
padding-top: 40rpx;
.cup{
font-size: 40rpx;
font-weight: 800;
color: #3E766E;
text-align: center;
margin-bottom: 6rpx;
}
.successText{
font-size: 32rpx;
color: #111111;
font-weight: 700;
text-align: center;
margin-bottom: 40rpx;
}
.user{
font-size: 28rpx;
font-weight: 500;
color: #888888;
text-align: center;
}
}
.closeIcon{
margin: 35rpx auto 0;
display: flex;
justify-content: center;
}
</style>
...@@ -5,23 +5,13 @@ ...@@ -5,23 +5,13 @@
<text class="store">阳光新业店</text> <text class="store">阳光新业店</text>
<text class="type">到店消费</text> <text class="type">到店消费</text>
</view> </view>
<view class="addrText">{{item.addr}}</view> <view class="addrText">{{item.addr||""}}</view>
</view>
<view class="userinfo">
<view class="liuyan" style="margin-top: 10px;">
<u-field padding="0px" label-width="120" input-align='right' v-model="msg.name" label="联系人"
placeholder="姓名"></u-field>
</view>
<view class="liuyan" style="margin-top: 10px;">
<u-field padding="0px" label-width="120" input-align='right' v-model="msg.mobile" label="联系电话"
type='number' placeholder="电话"></u-field>
</view>
</view> </view>
<view class="orderDetail"> <view class="orderDetail">
<view class="row1"> <view class="row1">
<view class="row1Sub"> <view class="row1Sub">
<image <image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup2.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup4.png"
mode="" style="width: 150rpx;height: 150rpx;"></image> mode="" style="width: 150rpx;height: 150rpx;"></image>
<view class="coffeeInfo"> <view class="coffeeInfo">
<view class="num"> <view class="num">
...@@ -53,7 +43,7 @@ ...@@ -53,7 +43,7 @@
</view> </view>
<view class="row3"> <view class="row3">
<text class="name">应付</text> <text class="name">应付</text>
<text class="totalPrice"> ¥{{detailData.total_price}}</text> <text class="totalPrice"> ¥{{detailData.total_price||0}}</text>
</view> </view>
</view> </view>
<view class="payRow"> <view class="payRow">
...@@ -69,7 +59,7 @@ ...@@ -69,7 +59,7 @@
<view class="payRow2"> <view class="payRow2">
<view class="name"> <view class="name">
需支付 需支付
<text class="payMomey">¥{{detailData.total_price}}</text> <text class="payMomey">¥{{detailData.total_price||0}}</text>
</view> </view>
<view class="payBtn" @click="setOrder"> <view class="payBtn" @click="setOrder">
去支付 去支付
...@@ -77,7 +67,7 @@ ...@@ -77,7 +67,7 @@
</view> </view>
<payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom> <payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom>
<u-popup v-model="payExit" mode="center" :mask-close-able="false"> <u-popup v-model="payExit" mode="center" :mask-close-able="false">
<view style="background:#fff;width:500rpx"> <view style="background:#fff;width:500rpx;border-radius: 10rpx;">
<view style="padding:10px 0 0 10px">提交失败</view> <view style="padding:10px 0 0 10px">提交失败</view>
<view style="text-align:center;padding-bottom:40rpx"> <view style="text-align:center;padding-bottom:40rpx">
<view style="margin:80rpx 0">支付取消</view> <view style="margin:80rpx 0">支付取消</view>
...@@ -100,10 +90,6 @@ ...@@ -100,10 +90,6 @@
payBtn: false, payBtn: false,
payExit: false, payExit: false,
item: {}, item: {},
msg: {
name: "",
mobile: ""
},
formdata: { formdata: {
AddressId: 0, AddressId: 0,
DeliveryMethod: 0, DeliveryMethod: 0,
...@@ -120,7 +106,8 @@ ...@@ -120,7 +106,8 @@
OrderPayType: 1, OrderPayType: 1,
GoodsName: '', GoodsName: '',
type: 2, //是甲鹤付款 type: 2, //是甲鹤付款
total_price: 0 total_price: 0,
isCoffee:true,
}, },
} }
}, },
...@@ -155,7 +142,8 @@ ...@@ -155,7 +142,8 @@
SpecificationSort: list.goods_attr.sign_id, SpecificationSort: list.goods_attr.sign_id,
Number: list.num, Number: list.num,
GoodsId: list.id, GoodsId: list.id,
SpecificationList: list.specificationNameList SpecificationList: list.specificationNameList,
PresentCoffeeNum:this.item.GiveAwayNum
}; };
this.detailList.push(obj); this.detailList.push(obj);
}); });
...@@ -165,25 +153,10 @@ ...@@ -165,25 +153,10 @@
); );
}, },
setOrder() { setOrder() {
if (this.msg.name == '') {
uni.showToast({
title: '请输入联系人!',
duration: 2000,
icon: 'none'
});
return;
}
if (this.msg.mobile == '') {
uni.showToast({
title: '请输入联系电话!',
duration: 2000,
icon: 'none'
});
return;
}
let form = {} let form = {}
form.Consignee = this.msg.name; form.OrderEduType= 1;//1:咖啡间
form.Mobile = this.msg.mobile; form.Consignee = '';
form.Mobile ='';
form.Province = 0; form.Province = 0;
form.City = 0; form.City = 0;
form.VersionSource = 1; form.VersionSource = 1;
...@@ -286,7 +259,7 @@ ...@@ -286,7 +259,7 @@
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 4rpx; border-radius: 4rpx;
margin: 0 auto; margin: 0 auto;
padding: 0rpx 30rpx; padding: 40rpx 30rpx 0;
.row1 { .row1 {
display: flex; display: flex;
...@@ -437,16 +410,5 @@ ...@@ -437,16 +410,5 @@
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
}
.userinfo {
width: 684rpx;
margin: 0 auto;
padding: 20rpx 40rpx;
margin-bottom: 40rpx;
background: #fff;
border-radius: 20rpx;
display: block;
} }
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/bg.png" <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/bg.png"
mode="widthFix" style="width: 100vw;height: auto;" class="bg2"></image> mode="widthFix" style="width: 100vw;height: auto;" class="bg2"></image>
<view class="nav"> <view class="nav">
<u-icon name="arrow-left" size="40"></u-icon> <u-icon name="arrow-left" size="40" @click="back"></u-icon>
</view> </view>
<view class="welcomeText"> <view class="welcomeText">
你好,同学 你好,同学
...@@ -65,13 +65,11 @@ ...@@ -65,13 +65,11 @@
<view class="tipText"> <view class="tipText">
{{pageData.GiveAwayList[0].BuyNum}}{{pageData.GiveAwayList[0].GiveAwayNum}} {{pageData.GiveAwayList[0].BuyNum}}{{pageData.GiveAwayList[0].GiveAwayNum}}
</view> </view>
<view class="tipIcon"> <view class="tipIcon"></view>
</view>
</view> </view>
</view> </view>
<view class="logBtn"> <view class="logBtn">
<view class="logitem buy" @click="jump('/coffee/myOrder')"> <view class="logitem buy" @click="jump(`/coffee/myOrder?addr=${pageData.Address}`)">
购买记录 购买记录
</view> </view>
<view class="logitem spend" @click="jump('/coffee/mySpend')"> <view class="logitem spend" @click="jump('/coffee/mySpend')">
...@@ -81,63 +79,63 @@ ...@@ -81,63 +79,63 @@
<u-popup v-model="isShowQrcode" mode="center"> <u-popup v-model="isShowQrcode" mode="center">
<view style="margin: 60rpx;"> <view style="margin: 60rpx;">
<Qrcode ref="qrcode" :modal="modal_qr" :url="url" @hideQrcode="hideQrcode" :width="300" :height="300" <Qrcode ref="qrcode" :modal="modal_qr" :url="qrData" @hideQrcode="hideQrcode" :width="300" :height="300"
themeColor="#44766E" is_themeImg :h_w_img="80" :themeImg="headImg" /> themeColor="#44766E" is_themeImg :h_w_img="80" :themeImg="headImg" />
</view> </view>
</u-popup> </u-popup>
<u-popup v-model="isShowSuccess" :maskCloseAble="false" mode="center"> <ComfirmDig :show="isShowSuccess" @close="isShowSuccess=false"></ComfirmDig>
<view style="margin: 60rpx;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup3.png"
mode="widthFix" style="width:546rpx;height:auto;display: block;"></image>
<view class="viewBox">
<view class="cup">
1杯
</view>
<view class="successText">
核销成功
</view>
<view class="user">
小猪
</view>
</view>
<view class="closeIcon" @click="isShowSuccess=false">
<u-icon name="close" color="#fefefe" size="60"></u-icon>
</view>
</view>
</u-popup>
</view> </view>
</template> </template>
<script> <script>
import Qrcode from "./qrcode/ay-qrcode.vue" import Qrcode from "./qrcode/ay-qrcode.vue"
import ComfirmDig from "./confirmDialog.vue"
export default { export default {
components: { components: {
Qrcode Qrcode,
ComfirmDig,
}, },
data() { data() {
return { return {
statusNavBar: 0, statusNavBar: 0,
modal_qr: false, modal_qr: false,
url: 'http://baidu.com/s', // 要生成的二维码值 UserId: 0,
timestamp: 0,
qrData: '', // 要生成的二维码值
isShowQrcode: false, isShowQrcode: false,
headImg: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png", headImg: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png",
pageData: {}, pageData: {},
isShowSuccess: false, isShowSuccess: false,
timer:null
} }
}, },
onLoad() { onLoad() {
this.statusNavBar = uni.getSystemInfoSync().statusBarHeight this.statusNavBar = uni.getSystemInfoSync().statusBarHeight
if (uni.getStorageSync('mall_UserInfo').Photo) { let userInfo = uni.getStorageSync('mall_UserInfo')
this.headImg = uni.getStorageSync('mall_UserInfo').Photo if (userInfo.Photo) {
this.headImg = userInfo.Photo
} }
this.showQrcode(); //一加载生成二维码 this.UserId = userInfo.UserId
this.getData() this.getData()
}, },
methods: { methods: {
showPopup() { async showPopup() {
this.isShowSuccess = true this.timestamp = new Date().getTime()
this.qrData = encodeURIComponent(JSON.stringify({
UserId: this.UserId,
timestamp: this.timestamp
}))
console.log(this.qrData)
await this.showQrcode() //生成二维码
this.isShowQrcode = true
setTimeout(() => {
this.getVerificat()
}, 2000)
},
back() {
uni.navigateBack()
}, },
// 展示二维码 // 展示二维码
showQrcode() { showQrcode() {
...@@ -167,6 +165,26 @@ ...@@ -167,6 +165,26 @@
} }
); );
}, },
getVerificat() {
this.request2({
url: '/api/AppletCoffee/GetMyCoffeeVerificatInfo',
data: {
Code: new Date().getTime()
}
},
res => {
console.log(res)
if (res.data.State === 1) {
this.isShowSuccess = false
clearTimeout(this.timer)
} else if (res.data.State === 2) {
this.timer = setTimeout(() => {
// this.getVerificat()
}, 2000)
}
}
);
},
} }
} }
</script> </script>
...@@ -360,38 +378,4 @@ ...@@ -360,38 +378,4 @@
margin-right: 130rpx; margin-right: 130rpx;
} }
} }
.viewBox {
width: 546rpx;
height: 286rpx;
background-color: #FFFFFF;
border-radius: 0rpx 0rpx 24rpx 24rpx;
padding-top: 40rpx;
.cup{
font-size: 40rpx;
font-weight: 800;
color: #3E766E;
text-align: center;
margin-bottom: 6rpx;
}
.successText{
font-size: 32rpx;
color: #111111;
font-weight: 700;
text-align: center;
margin-bottom: 40rpx;
}
.user{
font-size: 28rpx;
font-weight: 500;
color: #888888;
text-align: center;
}
}
.closeIcon{
margin: 35rpx auto 0;
display: flex;
justify-content: center;
}
</style> </style>
<template> <template>
<view class="myOrder"> <view class="myOrder">
<view v-for="(item,index) in list2" :key="index" class="item" @click="goDetail(0)"> <u-empty text="暂无订单" font-size="26" mode="order" v-if="list.length===0"></u-empty>
<view class="top"> <view v-if="list.length>0">
<view class="orderNo"> <view v-for="(item,index) in list" :key="index" class="item" @click="goDetail(item.OrderId)">
{{item.OrderNo}} <view class="top">
</view> <view class="orderNo">
<view class="orderStatus"> 阳光新业店
{{item.OrderStatus}}
</view>
</view>
<view class="itemInfoBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup2.png" mode="heightFix" style="width: auto;height: 130rpx;"></image>
<view class="itemInfo">
<view class="itemName">
星巴克咖啡10杯
</view> </view>
<view class="CreateDate"> <view class="orderStatus">
{{item.CreateDate}} <text v-if="item.OrderStatus===1">待付款</text>
<text v-if="item.OrderStatus===5">已完成</text>
</view> </view>
</view> </view>
<view class="price"> <view class="itemInfoBox" v-for="(_item,_index) in item.DetailList" :key="_index">
<text class="icon">¥ </text> {{item.PreferPrice}} <image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup4.png"
mode="heightFix" style="width: auto;height: 130rpx;"></image>
<view class="itemInfo">
<view class="itemName">
{{_item.GoodsName}}{{_item.Number}}
</view>
<view class="CreateDate">
{{item.CreateDate}}
</view>
</view>
<view class="price">
<text class="icon">¥ </text> {{_item.Final_Price}}
</view>
</view> </view>
</view> </view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" bg-color="#f5f5f5" />
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import util from '@/plugin/utils.js'
export default { export default {
data() { data() {
return { return {
list2: [{
OrderNo:'000',
PreferPrice:200,
OrderStatus:"已完成",
CreateDate:"2020-03-01"
},{
OrderNo:'000',
PreferPrice:200,
OrderStatus:"已完成",
CreateDate:"2020-03-01"
},{
OrderNo:'000',
PreferPrice:200,
OrderStatus:"已完成",
CreateDate:"2020-03-01"
}],
list: [], list: [],
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:10, pageSize: 10,
OrderStatus:0, OrderStatus: 0,
OrderNo:"", OrderNo: "",
},
pageCount: 0,
addr: "",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
}, },
pageCount:0, status: "loadmore",
} }
}, },
methods:{ methods: {
getData() { getData() {
uni.showLoading({
title: '加载中'
});
this.request2({ this.request2({
url: '/api/AppletCoffee/GetMyCofeeOrderPageList', url: '/api/AppletCoffee/GetMyCofeeOrderPageList',
data: this.msg data: this.msg
}, },
res => { res => {
this.pageCount=res.pageCount uni.hideLoading()
if(this.msg.pageIndex===1){ this.pageCount = res.data.pageCount
if (this.msg.pageIndex === 1) {
this.list = res.data.pageData this.list = res.data.pageData
}else{ } else {
this.list=this.list.concat(res.data.pageData) this.list = this.list.concat(res.data.pageData)
} }
if (this.pageCount == 1) {
this.status = "nomore";
}
},
err => {
uni.hideLoading()
} }
); );
}, },
goDetail(id){ goDetail(id) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/coffee/orderDetail?id='+id url: '/pages/coffee/orderDetail?id=' + id + '&addr=' + this.addr
})
},
},
onReachBottom() {
if (this.msg.pageIndex < this.pageCount) {
util.debounce(async () => {
this.msg.pageIndex++
await this.getData()
}) })
this.status = "loading";
} else {
this.status = "nomore";
} }
}, },
onLoad() { onLoad(options) {
this.addr = options.addr
this.getData() this.getData()
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "我的订单" title: "我的订单"
...@@ -93,64 +113,75 @@ ...@@ -93,64 +113,75 @@
.myOrder { .myOrder {
min-height: 100vh; min-height: 100vh;
background-color: #F5F5F5; background-color: #F5F5F5;
padding-top: 35rpx; padding: 35rpx 0;
} }
.item{
.item {
width: 684rpx; width: 684rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 4rpx; border-radius: 4rpx;
margin: 0 auto; margin: 0 auto;
padding: 0rpx 40rpx; padding: 0rpx 40rpx;
margin-bottom: 35rpx; margin-bottom: 35rpx;
.top{
.top {
height: 84rpx; height: 84rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
.orderNo{
.orderNo {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
} }
.orderStatus{
.orderStatus {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
} }
.itemInfoBox{
.itemInfoBox {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
padding-bottom: 30rpx; padding-bottom: 30rpx;
.itemInfo{ padding-top: 30rpx;
.itemInfo {
flex-grow: 1; flex-grow: 1;
padding:0 20rpx; padding: 0 46rpx;
.itemName{
.itemName {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
margin-top: 20rpx ; margin-top: 10rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
} }
.CreateDate{
.CreateDate {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
} }
.price{
.price {
font-size: 48rpx; font-size: 48rpx;
font-weight: bold; font-weight: bold;
color: #F65C10; color: #F65C10;
.icon{
.icon {
font-size: 28rpx; font-size: 28rpx;
font-weight:400; font-weight: 400;
margin-right: 4rpx; margin-right: 4rpx;
} }
} }
} }
} }
</style> </style>
<template> <template>
<view class="myOrder"> <view class="myOrder">
<view v-for="(item,index) in list2" :key="index" class="item"> <u-empty text="暂无消费记录" font-size="26" mode="order" v-if="list.length===0"></u-empty>
<view class="top"> <view v-if="list.length>0">
<view class="name"> <view v-for="(item,index) in list" :key="index" class="item">
{{item.name}} <view class="top">
<view class="name">
星巴克咖啡
</view>
<view class="Number">
-{{item.Number}}
</view>
</view> </view>
<view class="Number"> <view class="top">
-{{item.Number}} <view class="CreateDate">
{{item.CreateDate}}
</view>
<view class="Remark">
{{item.Remark}}
</view>
</view> </view>
</view> </view>
<view class="top"> <u-loadmore :status="status" :load-text="loadText" :font-size="24" bg-color="#f5f5f5" />
<view class="CreateDate">
{{item.CreateDate}}
</view>
<view class="Remark">
{{item.Remark}}
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import util from '@/plugin/utils.js'
export default { export default {
data() { data() {
return { return {
list2: [{
name:'星巴克咖啡',
Number:1,
Type:"已完成",
CreateDate:"2020-03-01",
Remark:"余12杯"
},{
name:'星巴克咖啡',
Number:1,
Type:"已完成",
CreateDate:"2020-03-01",
Remark:"余12杯"
},{
name:'星巴克咖啡',
Number:1,
Type:"已完成",
CreateDate:"2020-03-01",
Remark:"余12杯"
}],
list: [], list: [],
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:10, pageSize: 10,
Type:0, Type: 0,
},
pageCount: 0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
}, },
pageCount:0, status: "loadmore",
} }
}, },
methods:{ methods: {
getData() { getData() {
uni.showLoading({
title: '加载中'
});
this.request2({ this.request2({
url: '/api/AppletCoffee/GetMyCoffeeCouponsPageList', url: '/api/AppletCoffee/GetMyCoffeeCouponsPageList',
data: this.msg data: this.msg
}, },
res => { res => {
this.pageCount=res.pageCount uni.hideLoading()
if(this.msg.pageIndex===1){ this.pageCount = res.data.pageCount
if (this.msg.pageIndex === 1) {
this.list = res.data.pageData this.list = res.data.pageData
}else{ } else {
this.list=this.list.concat(res.data.pageData) this.list = this.list.concat(res.data.pageData)
} }
if (this.pageCount == 1) {
this.status = "nomore";
}
},
err => {
uni.hideLoading()
} }
); );
}, },
}, },
onReachBottom() {
if (this.msg.pageIndex < this.pageCount) {
util.debounce(async () => {
this.msg.pageIndex++
await this.getData()
})
this.status = "loading";
} else {
this.status = "nomore";
}
},
onLoad() { onLoad() {
this.getData() this.getData()
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -84,34 +96,40 @@ ...@@ -84,34 +96,40 @@
.myOrder { .myOrder {
min-height: 100vh; min-height: 100vh;
background-color: #F5F5F5; background-color: #F5F5F5;
padding-top: 35rpx; padding: 35rpx 0;
} }
.item{
.item {
width: 684rpx; width: 684rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 4rpx; border-radius: 4rpx;
margin: 0 auto; margin: 0 auto;
padding: 16rpx 40rpx; padding: 16rpx 40rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
.top{
.top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: 10rpx 0; margin: 10rpx 0;
.name{
.name {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
} }
.orderStatus{
.orderStatus {
font-size: 30rpx; font-size: 30rpx;
color: #000000; color: #000000;
} }
.CreateDate{
.CreateDate {
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
} }
.Remark{
.Remark {
font-size: 20rpx; font-size: 20rpx;
color: #CFCFCF; color: #CFCFCF;
} }
......
...@@ -13,21 +13,21 @@ ...@@ -13,21 +13,21 @@
<text class="store">阳光新业店</text> <text class="store">阳光新业店</text>
<text class="type">到店消费</text> <text class="type">到店消费</text>
</view> </view>
<view class="addrText">{{item.addr}}</view> <view class="addrText">{{addr}}</view>
</view> </view>
<view class="orderDetail"> <view class="orderDetail">
<view class="row1"> <view class="row1">
<view class="row1Sub"> <view class="row1Sub">
<image <image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup2.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup4.png"
mode="" style="width: 150rpx;height: 150rpx;"></image> mode="" style="width: 150rpx;height: 150rpx;"></image>
<view class="coffeeInfo"> <view class="coffeeInfo">
<view class="num"> <view class="num">
星巴克咖啡{{item.BuyNum||0}} 星巴克咖啡{{detailData.DetailList[0].Number||0}}
</view> </view>
<view class="give"> <view class="give">
{{item.BuyNum||0}}杯赠送{{item.GiveAwayNum||0}} {{detailData.DetailList[0].Number||0}}杯赠送{{detailData.DetailList[0].PresentCoffeeNum||0}}
</view> </view>
<view class="tip"> <view class="tip">
(赠送咖啡可随意选择) (赠送咖啡可随意选择)
...@@ -35,16 +35,16 @@ ...@@ -35,16 +35,16 @@
</view> </view>
</view> </view>
<view class="price"> <view class="price">
<text class="icon">¥</text>{{detailData.total_price}} <text class="icon">¥</text>{{detailData.DetailList[0].Final_Price||0}}
</view> </view>
</view> </view>
<view class="row2"> <view class="row2">
<view class="label">购买数量</view> <view class="label">购买数量</view>
<view class="value">{{item.BuyNum||0}}</view> <view class="value">{{detailData.DetailList[0].Number||0}}</view>
</view> </view>
<view class="row2"> <view class="row2">
<view class="label">赠送数量</view> <view class="label">赠送数量</view>
<view class="value">{{item.GiveAwayNum||0}}</view> <view class="value">{{detailData.DetailList[0].PresentCoffeeNum||0}}</view>
</view> </view>
<view class="row2"> <view class="row2">
<view class="label">使用期限</view> <view class="label">使用期限</view>
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
</view> </view>
<view class="row3"> <view class="row3">
<text class="name">应付</text> <text class="name">应付</text>
<text class="totalPrice"> ¥{{detailData.total_price}}</text> <text class="totalPrice"> ¥{{detailData.PreferPrice||0}}</text>
</view> </view>
<view class="row4"> <view class="row4">
下单时间:2022-02-28 15:49 下单时间:{{detailData.CreateDate}}
</view> </view>
</view> </view>
</view> </view>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
export default { export default {
data() { data() {
return { return {
item: {}, addr: '',
detailData: {}, detailData: {},
msg:{ msg:{
OrderId:0 OrderId:0
...@@ -73,19 +73,22 @@ ...@@ -73,19 +73,22 @@
} }
}, },
onLoad(options) { onLoad(options) {
this.addr=options.addr
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "订单详情" title: "订单详情"
}) })
this.msg.OrderId=options.id
this.getInfo()
}, },
methods: { methods: {
getInfo() { getInfo() {
this.request2({ this.request2({
url: '/api/AppletOrder/GetMyCoffeeOrderInfo', url: '/api/AppletCoffee/GetMyCoffeeOrderInfo',
data: this.msg data: this.msg
}, },
res => { res => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.detailData=res.data
} }
} }
); );
...@@ -155,7 +158,7 @@ ...@@ -155,7 +158,7 @@
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 4rpx; border-radius: 4rpx;
margin: 0 auto; margin: 0 auto;
padding: 0rpx 30rpx; padding: 40rpx 30rpx 0;
.row1 { .row1 {
display: flex; display: flex;
......
...@@ -84,10 +84,14 @@ ...@@ -84,10 +84,14 @@
uni.reLaunch({ uni.reLaunch({
url: '/pages/school/personal/orderList?status=2' url: '/pages/school/personal/orderList?status=2'
}); });
}else if(this.payInfo.type == 2){//根据甲鹤的跳转 }else if(this.payInfo.type == 2&&!this.payInfo.isCoffee){//根据甲鹤的跳转
uni.reLaunch({ uni.reLaunch({
url: "/pages/order/index/index?status=0", url: "/pages/order/index/index?status=0",
}); });
}else if(this.payInfo.type ==2 &&this.payInfo.isCoffee){//根据甲鹤咖啡的跳转
uni.reLaunch({
url: "/pages/coffee/myOrder",
});
} }
} else { } else {
uni.reLaunch({ uni.reLaunch({
......
<template>
<view>
<u-popup v-model="showDig" :maskCloseAble="false" mode="center" @close="closePopup">
<view style="margin: 60rpx;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup3.png"
mode="widthFix" style="width:546rpx;height:auto;display: block;"></image>
<view class="viewBox">
<view class="cup">
1杯
</view>
<view class="successText">
核销成功
</view>
<view class="user">
小猪
</view>
</view>
<view class="closeIcon" @click="closePopup">
<u-icon name="close" color="#fefefe" size="60"></u-icon>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
// model: {
// prop: 'show',
// event: "change"
// },
props: {
show:{
type:Boolean,
default: false,
} ,
dataObj:{
type:Object,
default:()=>{
return {}
}
}
},
watch:{
show(val){
console.log(this.dataObj)
this.showDig=val
}
},
data() {
return {
showDig:false
}
},
methods: {
closePopup() {
this.$emit("close");
}
},
}
</script>
<style lang="scss" scoped>
.viewBox {
width: 546rpx;
height: 286rpx;
background-color: #FFFFFF;
border-radius: 0rpx 0rpx 24rpx 24rpx;
padding-top: 40rpx;
.cup{
font-size: 40rpx;
font-weight: 800;
color: #3E766E;
text-align: center;
margin-bottom: 6rpx;
}
.successText{
font-size: 32rpx;
color: #111111;
font-weight: 700;
text-align: center;
margin-bottom: 40rpx;
}
.user{
font-size: 28rpx;
font-weight: 500;
color: #888888;
text-align: center;
}
}
.closeIcon{
margin: 35rpx auto 0;
display: flex;
justify-content: center;
}
</style>
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
meueData.user_center.is_account_status != 1, meueData.user_center.is_account_status != 1,
}" }"
> >
<!-- 咖啡扫码 -->
<view style="position: absolute;top:250rpx;right:50rpx" v-if="user_info.IsCoffee_Verification" @click="scanCodeByCoffee">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/ScanCode.png"
mode="widthFix" style="width: 40rpx;height: auto;"></image>
<coffeeConfirmDialog :show="showCoffeeVerification" @close="showCoffeeVerification=false" :dataObj="coffeeVerificationData"></coffeeConfirmDialog>
</view>
<view class="titlenav" :style="{ paddingTop: nav }">{{ <view class="titlenav" :style="{ paddingTop: nav }">{{
pageTitle pageTitle
}}</view> }}</view>
...@@ -696,15 +702,18 @@ ...@@ -696,15 +702,18 @@
@changeuserinfo="reloadUserinfo" @changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth" @gbAuth="gbAuth"
></auth> ></auth>
<tabbars></tabbars> <tabbars></tabbars>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
import tabbars from '@/components/tabbar/index'; import tabbars from '@/components/tabbar/index';
import auth from '../../components/auth/index.vue'; import auth from '../../components/auth/index.vue';
import blinddate from './components/blinddate-user.vue' import blinddate from './components/blinddate-user.vue';
import coffeeConfirmDialog from "./components/coffeeConfirmDialog.vue";//咖啡核验成功
export default { export default {
data() { data() {
return { return {
...@@ -741,12 +750,15 @@ ...@@ -741,12 +750,15 @@
AppletID:0,//小程序id 5-8日 判断是否是甲鹤 AppletID:0,//小程序id 5-8日 判断是否是甲鹤
isAttestationEdu:0,//学员是否认证了 0否1是 isAttestationEdu:0,//学员是否认证了 0否1是
isMallAdmin:0,//是否是饭粒汪商城管理员 0否1是 isMallAdmin:0,//是否是饭粒汪商城管理员 0否1是
showCoffeeVerification:true,//是否显示咖啡核验成功弹窗
coffeeVerificationData:{},//咖啡核验成功弹窗参数
}; };
}, },
components: { components: {
tabbars, tabbars,
auth, auth,
blinddate blinddate,
coffeeConfirmDialog
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
...@@ -1047,6 +1059,50 @@ ...@@ -1047,6 +1059,50 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/kotra/identification?editType=1' url: '/pages/kotra/identification?editType=1'
}) })
},
scanCodeByCoffee(){
let that=this
uni.scanCode({
scanType: ['qrCode'],
success: function (res) {
let qrdata=JSON.parse(decodeURIComponent(res.result))
console.log('条码类型:', qrdata);
that.setAdminVerificationCoffee(qrdata.UserId)
},
fail:err=>{
uni.showToast({
title:'扫码失败',
icon:'none',
duration:2000
})
}
});
},
//核验咖啡券
setAdminVerificationCoffee(id){
this.request2({
url: '/api/AppletCoffee/SetAdminVerificationCoffee',
data: {
UserId:id
}
},
res => {
if (res.resultCode == 1) {
console.log(res)
if(res.State==1){
this.coffeeVerificationData=res.data
this.showCoffeeVerification=true
}else{
uni.showToast({
title:res.data.Msg,
icon:'none',
duration:2000
})
}
}
}
);
} }
} }
}; };
......
...@@ -52,10 +52,17 @@ function AddDay(date, day) { ...@@ -52,10 +52,17 @@ function AddDay(date, day) {
let currentdate = year + seperator1 + month + seperator1 + strDate; let currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate; return currentdate;
} }
let timer=null
function debounce(cb, delay=500) {
if(timer) clearTimeout(timer)
timer=setTimeout(()=>{
cb()
},delay)
}
export default { export default {
calcContentHeight, calcContentHeight,
SystemInfo, SystemInfo,
getRect, getRect,
AddDay AddDay,
debounce,
} }
\ No newline at end of file
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