红绿项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

222 lines
4.7 KiB

<template>
<view class="content">
<view class="pro-head">
promotion
<view class="pro-hea-rig">
<image src="../../../static/promo/[email protected]" mode="aspectFit" class="img1"
@click="goInviteRule()"></image>
<image src="../../../static/promo/[email protected]" mode="aspectFit" class="img2"
@click="invMore=true,msShow=true"></image>
</view>
</view>
<view class="pro-body">
<view class="pro-body-p1">
bonus: <span class="category-sigh">{{currencySymbol}}</span><span
class="s1">{{inviteRule.bonusCapital}}</span>
</view>
<view class="pro-body-btn1" @click="appl=true,msShow=true">
Apply to balance
</view>
<view class="pro-body-lea">
<view class="lea-item" v-for="(item,index) in proLeav" :key="item.id" @click=" leaIdChange(index)">
<p :class="['p1', leaId==index?'on':'']">{{item.lea}}</p>
<p class="p2">{{item.lea2}}</p>
<p class="p3">{{item.leanum}}</p>
</view>
</view>
<view class="pro-body-code">
<view class="code-item1">
<p class="p1" ref="">My Promotion Code</p>
<p class="p2">{{inviteRule.inviteCode}}</p>
</view>
<view class="code-item1">
<p class="p1">My Promotion Link</p>
<p class="p2">{{copyText}}</p>
</view>
<view class="code-btn" @click="copyTextMethod()">
Copy
</view>
</view>
<cont></cont>
</view>
<view class="invite-more" v-show="invMore">
<view class="invite-con">
<view class="more-a" @click="goProRe">
promotion record
</view>
<view class="more-a" @click="goBouns">
bonus record
</view>
<view class="more-a" @click="applyRecord">
apply record
</view>
</view>
<view class="invite-con2">
<view class="more-a" @click="invMore=false,msShow=false">
cancel
</view>
</view>
</view>
<view class="appl_Ba" v-show="appl">
<view class="top">
<view class="title">
apply to balance
</view>
<view class="input">
<input type="text" value="" placeholder="bonus" v-model="tranAmt"
placeholder-style="color: #BFC2CCFF;font-size:28rpx;text-transform: capitalize" />
</view>
<view class="all" @click="applyAll()">
Apply all
</view>
</view>
<view class="btn_con">
<view class="btn1" @click="appl=false,msShow=false">
cancel
</view>
<view class="btn1 puple" @click="bountOut()">
confirm
</view>
</view>
</view>
<view class="msg-box-bg" v-show="msShow" @click="invMore=false,msShow=false,appl=false">
</view>
</view>
</template>
<script>
import cont from "@/components/cont/cont.vue"
import api from '@/utils/api'
export default {
data() {
return {
currencySymbol: '',
leaId: 0,
inviteRule: [],
tranAmt: '',
proLeav: [{
id: 0,
lea: 'level1',
lea2: 'Total people',
leanum: 0
},
{
id: 1,
lea: 'level2',
lea2: 'Contribution',
leanum: 0.00
},
],
copyText: '',
invMore: false,
appl: false,
msShow: false,
}
},
onLoad() {
const post = api.inviteCode({
"ticket": uni.getStorageSync('logInfo').data,
})
post.then(res => {
this.inviteRule = res.data;
this.copyText = this.inviteRule.qrcodeUrl;
console.log(res.data, 9999);
})
.catch(e => {
uni.showToast({
title: e,
icon: 'none',
duration: 2500
})
})
},
methods: {
goInviteRule() {
uni.navigateTo({
url: '../rule/inviteRule/index'
})
},
applyAll() {
this.tranAmt = this.inviteRule.bonusCapital;
},
bountOut() {
const post = api.bonusOut({
"ticket": uni.getStorageSync('logInfo').data,
"tranAmt": this.tranAmt,
})
post.then(res => {
if (res != undefined) {
if (res.success == true) {
uni.showToast({
title: 'Commission successfully transferred out to balance',
icon: 'success',
duration: 1500
})
} else {
uni.showToast({
title: res.data.errMsg,
icon: 'none',
duration: 1500
})
}
}
})
.catch(e => {
uni.showToast({
title: e,
icon: 'none',
duration: 2500
})
})
},
goProRe() {
uni.reLaunch({
url: './promotionRecord/index'
})
},
goBouns() {
uni.reLaunch({
url: './bounsRecord/index'
})
},
applyRecord() {
uni.reLaunch({
url: './applyRecord/index'
})
},
copyTextMethod() {
this.$copyText(this.copyText).then(res => {
uni.showToast({
title: 'Copy succeeded',
icon: 'success'
})
})
},
leaIdChange(index) {
this.leaId = index;
}
}
}
</script>
<style>
@import url("./index.css");
</style>