Преглед на файлове

优化标题显示, 优化支付问题

zhengkaixin преди 6 месеца
родител
ревизия
2db299736c
променени са 5 файла, в които са добавени 47 реда и са изтрити 4 реда
  1. 14 2
      apis/utils/init.js
  2. 10 0
      apis/weixin.js
  3. 9 1
      main.js
  4. 1 1
      pages.json
  5. 13 0
      pages/recharge/accountRecharge.vue

+ 14 - 2
apis/utils/init.js

@@ -109,7 +109,7 @@ var app = {
 		 })
 	 },
 	 
-	getOpenId() {
+	getOpenId(bl,uid) {
 		if (process.env.NODE_ENV === "development"){
 			carhelp.setOpenId(process.car.openId)
 			location.reload();
@@ -130,8 +130,20 @@ var app = {
 					carhelp.setOpenId(response.data.openid)
 					openId = response.data.openid;
 					carhelp.set("xpgj_wx_user_info",response.data)
+					if(bl&&uid){
+						API_WeiXin.saveWechatInfo({
+							openId:openId,
+							 unionId:uid
+						}).then(response => {
+							
+							 location.reload();
+						}).catch(error => {
+							console.log(error);
+						});
+					}else{
+						 location.reload();
+					}
 					
-					 location.reload();
 				}).catch(error => {
 					console.log(error);
 				});

+ 10 - 0
apis/weixin.js

@@ -38,6 +38,16 @@ export function getDataByCode(code) {
 	})
 }
 
+export function saveWechatInfo(data) {
+	return request({
+		url: '/mobile/tenantUser/saveWechatInfo' ,
+		data:data,
+		method: 'post',
+	})
+}
+
+
+
 export function findByUnionId(code,otherUserId) {
 	return requestWhite({
 		url: '/mobile/tenantUser/findByUnionId?otherUserId='+otherUserId+'&unionId=' + code,

+ 9 - 1
main.js

@@ -44,7 +44,15 @@ Vue.mixin({
 			  ProjectName+='('+process.car.NODE_ENV+')';				 
 		}
 		if(option.otherUserId){
-			ProjectName="壹家物管-"+ProjectName
+			var currentDomain = window.location.hostname;
+			
+			// 判断域名并显示不同的内容
+			if (currentDomain === 'yjwg.hbjp.com.cn') {
+			   ProjectName="壹家物管服务大厅"
+			}else{
+				
+			}
+			
 			console.log(ProjectName)
 		}
 		uni.setNavigationBarTitle({

+ 1 - 1
pages.json

@@ -406,7 +406,7 @@
 
 	"globalStyle": {
 		"navigationStyle": "custom", // 隐藏系统导航栏
-		"navigationBarTitleText": "e家能源",
+		"navigationBarTitleText": "加载中...",
 		"enablePullDownRefresh": false
 	},
 	"uniIdRouter": {}

+ 13 - 0
pages/recharge/accountRecharge.vue

@@ -292,6 +292,8 @@
 </template>
 
 <script>
+	import getOpenId from '@/apis/utils/init.js'
+	
 	import * as API from '@/apis/pagejs/wxPay.js'
 	import * as API_index from '@/apis/pagejs/index.js'
 
@@ -335,6 +337,17 @@
 		onLoad() {
 			
 			//this.submitForm.companyId=this.carhelp.getPersonInfoPlus().companyInfo.id
+			var openId=this.carhelp.getOpenId()
+			//当前页面必须要OpenId
+			if(openId){
+				
+			}else{
+				getOpenId.getOpenId(true, this.carhelp.getUID())
+			}
+		},
+		onReady() {
+			this.homePage()
+			this.availableDuration()
 		},
 		onShow(){
 			this.homePage()