DaMowang 2 gadi atpakaļ
vecāks
revīzija
d889d462d8

+ 263 - 0
src/components/xh-privacy/xh-privacy.vue

@@ -0,0 +1,263 @@
+<template>
+	<view class="xh-privacy">
+		<!-- 默认主题 -->
+		<view :style="'background:'+background+';'" class="theme theme-normal" v-if="show_privacy && theme == 'normal'">
+			<view class="theme-content">
+				<view class="title">{{ title }}</view>
+				<view class="des">
+					在使用当前小程序服务之前,请仔细阅读<text :style="'color:'+color+';'" class="link"
+						@click="onOpenPrivacy">{{PrivacyName}}</text>。如你同意{{PrivacyName}},请点击“同意”开始使用。
+				</view>
+				<view class="btns">
+					<button class="item reject" @click="onExitPrivacy">拒绝</button>
+					<button id="agree-btn" :style="'background:'+color+';'" class="item agree" open-type="agreePrivacyAuthorization"
+						v-on:agreeprivacyauthorization="onHandleAgree">同意</button>
+				</view>
+			</view>
+		</view>
+		<!-- 纵向主题 -->
+		<view :style="'background:'+background" class="theme theme-direction" v-if="show_privacy && theme == 'direction'">
+			<view class="theme-content">
+				<view class="title">{{ title }}</view>
+				<view class="des">
+					在使用当前小程序服务之前,请仔细阅读<text :style="'color:'+color+';'" class="link"
+						@click="onOpenPrivacy">{{PrivacyName}}</text>。如你同意{{PrivacyName}},请点击“同意”开始使用。
+				</view>
+				<view class="btns">
+					<button id="agree-btn" :style="'background:'+color+';'" class="item agree"
+						open-type="agreePrivacyAuthorization" v-on:agreeprivacyauthorization="onHandleAgree">同意</button>
+					<button class="item reject" @click="onExitPrivacy">拒绝</button>
+				</view>
+			</view>
+		</view>
+		<!-- 后续会增加更多好看的主题 -->
+		<view class="theme-content">
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		name: "xh-privacy",
+		props: {
+			background: {
+				type: String,
+				default: 'rgba(0, 0, 0, .5)'
+			},
+			color: {
+				type: String,
+				default: '#07c160'
+			},
+			theme: {
+				type: String,
+				default: 'normal'
+			},
+			title: {
+				type: String,
+				default: '隐私保护指引'
+			}
+		},
+		data() {
+			return {
+				show_privacy: false,
+				PrivacyName: ""
+			}
+		},
+		mounted() {
+			let _this = this
+			wx.getPrivacySetting({
+				success(res) {
+					console.log("PrivacySetting:",res);
+					if (res.errMsg == "getPrivacySetting:ok") {
+						// 弹出隐私授权协议
+						_this.show_privacy = res.needAuthorization
+					}
+					_this.PrivacyName = res.privacyContractName
+				}
+			})
+		},
+		methods: {
+			// 拒绝隐私协议
+			onExitPrivacy() {
+				uni.showToast({
+					title: '必须同意后才可以继续使用当前小程序',
+					icon: 'none'
+				})
+			},
+			// 打开隐私协议
+			onOpenPrivacy() {
+				wx.openPrivacyContract({
+					fail: () => {
+						wx.showToast({
+							title: '遇到错误',
+							icon: 'error'
+						})
+					}
+				})
+			},
+			// 同意隐私协议
+			onHandleAgree() {
+				let _this = this
+				_this.show_privacy = false
+			}
+		}
+	}
+</script>
+<style lang="scss">
+	// 纵向主题
+	.theme-direction {
+		.theme-content {
+			.title {
+				text-align: center;
+				color: #333;
+				font-weight: bold;
+				font-size: 32rpx;
+			}
+
+			.des {
+				font-size: 26rpx;
+				color: #666;
+				margin-top: 40rpx;
+				text-align: justify;
+				line-height: 1.6;
+
+				.link {
+					text-decoration: underline;
+				}
+			}
+
+
+			.btns {
+				margin-top: 48rpx;
+				display: flex;
+				flex-direction: column;
+
+				.item {
+					justify-content: space-between;
+					width: 244rpx;
+					height: 80rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					border-radius: 16rpx;
+					box-sizing: border-box;
+					border: none;
+				}
+
+				.reject {
+					width: 100%;
+					background: #f4f4f5;
+					color: #909399;
+					margin-top: 15rpx;
+				}
+
+				.agree {
+					width: 100%;
+					color: #fff;
+				}
+			}
+		}
+	}
+
+	// 默认主题1
+
+	.theme-normal {
+		.theme-content {
+			.title {
+				text-align: center;
+				color: #333;
+				font-weight: bold;
+				font-size: 32rpx;
+			}
+
+			.des {
+				font-size: 26rpx;
+				color: #666;
+				margin-top: 40rpx;
+				text-align: justify;
+				line-height: 1.6;
+
+				.link {
+					color: #07c160;
+					text-decoration: underline;
+				}
+			}
+
+
+			.btns {
+				margin-top: 48rpx;
+				display: flex;
+
+				.item {
+					justify-content: space-between;
+					width: 244rpx;
+					height: 80rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					border-radius: 16rpx;
+					box-sizing: border-box;
+					border: none;
+				}
+
+				.reject {
+					background: #f4f4f5;
+					color: #909399;
+				}
+
+				.agree {
+					background: #07c160;
+					color: #fff;
+				}
+			}
+		}
+	}
+
+	.theme {
+		position: fixed;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		z-index: 9999999;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+
+		.theme-content {
+			width: 632rpx;
+			padding: 48rpx;
+			box-sizing: border-box;
+			background: #fff;
+			border-radius: 16rpx;
+		}
+	}
+
+	/* 无样式button */
+	.btn-normal {
+		display: block;
+		margin: 0;
+		padding: 0;
+		line-height: normal;
+		background: none;
+		border-radius: 0;
+		box-shadow: none;
+		border: none;
+		font-size: unset;
+		text-align: unset;
+		overflow: visible;
+		color: inherit;
+	}
+
+	.btn-normal:after {
+		border: none;
+	}
+
+	.btn-normal.button-hover {
+		color: inherit;
+	}
+
+	button:after {
+		content: none;
+		border: none;
+	}
+</style>

+ 18 - 12
src/pages.json

@@ -408,6 +408,12 @@
 						"navigationStyle": "custom"
 					}
 				},
+				{
+					"path": "topUp/Local",
+					"style": {
+						"navigationBarTitleText": "充值"
+					}
+				},
 
 				{
 					"path": "order/verificationCode",
@@ -469,12 +475,12 @@
 			]
 		}
 	],
-	// "preloadRule": {
-	// 	"pages/orderingfood/merchantlist": {
-	// 		"network": "all",
-	// 		"packages": ["pagesB"]
-	// 	}
-	// },
+	"preloadRule": {
+		"pages/orderingfood/merchantlist": {
+			"network": "all",
+			"packages": ["pagesB"]
+		}
+	},
 	"tabBar": {
 		"color": "#999",
 		"selectedColor": "#18bb88",
@@ -487,12 +493,12 @@
 				"selectedIconPath": "static/nav/home.png",
 				"text": "首页"
 			},
-			{
-				"pagePath": "pages/orderingfood/merchantlist",
-				"iconPath": "static/nav/local_.png",
-				"selectedIconPath": "static/nav/local.png",
-				"text": "数智生活"
-			},
+			// {
+			// 	"pagePath": "pages/orderingfood/merchantlist",
+			// 	"iconPath": "static/nav/local_.png",
+			// 	"selectedIconPath": "static/nav/local.png",
+			// 	"text": "数智生活"
+			// },
 			{
 				"pagePath": "pages/sign/index",
 				"iconPath": "static/nav/benefits_.png",

+ 58 - 2
src/pages/index/index.vue

@@ -19,13 +19,21 @@
             </view>
             <!-- 公告-end -->
             <!-- 金刚区 -->
-            <view class="head_area flex_r flex_jse">
+            <!-- <view class="head_area flex_r flex_jse">
                 <view class="area_list" v-for="(item, index) in area_list" :key="index" @click="setPageUrl(item)">
                     <image class="area_img" :src="item.url"></image>
                     <view class="area_name">{{ item.name }}</view>
                 </view>
-            </view>
+            </view> -->
             <!-- 金刚区-end -->
+            
+            <div class="l_tabBar flex_r flex_jb">
+                <div class="item" v-for="(i,s) in tabs" :key="s" @click="isActivation(i.url)">
+                    <img :src="i.ico" alt="" class="ico">
+                    <!-- <div class="tit">{{ i.tit }}</div> -->
+                </div>
+            </div>
+
             <!-- 活动 -->
             <view class="activity" v-if="homeImg.length">
                 <image class="act_img act_one_img" :src="homeImg[0].image" @click="setPageUrl({ type: 4 })" mode=""></image>
@@ -69,17 +77,25 @@
             </view>
         </view>
         <view class="fz_w_text">让数字经济赋能美好生活!</view>
+		<xh-privacy title="隐私保护指引" color="#18bb88"></xh-privacy>
+        <activation ref="activation" tit="激活" :close="isActivation"/>
+
     </div>
 </template>
 <script>
 let app = getApp();
 var appEv = app.$vm.$options;
 import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
+import activation from "@/components/activation/activation.vue";
+import xhPrivacy from "@/components/xh-privacy/xh-privacy.vue";
 import { post } from "@/request/api.js";
+import tabs from '@/pages/orderingfood/tabs.js'
 export default {
     name: "Appindex",
     components: {
         swiperBanner, //轮播
+        activation,
+        xhPrivacy
     },
     data() {
         return {
@@ -105,6 +121,7 @@ export default {
                 },
             ],
             productList: [], //商品数据
+            tabs
         };
     },
     onLoad(option) {},
@@ -178,6 +195,22 @@ export default {
                 return false;
             }
         },
+        // 是否激活数智生活
+        isActivation(url) {
+            uni.Location();
+            post("local/isActivation").then(res => {
+                if (res.code === 0) {
+                    this.goto(url)
+                    // uni.Luserfun()
+                } else if (res.code == -1) {
+                    this.activation();
+                }
+            })
+        },
+        // 打开激活弹窗
+        activation(){
+            this.$refs.activation.open()
+        },
     },
     computed: {},
     watch: {},
@@ -258,6 +291,29 @@ export default {
     }
 }
 
+.l_tabBar {
+    margin: 32rpx 0;
+    background-color: #fff;
+    padding: 10rpx 20rpx;
+    border-radius: 10rpx;
+    box-shadow: 4rpx 4rpx 16rpx 10rpx rgba($color: #000, $alpha: 0.15);
+    flex-wrap: wrap;
+
+    .item {
+        width: 105rpx;
+        margin: 10rpx 10rpx;
+    }
+
+    .ico {
+        width: 100%;
+        height: 138rpx;
+    }
+
+    // .tit{
+    //   font-size: 26rpx;
+    //   text-align: center;
+    // }
+}
 // 金刚区
 .head_area {
     margin: 20rpx 0 20rpx;

+ 53 - 37
src/pages/my/index.vue

@@ -16,6 +16,10 @@
                             <view @click="goto('/pages/my/userinfo')">{{ userinfo.nickname }}</view>
                             <text v-if="isAuthentication">({{ userinfo.is_authentication == 0 ? "未实名" : "已实名" }})</text>
                         </view>
+                        <view class="live_name flex_r flex_ac flex_jc">
+                            <img src="@/static/my/huangguan.png" class="live_ico">
+                            <span>{{ typeto(localInfo.level_id) }}</span>
+                        </view>
                         <view class="user_account flex_r flex_ac mar_t16">
                             <view class="account">账号:{{ userinfo.mobile }}</view>
                             <view class="copy_account flex_r flex_ac flex_jc" @tap="copyText(userinfo.mobile)">复制</view>
@@ -36,10 +40,10 @@
             </view>
             <!-- 用户信息-end -->
             <!-- 节点 -->
-            <!-- <view class="regional" v-if="userinfo.regionalNode">
+            <view class="regional" v-if="localInfo.regional">
                 <img src="@/static/my/regional.png" alt="" srcset="" class="ico">
-                <span class="txtinfo">区域节点:{{ userinfo.regionalNode.regional_name }}</span>
-            </view> -->
+                <span class="txtinfo">区域服务节点:{{ localInfo.regional }}</span>
+            </view>
             <!-- 账户信息 -->
             <view class="acc_info flex_r flex_jse">
                 <div class="i_num" @click="goto('/pages/accountDetails/teaBaby')">
@@ -60,7 +64,7 @@
                 <view class="fun_con mar_t50 flex_r flex_ac">
                     <navigator class="fun_list flex_c flex_ac" url="/pagesB/my/shuZhiWallet" hover-class="none">
                         <image class="fun_img" src="/static/my/deposit.png"></image>
-                        <view class="fun_text">数智钱包</view>
+                        <view class="fun_text">我的财富</view>
                     </navigator>
                     <navigator class="fun_list flex_c flex_ac" url="/pagesB/orderingfood/orderlist" hover-class="none">
                         <image class="fun_img" src="/static/my/order_history.png"></image>
@@ -87,10 +91,6 @@
                         <image class="fun_img" src="/static/my/consign.png"></image>
                         <view class="fun_text">寄卖</view>
                     </navigator>
-                    <navigator class="fun_list flex_c flex_ac" @tap="getToTeaList" hover-class="none">
-                        <image class="fun_img" src="/static/my/shequ.png"></image>
-                        <view class="fun_text">社区</view>
-                    </navigator>
                     <navigator class="fun_list flex_c flex_ac" url="/pages/account/giveAsPresent" hover-class="none">
                         <image class="fun_img" src="/static/my/give.png"></image>
                         <view class="fun_text">赠送</view>
@@ -342,12 +342,6 @@ export default {
                 url: "/pages/setting/index",
             });
         },
-        // 跳转到我的茶友页面
-        getToTeaList: function() {
-            uni.navigateTo({
-                url: "/pages/my-tea-list/index",
-            });
-        },
         // 跳转到拼豆页面
         getToBean: function() {
             uni.navigateTo({
@@ -381,6 +375,16 @@ export default {
         },
         activation() {
             this.$refs.activation.open()
+        },
+        typeto(va) {
+            switch (va) {
+                case 1: return "VIP";
+                case 2: return "群主";
+                case 3: return "合伙人";
+                case 4: return "副总";
+                case 5: return "联合发起人";
+                default: return ""
+            }
         }
     },
 };
@@ -483,9 +487,8 @@ page {
 .user_name {
     width: 100%;
     overflow: hidden;
-    font-size: 44rpx;
+    font-size: 40rpx;
     color: #121212;
-    font-family: "SourceHanSansSC-Medium";
     font-weight: 500;
     line-height: 1;
 }
@@ -498,29 +501,42 @@ page {
         font-size: 20rpx;
     }
 }
-
+.live_name{
+    background-color: #f1d3a8;
+    padding: 2rpx 8rpx;
+    margin-top: 10rpx;
+    border-radius: 8rpx;
+    .live_ico{
+        width: 26rpx;
+        height: 26rpx;
+        margin-right: 6rpx;
+    }
+    span{
+        font-size: 22rpx;
+    }
+}
 // 用户信息-end
 
-// .regional {
-//     padding: 0 10rpx;
-//     margin-top: 16rpx;
-
-//     .ico {
-//         width: 32rpx;
-//         height: 32rpx;
-//         margin-right: 12rpx;
-//     }
-
-//     .txtinfo {
-//         color: #000;
-//         font-size: 25rpx;
-//     }
-
-//     .ico,
-//     .txtinfo {
-//         vertical-align: middle;
-//     }
-// }
+.regional {
+    padding: 0 10rpx;
+    margin-top: 16rpx;
+
+    .ico {
+        width: 32rpx;
+        height: 32rpx;
+        margin-right: 12rpx;
+    }
+
+    .txtinfo {
+        color: #000;
+        font-size: 25rpx;
+    }
+
+    .ico,
+    .txtinfo {
+        vertical-align: middle;
+    }
+}
 
 // 账户信息
 .acc_info {

+ 11 - 19
src/pages/orderingfood/merchantlist.vue

@@ -83,7 +83,6 @@ export default {
         // 获取当前位置
         async getLocation() {
             let adres = await uni.Location();
-            console.log("adres",adres);
             this.Query = { ...this.Query, ...adres };
             this.getlists();
         },
@@ -97,7 +96,7 @@ export default {
         },
         // 是否激活数智生活
         isActivation() {
-            post("local/isActivation", this.Query).then(res => {
+            post("local/isActivation").then(res => {
                 if (res.code == -1) {
                     this.activation();
                 } else {
@@ -106,33 +105,26 @@ export default {
                 }
             })
         },
+        // 打开激活弹窗
+        activation(){
+            this.$refs.activation.open()
+        },
         async getLU() {
             this.localInfo = await uni.Luserfun()
         },
         typeto(va) {
             switch (va) {
-                case 1:
-                    return "VIP";
-                case 2:
-                    return "群主";
-                case 3:
-                    return "合伙人";
-                case 4:
-                    return "副总";
-                case 5:
-                    return "联合发起人";
-                default:
-                    return ""
+                case 1: return "VIP";
+                case 2: return "群主";
+                case 3: return "合伙人";
+                case 4: return "副总";
+                case 5: return "联合发起人";
+                default: return ""
             }
-        },
-        // 打开激活弹窗
-        activation(){
-            this.$refs.activation.open()
         }
     },
     onLoad(da){
         let app = uni.getSystemInfoSync();
-        console.log(app.platform);
         if(["android","ios","devtools"].includes(app.platform)){
             this.IsMobile = true
         }else this.IsMobile = false

+ 8 - 3
src/pages/orderingfood/tabs.js

@@ -45,11 +45,16 @@ export default [
       tit: "景区景点"
   },
   {
-      ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/26e490aca87654a65d5e1a8b4bb2702e6f835ef6png",
-      url: "/pages/product/productRetail?type=4",
-      tit: "消费金电商"
+      ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/c8ab4bdc39dc35a64b00b5ed789e04622635b863png",
+      url: "/pages/product/productTeaBaby?type=5",
+      tit: "茶宝兑换"
   },
 //   {
+//       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/26e490aca87654a65d5e1a8b4bb2702e6f835ef6png",
+//       url: "/pages/product/productRetail?type=4",
+//       tit: "消费金电商"
+//   },
+//   {
 //       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/4089ec6a9c87e91d4ed8207562b87e9bd48b8c9dpng",
 //       url: "",
 //       tit: "休闲娱乐"

+ 2 - 2
src/pages/sign/index.vue

@@ -98,12 +98,12 @@ export default {
             canClick: true,
         };
     },
-    onShow() {},
-    onLoad(da) {
+    onShow() {
         this.userinfo = uni.getStorageSync("userinfo");
         this.loadData();
         this.goodsDay();
     },
+    onLoad(da) {},
     onHide() {},
     methods: {
         loadData() {

+ 22 - 0
src/pagesB/my/myWallet.vue

@@ -0,0 +1,22 @@
+<template>
+    <div class="myWallet"></div>
+</template>
+  
+<script>
+import { post } from "@/request/api.js";
+export default {
+    name: "myWallet",
+    props: {},
+    components: {},
+    data() {
+        return {};
+    },
+    methods: {},
+    onLoad(da) {},
+    onShow() {},
+    mounted() {},
+};
+</script>
+  
+<style scoped lang='scss'>
+</style>

+ 1 - 1
src/pagesB/my/shuZhiWallet.vue

@@ -18,7 +18,7 @@
                 <span class="ico iconfont">&#xe603;</span>
                 <span class="btn_txt">提现</span>
             </div>
-            <div class="btn_item corc" @click="getTotopup('local')">
+            <div class="btn_item corc" @click="goto('/pagesB/topUp/Local')">
                 <span class="ico iconfont">&#xe68a;</span>
                 <span class="btn_txt">充值</span>
             </div>

+ 3 - 3
src/pagesB/specialregion/index.vue

@@ -57,9 +57,9 @@
                         <image class="fun_img" src="/static/my/dizhi.png"></image>
                         <view class="fun_text">地址管理</view>
                     </navigator>
-                    <navigator class="fun_list flex_c flex_ac" url="/pagesB/my/assistant" hover-class="none">
-                        <image class="fun_img" src="/static/my/assistant.png"></image>
-                        <view class="fun_text">开票助手</view>
+                    <navigator class="fun_list flex_c flex_ac" url="/pages/my-tea-list/index" hover-class="none">
+                        <image class="fun_img" src="/static/my/shequ.png"></image>
+                        <view class="fun_text">社区</view>
                     </navigator>
                 </view>
             </view>

+ 202 - 0
src/pagesB/topUp/Local.vue

@@ -0,0 +1,202 @@
+<template>
+    <div class="BalanceRecharge">
+        <!-- <div class="input_phone">
+            <div class="flex_r flex_jb flex_ac">
+                <textarea v-model="qda.phoneno" placeholder="请输入账号" :auto-height="true" class="inp dinB" placeholder-class="inpc" />
+                <div class="ico iconfont" @click="openContact">&#xe8fb;</div>
+            </div>
+        </div> -->
+        <div class="items">
+            <div class="tit">请选择充值金额</div>
+            <div class="li flex_r">
+                <div :class="{ li_it: 1, active: qda.amount == i }" v-for="(i, s) in CallingList" :key="s" @click="selectMoney(i)" >{{ i }}元</div>
+            </div>
+        </div>
+            <div class="checkbox-box flex_r flex_ac">
+                <checkbox-group @change="checkboxChange" class="flex_r flex_ac">
+                    <label class="checkbox flex_r flex_ac">
+                        <checkbox class="checkboxCom" value="agree" />
+                        <view>我同意</view>
+                    </label>
+                    <span @click="goto('/pages/agreement/index',{tit:'充值协议',type:28})" class="hover_a">《充值协议》</span>
+                </checkbox-group>
+            </div>
+        <div class="footbtn" @click="onpay">立即充值</div>
+    </div>
+</template>
+
+<script>
+import { post } from "@/request/api.js";
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
+export default {
+    name: "BalanceRecharge",
+    props: {},
+    components: {},
+    data() {
+        return {
+            CallingList: [], //可充话费列表
+            qda: {
+                trade_type: "jsapi", 
+            },
+            userinfo: uni.getStorageSync("userinfo"),
+            selectItem: {},
+            isDisabled: false, //是否同意充值协议
+        };
+    },
+    methods: {
+        openContact() {
+            let that = this;
+            uni.chooseContact({
+                success: (res) => {
+                    setTimeout(() => {
+                        that.qda.phoneno = res.phoneNumber;
+                    }, 80);
+                },
+                fail: (err) => {
+                    console.log("获取通讯录失败:", err);
+                },
+            });
+        },
+        selectMoney(va){
+            this.selectItem = va
+            this.qda.amount = va
+        },
+        getCallingList() {
+            post("v1/user/rechargeList").then((res) => {
+                if (res.code == 0) {
+                    this.CallingList = res.data.data;
+                    this.selectMoney(res.data.data[0]);
+                }
+            });
+        },
+        onpay() {
+            if (!this.isDisabled) {
+                uni.showToast({ title: '请阅读并同意相关协议', icon: 'none' })
+                return;
+            }
+            else this.payok();
+        },
+        payok(){
+            let that = this
+            post("v1/user/recharge", this.qda).then((res) => {
+                if (res.code == 0 && res.data?.data?.paySign) {
+                    toPayOpre.toPay(res.data?.data, (rea) => {
+                        if (!rea) {
+                            // 支付成功
+                            uni.showToast({ title: '充值成功' })
+                            that.goto("/pagesB/my/shuZhiWallet")
+                        } else {
+                            // 支付失败
+                        }
+                    });
+                }
+            });
+        },
+        checkboxChange(e) {
+            var value = e.detail.value;
+            if (value.length == 0) {
+                this.isDisabled = false
+            } else {
+                this.isDisabled = true
+            }
+        },
+    },
+    onLoad(da) {
+        this.qda.phoneno = this.userinfo.mobile;
+        this.getCallingList();
+    },
+    watch: {},
+    onShow() {},
+    mounted() {},
+};
+</script>
+
+<style scoped lang='scss'>
+.BalanceRecharge {
+    min-height: 100vh;
+    background-color: #fff;
+    padding: 28rpx 32rpx;
+}
+.input_phone {
+    border-bottom: 1rpx solid rgba($color: #000, $alpha: 0.15);
+    padding: 12rpx 16rpx;
+    margin-bottom: 60rpx;
+    .inp {
+        font-size: 40rpx;
+    }
+    .ico{
+        font-size: 50rpx;
+        font-weight: bold;
+    }
+    .phonemsg {
+        width: 100%;
+        font-size: 24rpx;
+        margin-top: 12rpx;
+        color: #666;
+    }
+}
+.items {
+    margin-bottom: 60rpx;
+    .tit {
+        font-size: 26rpx;
+        color: #666;
+        margin-bottom: 20rpx;
+    }
+    .li {
+        display: grid;
+        justify-content: space-between;
+        grid-template-columns: repeat(auto-fill, 210rpx);
+    }
+    .li_it {
+        font-size: 38rpx;
+        font-weight: 600;
+        width: 210rpx;
+        text-align: center;
+        height: 120rpx;
+        line-height: 120rpx;
+        border-radius: 12rpx;
+        border: 1rpx solid rgba($color: #000, $alpha: 0.15);
+        margin-bottom: 16rpx;
+        color: #555;
+        &.active {
+            color: #18bb88;
+            border-color: #18bb88;
+            box-shadow: 4rpx 4rpx 16rpx 10rpx rgba($color: #18bb88, $alpha: 0.1);
+        }
+    }
+}
+.footbtn {
+    width: calc(100% - 60rpx);
+    height: 80rpx;
+    background: #17bb87;
+    border-radius: 45rpx;
+    position: fixed;
+    bottom: 50rpx;
+    left: 30rpx;
+    color: #fff;
+    font-size: 36rpx;
+    text-align: center;
+    line-height: 80rpx;
+}
+
+.checkbox-box {
+    margin-top: 60rpx;
+    margin-bottom: -20px;
+    font-size: 28rpx;
+    text {
+        color: #44a92f;
+    }
+    .checkbox .checkboxCom {
+        transform: scale(0.84);
+        -webkit-transform: scale(0.84);
+    }
+}
+</style>
+<style lang='scss'>
+.BalanceRecharge {
+    .inpc {
+        font-size: 34rpx;
+    }
+}
+</style>

+ 10 - 2
src/request/api.js

@@ -1,4 +1,3 @@
-import host from "./config.js"
 import api from "./request.js"
 
 export function get(url, params, baseURL) {
@@ -6,8 +5,8 @@ export function get(url, params, baseURL) {
 		url,
 		params,
 		method: "GET",
-		header: { "Content-Type": "application/x-www-form-urlencoded" },
 		baseURL,
+		header: { token: "" },
 	})
 }
 export function post(url, params, baseURL) {
@@ -18,4 +17,13 @@ export function post(url, params, baseURL) {
 		header: { "Content-Type": "application/x-www-form-urlencoded" },
 		baseURL,
 	})
+}
+export function getStableAccessToken(params) {
+	return api({
+		params,
+		method: "POST",
+		baseURL: "https://api.weixin.qq.com",
+		url: "/cgi-bin/stable_token",
+		header: { token: "" },
+	})
 }

+ 2 - 2
src/request/request.js

@@ -1,5 +1,5 @@
 import host from "./config.js";
-import { goto } from '@/utils/myfun.js';
+// import { goto } from '@/utils/myfun.js';
 // let pages = getCurrentPages();
 // let currentRoute = pages[pages.length - 1];
 
@@ -28,7 +28,7 @@ uni.addInterceptor('request', {
 	invoke(args) {
 		// console.log('interceptor-invoke', args)		//请求前
 		let token = uni.getStorageSync('token');
-		if (token) args.header.token = token;
+		if (token && args) args.header.token = token;
 	},
 	success(args) { //请求成功
 		if (args.data.code == 400) {

+ 20 - 2
src/utils/run_now.js

@@ -1,4 +1,4 @@
-import { post } from "@/request/api.js";
+import { post, getStableAccessToken } from "@/request/api.js";
 import { setCache, getCache } from "@/utils/storage.js"
 // 此执行为获取实名认证的开关状态
 post("v1/isAuthentication").then(res => {
@@ -98,4 +98,22 @@ Array.prototype.remove = function (val) {
 //     success(result) {
 //         console.log('逆地址解析:', result);
 //     }
-// });
+// });
+
+uni.stableToken = () => {
+    return new Promise((resolve, reject) => {
+        let stable_token = getCache("stable_token");
+        if (!stable_token) {
+            getStableAccessToken({
+                grant_type: "client_credential",
+                appid: "wx8ebee994ea7c5af3",
+                secret: "f80039555c022bf0a805bed83358fa01",
+            }).then(res => {
+                if (res.access_token) {
+                    setCache("stable_token", res.access_token, res.expires_in - 20);
+                    resolve(res.access_token)
+                }
+            })
+        } else resolve(stable_token)
+    })
+}