ソースを参照

Merge branch 'feature_业主工会' of http://192.168.4.246:3000/elab-damai-h5/h5-elab-open-ownerUnion into feature_业主工会

王晓晨 3 年 前
コミット
b40302e34b

+ 32 - 0
App.vue

@@ -1,5 +1,6 @@
 <script>
 	const config = require('./static/config.js');
+	
 	export default {
 		onLaunch: function() {
 			let href = location.href;
@@ -23,6 +24,7 @@
 			this.globalData.projectId = projectId||'';
 			this.globalData.shareToken = shareToken||'';
 			this.regist();
+			this.signJsapiTicket();
 		},
 		onShow: function() {
 			document.body.style.setProperty("background-color",this.globalData.color4);
@@ -66,6 +68,36 @@
 					}
 				}
 			},
+			async signJsapiTicket(){
+				const wx = require('weixin-js-sdk');
+				let url =  location.href.split('#')[0]
+				let parmas = {
+					url: url,
+				}
+				let self = this;
+				let res = await this.$myRequest({
+					url: '/wechat/signJsapiTicket',
+					data: parmas,
+					method:"GET",
+				});
+				if(res.data.success){
+				   let single =	res.data.single;
+				   wx.config({
+				   	debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+				   	appId: config.appid, // 必填,公众号的唯一标识
+				   	timestamp: single.timestamp, // 必填,生成签名的时间戳
+				   	nonceStr: single.nonceStr, // 必填,生成签名的随机串
+				   	signature: single.signature, // 必填,签名
+				       jsApiList: ["updateAppMessageShareData","updateTimelineShareData",'showMenuItems'] // 必填,需要使用的JS接口列表
+				   });
+				   wx.ready(function() {
+				   	
+				   });
+				   wx.error(function(res) {
+				   	// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+				   });
+				}
+			},
 		},
 		globalData: {
 			token: "",

+ 1 - 1
components/subComponents/dmLoginNotice.vue

@@ -1,7 +1,7 @@
 <template>
 	<dmDialog ref='popView' :isShowTitle="true" title="登录提醒" :isShowClose="true" :isShowConfirm="false" >
 		<view class="content">
-			<text class="desc">您还未进行登录,无法使用该功能\n点击登录后可以完整查看及使用</text>
+			<text class="desc">您还未进行登录,点此登录\n查看及使用完整功能</text>
 			<view class="confirm" @click="toLogin">
 				去登录
 			</view>

+ 5 - 7
main.js

@@ -5,21 +5,19 @@ Vue.config.productionTip = false
 import MinCache from './static/cache.js'
 import dmLoginNotice from './components/subComponents/dmLoginNotice.vue'
 import dmLogin from './components/subComponents/dmLogin.vue'
-//引入vuex
-import store from './store'
-//把vuex定义成全局组件
-Vue.prototype.$store = store
 
+Vue.prototype.$myRequest = myRequest
+import mixin from 'static/mixin.js'
+Vue.use(mixin);
 Vue.use(MinCache,{timeout:1800}) //缓存时间30分钟
 
 Vue.component('login-notice',dmLoginNotice)
 Vue.component('login',dmLogin)
 
 App.mpType = 'app'
-Vue.prototype.$myRequest = myRequest
+
 
 const app = new Vue({
-    ...App,
-	store 
+    ...App
 })
 app.$mount()

+ 7 - 0
pages/certificationResultPage/certificationResultPage.vue

@@ -15,6 +15,13 @@
 			</view>
 			<image class="renzheng_img" src="../../static/icons/icon_renzheng_pass.png" mode=""></image>
 		</view>
+		<view class="renzheng" v-if="approvalStatus==2">
+			<text class="renzheng_title">审核被拒绝!</text>
+			<view class="btn_back" @click="toHome">
+				任务大厅
+			</view>
+			<image class="renzheng_img" src="../../static/icons/icon_renzhenging.png" mode=""></image>
+		</view>
 		<login-notice></login-notice>
 		<login></login>
 	</view>

+ 35 - 1
pages/homePage/homePage.vue

@@ -266,9 +266,12 @@
 				typeName:"类型",
 				optionType:1,
 				registAmount:null,
+				shareToken:"",
+				isFirst:true,
 			}
 		},
 		mounted() {
+			this.isFirst = true;
 			this.color4 = app.globalData.color4;
 			this.getData();
 			uni.$on("request",()=>{
@@ -279,6 +282,13 @@
 			let projectId = this.getQueryString('projectId');
 			this.toPage(projectId);
 		},
+		onShow() {
+			if(!this.isFirst){
+				this.getSingle();
+			}else{
+				this.isFirst = false
+			}
+		},
 		onPullDownRefresh() {
 			this.getData();
 		},
@@ -309,7 +319,7 @@
 				this.pageNo = 1;
 				this.getUserInfo();
 				this.getHomePage();
-				this.getRegistTask();  
+				this.getRegistTask(); 
 			},
 			chooiceType(e){
 				this.city = e.city==''?"城市":(e.city).split('市')[0];
@@ -476,6 +486,30 @@
 				this.$refs.chooseType.setOptionType(option);
 				this.$forceUpdate();
 				this.$refs.chooseType.show()
+			},
+			async getSingle(){
+				let params = {
+					"projectId": "",
+					"userId": getApp().globalData.userId
+				}
+				let res = await this.$myRequest({
+					url: '/share_token/generate',
+					data: params
+				});
+				if(res.data.success){
+					this.shareToken = res.data.single;
+					this.queryProtocolConfigView();
+				}
+			},
+			async queryProtocolConfigView(){
+				let res = await this.$myRequest({
+					url: "/project/queryProtocolConfigView",
+					data: {},
+				});
+				if(res.data.success){
+					let single = res.data.single;
+					this.config(single.shareName,single.shareRemark,location.origin+location.pathname +"?shareToken="+this.shareToken,single.shareLogoImage)
+				}
 			}
 		},
 		components: {

+ 4 - 53
pages/houseDetail/houseDetail.vue

@@ -133,7 +133,7 @@
 			this.projectId = param.projectId;
 		},
 		onShow() {
-			
+			this.detailDatahandle();
 		},
 		components: {
 			backHome
@@ -143,7 +143,6 @@
 			this.color2 = app.globalData.color2;
 			this.color3 = app.globalData.color3;
 			this.color6 = app.globalData.color6;
-			this.detailDatahandle()
 			uni.$on("request", () => {
 				this.detailDatahandle()
 			})
@@ -162,55 +161,7 @@
 					this.shareToken = res.data.single;
 				}
 			},
-			async signJsapiTicket(){
-				let url =  location.href.split('#')[0]
-				let parmas = {
-					url: url,
-				}
-				let self = this;
-				let res = await this.$myRequest({
-					url: '/wechat/signJsapiTicket',
-					data: parmas,
-					method:"GET",
-				});
-				if(res.data.success){
-				   let single =	res.data.single;
-				   wx.config({
-				   	debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-				   	appId: config.appid, // 必填,公众号的唯一标识
-				   	timestamp: single.timestamp, // 必填,生成签名的时间戳
-				   	nonceStr: single.nonceStr, // 必填,生成签名的随机串
-				   	signature: single.signature, // 必填,签名
-				       jsApiList: ["updateAppMessageShareData","updateTimelineShareData",'showMenuItems'] // 必填,需要使用的JS接口列表
-				   });
-				   wx.ready(function() {
-				   	// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
-				   	wx.updateAppMessageShareData({ //分享给朋友
-				   		title: self.dataInfo.name, // 分享标题
-				   		desc: self.dataInfo.shareRemark, // 分享描述
-				   		link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+self.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
-				   		imgUrl: self.dataInfo.shareImg, // 分享图标
-				   		success: function() {
-				   			// 设置成功
-				   		}
-				   	});
-				   	wx.updateTimelineShareData({ //分享到朋友圈
-				   		title: self.dataInfo.name, // 分享标题
-				   		link: location.origin+location.pathname + "?projectId="+self.projectId+"&shareToken="+self.shareToken, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
-				   		imgUrl: self.dataInfo.shareImg, // 分享图标
-				   		success: function() {
-				   			// 设置成功
-				   		}
-				   	});
-					wx.showMenuItems({
-						menuList: [ "menuItem:share:appMessage","menuItem:share:timeline"] // 要显示的菜单项,所有menu项见附录3
-					});
-				   });
-				   wx.error(function(res) {
-				   	// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-				   });
-				}
-			},
+			
 			async detailDatahandle() {
 				if (getApp().globalData.userId) {
 					var parmas = {
@@ -229,7 +180,7 @@
 						this.dataInfo = res.data.single
 						this.reloadCategoryList()
 						this.reloadInfos();
-						this.signJsapiTicket();
+						this.config(this.dataInfo.name,this.dataInfo.shareRemark,location.origin+location.pathname + "?projectId="+this.projectId+"&shareToken="+this.shareToken,this.dataInfo.shareImg)
 					}
 				}
 			},
@@ -315,7 +266,7 @@
 			},
 
 			toShareCard(type) {
-				if (getApp().globalData.userId) {
+				if (getApp().globalData.token) {
 					let href = location.origin + location.pathname;
 					uni.navigateTo({
 						url: '../shareCardPage/shareCardPage?page=' + href + "&projectId=" + this.projectId +

+ 0 - 1
pages/ownerCertification/ownerCertification.vue

@@ -225,7 +225,6 @@
 					},
 					method:"GET"
 				})
-				this.houseList = [];
 				if (ret.data.success) {
 					this.countdown();
 				}

+ 9 - 3
pages/revenueRankingPage/revenueRankingPage.vue

@@ -86,14 +86,20 @@
 			this.color2 = app.globalData.color2;
 			this.incomeRankTop10Amounts();
 		},
+		onPullDownRefresh() {
+			this.incomeRank();
+		},
 		methods:{
 			tab(index){
 				this.currentTab = index;
-				if(index==1){
+				this.incomeRank();
+			},
+			incomeRank(){
+				if(this.currentTab==1){
 					this.incomeRankTop10Amounts();
-				}else if(index==2){
+				}else if(this.currentTab==2){
 					this.incomeRankTop10ThisMonth();
-				}else if(index==3){
+				}else if(this.currentTab==3){
 					this.incomeRankTop10Today();
 				}
 			},

+ 41 - 0
static/mixin.js

@@ -0,0 +1,41 @@
+const wx = require('weixin-js-sdk');
+const config = require('@/static/config.js');
+export default {
+	install(Vue){
+		Vue.mixin({
+			data(){
+				return {
+					
+				}
+			},
+			onLoad() {
+			
+			},
+			methods:{
+				config(title,desc,link,imgUrl){
+					wx.showMenuItems({
+						menuList: [ "menuItem:share:appMessage","menuItem:share:timeline"] // 要显示的菜单项,所有menu项见附录3
+					});
+					wx.updateAppMessageShareData({ //分享给朋友
+						title: title, // 分享标题
+						desc: desc, // 分享描述
+						link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+						imgUrl: imgUrl, // 分享图标
+						success: function() {
+							// 设置成功
+						}
+					});
+					wx.updateTimelineShareData({ //分享到朋友圈
+						title: title, // 分享标题
+						link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+						imgUrl: imgUrl, // 分享图标
+						success: function() {
+							// 设置成功
+						}
+					});
+					
+				}
+			}
+		})
+	}
+}

+ 0 - 29
store/index.js

@@ -1,29 +0,0 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-Vue.use(Vuex)
-const store = new Vuex.Store({
-	mutations: {
-		login(provider) { //改变登录状态
-			uni.setStorage({ //将用户信息保存在本地  
-				key: 'userInfo',
-				data: provider
-			})
-		},
-		logoutApp() { //退出登录 
-			uni.removeStorage({
-				key: 'userInfo',
-			})
-			getApp().globalData.token = "";
-			// uni.removeStorageSync('selectedData');
-			// uni.removeStorageSync('selecedProject');
-			// uni.reLaunch({
-			// 	url: "../loginPage/index"
-			// })
-			// #ifdef APP-PLUS
-			var ekanfang = uni.requireNativePlugin("Ekanfang")
-			ekanfang.logout();
-			// #endif
-		}
-	}
-})
-export default store