Browse Source

feat(controller): 优化UI

xiansin 3 năm trước cách đây
mục cha
commit
24a42e32ab

+ 14 - 0
App.vue

xqd
@@ -3,6 +3,20 @@
         globalData() {
         },
 		onLaunch(options) {
+            let userToken = this.vuex_user_token;
+            let notLogin = [
+                'pages/login/login',
+            ];
+            if(!userToken && (notLogin.indexOf(options.path) === -1)){
+                let arr = [];
+                for (const key in options.query) {
+                    arr.push(`${key}=${options.query[key]}`)
+                }
+                this.$jump({
+                    url: `/pages/login/login?redirect=${options.path}&${arr.join("&")}`,
+                    type: 'redirect',
+                });
+            }
 		},
         onShow(options){
             console.log('app show -->')

+ 0 - 30
components/app-layout.vue

xqd
@@ -14,40 +14,10 @@
             }
         },
         methods: {
-            login(){
-                uni.login({
-                    provider: 'weixin',
-                    success: res => {
-                        console.log('-->data',res)
-                        uni.getUserInfo({
-                            provider: 'weixin',
-                            success: data =>  {
-                                let params = {
-                                    code: res.code,
-                                    encryptedData: data.encryptedData,
-                                    iv:data.iv,
-                                    signature:data.signature
-                                }
-                                this.$u.api.login(params).then(loginRes => {
-                                    this.$u.vuex(this.$const.USER_TOKEN,loginRes.token)
-                                    this.$u.vuex(this.$const.USER_DATA,loginRes.user)
-                                })
-                            }
-                        });
-                    }
-                });
-            },
             handleConfirmBuy(){
                 this.$jump({url:'/pages/my/member',type:'to'})
             }
         },
-        created(){
-            if(!this.vuex_user_token){
-                this.login()
-            }
-        },
-        computed:{
-        }
     }
 </script>
 

+ 24 - 2
core/apiList.js

xqd
@@ -2,8 +2,30 @@
  * Created by JianJia.Zhou<jianjia.zhou> on 2021/3/17.
  */
 module.exports = {
+    // 登录
     login: '/passport/login',
-    userGet: '/user/get',
-    memberRecord: '/user/memberRecord',
+    // 设置
     settingGet: '/setting/get',
+
+    // 购买会员记录
+    memberRecord: '/user/memberRecord',
+    // 用户信息
+    userGet: '/user/get',
+    // 用户余额
+    userOverage: '/user/overage',
+    // 用户收益
+    userIncome: '/user/income',
+    // 购买会员
+    userBuy: '/user/buy',
+    // 查询购买会员订单
+    userQuery: '/user/query',
+    // 推广列表
+    userShares: '/user/shares',
+    // 绑定上级
+    userBind: '/user/bind',
+
+    // 提现申请
+    withdrawApply: '/withdraw/apply',
+    // 提现列表
+    withdrawLists: '/withdraw/lists',
 }

+ 34 - 2
core/http.api.js

xqd
@@ -5,15 +5,47 @@ const apiList = require("./apiList")
 const install = (Vue, vm) => {
 
 	const login = (data = {}) => vm.$u.post(apiList.login, data)
-	const userGet = (params = {}) => vm.$u.get(apiList.userGet, params)
+	// 系统设置
 	const settingGet = (params = {}) => vm.$u.get(apiList.settingGet, params)
+	// 购买记录
 	const memberRecord = (params = {}) => vm.$u.get(apiList.memberRecord, params)
+	// 获取用户信息
+	const userGet = (params = {}) => vm.$u.get(apiList.userGet, params)
+	// 用户收入
+	const userIncome = (params = {}) => vm.$u.get(apiList.userIncome, params)
+	// 用户余额
+	const userOverage = (params = {}) => vm.$u.get(apiList.userOverage, params)
+	// 购买会员
+	const userBuy = (data = {}) => vm.$u.post(apiList.userBuy, data)
+
+	// 提现申请
+	const withdrawApply = (data = {}) => vm.$u.post(apiList.withdrawApply, data)
+	// 提现列表
+	const withdrawLists = (params = {}) => vm.$u.get(apiList.withdrawLists, params)
+	// 查询订单
+	const userQuery = (params = {}) => vm.$u.get(apiList.userQuery, params)
+	// 提现列表
+	const userShares = (params = {}) => vm.$u.get(apiList.userShares, params)
+	// 提现列表
+	const userBind = (data = {}) => vm.$u.post(apiList.userBind, data)
+
 	//将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 		login,
-		userGet,
 		settingGet,
+
 		memberRecord,
+
+		userGet,
+		userIncome,
+		userOverage,
+		userBuy,
+		userQuery,
+		userShares,
+		userBind,
+
+		withdrawApply,
+		withdrawLists,
 	};
 }
 

+ 3 - 5
core/http.interceptor.js

xqd xqd
@@ -19,9 +19,7 @@ const install = (Vue, vm) => {
 	});
 	// 请求拦截,配置Token等参数
 	Vue.prototype.$u.http.interceptor.request = (config) => {
-		if(vm.vuex_user_token){
-			config.header["Authorization"] = vm.vuex_user_token
-		}
+		config.header["Authorization"] = vm.vuex_user_token
 		return config;
 	}
 	// 响应拦截,判断状态码是否通过
@@ -30,11 +28,11 @@ const install = (Vue, vm) => {
 		// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
 		if(res.code === 200) {
 			// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
-			return res.data;
+			return typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
 		} else {
 			uni.showModal({
 				title: '提示',
-				content: res.msg,
+				content: res.message,
 				showCancel: false,
 			});
 			return false;

+ 1 - 1
core/jump.js

xqd
@@ -38,7 +38,7 @@ const jump = function(data) {
             break;
         case 'relaunch':
             uni.reLaunch({
-                url: '/pages/login/login'
+                url: '/pages/index/index'
             });
             break
     }

+ 1 - 1
core/site.js

xqd
@@ -3,6 +3,6 @@
  */
 const ENV = process.env.NODE_ENV === 'development';
 module.exports = {
-    root: ENV ? 'http://t16.9026.com/' : '',
+    root: ENV ? 'http://www.sange-bridge.me/' : 'https://t16.9026.com/',
     authKey: "!j1^z9hE4sXJdEE$#S1GLYQnWfEBakex",
 }

+ 72 - 0
core/util.js

xqd xqd xqd
@@ -1,3 +1,4 @@
+import $site from "./site";
 const ksort = obj => {
     let keys = Object.keys(obj).sort()
         , sortedObj = {};
@@ -91,6 +92,74 @@ const round = (number,percent) => {
     return flag+number;
 }
 
+const objectToUrlParams = function (obj, urlencode) {
+    let str = "";
+    for (let key in obj) {
+        str += "&" + key + "=" + (urlencode ? encodeURIComponent(obj[key]) : obj[key]);
+    }
+    return str.substr(1);
+}
+
+const shareMessage = user => {
+    let args = {
+        path: '/pages/index/index',
+        params: {
+            user_id : user.id,
+        },
+        title: '桥架计算和公示表永久使用',
+        desc: '做桥架不求人,让你秒变大师!',
+        imageUrl: $site.root+"assets/images/formula/formula-cover.png"
+    };
+    return args ;
+}
+
+/**
+ * WXSceneSession    分享到聊天界面
+ * WXSenceTimeline    分享到朋友圈
+ * WXSceneFavorite  分享到微信收藏
+ * @param user
+ * @param scene
+ */
+const share = (user,scene = "WXSenceTimeline") => {
+    uni.share({
+        provider: 'weixin',
+        scene: "WXSceneSession",
+        type: 5,
+        imageUrl: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/962fc340-4f2c-11eb-bdc1-8bd33eb6adaa.png',
+        title: '欢迎体验uniapp',
+        miniProgram: {
+            id: 'gh_abcdefg',
+            path: 'pages/index/index',
+            type: 0,
+            webUrl: 'http://uniapp.dcloud.io'
+        },
+        success: ret => {
+            console.log(JSON.stringify(ret));
+        },
+        fail: err =>  {
+            console.error("fail:" + JSON.stringify(err));
+        }
+    });
+    /*uni.share({
+        provider: "weixin",
+        scene: scene,
+        type: 5, // 小程序
+        miniProgram: {
+            id: 'gh_cdaf361f6966',
+            path:'/pages/index/index?user_id='+user.id,
+        },
+        title: '桥架计算和公示表永久使用',
+        summary: "做桥架不求人,让你秒变大师!",
+        imageUrl: $site.root+"assets/images/formula/formula-cover.png",
+        success: function (res) {
+            console.log("success:" + JSON.stringify(res));
+        },
+        fail: function (err) {
+            console.error("fail:" + JSON.stringify(err));
+        }
+    });*/
+}
+
 
 export {
     ksort,
@@ -107,4 +176,7 @@ export {
     atan,
     checkTriangle,
     round,
+    objectToUrlParams,
+    shareMessage,
+    share
 }

+ 7 - 0
pages.json

xqd
@@ -10,6 +10,13 @@
         "enablePullDownRefresh": false
       }
     },
+    {
+      "path": "pages/login/login",
+      "style": {
+        "navigationBarTitleText": "登录",
+        "enablePullDownRefresh": false
+      }
+    },
     {
       "path": "pages/math/index",
       "style": {

+ 40 - 41
pages/income/index.vue

xqd xqd
@@ -1,47 +1,30 @@
 <template>
 	<app-layout>
 		<view class="container">
-			<view class="cell-box main-left">
-				<view class="head-img">
-					<u-image
-							width="140"
-							height="140"
-							src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
-							shape="circle"></u-image>
-				</view>
-				<view class="nickname main-left cross-center">
-					<text>重置桥架会员</text>
-					<u-image
-							width="35"
-							height="35"
-						src="@/static/images/vip.png"
+			<template v-for="(item,index) in lists">
+				<view class="cell-box main-left" :key="index">
+					<view class="head-img">
+						<u-image
+								width="140"
+								height="140"
+								:src="item.child.head_img"
+								shape="circle"></u-image>
+					</view>
+					<view class="nickname main-left cross-center">
+						<text>{{item.child.nickname}}</text>
+						<u-image
+								width="35"
+								height="35"
+								src="@/static/images/vip.png"
+								v-if="item.child.is_vip"
 						></u-image>
+					</view>
+					<view class="price main-center cross-center">
+						推荐奖励:<text>{{item.income}}</text>元
+					</view>
 				</view>
-				<view class="price main-center cross-center">
-					推荐奖励:<text>58</text>元
-				</view>
-			</view>
-			<u-line></u-line>
-			<view class="cell-box main-left">
-				<view class="head-img">
-					<u-image
-							width="140"
-							height="140"
-							src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
-							shape="circle"></u-image>
-				</view>
-				<view class="nickname main-left cross-center">
-					<text>重置桥架会员</text>
-					<u-image
-							width="35"
-							height="35"
-							src="@/static/images/vip.png"
-					></u-image>
-				</view>
-				<view class="price main-center cross-center">
-					推荐奖励:<text>58</text>元
-				</view>
-			</view>
+				<u-line></u-line>
+			</template>
 		</view>
 	</app-layout>
 </template>
@@ -54,11 +37,27 @@
 		},
 		data() {
 			return {
-
+				lists: [],
+				currentPage: 1,
+				totalPage: 0
 			}
 		},
 		methods: {
-
+			getList(page){
+				this.$u.api.userIncome(page).then(res => {
+					this.currentPage = res.current_page
+					this.totalPage = res.last_page
+					this.lists = this.lists.concat(res.data);
+				})
+			}
+		},
+		onLoad(){
+			this.getList();
+		},
+		onReachBottom(){
+			if(this.currentPage < this.totalPage){
+				this.getList(this.currentPage+1)
+			}
 		}
 	}
 </script>

+ 16 - 0
pages/index/index.vue

xqd xqd
@@ -42,6 +42,7 @@
 					title: '该功能需付费永久使用',
 					subTitle: '做桥架不求人,让你秒变大师',
 				},
+				scene: ''
 			}
 		},
 		methods: {
@@ -54,7 +55,22 @@
 			},
 			handleConfirmBuy(){
 				this.$jump({url:'/pages/my/member',type:'to'})
+			},
+			handleBind(){
+				this.$u.api.userBind({scene:this.scene}).then(res => {
+
+				})
+			}
+		},
+		onLoad(options){
+			this.scene = options.scene;
+			if(this.scene){
+				this.handleBind()
 			}
+
+		},
+		onShareAppMessage() {
+			return this.$util.shareMessage(this.vuex_user_data);
 		},
 	}
 </script>

+ 68 - 0
pages/login/login.vue

xqd
@@ -0,0 +1,68 @@
+<template>
+    <app-layout>
+
+    </app-layout>
+</template>
+
+<script>
+    import appLayout from "@/components/app-layout"
+    export default {
+        components:{
+            appLayout,
+        },
+        data() {
+            return {
+                redirect: ''
+            }
+        },
+        methods: {
+            login(){
+                let _this = this;
+                uni.showLoading({title: '登录中...'})
+                uni.login({
+                    provider: 'weixin',
+                    success: res => {
+                        uni.getUserInfo({
+                            provider: 'weixin',
+                            success: data =>  {
+                                let params = {
+                                    code: res.code,
+                                    encryptedData: data.encryptedData,
+                                    iv:data.iv,
+                                    signature:data.signature
+                                }
+                                _this.$u.api.login(params).then(loginRes => {
+                                    _this.$u.vuex(_this.$const.USER_TOKEN,loginRes.token)
+                                    _this.$u.vuex(_this.$const.USER_DATA,loginRes.user)
+                                    uni.hideLoading()
+                                    uni.reLaunch({
+                                        url: _this.redirect
+                                    });
+                                })
+                            }
+                        });
+                    }
+                });
+            },
+        },
+        onLoad(options) {
+            let redirect = options.redirect;
+            delete options.redirect;
+            let arr = [];
+            for (const key in options) {
+                arr.push(`${key}=${options[key]}`)
+            }
+            this.redirect = `/${redirect}?${arr.join("&")}`
+            if(!this.redirect){
+                this.redirect = '/pages/index/index'
+            }
+            if(!this.vuex_user_token){
+                this.login()
+            }
+        }
+    }
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 2 - 1
pages/math/index.vue

xqd xqd
@@ -2,7 +2,7 @@
 	<app-layout class="app-math">
 		<view class="container">
 			<view class="cover-image">
-				<u-image width="100%" height="400rpx" src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/formula/formula-cover.png"></u-image>
+				<u-image width="100%" height="400rpx" :src="src"></u-image>
 			</view>
 			<view class="input">
 				<u-input
@@ -83,6 +83,7 @@
 				value5: 1.414,
 				value6: 0.707,
 				value7: 0.707,
+				src: this.$site.root+"assets/images/formula/formula-cover.png"
 			}
 		},
 		methods: {

+ 3 - 1
pages/my/index.vue

xqd xqd
@@ -30,7 +30,7 @@
 				<u-cell-item title="会员购买记录" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/my/member-record',type:'to'})">
 					<view slot="icon" class="icon member"></view>
 				</u-cell-item>
-				<u-cell-item title="分销中心" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/share/index',type:'to'})">
+				<u-cell-item title="分销中心" v-if="setting.open_share" :border-bottom="false" bg-color="#f9f9f9" @click="$jump({url:'/pages/share/index',type:'to'})">
 					<view slot="icon" class="icon share"></view>
 				</u-cell-item>
 				<u-cell-item title="微信号" :border-bottom="false" bg-color="#f9f9f9">
@@ -85,6 +85,8 @@
 		onLoad(){
 			this.userData = this.vuex_user_data
 			//this.getUser();
+		},
+		onShow(){
 			this.getSetting();
 		}
 	}

+ 69 - 4
pages/my/member.vue

xqd xqd xqd
@@ -13,15 +13,23 @@
 				<view class="item-group  dir-top-wrap cross-center">
 					<view class="title">开通桥架会员</view>
 					<view class="price">
-						<view class="current">¥58</view>
-						<view class="origin">¥98</view>
+						<view class="current">¥{{setting.member_price}}</view>
+						<view class="origin">¥{{setting.origin_member_price}}</view>
 						<view class="desc">永久使用</view>
 					</view>
 					<u-button shape="circle"
 							  type="success"
 							  hover-class="none"
 							  :custom-style="btnStyle"
+							  @click="handleBuy"
+							  v-if="vuex_user_data.is_vip == 0"
 					>立即开通</u-button>
+					<u-button shape="circle"
+							  type="success"
+							  hover-class="none"
+							  :custom-style="btnStyle"
+							  v-else
+					>您已经是会员了</u-button>
 				</view>
 			</view>
 		</view>
@@ -36,11 +44,65 @@
 		},
 		data() {
 			return {
-
+				setting: {},
+				interval: null
 			}
 		},
 		methods: {
-
+			getSetting(){
+				this.$u.api.settingGet().then(data => {
+					this.setting = data;
+				})
+			},
+			handleBuy(){
+				uni.showLoading({title: '数据处理中...'})
+				let _this = this;
+				this.$u.api.userBuy().then(data => {
+					uni.hideLoading();
+					uni.requestPayment({
+						provider: 'wxpay',
+						timeStamp: data.timeStamp,
+						nonceStr: data.nonceStr,
+						package: data.package,
+						signType: data.signType,
+						paySign: data.paySign,
+						success: function (res) {
+							console.log('success:' + JSON.stringify(res));
+							//_this.$u.toast("支付成功")
+							_this.queryOrder();
+						},
+						fail: function (err) {
+							console.log('fail:' + JSON.stringify(err));
+							//_this.$u.toast("支付失败")
+							clearInterval(_this.interval)
+						}
+					});
+				}).catch(res => {
+					if(res.code === 10013){
+						clearInterval(_this.interval)
+						_this.getUser();
+					}
+				})
+			},
+			queryOrder(){
+				let _this = this;
+				_this.interval = setInterval(function () {
+					_this.$u.api.userQuery().then(data => {
+						if(data == 1){
+							clearInterval(_this.interval)
+							_this.getUser();
+						}else if(data == 2){
+							clearInterval(_this.interval)
+							_this.$u.toast('支付失败');
+						}
+					})
+				},1000)
+			},
+			getUser(){
+				this.$u.api.userGet().then(data => {
+					this.$u.vuex(this.$const.USER_DATA, data)
+				})
+			},
 		},
 		computed:{
 			btnStyle() {
@@ -54,6 +116,9 @@
 					fontWeight: 600
 				};
 			}
+		},
+		onReady(){
+			this.getSetting();
 		}
 	}
 </script>

+ 14 - 9
pages/price/apply.vue

xqd xqd xqd
@@ -8,7 +8,7 @@
 				</view>
 				<view class="input-item main-left cross-center">
 					<view class="label">账号</view>
-					<input type="text" placeholder="请输入正确微信账号" v-model="form.wechat">
+					<input type="text" placeholder="请输入正确微信账号" v-model="form.account">
 				</view>
 				<view class="input-item main-left cross-center" >
 					<view class="label">备注</view>
@@ -22,7 +22,7 @@
 					  hover-class="none"
 					  :custom-style="btnStyle"
 					  @click="handelApply"
-					  :disabled="!form.name || !form.wechat"
+					  :disabled="!form.name || !form.account"
 			>提交申请</u-button>
 		</view>
 	</app-layout>
@@ -38,24 +38,29 @@
 			return {
 				form:{
 					name:'',
-					wechat:'',
+					account:'',
 					remark:'',
 				}
 			}
 		},
 		methods: {
 			handelApply(){
-				uni.showToast({
-					title: '提交成功',
-					icon: 'success',
-					duration: 1500
-				});
+				this.$u.api.withdrawApply(this.form).then(res => {
+					uni.showToast({
+						title: '提交成功',
+						icon: 'success',
+						duration: 1500
+					});
+					setTimeout(() => {
+						this.$jump({url:'/pages/price/index',type:'redirect'})
+					},1500)
+				})
 			}
 		},
 		computed:{
 			btnStyle() {
 				let background = 'linear-gradient(90deg, rgba(196,146,68,1) 0%, rgba(225,193,117,1) 100%, rgba(225,193,117,1) 100%)';
-				if(!this.form.name || !this.form.wechat){
+				if(!this.form.name || !this.form.account){
 					background = '#ccc !important'
 				}
 				return {

+ 23 - 4
pages/price/index.vue

xqd xqd xqd xqd
@@ -3,7 +3,7 @@
 		<view class="container dir-top-wrap cross-center">
 			<view class="price-box dir-top-wrap cross-center ">
 				<view class="title">账户剩余金额</view>
-				<view class="price">¥766</view>
+				<view class="price">¥{{overage}}</view>
 				<view class="desc">微信线下打款</view>
 			</view>
 			<view class="tips dir-top-wrap cross-center">
@@ -14,7 +14,7 @@
 					  type="success"
 					  hover-class="none"
 					  :custom-style="btnStyle"
-					  @click="$jump({url:'/pages/price/apply',type:'to'})"
+					  @click="handleWithdraw"
 			>提现</u-button>
 		</view>
 	</app-layout>
@@ -28,11 +28,27 @@
 		},
 		data() {
 			return {
-
+				overage: 0
 			}
 		},
 		methods: {
-
+			handleWithdraw(){
+				if(this.overage > 0){
+					this.$jump({url:'/pages/price/apply',type:'to'})
+				}else{
+					this.$u.toast("暂无可提现金额");
+				}
+			},
+			getSetting(){
+				this.$u.api.settingGet().then(data => {
+					this.setting = data;
+				})
+			},
+			getOverage(){
+				this.$u.api.userOverage().then(res => {
+					this.overage = res.overage
+				})
+			}
 		},
 		computed:{
 			btnStyle() {
@@ -46,6 +62,9 @@
 					fontWeight: 600
 				};
 			}
+		},
+		onLoad(){
+			this.getOverage();
 		}
 	}
 </script>

+ 38 - 15
pages/share/index.vue

xqd xqd xqd xqd xqd xqd
@@ -12,8 +12,8 @@
 								shape="circle"></u-image>
 					</view>
 					<view class="share-box dir-top-wrap">
-						<view class="nickname">会员昵称</view>
-						<view class="recommend">推荐人:大虎</view>
+						<view class="nickname">{{vuex_user_data.nickname}}</view>
+						<view class="recommend" v-if="userData.parent">推荐人:{{userData.parent.nickname}}</view>
 					</view>
 				</view>
 			</view>
@@ -22,7 +22,17 @@
 					  v-for="(item,index) in shareTool"
 					  @click="handleItemClick(index)"
 				>
-					<view class="icon">
+					<u-button type="primary" open-type="share" v-if="item.share"
+							  :custom-style="{backgroundColor: 'transparent',borderColor: 'unset'}"
+							  hover-class="none"
+					>
+						<u-image
+								width="90"
+								height="90"
+								mode="aspectFit"
+								:src="item.icon"></u-image>
+					</u-button>
+					<view class="icon" v-else>
 						<u-image
 								width="90"
 								height="90"
@@ -41,16 +51,16 @@
 						<u-image
 								width="150"
 								height="150"
-								src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
+								:src="userData.head_img"
 								shape="circle"></u-image>
 					</view>
-					<view class="nickname">小星星</view>
+					<view class="nickname">{{userData.nickname}}</view>
 					<u-line class="u-line" border-style="dashed" length="90%"></u-line>
 					<view class="qrcode">
 						<u-image
-								width="350"
-								height="350"
-								src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
+								width="320"
+								height="320"
+								:src="userData.share_qrcode"
 						></u-image>
 					</view>
 				</view>
@@ -81,12 +91,13 @@
 					{icon:'/static/images/withdraw.png',title:'佣金提现明细',url:'/pages/withdraw/index'},
 					{icon:'/static/images/list.png',title:'推广列表',url:'/pages/share/list'},
 					{icon:'/static/images/income.png',title:'收益列表',url:'/pages/income/index'},
-					{icon:'/static/images/share.png',title:'推广分享',method: this.handleShare},
+					{icon:'/static/images/share.png',title:'推广分享',method: this.handleShare,share: true},
 					{icon:'/static/images/qrcode.png',title:'推广二维码',url:'',method: this.handleQrCode},
 				],
 				qrCodeModal:{
 					show: false
-				}
+				},
+				userData: {}
 			}
 		},
 		methods: {
@@ -102,9 +113,21 @@
 				this.qrCodeModal.show = true
 			},
 			handleShare(){
-				this.$u.toast('推广分享')
-			}
-		}
+				this.$util.share(this.vuex_user_data);
+				// this.$u.toast('推广分享')
+			},
+			getUser(){
+				this.$u.api.userGet().then(data => {
+					this.userData = data;
+				})
+			},
+		},
+		onLoad(){
+			this.getUser();
+		},
+		onShareAppMessage() {
+			return this.$util.shareMessage(this.vuex_user_data);
+		},
 	}
 </script>
 <style lang="scss" scoped>
@@ -189,8 +212,8 @@
 				.nickname{
 					position: absolute;
 					color: #ffffff;
-					top: 11%;
-					font-size: 36rpx;
+					top: 15%;
+					font-size: 34rpx;
 				}
 				.u-line{
 					position: absolute;

+ 40 - 38
pages/share/list.vue

xqd xqd
@@ -1,46 +1,32 @@
 <template>
 	<app-layout>
 		<view class="container">
-			<view class="cell-box main-left">
-				<view class="head-img">
-					<u-image
-							width="140"
-							height="140"
-							src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
-							shape="circle"></u-image>
-				</view>
-				<view class="nickname dir-top-wrap main-center">
-					<view class="title main-left cross-center">
-						<text>重置桥架会员</text>
+			<template v-for="(item,index) in lists">
+				<view class="cell-box main-left" :key="index">
+					<view class="head-img">
 						<u-image
-								width="35"
-								height="35"
-								src="@/static/images/vip.png"
-						></u-image>
-					</view>
-					<view class="sub-title">
-						绑定时间:2021-8-1 15:02:42
-					</view>
-				</view>
-			</view>
-			<u-line></u-line>
-			<view class="cell-box main-left">
-				<view class="head-img">
-					<u-image
-							width="140"
-							height="140"
-							src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
-							shape="circle"></u-image>
-				</view>
-				<view class="nickname dir-top-wrap main-center">
-					<view class="title main-left">
-						<text>重置桥架会员</text>
+								width="140"
+								height="140"
+								src="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
+								shape="circle"></u-image>
 					</view>
-					<view class="sub-title">
-						绑定时间:2021-8-1 15:02:42
+					<view class="nickname dir-top-wrap main-center">
+						<view class="title main-left cross-center">
+							<text>{{item.nickname}}</text>
+							<u-image
+									width="35"
+									height="35"
+									src="@/static/images/vip.png"
+									v-if="item.is_vip"
+							></u-image>
+						</view>
+						<view class="sub-title">
+							绑定时间:{{item.become_child_at}}
+						</view>
 					</view>
 				</view>
-			</view>
+				<u-line></u-line>
+			</template>
 		</view>
 	</app-layout>
 </template>
@@ -53,11 +39,27 @@
 		},
 		data() {
 			return {
-
+				lists: [],
+				currentPage: 1,
+				totalPage: 0
 			}
 		},
 		methods: {
-
+			getList(page){
+				this.$u.api.userShares(page).then(res => {
+					this.currentPage = res.current_page
+					this.totalPage = res.last_page
+					this.lists = this.lists.concat(res.data);
+				})
+			}
+		},
+		onLoad(){
+			this.getList();
+		},
+		onReachBottom(){
+			if(this.currentPage < this.totalPage){
+				this.getList(this.currentPage+1)
+			}
 		}
 	}
 </script>

+ 69 - 29
pages/withdraw/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,5 +1,5 @@
 <template>
-	<app-layout class="c-wrapper">
+	<app-layout class="c-wrapper dir-top-wrap">
 		<!--tab-->
 		<view class="u-tabs-box">
 			<u-tabs-swiper ref="tabs"
@@ -21,32 +21,40 @@
 							 lower-threshold="80"
 							 @scrolltolower="scrollBottom">
 					<view class="page-box">
-						<view class="cell-box">
-							<view class="stamp">
-								<u-image
-										width="150"
-										height="150"
-										mode="aspectFit"
-										src="@/static/images/agree.png"
-								></u-image>
-							</view>
-							<view class="header main-between">
-								<text class="nickname">微信昵称:Z是一颗星</text>
-								<text>待审核</text>
-							</view>
-							<view class="section main-between cross-cente">
-								<view class="info main-left cross-center">
-									<text>提现金额</text>
-									<view class="price">¥76</view>
+						<block v-if="arr.data.length || !arr.initData">
+							<view class="cell-box" v-for="(item,itemIndex) in arr.data" :key="itemIndex">
+								<view class="stamp" v-if="item.status == 1">
+									<u-image
+											width="150"
+											height="150"
+											mode="aspectFit"
+											src="@/static/images/agree.png"
+									></u-image>
+								</view>
+								<view class="header main-between">
+									<text class="nickname">微信昵称:{{vuex_user_data.nickname}}</text>
+									<text>{{item.status==1?'已通过':(item.status==2?'已驳回':'带审核')}}</text>
 								</view>
-								<view class="name cross-center">
-									张三(2390573452730)
+								<view class="section main-between cross-cente">
+									<view class="info main-left cross-center">
+										<text>提现金额</text>
+										<view class="price">¥{{item.price}}</view>
+									</view>
+									<view class="name cross-center">
+										{{item.name}}({{item.account}})
+									</view>
+								</view>
+								<view class="footer">
+									<text>申请时间:{{item.created_at}}</text>
 								</view>
 							</view>
-							<view class="footer">
-								<text>申请时间:2021/07/21 15:45</text>
+							<u-loadmore :status="arr.status" font-size="20" margin-top="40"></u-loadmore>
+						</block>
+						<block v-else>
+							<view class="dir-top-wrap main-center cross-center no-order">
+								<text class="tips">暂无数据</text>
 							</view>
-						</view>
+						</block>
 					</view>
 				</scroll-view>
 			</swiper-item>
@@ -65,9 +73,9 @@
 				currentTab: 0,
 				tabs: [
 					{name: '全部', value: -1},
-					{name: '待审核', value: 1},
-					{name: '已通过', value: 2},
-					{name: '已驳回', value: 3},
+					{name: '待审核', value: 0},
+					{name: '已通过', value: 1},
+					{name: '已驳回', value: 2},
 				],
 				currentSwiper: 0,
 				dataList: [],
@@ -102,11 +110,31 @@
 				_this.getList(0, 1);
 			},
 			getList(index, page){
+				let params = {
+					status: this.tabs[index].value,
+					page: page
+				};
+				let activeData = this.dataList[index];
+				this.$u.api.withdrawLists(params).then(data => {
+					uni.stopPullDownRefresh()
+					activeData.initData = true;
+					activeData.data = this.isReload ? data.data : activeData.data.concat(data.data);
+					activeData.currentPage = data.current_page;
+					activeData.totalPage = data.last_page;
+					if(activeData.currentPage >= activeData.totalPage){
+						activeData.status = 'nomore';
+					}else{
+						activeData.status = 'loadmore';
+					}
+					this.isReload = false;
+					console.log('-->data',activeData)
+				})
 
 			},
 			// tabs 切换
 			changeTabs(index){
 				this.currentSwiper = index;
+				console.log('-->data',this.dataList[index].initData)
 				if(!this.dataList[index].initData){
 					this.getList(index, 1);
 				}
@@ -117,7 +145,7 @@
 				let activeData = this.dataList[index];
 				if(activeData.currentPage < activeData.totalPage){
 					activeData.status = 'loading';
-					//this.getList(index,activeData.currentPage + 1);
+					this.getList(index,activeData.currentPage + 1);
 				}else{
 					activeData.status = 'nomore';
 				}
@@ -136,7 +164,7 @@
 				}
 				if(this.dataList[current].data.length === 0 && this.dataList[current].status !== 'nomore'){
 					this.dataList[current].status = 'loading';
-					//this.getList(current,this.dataList[current].currentPage);
+					this.getList(current,this.dataList[current].currentPage);
 				}
 			},
 		},
@@ -146,8 +174,11 @@
 </script>
 
 <style lang="scss">
+	.c-wrapper{
+		height: 100vh;
+	}
 	.swiper-box {
-		flex: 1;
+		height: calc(100vh - 90rpx);
 		.swiper-item {
 			height: 100%;
 		}
@@ -159,11 +190,20 @@
 	.page-box{
 		flex: 1;
 		padding: 20rpx 30rpx;
+		.no-order{
+			height: 70vh;
+			.tips{
+				margin-top: 13upx;
+				font-size: 26upx;
+				color: #999999;
+			}
+		}
 		.cell-box{
 			position: relative;
 			background: #fff;
 			border-radius: 16rpx;
 			padding: 36rpx 32rpx;
+			margin-bottom: 32rpx;
 			.stamp{
 				position: absolute;
 				right: 0;