Commit 60755f0c by zhangzhen

细节优化

parent ae7d46f5
...@@ -66,10 +66,11 @@ ...@@ -66,10 +66,11 @@
<script> <script>
import {dictList} from "@/api/index.js"; import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.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() {
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
<text class="text-black">可用时段:</text> <text class="text-black">可用时段:</text>
<text class="text-black">{{item.couponTimeStart}}-{{item.couponTimeEnd}}</text> <text class="text-black">{{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> </view>
...@@ -62,12 +62,12 @@ ...@@ -62,12 +62,12 @@
</template> </template>
<script> <script>
import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js"
import config from "@/config/index.config" import config from "@/config/index.config"
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 { import {getUseCoupon} from "@/api/coupon"
getUseCoupon
} from "@/api/coupon"
export default { export default {
data() { data() {
...@@ -90,13 +90,15 @@ ...@@ -90,13 +90,15 @@
tipText: "", tipText: "",
show: false, show: false,
eventChannel: null, eventChannel: null,
selectId: '' selectId: '',
platformEnum:{}
}; };
}, },
components: { components: {
'fixed-header': FixedHeader 'fixed-header': FixedHeader
}, },
onLoad() { onLoad() {
this.onGetDicts();
this.eventChannel = this.getOpenerEventChannel(); this.eventChannel = this.getOpenerEventChannel();
// eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'}); // eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'});
...@@ -106,6 +108,24 @@ ...@@ -106,6 +108,24 @@
}) })
}, },
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(d) { onLoading(d) {
getUseCoupon(d).then(res => { getUseCoupon(d).then(res => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
......
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