cmy 9 месяцев назад
Родитель
Сommit
0e7355fe74

+ 9 - 1
api/order.js

@@ -109,7 +109,15 @@ export function orderComment(data) {
 export function orderPay(data) {
 	return request.post('order/pay', data);
 }
-
+/**
+ * 订单支付
+ * @param object data
+ */
+export function orderCheck(order_id) {
+	return request.get('order/check', {
+		order_id
+	});
+}
 /**
  * 订单统计数据
  */

+ 8 - 0
api/user.js

@@ -313,6 +313,14 @@ export function extractCash(data) {
 export function energyExchange(data) {
 	return request.post('energy/exchange', data)
 }
+/**
+ * 能量转余额
+ * @param object data
+ */
+export function energyMoney(data) {
+	return request.post('energy/money', data)
+}
+
 
 /**
  * 提现银行/提现最低金额

+ 2 - 1
components/d_goodList/index.vue

@@ -18,7 +18,8 @@
 			<!-- #endif -->
 			<view class="bottom acea-row row-between-wrapper">
 				<view class="sales acea-row row-middle">
-					<view class="money font-color"><text>¥</text>{{item.price}}</view>
+					<view class="money font-color"><!-- <text>¥</text> -->{{item.price*1}}
+					<text>积分</text></view>
 					<view>已售 {{item.sales}}</view>
 				</view>
 				<view v-if="item.stock>0">

+ 8 - 1
components/groupGoodsList/index.vue

@@ -16,7 +16,14 @@
 					<view class="name-wrap">
 						<view class="name">{{ cell.productInfo.store_name }}</view>
 						<view class="attr">{{ cell.productInfo.attrInfo.suk }}</view>
-						<view class="money">¥{{ cell.truePrice }}</view>
+						<view class="money">
+							<template v-if="cell.awardPrice*1>0">
+								¥{{ cell.truePrice }}
+							</template>
+							<template v-else>
+								{{ cell.truePrice*1 }}积分
+							</template>
+						</view>
 					</view>
 					<view class="">x {{ cell.cart_num }}</view>
 				</view>

+ 6 - 1
components/orderGoods/index.vue

@@ -38,7 +38,12 @@
 						<view class='attr line1' v-if="item.productInfo.attrInfo">{{item.productInfo.attrInfo.suk}}</view>
 						<view class='money font-color pic'>
 							<text v-if="item.type != 8">
-								¥{{item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price}}
+								<template v-if="item.awardPrice*1>0">
+									¥{{ item.productInfo.attrInfo?item.productInfo.attrInfo.price:item.productInfo.price }}
+								</template>
+								<template v-else>
+									{{ iitem.productInfo.attrInfo?(item.productInfo.attrInfo.price*1):(item.productInfo.price*1) }}积分
+								</template>
 							</text>
 							<text class="valid" v-if="!item.is_valid">{{shippingType==0?'不送达':'不支持自提'}}</text>
 						</view>

+ 98 - 34
components/payment/index.vue

@@ -30,11 +30,16 @@
 
 <script>
 	import {
-		orderPay
+		orderPay,
+		orderCheck
 	} from '@/api/order.js';
 	import colors from '@/mixins/color.js';
 	export default {
 		props: {
+			id: {
+				type: Number,
+				default: 0
+			},
 			payMode: {
 				type: Array,
 				default: function() {
@@ -58,7 +63,7 @@
 				default: false
 			}
 		},
-		mixins:[colors],
+		mixins: [colors],
 		data() {
 			return {
 				formContent: '',
@@ -88,7 +93,7 @@
 		methods: {
 			payType(number, paytype, index) {
 				this.active = index;
-				console.log(this.active,'this.active');
+				console.log(this.active, 'this.active');
 				this.paytype = paytype;
 				this.number = number;
 				this.$emit('changePayType', paytype)
@@ -98,7 +103,7 @@
 					action: 'payClose'
 				});
 			},
-			goPay: function(number, paytype) {
+			goPay: async function(number, paytype) {
 				if (this.isCall) {
 					return this.$emit('onChangeFun', {
 						action: 'payCheck',
@@ -109,33 +114,90 @@
 				if (!that.order_id) return that.$util.Tips({
 					title: '请选择要支付的订单'
 				});
+				if (that.id > 0) {
+					try {
+						const {
+							data
+						} = await orderCheck(that.id)
+					} catch (error) {
+						console.log(error)
+					}
+					const tip = `此次复投起提示需要支付至少${parseFloat(that.totalPrice*0.1*data.reorder_count)}的现金,否则出局时消费分比例加10%`;
+					if (paytype == 'yue') {
+						uni.showModal({
+							title: '提示',
+							content:tip,
+							cancelText: '取消支付',
+							confirmText: '继续支付',
+							success: res => {
+								if(res.confirm){
+									this.payMoney(number, paytype)
+								}
+							}
+						});
+					}
+					if (paytype != 'yue') {
+						if (data.reorder_count > 1) {
+							uni.showModal({
+								title: '提示',
+								editable:true,
+								placeholderText:tip,
+								cancelText: '取消支付',
+								success: res => {
+									if(res.confirm){
+										if(!isNaN(res.content)){
+											this.payMoney(number, paytype,res.content)
+										}else{
+											uni.showToast({
+												title: '请输入数字',
+												icon:'error'
+											});
+										}
+									}
+								},
+								fail: () => {},
+								complete: () => {}
+							});
+						}
+					}
+				}else{
+					this.payMoney(number, paytype)
+				}
+
+			},
+			//支付方法
+			async payMoney(number, paytype,yue_pay=0) {
+				let that = this;
 				if (paytype == 'yue' && parseFloat(number) < parseFloat(that.totalPrice)) return that.$util.Tips({
 					title: '余额不足!'
 				});
 				uni.showLoading({
 					title: '支付中'
 				});
-				let upData={
-						uni: that.order_id,
-						paytype: paytype,
-						// #ifdef MP 
-						'from': 'routine',
-						// #endif
-						// #ifdef H5
-						'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
-						// #endif
-						// #ifdef H5
-						quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location
-							.port +
-							'/pages/goods/order_details/index?order_id=' + this.order_id : location.protocol +
-							'//' + location.hostname +
-							'/pages/goods/order_details/index?order_id=' + this.order_id
-						// #endif
-						// #ifdef APP-PLUS
-						quitUrl: '/pages/goods/order_details/index?order_id=' + this.order_id
-						// #endif
+				let upData = {
+					yue_pay,
+					uni: that.order_id,
+					paytype: paytype,
+					// #ifdef MP 
+					'from': 'routine',
+					// #endif
+					// #ifdef H5
+					'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
+					// #endif
+					// #ifdef H5
+					quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location
+						.port +
+						'/pages/goods/order_details/index?order_id=' + this.order_id : location.protocol +
+						'//' + location.hostname +
+						'/pages/goods/order_details/index?order_id=' + this.order_id
+					// #endif
+					// #ifdef APP-PLUS
+					quitUrl: '/pages/goods/order_details/index?order_id=' + this.order_id
+					// #endif
 				}
-				orderPay(upData).then(res => {
+				try {
+					const res = await orderPay(upData)
+
 					let jsConfig = res.data.result.jsConfig;
 					// console.log(res,upData,'神英优选')
 					switch (paytype) {
@@ -145,11 +207,11 @@
 							});
 
 							// #ifdef MP
-							let mp_pay_name=''
-							if(uni.requestOrderPayment){
-								mp_pay_name='requestOrderPayment'
-							}else{
-								mp_pay_name='requestPayment'
+							let mp_pay_name = ''
+							if (uni.requestOrderPayment) {
+								mp_pay_name = 'requestOrderPayment'
+							} else {
+								mp_pay_name = 'requestPayment'
 							}
 							uni[mp_pay_name]({
 								timeStamp: jsConfig.timestamp,
@@ -219,7 +281,7 @@
 									.catch(function(res) {
 										if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
 											title: '取消支付'
-										},() => {
+										}, () => {
 											that.$emit('onChangeFun', {
 												action: 'pay_fail'
 											});
@@ -339,7 +401,7 @@
 							// #endif
 							break;
 					}
-				}).catch(err => {
+				} catch (err) {
 					uni.hideLoading();
 					return that.$util.Tips({
 						title: err
@@ -348,16 +410,18 @@
 							action: 'pay_fail'
 						});
 					});
-				})
+					//TODO handle the exception
+				}
 			}
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-	.bgcolor{
+	.bgcolor {
 		background-color: var(--view-theme)
 	}
+
 	.payment {
 		position: fixed;
 		bottom: 0;
@@ -470,4 +534,4 @@
 		font-size: 40rpx;
 		color: #ccc;
 	}
-</style>
+</style>

+ 23 - 3
components/productWindow/index.vue

@@ -19,11 +19,27 @@
 							<text v-if="type =='points'">
 								<text v-if="parseFloat(attr.productSelect.integral)"><text class="num">{{ attr.productSelect.integral }}</text>积分</text>
 								<text v-if="parseFloat(attr.productSelect.price) && parseFloat(attr.productSelect.integral)">+</text>
-								<text v-if="parseFloat(attr.productSelect.price)">¥<text class="num">{{ attr.productSelect.price }}</text></text>
+								<text v-if="parseFloat(attr.productSelect.price)">
+									<template v-if="isAwardPrice">
+									¥
+									<text class="num" v-text="attr.productSelect.price || 0"></text>
+									</template>
+									<template v-else>
+										<text class="num" v-text="attr.productSelect.price?attr.productSelect.price*1 : 0"></text><text>积分</text>
+									</template>
+								</text>
 							</text>
-							<text v-else>¥<text class="num">{{ attr.productSelect.price }}</text></text>
+							<text v-else>
+								<template v-if="isAwardPrice">
+								¥
+								<text class="num" v-text="attr.productSelect.price || 0"></text>
+								</template>
+								<template v-else>
+									<text class="num" v-text="attr.productSelect.price?attr.productSelect.price*1 : 0"></text><text>积分</text>
+								</template>
+								</text>
 							<text class='vip-money'
-								v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'member'">¥{{attr.productSelect.vip_price}}</text>
+								v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'member'"><!--  -->{{attr.productSelect.vip_price}}积分</text>
 							<view class="vipImg" v-if="is_vip>0 && attr.productSelect.vip_price && storeInfo && storeInfo.price_type == 'member'">
 								<image src="../../static/images/vip.png"></image>
 							</view>
@@ -156,6 +172,10 @@
 		  addressWindow
 		},
 		props: {
+			isAwardPrice:{
+				type:Boolean,
+				value:false
+			},
 			isStoreBuy: {
 				type: Number,
 				value: 0

+ 3 - 3
manifest.json

@@ -2,8 +2,8 @@
     "name" : "神英优选",
     "appid" : "__UNI__70BC0AE",
     "description" : "神英优选商城",
-    "versionName" : "3.0.9",
-    "versionCode" : 309,
+    "versionName" : "3.1.3",
+    "versionCode" : 313,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -224,7 +224,7 @@
             "https" : false,
             "proxy" : {
                 "^/api" : {
-                    "target" : "http://test.syushop.com"
+                    "target" : "https://www.senyinkj.cn"
                 }
             }
         },

+ 6 - 6
pages/goods/goods_list/index.vue

@@ -98,7 +98,7 @@
 							<view class='money font-color' :class='is_switch==true?"":"on"'>¥<text
 									class='num'>{{item.price}}</text></view>
 							<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
-								<view>¥{{item.vip_price}}</view>
+								<view><!--  -->{{item.vip_price}}积分</view>
 								<view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
 										class="iconfont icon-huangguan4"></text>SVIP</view>
 								<view class="icon" v-if="item.price_type && item.price_type == 'level'"><text
@@ -171,7 +171,7 @@
 										v-if="item.price.toString().split('.').length>1">.{{item.price.toString().split(".")[1]}}</text>
 								</view>
 								<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
-									<view>¥{{item.vip_price}}</view>
+									<view><!--  -->{{item.vip_price}}积分</view>
 									<!-- 	<image src='../../static/images/vip.png' v-if="item.price_type == 'member'"></image> -->
 									<view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
 											class="iconfont icon-huangguan4"></text>SVIP</view>
@@ -200,12 +200,12 @@
 							<text class="label" v-if="item.promotions.title">{{item.promotions.title}}</text>
 							<view class="vip acea-row row-middle">
 								<view class='money font-color'>
-									¥<text class='num'>{{item.price.toString().split(".")[0]}}</text>
-									<text class='nums'
-										v-if="item.price.toString().split('.').length>1">.{{item.price.toString().split(".")[1]}}</text>
+									<!--  --><text class='num'>{{item.price.toString().split(".")[0]}}</text>积分
+									<!-- <text class='nums'
+										v-if="item.price.toString().split('.').length>1">.{{item.price.toString().split(".")[1]}}</text> -->
 								</view>
 								<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
-									<view>¥{{item.vip_price}}</view>
+									<view><!--  -->{{item.vip_price}}积分</view>
 									<view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
 											class="iconfont icon-huangguan4"></text>SVIP</view>
 									<view class="icon" v-if="item.price_type && item.price_type == 'level'"><text

+ 2 - 0
pages/goods/order_confirm/index.vue

@@ -907,6 +907,7 @@
 		  });
       },
       payCheck(type) {
+		  console.log(type,'type')
         this.payType = type;
         this.SubOrder();
       },
@@ -1363,6 +1364,7 @@
             goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + res.msg +
             '&type=3' + '&totalPrice=' + this.totalPrice
           switch (status) {
+			case 'NOTICE':
             case 'ORDER_EXIST':
             case 'EXTEND_ORDER':
             case 'PAY_ERROR':

+ 1 - 1
pages/goods/order_details/index.vue

@@ -428,7 +428,7 @@
 		</view>
 		<home v-show="!aleartStatus && !invShow && navigation"></home>
 		<view class="mask" v-if="refund_close" @click="refund_close = false"></view>
-		<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
+		<payment :id='orderInfo.id' :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
 			:totalPrice='totalPrice'></payment>
 
 

+ 1 - 1
pages/goods_cate/goods_cate2.vue

@@ -101,7 +101,7 @@
 				<view class="iconfont icon-gouwuche-yangshi2"></view>
 			</view>
 			<view class="money acea-row row-middle" :class="cartNum>0?'':'noCart'">
-				<view>¥<text class="num">{{totalPrice}}</text></view>
+				<view><!--  --><text class="num">{{totalPrice}}</text>积分</view>
 				<view class="bnt" @click="subOrder">去结算</view>
 			</view>
 		</view>

+ 7 - 1
pages/goods_details/index.vue

@@ -110,8 +110,14 @@
 									<view class="wrapper on">
 												<view class="share acea-row row-between row-bottom" v-if="promotions_type !=1 && !activityBg">
 													<view class="money font-color skeleton-rect">
+														<template v-if="storeInfo.award_price*1>0">
 														<text class="num" v-text="storeInfo.price || 0"></text>
+														</template>
+														<template v-else>
+															<text class="num" v-text="storeInfo.price?storeInfo.price*1 : 0"></text><text>积分</text>
+														</template>
+														
 														<text v-if="storeInfo.spec_type">起</text>
 														<text class="vip-money"
 															v-if="storeInfo.vip_price && parseFloat(storeInfo.vip_price) > 0 && ((storeInfo.is_vip == 1 && storeInfo.price_type == 'member') || storeInfo.price_type == 'level')">¥{{ storeInfo.vip_price }}</text>
@@ -436,7 +442,7 @@
 							@listenerActionSheet="listenerActionSheet" @boxStatus="boxStatus" @closeChange="closeChange"
 							v-if="base64Show && !fromPage"></shareRedPackets>
 						<!-- 属性组件 -->
-						<productWindow ref='productWindow' :attr="attr" :isShow="1" :iSplus="1" :cusPreviewImg='1' :storeInfo="storeInfo" :productType="storeInfo.product_type" :productId="storeInfo.id" :isStoreBuy="is_store_buy"
+						<productWindow :isAwardPrice='storeInfo.award_price*1>0' ref='productWindow' :attr="attr" :isShow="1" :iSplus="1" :cusPreviewImg='1' :storeInfo="storeInfo" :productType="storeInfo.product_type" :productId="storeInfo.id" :isStoreBuy="is_store_buy"
 							@myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
 							@attrVal="attrVal" @iptCartNum="iptCartNum" @getImg="showImg" @deliveryFun="deliveryFun"
 							@onAddressId="onAddressId" @onstoreId="onstoreId" id="product-window" :is_vip="is_vip">

+ 33 - 3
pages/index/components/goodList.vue

@@ -18,14 +18,20 @@
 								<view class="title line2" v-if="titleShow">{{ item.store_name }}</view>
 								<slot name="center"></slot>
 								<view class="old-price" v-if="opriceShow">
-									<text>¥</text>
+									<text v-if="item.award_price*1>0">¥</text>
 									{{ item.ot_price }}
 								</view>
 							</view>
 							<view class="price" :style="'color:'+fontColor">
 								<view v-if="priceShow">
+									<template v-if="item.award_price*1>0">
 									<text>¥</text>
 									{{ item.price }}
+									</template>
+									<template v-else>
+										{{ item.price*1 }}
+										<text>积分</text>
+									</template>
 								</view>
 								<view class="txt" :style="'border:1px solid '+labelColor+';color:'+labelColor" :class="priceShow?'':'on'" v-if="item.checkCoupon && couponShow">券</view>
 							</view>
@@ -62,13 +68,25 @@
 							<view class="title line1" v-if="titleShow">{{ item.store_name }}</view>
 							<slot name="center"></slot>
 							<view class="old-price" v-if="opriceShow">
-								<text>¥</text>
+								<template v-if="item.award_price*1>0">
+								<text>¥</text>
 								{{ item.ot_price }}
+								</template>
+								<template v-else>
+									{{ item.ot_price*1 }}
+									<text>积分</text>
+								</template>
 							</view>
 							<view class="price" :style="'color:'+fontColor">
 								<view v-if="priceShow">
+									<template v-if="item.award_price*1>0">
 									<text>¥</text>
 									{{ item.price }}
+									</template>
+									<template v-else>
+										{{ item.price*1 }}
+										<text>积分</text>
+									</template>
 								</view>
 								<view class="txt" :style="'border:1px solid '+labelColor+';color:'+labelColor" :class="priceShow?'':'on'" v-if="item.checkCoupon && couponShow">券</view>
 							</view>
@@ -92,14 +110,26 @@
 								<view class="title line1" v-if="titleShow">{{ item.store_name }}</view>
 								<slot name="center"></slot>
 								<view class="old-price" v-if="opriceShow">
-									<text>¥</text>
+									<template v-if="item.award_price*1>0">
+									<text>¥</text>
 									{{ item.ot_price }}
+									</template>
+									<template v-else>
+										{{ item.ot_price*1 }}
+										<text>积分</text>
+									</template>
 								</view>
 							</view>
 							<view class="price" :style="'color:'+fontColor">
 								<view v-if="priceShow">
+									<template v-if="item.award_price*1>0">
 									<text>¥</text>
 									{{ item.price }}
+									</template>
+									<template v-else>
+										{{ item.price*1 }}
+										<text>积分</text>
+									</template>
 								</view>
 								<view class="txt" :style="'border:1px solid '+labelColor+';color:'+labelColor" :class="priceShow?'':'on'" v-if="item.checkCoupon && couponShow">券</view>
 							</view>

+ 5 - 5
pages/index/index.vue

@@ -490,9 +490,11 @@
 						cancelText: '关闭',
 						confirmText: '立即查看',
 						success: res => {
-							uni.navigateTo({
-								url:this.newsd.link
-							})
+							if(res.confirm){
+								uni.navigateTo({
+									url:this.newsd.link
+								})
+							}
 						},
 						fail: () => {},
 						complete: () => {}
@@ -825,10 +827,8 @@
 			},
 			diyData() {
 				let diyData = uni.getStorageSync('diyData');
-				console.log(JSON.parse(diyData), 'diyData');
 				if (diyData) {
 					getDiyVersion(0).then(res => {
-						console.log(res, '5555555555555')
 						let diyVersion = uni.getStorageSync('diyVersion');
 						if ((res.data.version + '0') === diyVersion) {
 							this.setDiyData(JSON.parse(diyData));

+ 1 - 1
pages/user/index.vue

@@ -286,7 +286,7 @@
 								<view class="money">
 									{{userInfo.integral || 0}}
 								</view>
-								<view class="txt">消费分</view>
+								<view class="txt">分</view>
 							</view>
 						</view>
 					</view>

+ 111 - 5
pages/users/user_payment/energy.vue

@@ -1,8 +1,16 @@
 <template>
 	<view :style="colorStyle">
+		<view class="tab flex">
+			<view class="item" @click="tabIndex=0" :class="{action:tabIndex==0}">
+				转股权
+			</view>
+			<view class="item" @click="tableChange(1)" :class="{action:tabIndex==1}">
+				转余额
+			</view>
+		</view>
 		<view class='cash-withdrawal'>
 			<view class='wrapper'>
-				<view class='list'>
+				<view class='list' v-if="tabIndex==0">
 					<form @submit="subCash">
 						<view class='item acea-row row-between-wrapper'>
 							<view class='name'>持卡人</view>
@@ -46,6 +54,23 @@
 						<button formType="submit" class='bnt bg-color'>立即转换</button>
 					</form>
 				</view>
+				<view class="list" v-if="tabIndex==1">
+					<view class='item acea-row row-between-wrapper'>
+						<view class='name'>能量值</view>
+						<view class='input'>
+							<input v-model="energy" placeholder='请输入要转换的能量值' placeholder-class='placeholder'></input>
+						</view>
+					</view>
+					<view class='tip'>
+						当前可转能量值:<text class="price">{{userInfo.energy}}</text>
+						可兑次数:<text class="price">{{tagetNumber}}</text>
+					</view>
+					<view class='tip'>
+						手续费:<text class="price">{{userInfo.energy_to_money_commission}}%</text>实际到账:<text
+							class="price">{{moneyTimes}}</text>
+					</view>
+					<button @click="sumitYue" class='bnt bg-color'>立即兑换</button>
+				</view>
 			</view>
 		</view>
 		<home v-if="navigation"></home>
@@ -56,7 +81,8 @@
 	import {
 		energyExchange,
 		energyBank,
-		getUserInfo
+		getUserInfo,
+		energyMoney
 	} from '@/api/user.js';
 	import {
 		toLogin
@@ -78,8 +104,13 @@
 		mixins: [colors],
 		data() {
 			return {
+				energy: '',
+				tabIndex: 0,
+				stock_price: '',
 				minPrice: 0.00, //最低提现金额
-				userInfo: [],
+				userInfo: {
+					energy_to_money_switch: 0
+				},
 				prevent: true, //避免重复提交成功多次
 				moneyMaxLeng: 8,
 				withdraw_fee: '0',
@@ -87,7 +118,25 @@
 				allMoney: '', //保存当前提现金额
 			};
 		},
-		computed: mapGetters(['isLogin']),
+		computed: {
+			...mapGetters(['isLogin']),
+			moneyTimes() {
+				const commission = this.userInfo.energy_to_money_commission || 0 //手续费
+				const limit = this.userInfo.energy_to_money_times_limit || 0 //可使用
+				const times = this.userInfo.energy_to_money_times || 0 //已使用
+				const bool = this.userInfo.energy_to_money_commission || 0 //是否开启
+				return this.energy- (+(this.energy * commission / 100).toFixed(2))
+			},
+			tagetNumber() {
+				const limit = this.userInfo.energy_to_money_times_limit || 0 //可使用
+				const times = this.userInfo.energy_to_money_times || 0 //已使用
+				if (limit == '0') {
+					return "不限次数"
+				} else {
+					return limit - times
+				}
+			}
+		},
 		watch: {
 			isLogin: {
 				handler: function(newV, oldV) {
@@ -108,6 +157,45 @@
 			}
 		},
 		methods: {
+			sumitYue(){
+				uni.showLoading({
+					title:"提交中"
+				})
+				energyMoney({
+					price: this.energy,
+				}).then(res => {
+					uni.hideLoading()
+					return this.$util.Tips({
+						title: res.msg,
+						icon: 'success'
+					}, {
+						url: '/pages/users/user_spread_user/index',
+						tab: 2
+					});
+				}).catch(err => {
+					uni.hideLoading()
+					setTimeout(e => {
+						this.prevent = true
+					}, 1500)
+					return this.$util.Tips({
+						title: err
+					});
+				});
+			},
+			tableChange(num) {
+				if (num == 1) {
+					// console.log(this.userInfo.energy_to_money_switch == '1')
+					if (this.userInfo.energy_to_money_switch == '1') {
+						this.tabIndex = 1
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: '暂未开放转余额功能',
+							showCancel: false,
+						});
+					}
+				}
+			},
 			inputNum: async function(e) {
 				let val = e.detail.value;
 				let dot = val.indexOf('.');
@@ -148,7 +236,7 @@
 			subCash: function(e) {
 				let that = this,
 					value = e.detail.value;
-					console.log(value,'value')
+				console.log(value, 'value')
 				if (value.account.length == 0) return that.$util.Tips({
 					title: '请填写交易账户'
 				});
@@ -353,4 +441,22 @@
 		color: var(--view-priceColor);
 		margin-right: 20rpx;
 	}
+
+	.tab {
+		text-align: center;
+		font-size: 32rpx;
+
+		.item {
+			width: 50%;
+			height: 100rpx;
+			line-height: 100rpx;
+			border-bottom: 1px solid #DDDDDD;
+
+			&.action {
+				border-color: $uni-color-error;
+				color: #FFF;
+				background-color: $uni-color-error;
+			}
+		}
+	}
 </style>