Browse Source

服务点数

qzy 2 weeks ago
parent
commit
d30c5c69ec

+ 1 - 1
common/http.js

@@ -5,7 +5,7 @@
 // const ip = 'http://hs-server.tbgjhc.top:8018';
 //静态图片地址前缀
 // const ngip = 'http://192.168.3.15:8080/sp-admin'
-const ip = 'http://192.168.10.123:8080'; //线下
+const ip = 'http://192.168.3.15:8080'; //线下
 
 /**
  * 封装的http请求

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "天保物流",
-    "appid" : "__UNI__80F633F",
+    "appid" : "__UNI__4E5B775",
     "description" : "",
     "versionName" : "1.1.2",
     "versionCode" : "100",

+ 8 - 1
pages.json

@@ -698,7 +698,14 @@
 		{
 			"path": "pages/wallet/topup/detail",
 			"style": {
-				"navigationBarTitleText": "服务点充值详细",
+				"navigationBarTitleText": "充值详情",
+				"enablePullDownRefresh": false
+			}
+		},	
+		{
+			"path": "pages/wallet/topup/topupSuccess",
+			"style": {
+				"navigationBarTitleText": "充值成功",
 				"enablePullDownRefresh": false
 			}
 		},

+ 3 - 4
pages/index/index.vue

@@ -157,9 +157,6 @@
 		},
 		onLoad() {
 			uni.hideLoading()
-			this.getBannerList();
-			this.getNewsList();
-			this.getMenu();
 			uni.$on('getMenu', res => {
 				this.getMenu();
 			});
@@ -171,6 +168,9 @@
 			this.checkFace()
 			this.getRead();
 			this.getUpdateInfo();
+			this.getBannerList();
+			this.getNewsList();
+			this.getMenu();
 		},
 		methods: {
 			getUpdateInfo() {
@@ -405,7 +405,6 @@
 					});
 					return;
 				}
-				console.log(url);
 				uni.navigateTo({
 					url: url,
 					fail: res => {

+ 0 - 3
pages/login/login.vue

@@ -54,9 +54,6 @@ export default {
 					this.item.appVersion = wgtinfo.versionCode;
 				});
 				// #endif
-				// #ifdef H5
-				this.item.appVersion = '1.0.0';
-				// #endif
 			}
 		});
 	},

+ 172 - 130
pages/market/one/leader/handle.vue

@@ -187,150 +187,192 @@
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			ip: this.http.ip,
-			imgList: [],
-			expand: false, //展开
-			current: 0,
-			item: {},
-			item2: {},
-			orderId: '',
-			peopleConfirmStatus: '',
-			cooperEntrustStatus: '',
-			applyConfirmStatus: '',
-			cooper_entrust: 2
-		};
-	},
-	onLoad(e) {
-		if (e.orderId && e.peopleConfirmStatus && e.applyConfirmStatus) {
-			this.orderId = e.orderId;
-			this.peopleConfirmStatus = e.peopleConfirmStatus;
-			this.cooperEntrustStatus = e.cooperEntrustStatus;
-			this.applyConfirmStatus = e.applyConfirmStatus;
-			if(this.peopleConfirmStatus == 0) {
-				this.current = 0;
-				this.getData1();
-			} else if(this.peopleConfirmStatus == 1  && this.applyConfirmStatus == 0) {
-				this.current = 1;
-				this.getData2();
+	export default {
+		data() {
+			return {
+				ip: this.http.ip,
+				imgList: [],
+				expand: false, //展开
+				current: 0,
+				item: {},
+				item2: {},
+				orderId: '',
+				peopleConfirmStatus: '',
+				cooperEntrustStatus: '',
+				applyConfirmStatus: '',
+				cooper_entrust: 2
+			};
+		},
+		onLoad(e) {
+			if (e.orderId && e.peopleConfirmStatus && e.applyConfirmStatus) {
+				this.orderId = e.orderId;
+				this.peopleConfirmStatus = e.peopleConfirmStatus;
+				this.cooperEntrustStatus = e.cooperEntrustStatus;
+				this.applyConfirmStatus = e.applyConfirmStatus;
+				if (this.peopleConfirmStatus == 0) {
+					this.current = 0;
+					this.getData1();
+				} else if (this.peopleConfirmStatus == 1 && this.applyConfirmStatus == 0) {
+					this.current = 1;
+					this.getData2();
+				}
 			}
-		}
 
-		//人脸认证回调
-		uni.$on('face',res=>{
-			if(res){
-				this.confirmFn()
-			}
-		})
-	},
-	methods: {
-		confirmFn(){
-			if (this.current == 0){
-				 this.http.request({
-					url: '/level-one-server/app/TbOrder/confirmOrder',
-					method: 'POST',
-					data: { orderId: this.item.id },
-					success: res => {
-						uni.showToast({ title: '订单确认成功' });
-						this.current = 1;
-						uni.setNavigationBarTitle({ title: '互助委托确认' });
-						this.getData2();
-					}
-				});
-			}
-			if (this.current == 1){
-				 this.http.request({
-				 	url: '/level-one-server/app/TbOrder/applyOrder',
-				 	method: 'POST',
-				 	data: { orderId: this.orderId },
-				 	success: res => {
-				 		uni.showToast({ title: '进口申报确认成功' });
-				 		setTimeout(() => {
-				 			uni.switchTab({ url: '/pages/index/index' });
-				 		}, 1000);
-				 	}
-				 });
-			}
-		},
-		getData1() {
-			this.http.request({
-				url: '/level-one-server/app/TbOrder/orderDetail',
-				data: { orderId: this.orderId },
-				success: res => {
-					this.item = res.data.data;
+			//人脸认证回调
+			uni.$on('face', res => {
+				if (res) {
+					this.confirmFn()
 				}
-			});
+			})
 		},
-		getData2() {
-			this.http.request({
-				url: '/level-one-server/app/TbImportOrder/importOrderDetail',
-				data: { orderId: this.orderId },
-				success: res => {
-					this.item2 = res.data.data;
-					JSON.parse(this.item2.cooperEntrustImg).map(item => this.imgList.push(item))
-					console.log("-----5-----"+this.imgList)
+		methods: {
+			confirmFn() {
+			
+
+				if (this.current == 0) {
+					this.http.request({
+						url: '/level-one-server/app/TbOrder/confirmOrder',
+						method: 'POST',
+						data: {
+							orderId: this.item.id
+						},
+						success: res => {
+							uni.showToast({
+								title: '订单确认成功'
+							});
+							this.current = 1;
+							uni.setNavigationBarTitle({
+								title: '互助委托确认'
+							});
+							this.getData2();
+						}
+					});
 				}
-			});
-		},
-		ok() {
-			//根据不同的步骤提交不同的url或者状态参数
-			if (this.current == 0) {
-				uni.showModal({
-					title: '提示',
-					content: '我已核对信息无误',
-					success: res => {
-						if (res.confirm) {
-							//return;
-							//跳转到人脸认证
-							uni.navigateTo({url:'/pages/face/faceRegister?type=2'})
+				if (this.current == 1) {
+					this.http.request({
+						url: '/level-one-server/app/TbOrder/applyOrder',
+						method: 'POST',
+						data: {
+							orderId: this.orderId
+						},
+						success: res => {
+							uni.showToast({
+								title: '进口申报确认成功'
+							});
+							setTimeout(() => {
+								uni.switchTab({
+									url: '/pages/index/index'
+								});
+							}, 1000);
 						}
+					});
+				}
+			},
+			getData1() {
+				this.http.request({
+					url: '/level-one-server/app/TbOrder/orderDetail',
+					data: {
+						orderId: this.orderId
+					},
+					success: res => {
+						this.item = res.data.data;
 					}
 				});
-			}
-			if (this.current == 1) {
-				//进口确认不用刷脸
-				uni.showModal({
-					title: '提示',
-					content: '我已核对信息无误',
+			},
+			getData2() {
+				this.http.request({
+					url: '/level-one-server/app/TbImportOrder/importOrderDetail',
+					data: {
+						orderId: this.orderId
+					},
 					success: res => {
-						if (res.confirm) {
-							//return;
-							//跳转到人脸认证
-							this.confirmFn();
-							//uni.navigateTo({url:'/pages/face/faceRegister?type=2'})
-						}
+						this.item2 = res.data.data;
+						JSON.parse(this.item2.cooperEntrustImg).map(item => this.imgList.push(item))
+						console.log("-----5-----" + this.imgList)
 					}
 				});
+			},
+			ok() {
+				let user = this.getUser();
+				if (user.wallet <= 0) {
+					uni.showModal({
+						title: '提示',
+						content: '剩余服务点数不足,请先充值!',
+						success: function(res) {
+							if (res.confirm) {
+								uni.navigateTo({
+									url:'/pages/wallet/wallet'
+								})
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+					})
+					return;
+				}
+				//根据不同的步骤提交不同的url或者状态参数
+				if (this.current == 0) {
+					uni.showModal({
+						title: '提示',
+						content: '我已核对信息无误',
+						success: res => {
+							if (res.confirm) {
+								//return;
+								//跳转到人脸认证
+								uni.navigateTo({
+									url: '/pages/face/faceRegister?type=2'
+								})
+							}
+						}
+					});
+				}
+				if (this.current == 1) {
+					//进口确认不用刷脸
+					uni.showModal({
+						title: '提示',
+						content: '我已核对信息无误',
+						success: res => {
+							if (res.confirm) {
+								//return;
+								//跳转到人脸认证
+								this.confirmFn();
+								//uni.navigateTo({url:'/pages/face/faceRegister?type=2'})
+							}
+						}
+					});
+				}
 			}
+		},
+		destroyed() {
+			uni.$off('face');
 		}
-	},
-	destroyed() {
-		uni.$off('face');
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-page {
-	background-color: $pg;
-}
-.cmain{
-	padding-bottom: 100px;
-}
-.expand {
-	overflow: hidden;
-}
-.more {
-	text-align: center;
-	padding: 10px 10px 15px 10px;
-	.icon {
-		padding-right: 3px;
+	page {
+		background-color: $pg;
+	}
+
+	.cmain {
+		padding-bottom: 100px;
+	}
+
+	.expand {
+		overflow: hidden;
+	}
+
+	.more {
+		text-align: center;
+		padding: 10px 10px 15px 10px;
+
+		.icon {
+			padding-right: 3px;
+		}
+	}
+
+	.ctt {
+		text-align: center;
+		font-weight: bold;
 	}
-}
-.ctt {
-	text-align: center;
-	font-weight: bold;
-}
-</style>
+</style>

+ 18 - 0
pages/market/one/leader/handleThree.vue

@@ -249,6 +249,7 @@ export default {
 	},
 	methods: {
 		confirmFn(){
+		
 			if (this.current == 0){
 				 this.http.request({
 					url: '/level-one-server/app/TbOrder/confirmOrder',
@@ -358,6 +359,23 @@ export default {
 			});
 		},
 		ok() {
+			let user = this.getUser();
+			if (user.wallet <= 0) {
+				uni.showModal({
+					title: '提示',
+					content: '剩余可用点数不足,请先充值!',
+					success: function(res) {
+						if (res.confirm) {
+							uni.navigateTo({
+								url:'/pages/wallet/wallet'
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				})
+				return;
+			}
 			//根据不同的步骤提交不同的url或者状态参数
 			if (this.current == 0) {
 				uni.showModal({

+ 0 - 2
pages/market/order/order.vue

@@ -161,8 +161,6 @@
 						this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
 						if (res.data.data) {
 							this.list = res.data.data;
-							console.log("---1---=" + this.list[0].finishStatus)
-							console.log("---2---=" + this.list[0].resaleStatus)
 						}
 					}
 				});

+ 108 - 103
pages/market/two/leader/resale.vue

@@ -34,38 +34,19 @@
 					<text class="label">预上架金额</text>
 					<text class="desc">¥ {{ item.totalPrice }}</text>
 				</view>
-				<!-- <view class="item">
-					<text class="label">利润</text>
-					<text class="desc">50元</text>
-				</view> -->
-				<!-- <view class="item">
-					<text class="label">上架金额</text>
-					<text class="desc">¥ {{ resalePrice }}</text>
-				</view> -->
-				<view  style="font-size: 12px;padding: 5px;height: 30px;line-height: 30px;">注:本次上架需扣除服务1点数</view>
+
+				<view style="font-size: 16px;padding: 5px;height: 80px;line-height: 30px;">注:本次上架需扣除服务1点数,
+					<view>剩余服务点数:<text style="font-weight: bold;">{{user.wallet}}</text><text
+							style="margin-left: 10px;color: blue" @click="toCharge">前往充值</text></view>
+				</view>
 			</view>
-		<!-- 	<u-divider text="服务费明细"></u-divider>
-			<view v-if="fee.totalFee>0">{{fee.title}}:{{fee.totalFee}}<span style="color: coral;margin-left: 5px;font-size: 16px;">元</span></view>
-			<view class="box">
-				<u-collapse v-for="(item,index) in fee.feeList" :key="index" :value="['1']">
-					<u-collapse-item :title="item.name" class="cell_title" name="1">
-						<view class="itm">1、系统服务费:{{ item.name }}</view>
-						<view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
-						<view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
-						<view class="itm" v-if="item.feeType ==3">2、收费类型:按吨收取</view>
-						<view class="itm" v-if="item.feeType ==1">3、收费%(按交易额收):<span style="color: coral;">{{ item.percent }} %</span></view>
-						<view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
-						<view class="itm" v-if="item.feeType ==3">3、收费%(按吨收):<span style="color: coral;">{{ item.percent }} %</span></view>
-						<view class="itm">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
 
-					</u-collapse-item>
-				</u-collapse>
-			</view> -->
 		</view>
 		<view class="mfooter" v-if="item.upStatus != 2">
 			<view class="flex">
 				<view class="f">
-					<button class="btn" @click="ok()">确定上架</button>
+					<button class="btn" @click="ok()" v-if="user.wallet>0">确定上架</button>
+					<button class="btn" style="color: firebrick;" @click="toCharge" v-else>前往充值</button>
 				</view>
 			</view>
 		</view>
@@ -73,91 +54,115 @@
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			item: {},
-			resalePrice: '',
-			weight: '',
-			price: '',
-			newRuleList: [],
-			fee:{
-				totalFee:0,
-				feeList:[]
-			}
-		};
-	},
-	onLoad(e) {
-		if (e.item) {
-			this.item = JSON.parse(e.item);
-			this.price = this.item.totalPrice;
-			this.weight = this.item.totalWeight;
-			//this.countPrice();
-		}
-	},
-	methods: {
-		fetchItemList(){
-			this.http.request({
-				url: '/level-two-server/app/TbOrders/fetchItemList',
-				data: {id: this.item.id},
-				success: res => {
-					this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
-					this.newRuleList = res.data.data.newRuleList
+	export default {
+		data() {
+			return {
+				item: {},
+				resalePrice: '',
+				weight: '',
+				price: '',
+				user: {},
+				newRuleList: [],
+				fee: {
+					totalFee: 0,
+					feeList: []
 				}
-			});
+			};
 		},
-		//费项合计
-		countPrice(){
-			this.http.request({
-				url: '/level-two-server/app/TbOrders/countPrice',
-				data: {id: this.item.id},
-				success: res => {
-					// this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
-					// this.newRuleList = res.data.data.newRuleList
-					this.fee=res.data.data;
-					this.resalePrice = (this.fee.totalFee + this.item.totalPrice).toFixed(2);
-				}
-			});
-		},
-		ok() {
-			let resalePrice=this.resalePrice;
-			/* if(!resalePrice){
-					uni.showToast({title: '请填写上架金额',icon:'error'});
-				return;
+		onLoad(e) {
+			if (e.item) {
+				this.item = JSON.parse(e.item);
+				this.price = this.item.totalPrice;
+				this.weight = this.item.totalWeight;
+				this.user = this.getUser();
+				//this.countPrice();
 			}
-			if(resalePrice<this.item.totalPrice){
-				uni.showToast({title: '上架金额不能小于订单金额',icon:'error'});
-				return;
-			} */
-			uni.showModal({
-				title: '提示',
-				content: '确定上架?',
-				success: res => {
-					if (res.confirm) {
-						this.http.request({
-							url: '/level-one-server/app/TbOrder/up',
-							data: {id: this.item.id, upPrice: this.item.totalPrice},
-							success: res => {
-								uni.showToast({title: '提交成功'});
-								uni.navigateBack();
-							}
-						});
+		},
+		methods: {
+			toCharge() {
+				uni.navigateTo({
+					url: '/pages/wallet/topup/edit'
+				});
+			},
+			fetchItemList() {
+				this.http.request({
+					url: '/level-two-server/app/TbOrders/fetchItemList',
+					data: {
+						id: this.item.id
+					},
+					success: res => {
+						this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
+						this.newRuleList = res.data.data.newRuleList
+					}
+				});
+			},
+			//费项合计
+			countPrice() {
+				this.http.request({
+					url: '/level-two-server/app/TbOrders/countPrice',
+					data: {
+						id: this.item.id
+					},
+					success: res => {
+						// this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
+						// this.newRuleList = res.data.data.newRuleList
+						this.fee = res.data.data;
+						this.resalePrice = (this.fee.totalFee + this.item.totalPrice).toFixed(2);
 					}
+				});
+			},
+			ok() {
+				let resalePrice = this.resalePrice;
+				/* if(!resalePrice){
+						uni.showToast({title: '请填写上架金额',icon:'error'});
+					return;
 				}
-			});
+				if(resalePrice<this.item.totalPrice){
+					uni.showToast({title: '上架金额不能小于订单金额',icon:'error'});
+					return;
+				} */
+				uni.showModal({
+					title: '提示',
+					content: '确定上架?',
+					success: res => {
+						if (res.confirm) {
+							let that = this;
+							this.http.request({
+								url: '/level-one-server/app/TbOrder/up',
+								data: {
+									id: this.item.id,
+									upPrice: this.item.totalPrice
+								},
+								success: res => {
+									let resp = res.data;
+									uni.showToast({
+										title: resp.data
+									});
+									if (resp.code == 200) {
+										let user = that.user;
+										user.wallet = user.wallet - resp.data;
+										uni.setStorageSync('info', user);
+										uni.navigateBack();
+									}
+
+								}
+							});
+						}
+					}
+				});
+			}
 		}
-	}
-};
+	};
 </script>
 
 <style lang="scss">
-page {
-	background-color: $pg;
-}
-.item {
-	input{
-		margin-top: 0px!important;
-	}
+	page {
+		background-color: $pg;
 	}
 
-</style>
+	.item {
+		input {
+			margin-top: 0px !important;
+		}
+	}
+</style>

+ 0 - 4
pages/wallet/detail.vue

@@ -16,10 +16,6 @@
 					<text class="desc">{{ item.goodsNames }}</text>
 				</view>
 				<view class="item">
-					<text class="label">商铺名称</text>
-					<text class="desc">{{ item.shopName }}</text>
-				</view>			
-				<view class="item">
 					<text class="label">车牌号</text>
 					<text class="desc">{{ item.veNo }}</text>
 				</view>

+ 167 - 435
pages/wallet/topdown/edit.vue

@@ -1,443 +1,175 @@
 <template>
-	<view class="app">
-		<view style="padding-bottom: 0.5rem;">
-			<view class="label">可用服务点数:{{user.wallet}}</view>
-		</view>
-		<view>
-			<view class="label">兑现数量(1个兑现1元人民币):</view>
-			<view><input v-model.number="total_fee" type="number" /></view>
-		</view>
-		<button type="primary" @click="createOrder('wxpay')">发起兑现</button>
-	</view>
+  <view class="withdrawal-container">
+    <view class="balance-info">
+      <text class="balance-label">可用服务点数:</text>
+      <text class="balance-amount">{{ user.wallet }}</text>
+    </view>
+
+    <view class="input-section">
+      <text class="input-label">兑现数量(1个兑现1元人民币):</text>
+      <input 
+        v-model.number="total_fee" 
+        type="number" 
+        class="amount-input"
+        placeholder="请输入兑现数量"
+      />
+    </view>
+
+    <button 
+      class="submit-btn" 
+      :class="{ 'submit-btn-disabled': !isValidAmount }"
+      :disabled="!isValidAmount" 
+      @click="createOrder('wxpay')"
+    >
+      发起兑现
+    </button>
+
+    <text v-if="errorMessage" class="error-message">{{ errorMessage }}</text>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-				total_fee: 1000, // 支付金额,单位分 100 = 1元
-				order_no: "", // 业务系统订单号(即你自己业务系统的订单表的订单号)
-				out_trade_no: "", // 插件支付单号
-				description: "测试订单", // 支付描述
-				type: "test", // 支付回调类型 如 recharge 代表余额充值 goods 代表商品订单(可自定义,任意英文单词都可以,只要你在 uni-pay-co/notify/目录下创建对应的 xxx.js文件进行编写对应的回调逻辑即可)
-				//qr_code: true, // 是否强制使用扫码支付
-				openid:"", // 微信公众号需要
-				custom:{
-					a: "a",
-					b: 1
-				},
-				adpid: "1000000001", // uni-ad的广告位id
-				
-				transaction_id:"", // 查询订单接口的查询条件
-				getOrderRes:{}, // 查询订单支付成功后的返回值
-			}
-		},
-		onLoad(options={}) {
-			this.user = this.getUser();
-			// #ifdef H5
-			// 微信公众号特殊逻辑开始-----------------------------------------------------------
-			// 以下代码仅为获取openid,正常你自己项目应该是登录后才能支付,登录后已经拿到openid,无需编写下面的代码
-			if (this.h5Env === 'h5-weixin') {
-				let openid = uni.getStorageSync("uni-pay-weixin-h5-openid");
-				let code = uni.getStorageSync("uni-pay-weixin-h5-code");
-				if (openid) {
-					this.openid = openid;
-				}
-				// 如果code和state有值,且此code没有被使用过,则执行获取微信公众号的openid
-				if (options.code && options.state && code !== options.code) {
-					// 获取微信公众号的openid
-					setTimeout(() => {
-						this.getOpenid({
-							provider: "wxpay",
-							code: options.code
-						});
-					}, 300);
-				} else if (!openid){
-					// 如果openid为空,则执行微信公众号的网页授权登录逻辑
-					setTimeout(() => {
-						this.getWeiXinJsCode('snsapi_base');
-					}, 300);
-				}
-			}
-			this.order_no = `test`+Date.now();
-			this.out_trade_no = `${this.order_no}-1`;
-			
-			// 微信公众号特殊逻辑结束-----------------------------------------------------------
-			// #endif
-		},
-		methods: {
-			/**
-			 * 发起支付(唤起收银台,如果只有一种支付方式,则收银台不会弹出来,会直接使用此支付方式)
-			 * 在调用此api前,你应该先创建自己的业务系统订单,并获得订单号 order_no,把order_no当参数传给此api,而示例中为了简化跟支付插件无关的代码,这里直接已时间戳生成了order_no
-			 */
-			open() {
-				this.order_no = `test`+Date.now();
-				this.out_trade_no = `${this.order_no}-1`;
-				// 打开支付收银台
-				this.$refs.pay.open({
-					total_fee: this.total_fee, // 支付金额,单位分 100 = 1元
-					order_no: this.order_no, // 业务系统订单号(即你自己业务系统的订单表的订单号)
-					out_trade_no: this.out_trade_no, // 插件支付单号
-					description: this.description, // 支付描述
-					type: this.type, // 支付回调类型
-					qr_code: this.qr_code, // 是否强制使用扫码支付
-					openid: this.openid, // 微信公众号需要
-					custom: this.custom, // 自定义数据
-				});
-			},
-			/**
-			 * 发起支付(不唤起收银台,手动指定支付方式)
-			 * 在调用此api前,你应该先创建自己的业务系统订单,并获得订单号 order_no,把order_no当参数传给此api,而示例中为了简化跟支付插件无关的代码,这里直接已时间戳生成了order_no
-			 */
-			createOrder(provider){
+export default {
+  data() {
+    return {
+      user: {},
+      total_fee: null,
+      errorMessage: ''
+    }
+  },
+  computed: {
+    isValidAmount() {
+      return this.total_fee && this.total_fee > 0 && this.total_fee <= this.user.wallet
+    }
+  },
+  onLoad() {
+    this.user = this.getUser()
+  },
+  methods: {
+    createOrder(provider) {
+		uni.showModal({
+			content: '功能正在开发中...',
+			showCancel: false
+		});
+		return;
+      if (!this.isValidAmount) {
+        this.errorMessage = '请输入有效的兑现数量'
+        return
+      }
+
+      this.errorMessage = ''
+      uni.showLoading({ title: '处理中...' })
 
-				/*
-				// 发起支付
-				this.$refs.pay.createOrder({
-					provider: provider, // 支付供应商
-					total_fee: this.total_fee, // 支付金额,单位分 100 = 1元
-					order_no: this.order_no, // 业务系统订单号(即你自己业务系统的订单表的订单号)
-					out_trade_no: this.out_trade_no, // 插件支付单号
-					description: this.description, // 支付描述
-					type: this.type, // 支付回调类型
-					qr_code: this.qr_code, // 是否强制使用扫码支付
-					openid: this.openid, // 微信公众号需要
-					custom: this.custom, // 自定义数据
-				});
-				*/
-			   this.http.request({
-			   	url: '/level-one-server/app/WalletManage/topdownSave',
-			   	data: {
-					amount: this.total_fee, 
-					goodsName: '服务点对象'
-			   	},
-			   	success: res => {
-					this.user.wallet = this.user.wallet - this.total_fee/100;
-					console.log("this.user",this.user)
-					uni.setStorageSync('info', this.user);
-			   		uni.showToast({
-			   			title: '提现成功!'
-			   		});
-					uni.navigateBack({
-						data:1
-					});
-			   	}
-			   });
-				
-			},
-			/**
-			 * 生成支付独立二维码(只返回支付二维码)
-			 * 在调用此api前,你应该先创建自己的业务系统订单,并获得订单号 order_no,把order_no当参数传给此api,而示例中为了简化跟支付插件无关的代码,这里直接已时间戳生成了order_no
-			 */
-			createQRcode(provider){
-				this.order_no = `test`+Date.now();
-				this.out_trade_no = `${this.order_no}-1`;
-				// 发起支付
-				this.$refs.pay.createOrder({
-					provider: provider, // 支付供应商
-					total_fee: this.total_fee, // 支付金额,单位分 100 = 1元
-					order_no: this.order_no, // 业务系统订单号(即你自己业务系统的订单表的订单号)
-					out_trade_no: this.out_trade_no, // 插件支付单号
-					description: this.description, // 支付描述
-					type: this.type, // 支付回调类型
-					qr_code: true, // 是否强制使用扫码支付
-					cancel_popup: true, // 配合qr_code:true使用,是否只生成支付二维码,没有二维码弹窗
-					openid: this.openid, // 微信公众号需要
-					custom: this.custom, // 自定义数据
-				});
-			},
-			/**
-			 * 前往自定义收银台页面
-			 * 在调用此api前,你应该先创建自己的业务系统订单,并获得订单号 order_no,把order_no当参数传给此api,而示例中为了简化跟支付插件无关的代码,这里直接已时间戳生成了order_no
-			 */
-			toPayDesk(){
-				this.order_no = `test`+Date.now();
-				this.out_trade_no = `${this.order_no}-1`;
-				let options = {
-					total_fee: this.total_fee, // 支付金额,单位分 100 = 1元
-					order_no: this.order_no, // 业务系统订单号(即你自己业务系统的订单表的订单号)
-					out_trade_no: this.out_trade_no, // 插件支付单号
-					description: this.description, // 支付描述
-					type: this.type, // 支付回调类型
-					qr_code: this.qr_code, // 是否强制使用扫码支付
-					openid: this.openid, // 微信公众号需要
-					custom: this.custom, // 自定义数据
-				};
-				let optionsStr = encodeURI(JSON.stringify(options));
-				uni.navigateTo({
-					url:`/uni_modules/uni-pay/pages/pay-desk/pay-desk?options=${optionsStr}`
-				});
-			},
-			// 打开查询订单的弹窗
-			getOrderPopup(key){
-				if (key) {
-					this.$refs.getOrderPopup.open();
-				} else {
-					this.$refs.getOrderPopup.close();
-				}
-			},
-			// 查询支付状态
-			async getOrder() {
-				this.getOrderRes = {};
-				let res = await this.$refs.pay.getOrder({
-					//out_trade_no: this.out_trade_no, // 插件支付单号 两者传1个即可
-					transaction_id: this.transaction_id, // 第三方单号 两者传1个即可
-					await_notify: true
-				});
-				if (res) {
-					this.getOrderRes = res.pay_order;
-					let obj = {
-						"-1": "已关闭",
-						"1": "已支付",
-						"0": "未支付",
-						"2": "已部分退款",
-						"3": "已全额退款"
-					};
-					uni.showToast({
-						title: obj[res.status] || res.errMsg,
-						icon: "none"
-					});
-				}
-			},
-			// 发起退款
-			async refund() {
-				let res = await this.$refs.pay.refund({
-					out_trade_no: this.out_trade_no, // 插件支付单号
-				});
-				if (res) {
-					uni.showToast({
-						title: res.errMsg,
-						icon: "none"
-					});
-				}
-			},
-			// 查询退款状态
-			async getRefund() {
-				let res = await this.$refs.pay.getRefund({
-					out_trade_no: this.out_trade_no, // 插件支付单号
-				});
-				if (res) {
-					uni.showModal({
-						content: res.errMsg,
-						showCancel: false
-					});
-				}
-			},
-			// 关闭订单
-			async closeOrder() {
-				let res = await this.$refs.pay.closeOrder({
-					out_trade_no: this.out_trade_no, // 插件支付单号
-				});
-				if (res) {
-					uni.showModal({
-						content: res.errMsg,
-						showCancel: false
-					});
-				}
-			},
-			// 获取公众号code
-			async getWeiXinJsCode(scope="snsapi_base") {
-				let res = await this.$refs.pay.getProviderAppId({
-					provider: "wxpay",
-					provider_pay_type: "jsapi"
-				});
-				if (res.appid) {
-					let appid = res.appid;
-					let redirect_uri = window.location.href.split("?")[0];
-					let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=STATE#wechat_redirect`;
-					window.location.href = url;
-				}
-			},
-			// 获取公众号openid
-			async getOpenid(data={}) {
-				let res = await this.$refs.pay.getOpenid(data);
-				if (res) {
-					this.openid = res.openid;
-					// 将openid缓存到本地
-					uni.setStorageSync("uni-pay-weixin-h5-openid", this.openid);
-					uni.setStorageSync("uni-pay-weixin-h5-code", data.code);
-					uni.showToast({
-						title: "已获取到openid,可以开始支付",
-						icon: "none"
-					});
-				}
-			},
-			// 监听事件 - 支付订单创建成功(此时用户还未支付)
-			onCreate(res){
-				console.log('create: ', res);
-				// 如果只是想生成支付二维码,不需要组件自带的弹窗,则在这里可以获取到支付二维码 qr_code_image
-			},
-			// 监听事件 - 支付成功
-			onSuccess(res){
-				console.log('success: ', res);
-				if (res.user_order_success) {
-					// 代表用户已付款,且你自己写的回调成功并正确执行了
-					
-				} else {
-					// 代表用户已付款,但你自己写的回调执行失败(通常是因为你的回调代码有问题)
-	
-				}
-			},
-			onFail(err){
-				console.log('err: ', err)
-				
-			},
-			pageTo(url){
-				uni.navigateTo({
-					url
-				});
-			},
-			providerFormat(provider){
-				let providerObj = {
-					"wxpay":"微信支付",
-					"alipay":"支付宝支付",
-					"appleiap":"ios内购"
-				};
-				let providerStr = providerObj[provider] || "未知";
-				return providerStr;
-			},
-			/**
-			 * 日期格式化
-			 * @params {Date || Number} date 需要格式化的时间
-			 * timeFormat(new Date(),"yyyy-MM-dd hh:mm:ss");
-			 */
-			timeFormat(time, fmt = 'yyyy-MM-dd hh:mm:ss', targetTimezone = 8){
-				try {
-					if (!time) {
-						return "";
-					}
-					if (typeof time === "string" && !isNaN(time)) time = Number(time);
-					// 其他更多是格式化有如下:
-					// yyyy-MM-dd hh:mm:ss|yyyy年MM月dd日 hh时MM分等,可自定义组合
-					let date;
-					if (typeof time === "number") {
-						if (time.toString().length == 10) time *= 1000;
-						date = new Date(time);
-					} else {
-						date = time;
-					}
-							
-					const dif = date.getTimezoneOffset();
-					const timeDif = dif * 60 * 1000 + (targetTimezone * 60 * 60 * 1000);
-					const east8time = date.getTime() + timeDif;
-							
-					date = new Date(east8time);
-					let opt = {
-						"M+": date.getMonth() + 1, //月份
-						"d+": date.getDate(), //日
-						"h+": date.getHours(), //小时
-						"m+": date.getMinutes(), //分
-						"s+": date.getSeconds(), //秒
-						"q+": Math.floor((date.getMonth() + 3) / 3), //季度
-						"S": date.getMilliseconds() //毫秒
-					};
-					if (/(y+)/.test(fmt)) {
-						fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
-					}
-					for (let k in opt) {
-						if (new RegExp("(" + k + ")").test(fmt)) {
-							fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (opt[k]) : (("00" + opt[k]).substr(("" + opt[k]).length)));
-						}
-					}
-					return fmt;
-				} catch (err) {
-					// 若格式错误,则原值显示
-					return time;
-				}
-			},
-		}, 
-		computed: {
-			h5Env(){
-				// #ifdef H5
-				let ua = window.navigator.userAgent.toLowerCase();
-				if (ua.match(/MicroMessenger/i) == 'micromessenger' && (ua.match(/miniprogram/i) == 'miniprogram')) {
-					// 微信小程序
-					return "mp-weixin";
-				}
-				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
-					// 微信公众号
-					return "h5-weixin";
-				}
-				if (ua.match(/alipay/i) == 'alipay' && ua.match(/miniprogram/i) == 'miniprogram') {
-					return "mp-alipay";
-				}
-				if (ua.match(/alipay/i) == 'alipay') {
-					return "h5-alipay";
-				}
-				// 外部 H5
-				return "h5";
-				// #endif
-			},
-			// 计算当前是否是ios app
-			isIosAppCom(){
-				let info = uni.getSystemInfoSync();
-				return info.uniPlatform === 'app' && info.osName === 'ios' ? true : false;
-			},
-			// 计算当前是否是PC环境
-			isPcCom(){
-				// #ifdef H5
-				let info = uni.getSystemInfoSync();
-				return info.deviceType === 'pc' ? true : false;
-				// #endif
-				return false;
-			}
-		},
-	}
+      this.http.request({
+        url: '/level-one-server/app/WalletManage/topdownSave',
+        data: {
+          amount: this.total_fee * 100, // Convert to cents
+          goodsName: '服务点兑现'
+        },
+        success: res => {
+          uni.hideLoading()
+          this.user.wallet -= this.total_fee
+          uni.setStorageSync('info', this.user)
+          uni.showToast({
+            title: '兑现成功!',
+            icon: 'success'
+          })
+          setTimeout(() => {
+            uni.navigateBack({ delta: 1 })
+          }, 1500)
+        },
+        fail: err => {
+          uni.hideLoading()
+          this.errorMessage = '兑现失败,请稍后重试'
+          console.error('Withdrawal failed:', err)
+        }
+      })
+    }
+  }
+}
 </script>
 
-<style lang="scss" scoped>
-	.app{
-		padding: 30rpx;
-	}
-	input {
-		border: 1px solid #f3f3f3;
-		padding: 10rpx;
-		width: 100%;
-		box-sizing: border-box;
-		height: 80rpx;
-	}
+<style lang="scss">
+.withdrawal-container {
+  padding: 30px;
+  background-color: #f8f8f8;
+  min-height: 100vh;
+}
+
+.balance-info {
+  background-color: #007AFF;
+  padding: 20px;
+  border-radius: 10px;
+  margin-bottom: 20px;
+}
+
+.balance-label {
+  font-size: 16px;
+  color: rgba(255, 255, 255, 0.8);
+}
+
+.balance-amount {
+  font-size: 24px;
+  font-weight: bold;
+  color: #fff;
+}
+
+.input-section {
+  background-color: #fff;
+  padding: 15px;
+  border-radius: 10px;
+  margin-bottom: 20px;
+}
+
+.input-label {
+  font-size: 16px;
+  color: #333;
+  margin-bottom: 10px;
+}
+
+.amount-input {
+  border: 1px solid #ddd;
+  border-radius: 5px;
+  padding: 10px;
+  font-size: 16px;
+  width: 100%;
+  box-sizing: border-box;
+  height: 40px;
+}
+
+.submit-btn {
+  background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
+  color: #fff;
+  padding: 15px;
+  border-radius: 25px;
+  font-size: 18px;
+  font-weight: bold;
+  width: 100%;
+  border: none;
+  margin-top: 20px;
+  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+  transition: all 0.3s ease;
+
+  &:active {
+    transform: translateY(2px);
+    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+  }
+
+  &:disabled {
+    background: #ccc;
+    box-shadow: none;
+  }
+}
+
+.submit-btn-disabled {
+  opacity: 0.7;
+  cursor: not-allowed;
+}
 
-	button {
-		margin-top: 20rpx;
-	}
-	
-	.label{
-		margin: 10rpx 0;
-	}
-	
-	.tips{
-		margin-top: 20rpx;
-		font-size: 24rpx;
-		color: #565656;
-	}
-	
-	.get-order-popup{
-		background-color: #ffffff;
-		padding: 30rpx;
-		height: 60vh;
-		border-radius: 30rpx 30rpx 0 0;
-		overflow: hidden;
-	}
-	.mt20{
-		margin-top: 20rpx;
-	}
-	
-	.pd2030{
-		padding: 20rpx 30rpx;
-	}
-	
-	.table{
-		font-size: 24rpx;
-	}
-	.align-left{
-		text-align: left;
-		width: 50%;
-	}
-	.align-right{
-		text-align: right;
-		width: 50%;
-	}
-	
-	
-</style>
+.error-message {
+  color: #ff4d4f;
+  font-size: 14px;
+  margin-top: 10px;
+  text-align: center;
+}
+</style>

+ 179 - 58
pages/wallet/topup/detail.vue

@@ -1,75 +1,196 @@
 <template>
-	<view>
-		<view class="cmain">
-			<view class="box order_detail" style="margin-top: 0px">
-				<u-divider text="服务点充值信息"></u-divider>
-				<view class="item" style="padding-top: 0px">
-					<text class="label">支付方式</text>
-					<text class="desc">微信支付</text>
+	<view class="recharge-details">
+		<u-divider text="服务点充值信息"></u-divider>
+		<view class="content">
+			<view class="card">
+				<view class="card-item">
+					<text class="label">充值时间</text>
+					<text class="value">{{ detail.topupTime }}</text>
+				</view>
+				<view class="card-item highlight">
+					<text class="label">充值点数</text>
+					<text class="value">{{ detail.amount }}</text>
 				</view>
-				<view class="item">
-					<text class="label">商户号</text>
-					<text class="desc omit">{{ item.mchid }}</text>
+				<view class="card-item">
+					<text class="label">充值前点数</text>
+					<text class="value">{{ detail.beforeAmount }}</text>
 				</view>
-				<view class="item">
-					<text class="label">商户系统内部订单号</text>
-					<text class="desc omit">{{ item.outTradeNo }}</text>
+				<view class="card-item">
+					<text class="label">充值后点数</text>
+					<text class="value">{{ detail.afterAmount }}</text>
 				</view>
-				<view class="item">
-					<text class="label">微信支付系统生成的订单号</text>
-					<text class="desc omit">{{ item.transactionId }}</text>
+			</view>
+
+			<view class="card">
+				<view class="card-item">
+					<text class="label">微信订单号</text>
+					<text class="value">{{ detail.transactionId }}</text>
 				</view>
-				<view class="item">
-					<text class="label">服务点数量(金额)</text>
-					<text class="desc">+{{ item.amount }}</text>
+				<view class="card-item">
+					<text class="label">系统订单号</text>
+					<text class="value">{{ detail.outTradeNo }}</text>
 				</view>
-				<view class="item">
-					<text class="label">充值时间</text>
-					<text class="desc">{{ item.topupTime }}</text>
-				</view>	
 			</view>
 		</view>
+		<view class="footer">
+			<button class="return-button" @tap="goBack">返回</button>
+		</view>
 	</view>
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			item: {},
-			param: {},
-		};
-	},
-	onLoad(e) {
-		if (e.id) {
-			this.param.id = e.id
-			this.http.request({
-				url: '/level-one-server/app/WalletManage/getTopUpById',
-				data: this.param,
-				success: res => {
-					this.item = res.data.data;
-				}
-			});
-		}
-		if (e.transactionId) {
-			this.param.transactionId = e.transactionId
-			this.http.request({
-				url: '/level-one-server/app/WalletManage/getTopUpByTransactionId',
-				data: this.param,
-				success: res => {
-					this.item = res.data.data;
-				}
-			});
+	export default {
+		data() {
+			return {
+				detail: {
+
+				},
+				rechargeTime: '2024-10-28 17:18:58',
+				beforePoints: 100,
+				afterPoints: 200,
+				rechargePoints: 100,
+				wxOrderNo: 'WX20241028171858001',
+				systemOrderNo: 'SYS20241028171858001'
+			}
+		},
+		onLoad(option) {
+			// 从路由参数中获取充值金额
+			this.geDetail(option.id);
+		},
+		methods: {
+			geDetail(id) {
+				this.http.request({
+					url: '/level-one-server/app/TbWalletTopup/getById',
+					data: {
+						id: id
+					},
+					success: resp => {
+						this.detail = resp.data.data;
+					}
+				})
+			},
+			goBack() {
+				uni.navigateBack()
+			},
+
 		}
-	},
-	methods: {
-		
 	}
-};
 </script>
 
 <style lang="scss">
-page {
-	background-color: $pg;
-}
-</style>
+	.recharge-details {
+		min-height: 80vh;
+		background-color: #f5f7fa;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.header {
+		background-color: #007AFF;
+		padding: 40rpx 30rpx;
+		display: flex;
+		align-items: center;
+		position: relative;
+
+		.back-button {
+			position: absolute;
+			left: 30rpx;
+
+			.icon-back {
+				font-size: 40rpx;
+				color: #ffffff;
+			}
+		}
+
+		.title {
+			flex: 1;
+			text-align: center;
+			color: #ffffff;
+			font-size: 36rpx;
+			font-weight: bold;
+		}
+	}
+
+	.content {
+		flex: 1;
+		padding: 30rpx;
+	}
+
+	.card {
+		background-color: #ffffff;
+		border-radius: 20rpx;
+		padding: 30rpx;
+		margin-bottom: 30rpx;
+		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
+	}
+
+	.card-item {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 20rpx 0;
+		border-bottom: 1rpx solid #f0f0f0;
+
+		&:last-child {
+			border-bottom: none;
+		}
+
+		.label {
+			color: #666666;
+			font-size: 28rpx;
+		}
+
+		.value {
+			color: #333333;
+			font-size: 28rpx;
+			font-weight: 500;
+		}
+
+		&.highlight {
+
+			.label,
+			.value {
+				color: #007AFF;
+				font-weight: bold;
+			}
+		}
+	}
+
+	.footer {
+		padding: 30rpx;
+	}
+
+	.return-button {
+		background-color: #007AFF;
+		color: #ffffff;
+		border: none;
+		border-radius: 50rpx;
+		padding: 20rpx 0;
+		font-size: 32rpx;
+		font-weight: bold;
+		box-shadow: 0 4rpx 12rpx rgba(0, 123, 255, 0.3);
+		transition: all 0.3s ease;
+
+		&:active {
+			transform: translateY(2rpx);
+			box-shadow: 0 2rpx 6rpx rgba(0, 123, 255, 0.3);
+		}
+	}
+
+	// 添加一个简单的图标字体,用于返回按钮
+	@font-face {
+		font-family: 'iconfont';
+		src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKcAAsAAAAABlAAAAJPAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcApsgQ0BNgIkAwgLBgAEIAWEbQc2G7oFyK4wbuGJaCVsrXwzCN5Xzef9nLtvzMwHRJIoiAlKQqKQIlGah3TvpF7pzvL/udLXgDhQy0QkqtWuZ87sJvSGnCqkQh6Q0/+cXm0CDnx+oEvNg9oATlsDjLMosgIpIG8Yu8AlPCbQaVYjcVhZ3wIlhTEvEE8MoYBSllQpDW1DvWJjEW9Aazo9Th+BN//9+JeKUkmaMvPi/nHFBco/a3+Wg/9BdAQIEEFwvY2MNSARJ5WZQ1IwLqmTn2WwBdVq8bP2/ycysFXkv7wiyGrIbmAKs+RnrRQEP2vVIPEOXTqx3wTEY7A3cDgFx0vS1d0GlBSIyG5/3Nvde7h69Xrn6Qvd9auDZyuHV3fXL1+ygbZuHT6+Vgm7eAFOx84eX3/Rde7MwZHo9trZ3UtHR3fvHt1dO9c9gu7t3e2jI+jcNbJ/dHvvLrq1tn9y7eDZ9aNn+4/uQNf2T+/t3L3qcPzm9E3H/wdxWPy0z7z9fKs5bK+8mQ+TJfCt/OnGX+Vgp+Dj/0j4N1/8Gx/yEXxrBqXzrWGAn7WfYMFEo2HLlKYGOxSC3KBTJxCtxlHSbgp9Gu3zO3XqhEqLSiVkncYwGbWGRpc1qNVpC52u2F3dZUQpRjpYMQ+h3wVJr0/I+n1hMuoTGqO+odYfJnS6j5hL7LIaZuVYDFGhGPsPnYeKJOlGzTvyNZSLOhPlC49oCnOy4Pk5Z0SKsUNu4SJcFxmGiSAXLuA8dF0Jznmm6FNRqLgxjOp4iEIhDLP/QMdDCimlNjjz/XwNygo1J1Qgki+kUjBOLEGnHycJIdXKdqhbqpZwusAwGEkgXOACctEpCeQ4Ty/RR4lCCo3JFKqOK4r1+TXSD+5AJ+NRpMhRokIdGvQcY6YZk0o6lZRTq5kRAAA=') format('woff2');
+	}
+
+	.iconfont {
+		font-family: "iconfont" !important;
+		font-style: normal;
+		-webkit-font-smoothing: antialiased;
+		-moz-osx-font-smoothing: grayscale;
+	}
+
+	.icon-back:before {
+		content: "\e697";
+	}
+</style>

+ 143 - 78
pages/wallet/topup/edit.vue

@@ -1,64 +1,120 @@
 <template>
-	<view class="app">
-		<view>
-			<view class="label">充值金额(单位:元 ):</view>
-			<view><input v-model.number="total_fee" type="number" /></view>
+	<view class="recharge-container">
+		<view class="amount-options">
+			<view v-for="amount in amounts" :key="amount"
+				:class="['amount-option', { selected: selectedAmount === amount }]" @tap="selectAmount(amount)">
+				{{ amount }}元
+			</view>
+		</view>
+		<view class="custom-amount">
+			<input type="number" v-model="customAmount" placeholder="自定义金额" @input="onCustomAmountInput"
+				@blur="validateCustomAmount" />
+			<text>元</text>
+		</view>
+		<button class="submit-btn" @tap="submitRecharge">确认充值</button>
+		<view style="padding: 15px;line-height: 30px;font-size: 16px;">
+			<h3>充值说明:</h3>
+			<view>1、充值的金额和服务点数相对应,充值一元=一服务点数;</view>
+			<view>2、充值的服务点数仅用于商品上架二级市场的技术服务费。</view>
 		</view>
-		<button type="primary" @click="createOrder('wxpay')">发起支付(微信)</button>
 	</view>
+
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
-				total_fee: 10, // 金额				
-				transaction_id:"", // 查询订单接口的查询条件
-				getOrderRes:{}, // 查询订单支付成功后的返回值
+				amounts: [5, 10, 20, 30, 50, 100],
+				selectedAmount: 5,
+				customAmount: '',
 			}
 		},
 
 		methods: {
 
+			selectAmount(amount) {
+				this.selectedAmount = amount
+				this.customAmount = ''
+			},
+			onCustomAmountInput() {
+				this.selectedAmount = null;
+				this.customAmount = Math.floor(Number(this.customAmount));
+			},
+			validateCustomAmount() {
+				if (this.customAmount < 1) {
+					this.customAmount = '';
+					uni.showToast({
+						title: '充值金额必须大于等于1元',
+						icon: 'none'
+					});
+				}
+			},
+			submitRecharge() {
+				const amount = this.selectedAmount || Number(this.customAmount)
+				if (amount && Number.isInteger(amount) && amount > 0) {
+					let that = this;
+					uni.showModal({
+						title: '充值确认',
+						content: `您选择充值金额:${amount}点数`,
+						success: (res) => {
+							if (res.confirm) {
+								that.createOrder(amount);
+								// 这里可以添加实际的充值逻辑
+							}
+						}
+					})
+				} else {
+					uni.showToast({
+						title: '请选择或输入有效的整数充值点数',
+						icon: 'none'
+					})
+				}
+			},
+
 			/**
 			 * 发起支付(不唤起收银台,手动指定支付方式)
 			 * 在调用此api前,你应该先创建自己的业务系统订单,并获得订单号 order_no,把order_no当参数传给此api,而示例中为了简化跟支付插件无关的代码,这里直接已时间戳生成了order_no
 			 */
-			createOrder(provider){
+			createOrder(fee) {
 				this.http.request({
-			   	url: '/level-one-server/app/WalletManage/topupSave',
-			   	data: {
-					amount: this.total_fee, // 支付金额,单位分 100 = 1元
-					goodsName: '服务点充值'
-			   	},
-			   	success: res => {
-					console.log('WxPayAppOrderResult:',res)
-					// 调起支付
-					this.orderPayment(res.data.data);
-					this.transaction_id = res.data.data.prepayId;					
-			   	}
-			   });				
+					url: '/level-one-server/app/WalletManage/topupSave',
+					data: {
+						amount: fee, // 支付金额,单位分 100 = 1元
+						goodsName: '服务点充值'
+					},
+					success: res => {
+						console.log('WxPayAppOrderResult:', res)
+						// 调起支付
+						this.orderPayment(res.data.data);
+						this.transaction_id = res.data.data.prepayid;
+					}
+				});
 			},
-			
+
 			// 调起支付
-			orderPayment(data){			
-				console.log('fff',data)
+			orderPayment(data) {
 				uni.requestPayment({
 					"provider": "wxpay",
 					"orderInfo": data,
-					success:(res)=>{
-						this.user.wallet = this.user.wallet + this.total_fee;
-					console.log("this.user",this.user)
-					uni.setStorageSync('info', this.user);
+					success: (res) => {
+						console.log(res);
 						uni.navigateTo({
-							url: '/pages/wallet/topup/detail?transaction_id=' + data.prepayId
+							url: '/pages/wallet/topup/topupSuccess?prePayId=' + data.prepayid
 						})
 					},
-					fail:(err)=>{
+					complete: (resp) => {
+						
+						console.log(resp);
+					},
+					fail: (err) => {
+						console.log(err);
 						// 发起支付失败
-						uni.showToast({title: '发起支付失败!'+err.errMsg,});						
+						// uni.showToast({
+						// 	title: '发起支付失败!' + err.errMsg,
+						// });
 					}
-				});				
+				});
 			},
 
 
@@ -84,63 +140,72 @@
 						icon: "none"
 					});
 				}
-			},			
-		}, 
+			},
+		},
 	}
 </script>
 
 <style lang="scss" scoped>
-	.app{
-		padding: 30rpx;
-	}
-	input {
-		border: 1px solid #f3f3f3;
-		padding: 10rpx;
-		width: 100%;
-		box-sizing: border-box;
-		height: 80rpx;
+	.recharge-container {
+		margin-top: 30px;
+		padding: 20px;
+		background-color: #ffffff;
 	}
 
-	button {
-		margin-top: 20rpx;
+	.title {
+		font-size: 20px;
+		font-weight: bold;
+		text-align: center;
+		margin-bottom: 20px;
 	}
-	
-	.label{
-		margin: 10rpx 0;
-	}
-	
-	.tips{
-		margin-top: 20rpx;
-		font-size: 24rpx;
-		color: #565656;
+
+	.amount-options {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-between;
+		margin-bottom: 20px;
 	}
-	
-	.get-order-popup{
-		background-color: #ffffff;
-		padding: 30rpx;
-		height: 60vh;
-		border-radius: 30rpx 30rpx 0 0;
-		overflow: hidden;
+
+	.amount-option {
+		width: 30%;
+		height: 40px;
+		line-height: 40px;
+		text-align: center;
+		border: 1px solid #007aff;
+		border-radius: 4px;
+		margin-bottom: 10px;
 	}
-	.mt20{
-		margin-top: 20rpx;
+
+	.amount-option.selected {
+		background-color: #007aff;
+		color: #ffffff;
 	}
-	
-	.pd2030{
-		padding: 20rpx 30rpx;
+
+	.custom-amount {
+		display: flex;
+		align-items: center;
+		margin-bottom: 20px;
 	}
-	
-	.table{
-		font-size: 24rpx;
+
+	.custom-amount input {
+		flex: 1;
+		height: 40px;
+		border: 1px solid #007aff;
+		border-radius: 4px;
+		padding: 0 10px;
 	}
-	.align-left{
-		text-align: left;
-		width: 50%;
+
+	.custom-amount text {
+		margin-left: 5px;
 	}
-	.align-right{
-		text-align: right;
-		width: 50%;
+
+	.submit-btn {
+		width: 100%;
+		height: 44px;
+		line-height: 44px;
+		background-color: #007aff;
+		color: #ffffff;
+		border-radius: 4px;
+		text-align: center;
 	}
-	
-	
-</style>
+</style>

+ 36 - 20
pages/wallet/wallet.vue

@@ -6,21 +6,22 @@
 		<view class="list animated fadeInDown">
 			<view class="uni-flex uni-row center">
 				<view class="wallet">
-					<text>我的服务点数</text>
-					<text class="num">{{ user.wallet }}</text>					
+					<h1 style="color: blue;">{{ user.wallet }}</h1>
 				</view>
 			</view>
 		</view>
 		<view class="uni-flex uni-row" style="padding:1rem; ">
-			<button type="primary" style="-webkit-flex: 1;flex: 1;" @click="goto('/pages/wallet/topup/edit')">充值</button>
+			<button type="primary" style="-webkit-flex: 1;flex: 1;"
+				@click="goto('/pages/wallet/topup/edit')">充值</button>
 			<view class="text" style="width: 15rpx;"></view>
-			<button type="default" style="-webkit-flex: 1;flex: 1;" @click="goto('/pages/wallet/topdown/edit')">兑现</button>
+			<button type="default" style="-webkit-flex: 1;flex: 1;"
+				@click="goto('/pages/wallet/topdown/edit')">兑现</button>
 		</view>
 		<view class="tab">
 			<u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
 		</view>
 		<view class="goodsList">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">	
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 				<view class="title">{{ item.tagTypeName }}
 					<view class="state" v-if="item.tagType == 1 ">
 						<text class="icon" style="color:#13ce66">&#xe830;</text>
@@ -35,7 +36,7 @@
 						<text>-{{ item.amount }}</text>
 					</view>
 				</view>
-				<view class="op">					
+				<view class="op">
 					<view class="date">{{ item.recordTime }}</view>
 				</view>
 			</view>
@@ -70,7 +71,8 @@
 				param: {
 					pageNo: 1,
 					pageSize: 10,
-					tagType:''
+					status:2,
+					tagType: ''
 				},
 				list: [],
 				loadMore: true,
@@ -104,22 +106,24 @@
 				this.refresh()
 			},
 			detail(item) {
-				let urlStr=''
-				if(item.tagType==1){
-					urlStr='/pages/wallet/topup/detail?id='
+				let urlStr = ''
+				if (item.tagType == 1) {
+					urlStr = '/pages/wallet/topup/detail?id='
 				}
-				if(item.tagType==2){
-					urlStr='/pages/wallet/topdown/detail?id='
+				if (item.tagType == 2) {
+					urlStr = '/pages/wallet/topdown/detail?id='
 				}
-				if(item.tagType==3){
-					urlStr='/pages/wallet/detail?id='
+				if (item.tagType == 3) {
+					urlStr = '/pages/wallet/detail?id='
 				}
 				uni.navigateTo({
 					url: urlStr + item.id
 				});
 			},
 			goto(url) {
-				uni.navigateTo({ url: url });
+				uni.navigateTo({
+					url: url
+				});
 			},
 			// 刷新数据
 			refresh() {
@@ -150,49 +154,61 @@
 	page {
 		background-color: #f5f5f5;
 	}
+
 	.my_top {
 		position: relative;
 		overflow: hidden;
+
 		image {
 			width: 100%;
 		}
 	}
+
 	.uni-flex {
 		display: flex;
 		flex-direction: row;
 	}
+
 	.uni-flex-item {
 		flex: 1;
 	}
+
 	.uni-row {
 		flex-direction: row;
 	}
+
 	.list {
 		position: relative;
 		padding: 0px 20px 10px 20px;
 		margin-top: -226px;
-		.center{
+
+		.center {
 			-webkit-justify-content: center;
 			justify-content: center;
 			text-align: center;
+
 			.wallet {
 				display: flex;
 				flex-direction: column;
 				background-color: white;
-				width: 15rem;
-				height: 7rem;
+				width: 5rem;
+				height: 5rem;
+				line-height: 5rem;
 				border-radius: 50%;
+
 				.num {
 					color: #0000CC;
-					font-size: 43px;					
+					font-size: 43px;
 				}
 			}
-			.rbtn {			
+
+			.rbtn {
 				padding-left: 15px;
 				width: 60%;
 			}
 		}
 	}
+
 	.state {
 		margin-right: -70px;
 	}