Commit c7ca8382 by zhangzhen

功能完善

parent 4df2577e
......@@ -11,4 +11,10 @@ export const getUseCoupon=(data)=>{
return http.post(url,data)
}
export const couponChecked=(code)=>{
let url=`/chessCards/consumeByUser?code=`+code
return http.get(url)
}
......@@ -69,7 +69,8 @@ http.interceptor.response = (config) => {
/\/order\/creat/g,
/\/order\/list/g,
/\/consumerCoupon\/list/g,
/\/consumerCoupon\/query/g
/\/consumerCoupon\/query/g,
/\/chessCards\/consumeByUser/g
]
if (urls.some(item => item.test(config.config.url)) && config.data.code == 401) {
......
......@@ -30,7 +30,8 @@
},
{
name:"验券",
sortName:"验"
sortName:"验",
routePath:"/pages/couponCheck/couponCheck"
},
{
name:"客服",
......@@ -62,6 +63,11 @@
methods:{
onHandle(val){
console.log(val)
if(val.routePath){
uni.navigateTo({
url:val.routePath
})
}
}
}
}
......@@ -70,16 +76,16 @@
<style lang="scss" scoped>
.tool-box{
position: fixed;
bottom: 160upx;
bottom: 5vh;
right: 0;
z-index: 99;
.tool-item{
display: flex;
justify-content: center;
align-items: center;
width: 120upx;
height: 60upx;
border-radius: 30upx 0 0 30upx;
width: 12vw;
height: 12vw;
border-radius: 50%;
background: #ff55ff;
border-top: 1px solid #ff00ff;
border-left: 1px solid #ff00ff;
......@@ -91,11 +97,12 @@
text{
white-space: nowrap;
font-style: italic;
letter-spacing: 10upx;
letter-spacing: 2upx;
}
}
.active{
width: 60upx;
width: 6vw;
height: 6vw;
opacity: 0.6;
}
}
......
......@@ -2,10 +2,10 @@ const CONFIG = {
// 开发环境配置
development: {
assetsPath: '/static', // 静态资源路径
baseUrl: 'http://10.106.30.135:8883/front', // 后台接口请求地址
hostUrl: 'http://10.106.30.135:8882', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.43.242:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.43.242:8882', // H5地址(前端运行地址)
// baseUrl: 'http://10.106.30.135:8883/front', // 后台接口请求地址
// hostUrl: 'http://10.106.30.135:8882', // H5地址(前端运行地址)
baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '' ,// 微信公众号appid
codeHeadUrl:"",
......
......@@ -111,6 +111,14 @@
"navigationStyle": "default"
}
},
{
"path" : "pages/couponCheck/couponCheck",
"style" :
{
"navigationBarTitleText" : "券码核销",
"enablePullDownRefresh" : false
}
}
],
......
<template>
<view class="flex-col coupon-checked">
<view class="icon-list">
<view class="img-box" v-for="(item,index) in list" :key="index">
<image :src="item.iconUrl" mode=""></image>
</view>
</view>
<view class="text-box margin-top">
<view v-for="(item,index) in list" :key="index" class="text-item">
<text>{{item.name}}</text>
<text v-if="index<list.length-1"></text>
</view>
<text>自助验券</text>
</view>
<view class="input-box">
<view class="cu-form-group">
<input class="input" placeholder="点击输入卡券兑换码" name="input" v-mode="code"></input>
<text class="cuIcon-qr_code text-gray text-xxl" @tap="onScanCode"></text>
</view>
</view>
<view class="confirm-box">
<button class="cu-btn round block bg-pink lg" @tap="onConfirm">兑换</button>
</view>
<view class="tips-box margin-top">
<view class="">
<text class="text-black text-bold text-xl">温馨提示</text>
</view>
<view class="flex-col margin-top">
<text>1.可将各平台的兑换码复制进输入框内,点击兑换,兑换成功后可进入我的优惠券内查看</text>
<text>2.可扫码各平台的兑换码,兑换成功后可进入我的优惠券内查看</text>
<text>3.核销验券之后的券会进入到我的优惠券当中,可去门店预约时自动抵扣使用,若显示无法使用团购券,请核验团购券的可用门店、可用时间段。团购券过期后自动作废,不退款不更换不延期,请尽快使用。</text>
</view>
</view>
<uni-popup ref="popup" type="center">
<view class="content-box">
<view class="content">
<view class="title-box">
<text class="text-black text-bold text-xl">提示</text>
<view class="close-box" @tap="onClose">
<text class="cuIcon-close text-gray text-bold text-xl"></text>
</view>
</view>
<view class="tip">
<view class="text-1">
<text class="text-bold text-lg text-black">核销成功</text>
</view>
<view class="flex-col">
<text >优惠券名称:</text>
</view>
<view class="flex-col">
<text >到期时间:</text>
</view>
</view>
</view>
<view class="margin-top">
<button class="cu-btn round block bg-pink lg" @tap="onNavHome">去使用</button>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {couponChecked} from "@/api/coupon.js"
import mtIcon from "@/static/mt_icon.png"
export default {
data() {
return {
code:"",
list:[
{
iconUrl:mtIcon,
name:"美团"
}
],
couponInfo:''
};
},
mounted() {
},
methods:{
onConfirm(){
if(!this.code){
uni.showToast({
icon:"none",
title:"请输入兑换码或扫码兑换"
})
return
}
uni.showLoading({
title:"券码核验中"
})
couponChecked(this.code).then(res=>{
console.log(res,909090)
if(res.data.code === 200){
this.couponInfo = res.data.data
this.$refs.popup.open()
}
})
},
onScanCode(){
uni.scanCode({
complete: (res) => {
console.log(res)
if(res.result){
this.code = res.result
this.onConfirm()
}
}
})
},
onNavHome(){
uni.switchTab({
url:"/pages/index/index"
})
},
onClose(){
this.$refs.popup.close()
}
}
}
</script>
<style lang="scss" scoped>
.coupon-checked{
display: flex;
flex-direction: column;
width: 100vw;
min-height: 100vh;
align-items: center;
.icon-list{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 14vh;
.img-box{
display: flex;
width: 120upx;
height: 120upx;
margin: 0 20upx;
border-radius: 24upx;
overflow: hidden;
image{
display: block;
width: 100%;
height: 100%;
}
}
}
.text-box{
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 36upx;
color: #000000;
font-weight: bold;
.text-item{
display: flex;
flex-direction: row;
align-items: center;
}
}
}
.input-box{
display: flex;
justify-content: center;
align-items: center;
width: 70%;
margin-top: 30upx;
.cu-form-group{
width: 100%;
border-bottom: 1px solid #999999;
background: transparent;
padding: 1upx 12upx;
.input{
padding: 4upx 6upx;
}
.cuIcon-qr_code{
font-size: 60upx;
}
}
}
.confirm-box{
display: flex;
justify-content: center;
align-items: center;
width: 70%;
margin-top: 30upx;
.cu-btn{
width: 100%;
}
}
.tips-box{
display: flex;
flex-direction: column;
width: 90%;
}
.content-box{
display: flex;
flex-direction: column;
width: 70vw;
height: 40vh;
.content{
display: flex;
flex-direction: column;
width: 100%;
padding: 10upx 0 50upx;
border-radius: 24upx;
background-color: #ffffff;
.title-box{
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 20upx 0;
border-bottom: 1px solid #e5e5e5;
.close-box{
position: absolute;
right: 20upx;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 60upx;
text{
font-size: 50upx;
}
}
}
}
.tip{
display: flex;
flex-direction: column;
.text-1{
display: flex;
width: 100%;
justify-content: center;
align-items: center;
margin: 30upx 0;
}
.flex-col{
width: 100%;
margin: 10upx 30upx;
text{
font-size: 32upx;
color: #666666;
}
}
}
}
</style>
......@@ -57,20 +57,20 @@
<view class="title">
<text class="text-title">房间预览</text>
</view>
<view v-for="(item,index) in storeInfo.roomVoList" :key="index" class="list-item-box">
<view v-for="(item,index) in storeInfo.roomVoList" :key="index" class="list-item-box" @tap="onNavToOrder(item)">
<view class="relative part-top">
<image class="room-img" :src="item.images[0]" mode="widthFix"></image>
<image class="room-img" :src="item.images[0]" mode="scaleToFill"></image>
<view class="absolute part-top-content">
<view class="flex-between">
<view></view>
<image src="../../static/nav_to_icon.png" mode="widthFix" @tap="onNavToInfo(item)">
<image src="../../static/nav_to_icon.png" mode="widthFix" @tap.stop="onNavToInfo(item)">
</image>
</view>
<view class="tip-list-box">
<!-- <view class="tip-list-box">
<view v-for="(item,index) in iconList" :key="index" class="tip-item">
<image :src="item.url" mode="widthFix"></image>
</view>
</view>
</view> -->
</view>
</view>
<view class="flex-col part-bottom">
......@@ -82,14 +82,19 @@
<text></text><text class="text-pink">{{item.price}}</text><text>/小时</text>
</view>
</view>
<view class="facilitie-box">
<view v-for="(val,i) in item.facilities" :key="i" class='cu-tag radius light bg-pink'>
<text>{{facilitieList[val]}}</text>
</view>
</view>
<view class="flex-1 flex-between">
<view class="flex-row room-type">
<text>优惠套餐:</text>
<view v-for="(item,i) in item.packList" :key="i" class="item">
<text>{{item.name}}</text>
<view v-for="(val,i) in item.packList" :key="i" class="item">
<text>{{val.name}}</text>
</view>
</view>
<view class="confirm" @tap="onNavToOrder(item)">
<view class="confirm" >
<text class="cuIcon-add text-white text-lg"></text>
</view>
</view>
......@@ -166,6 +171,7 @@
label: "8小时"
}
],
facilitieList:{},
show: true,
timer: null
}
......@@ -203,13 +209,21 @@
},
onLoad(option) {
console.log(option, 909090)
},
mounted() {
this.facilitieList = this.getDictItem("indoor_facilities");
console.log(this.facilitieList)
},
methods: {
onScroll(e) {
this.scrollTop = e.target.scrollTop;
},
onLoading() {
uni.removeStorage({
key:'storeId'
})
this.onGetListStore()
},
onGetListStore() {
......@@ -228,12 +242,13 @@
roomVoList: obj.roomVoList.map(item => {
return {
...item,
facilities: item.facilities? item.facilities.split(","):[],
images: item.images ? item.images
.split(",").map(val => this.hostUrl + val) : []
}
})
}
console.log(this.storeInfo,909090)
}
})
......@@ -513,7 +528,7 @@
.part-top {
position: relative;
width: 600upx;
min-height: 200upx;
min-height: 300upx;
z-index: 10;
background-color: #FFFFFF;
border-radius: 36upx 36upx 36upx 36upx;
......@@ -524,7 +539,7 @@
display: block;
width: 100%;
border-radius: 36upx 36upx 36upx 36upx;
height: auto;
height: 100%;
}
.part-top-content {
......@@ -631,8 +646,8 @@
justify-content: center;
align-items: center;
align-self: flex-end;
width: 76upx;
height: 62upx;
width: 80upx;
height: 80upx;
background: #E40583;
border-radius: 0 0 32rpx 0;
......@@ -645,4 +660,9 @@
}
}
}
.facilitie-box{
display: flex;
flex-wrap: wrap;
padding: 12upx 20upx;
}
</style>
\ 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