|
|
@@ -1,55 +1,57 @@
|
|
|
<template>
|
|
|
- <view class="order-content-wrap">
|
|
|
+ <view class="page" :style="{'height':windowHeight}">
|
|
|
+
|
|
|
+ <view class="flex-row">
|
|
|
+ <view class="flex-col justify-center" @click="noUseChange">
|
|
|
+ <u-icon v-if="noUse" name="checkmark-circle-fill" color="#38db38" size="25" ></u-icon>
|
|
|
+ <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
|
|
|
+ </view>
|
|
|
+ <view class="noUse">
|
|
|
+ <text>不使用优惠券</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view :style="{'height':scrollViewHeight}">
|
|
|
+ <scroll-view class="scroll " :style="{'height':scrollViewHeight}" scroll-y>
|
|
|
+ <view class="row-list flex-row justify-start" v-for="(it,i) in 10" @click="useCoupons(i)">
|
|
|
+ <view class="h-text flex-col justify-center ">
|
|
|
+ <view class="money">
|
|
|
+ <text>¥{{item.discountsPrice || '100'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="desc">
|
|
|
+ <text>{{item.name || '优惠券名字'}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="h-center-content flex-col ">
|
|
|
+ <view class="h-value">
|
|
|
+ <text>门店通用</text>
|
|
|
+ </view>
|
|
|
+ <view class="title">
|
|
|
+ 使用平台:<text v-if="item.strategyType == '0'">全平台</text>
|
|
|
+ <text v-else-if="item.strategyType == '1'">个人优惠卷</text>
|
|
|
+ </view>
|
|
|
+ <view class="title">
|
|
|
+ 使用次数:{{item.degree}}
|
|
|
+ </view>
|
|
|
+ <view class="title">
|
|
|
+ 到期时间:{{item.endTime.substring(0,10)}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="h-right-content flex-col justify-center ">
|
|
|
+ <u-icon v-if="index == i " name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
|
|
|
+ <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <view class="btn">
|
|
|
+ <text>确定</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
-<!-- <!– 当前订单–>-->
|
|
|
-<!-- <view class="service-order">-->
|
|
|
-
|
|
|
-<!-- <view @click="noUseCoupon()" class="h-no-use-coupons">-->
|
|
|
-<!-- <u-icon name="share-square" color="#333" size="25"></u-icon>-->
|
|
|
-<!-- <view class="">-->
|
|
|
-<!-- <text>不使用优惠券</text>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-
|
|
|
-<!-- <view v-for="(item,index) in countsList" :class="computedStyle(item)" class="store-wrap bg-img">-->
|
|
|
-<!-- <view class="row-list" >-->
|
|
|
-<!-- <view @click="useCoupon(item)" class="store-content">-->
|
|
|
-<!-- <view class="h-left-content">-->
|
|
|
-<!-- <view class="h-text">-->
|
|
|
-<!-- <view class="money">¥{{item.discountsPrice}}</view>-->
|
|
|
-<!-- <view class="desc">{{item.name}}</view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- <view class="h-center-content">-->
|
|
|
-<!-- <view class="title">-->
|
|
|
-<!-- <text class="h-value">门店通用</text>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- <view class="title">-->
|
|
|
-<!-- 使用平台:全平台-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- <view class="title">-->
|
|
|
-<!-- 有效时间:{{this.dateFormat(item.startTime)}}~{{this.dateFormat(item.endTime)}}-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- <view class="h-right-content">-->
|
|
|
-<!-- <u-icon v-if="item.id == couponIds" name="checkmark-circle" color="#333" size="25"></u-icon>-->
|
|
|
-<!-- <view v-else class="no-checked"></view>-->
|
|
|
-<!-- <view class="h-btn">-->
|
|
|
-<!-- <!– <view @click="useCoupon(item)" class="h-btn-value-receive">选择使用</view> –>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
-
|
|
|
-<!-- <view v-if="countsList.length == 0" class="footer">-->
|
|
|
-<!-- <view class="">---暂无数据---</view>-->
|
|
|
-<!-- </view>-->
|
|
|
-
|
|
|
-<!-- <view v-if="countsList.length > 0" class="footer">-->
|
|
|
-<!-- <view class="">---到底了---</view>-->
|
|
|
-<!-- </view>-->
|
|
|
-<!-- </view>-->
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -57,261 +59,36 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- checkboxList1:[
|
|
|
- {
|
|
|
- name: '苹果',
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '香蕉',
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- {
|
|
|
- name: '橙子',
|
|
|
- disabled: false,
|
|
|
- },
|
|
|
- ],
|
|
|
- checkboxValue1: '',
|
|
|
- isChecked: false,
|
|
|
- couponIds: null ,
|
|
|
- currentServiceTab: 'orderTab1', // 当前选中的 Tab
|
|
|
- list: [1, 2, 3, 4],
|
|
|
- reqParm: {
|
|
|
- auth: true,
|
|
|
- type: 0
|
|
|
- },
|
|
|
- countsList: []
|
|
|
+ index:-1,
|
|
|
+ noUse:true,
|
|
|
+ windowHeight:'',
|
|
|
+ scrollViewHeight:''
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- // 选择的优惠券
|
|
|
- this.couponIds = option.couponIds;
|
|
|
- console.log(option.couponIds)
|
|
|
- // 查询可领取的优惠劵
|
|
|
- this.getUserDiscountsList();
|
|
|
+ let sysInfo = uni.getSystemInfoSync()
|
|
|
+ this.windowHeight =sysInfo.windowHeight +'px'
|
|
|
+ this.scrollViewHeight =sysInfo.windowHeight -(sysInfo.windowWidth/750)*252 +'px'
|
|
|
},
|
|
|
computed: {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- // 日期格式化
|
|
|
- dateFormat(date){
|
|
|
- let time = Date.parse(date);
|
|
|
- return uni.$u.date(time, 'yyyy-mm-dd');
|
|
|
- },
|
|
|
- // 查询可领取的优惠劵
|
|
|
- getUserDiscountsList(){
|
|
|
- let that = this;
|
|
|
- // 用户绑定门店
|
|
|
- getMyCouponList({data:this.reqParm}).then((res)=>{
|
|
|
- console.log(res)
|
|
|
- this.countsList = res.rows;
|
|
|
- }).catch(() =>{
|
|
|
- uni.showToast({
|
|
|
- title: "操作失败"
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
+ noUseChange(){
|
|
|
+ this.noUse = !this.noUse
|
|
|
+ if (this.noUse){
|
|
|
+ this.index = -1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ useCoupons(i){
|
|
|
+ this.noUse = false
|
|
|
+ this.index = i
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- computedStyle(item) {
|
|
|
- return 'bg-img';
|
|
|
- },
|
|
|
- // 切换菜单
|
|
|
- changeServiceTab(tab){
|
|
|
- this.currentServiceTab = tab;
|
|
|
- },
|
|
|
- // 领取优惠劵
|
|
|
- gotoReceiveCoupon(){
|
|
|
- uni.showToast({
|
|
|
- title: "领取成功"
|
|
|
- })
|
|
|
- },
|
|
|
- // 去使用优惠劵
|
|
|
- useCoupon(item){
|
|
|
- // 选择完成后返回上一页
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1,
|
|
|
- success: function(res) {
|
|
|
- console.log('返回成功');
|
|
|
- // 在这里可以处理选择结果
|
|
|
- // 可以将选择的内容保存到本地或通过事件传递给上一个页面
|
|
|
- uni.$emit('selectedDataCouponChild', item);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 不使用优惠券
|
|
|
- noUseCoupon(){
|
|
|
- let data = {
|
|
|
- id: null,
|
|
|
- discountsPrice: 0
|
|
|
- }
|
|
|
- // 选择完成后返回上一页
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1,
|
|
|
- success: function(res) {
|
|
|
- console.log('返回成功');
|
|
|
- // 在这里可以处理选择结果
|
|
|
- // 可以将选择的内容保存到本地或通过事件传递给上一个页面
|
|
|
- uni.$emit('selectedDataCouponChild', data);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
-.h-no-use-coupons{
|
|
|
- display: flex;
|
|
|
- padding-top: 12px;
|
|
|
- padding-left: 12px;
|
|
|
- padding-right: 12px;
|
|
|
-}
|
|
|
-
|
|
|
- /* 服务订单内容*/
|
|
|
-.service-order-tab-bar{
|
|
|
- background: #fff;
|
|
|
- display: flex;
|
|
|
- justify-content: space-around;
|
|
|
- height: 50px;
|
|
|
- background-color: #f5f5f5;
|
|
|
- .service-order-tab-item{
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- font-size: 16px;
|
|
|
- color: #333;
|
|
|
- line-height: 26px;
|
|
|
- }
|
|
|
- .service-order-tab-item.active {
|
|
|
- // color: #ff0000;
|
|
|
- }
|
|
|
-
|
|
|
- .underline {
|
|
|
- border-bottom: 2px solid #FFE05C ;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.bg-img{
|
|
|
- background-image: url('/static/coupon/u210.png');
|
|
|
- background-repeat: repeat;
|
|
|
- height: 94px;
|
|
|
- margin: 12px;
|
|
|
-}
|
|
|
-.bg-img1{
|
|
|
- background-image: url('/static/coupon/u211.png');
|
|
|
- background-repeat: repeat;
|
|
|
- height: 94px;
|
|
|
- margin: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-.service-order{
|
|
|
- // background: #fff;
|
|
|
-}
|
|
|
-
|
|
|
-/* 门店列表 */
|
|
|
-.store-wrap{
|
|
|
- border-radius: 2px;
|
|
|
- padding-bottom: 12px;
|
|
|
- padding-left: 12px;
|
|
|
- padding-right: 12px;
|
|
|
- .row-list{
|
|
|
- .store-content{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- height: 94px;
|
|
|
- color: #333333;
|
|
|
- .h-left-content{
|
|
|
- width: 26%;
|
|
|
- text-align: center;
|
|
|
- .h-text{
|
|
|
- width: 100%;
|
|
|
- font-weight: 400;
|
|
|
- line-height: 18px;
|
|
|
- font-size: 12px;
|
|
|
- .money{
|
|
|
- font-size: 18px;
|
|
|
- font-weight: bold;
|
|
|
- line-height: 26px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .h-center-content{
|
|
|
- width: 60%;
|
|
|
- padding-left: 12px;
|
|
|
- .title{
|
|
|
- width: 100%;
|
|
|
- color: #999999;
|
|
|
- font-size: 12px;
|
|
|
- .h-value{
|
|
|
- font-size: 14px;
|
|
|
- line-height: 42px;
|
|
|
- color: #333333;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .h-right-content{
|
|
|
- width: 14%;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;;
|
|
|
- align-items: center;
|
|
|
- background-image: url('/static/coupon/u2102.png');
|
|
|
- height: 94px;
|
|
|
- font-size: 12px;
|
|
|
- padding-right: 12px;
|
|
|
- .no-checked{
|
|
|
- height: 22px;width: 22px;
|
|
|
- border-radius: 11px;
|
|
|
- border: 2px solid #999;
|
|
|
- }
|
|
|
- .h-btn-value-use{
|
|
|
- background: #FFE05C;
|
|
|
- color: #333333;
|
|
|
- height: 30px;
|
|
|
- width: 80px;
|
|
|
- text-align: center;
|
|
|
- line-height: 30px;
|
|
|
- border-radius: 15px;
|
|
|
- }
|
|
|
- .h-btn-value-receive{
|
|
|
- background: #FFE05C;
|
|
|
- color: #333;
|
|
|
- height: 30px;
|
|
|
- width: 80px;
|
|
|
- text-align: center;
|
|
|
- line-height: 30px;
|
|
|
- border-radius: 15px;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- .h-btn-img{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- image{
|
|
|
- height: 68px;
|
|
|
- width: 68px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-/* 产品订单 */
|
|
|
-.product-order{
|
|
|
- margin-top: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-/* 底部 */
|
|
|
-.footer{
|
|
|
- margin-top: 30px;
|
|
|
- height: 120px;
|
|
|
- font-size: 12px;
|
|
|
- text-align: center;
|
|
|
- color: #666;
|
|
|
-}
|
|
|
-
|
|
|
+ @import '/common/css/common.css';
|
|
|
+ @import './index.rpx.scss';
|
|
|
</style>
|