Commit ae7d46f5 by zhangzhen

细节优化

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