Commit c8997b96 by zhangzhen

细节优化

parent 6f8cfb5e
......@@ -109,7 +109,7 @@
code:this.code.split(" ").join(""),
openShopUuid:this.openShopUuid
}).then(res=>{
console.log(res,909090)
uni.hideLoading()
if(res.data.code === 200){
this.couponInfo = res.data.data
uni.showToast({
......@@ -127,7 +127,8 @@
}else{
uni.showToast({
icon:"none",
title:res.data.msg
title:res.data.msg,
duration: 3000
})
}
})
......
......@@ -82,7 +82,7 @@
queryParams: {
pageSize: 10,
pageNum: 1,
useStatus: '',
useStatus: '0',
},
eventChannel:null,
tipText:"",
......@@ -91,17 +91,17 @@
statusIndex: 0,
statusList: [
{
label: "全部",
value: "",
},
{
label: "待使用",
value: "0",
},
{
label: "已使用",
value: "1",
}
},
{
label: "已过期",
value: "2",
},
]
};
},
......
......@@ -42,7 +42,7 @@
</view>
<view v-for="(item,k) in dateList" :key="k" class="flex-1 flex-col date-item"
:class="{active:dateIndex === k}" @tap="onDateChange(k)">
<text class="text-title text-bold text-first ">{{ k>0?item.weekday: '今天'}}</text>
<text class="text-title text-bold text-first ">{{ k === 0 && item.readDate === toDayDate? '今天' : item.weekday}}</text>
<text class="text-title text-bold" style="margin-top: 12upx;">{{ item.date}}</text>
</view>
</view>
......@@ -189,7 +189,7 @@
<text class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text>
<view class="flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: useCouponList.length? '请选择':'暂无可用'}}</text>
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: couponList.length? '请选择':'暂无可用'}}</text>
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view>
</view>
......@@ -474,7 +474,8 @@
addM:false,//初始化加一分钟,之后不加
startHours:0,
endHours:48,
content:''
content:'',
toDayDate: '', // 今天日期
};
},
filters:{
......@@ -519,6 +520,7 @@
},
methods: {
onInitDateList(){
this.toDayDate = moment().format("YYYY-MM-DD")
let dateList = [];
for (let i = 0; i < 5; i++) {
let obj = {
......@@ -529,6 +531,7 @@
dateList.push(obj)
}
this.dateList = dateList;
console.log(this.dateList,909090)
},
onSetSelectTime(){
if(this.dateIndex === 0){
......@@ -861,10 +864,19 @@
}).then(res => {
if (res.data.code == 200) {
if (res.data && res.data.data.length) {
this.useCouponList = res.data.data.filter(item => item.isAvailable === 0).sort((a,
b) => b.subPrice - a.subPrice);
this.couponList = res.data.data;
let list = res.data.data.filter(item => item.isAvailable === 0).map(item=> {
return {
...item,
subPrice: item.subPrice || 0
}
})
list.sort((a,b) => b.subPrice - a.subPrice)
this.useCouponList = list;
if(this.useCouponList.length){
this.selectCouponIndex = 0;
let i = this.useCouponList.findIndex(item=> item.duration == this.duration)
this.selectCouponIndex = i>=0? i : 0;
}
}
} else if (res.data.code == 401) {
......@@ -875,7 +887,7 @@
},
onNavToSelectCoupon() {
let that = this;
if (this.useCouponList.length) {
if (this.useCouponList.length || this.couponList.length) {
uni.navigateTo({
url: "/pages/useCoupon/index",
events: {
......
......@@ -9,11 +9,11 @@
<text class="text-title text-lg text-bold">{{item.name}}</text>
</view>
<view v-if="item.couponType == 4" class="flex-row margin-top">
<text class="">使用说明:</text>
<text class="part-tip">使用说明:</text>
<text>{{item.remark || ''}}</text>
</view>
<view v-else class="flex-row margin-top">
<text class="">使用说明:</text>
<text class="part-tip">使用说明:</text>
<text class="">{{item.minPrice}}元,优惠{{item.subPrice}}</text>
</view>
<!-- <view class="flex-row margin-top">
......@@ -110,7 +110,15 @@
getUseCoupon(d).then(res => {
if (res.statusCode == 200) {
if (res.data && res.data.data.length) {
this.list = res.data.data.sort((a, b) => b.subPrice - a.subPrice);
let list = res.data.data.map(item=> {
return {
...item,
subPrice: item.subPrice || 0
}
})
list.sort((a, b) => b.subPrice - a.subPrice);
this.list = list;
}
}
})
......@@ -163,6 +171,9 @@
width: 100%;
padding: 20upx 30upx;
z-index: 99;
.part-tip{
width: 160upx;
}
}
.part-bottom{
display: flex;
......
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