Przeglądaj źródła

购买成功跳转

gcz 4 lat temu
rodzic
commit
a4d221604f

+ 1 - 0
config/config.js

@@ -2,6 +2,7 @@ const config = {
 	//dev
 	// apiBaseurl:'http://172.16.90.8:21998',//东东
 	// apiBaseurl:'http://wx.hw.hongweisoft.com/cqthminapp',//东东
+	// apiBaseurl:'http://172.16.90.102:21998',//东东
 	apiBaseurl:'http://47.108.214.98:21998',//服务器
 	
 	// 图片占位

+ 13 - 1
pages.json

@@ -1,5 +1,11 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+	{
+		"path": "pages/buySuccess/buySuccess",
+		"style": {
+			"navigationBarTitleText": "结果页"
+		}
+	},
 		{
 			"path": "pages/index/init",
 			"navigationStyle":"custom"
@@ -47,7 +53,7 @@
 		{
 			"path": "pages/product/productList/productList",
 			"style": {
-				"navigationBarTitleText": ""
+				"navigationBarTitleText": "更多产品"
 			}
 		},
 		{
@@ -56,6 +62,12 @@
 				"navigationBarTitleText": ""
 			}
 		},
+		// {
+		// 	"path": "pages/buySuccess/buySuccess",
+		// 	"style": {
+		// 		"navigationBarTitleText": "结果页"
+		// 	}
+		// },
 		{
 			"path": "pages/use/useRouter",
 			"style": {

+ 32 - 0
pages/buySuccess/buySuccess.css

@@ -0,0 +1,32 @@
+page{background-color: #F5F5F5;}
+.content{background-color: #fff;padding: 113rpx 24rpx 64rpx;text-align: center;}
+.content-icon{width: 108rpx;height: 108rpx;margin-bottom: 48rpx;}
+.content-til{font-size: 36rpx;color: #333;line-height: 50rpx;font-weight: 400;margin-bottom: 16rpx;}
+.content-subtil{font-size: 26rpx;color: #999;line-height: 37rpx;font-weight: 400;min-height: 74rpx;}
+.full-btn{margin: 40rpx 24rpx;}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 48 - 0
pages/buySuccess/buySuccess.vue

@@ -0,0 +1,48 @@
+<template>
+	<view class="pages">
+		<view class="content">
+			<image :src="$getimg + 'icon-chenggong.png'" class="content-icon" mode="heightFix"></image>
+			<view class="content-til">购买成功</view>
+			<view class="content-subtil">您已成购买碳汇产品</view>
+		</view>
+		<view class="full-btn" @click="goCertDetails">查看证书</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				$getimg:this.$getimg,
+				token:'',
+				orderid:'',
+				params:{
+					
+				}
+				
+			}
+		},
+		onShow() {
+			let serf = this;
+			this.token = this.$store.state.token;
+		},
+		onLoad(option) {
+			console.log('option',option);
+			this.orderid = option.orderid;
+
+		},
+		methods: {
+			goCertDetails(id){
+				// console.log(id)
+				uni.navigateTo({
+					url: '/pages/usercenter/certificateList/certificate/certificate?orderid=' + this.orderid,
+				});
+			},
+
+		}
+	}
+</script>
+
+<style>
+	@import url("./buySuccess.css");
+</style>

+ 2 - 1
pages/confirmOrder/confirmOrder.vue

@@ -200,7 +200,8 @@
 					    paySign: res.data.retBody.paySign,
 					    success: function (res) {
 							// self.$api.href('/pages/usercenter/orderList/orderList')
-							self.$api.href('/pages/usercenter/certificateList/certificate/certificate?orderid=' + self.orderid)
+							// self.$api.href('/pages/usercenter/certificateList/certificate/certificate?orderid=' + self.orderid);
+							self.$api.href('/pages/buySuccess/buySuccess?orderid=' + self.orderid)
 					        console.log('success:' + JSON.stringify(res));
 					    },
 					    fail: function (err) {

+ 7 - 3
pages/index/index.vue

@@ -39,7 +39,7 @@
 					<image :src="$getimg+'home-buy-now-img.png'" class="buy-now-img" mode="aspectFit"></image>
 				</view>
 				<view class="buy-now-text">
-					<view class="buy-now-text-big">立即购碳</view>
+					<view class="buy-now-text-big">{{buyNowText}}</view>
 					<view class="buy-now-text-small">点击去购碳哟</view>
 				</view>
 				<view class="buy-now-icon">
@@ -201,7 +201,8 @@
 				rankTop:[],
 				myRank:{},
 				rankList:[],
-				rankResult:{}
+				rankResult:{},
+				buyNowText:'立即认购'
 				
 			}
 		},
@@ -219,7 +220,10 @@
 						  iconPath: '/static/img/icon_mall.png',
 						  selectedIconPath: '/static/img/icon_mall_active.png',
 						  pagePath: '/pages/mall/mall'
-						})
+						});
+						self.buyNowText = '立即购碳'
+					}else{
+						self.rankTab(2);
 					};
 				}
 			});

+ 2 - 2
pages/index/modal/quickBuy.css

@@ -12,13 +12,13 @@
 .remark{border: 2rpx solid #DFDFDF;padding: 30rpx 24rpx 24rpx;}
 .remark-textarea{font-size: 24rpx;color: #ccc;line-height: 33rpx;height: 100rpx;}
 
-.amount-wrap{display: flex;padding: 32rpx 40rpx;margin-bottom: 12rpx;align-items: center;justify-content: space-between;}
+.amount-wrap{display: flex;padding: 32rpx 40rpx 0;margin-bottom: 12rpx;align-items: center;justify-content: space-between;}
 .amount-flex-wrap{display: flex;align-items: center;}
 .amount-til{font-size: 30rpx;color: #666;font-weight: 600;}
 .amount{color: #FFDA00;font-weight: 600;}
 .amount .rmb{font-size: 54rpx;}
 .amount .num{font-size: 70rpx;}
-.amount-btn{margin-right: 0;height: 98rpx;line-height: 98rpx;padding: 0 22rpx;background-color: #26D18B;border-radius: 6rpx;text-align: center;color: #fff;}
+.amount-btn{margin-right: 0;height: 98rpx;line-height: 98rpx;width: 240rpx;background-color: #26D18B;border-radius: 6rpx;text-align: center;color: #fff;}
 
 .tip{padding: 0 40rpx 50rpx;font-size: 28rpx;color: #999;}
 

+ 19 - 3
pages/index/modal/quickBuy.vue

@@ -28,7 +28,7 @@
 							<text class="num">{{totalMoney}}</text>
 						</view>						
 					</view>					
-					<view class="amount-btn"  @click="goCart">提交认购申请</view>
+					<view class="amount-btn"  @click="goCart">{{amountBtnText}}</view>
 				</view>
 				<view class="tip">
 					购买{{shoppingNum}}kg,预估金额{{totalMoney}}元,认购期3年
@@ -52,8 +52,21 @@
 			uniPopup,
 		},
 		created() {
-			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;			
 			let self = this;
+			uni.getStorage({
+				key : 'userInfo',
+				success:function(res){
+					// console.log('userInfo customerType',res.data.customerType);
+					if(res.data.customerType =='1'){
+						// console.log('个人用户');
+						self.amountBtnText = '立即购买'
+					}else{
+						
+					};
+					
+				}
+			});
+			this.thetoken = 'Bearer' + ' ' + this.$store.state.token;
 			this.shoppingNum = 1;
 			uni.getStorage({
 				key:'userInfo',
@@ -92,6 +105,7 @@
 				totalMoney:0,
 				price:3,
 				helpPeople:[],
+				amountBtnText:'提交认购申请'
 				// goodsId:'',
 				// carbonVal:''
 			}
@@ -161,7 +175,9 @@
 					Authorization: this.thetoken, //注意Bearer后面有一空格
 				},
 				}).then(res=>{
-					self.$api.href('/pages/usercenter/subscribe/subscribe')
+					console.log('res.data.retBody',res.data.retBody);
+					self.$api.href('/pages/offlineBuy/offlineBuy?guid=' + res.data.retBody);
+					// self.$api.href('/pages/usercenter/subscribe/subscribe');
 				}).catch( err =>{
 					console.log('err',err)
 				})

+ 1 - 0
pages/product/product.css

@@ -11,6 +11,7 @@ page{background-color: #F5F5F5;}
 
 .main-body{margin-bottom: 24rpx;background-color: #fff;}
 .main-body-til{display: flex;justify-content: space-between;align-items: center;padding: 24rpx;border-bottom: 1px solid #ddd;}
+.main-body-til.noborder{border-bottom: 0;}
 .main-body-til .til{font-size: 30rpx;font-weight: 600;color: #333;}
 .main-body-til .con{display: flex;align-items: center;font-size: 24rpx;color: #666;}
 .main-body-info{display: flex;padding: 24rpx;align-items: center;}

+ 16 - 6
pages/product/product.vue

@@ -8,7 +8,7 @@
 			:autoplay="swiper.autoplay"
 			:interval="swiper.interval" :duration="swiper.duration">
 				<swiper-item v-for="(item, index) in bannerList" :key="index">
-					<view class="adv-item" ><image :src="$onlineImg +item" class="pic" mode="heightFix"></image></view>
+					<view class="adv-item" ><image :src="$onlineImg +item" class="pic" mode="scaleToFill"></image></view>
 				</swiper-item>
 			</swiper>
 		</view>
@@ -26,23 +26,23 @@
 			</view>			
 		</view>
 		<view class="main-body">
-			<view class="main-body-til">
+			<view class="main-body-til noborder">
 				<view class="til">碳汇研发主体</view>
 				<view class="con">
-					<text>青龙村</text>
+					<!-- <text>青龙村</text> -->
 					<text class="iconfont icon-jiantou"></text>
 				</view>
 			</view>
-			<view class="main-body-info">
+			<!-- <view class="main-body-info">
 				<image :src="$getimg+'home-buy-now-img.png'" class="main-body-info-img" mode="scaleToFill"></image>
 				<view class="main-body-info-text">
 					<view class="text-item">
 						<text class="text">家庭成员:5人</text>
 						<text class="text">涉及产品数:3</text>
 					</view>
-					<view class="main-body-info-text">地址:重庆市渝中区解放碑街道民生路</view>
+					<view class="main-body-info-text">地址:{{product.productInfos[0].povertyArea.areaAddress || ""}}</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view class="main-body product-info">
 			<view class="main-body-til">
@@ -63,6 +63,16 @@
 				</view>
 			</view>
 		</view>
+		<view class="main-body">
+			<view class="main-body-til">
+				<view class="til">产品介绍</view>
+			</view>
+			<view class="main-body-info">
+				<view class="main-body-info-text">
+					<view class="main-body-info-text">{{product.productInfos[0].povertyArea.areaDesc || ""}}</view>
+				</view>
+			</view>
+		</view>
 		<view class="bottom-btn-wrap">
 			<view class="bottom-btn-wrap-bg">
 				<view class="bottom-btn btn" @click="randomPop">

+ 4 - 2
pages/use/use.vue

@@ -40,8 +40,9 @@
 		data() {
 			return {
 				$getimg:this.$getimg,
+				token:'',
 				params:{
-					token:'',
+					
 				}
 				
 			}
@@ -73,7 +74,8 @@
 				this.$api.msg('暂未开放')
 			},
 			useClick(){
-				this.$api.msg('稍后展示')
+				this.$api.href('/pages/usercenter/question/question')
+				// this.$api.msg('稍后展示')
 			}
 
 		}

+ 2 - 1
pages/usercenter/orderList/orderList.vue

@@ -285,8 +285,9 @@
 					    signType: 'MD5',
 					    paySign: res.data.retBody.paySign,
 					    success: function (res) {
-							self.downCallback();
+							// self.downCallback();
 					        console.log('success:' + JSON.stringify(res));
+							self.$api.href('/pages/buySuccess/buySuccess?orderid=' + params.orderId)
 					    },
 					    fail: function (err) {
 					        console.log('fail:' + JSON.stringify(err));