Commit b17efaae authored by 罗超's avatar 罗超

新增咖啡

parent 19f253de
<template>
<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"
mode="widthFix" class="bg"></image>
<u-sticky :offset-top="statusNavBar">
<view class="nav">
<u-sticky >
<view class="nav" :style="{paddingTop:`${statusNavBar}px`}">
<u-icon name="arrow-left" size="40" color="#fff" @click="back"></u-icon>
<view class="title">
购买
......@@ -150,6 +150,8 @@
padding: 0 30rpx;
display: flex;
align-items: center;
background-color: #3E766E;
box-sizing: content-box;
.title {
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 @@
<text class="store">阳光新业店</text>
<text class="type">到店消费</text>
</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 class="addrText">{{item.addr||""}}</view>
</view>
<view class="orderDetail">
<view class="row1">
<view class="row1Sub">
<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>
<view class="coffeeInfo">
<view class="num">
......@@ -53,7 +43,7 @@
</view>
<view class="row3">
<text class="name">应付</text>
<text class="totalPrice"> ¥{{detailData.total_price}}</text>
<text class="totalPrice"> ¥{{detailData.total_price||0}}</text>
</view>
</view>
<view class="payRow">
......@@ -69,7 +59,7 @@
<view class="payRow2">
<view class="name">
需支付
<text class="payMomey">¥{{detailData.total_price}}</text>
<text class="payMomey">¥{{detailData.total_price||0}}</text>
</view>
<view class="payBtn" @click="setOrder">
去支付
......@@ -77,7 +67,7 @@
</view>
<payCom v-if="payBtn" :payInfo="payInfo" @closePay="closePay"></payCom>
<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="text-align:center;padding-bottom:40rpx">
<view style="margin:80rpx 0">支付取消</view>
......@@ -100,10 +90,6 @@
payBtn: false,
payExit: false,
item: {},
msg: {
name: "",
mobile: ""
},
formdata: {
AddressId: 0,
DeliveryMethod: 0,
......@@ -120,7 +106,8 @@
OrderPayType: 1,
GoodsName: '',
type: 2, //是甲鹤付款
total_price: 0
total_price: 0,
isCoffee:true,
},
}
},
......@@ -155,7 +142,8 @@
SpecificationSort: list.goods_attr.sign_id,
Number: list.num,
GoodsId: list.id,
SpecificationList: list.specificationNameList
SpecificationList: list.specificationNameList,
PresentCoffeeNum:this.item.GiveAwayNum
};
this.detailList.push(obj);
});
......@@ -165,25 +153,10 @@
);
},
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 = {}
form.Consignee = this.msg.name;
form.Mobile = this.msg.mobile;
form.OrderEduType= 1;//1:咖啡间
form.Consignee = '';
form.Mobile ='';
form.Province = 0;
form.City = 0;
form.VersionSource = 1;
......@@ -286,7 +259,7 @@
background-color: #FFFFFF;
border-radius: 4rpx;
margin: 0 auto;
padding: 0rpx 30rpx;
padding: 40rpx 30rpx 0;
.row1 {
display: flex;
......@@ -437,16 +410,5 @@
font-weight: 500;
color: #FFFFFF;
}
}
.userinfo {
width: 684rpx;
margin: 0 auto;
padding: 20rpx 40rpx;
margin-bottom: 40rpx;
background: #fff;
border-radius: 20rpx;
display: block;
}
</style>
......@@ -5,7 +5,7 @@
<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>
<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 class="welcomeText">
你好,同学
......@@ -65,13 +65,11 @@
<view class="tipText">
{{pageData.GiveAwayList[0].BuyNum}}{{pageData.GiveAwayList[0].GiveAwayNum}}
</view>
<view class="tipIcon">
</view>
<view class="tipIcon"></view>
</view>
</view>
<view class="logBtn">
<view class="logitem buy" @click="jump('/coffee/myOrder')">
<view class="logitem buy" @click="jump(`/coffee/myOrder?addr=${pageData.Address}`)">
购买记录
</view>
<view class="logitem spend" @click="jump('/coffee/mySpend')">
......@@ -81,63 +79,63 @@
<u-popup v-model="isShowQrcode" mode="center">
<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" />
</view>
</u-popup>
<u-popup v-model="isShowSuccess" :maskCloseAble="false" mode="center">
<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>
<ComfirmDig :show="isShowSuccess" @close="isShowSuccess=false"></ComfirmDig>
</view>
</template>
<script>
import Qrcode from "./qrcode/ay-qrcode.vue"
import ComfirmDig from "./confirmDialog.vue"
export default {
components: {
Qrcode
Qrcode,
ComfirmDig,
},
data() {
return {
statusNavBar: 0,
modal_qr: false,
url: 'http://baidu.com/s', // 要生成的二维码值
UserId: 0,
timestamp: 0,
qrData: '', // 要生成的二维码值
isShowQrcode: false,
headImg: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee/cup.png",
pageData: {},
isShowSuccess: false,
timer:null
}
},
onLoad() {
this.statusNavBar = uni.getSystemInfoSync().statusBarHeight
if (uni.getStorageSync('mall_UserInfo').Photo) {
this.headImg = uni.getStorageSync('mall_UserInfo').Photo
let userInfo = uni.getStorageSync('mall_UserInfo')
if (userInfo.Photo) {
this.headImg = userInfo.Photo
}
this.showQrcode(); //一加载生成二维码
this.UserId = userInfo.UserId
this.getData()
},
methods: {
showPopup() {
this.isShowSuccess = true
async showPopup() {
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() {
......@@ -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>
......@@ -360,38 +378,4 @@
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>
<template>
<view class="myOrder">
<view v-for="(item,index) in list2" :key="index" class="item" @click="goDetail(0)">
<view class="top">
<view class="orderNo">
{{item.OrderNo}}
</view>
<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杯
<u-empty text="暂无订单" font-size="26" mode="order" v-if="list.length===0"></u-empty>
<view v-if="list.length>0">
<view v-for="(item,index) in list" :key="index" class="item" @click="goDetail(item.OrderId)">
<view class="top">
<view class="orderNo">
阳光新业店
</view>
<view class="CreateDate">
{{item.CreateDate}}
<view class="orderStatus">
<text v-if="item.OrderStatus===1">待付款</text>
<text v-if="item.OrderStatus===5">已完成</text>
</view>
</view>
<view class="price">
<text class="icon">¥ </text> {{item.PreferPrice}}
<view class="itemInfoBox" v-for="(_item,_index) in item.DetailList" :key="_index">
<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>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" bg-color="#f5f5f5" />
</view>
</view>
</template>
<script>
import util from '@/plugin/utils.js'
export default {
data() {
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: [],
msg:{
pageIndex:1,
pageSize:10,
OrderStatus:0,
OrderNo:"",
msg: {
pageIndex: 1,
pageSize: 10,
OrderStatus: 0,
OrderNo: "",
},
pageCount: 0,
addr: "",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
pageCount:0,
status: "loadmore",
}
},
methods:{
methods: {
getData() {
uni.showLoading({
title: '加载中'
});
this.request2({
url: '/api/AppletCoffee/GetMyCofeeOrderPageList',
data: this.msg
},
res => {
this.pageCount=res.pageCount
if(this.msg.pageIndex===1){
uni.hideLoading()
this.pageCount = res.data.pageCount
if (this.msg.pageIndex === 1) {
this.list = res.data.pageData
}else{
this.list=this.list.concat(res.data.pageData)
} else {
this.list = this.list.concat(res.data.pageData)
}
if (this.pageCount == 1) {
this.status = "nomore";
}
},
err => {
uni.hideLoading()
}
);
},
goDetail(id){
goDetail(id) {
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()
uni.setNavigationBarTitle({
title: "我的订单"
......@@ -93,64 +113,75 @@
.myOrder {
min-height: 100vh;
background-color: #F5F5F5;
padding-top: 35rpx;
padding: 35rpx 0;
}
.item{
.item {
width: 684rpx;
background-color: #FFFFFF;
border-radius: 4rpx;
margin: 0 auto;
padding: 0rpx 40rpx;
margin-bottom: 35rpx;
.top{
.top {
height: 84rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #e8e8e8;
.orderNo{
.orderNo {
font-size: 28rpx;
font-weight: 500;
color: #000000;
}
.orderStatus{
.orderStatus {
font-size: 24rpx;
font-weight: 400;
color: #666666;
}
}
.itemInfoBox{
.itemInfoBox {
display: flex;
flex-wrap: nowrap;
align-items: center;
padding-bottom: 30rpx;
.itemInfo{
padding-top: 30rpx;
.itemInfo {
flex-grow: 1;
padding:0 20rpx;
.itemName{
padding: 0 46rpx;
.itemName {
font-size: 28rpx;
font-weight: bold;
color: #000000;
margin-top: 20rpx ;
margin-top: 10rpx;
margin-bottom: 15rpx;
}
.CreateDate{
.CreateDate {
font-size: 24rpx;
font-weight: 400;
color: #666666;
}
}
.price{
.price {
font-size: 48rpx;
font-weight: bold;
color: #F65C10;
.icon{
.icon {
font-size: 28rpx;
font-weight:400;
font-weight: 400;
margin-right: 4rpx;
}
}
}
}
</style>
<template>
<view class="myOrder">
<view v-for="(item,index) in list2" :key="index" class="item">
<view class="top">
<view class="name">
{{item.name}}
<u-empty text="暂无消费记录" font-size="26" mode="order" v-if="list.length===0"></u-empty>
<view v-if="list.length>0">
<view v-for="(item,index) in list" :key="index" class="item">
<view class="top">
<view class="name">
星巴克咖啡
</view>
<view class="Number">
-{{item.Number}}
</view>
</view>
<view class="Number">
-{{item.Number}}
<view class="top">
<view class="CreateDate">
{{item.CreateDate}}
</view>
<view class="Remark">
{{item.Remark}}
</view>
</view>
</view>
<view class="top">
<view class="CreateDate">
{{item.CreateDate}}
</view>
<view class="Remark">
{{item.Remark}}
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" bg-color="#f5f5f5" />
</view>
</view>
</template>
<script>
import util from '@/plugin/utils.js'
export default {
data() {
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: [],
msg:{
pageIndex:1,
pageSize:10,
Type:0,
msg: {
pageIndex: 1,
pageSize: 10,
Type: 0,
},
pageCount: 0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
pageCount:0,
status: "loadmore",
}
},
methods:{
methods: {
getData() {
uni.showLoading({
title: '加载中'
});
this.request2({
url: '/api/AppletCoffee/GetMyCoffeeCouponsPageList',
data: this.msg
},
res => {
this.pageCount=res.pageCount
if(this.msg.pageIndex===1){
uni.hideLoading()
this.pageCount = res.data.pageCount
if (this.msg.pageIndex === 1) {
this.list = res.data.pageData
}else{
this.list=this.list.concat(res.data.pageData)
} else {
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() {
this.getData()
uni.setNavigationBarTitle({
......@@ -84,34 +96,40 @@
.myOrder {
min-height: 100vh;
background-color: #F5F5F5;
padding-top: 35rpx;
padding: 35rpx 0;
}
.item{
.item {
width: 684rpx;
background-color: #FFFFFF;
border-radius: 4rpx;
margin: 0 auto;
padding: 16rpx 40rpx;
margin-bottom: 24rpx;
.top{
.top {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10rpx 0;
.name{
.name {
font-size: 28rpx;
font-weight: 500;
color: #000000;
}
.orderStatus{
.orderStatus {
font-size: 30rpx;
color: #000000;
}
.CreateDate{
.CreateDate {
font-size: 24rpx;
color: #666666;
}
.Remark{
.Remark {
font-size: 20rpx;
color: #CFCFCF;
}
......
......@@ -13,21 +13,21 @@
<text class="store">阳光新业店</text>
<text class="type">到店消费</text>
</view>
<view class="addrText">{{item.addr}}</view>
<view class="addrText">{{addr}}</view>
</view>
<view class="orderDetail">
<view class="row1">
<view class="row1Sub">
<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>
<view class="coffeeInfo">
<view class="num">
星巴克咖啡{{item.BuyNum||0}}
星巴克咖啡{{detailData.DetailList[0].Number||0}}
</view>
<view class="give">
{{item.BuyNum||0}}杯赠送{{item.GiveAwayNum||0}}
{{detailData.DetailList[0].Number||0}}杯赠送{{detailData.DetailList[0].PresentCoffeeNum||0}}
</view>
<view class="tip">
(赠送咖啡可随意选择)
......@@ -35,16 +35,16 @@
</view>
</view>
<view class="price">
<text class="icon">¥</text>{{detailData.total_price}}
<text class="icon">¥</text>{{detailData.DetailList[0].Final_Price||0}}
</view>
</view>
<view class="row2">
<view class="label">购买数量</view>
<view class="value">{{item.BuyNum||0}}</view>
<view class="value">{{detailData.DetailList[0].Number||0}}</view>
</view>
<view class="row2">
<view class="label">赠送数量</view>
<view class="value">{{item.GiveAwayNum||0}}</view>
<view class="value">{{detailData.DetailList[0].PresentCoffeeNum||0}}</view>
</view>
<view class="row2">
<view class="label">使用期限</view>
......@@ -52,10 +52,10 @@
</view>
<view class="row3">
<text class="name">应付</text>
<text class="totalPrice"> ¥{{detailData.total_price}}</text>
<text class="totalPrice"> ¥{{detailData.PreferPrice||0}}</text>
</view>
<view class="row4">
下单时间:2022-02-28 15:49
下单时间:{{detailData.CreateDate}}
</view>
</view>
</view>
......@@ -65,7 +65,7 @@
export default {
data() {
return {
item: {},
addr: '',
detailData: {},
msg:{
OrderId:0
......@@ -73,19 +73,22 @@
}
},
onLoad(options) {
this.addr=options.addr
uni.setNavigationBarTitle({
title: "订单详情"
})
this.msg.OrderId=options.id
this.getInfo()
},
methods: {
getInfo() {
this.request2({
url: '/api/AppletOrder/GetMyCoffeeOrderInfo',
url: '/api/AppletCoffee/GetMyCoffeeOrderInfo',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.detailData=res.data
}
}
);
......@@ -155,7 +158,7 @@
background-color: #FFFFFF;
border-radius: 4rpx;
margin: 0 auto;
padding: 0rpx 30rpx;
padding: 40rpx 30rpx 0;
.row1 {
display: flex;
......
......@@ -84,10 +84,14 @@
uni.reLaunch({
url: '/pages/school/personal/orderList?status=2'
});
}else if(this.payInfo.type == 2){//根据甲鹤的跳转
}else if(this.payInfo.type == 2&&!this.payInfo.isCoffee){//根据甲鹤的跳转
uni.reLaunch({
url: "/pages/order/index/index?status=0",
});
}else if(this.payInfo.type ==2 &&this.payInfo.isCoffee){//根据甲鹤咖啡的跳转
uni.reLaunch({
url: "/pages/coffee/myOrder",
});
}
} else {
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 @@
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 }">{{
pageTitle
}}</view>
......@@ -696,15 +702,18 @@
@changeuserinfo="reloadUserinfo"
@gbAuth="gbAuth"
></auth>
<tabbars></tabbars>
</view>
</scroll-view>
</template>
<script>
import tabbars from '@/components/tabbar/index';
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 {
data() {
return {
......@@ -741,12 +750,15 @@
AppletID:0,//小程序id 5-8日 判断是否是甲鹤
isAttestationEdu:0,//学员是否认证了 0否1是
isMallAdmin:0,//是否是饭粒汪商城管理员 0否1是
showCoffeeVerification:true,//是否显示咖啡核验成功弹窗
coffeeVerificationData:{},//咖啡核验成功弹窗参数
};
},
components: {
tabbars,
auth,
blinddate
blinddate,
coffeeConfirmDialog
},
created() {
this.mainColor = this.$uiConfig.mainColor;
......@@ -1047,6 +1059,50 @@
uni.navigateTo({
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) {
let currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
let timer=null
function debounce(cb, delay=500) {
if(timer) clearTimeout(timer)
timer=setTimeout(()=>{
cb()
},delay)
}
export default {
calcContentHeight,
SystemInfo,
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