zqwang 1 yıl önce
ebeveyn
işleme
b4449e5995

+ 7 - 0
common/apis/recharge.js

@@ -0,0 +1,7 @@
+import http from "../http.js";
+
+// 获取用户信息
+export const getOptions = () => {
+	return http.get('/api/pay/options');
+} 
+

+ 1 - 1
common/config.js

@@ -1,7 +1,7 @@
 // 配置信息
 // 配置信息
 export default {
 export default {
 	// api请求前缀
 	// api请求前缀
-	apiUrl:"http://api.duanju.dududus.com",
+	apiUrl:"https://api.duanju.dududus.com",
 	webUrl:'http://xjc.demo.hongcd.com',//uni.getStorageSync("config").weburl?uni.getStorageSync("config").weburl:'http://192.168.10.175',
 	webUrl:'http://xjc.demo.hongcd.com',//uni.getStorageSync("config").weburl?uni.getStorageSync("config").weburl:'http://192.168.10.175',
 	imgUrl:'https://xjc.demo.hongcd.com',//uni.getStorageSync("config").imgurl?uni.getStorageSync("config").imgurl:'http://192.168.10.175',
 	imgUrl:'https://xjc.demo.hongcd.com',//uni.getStorageSync("config").imgurl?uni.getStorageSync("config").imgurl:'http://192.168.10.175',
 	staticUrl:'https://xjc.demo.hongcd.com/img/',//静态图片地址https://xjc.demo.hongcd.com
 	staticUrl:'https://xjc.demo.hongcd.com/img/',//静态图片地址https://xjc.demo.hongcd.com

+ 9 - 0
pages.json

@@ -417,6 +417,15 @@
             }
             }
             
             
         }
         }
+        ,{
+            "path" : "pages/client/pay/pay",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "充值",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
     ],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTextStyle": "black",

+ 66 - 0
pages/client/components/pay/recharge.vue

@@ -0,0 +1,66 @@
+<template>
+	<view class="re-body pd16_15">
+		<p class="ft14">账户余额<span class="ft14 kb-txt">{{user_info.total_coin}}</span>K币</p>
+		<view class="box options-box">
+			<block v-for="(item,key) in list" :key="key">
+				<view class="box mt16  options-item">
+					<text class="ft18 pirice-txt"> 50.9元</text>
+					<p class="ft14 cz-desc-txt">5000币 <text class="ft14">+888币</text></p>
+					<text></text>
+				</view>
+			</block>
+			
+		</view>
+		<view class="ft14 textdesc">
+			<text class="ft12">1、虚拟商品,一经购买不得退换</text>
+			<text class="ft12">2、充值后K币可能有延迟,1小时未到账请在“我的”页面联系客服</text>
+			<text class="ft12">3、未满18岁的未成年需要在监护人陪同下购买并观看短剧剧</text>
+			<text class="ft12">4、购买成功后,“K币”仅在本小程序中使用</text>
+			<text class="ft12">5、购买成功后可在”我的”页面订单中心进行查看</text>
+		</view>
+
+	</view>
+</template> 
+
+<script>
+	import {
+		getOptions
+	} from "@/common/apis/recharge.js"
+	export default {
+		props: ['user_info', "video_info"],
+		data() {
+			return {
+				list: []
+			}
+		},watch:{
+			user_info:{
+				// 此处监听variable变量,当期有变化时执行
+				handler(item1,item2){
+					this.user_info = item1;
+					// console.log('111111111111','item1',item1,'item2',item2,'this.user_info',this.user_info)
+					// item1为新值,item2为旧值
+				}
+			}
+		},
+		created() {
+			// props 会暴露到 `this` 上
+			this.get_options();
+			console.log(this.user_info, 'getOptions', this.list)
+		},
+		methods: {
+			loginAct() {
+				this.$emit('loginAct');
+			},  
+			showQrcodeAct() {
+				this.$emit('qrcode');
+			},
+			async get_options() {
+				this.list = await getOptions();
+			}
+		}
+	}
+</script>
+
+<style>
+	@import url("style/recharge.css");
+</style>

+ 44 - 0
pages/client/components/pay/style/recharge.css

@@ -0,0 +1,44 @@
+.re-body {
+	background-color: #fff;
+}
+
+.textdesc {
+	margin-top: 5rpx;
+	display: flex;
+	flex-direction: column;
+}
+
+.textdesc text {}
+
+.kb-txt {
+	color: #FF9800;
+}
+
+.options-box {
+	display: flex;
+	flex-direction: row;
+	flex-wrap: wrap;
+}
+
+.options-item {
+	padding: 20rpx 20rpx 0px 20rpx;
+	display: flex;
+	flex-direction: column;
+	width: calc((100% - 20rpx) / 2);
+	min-width: calc((100% - 20rpx) / 2);
+	max-width: calc((100% - 20rpx) / 2);
+	background-color: #ececec;
+	margin: 20rpx 0px 20rpx 20rpx;
+	border-radius: 10rpx;
+}
+
+.options-item:nth-child(2n+1) {
+	margin-left: 0rpx;
+}
+
+.pirice-txt {
+	color: #ff5722;
+}
+.cz-desc-txt{
+	margin: 10rpx 0;
+}

+ 4 - 2
pages/client/member/index.vue

@@ -29,8 +29,10 @@
 						<label class="coin-text">{{userinfo.free_coin|| 0}}</label>
 						<label class="coin-text">{{userinfo.free_coin|| 0}}</label>
 						<label class="coin-text">赠送看币</label>
 						<label class="coin-text">赠送看币</label>
 					</div>
 					</div>
-				</div>
-				<div class="mt16 box-cj"><label class="btn-cz">去充值</label></div>
+				</div>
+				<navigator  url="/pages/client/pay/pay">
+				<div class="mt16 box-cj"><label class="btn-cz">去充值</label></div>
+				</navigator>
 
 
 			</div>
 			</div>
 			<!-- <home-vipcard :userinfo="userinfo" @loginAct="showLoginAct" @qrcode="showQrcode = true"></home-vipcard> -->
 			<!-- <home-vipcard :userinfo="userinfo" @loginAct="showLoginAct" @qrcode="showQrcode = true"></home-vipcard> -->

+ 29 - 0
pages/client/pay/pay.vue

@@ -0,0 +1,29 @@
+<template>
+	<view class="">
+		<recharge :user_info="user_info"> </recharge>
+	</view>
+</template>
+
+<script>
+	import recharge from '../components/pay/recharge.vue';
+	import {getUserInfo} from "@/common/apis/my.js";
+	export default {
+		components:{
+			recharge
+		},
+		data() {
+			return {
+				user_info:{},
+			}
+		},async onShow() {
+			this.user_info = await  getUserInfo();
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+@import url("style/pay.css");
+</style>

+ 14 - 0
pages/client/pay/style/pay.css

@@ -0,0 +1,14 @@
+.body{
+	background-color: #fff;
+}
+.textdesc{
+	display: flex;
+	flex-direction: column;
+}
+
+.textdesc text{
+	
+}
+.kb-txt{
+	color: #FF9800;;
+}