cmy hai 11 meses
pai
achega
89be7a960a

+ 23 - 1
api/user.js

@@ -208,7 +208,13 @@ export function getIntegralListAction(q) {
  * 立即出局
  * */
 export function getIntegralListActionOut(q) {
-	return request.post(`award_integral/${q.id}`);
+	return request.post(`award_integral/${q.id}`,q);
+}
+/*
+ * 佣金转能量
+ * */
+export function energyImport(q) {
+	return request.post(`energy/import`);
 }
 
 /**
@@ -286,6 +292,15 @@ export function extractCash(data) {
 	return request.post('extract/cash', data)
 }
 
+
+/**
+ * 能量转股权
+ * @param object data
+ */
+export function energyExchange(data) {
+	return request.post('energy/exchange', data)
+}
+
 /**
  * 提现银行/提现最低金额
  * 
@@ -294,6 +309,13 @@ export function extractBank() {
 	return request.get('extract/bank');
 }
 
+// 能量
+export function energyBank() {
+	return request.get('energy/bank');
+}
+
+
+
 /**
  * 会员等级列表
  * 

+ 3 - 5
manifest.json

@@ -1,9 +1,9 @@
 {
     "name" : "神英优选",
-    "appid" : "__UNI__038CA44",
+    "appid" : "__UNI__70BC0AE",
     "description" : "神英优选商城",
-    "versionName" : "2.8.5",
-    "versionCode" : 285,
+    "versionName" : "2.9.2",
+    "versionCode" : 292,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -24,8 +24,6 @@
         "modules" : {
             "VideoPlayer" : {},
             "Payment" : {},
-            "Maps" : {},
-            "Geolocation" : {},
             "Barcode" : {},
             "Camera" : {}
         },

+ 26 - 0
pages.json

@@ -615,6 +615,32 @@
 						}
 					}
 				},
+				{
+					"path": "user_payment/user_spread",
+					"style": {
+						"navigationBarTitleText": "佣金转换",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
+				{
+					"path": "user_payment/energy",
+					"style": {
+						"navigationBarTitleText": "能量转换",
+						"app-plus": {
+							// #ifdef APP-PLUS
+							"titleNView": {
+								"type": "default"
+							}
+							// #endif
+						}
+					}
+				},
 				{
 					"path": "user_pwd_edit/index",
 					"style": {

+ 1 - 1
pages/user/index.vue

@@ -243,7 +243,7 @@
 							<text class="num">{{userInfo.now_money || 0}}</text>
 							<view class="txt">余额</view>
 						</view>
-						<view class="num-item">
+						<view class="num-item" @click="goMenuPage('/pages/users/user_payment/energy')">
 							<text class="num">{{userInfo.energy || 0}}</text>
 							<view class="txt">能量值</view>
 						</view>

+ 21 - 12
pages/users/user_integral/integral.vue

@@ -177,18 +177,27 @@
 					content: '是否立即出局',
 					success: res => {
 						if(res.confirm){
-							getIntegralListActionOut({
-								id:item.id
-							}).then((res)=>{
-								uni.showToast({
-									title:res.msg
-								});
-							}).catch((err)=>{
-								uni.showToast({
-									title: err,
-									icon:'error'
-								});
-							})
+							uni.showModal({
+								title: '请输入登录密码确认',
+								editable:true,
+								success: res => {
+									if(res.confirm){
+										getIntegralListActionOut({
+											id:item.id,
+											password:res.content
+										}).then((res)=>{
+											uni.showToast({
+												title:res.msg,
+											});
+										}).catch((err)=>{
+											uni.showToast({
+												title: err,
+												icon:'error'
+											});
+										})
+									}
+								},
+							});
 						}
 					},
 					fail: () => {},

+ 346 - 0
pages/users/user_payment/energy.vue

@@ -0,0 +1,346 @@
+<template>
+	<view :style="colorStyle">
+		<view class='cash-withdrawal'>
+			<view class='wrapper'>
+				<view class='list'>
+					<form @submit="subCash">
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>持卡人</view>
+							<view class='input'><input placeholder='请输入持卡人姓名' placeholder-class='placeholder'
+									name="name"
+									onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input>
+							</view>
+						</view>
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>卡号</view>
+							<view class='input'><input type='number' placeholder='请填写卡号' placeholder-class='placeholder'
+									name="cardnum"></input></view>
+						</view>
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>开户行</view>
+							<view class='input'><input placeholder='请输入开户行名称' placeholder-class='placeholder'
+									name="bankname"
+									onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input>
+							</view>
+						</view>
+						<view class='item acea-row row-between-wrapper'>
+							<view class='name'>转换能量</view>
+							<view class='input'><input v-model="allMoney" @input='inputNum' :maxlength="moneyMaxLeng"
+									:placeholder='"最低转换能量值:"+minPrice' placeholder-class='placeholder' name="energy"
+									type='digit'></input></view>
+						</view>
+						<view class='tip'>
+							当前可转能量值:<text class="price">{{userInfo.energy}}</text>
+							时价:<text  class="price">{{stock_price}}</text>
+						</view>
+						<view class='tip'>
+							手续费:<text class="price">{{withdraw_fee}}%</text>实际到账:<text
+								class="price">{{true_money}}</text>
+						</view>
+						<button formType="submit" class='bnt bg-color'>立即转换</button>
+					</form>
+				</view>
+			</view>
+		</view>
+		<home v-if="navigation"></home>
+	</view>
+</template>
+
+<script>
+	import {
+		energyExchange,
+		energyBank,
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+
+	import {
+		calculator,
+	} from '@/api/new.js';
+
+	import {
+		mapGetters
+	} from "vuex";
+	import colors from '@/mixins/color.js';
+	import home from '@/components/home';
+	export default {
+		components: {
+			home
+		},
+		mixins: [colors],
+		data() {
+			return {
+				minPrice: 0.00, //最低提现金额
+				userInfo: [],
+				prevent: true, //避免重复提交成功多次
+				moneyMaxLeng: 8,
+				withdraw_fee: '0',
+				true_money: 0,
+				allMoney: '', //保存当前提现金额
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getUserInfo();
+						this.getUserExtractBank();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad() {
+			if (this.isLogin) {
+				this.getUserInfo();
+				this.getUserExtractBank();
+			} else {
+				toLogin()
+			}
+		},
+		methods: {
+			inputNum: async function(e) {
+				let val = e.detail.value;
+				let dot = val.indexOf('.');
+				if (dot > -1) {
+					this.moneyMaxLeng = dot + 3;
+				} else {
+					this.moneyMaxLeng = 8
+				}
+				try {
+					this.true_money = +((val - val*this.withdraw_fee/100)/this.stock_price).toFixed(2);
+					console.log(this.true_money,'this.true_money');
+				} catch (e) {
+					uni.showToast({
+						title: e,
+						icon: "error"
+					});
+					//TODO handle the exception
+				}
+
+			},
+			getUserExtractBank: function() {
+				let that = this;
+				energyBank().then(res => {
+					that.minPrice = res.data.minEnergy;
+					that.stock_price = res.data.stock_price;
+					that.withdraw_fee = res.data.exchange_fee;
+				});
+			},
+			/**
+			 * 获取个人用户信息
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then(res => {
+					that.userInfo = res.data;
+				})
+			},
+			subCash: function(e) {
+				let that = this,
+					value = e.detail.value;
+				if (value.name.length == 0) return that.$util.Tips({
+					title: '请填写持卡人姓名'
+				});
+				if (value.cardnum.length == 0) return that.$util.Tips({
+					title: '请填写卡号'
+				});
+				if (value.energy.length == 0) return that.$util.Tips({
+					title: '请填写转换能量'
+				});
+				if (value.bankname.length == 0) return that.$util.Tips({
+					title: '请填写开户行名称'
+				});
+				if (Number(value.energy) < Number(that.minPrice)) return that.$util.Tips({
+					title: '转换能量不能低于:' + that.minPrice
+				});
+				if (that.prevent) {
+					that.prevent = false
+				} else {
+					return
+				}
+				energyExchange({
+					...value,
+				}).then(res => {
+					return this.$util.Tips({
+						title: res.msg,
+						icon: 'success'
+					}, {
+						url: '/pages/users/user_spread_user/index',
+						tab: 2
+					});
+				}).catch(err => {
+					setTimeout(e => {
+						this.prevent = true
+					}, 1500)
+					return this.$util.Tips({
+						title: err
+					});
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff !important;
+	}
+
+	.fontcolor {
+		color: var(--view-theme) !important;
+	}
+
+	.cash-withdrawal .nav {
+		height: 130rpx;
+		box-shadow: 0 10rpx 10rpx #f8f8f8;
+	}
+
+	.cash-withdrawal .nav .item {
+		font-size: 26rpx;
+		flex: 1;
+		text-align: center;
+	}
+
+	.cash-withdrawal .nav .item~.item {
+		border-left: 1px solid #f0f0f0;
+	}
+
+	.cash-withdrawal .nav .item .iconfont {
+		width: 40rpx;
+		height: 40rpx;
+		border-radius: 50%;
+		border: 2rpx solid var(--view-theme);
+		text-align: center;
+		line-height: 37rpx;
+		margin: 0 auto 6rpx auto;
+		font-size: 22rpx;
+		box-sizing: border-box;
+	}
+
+	.cash-withdrawal .nav .item .iconfont.on {
+		background-color: var(--view-theme);
+		color: #fff;
+		border-color: var(--view-theme);
+	}
+
+	.cash-withdrawal .nav .item .line {
+		width: 2rpx;
+		height: 20rpx;
+		margin: 0 auto;
+		transition: height 0.3s;
+	}
+
+	.cash-withdrawal .nav .item .line.on {
+		height: 39rpx;
+	}
+
+	.cash-withdrawal .wrapper .list {
+		padding: 0 30rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item {
+		border-bottom: 1rpx solid #eee;
+		min-height: 28rpx;
+		font-size: 30rpx;
+		color: #333;
+		padding: 39rpx 0;
+	}
+
+	.cash-withdrawal .wrapper .list .item .name {
+		width: 130rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .input {
+		width: 505rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .input .placeholder {
+		color: #bbb;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm,
+	.cash-withdrawal .wrapper .list .item .pictrue {
+		width: 140rpx;
+		height: 140rpx;
+		border-radius: 3rpx;
+		position: relative;
+		margin-right: 23rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm image {
+		width: 100%;
+		height: 100%;
+		border-radius: 3rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1 {
+		position: absolute;
+		right: -14rpx;
+		top: -16rpx;
+		font-size: 40rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .item .pictrue {
+		border: 1px solid rgba(221, 221, 221, 1);
+		font-size: 22rpx;
+		color: #BBBBBB;
+	}
+
+	.cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
+		font-size: 47rpx;
+		color: #DDDDDD;
+		margin-bottom: 3px;
+	}
+
+	.cash-withdrawal .wrapper .list .tip {
+		font-size: 26rpx;
+		color: #999;
+		margin-top: 25rpx;
+	}
+
+	.cash-withdrawal .wrapper .list .bnt {
+		font-size: 32rpx;
+		color: #fff;
+		width: 690rpx;
+		height: 90rpx;
+		text-align: center;
+		border-radius: 50rpx;
+		line-height: 90rpx;
+		margin: 64rpx auto;
+	}
+
+	.cash-withdrawal .wrapper .list .tip2 {
+		font-size: 26rpx;
+		color: #999;
+		text-align: center;
+		margin: 44rpx 0 20rpx 0;
+	}
+
+	.cash-withdrawal .wrapper .list .value {
+		height: 135rpx;
+		line-height: 135rpx;
+		border-bottom: 1rpx solid #eee;
+		width: 690rpx;
+		margin: 0 auto;
+	}
+
+	.cash-withdrawal .wrapper .list .value input {
+		font-size: 80rpx;
+		color: #282828;
+		height: 135rpx;
+		text-align: center;
+	}
+
+	.cash-withdrawal .wrapper .list .value .placeholder2 {
+		color: #bbb;
+	}
+
+	.price {
+		color: var(--view-priceColor);
+		margin-right: 20rpx;
+	}
+</style>

+ 448 - 0
pages/users/user_payment/user_spread.vue

@@ -0,0 +1,448 @@
+<template>
+	<view>
+		<form @submit="submitSub" :style="colorStyle">
+			<view class="payment-top acea-row row-column row-center-wrapper">
+				<span class="name">我的佣金</span>
+				<view class="pic">
+					¥<span class="pic-font">{{userinfo.commissionCount || 0.00}}</span>
+				</view>
+			</view>
+			<view class="payment">
+				<view class="nav acea-row row-around row-middle">
+					<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index"
+						@click="navRecharges(index)">{{item}}</view>
+				</view>
+				<view class='tip picList' v-if='!active'>
+					<view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
+							placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
+							name="number"></input></view>
+				</view>
+				<view class="tip" v-else>
+					<view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
+							placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
+							name="number"></input></view>
+				</view>
+				<view class="tips-title">
+					<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
+					<view style="margin-top: 10rpx;">当前可转佣金为 <text
+							class='font-color'>¥{{userinfo.commissionCount || 0}}</text>,冻结佣金为<text
+							class='font-color'>¥{{userinfo.broken_commission}}</text></view>
+				</view>
+				<button class='but bg-color' formType="submit"> 立即转换</button>
+			</view>
+		</form>
+		<home v-if="navigation"></home>
+		<view v-show="false" v-html="formContent"></view>
+		<!-- #ifdef MP -->
+		<!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
+		<!-- #endif -->
+	</view>
+</template>
+
+<script>
+	import {
+		getUserInfo,
+		rechargeRoutine,
+		rechargeWechat,
+		energyImport
+	} from '@/api/user.js';
+	import {
+		toLogin
+	} from '@/libs/login.js';
+	import {
+		orderOfflinePayType
+	} from '@/api/order.js';
+	import {
+		mapGetters
+	} from "vuex";
+	import home from '@/components/home';
+	import colors from "@/mixins/color";
+	import {
+		openPaySubscribe
+	} from '@/utils/SubscribeMessage.js';
+	export default {
+		components: {
+			home,
+		},
+		mixins: [colors],
+		data() {
+			let that = this;
+			return {
+				now_money: 0,
+				navRecharge: ['佣金转能量', '佣金转余额'],
+				active: 0,
+				number: '',
+				userinfo: {},
+				placeholder: "0.00",
+				from: '',
+				isAuto: false, //没有授权的不会自动授权
+				isShowAuth: false, //是否隐藏授权
+				picList: [],
+				activePic: 0,
+				money: "",
+				numberPic: '',
+				rechar_id: 0,
+				password: '',
+				goodsList: [],
+				pay_order_id: '',
+				payMode: [{
+						name: '微信支付',
+						icon: 'icon-weixinzhifu',
+						value: 'weixin',
+						title: '微信快捷支付',
+						payStatus: true
+					}
+					// #ifdef H5 ||APP-PLUS
+					,
+					{
+						name: '支付宝支付',
+						icon: 'icon-zhifubao',
+						value: 'alipay',
+						title: '支付宝支付',
+						payStatus: true
+					}
+					// #endif
+				],
+				pay_close: false,
+				payType: 'alipay',
+				totalPrice: '0',
+				formContent: '',
+				// #ifdef H5
+				isWeixin: this.$wechat.isWeixin(),
+				// #endif
+				type: '',
+				rechargeAttention: [],
+				moneyMaxLeng: 8
+			};
+		},
+		computed: mapGetters(['isLogin']),
+		watch: {
+			isLogin: {
+				handler: function(newV, oldV) {
+					if (newV) {
+						this.getUserInfo();
+					}
+				},
+				deep: true
+			}
+		},
+		onLoad(options) {
+			// #ifdef H5
+			this.from = this.$wechat.isWeixin() ? "weixinh5" : "alipay"
+			// #endif
+			if (this.isLogin) {
+				this.getUserInfo();
+			} else {
+				toLogin();
+			}
+		},
+		onShow() {
+			uni.removeStorageSync('form_type_cart');
+		},
+		methods: {
+			onLunch() {
+				this.getUserInfo();
+			},
+			inputNum: function(e) {
+				let val = e.detail.value;
+				let dot = val.indexOf('.');
+				if (dot > -1) {
+					this.moneyMaxLeng = dot + 3;
+				} else {
+					this.moneyMaxLeng = 8
+				}
+			},
+			/**
+			 * 选择金额
+			 */
+			picCharge(idx, item) {
+				this.activePic = idx;
+				if (item === undefined) {
+					this.rechar_id = 0;
+					this.numberPic = "";
+				} else {
+					this.money = "";
+					this.rechar_id = item.id;
+					this.numberPic = item.price;
+				}
+			},
+			onLoadFun: function() {
+				this.getUserInfo();
+				this.isShowAuth = false;
+			},
+			// 授权关闭
+			authColse: function(e) {
+				this.isShowAuth = e
+			},
+			navRecharges: function(index) {
+				this.active = index;
+			},
+			/**
+			 * 获取用户信息
+			 */
+			getUserInfo: function() {
+				let that = this;
+				getUserInfo().then(res => {
+					that.$set(that, 'userinfo', res.data);
+				})
+			},
+			submitSub: function(e) {
+				let that = this
+				let value = e.detail.value.number;
+				if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
+					return that.$util.Tips({
+						title: '请输入转换金额'
+					});
+				}
+				// 转入余额
+				if (that.active) {
+					uni.showModal({
+						title: '转入余额',
+						content: '转入余额后无法再次转出,确认是否转入余额',
+						success(res) {
+							if (res.confirm) {
+								// #ifdef MP || APP-PLUS
+								rechargeRoutine({
+									price: parseFloat(value),
+									type: 1
+								})
+								// #endif
+								// #ifdef H5
+								rechargeWechat({
+										price: parseFloat(value),
+										from: that.from,
+										type: 1
+									})
+									// #endif
+									.then(res => {
+										// that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
+										return that.$util.Tips({
+											title: '转入成功',
+											icon: 'success'
+										}, {
+											tab: 5,
+											url: '/pages/users/user_money/index'
+										});
+									}).catch(err => {
+										return that.$util.Tips({
+											title: err
+										})
+									});
+							} else if (res.cancel) {
+								return that.$util.Tips({
+									title: '已取消'
+								});
+							}
+						},
+					})
+				} else {
+						uni.showModal({
+							title: '转入能量',
+							content: '转入能量后无法再次转出,确认是否转入能量',
+							success(res) {
+								if (res.confirm) {
+									energyImport({
+										price: parseFloat(value),
+									}).then(res => {
+										// that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
+										return that.$util.Tips({
+											title: '转入成功',
+											icon: 'success'
+										}, {
+											tab: 5,
+											url: '/pages/user/index'
+										});
+									}).catch(err => {
+										return that.$util.Tips({
+											title: err
+										})
+									});
+									
+								} else if (res.cancel) {
+									return that.$util.Tips({
+										title: '已取消'
+									});
+								}
+							},
+						})
+					
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		width: 100%;
+		height: 100%;
+		background-color: #fff;
+	}
+
+	.bgcolor {
+		background-color: var(--view-theme)
+	}
+
+	.payment {
+		position: relative;
+		width: 100%;
+		background-color: #fff;
+		border-radius: 10rpx;
+		padding-top: 25rpx;
+		border-top-right-radius: 39rpx;
+		border-top-left-radius: 39rpx;
+	}
+
+	.payment .nav {
+		height: 75rpx;
+		line-height: 75rpx;
+		padding: 0 100rpx;
+	}
+
+	.payment .nav .item {
+		font-size: 30rpx;
+		color: #333;
+	}
+
+	.payment .nav .item.on {
+		font-weight: bold;
+		border-bottom: 4rpx solid var(--view-theme);
+	}
+
+	.payment .input {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		border-bottom: 1px dashed #dddddd;
+		margin: 60rpx auto 0 auto;
+		padding-bottom: 20rpx;
+		font-size: 56rpx;
+		color: #333333;
+		flex-wrap: nowrap;
+
+	}
+
+	.payment .input text {
+		padding-left: 106rpx;
+	}
+
+	.payment .input input {
+		padding-right: 106rpx;
+		width: 300rpx;
+		height: 94rpx;
+		text-align: center;
+		font-size: 70rpx;
+	}
+
+	.payment .placeholder {
+		color: #d0d0d0;
+		height: 100%;
+		line-height: 94rpx;
+	}
+
+	.payment .tip {
+		font-size: 26rpx;
+		color: #888888;
+		padding: 0 30rpx;
+		margin-top: 25rpx;
+	}
+
+	.payment .but {
+		color: #fff;
+		font-size: 30rpx;
+		width: 700rpx;
+		height: 86rpx;
+		border-radius: 50rpx;
+		margin: 46rpx auto 0 auto;
+		line-height: 86rpx;
+	}
+
+	.payment-top {
+		width: 100%;
+		height: 350rpx;
+		background-color: var(--view-theme);
+
+		.name {
+			font-size: 26rpx;
+			color: rgba(255, 255, 255, 0.8);
+			margin-top: -38rpx;
+			margin-bottom: 30rpx;
+		}
+
+		.pic {
+			font-size: 32rpx;
+			color: #fff;
+		}
+
+		.pic-font {
+			font-size: 78rpx;
+			color: #fff;
+		}
+	}
+
+	.picList {
+		display: flex;
+		flex-wrap: wrap;
+		margin: 30rpx 0;
+
+		.pic-box {
+			width: 32%;
+			height: auto;
+			border-radius: 20rpx;
+			margin-top: 21rpx;
+			padding: 20rpx 0;
+			margin-right: 12rpx;
+
+			&:nth-child(3n) {
+				margin-right: 0;
+			}
+		}
+
+		.pic-box-color {
+			background-color: #f4f4f4;
+			color: #656565;
+		}
+
+		.pic-number {
+			font-size: 22rpx;
+		}
+
+		.pic-number-pic {
+			font-size: 38rpx;
+			margin-right: 10rpx;
+			text-align: center;
+		}
+
+		.pic-box-color-active {
+			background-color: var(--view-theme) !important;
+			color: #fff !important;
+		}
+	}
+
+	.tips-box {
+		.tips {
+			font-size: 28rpx;
+			color: #333333;
+			font-weight: 800;
+			margin-bottom: 14rpx;
+			margin-top: 20rpx;
+		}
+
+		.tips-samll {
+			font-size: 24rpx;
+			color: #333333;
+			margin-bottom: 14rpx;
+		}
+
+		.tip-box {
+			margin-top: 30rpx;
+		}
+	}
+
+	.tips-title {
+		padding-left: 30rpx;
+		margin-top: 20rpx;
+		font-size: 24rpx;
+		color: #333;
+	}
+</style>

+ 20 - 5
pages/users/user_spread_user/index.vue

@@ -58,8 +58,14 @@
 						<text class="iconfont icon-xiangyou"></text>
 					</view>
 				</view>
-				<view class="com-count" @click="jumbPath(6)">
-					{{userInfo.commissionCount || 0.00}}
+				<view class="box-top">
+					<view class="com-count" @click="jumbPath(6)">
+
+						{{userInfo.commissionCount || 0.00}}
+					</view>
+					<view class="buttomtxt" @click="jumbPath(11)">
+						佣金转换
+					</view>
 				</view>
 				<view class="box-btn">
 					<view class="item">
@@ -96,9 +102,9 @@
 					立即提现
 				</view>
 			</view>
-			<view class="price-box" >
+			<view class="price-box">
 				<view class="box-top">
-					<view >
+					<view>
 						团队业绩
 					</view>
 				</view>
@@ -106,7 +112,7 @@
 					{{userInfo.achievement || 0.00}}
 				</view>
 			</view>
-			
+
 			<view class="statistics">
 				<view class="item mb" @click="jumbPath(9)">
 					<view class="img">
@@ -303,6 +309,7 @@
 					'/pages/users/promoter-order/index',
 					'/pages/users/promoter-list/index',
 					'/pages/users/user_distribution_level/index',
+					'/pages/users/user_payment/user_spread',
 				]
 
 				uni.navigateTo({
@@ -554,6 +561,14 @@
 				.icon-xiangyou {
 					font-size: 24rpx;
 				}
+				.buttomtxt{
+					color: #FFF;
+					padding: 10rpx 20rpx;
+					background: #FFBD6B;
+					border-radius: 100rpx;
+					line-height: 1;
+					align-self: center
+				}
 			}
 
 			.com-count {

BIN=BIN
unpackage/debug/android_debug.apk


+ 300 - 229
utils/util.js

@@ -141,29 +141,29 @@ export default {
 	 * @param url 跳转路径
 	 * 选择跳转到其他小程序时,在h5也可以跳转路径
 	 */
-	JumpPath: function(url){
+	JumpPath: function(url) {
 		let arr = url.split('@APPID=');
-		if(arr.length>1){
+		if (arr.length > 1) {
 			//#ifdef MP
 			uni.navigateToMiniProgram({
-			    appId:arr[arr.length-1],// 此为生活缴费appid
-			    path:arr[0],// 此为生活缴费首页路径
-			    envVersion:"release",
-			    success: res => {
-			         console.log("打开成功", res);
-			    },
-			    fail: err => {
-			         console.log('sgdhgf',err);
-			    }
+				appId: arr[arr.length - 1], // 此为生活缴费appid
+				path: arr[0], // 此为生活缴费首页路径
+				envVersion: "release",
+				success: res => {
+					console.log("打开成功", res);
+				},
+				fail: err => {
+					console.log('sgdhgf', err);
+				}
 			})
-		 //#endif
-		 //#ifndef MP
-		 this.Tips({
-			 title: 'h5与app端不支持跳转外部小程序'
-		 });
-		 //#endif
-		}else{
-			if(url == '/pages/short_video/appSwiper/index' || url == '/pages/short_video/nvueSwiper/index'){
+			//#endif
+			//#ifndef MP
+			this.Tips({
+				title: 'h5与app端不支持跳转外部小程序'
+			});
+			//#endif
+		} else {
+			if (url == '/pages/short_video/appSwiper/index' || url == '/pages/short_video/nvueSwiper/index') {
 				//#ifdef APP
 				url = '/pages/short_video/appSwiper/index'
 				//#endif
@@ -176,7 +176,9 @@ export default {
 					url: `/pages/annex/web_view/index?url=${url}`
 				});
 			} else {
-				if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/index/index','/pages/store_cate/store_cate']
+				if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index',
+						'/pages/index/index', '/pages/store_cate/store_cate'
+					]
 					.indexOf(url.split('?')[0]) == -1) {
 					uni.navigateTo({
 						url: url
@@ -186,7 +188,7 @@ export default {
 						url: url
 					})
 				}
-			} 
+			}
 		}
 	},
 	/**
@@ -281,7 +283,7 @@ export default {
 				ctx.setFontSize(33)
 				ctx.setFillStyle('#fff');
 				ctx.setTextAlign('center');
-				ctx.fillText(posterTitle, WIDTH/2, 65);
+				ctx.fillText(posterTitle, WIDTH / 2, 65);
 				ctx.save();
 				ctx.drawImage(arr2[1], 32, 141, 685, 685);
 				ctx.save();
@@ -356,7 +358,7 @@ export default {
 				ctx.setFillStyle('#999');
 				// ctx.fillText('长按识别图中的二维码查看商品详情', 26, 1263);
 				ctx.setTextAlign('center');
-				ctx.fillText('长按识别图中的二维码查看商品详情', WIDTH/2, 1272);
+				ctx.fillText('长按识别图中的二维码查看商品详情', WIDTH / 2, 1272);
 				ctx.save();
 				let r = 93;
 				let d = r * 2;
@@ -550,25 +552,25 @@ export default {
 					ctx.setFontSize(10);
 				}
 				const CONTENT_ROW_LENGTH = 30;
-				const store_name = '邀请您加入'+sitename;
+				const store_name = '邀请您加入' + sitename;
 				let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
-				     CONTENT_ROW_LENGTH);
-				    if (contentRows > 2) {
-				     contentRows = 2;
-				     let textArray = contentArray.slice(0, 2);
-				     textArray[textArray.length - 1] += '...';
-				     contentArray = textArray;
-				    }
-				    ctx.setTextAlign('left');
-				    // ctx.setFontSize(38);
-				    ctx.setFillStyle('#000');
-				    let contentHh = 38;
-				    for (let m = 0; m < contentArray.length; m++) {
-				     if (m) {
-				      ctx.fillText(contentArray[m], w * markx, h * marky+14);
-				     } else {
-				      ctx.fillText(contentArray[m], w * markx, h * marky);
-				     }
+					CONTENT_ROW_LENGTH);
+				if (contentRows > 2) {
+					contentRows = 2;
+					let textArray = contentArray.slice(0, 2);
+					textArray[textArray.length - 1] += '...';
+					contentArray = textArray;
+				}
+				ctx.setTextAlign('left');
+				// ctx.setFontSize(38);
+				ctx.setFillStyle('#000');
+				let contentHh = 38;
+				for (let m = 0; m < contentArray.length; m++) {
+					if (m) {
+						ctx.fillText(contentArray[m], w * markx, h * marky + 14);
+					} else {
+						ctx.fillText(contentArray[m], w * markx, h * marky);
+					}
 				}
 				// ctx.fillText('邀请您加入' + sitename, w * markx, h * marky);
 				ctx.save();
@@ -630,72 +632,97 @@ export default {
 	 */
 	uploadImageOne: function(opt, successCallback, errorCallback) {
 		let that = this;
-		if (typeof opt === 'string') {
-			let url = opt;
-			opt = {};
-			opt.url = url;
+		// #ifdef APP
+		if (permision.isIOS) {
+			upimg()
+		} else {
+			let title = '申请相册权限';
+			let content = "是否允许访问相册用于上传图片?"
+			uni.showModal({
+				title,
+				content,
+				cancelText: '拒绝',
+				confirmText: '允许',
+				success: res => {
+					if (res.confirm) {
+						upimg()
+					}
+				},
+			});
 		}
-		let count = opt.count || 1,
-			sizeType = opt.sizeType || ['compressed'],
-			sourceType = opt.sourceType || ['album', 'camera'],
-			is_load = opt.is_load || true,
-			uploadUrl = opt.url || '',
-			inputName = opt.name || 'pics',
-			fileType = opt.fileType || 'image';
-		uni.chooseImage({
-			count: count, //最多可以选择的图片总数  
-			sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
-			sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
-			success: function(res) {
-				//启动上传等待中...  
-				uni.showLoading({
-					title: '图片上传中',
-				});
-				uni.uploadFile({
-					url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
-					filePath: res.tempFilePaths[0],
-					fileType: fileType,
-					name: inputName,
-					formData: {
-						'filename': inputName
-					},
-					header: {
-						// #ifdef MP
-						"Content-Type": "multipart/form-data",
-						// #endif
-						[TOKENNAME]: 'Bearer ' + store.state.app.token
-					},
-					success: function(res) {
-						uni.hideLoading();
-						if (res.statusCode == 403) {
-							that.Tips({
-								title: res.data
-							});
-						} else if (res.statusCode == 413) {
-							that.Tips({
-								title: '上传图片失败,请重新上传小尺寸图片'
-							});
-						} else {
-							let data = res.data ? JSON.parse(res.data) : {};
-							if (data.status == 200) {
-								successCallback && successCallback(data)
-							} else {
-								errorCallback && errorCallback(data);
+		// #endif
+		// #ifndef APP
+		upimg()
+		// #endif
+		function upimg() {
+			if (typeof opt === 'string') {
+				let url = opt;
+				opt = {};
+				opt.url = url;
+			}
+			let count = opt.count || 1,
+				sizeType = opt.sizeType || ['compressed'],
+				sourceType = opt.sourceType || ['album', 'camera'],
+				is_load = opt.is_load || true,
+				uploadUrl = opt.url || '',
+				inputName = opt.name || 'pics',
+				fileType = opt.fileType || 'image';
+			uni.chooseImage({
+				count: count, //最多可以选择的图片总数  
+				sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
+				sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
+				success: function(res) {
+					//启动上传等待中...  
+					uni.showLoading({
+						title: '图片上传中',
+					});
+					uni.uploadFile({
+						url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
+						filePath: res.tempFilePaths[0],
+						fileType: fileType,
+						name: inputName,
+						formData: {
+							'filename': inputName
+						},
+						header: {
+							// #ifdef MP
+							"Content-Type": "multipart/form-data",
+							// #endif
+							[TOKENNAME]: 'Bearer ' + store.state.app.token
+						},
+						success: function(res) {
+							uni.hideLoading();
+							if (res.statusCode == 403) {
+								that.Tips({
+									title: res.data
+								});
+							} else if (res.statusCode == 413) {
 								that.Tips({
-									title: data.msg
+									title: '上传图片失败,请重新上传小尺寸图片'
 								});
+							} else {
+								let data = res.data ? JSON.parse(res.data) : {};
+								if (data.status == 200) {
+									successCallback && successCallback(data)
+								} else {
+									errorCallback && errorCallback(data);
+									that.Tips({
+										title: data.msg
+									});
+								}
 							}
+						},
+						fail: function(res) {
+							uni.hideLoading();
+							that.Tips({
+								title: '上传图片失败'
+							});
 						}
-					},
-					fail: function(res) {
-						uni.hideLoading();
-						that.Tips({
-							title: '上传图片失败'
-						});
-					}
-				})
-			}
-		})
+					})
+				}
+			})
+
+		}
 	},
 	/*
 	 * 单图上传压缩版
@@ -705,81 +732,115 @@ export default {
 	 */
 	uploadImageChange: function(opt, successCallback, errorCallback, sizeCallback) {
 		let that = this;
-		if (typeof opt === 'string') {
-			let url = opt;
-			opt = {};
-			opt.url = url;
+		// #ifdef APP
+		if (permision.isIOS) {
+			upimg()
+		} else {
+			let title = '申请相册权限';
+			let content = "是否允许访问相册用于上传图片?"
+			uni.showModal({
+				title,
+				content,
+				cancelText: '拒绝',
+				confirmText: '允许',
+				success: res => {
+					if (res.confirm) {
+						upimg()
+					}
+				},
+			});
 		}
-		let count = opt.count || 1,
-			sizeType = opt.sizeType || ['compressed'],
-			sourceType = opt.sourceType || ['album', 'camera'],
-			is_load = opt.is_load || true,
-			uploadUrl = opt.url || '',
-			inputName = opt.name || 'pics',
-			fileType = opt.fileType || 'image';
-		uni.chooseImage({
-			count: count, //最多可以选择的图片总数  
-			sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
-			sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
-			success: function(res) {
-				//启动上传等待中...  
-				let imgSrc
-				let objImg = res.tempFilePaths;
-				objImg.forEach(item => {
-					uni.getImageInfo({
-						src: item,
-						success(ress) {
-							uni.showLoading({
-								title: '图片上传中',
-							});
-							if (res.tempFiles[0].size <= 2097152) {
-								uploadImg(ress.path)
-								return
-							}
-							// uploadImg(canvasPath.tempFilePath)
-							let canvasWidth, canvasHeight, xs, maxWidth = 750
-							xs = ress.width / ress.height // 宽高比例
-							if (ress.width > maxWidth) {
-								canvasWidth = maxWidth // 这里是最大限制宽度
-								canvasHeight = maxWidth / xs
-							} else {
-								canvasWidth = ress.width
-								canvasHeight = ress.height
-							}
-							sizeCallback && sizeCallback({
-								w: canvasWidth,
-								h: canvasHeight
-							})
-							let canvas = uni.createCanvasContext('canvas');
-							canvas.width = canvasWidth
-							canvas.height = canvasHeight
-							canvas.clearRect(0, 0, canvasWidth, canvasHeight);
-							canvas.drawImage(ress.path, 0, 0, canvasWidth, canvasHeight)
-							canvas.save();
-							// 这里的画布drawImage是一种异步属性  可能存在未绘制全就执行了draw的问题  so添加延迟
-							setTimeout(e => {
-								canvas.draw(true, () => {
-									uni.canvasToTempFilePath({
-										canvasId: 'canvas',
-										fileType: 'JPEG',
-										destWidth: canvasWidth,
-										destHeight: canvasHeight,
-										quality: 0.7,
-										success: function(
-											canvasPath) {
-											uploadImg(
-												canvasPath
-												.tempFilePath
-												)
-										}
-									})
+		// #endif
+		// #ifndef APP
+		upimg()
+		// #endif
+		function upimg() {
+			if (typeof opt === 'string') {
+				let url = opt;
+				opt = {};
+				opt.url = url;
+			}
+			let count = opt.count || 1,
+				sizeType = opt.sizeType || ['compressed'],
+				sourceType = opt.sourceType || ['album', 'camera'],
+				is_load = opt.is_load || true,
+				uploadUrl = opt.url || '',
+				inputName = opt.name || 'pics',
+				fileType = opt.fileType || 'image';
+			uni.chooseImage({
+				count: count, //最多可以选择的图片总数  
+				sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
+				sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
+				success: function(res) {
+					//启动上传等待中...  
+					let imgSrc
+					let objImg = res.tempFilePaths;
+					objImg.forEach(item => {
+						uni.getImageInfo({
+							src: item,
+							success(ress) {
+								uni.showLoading({
+									title: '图片上传中',
 								});
-							}, 200)
-						}
+								if (res.tempFiles[0].size <=
+									2097152) {
+									uploadImg(ress.path)
+									return
+								}
+								// uploadImg(canvasPath.tempFilePath)
+								let canvasWidth, canvasHeight, xs,
+									maxWidth = 750
+								xs = ress.width / ress
+									.height // 宽高比例
+								if (ress.width > maxWidth) {
+									canvasWidth =
+										maxWidth // 这里是最大限制宽度
+									canvasHeight = maxWidth / xs
+								} else {
+									canvasWidth = ress.width
+									canvasHeight = ress.height
+								}
+								sizeCallback && sizeCallback({
+									w: canvasWidth,
+									h: canvasHeight
+								})
+								let canvas = uni
+									.createCanvasContext('canvas');
+								canvas.width = canvasWidth
+								canvas.height = canvasHeight
+								canvas.clearRect(0, 0, canvasWidth,
+									canvasHeight);
+								canvas.drawImage(ress.path, 0, 0,
+									canvasWidth, canvasHeight)
+								canvas.save();
+								// 这里的画布drawImage是一种异步属性  可能存在未绘制全就执行了draw的问题  so添加延迟
+								setTimeout(e => {
+									canvas.draw(true,
+										() => {
+											uni.canvasToTempFilePath({
+												canvasId: 'canvas',
+												fileType: 'JPEG',
+												destWidth: canvasWidth,
+												destHeight: canvasHeight,
+												quality: 0.7,
+												success: function(
+													canvasPath
+												) {
+													uploadImg
+														(
+															canvasPath
+															.tempFilePath
+														)
+												}
+											})
+										});
+								}, 200)
+							}
+						})
 					})
-				})
-			}
-		})
+				}
+			})
+		}
 
 		function uploadImg(filePath) {
 			uni.uploadFile({
@@ -846,16 +907,16 @@ export default {
 					'&openid=' + userInfo.openid;
 				let urls = encodeURIComponent(href.indexOf('?') === -1 ? hrefO : hrefT);
 				if (data.customer_url.indexOf('work.weixin.qq.com') > 0) {
-				// #ifdef MP
+					// #ifdef MP
 					wx.openCustomerServiceChat({
 						extInfo: {
 							url: data.customer_url
 						},
 						corpId: data.wechat_work_corpid,
-						showMessageCard: show?true:false,
-						sendMessageTitle: show?storeInfo.store_name:'',
-						sendMessagePath: show?storeInfo.path:'',
-						sendMessageImg: show?storeInfo.image:'',
+						showMessageCard: show ? true : false,
+						sendMessageTitle: show ? storeInfo.store_name : '',
+						sendMessagePath: show ? storeInfo.path : '',
+						sendMessageImg: show ? storeInfo.image : '',
 						success(res) {},
 						fail(err) {
 							self.Tips({
@@ -863,13 +924,13 @@ export default {
 							});
 						}
 					})
-				// #endif
-				// #ifdef H5
-				return window.location.href = data.customer_url
-				// #endif
-				// #ifdef APP-PLUS
-				plus.runtime.openURL(data.customer_url)
-				// #endif
+					// #endif
+					// #ifdef H5
+					return window.location.href = data.customer_url
+					// #endif
+					// #ifdef APP-PLUS
+					plus.runtime.openURL(data.customer_url)
+					// #endif
 				} else {
 					uni.navigateTo({
 						url: `/pages/annex/web_view/index?url=${urls}`
@@ -886,7 +947,7 @@ export default {
 			});
 		})
 	},
-	
+
 	/**
 	 * 小程序头像获取上传
 	 * @param uploadUrl 上传接口地址
@@ -896,49 +957,59 @@ export default {
 	 */
 	uploadImgs(uploadUrl, filePath, successCallback, errorCallback) {
 		let that = this;
-		uni.uploadFile({
-			url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
-			filePath: filePath,
-			fileType: 'image',
-			name: 'pics',
-			formData: {
-				'filename': 'pics'
-			},
-			header: {
-				// #ifdef MP
-				"Content-Type": "multipart/form-data",
-				// #endif
-				[TOKENNAME]: 'Bearer ' + store.state.app.token
-			},
-			success: (res) => {
-				uni.hideLoading();
-				if (res.statusCode == 403) {
-					that.Tips({
-						title: res.data
-					});
-				} else if (res.statusCode == 413) {
-					that.Tips({
-						title: '上传图片失败,请重新上传小尺寸图片'
-					});
-				} else {
-					let data = res.data ? JSON.parse(res.data) : {};
-					if (data.status == 200) {
-						successCallback && successCallback(data)
-					} else {
-						errorCallback && errorCallback(data);
-						that.Tips({
-							title: data.msg
-						});
-					}
+		uni.showModal({
+			title,
+			content,
+			cancelText: '拒绝',
+			confirmText: '允许',
+			success: res => {
+				if (res.confirm) {
+					uni.uploadFile({
+						url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
+						filePath: filePath,
+						fileType: 'image',
+						name: 'pics',
+						formData: {
+							'filename': 'pics'
+						},
+						header: {
+							// #ifdef MP
+							"Content-Type": "multipart/form-data",
+							// #endif
+							[TOKENNAME]: 'Bearer ' + store.state.app.token
+						},
+						success: (res) => {
+							uni.hideLoading();
+							if (res.statusCode == 403) {
+								that.Tips({
+									title: res.data
+								});
+							} else if (res.statusCode == 413) {
+								that.Tips({
+									title: '上传图片失败,请重新上传小尺寸图片'
+								});
+							} else {
+								let data = res.data ? JSON.parse(res.data) : {};
+								if (data.status == 200) {
+									successCallback && successCallback(data)
+								} else {
+									errorCallback && errorCallback(data);
+									that.Tips({
+										title: data.msg
+									});
+								}
+							}
+						},
+						fail: (err) => {
+							uni.hideLoading();
+							that.Tips({
+								title: '上传图片失败'
+							});
+						}
+					})
 				}
 			},
-			fail: (err) => {
-				uni.hideLoading();
-				that.Tips({
-					title: '上传图片失败'
-				});
-			}
-		})
+		});
 	},
 	/**
 	 * 小程序比较版本信息
@@ -1206,4 +1277,4 @@ export default {
 		},
 	}
 
-}
+}