Forráskód Böngészése

feat:提现功能

zhanghui 2 éve
szülő
commit
6dd8dd4641

+ 43 - 8
common/js/service.js

@@ -3,6 +3,41 @@ import request from '../js/request.js';
 
 export default {
 
+    //	协议查询
+    aboutByType(data) {
+        return request({
+            url: '/system/openapi/getAboutByType',
+            method: 'GET',
+            data: data
+        })
+    },
+
+    // 提现记录
+    records(data) {
+    return request({
+        url: '/expand/wechat/withdraw/records',
+        method: 'POST',
+        data:data
+        })
+    },
+
+    // 提现
+    apply(data) {
+        return request({
+            url: '/expand/wechat/withdraw/apply',
+            method: 'POST',
+            data:data
+        })
+    },
+
+    // 查询今日是否能提现
+    canWithdraw() {
+        return request({
+            url: '/expand/wechat/canWithdraw',
+            method: 'GET'
+        })
+    },
+
     // 统计
     exStatistics(data) {
         return request({
@@ -26,7 +61,7 @@ export default {
         return request({
             url: '/resource/authentication/idCardAndName',
             method: 'GET',
-            data:data
+            data: data
 
         })
     },
@@ -35,7 +70,7 @@ export default {
         return request({
             url: '/member/wechat/getMyMemberList',
             method: 'GET',
-            data:data
+            data: data
 
         })
     },
@@ -44,7 +79,7 @@ export default {
         return request({
             url: '/member/wechat/getMyExpandAttacheList',
             method: 'GET',
-            data:data
+            data: data
 
         })
     },
@@ -54,7 +89,7 @@ export default {
         return request({
             url: '/member/wechat/getRecord',
             method: 'GET',
-            data:data
+            data: data
 
         })
     },
@@ -80,7 +115,7 @@ export default {
         return request({
             url: '/member/wechat/roleBindRule',
             method: 'POST',
-            data:param
+            data: param
         })
     },
 
@@ -89,7 +124,7 @@ export default {
         return request({
             url: '/member/wechat/cancelRoleBindRule',
             method: 'POST',
-            data:param
+            data: param
         })
     },
 
@@ -98,7 +133,7 @@ export default {
         return request({
             url: '/member/wechat/getRuleByRoleId',
             method: 'POST',
-            data:param
+            data: param
         })
     },
     //查询角色没有绑定的规则,拓客经理调用
@@ -106,7 +141,7 @@ export default {
         return request({
             url: '/member/wechat/getNewRules',
             method: 'POST',
-            data:param
+            data: param
         })
     },
     // get请求,获取手机验证码

+ 21 - 0
pages.json

@@ -155,6 +155,27 @@
 				"navigationBarTitleText" : "修改分组",
 				"enablePullDownRefresh" : false
 			}
+		},
+		{
+			"path" : "pages/withdraw/withdraw",
+			"style" :
+			{
+				"navigationBarTitleText" : "收益提现"
+			}
+		},
+		{
+			"path" : "pages/withdrawalRecord/withdrawalRecord",
+			"style" :
+			{
+				"navigationBarTitleText" : "提现记录"
+			}
+		},
+		{
+			"path" : "pages/agreement/agreement",
+			"style" : 
+			{
+				"navigationBarTitleText" : ""
+			}
 		}
 	],
 	"tabBar": {

+ 60 - 0
pages/agreement/agreement.vue

@@ -0,0 +1,60 @@
+<template>
+	<view class="page  flex-col" :style="{'height':height}">
+		<scroll-view scroll-y="true" class="scroll-y ">
+			<view class="content-box flex-col">
+				<!--				<web-view  src="http://www.gzqcdj.cn/doc/2.html"></web-view>-->
+				<rich-text v-html="name">
+				</rich-text>
+
+			</view>
+		</scroll-view>
+
+		<!--#ifdef H5-->
+		<liu-drag-button @clickBtn="back">返回</liu-drag-button>
+		<!--#endif-->
+	</view>
+</template>
+
+<script>
+	export default {
+
+		data() {
+			return {
+				name: '',
+				height: '',
+				type:''
+
+			};
+		},
+		mounted() {
+		},
+		onLoad(option) {
+			let sysInfo = uni.getSystemInfoSync();
+			this.height = sysInfo.windowHeight + 'px';
+			console.log("获取到的高度", this.height)
+			uni.setNavigationBarTitle({
+				title: option.name
+
+			})
+			this.type = option.type
+			this.aboutByType(this.type)
+		},
+
+		methods: {
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			aboutByType(type) {
+				this.$api.service.aboutByType({type:type}).then(res => {
+					this.name = res.data.data.aboutContent
+				})
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	@import './index.rpx.css';
+</style>

+ 9 - 0
pages/agreement/index.rpx.css

@@ -0,0 +1,9 @@
+.scroll-y{
+	height: 95%;
+	overflow: hidden;
+
+}
+.content-box {
+	text-indent:2rem;
+	padding: 20rpx 20rpx;
+}

+ 2 - 2
pages/earningsList/module/mescrollUni-item.vue

@@ -16,11 +16,11 @@
 					</view>
 					<view class="rightText flex-col">
 						<view class=" flex-row justify-between">
-							<text class="text1">{{item.description}}</text>
+							<text class="text1">{{item.description || item.remake}}</text>
 							<text class="text2" v-if="item.isAdd == '1'">{{item.amount}}</text>
 							<text class="text2" v-else>-{{item.amount}}</text>
 						</view>
-						<view class=" flex-row justify-between">
+						<view v-if="item.no" class=" flex-row justify-between">
 							<text class="text3">昵称:{{item.memberName}}</text>
 							<text class="text3">编号:{{item.no}}</text>
 						</view>

+ 1 - 0
pages/login/login.vue

@@ -169,6 +169,7 @@
 						this.requestStatus=false
 						uni.setStorageSync('accessToken', res.data.data.access_token)
 						this.$api.user.getUserInfo().then(res=>{
+							console.log('获取到的用户信息:',res.data.data,'获取到的用户头像',res.data.data.img)
 							if (res.data.data.img){
 								res.data.data.img = res.data.data.img.replace(/^http:/, "https:")
 							}

+ 4 - 0
pages/my/index.rpx.css

@@ -110,3 +110,7 @@
 	border-radius: 15rpx;
 	overflow: hidden;
 }
+.txbtn{
+	font-size: 26rpx;
+	color: #999999;
+}

+ 17 - 6
pages/my/my.vue

@@ -43,20 +43,23 @@
 				<view class="flex-row justify-center out ">
 					<view class="flex-col  statisticsItem "
 						@click="navigateTo('/pages/directPromotionList/directPromotionList')">
-						<view>
-							<image src="/static/my/fuwuTimeLong.png" class="statisticsImg"></image>
-						</view>
+<!--						<view>-->
+<!--							<image src="/static/my/fuwuTimeLong.png" class="statisticsImg"></image>-->
+<!--						</view>-->
 						<text class="statisticsKey">我的直推(人)</text>
 						<text class="statisticsValue">{{statistics.myMember}}</text>
 					</view>
 				</view>
 				<view class="flex-row justify-center out leftBorder">
 					<view class="flex-col statisticsItem " @click="navigateTo('/pages/earningsList/earningsList')">
-						<view>
-							<image src="/static/my/benyuerenwu.png" class="statisticsImg"></image>
-						</view>
+<!--						<view>-->
+<!--							<image src="/static/my/benyuerenwu.png" class="statisticsImg"></image>-->
+<!--						</view>-->
 						<text class="statisticsKey">推广收益(人)</text>
 						<text class="statisticsValue">{{statistics.myEarning}}</text>
+						<view v-if="isCanWithdraw" @click.stop="navigateTo('/pages/withdraw/withdraw')">
+							<text class="txbtn">去提现></text>
+						</view>
 					</view>
 				</view>
 			</view>
@@ -78,6 +81,7 @@
 	export default {
 		data() {
 			return {
+				isCanWithdraw:false,
 				staticsData: {},
 				userInfo: {},
 				height: '',
@@ -93,9 +97,16 @@
 			this.userInfo = uni.getStorageSync('spreadUserInfo')
 			// this.getImgUrlByOssId(this.userInfo.img)
 			this.exStatistics()
+			this.canWithdraw()
 		},
 
 		methods: {
+			canWithdraw(){
+				this.$api.service.canWithdraw().then(res=>{
+					console.log(res)
+					this.isCanWithdraw = res.data.data
+				})
+			},
 
 			exStatistics(){
 				this.$api.service.exStatistics().then(res=>{

+ 1 - 5
pages/userInfo/userInfo.vue

@@ -168,11 +168,7 @@
 				})
 
 			},
-			back() {
-				uni.navigateBack({
-					delta: 1
-				})
-			},
+
 			logout(){
 				this.$api.login.logout().then(res=>{
 					uni.removeStorageSync('accessToken');

+ 46 - 0
pages/withdraw/index.rpx.css

@@ -0,0 +1,46 @@
+.page{
+    height: 100vh;
+    background: #F9F9F9;
+    padding: 0 32rpx;
+}
+.read{
+    font-size: 28rpx;
+    color: #000000;
+    line-height: 40rpx;
+}
+.title{
+    position: relative;
+}
+.title1{
+    font-size: 35rpx;
+    line-height: 50rpx;
+}
+.title2{
+    font-size: 28rpx;
+    color: #000000;
+    line-height: 50rpx;
+    position: absolute;
+    right: 0;
+    top: 0;
+}
+.withdrawButton{
+    background: #FFE50C;
+    width: 686rpx;
+    height: 80rpx;
+    color: #000000;
+    text-align: center;
+    line-height: 80rpx;
+    font-size: 28rpx;
+    border-radius: 10rpx;
+}
+.marginTop{
+    margin-top: 24rpx;
+}
+.priceTitle{
+    font-size: 28rpx;
+}
+.price{
+    font-size: 60rpx;
+    font-weight: bold;
+
+}

+ 106 - 0
pages/withdraw/withdraw.vue

@@ -0,0 +1,106 @@
+<template>
+	<view class="page">
+		<view class="title flex-col">
+			<!--#ifdef H5-->
+			<view class="flex-row justify-center">
+				<text class="title1">收益提现</text>
+			</view>
+			<!--#endif-->
+			<text class="title2" @click="navigateTo('/pages/withdrawalRecord/withdrawalRecord')">提现记录</text>
+		</view>
+		<view class="flex-col justify-center" :style="{marginTop:'150rpx'}">
+			<view class="flex-row justify-center">
+				<text class="priceTitle">可提现金额</text>
+			</view>
+			<view class="flex-row justify-center marginTop">
+				<text class="price">{{statistics.myEarning}}</text>
+			</view>
+		</view>
+		<view class="flex-row justify-start ":style="{marginTop:'150rpx'}">
+			<checkbox-group @change="checkboxChange">
+				<checkbox :checked="checked"  color="#000000" :style="{'transform':'scale(0.7)'}"/>
+				<text class="read">请阅读并同意</text>
+				<text @click.stop="gotoTermOfService(8)" class="read">《娇骄儿拓客活动规则》</text>
+			</checkbox-group>
+		</view>
+
+
+		<view  class="flex-row justify-center marginTop">
+			<view class="withdrawButton" @click="apply">
+				<text>立即提现</text>
+			</view>
+		</view>
+
+
+		<!--#ifdef H5-->
+		<liu-drag-button @clickBtn="back">返回</liu-drag-button>
+		<!--#endif-->
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				checked:false,
+				statistics:{},
+
+			}
+		},
+		onShow() {
+			this.exStatistics()
+		},
+		methods: {
+
+			// 查看储值协议
+			gotoTermOfService(type){
+				uni.navigateTo({
+					url: '/pages/agreement/agreement?name='+'娇骄儿拓客活动规则'+'&type=' + 10,
+				})
+			},
+
+			apply(){
+				if (!this.checked){
+					uni.showToast({
+						icon: 'error',
+						duration: 3000,
+						title: '请同意《娇骄儿拓客活动规则》'
+					});
+					return
+				}
+				this.$api.service.apply({
+					amount:null
+				}).then(res=>{
+					uni.showToast({
+						icon: 'success',
+						duration: 3000,
+						title: '申请成功'
+					});
+				})
+			},
+
+			exStatistics(){
+				this.$api.service.exStatistics().then(res=>{
+					this.statistics = res.data.data
+				})
+			},
+			navigateTo(url) {
+				uni.navigateTo({
+					url: url
+				})
+			},
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			checkboxChange(){
+				this.checked = !this.checked
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import './index.rpx.css';
+</style>

+ 3 - 0
pages/withdrawalRecord/index.rpx.css

@@ -0,0 +1,3 @@
+.page{
+	padding: 0 24rpx;
+}

+ 61 - 0
pages/withdrawalRecord/module/index.rpx.css

@@ -0,0 +1,61 @@
+.item{
+    height: 156rpx;
+    border-bottom: 1px solid #EEEEEE;
+}
+.leftText{
+    width: 84rpx;
+    height: 84rpx;
+    text-align: center;
+    color: #FFFFFF;
+    line-height: 84rpx;
+    border-radius: 42rpx;
+    font-size: 24rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    margin-top: 32rpx ;
+}
+.rightText{
+    margin-top: 32rpx;
+    width: 590rpx;
+    padding: 0 20rpx;
+}
+.text1{
+    height: 44rpx;
+    font-size: 28rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #333333;
+    line-height: 44rpx;
+}
+
+.text2{
+    height: 44rpx;
+    font-size: 28rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    color: #ED569F;
+    line-height: 44rpx;
+}
+
+.text2_1{
+    height: 44rpx;
+    font-size: 28rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    color: #999999;
+    line-height: 44rpx;
+}
+.text3{
+    height: 40rpx;
+    font-size: 24rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #999999;
+    line-height: 40rpx;
+}
+.backColor1{
+    background: #ED569F;
+}
+.backColor2{
+    background: #93D21A;
+}
+.backColor3{
+    background: #FFAF36;
+}

+ 154 - 0
pages/withdrawalRecord/module/mescrollUni-item.vue

@@ -0,0 +1,154 @@
+<template>
+	<!--
+    swiper中的transfrom会使fixed失效,此时用height固定高度;
+    swiper中无法触发mescroll-mixins.js的onPageScroll和onReachBottom方法,只能用mescroll-uni,不能用mescroll-body
+    -->
+	<!-- ref动态生成: 字节跳动小程序编辑器不支持一个页面存在相同的ref (如不考虑字节跳动小程序可固定值为 ref="mescrollRef") -->
+	<!-- top的高度等于悬浮菜单tabs的高度 -->
+	<mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
+		:up="upOption" @up="upCallback" @emptyclick="emptyClick">
+		<view>
+			<view class="item" v-for="(item,index) in list" :key="index">
+				<view class="flex-row justify-between" @click="goOrderDetail(item)">
+
+					<view v-if="item.handleStatus == 0" class="rightText flex-col">
+						<view class=" flex-row justify-between">
+							<text class="text1">提出申请</text>
+							<text class="text2">{{item.handleStatusDesc}}</text>
+						</view>
+						<view class=" flex-row justify-between">
+							<text class="text3">{{item.createTime}}</text>
+						</view>
+					</view>
+					<view v-if="item.handleStatus == 1"  class="rightText flex-col">
+						<view class=" flex-row justify-between">
+							<text class="text1">提现金额:{{item.amount}}</text>
+							<text class="text2_1">{{item.handleStatusDesc}}</text>
+						</view>
+						<view class=" flex-row justify-between">
+							<text class="text3">{{item.createTime}}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+
+	</mescroll-uni>
+</template>
+
+<script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
+	export default {
+		mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
+		components: {
+		},
+
+		data() {
+			return {
+				downOption: {
+					auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
+				},
+				upOption: {
+					auto: false, // 不自动加载
+					// page: {
+					// 	num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+					// 	size: 10 // 每页数据的数量
+					// },
+					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
+					empty: {
+						icon: '/static/dataNull.png',
+						tip: '暂无内容', // 提示
+						// btnText: '去看看'
+					},
+					textNoMore: '没有更多了'
+				},
+				list:[],
+			}
+		},
+		props: {
+			i: Number, // 每个tab页的专属下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+			index: { // 当前tab的下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+				type: Number,
+				default () {
+					return 0
+				}
+			},
+
+			height: [Number, String], // mescroll的高度
+
+		},
+		watch:{
+
+		},
+
+		created(){
+
+
+		},
+
+		methods: {
+
+
+			/*下拉刷新的回调 */
+			downCallback() {
+				// 这里加载你想下拉刷新的数据, 比如刷新轮播数据
+				// loadSwiper();
+				// 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
+				this.mescroll.resetUpScroll()
+			},
+			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
+			upCallback(page) {
+
+				//联网加载数据
+				let httpData = {
+					pageNum:page.num,
+					pageSize:10,
+					orderByColumn:'createTime',
+					isAsc:'desc'
+				}
+
+				this.$api.service.records(httpData).then((res) => {
+					console.log(res)
+					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+					this.mescroll.endSuccess(res.data.rows.length,res.data.rows.length === 10);
+					//设置列表数据
+					if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
+					this.list = this.list.concat(res.data.rows); //追加新数据
+					console.log(this.list)
+				}).catch((err) => {
+					//联网失败, 结束加载
+					this.mescroll.endErr();
+				})
+
+
+			},
+
+			//点击空布局按钮的回调
+			emptyClick() {
+				uni.showToast({
+					title: '点击了按钮,具体逻辑自行实现'
+				})
+			},
+			// 搜索
+			doSearch() {
+				this.list = []; // 先清空列表,显示加载进度
+				this.mescroll.resetUpScroll();
+			},
+
+
+
+
+			goOrderDetail(item){
+				uni.navigateTo({
+					url:'/myPages/transactionRecordDetail/index?item='+JSON.stringify(item)
+				})
+			},
+		}
+	}
+</script>
+<style scoped>
+	@import '/common/css/common.css';
+	@import './index.rpx.css';
+
+</style>

+ 41 - 0
pages/withdrawalRecord/withdrawalRecord.vue

@@ -0,0 +1,41 @@
+<template>
+	<view class="page">
+		<view :style="{height:height}" class="list">
+			<mescroll-item ref="MescrollItem" :i="0"  :index="0"  :height="height">
+			</mescroll-item>
+		</view>
+		<!--#ifdef H5-->
+		<liu-drag-button @clickBtn="back">返回</liu-drag-button>
+		<!--#endif-->
+	</view>
+</template>
+
+<script>
+	import MescrollItem from "./module/mescrollUni-item.vue";
+	export default {
+		components: {
+			MescrollItem
+		},
+		data() {
+			return {
+				height:''
+
+			}
+		},
+		onLoad(e) {
+			let sysInfo = uni.getSystemInfoSync()
+			this.height = sysInfo.windowHeight  - 70 + 'px' //除标题栏栏外的屏幕可用高度
+		},
+		methods: {
+			back() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import './index.rpx.css';
+</style>