lhl 2 سال پیش
والد
کامیت
09aee66bf4

+ 17 - 1
api/wall/index.js

@@ -112,6 +112,20 @@ function shouzhi(data) {
 	})
 }
 
+function bankTx(data) {
+	return request({
+		url: '/api/vip/bankTxOrder',
+		method: 'post',
+		data
+	})
+}
+function bankFind(data) {
+	return request({
+		url: '/api/vip/bankFind',
+		method: 'get',
+		data
+	})
+}
 export default {
 	income,
 	txOrder,
@@ -127,5 +141,7 @@ export default {
 	Wxpaycz,
 	tx_farm,
 	txlist,
-	shouzhi
+	shouzhi,
+	bankTx,
+	bankFind
 }

+ 32 - 2
components/payment/payment.vue

@@ -41,6 +41,17 @@
 							</radio>
 						</label>
 					</view>
+					<view v-if="ncb" class="type-item" @click="changepaytype(4)">
+						<u-icon name="bag-fill" color="rgb(224, 116, 114)" size="30"></u-icon>
+						<view class="con">
+							<text class="tit">农场币</text>
+							<text style="padding-top: 10rpx;">可用余额 ¥{{farm_coin}}</text>
+						</view>
+						<label class="radio">
+							<radio value="2" :color="primary" :checked='params.paytype == 4' />
+							</radio>
+						</label>
+					</view>
 				</radio-group>
 			</view>
 
@@ -82,9 +93,10 @@
 	} from '../../js/underscore';
 	export default {
 		name: "payment",
-		props: ["channel", "weixinpay", "alipay", "zhtpay"], //1:(商品,砍价 ,拼团),2:认养,,3:充值,4:租地,5:活动,6:保证金
+		props: ["channel", "weixinpay", "alipay", "zhtpay","ncb"], //1:(商品,砍价 ,拼团),2:认养,,3:充值,4:租地,5:活动,6:保证金
 		data() {
 			return {
+				farm_coin: 0,
 				primary: this.$theme.primary,
 				settingFile: getApp().globalData.siteinfo,
 				payshow: false,
@@ -106,6 +118,7 @@
 			wallApi.income({}).then(res => {
 				if (res.status == 200) {
 					that.balance = res.data.money; //余额
+					that.farm_coin = res.data.farm_coin
 				}
 			});
 			let config = that.$init_config(1, function(res) {
@@ -163,6 +176,17 @@
 					}
 				} else if (that.params.paytype == 3) {
 					that.payali();
+				} else if(that.params.paytype == 4) {
+					if (that.channel != 3) {
+						that.show = true;
+						that.password = ''
+					} else {
+						uni.showToast({
+							title: '请选择正确的支付方式',
+							icon: 'none'
+						})
+						return;
+					}
 				} else {
 					uni.showToast({
 						title: '请选择正确的支付方式',
@@ -182,8 +206,14 @@
 						that.paywx();
 					} else if (that.params.paytype == 2) {
 						that.paybalance();
+					} else if(that.params.paytype == 4) {
+						that.paybalance();
+						console.log(that.channel);
 					}
 				}
+			},
+			payNcb() {
+				
 			},
 			onBackspace(e) {
 				let that = this;
@@ -727,7 +757,7 @@
 						var pdata = {
 							orderid: that.params.orderid,
 							djqid: that.params.djqid,
-							type: that.params.paytype == 1 ? 'wxpay' : 'money',
+							type: that.params.paytype == 1 ? 'wxpay' : (that.params.paytype == 4? 'farmCoin': 'money'),
 							paypass: that.password
 						};
 						api.pay(pdata)

+ 9 - 4
pages/user/user.vue

@@ -12,9 +12,9 @@
 					<image class="portrait" :src="headimgurl">
 					</image>
 				</view>
-				<view class="info-box">
+				<view class="info-box" style="flex-grow: 1;">
 					<view v-if="user.id" style="text-align: left;">
-						<text class="username">{{ user.nickname ?user.nickname:'暂无昵称' }}</text>
+						<text class="username">{{ user.nickname ?user.nickname:'暂无昵称' }}{{user.level_name?'('+user.level_name+')': ''}}</text>
 					</view>
 					<view v-if="user.id" style="text-align: left;">
 						<text class="username2">ID:{{ user.id }}</text>
@@ -27,7 +27,7 @@
 					<!-- #endif -->
 				</view>
 				<view @click="navTo('/pagesD/pages/set/set')"
-					style="width: 35vh;display: flex;justify-content: flex-end;padding-right: 10rpx;">
+					style="display: flex;justify-content: flex-end;padding-right: 10rpx;">
 					<u-icon name="setting" color="#ffffff" size="25"></u-icon>
 				</view>
 			</view>
@@ -48,9 +48,13 @@
 						<text class="num">{{ user.money || 0 }}</text>
 						<text>余额</text>
 					</view>
-					<view class="tj-item" @click="navTo('/pagesE/pages/mall/integral')">
+					<!-- <view class="tj-item" @click="navTo('/pagesE/pages/mall/integral')">
 						<text class="num">{{ user.score || 0 }}</text>
 						<text>积分</text>
+					</view> -->
+					<view class="tj-item">
+						<text class="num">{{ user.farm_coin || 0 }}</text>
+						<text>农场币</text>
 					</view>
 					<view class="tj-item" >
 						<text class="num">{{ user.all_soil || 0 }}</text>
@@ -286,6 +290,7 @@
 			}
 			let userInfo = uni.getStorageSync('userInfo');
 			that.user = userInfo
+			console.log(that.user,'that.user');
 			if (!that.user) {
 				that.goodslikecount = 0;
 			}

+ 63 - 14
pagesA/pages/mypurse/withdraw/withdraw.vue

@@ -12,7 +12,7 @@
 			<view class="uni-list">
 				<radio-group @change="radioChange">
 					<label class="uni-list-cell uni-list-cell-pd"
-						v-if="item.isopen && ((item.value=='weixin' && weixin) || (item.value=='zfb' && zfb))"
+						v-if="item.isopen && ((item.value=='weixin' && weixin) || (item.value=='zfb' && zfb)) || (item.value == 'bank' && zfb)"
 						v-for="(item, index) in items" :key="item.value">
 						<u-icon :name="item.img" :color="item.color" size="40"></u-icon>
 						<view>{{ item.name }}</view>
@@ -31,6 +31,19 @@
 					prefixIconStyle="font-size: 22px;color: #909399"></u--input>
 				<view class="bor_solp"></view>
 			</view>
+			<view v-if="sitem.value=='bank'" class="u-demo-block">
+				<view style="padding-bottom: 30rpx;">姓名</view>
+				<u--input placeholder="姓名" prefixIcon="account" v-model="bank_name"
+					prefixIconStyle="font-size: 22px;color: #909399"></u--input>
+				<view style="padding: 30rpx 0rpx;">银行卡号</view>
+				<u--input placeholder="银行卡号" prefixIcon="zhifubao" v-model="bank_number"
+					prefixIconStyle="font-size: 22px;color: #909399"></u--input>
+				<view class="bor_solp"></view>
+				<view style="padding: 30rpx 0rpx;">所属银行</view>
+				<u--input placeholder="所属银行" prefixIcon="zhifubao" v-model="branch"
+					prefixIconStyle="font-size: 22px;color: #909399"></u--input>
+				<view class="bor_solp"></view>
+			</view>
 		</view>
 		<view class="btn">
 			<view class="save bg-linear-gradient" @click="doSve">提交</view>
@@ -45,22 +58,34 @@
 		name: 'Withdraw',
 		data() {
 			return {
+				bank_name: '',
+				bank_number: '',
+				branch: '',
 				primary: this.$theme.primary,
 				settingFile: getApp().globalData.siteinfo,
 				money: 0,
 				items: [{
-					value: 'weixin',
-					color: '#62b900',
-					isopen: true,
-					name: '微信',
-					img: 'weixin-fill'
-				}, {
-					value: 'zfb',
-					color: 'rgb(85, 170, 255)',
-					isopen: true,
-					name: '支付宝',
-					img: 'zhifubao'
-				}],
+						value: 'weixin',
+						color: '#62b900',
+						isopen: true,
+						name: '微信',
+						img: 'weixin-fill'
+					},
+					{
+						value: 'zfb',
+						color: 'rgb(85, 170, 255)',
+						isopen: true,
+						name: '支付宝',
+						img: 'zhifubao'
+					},
+					{
+						value: 'bank',
+						color: 'rgb(85, 170, 255)',
+						isopen: true,
+						name: '银行卡',
+						img: 'rmb-circle'
+					}
+				],
 				apply_account: '',
 				apply_name: '',
 				sitem: {
@@ -93,6 +118,11 @@
 					that.weixin = res.app.cash.wx.isopen;
 					that.zfb = res.app.cash.ali.isopen;
 				}
+				if(res && res.bank) {
+					that.bank_name = res.bank.bank_name
+					that.bank_number = res.bank.bank_number
+					that.branch = res.bank.branch
+				}
 			});
 		},
 		methods: {
@@ -195,6 +225,25 @@
 									that.$api.msg(res.msg);
 								}
 							});
+						} else if (that.sitem.value == 'bank') {
+							txApi.bankTx({
+								bank_name: that.bank_name,
+								bank_number: that.bank_number,
+								branch: that.branch,
+								txprice: that.money,
+								systype: that.systype
+							}).then(res => {
+								if (res.status == 200) {
+									that.$api.msg(res.msg);
+									setTimeout(() => {
+										uni.redirectTo({
+											url: '/pagesA/pages/mypurse/index'
+										});
+									}, 1000);
+								} else {
+									that.$api.msg(res.msg);
+								}
+							})
 						} else {
 							that.$api.msg('请选择提现方式');
 							return;
@@ -309,4 +358,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 4 - 1
pagesD/pages/order/createOrder.vue

@@ -116,7 +116,7 @@
 				<yhcoupon ref="yh_coupon" :orderList="orderList" :showModal="showPay" @close="onclose"></yhcoupon>
 			</view>
 		</view>
-		<payment ref="payment" :channel="1" :alipay="true" :weixinpay="true" :zhtpay="true"></payment>
+		<payment ref="payment" :channel="1" :alipay="true" :weixinpay="true" :zhtpay="true" :ncb="istd"></payment>
 	</view>
 </template>
 <script>
@@ -130,6 +130,7 @@
 		},
 		data() {
 			return {
+				istd: false,
 				primary: this.$theme.primary,
 				maskState: 0, //优惠券面板显示状态
 				desc: '', //备注
@@ -407,12 +408,14 @@
 			/* 获取订单信息*/
 			orderIndex(option) {
 				api.shop_orderMake(option).then(res => {
+					console.log(res,'resddd');
 					if (res.status == 200) {
 						this.orderList = res.data;
 						this.opayprice = this.orderList.payprice
 						this.clone = this.$u.deepClone(res.data);
 						this.province = res.data.province;
 						this.login = false;
+						this.istd = this.orderList.cache[0].soil_num > 0 
 					} else if (res.status == 402) {
 						this.$api.msg(res.msg);
 						this.ifpeon = false

+ 15 - 3
pagesD/pages/product/product.vue

@@ -355,7 +355,12 @@
 						let id = uni.getStorageSync('userInfo').id;
 						// #endif
 						// #ifdef H5
-						let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
+						try{
+							let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
+						}catch(e){
+							//TODO handle the exception
+							console.log(e,'eee');
+						}
 						// #endif
 						let obj = {
 							sid: 0,
@@ -395,11 +400,18 @@
 				if (index == 2) {
 					if (this.specClass === 'show') {
 						this.stock();
+						let id
 						// #ifdef MP-WEIXIN
-						let id = uni.getStorageSync('userInfo').id;
+						id = uni.getStorageSync('userInfo').id;
 						// #endif
 						// #ifdef H5
-						let id = uni.getStorageSync('userInfo').userinfo.id || uni.getStorageSync('userInfo').id;
+						try{
+							id = uni.getStorageSync('userInfo').id || uni.getStorageSync('userInfo').userinfo.id;
+						}catch(e){
+							console.log(e,'eeee2e');
+							console.log(uni.getStorageSync('userInfo'),'ddddddddddddddd');
+							//TODO handle the exception
+						}
 						// #endif
 						let obj = {
 							sid: 0,