| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <template>
- <view class="details">
- <view class="top"></view>
- <view class="head">
- <span class="cuIcon-back" @click="back"></span>
- <view class="case">
- 服务核销
- </view>
- </view>
- <view class="content">
- <view class="product">
- <view class="img">
- <image :src="product.productImage" mode=""></image>
- </view>
- <view class="name">
- {{product.productName}}
- <view class="price">
- <span>¥</span>{{product.orderPrice}} <span>/份</span>
- </view>
- </view>
- </view>
- </view>
- <view class="foot">
- <view class="btn" @click="verify">
- 确认消费
- </view>
- </view>
- <view class="popup " v-if="isSuccess">
- <view class="content">
- <view class="title">
- <span>消费成功</span>
- </view>
- <view class="center">
- <image src="/static/index/close.png" mode=""></image>
- <span>消费成功!</span>
- </view>
- <view class="btn" @click="goIndex">
- 确定
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- isSuccess: false,
- product:null,
- merchantId:''
- }
- },
- methods:{
- //返回
- back() {
- uni.navigateBack({
- delta: 1
- });
- },
- verify(){
- // this.isSuccess = true
- let data = {
- merchantId:this.merchantId,
- voucherCode:this.product.voucherCode
- }
- this.$http.post("app/writeOff/add",data).then(res => {
- if (res.data.code == 200) {
- console.log(res)
- this.isSuccess = true
- }else{
- uni.showToast({
- title: res.data.message,
- icon:'none'
- });
- }
- })
- },
- goIndex(){
- this.isSuccess = false
- uni.switchTab({
- url:'/pages/index/index'
- })
- }
- },
- onLoad(options) {
- this.product =JSON.parse(decodeURIComponent(options.params))
- console.log(this.product )
- },
- onShow() {
- let that = this
- uni.getStorage({
- key: 'login_user_info',
- success: function(res) {
- that.merchantId = res.data.merchantId
- }
- })
- }
- }
- </script>
- <style lang="scss" scoped>
- .details {
- width: 100vw;
- height: 100vh;
- background: #F7F8FC;
- /*#ifdef APP-PLUS*/
- .top {
- width: 100%;
- background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(0, #F7F8FC 0%, rgba(255, 255, 255, 0) 100%);
- height: var(--status-bar-height);
- }
-
- /*#endif*/
- .head {
- width: 100%;
- height: 112rpx;
- padding: 20rpx;
- display: flex;
- align-items: center;
- background: #fff;
- position: relative;
- .cuIcon-back {
- font-size: 40rpx;
- margin-right: 40rpx;
- }
- .case {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- font-size: 36rpx;
- font-weight: 600;
- }
- }
- .content {
- width: 100%;
- margin-top: 24rpx;
- padding: 24rpx;
- .product {
- background-color: #fff;
- display: flex;
- margin-bottom: 20rpx;
- padding: 20rpx 16rpx;
- border-radius: 16rpx;
- .img {
- width: 132rpx;
- height: 132rpx;
- border-radius: 12rpx;
- overflow: hidden;
- margin-right: 16rpx;
- image {
- width: 132rpx;
- height: 132rpx;
- }
- }
- .name {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- font-size: 30rpx;
- color: #000000;
- line-height: 35rpx;
- font-weight: 600;
- .price {
- font-size: 28rpx;
- color: #FF6A42;
- span{
- font-size: 24rpx
- }
- }
- }
- }
- }
- .foot {
- width: 100%;
- height: 112rpx;
- position: fixed;
- bottom: 0;
- border-top: 1px solid #eeeeee;
- padding: 16rpx 24rpx 20rpx;
- .btn {
- width: 100%;
- height: 76rpx;
- background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
- border-radius: 53rpx;
- font-size: 28rpx;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- .popup {
- width: 100vw;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.4);
- display: flex;
- align-items: center;
- justify-content: center;
-
- .content {
- width: 570rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 0px 24rpx;
- padding-bottom: 16rpx;
- .title {
- width: 100%;
- height: 86rpx;
- font-size: 32rpx;
- color: #333333;
- font-weight: 600;
- border-bottom: 1px solid #EEEEEE;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .center {
- font-size: 30rpx;
- color: #333333;
- line-height: 35rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding-top: 28rpx;
- border-bottom: 1px solid #EEEEEE;
- padding-bottom: 40rpx;
- margin-bottom: 16rpx;
- image {
- width: 100rpx;
- height: 100rpx;
- margin-bottom: 10rpx;
- }
- }
- .btn {
- width: 320rpx;
- height: 68rpx;
- border-radius: 66rpx;
- font-size: 28rpx;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 0rpx auto;
- background: #449AFF;
- }
- .close{
-
- }
- }
- }
- }
- </style>
|