Commit ae7d46f5 by zhangzhen

细节优化

parent 3174b192
......@@ -18,6 +18,11 @@
<text class="text-title text-lg text-bold" style="width: 64%;">{{item.name}}</text>
<text class="text-lg" :class="item.useStatus==0?'text-pink':'text-gray'">{{item.useStatus==0?'待使用':'已使用'}}</text>
</view>
<view class="flex-row margin-top">
<text class="">来源:</text>
<text>{{couponSourceEnum[item.sourceType]}}</text>
</view>
<view v-if="item.couponType == 4" class="flex-row margin-top">
<text class="">使用说明:</text>
<text>{{item.remark || ''}}</text>
......@@ -31,11 +36,11 @@
<text class="">可用时段:</text>
<text class="">{{item.couponTimeStart}}-{{item.couponTimeEnd}}</text>
</view>
<text>{{item.platformType==2?'美团核销':''}}</text>
<text>{{platformEnum[item.platformType]}}</text>
</view>
<view v-else class="des margin-top">
<text class="">全天通用</text>
<text>{{item.platformType==2?'美团核销':''}}</text>
<text>{{platformEnum[item.platformType]}}</text>
</view>
<view class="coupon-name margin-top">
<text class="text-gray">有效期限:</text>
......@@ -60,9 +65,11 @@
</template>
<script>
import {dictList} from "@/api/index.js";
import indexConfig from "@/config/index.config";
import FixedHeader from "@/components/fixedHeader/index";
import {getCouponList} from "@/api/coupon"
import {getDictItem} from "@/utils/tools.js"
export default {
data() {
......@@ -89,6 +96,8 @@
show:false,
listBlankImage:indexConfig.assetsPath+'/no_data_icon.png',
statusIndex: 0,
platformEnum:{},
couponSourceEnum:{},
statusList: [
{
label: "待使用",
......@@ -116,9 +125,28 @@
},
onLoad() {
this.onGetDicts();
this.onLoading();
},
methods: {
onGetDicts() {
let dicts = []
let dictStr = uni.getStorageSync('dicts')
if (dictStr) {
let dicts = JSON.parse(dictStr)
this.platformEnum = getDictItem(dicts, "consumer_coupon_platform_type");
this.couponSourceEnum = getDictItem(dicts, "consumer_coupon_source_type");
this.$forceUpdate()
}
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.platformEnum = getDictItem(dicts, "consumer_coupon_platform_type");
this.couponSourceEnum = getDictItem(dicts, "consumer_coupon_source_type");
this.$forceUpdate()
})
},
onLoading(){
getCouponList(this.queryParams).then(res=>{
if(res.data.code === 200 ){
......@@ -165,11 +193,12 @@
.coupon-item{
display: flex;
flex-direction: row;
width: 92%;
border-radius: 20upx;
width: 94%;
border-radius: 24upx;
background-color: #ffffff;
margin: 12upx 0;
padding: 30upx 20upx;
box-shadow: 0 0 12upx rgba(255, 0, 127, 0.23);
.part-left{
display: flex;
justify-content: center;
......
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