wangfukang 4 weeks ago
parent
commit
7549b34b18
  1. 222
      package1/myCenter/wallet.vue

222
package1/myCenter/wallet.vue

@ -12,72 +12,82 @@
</view>
</view>
<view class="content">
<view style="width: 100%;height: 100px;border: 1px solid red;">
<view style="width: 100%;height: 100px;border: 1px solid red;" @tap="chooseLinkId('user')">
<view>用户余额()</view>
<view>268.50</view>
<view>{{balanceUser.depoBal}}</view>
<view>
钱包安全保障中
</view>
<view @tap="withDraw" class="">
<view @tap.stop="userCommion('user',balanceUser.depoBal)" class="">
提现
</view>
</view>
<view style="display: flex;">
<view style="flex: 1;border: 1px solid green;height: 80px;">
<view>配送兼职佣金()</view>
<view>156.80</view>
</view>
<view style="flex: 1;border: 1px solid orange;height: 80px;">
<view>店铺余额()</view>
<view>111.70</view>
<view @tap="$refs.shopPopup.open()" >
筛选
<view style="flex: 1;border: 1px solid green;height: 80px;" @tap="chooseLinkId('worker')">
<view>配送今日佣金()</view>
<view>{{balanceWorker.depoBal}}</view>
<view>配送可提现余额)</view>
<view>{{balanceWorker.depoBalRel}}</view>
<view @tap.stop="userCommion('worker',balanceWorker.depoBalRel)" class="">
提现
</view>
</view>
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
:interval="interval" :duration="duration">
<swiper-item @tap="chooseLinkId('shop',item)" v-for="(item,index) in balanceShop" :key="index">
<view style="flex: 1;border: 1px solid orange;height: 80px;">
<view>{{item.shopName}}余额()</view>
<view>{{item.balance}}</view>
<view @tap.stop="userCommion('shop',item.balance,item)" class="">
提现
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="">
<view class="" style="display: flex;height: 30px;line-height: 30px;">
<view class="" style="flex:1;">
余额明细
</view>
<view class="" style="flex:1;">
筛选全部
</view>
</view>
<view class="" style="display: flex;text-align: center;height: 80px;border: 1px solid #000;">
<view class="" style="display: flex;text-align: center;height: 80px;border: 1px solid #000;" v-for="(item,index) in rewardLists" :key="index">
<view style="flex: 1;text-align: left;">
<img src="/static/images/dingdan/dd0.png" alt="" style="width: 50px;height: 50px;background-size: 100%;">
</view>
<view class="" style="flex: 1;">
<view class="">
配送兼职收入
</view>
<view class="">
订单号:#8257461
{{item.dealingsWay}}
</view>
</view>
<view class="" style="flex: 1;">
<view class="">
-23.50
{{item.amount}}
</view>
<view class="">
05-20 18:30
{{item.createTime}}
</view>
</view>
</view>
<uni-load-more :status="loadStatus" />
</view>
</view>
<uni-popup ref="shopPopup" type="bottom" background-color="#F5F8F5">
<view style="width: 100%; height: 800rpx; display: flex; flex-direction: column;">
<view style="height: 100rpx; line-height: 100rpx; text-align: center; font-size: 32rpx; font-weight: bold; border-bottom: 1px solid #eee; position: relative; background: #fff;">
选择店铺
<uni-icons type="closeempty" size="24" @tap="$refs.couponPopup.close()" style="position: absolute; right: 30rpx; top: 0;"></uni-icons>
</view>
<view class="">
<view>我的店铺一</view>
<view>我的店铺二</view>
</view>
<!-- 出层 -->
<uni-popup ref="payPopup" background-color="#fff">
<text style="color: #777; font-weight: normal; margin-right: 10rpx; font-size: 24rpx;">支付宝实名</text>
<input type="text" v-model="aliName"
style="width: 140rpx; border-bottom: 1px solid #ccc; text-align: center; font-size: 28rpx; font-weight: normal; height: 50rpx; min-height: 50rpx;"
placeholder="名称" />
<text style="color: #777; font-weight: normal; margin-right: 10rpx; font-size: 24rpx;">支付宝认证手机号</text>
<input type="digit" v-model="aliAccount"
style="width: 140rpx; border-bottom: 1px solid #ccc; text-align: center; font-size: 28rpx; font-weight: normal; height: 50rpx; min-height: 50rpx;"
placeholder="手机号" />
<text style="color: #777; font-weight: normal; margin-right: 10rpx; font-size: 24rpx;">提现金额</text>
<input type="digit" v-model="commionAmount"
style="width: 140rpx; border-bottom: 1px solid #ccc; text-align: center; font-size: 28rpx; font-weight: normal; height: 50rpx; min-height: 50rpx;"
placeholder="金额" />
<view class="btn" style="background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));width: 90%;height: 100rpx;border-radius: 100rpx;text-align: center;font-size: 28rpx;font-weight: 700;line-height: 100rpx;margin: 40rpx auto;" @tap="wxPayment">
确认提现
</view>
</uni-popup>
</view>
@ -88,6 +98,27 @@
data() {
return {
menuButtonInfo: {},
balanceUser:{},
loadStatus: 'more',
balanceWorker:{},
rewardLists:[],
aliName:'',
aliAccount:'',
commionType:'',
shopId:'',
searchForm:{
pageNum:1,
pageSize:10
},
indicatorDots: false,
interval: 4000,
onlineWorkerInterval:4000,
totalPages: 1,
commionUrl:'',
commionAmount:0,
linkId:'',
autoplay: true,
balanceShop:[],
}
},
onLoad(option) {
@ -95,14 +126,117 @@
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.balanceUser = 0
this.balanceWorker = 0
this.balanceShop = 0
this.beginData();
},
onReachBottom() {
if (this.searchForm.pageNum >= this.totalPages) return;
// this.status = 'loading';
this.searchForm.pageNum+=1;
this.rewardList();
},
methods: {
beginData(){
this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.user){
this.balanceUser = res.result.user
this.linkId = res.result.user.id
this.rewardList()
}
if(res.result.worker){
this.balanceWorker = res.result.worker
}
if(res.result.shop){
this.balanceShop = res.result.shop
}
that.$forceUpdate();
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
//
withDraw(){
uni.showToast({
title:'提现成功'
})
},
userCommion(type,commion,item){
if(type=='user'){
this.commionUrl = '/app/returnCommission/handleReturnUser'
}else if(type=='worker'){
this.commionUrl = '/app/returnCommission/handleReturnWorker'
}else{
this.commionUrl = '/app/returnCommission/handleReturn'
this.shopId = item.id
}
this.commionAmount = commion
this.commionType = type
this.$refs.payPopup.open();
},
wxPayment(){
let that = this
let data = {
commission:this.commionAmount,
aliName:this.aliName,
aliAccount:this.aliAccount
}
if(this.commionType == 'user'){
data.userId = this.balanceUser.id
}else if(this.commionType == 'worker'){
data.workerId = this.balanceWorker.id
}else{
data.shopId = this.shopId
}
that.tui.request(this.commionUrl, "POST", data, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
this.$refs.payPopup.close();
this.beginData();
} else {
that.tui.toast(res.message,1000)
return
}
uni.hideLoading()
}).catch((res) => {})
},
chooseLinkId(type,item){
if(type == 'user'){
this.linkId = this.balanceUser.id
}else if(type == 'worker'){
this.linkId = this.balanceWorker.workerId
}else{
this.linkId = item.id
}
this.rewardList();
},
rewardList(){
this.loadStatus = 'loading'
let that = this
this.searchForm.linkUserId = this.linkId;
that.tui.request("/mall/coupon/selectRewardByRegionId", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
that.totalPages = res.result.pages
if (that.searchForm.pageNum == 1) {
that.rewardLists = res.result.records
} else {
that.rewardLists = [...that.rewardLists, ...res.result.records]
}
that.$forceUpdate()
} else {
that.tui.toast(res.message,1000)
return
}
uni.hideLoading()
}).catch((res) => {})
},
back() {
uni.navigateBack()
}
@ -159,4 +293,26 @@
flex: 1;
text-align: center;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-page {
width: 100%;
height: 100%;
}
.swiper {
width: 100%;
height: 500rpx;
z-index: 99 !important;
}
.swiper img {
width: 100%;
height: 100%;
z-index: 99 !important;
}
</style>
Loading…
Cancel
Save