|
@@ -82,7 +82,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts">
|
|
|
+<script>
|
|
|
import { defineComponent } from 'vue'
|
|
|
import { string } from 'yup'
|
|
|
import { inviteFriends, getInviteRewards } from '@/service/user'
|
|
@@ -94,22 +94,25 @@ export default defineComponent({
|
|
|
name: 'InviteFriends',
|
|
|
async beforeRouteEnter(to, from, next) {
|
|
|
const { results } = await getInviteRewards()
|
|
|
- next((vm: any) => (vm.awards = results))
|
|
|
+ next(vm => (vm.awards = results))
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
emails: '',
|
|
|
- awards: [] as any[],
|
|
|
+ /** @type {any[]} */
|
|
|
+ awards: [],
|
|
|
inviteUrl:
|
|
|
location.origin +
|
|
|
'/fill-order?from=member&invitee=' +
|
|
|
- state.userInfo!.id,
|
|
|
+ state.userInfo.id,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
totalAmount() {
|
|
|
- // @ts-ignore
|
|
|
- return this.awards.reduce((sum, award) => sum + award.gift_card_amount, 0)
|
|
|
+ return this.awards.reduce(
|
|
|
+ (sum, award) => sum + +award.gift_card_amount,
|
|
|
+ 0
|
|
|
+ )
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
@@ -127,7 +130,7 @@ export default defineComponent({
|
|
|
Toast(err.message)
|
|
|
}
|
|
|
},
|
|
|
- copy(content: string) {
|
|
|
+ copy(content) {
|
|
|
copy(content)
|
|
|
Toast('copy success')
|
|
|
},
|