|
|
|
@ -8,19 +8,19 @@ |
|
|
|
|
<view class='nav acea-row'> |
|
|
|
|
<view class='item'> |
|
|
|
|
<view>当前惠通宝/个</view> |
|
|
|
|
<view class='num'>{{userInfo.integral || 0}}</view> |
|
|
|
|
<view class='num'>{{huitong || 0}}</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class='item'> |
|
|
|
|
<view>冻结惠通宝/个</view> |
|
|
|
|
<view class='num'>{{userInfo.lockIntegral || 0}}</view> |
|
|
|
|
<view class='num'>{{huitong_frozen || 0}}</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class='item'> |
|
|
|
|
<!-- <view class='item'> |
|
|
|
|
<view>当前惠通宝市值/消费积分</view> |
|
|
|
|
<view class='num'>{{userInfo.lockIntegral || 0}}</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- <view class='item'> |
|
|
|
|
<view class='num'>{{userInfo.totalGainIntegral || 0}}</view> |
|
|
|
|
<view>累计积分</view> |
|
|
|
@ -40,6 +40,12 @@ |
|
|
|
|
<view class='item acea-row row-center-wrapper' :class='current==index?"on":""' v-for="(item,index) in navList" :key='index' |
|
|
|
|
@click='nav(index)'><text class='iconfont' :class="item.icon"></text>{{item.name}}</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="zhuanrang"> |
|
|
|
|
<text>惠通宝兑换消费积分</text> |
|
|
|
|
<view class="zhuanrangBtn" @click="show1 = true"> |
|
|
|
|
立即兑换 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="zhuanrang"> |
|
|
|
|
<text>惠通宝转让</text> |
|
|
|
|
<view class="zhuanrangBtn" @click="show = true"> |
|
|
|
@ -55,11 +61,11 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class='item acea-row row-between-wrapper' v-for="(item,index) in integralList" :key="index"> |
|
|
|
|
<view> |
|
|
|
|
<view class='state'>{{item.mark}}</view> |
|
|
|
|
<view class='state'>{{item.type}}</view> |
|
|
|
|
<view>{{item.create_time}}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class='num p-color' v-if="item.pm">+{{item.number}}</view> |
|
|
|
|
<view class='num' v-else>-{{item.number}}</view> |
|
|
|
|
<view class='num p-color' v-if="item.count.indexOf('-')==-1">{{item.count}}</view> |
|
|
|
|
<view class='num' v-if="item.count.indexOf('-')!=-1">{{item.count}}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class='loadingicon acea-row row-center-wrapper' v-if="integralList.length>0"> |
|
|
|
|
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}} |
|
|
|
@ -88,7 +94,7 @@ |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="instructions" v-if="showProtocol"> |
|
|
|
|
<!-- <view class="instructions" v-if="showProtocol"> |
|
|
|
|
<view class="setAgCount"> |
|
|
|
|
<i class="icon iconfont icon-cha" @click="showProtocol = false"></i> |
|
|
|
|
<div class="title">积分说明</div> |
|
|
|
@ -96,40 +102,83 @@ |
|
|
|
|
<jyf-parser :html="protocol" ref="article" :tag-style="tagStyle"></jyf-parser> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<u-popup :show="show"> |
|
|
|
|
</view> --> |
|
|
|
|
<u-popup :show="show1" @close="show1=false"> |
|
|
|
|
<view class="popContent"> |
|
|
|
|
<view class="popTitle" style="display: flex;justify-content: space-between;"> |
|
|
|
|
<text>惠通宝:消费积分比值</text> |
|
|
|
|
<text>{{huitongToConsume}}:1</text> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="popTitle" style="margin-top:29rpx;"> |
|
|
|
|
兑换消费积分 |
|
|
|
|
</view> |
|
|
|
|
<u--input |
|
|
|
|
placeholder="请输入兑换消费积分" |
|
|
|
|
border="surround" |
|
|
|
|
type="number" |
|
|
|
|
v-model="huitongToConsumeNum" |
|
|
|
|
></u--input> |
|
|
|
|
<view class="popTitle" style="margin-top: 15px;display: flex;justify-content: space-between;"> |
|
|
|
|
<text>需支付惠通宝</text> |
|
|
|
|
<text>{{huitongToConsumeNum?Math.ceil((huitongToConsumeNum*huitongToConsume)):0}}</text> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="submitBtn" @click="changeConsume"> |
|
|
|
|
立即兑换 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</u-popup> |
|
|
|
|
<u-popup :show="show" @close="show=false"> |
|
|
|
|
<view class="popContent"> |
|
|
|
|
<view class="popTitle"> |
|
|
|
|
转让惠通宝数量 |
|
|
|
|
</view> |
|
|
|
|
<u--input |
|
|
|
|
placeholder="请输入转让数量" |
|
|
|
|
type="digit" |
|
|
|
|
border="surround" |
|
|
|
|
v-model="zhuanrang.count" |
|
|
|
|
></u--input> |
|
|
|
|
<view class="popTitle" style="margin-top:29rpx;"> |
|
|
|
|
收款人注册手机号 |
|
|
|
|
</view> |
|
|
|
|
<u--input |
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
placeholder="请输入收款人注册手机号" |
|
|
|
|
border="surround" |
|
|
|
|
v-model="value" |
|
|
|
|
@change="change" |
|
|
|
|
type="number" |
|
|
|
|
v-model="zhuanrang.phoneTo" |
|
|
|
|
></u--input> |
|
|
|
|
<view class="popTitle" style="margin-top:29rpx;"> |
|
|
|
|
转让人手机验证码 |
|
|
|
|
</view> |
|
|
|
|
<view class="code"> |
|
|
|
|
<u--input |
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
placeholder="请输入验证码" |
|
|
|
|
border="surround" |
|
|
|
|
v-model="value" |
|
|
|
|
@change="change" |
|
|
|
|
v-model="zhuanrang.smsCode" |
|
|
|
|
></u--input> |
|
|
|
|
<text>获取验证码</text> |
|
|
|
|
<!-- <text @click="getCode">获取验证码</text> --> |
|
|
|
|
<button v-debounce class="codeText" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="getCode"> |
|
|
|
|
{{ text }} |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
|
<view class="submitBtn"> |
|
|
|
|
<view class="submitBtn" @click="submitHandle"> |
|
|
|
|
确定 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify> |
|
|
|
|
</u-popup> |
|
|
|
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import sendVerifyCode from "@/mixins/SendVerifyCode"; |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
@ -139,32 +188,36 @@ |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
// | Author: CRMEB Team <admin@crmeb.com> |
|
|
|
|
// +---------------------------------------------------------------------- |
|
|
|
|
import { getIntegralInfo, getIntegralList, getAgreementApi } from '@/api/user.js'; |
|
|
|
|
import { getIntegralInfo, getassetsLog, getAgreementApi,huitongToConsume,getUserInfo,registerVerify,changeHuitong,getConfig} from '@/api/user.js'; |
|
|
|
|
import { |
|
|
|
|
mapGetters |
|
|
|
|
} from "vuex"; |
|
|
|
|
import authorize from '@/components/Authorize'; |
|
|
|
|
import emptyPage from '@/components/emptyPage.vue'; |
|
|
|
|
import Verify from '@/components/verify/verify.vue'; |
|
|
|
|
import parser from "@/components/jyf-parser/jyf-parser"; |
|
|
|
|
const app = getApp(); |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
authorize, |
|
|
|
|
emptyPage, |
|
|
|
|
Verify, |
|
|
|
|
"jyf-parser": parser, |
|
|
|
|
}, |
|
|
|
|
mixins: [sendVerifyCode], |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
show:false, |
|
|
|
|
navList: [{ |
|
|
|
|
'name': '分值明细', |
|
|
|
|
'icon': 'icon-mingxi' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'name': '分值提升', |
|
|
|
|
'icon': 'icon-tishengfenzhi' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
show1:false, |
|
|
|
|
// navList: [{ |
|
|
|
|
// 'name': '分值明细', |
|
|
|
|
// 'icon': 'icon-mingxi' |
|
|
|
|
// }, |
|
|
|
|
// { |
|
|
|
|
// 'name': '分值提升', |
|
|
|
|
// 'icon': 'icon-tishengfenzhi' |
|
|
|
|
// } |
|
|
|
|
// ], |
|
|
|
|
current: 0, |
|
|
|
|
page: 1, |
|
|
|
|
limit: 10, |
|
|
|
@ -182,6 +235,16 @@ |
|
|
|
|
video: 'width:100%;' |
|
|
|
|
}, |
|
|
|
|
integral_status: true, |
|
|
|
|
huitong:0, |
|
|
|
|
huitong_frozen:0, |
|
|
|
|
zhuanrang:{ |
|
|
|
|
count:0, |
|
|
|
|
phoneTo:null, |
|
|
|
|
smsCode:null, |
|
|
|
|
type:'huitong', |
|
|
|
|
}, |
|
|
|
|
huitongToConsume:1, |
|
|
|
|
huitongToConsumeNum:0 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: mapGetters(['isLogin','viewColor']), |
|
|
|
@ -193,6 +256,10 @@ |
|
|
|
|
this.isShowAuth = true |
|
|
|
|
} |
|
|
|
|
this.getAgreement(); |
|
|
|
|
getConfig().then(res=>{ |
|
|
|
|
this.huitongToConsume = res.data?res.data.huitongToConsume:1 |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -202,6 +269,137 @@ |
|
|
|
|
this.getIntegralList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
changeConsume(){ |
|
|
|
|
if(this.huitongToConsumeNum==0){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '兑换数量需大于0', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(Math.ceil((this.huitongToConsumeNum*this.huitongToConsume))>this.huitong){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '惠通宝不足', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
huitongToConsume({count:this.huitongToConsumeNum}).then(res=>{ |
|
|
|
|
|
|
|
|
|
if(res.status==200){ |
|
|
|
|
this.getUserInfo() |
|
|
|
|
this.show1 = false; |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.$util.Tips({ |
|
|
|
|
title: res |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
submitHandle(){ |
|
|
|
|
if(this.zhuanrang.count==0){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '转让数量需大于0', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(this.zhuanrang.count>this.huitong){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '惠通宝不足', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(!this.zhuanrang.phoneTo){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入收款人注册手机号', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const regex =/^1(3|4|5|7|8|9|6)\d{9}$/i; |
|
|
|
|
|
|
|
|
|
if(!regex.test(this.zhuanrang.phoneTo)){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的手机号', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!this.zhuanrang.smsCode){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入验证码', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
changeHuitong(this.zhuanrang).then(res=>{ |
|
|
|
|
|
|
|
|
|
if(res.status==200){ |
|
|
|
|
this.getUserInfo() |
|
|
|
|
this.show = false; |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.$util.Tips({ |
|
|
|
|
title: res |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
success(data) { |
|
|
|
|
this.$refs.verify.hide(); |
|
|
|
|
this.code(data); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
async getCode(data) { |
|
|
|
|
let that = this; |
|
|
|
|
if(!this.zhuanrang.phoneTo){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入收款人注册手机号', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const regex =/^1(3|4|5|7|8|9|6)\d{9}$/i; |
|
|
|
|
|
|
|
|
|
if(!regex.test(this.zhuanrang.phoneTo)){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的手机号', |
|
|
|
|
icon:'none' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$refs.verify.show(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
async code(data) { |
|
|
|
|
let that = this; |
|
|
|
|
// if (that.formItem == 2) that.type = "register"; |
|
|
|
|
await registerVerify({ |
|
|
|
|
phone: this.zhuanrang.phoneTo, |
|
|
|
|
type: 'huitong', |
|
|
|
|
key: "", |
|
|
|
|
// code: that.codeVal, |
|
|
|
|
toke:data.token, |
|
|
|
|
captchaType: 'blockPuzzle', |
|
|
|
|
captchaVerification: data.captchaVerification |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
that.$util.Tips({ |
|
|
|
|
title: res.message |
|
|
|
|
}); |
|
|
|
|
that.sendCode(); |
|
|
|
|
}) |
|
|
|
|
.catch(res => { |
|
|
|
|
that.$util.Tips({ |
|
|
|
|
title: res |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 授权回调 |
|
|
|
|
*/ |
|
|
|
@ -213,17 +411,23 @@ |
|
|
|
|
authColse: function(e) { |
|
|
|
|
this.isShowAuth = e |
|
|
|
|
}, |
|
|
|
|
getUserInfo: function() { |
|
|
|
|
getUserInfo() { |
|
|
|
|
let that = this; |
|
|
|
|
getIntegralInfo().then(function(res) { |
|
|
|
|
that.$set(that,'userInfo',res.data); |
|
|
|
|
that.getIntegralList() |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.integral_status = false |
|
|
|
|
return that.$util.Tips({ |
|
|
|
|
title: res |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
getUserInfo().then((res)=>{ |
|
|
|
|
this.huitong = res.data.assets.huitong |
|
|
|
|
this.huitong_frozen = res.data.assets.huitong_frozen; |
|
|
|
|
this.getIntegralList() |
|
|
|
|
// getIntegralInfo().then(function(res) { |
|
|
|
|
// that.$set(that,'userInfo',res.data); |
|
|
|
|
// that.getIntegralList() |
|
|
|
|
// }).catch(res => { |
|
|
|
|
// this.integral_status = false |
|
|
|
|
// return that.$util.Tips({ |
|
|
|
|
// title: res |
|
|
|
|
// }); |
|
|
|
|
// }); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
/*获取积分说明*/ |
|
|
|
|
getAgreement() { |
|
|
|
@ -241,9 +445,10 @@ |
|
|
|
|
if (that.loadend) return; |
|
|
|
|
that.loading = true; |
|
|
|
|
that.loadTitle = ''; |
|
|
|
|
getIntegralList({ |
|
|
|
|
getassetsLog({ |
|
|
|
|
page: that.page, |
|
|
|
|
limit: that.limit |
|
|
|
|
limit: that.limit, |
|
|
|
|
asset_type:4 |
|
|
|
|
}).then(function(res) { |
|
|
|
|
let list = res.data.list, |
|
|
|
|
loadend = list.length < that.limit; |
|
|
|
@ -583,7 +788,7 @@ |
|
|
|
|
.code{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
text{ |
|
|
|
|
.codeText{ |
|
|
|
|
|
|
|
|
|
font-family: Alibaba PuHuiTi; |
|
|
|
|
font-weight: 400; |
|
|
|
|