Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
6 years ago
Commit
25e490f62f67b75d70afe262188b2cd07dd37c2b
1 parent
3448905f
api
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
19 deletions
apps/pages/single/coupon/components/exchange-box/exchage-box.vue
apps/pages/single/coupon/yoho/list.vue
apps/store/coupon/list/actions.js
apps/pages/single/coupon/components/exchange-box/exchage-box.vue
View file @
25e490f
<template>
<div class="exchange-box">
<
CubuInput :value="code" placeholder="请输入优惠券码" :clearable="inputOption"></CubuInput
>
<
input type="text" name="couponCodeInput" placeholder="请输入优惠券码" v-model="code"
>
<button :class="btnCls" @click="onClick">兑换</button>
</div>
</template>
<script>
import {Input} from 'cube-ui';
<script>
export default {
name: 'ExchangeBox',
data() {
return {
code: '',
inputOption: {
visible: true,
blurHidden: false
}
code: ''
};
},
methods: {
onClick() {
this.$emit('click');
},
onCodeInput(e) {
this.code += e.data;
this.$emit('input', this.code);
}
},
computed: {
btnCls() {
...
...
@@ -35,8 +27,10 @@ export default {
}];
}
},
components: {
CubuInput: Input
watch: {
code() {
this.$emit('input', this.code);
}
}
};
</script>
...
...
@@ -51,7 +45,7 @@ export default {
left: 0;
z-index: 2;
.code
{
input
{
width: 570px;
height: 60px;
margin-right: 12px;
...
...
apps/pages/single/coupon/yoho/list.vue
View file @
25e490f
...
...
@@ -51,7 +51,7 @@
<script>
import {createNamespacedHelpers} from 'vuex';
const {mapState} = createNamespacedHelpers('coupon/yoho');
const {mapState
, mapActions
} = createNamespacedHelpers('coupon/yoho');
import Tabs from '../components/tabs';
import FilterBar from '../components/filter-bar';
...
...
@@ -98,7 +98,7 @@ export default {
}
],
scrollOptions: {
directionLockThreshold: 0
directionLockThreshold: 0
,
},
slideOptions: {
listenScroll: true,
...
...
@@ -123,6 +123,7 @@ export default {
this.getNum();
},
methods: {
...mapActions(['getCouponCode']),
changePage(current) {
const tab = this.tabLabels[current];
...
...
@@ -149,7 +150,19 @@ export default {
this.$refs.tabs.showFilter = false;
},
onSubmitCode() {
this.getCouponCode({code: this.inputCouponCode}).then(result => {
if (result.code === 200) {
this.$createToast({
txt: result.message,
type: 'correct'
});
} else {
this.$createToast({
txt: result.message,
type: 'error'
});
}
});
}
},
watch: {
...
...
apps/store/coupon/list/actions.js
View file @
25e490f
...
...
@@ -73,7 +73,7 @@ export default {
async
getCouponCode
({
commit
},
{
code
})
{
commit
(
Types
.
FETCH_YOHO_COUPON_REQUEST
);
const
result
=
await
this
.
$api
.
post
(
'/api/coupon/yoho/'
,
{
const
result
=
await
this
.
$api
.
post
(
'/api/coupon/yoho/
getcoupon
'
,
{
coupon_code
:
code
});
...
...
Please
register
or
login
to post a comment