|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view >
|
|
|
- <u-navbar title="我的优惠券"><view class="exchange">兑换</view></u-navbar>
|
|
|
+ <u-navbar title="我的优惠券"><view class="exchange" @click="toConversion">兑换</view></u-navbar>
|
|
|
<view class="tab" >
|
|
|
<u-tabs :list="tabList" :current="current" @change="change" :show-bar="false" active-color="#333" inactive-color="#c4c0c0"></u-tabs>
|
|
|
</view>
|
|
@@ -67,15 +67,11 @@
|
|
|
|
|
|
<view class="limit">
|
|
|
<view class="limit-text">
|
|
|
-
|
|
|
<view class="limit-text1">
|
|
|
- 限用户充电电费+服务费满100元使用。<text class="iconfont arrows"></text>
|
|
|
- 限微信钱包、支付宝生活号APP端使用,
|
|
|
- 不支持找零,
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="limit-text2">
|
|
|
- 限登录和充电帐号为155****1111使用。
|
|
|
+ <u-read-more ref="uReadMore" :shadow-style="shadowStyle" :show-height="50" text-indent="0" :close-text="closeContent"
|
|
|
+ :open-text="openContent" color="#999999" :toggle="true">
|
|
|
+ <rich-text :nodes="readContent"></rich-text>
|
|
|
+ </u-read-more>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="use-button">
|
|
@@ -295,23 +291,63 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as userApi from '@/apis/user.js'
|
|
|
+
|
|
|
export default{
|
|
|
data(){
|
|
|
return{
|
|
|
tabList: [
|
|
|
- {name: '可使用',type: '1'},
|
|
|
- {name: '已使用',type: '2'},
|
|
|
- {name: '已过期',type: '3'},
|
|
|
+ {name: '可使用',type: '0'},
|
|
|
+ {name: '已使用',type: '1'},
|
|
|
+ {name: '已过期',type: '2'},
|
|
|
],
|
|
|
current: 0,
|
|
|
+ couponType: '0',
|
|
|
+ myCouponList: [],
|
|
|
+ readContent: `限用户充电电费+服务费满100元使用。限微信钱包、支付宝生活号APP端使用,<br />不支持找零,限登录和充电帐号为155****1111使用。`,
|
|
|
+ shadowStyle: {
|
|
|
+ width: "110%",
|
|
|
+ backgroundImage: "none",
|
|
|
+ paddingTop: "0",
|
|
|
+ marginTop: "-10%",
|
|
|
+ justifyContent: "right",
|
|
|
+ },
|
|
|
+ closeContent: '',
|
|
|
+ openContent: ','
|
|
|
}
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ this.getCouponList();
|
|
|
+ },
|
|
|
methods:{
|
|
|
+ toConversion() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/user/coupon/conversion'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCouponList() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ userApi.couponList({
|
|
|
+ status: this.couponType
|
|
|
+ }).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+
|
|
|
+ this.myCouponList = res.data.data;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
change(index) {
|
|
|
this.current = index;
|
|
|
-
|
|
|
+ this.couponType = this.tabList[index].type;
|
|
|
+ this.getCouponList();
|
|
|
},
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|