123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457 |
- <template>
- <view class="content">
- <view class="" style="height: 20rpx;"></view>
- <view class="yhq-wrap">
- <view class="yhq-info p-r">
- <image src="../../static/img/yhq-w.png" mode="widthFix"></image>
- <view class="info-name p-a">
- 地锅印象代金券
- </view>
- <view class="info-info p-a">
- 79元代100元券
- </view>
- <view class="info-time p-a">
- 周一至周日可用
- </view>
- </view>
- <view class="yhq-price flex f-j-s">
- <view class="price-left flex f-j-s fg1">
- <view class="left-new-price">
- 79
- </view>
- <view class="left-zk">
- 7.9折
- </view>
- <view class="left-old-price">
- ¥100
- </view>
- </view>
- <view class="price-right fs0">
- 1020人买过
- </view>
- </view>
- <view class="yhq-tit">
- 有效期
- </view>
- <view class="yhq-val">
- 2021.12.17至2022.5.16 23:59(周末、法定节假日通用)
- </view>
- <view class="yhq-tit">
- 使用时间
- </view>
- <view class="yhq-val">
- 11:00-2300
- </view>
- <view class="yhq-tit">
- 适用范围
- </view>
- <view class="yhq-val">
- 除酒水饮料外全场通用
- </view>
- <view class="yhq-tit">
- 使用规则
- </view>
- <view class="yhq-val">
- 仅限堂食
- </view>
- </view>
- <!-- 底部填充 -->
- <view class="" style="height: 120rpx;"></view>
- <!-- 底部购买收藏 -->
- <view class="btm-btn flex">
- <!-- <view class="sc fs0 flex f-j-c">
- <image src="../../static/icon/shoucang.png" mode=""></image>
- </view> -->
- <view class="buy-now-btn fg1" @click="buyNow()">
- 立即购买
- </view>
- </view>
- <!-- 购买数量弹窗 -->
- <uni-popup ref="buyNumPopup" type="center">
- <view class="buy-num p-r">
- <view class="buy-num-tit">
- 购买数量
- </view>
- <add-number class="buy-num-wrap" :isMin="true" :value="buyNum" :min="1" :max="goodsNumberMax"
- @eventChange="numberChange"></add-number>
- <view class="buy-num-hj">
- 合计¥188
- </view>
- <view class="buy-num-btn flex">
- <view class="buy-close fg1" @click="buyNumClose">
- 取消
- </view>
- <view class="buy-true fg1" style="color: #FF4C4C;" @click="openPay">
- 确定
- </view>
- </view>
- </view>
- </uni-popup>
- <!-- 选择支付方式弹窗 -->
- <uni-popup ref="popup" type="bottom">
- <view class="zf-wrap">
- <view class="zf-top flex f-j-sb">
- <view class="top-left">
- 选择支付方式
- </view>
- <image src="../../static/icon/colse.png" mode="" @click="close"></image>
- </view>
- <view class="zf-type flex" @click="changePayType(1)">
- <view class="type-left">
- <text class="icon iconfont iconweixin"></text>
- <text style="margin-left: 20rpx;">微信支付</text>
- </view>
- <label class="radio">
- <radio value="" color="#FF4C4C" :checked="payType == 1"></radio>
- </label>
- </view>
- <view class="zf-type flex" @click="changePayType(3)">
- <view class="type-left">
- <text class="icon iconfont iconyue"></text>
- <text style="margin-left: 20rpx;">余额支付</text>
- </view>
- <label class="radio">
- <radio value="" color="#FF4C4C" :checked="payType == 3"></radio>
- </label>
- </view>
- <view class="" style="width: 750rpx;height: 20rpx;background: #F6F6F6;"></view>
- <view class="zf-btn flex">
- <view class="btn-left">
- 合计:<text class="zf-price">100</text>
- </view>
- <view class="btn-right" @click="buying?'':buy()">
- 立即支付
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import addNumber from '@/components/add-number.vue';
- export default {
- components: {
- addNumber
- },
- data() {
- return {
- goodsNumberMax: 999,
- buyNum: 1,
- payType: 1,
- buying: false,
- payName: 'weixin'
- }
- },
- onLoad() {
- },
- onShow() {
- },
- onReachBottom() {
- },
- onReady() {
- },
- methods: {
- buyNow() {
- let obj = this
- obj.$refs.buyNumPopup.open()
- },
- // 购买数量变化
- numberChange(e) {
- this.buyNum = e.number;
- },
- buyNumClose() {
- let obj = this
- obj.$refs.buyNumPopup.close()
- },
- // 打开支付弹窗
- openPay() {
- let obj = this
- obj.$refs.buyNumPopup.close()
- obj.$refs.popup.open()
- },
- closePay() {
- let obj = this
- obj.$refs.popup.close()
- },
- changePayType(type) {
- this.payType = type;
- if (this.payType == 1) {
- this.payName = 'weixin';
- }
- if (this.payType == 2) {
- this.payName = 'ali';
- }
- if (this.payType == 3) {
- this.payName = 'yue';
- }
- if (this.payType == 4) {
- this.payName = 'pink_integral';
- }
- if (this.payType == 5) {
- this.payName = 'cash';
- }
- },
- //支付
- buy() {
- let obj = this
- if (obj.payType == 0) {
- return obj.$api.msg('请选择支付方式')
- }
- if (obj.buying) {
- return
- }
- obj.buying = true
- obj.closePay()
- },
- }
- }
- </script>
- <style lang="scss">
- .yhq-wrap {
- width: 702rpx;
- // height: 1065rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- margin: auto;
- padding: 30rpx 24rpx 50rpx;
- .yhq-info {
- width: 655rpx;
- height: 230rpx;
- // border: 1px solid #FCC7AE;
- margin: auto;
- image {
- width: 655rpx;
- }
- view {
- padding-left: 22rpx;
- }
- .info-name {
- top: 25rpx;
- font-size: 24rpx;
- font-weight: bold;
- color: #333333;
- }
- .info-info {
- top: 70rpx;
- font-size: 45rpx;
- font-weight: bold;
- color: #333333;
- }
- .info-time {
- bottom: 25rpx;
- }
- }
- }
- .yhq-price {
- width: 643rpx;
- margin: auto;
- height: 110rpx;
- border-bottom: 1rpx solid #f6f6f6;
- .price-right {
- font-size: 25rpx;
- font-weight: 500;
- color: #999999;
- }
- .left-new-price {
- font-size: 56rpx;
- font-weight: bold;
- color: #FF4C4C;
- &:before {
- content: '¥';
- font-size: 29rpx;
- color: #FF4C4C;
- }
- }
- .left-zk {
- display: inline-block;
- padding: 5rpx 8rpx;
- border: 1px solid #FF4C4C;
- border-radius: 8rpx;
- font-size: 22rpx;
- font-weight: 500;
- color: #FF4C4C;
- margin: 0 10rpx 0 12rpx;
- }
- .left-old-price {
- font-size: 25rpx;
- font-weight: 500;
- text-decoration: line-through;
- color: #999999;
- }
- }
- .yhq-tit {
- padding-top: 45rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- }
- .yhq-val {
- padding-top: 20rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #333333;
- text-align: justify;
- }
- .btm-btn {
- background-color: #fff;
- box-shadow: 0px 0px 40px 0px rgba(50, 50, 52, 0.06);
- position: fixed;
- bottom: 0;
- width: 750rpx;
- height: 100rpx;
- .sc {
- width: 103rpx;
- image {
- width: 42rpx;
- height: 64rpx;
- }
- }
- .buy-now-btn {
- line-height: 100rpx;
- background: #FF4C4C;
- font-size: 36rpx;
- font-weight: 500;
- color: #FFFFFF;
- text-align: center;
- }
- }
- .buy-num {
- width: 537rpx;
- height: 449rpx;
- background: #FFFFFF;
- border-radius: 30rpx;
- font-size: 30rpx;
- text-align: center;
- .buy-num-tit {
- font-weight: bold;
- color: #333333;
- padding-top: 60rpx;
- }
- .buy-num-wrap {
- margin: 60rpx auto 45rpx;
- }
- .buy-num-hj {
- font-weight: 500;
- color: #333333;
- }
- .buy-num-btn {
- position: absolute;
- bottom: 0;
- width: 100%;
- text-align: center;
- height: 90rpx;
- }
- }
- .zf-wrap {
- width: 750rpx;
- height: 404rpx;
- background: #FFFFFF;
- border-radius: 10rpx 10rpx 0px 0px;
- .zf-top {
- height: 86rpx;
- border-bottom: #EEEEEE solid 1rpx;
- padding: 0 25rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- image {
- width: 15rpx;
- height: 15rpx;
- }
- }
- .zf-type {
- margin-left: 23rpx;
- width: 727rpx;
- height: 100rpx;
- border-bottom: #EEEEEE solid 1rpx;
- padding: 0 25rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #3F454B;
- &:last-of-type {
- border-bottom: none;
- }
- }
- .zf-btn {
- .btn-right {
- width: 360rpx;
- line-height: 100rpx;
- background: #FF4C4C;
- text-align: center;
- font-size: 32rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .btn-left {
- width: 390rpx;
- line-height: 100rpx;
- padding-left: 24rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #3F454B;
- .zf-price {
- font-size: 36rpx;
- font-weight: bold;
- color: #FF4C4C;
- &::before {
- content: '¥';
- font-size: 24rpx;
- color: #FF4C4C;
- }
- }
- }
- }
- }
- .iconweixin {
- color: #36cb59;
- }
- .iconyue {
- color: #fe8e2e;
- }
- </style>
|