张文飞 3 éve
szülő
commit
2f9e75ecfc

+ 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>

+ 28 - 0
pages/homePage/homePage.vue

@@ -266,6 +266,7 @@
 				typeName:"类型",
 				optionType:1,
 				registAmount:null,
+				shareToken:"",
 			}
 		},
 		mounted() {
@@ -279,6 +280,9 @@
 			let projectId = this.getQueryString('projectId');
 			this.toPage(projectId);
 		},
+		onLoad() {
+			this.getSingle();
+		},
 		onPullDownRefresh() {
 			this.getData();
 		},
@@ -476,6 +480,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: {

+ 2 - 50
pages/houseDetail/houseDetail.vue

@@ -160,55 +160,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 = {
@@ -227,7 +179,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)
 					}
 				}
 			},

+ 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();
 				}
 			},

+ 70 - 0
static/mixin.js

@@ -0,0 +1,70 @@
+const wx = require('weixin-js-sdk');
+const config = require('@/static/config.js');
+export default {
+	install(Vue){
+		Vue.mixin({
+			data(){
+				return {
+					
+				}
+			},
+			onLoad() {
+				this.signJsapiTicket();
+			},
+			methods:{
+				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: true, // 开启调试模式,调用的所有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可以在这里更新签名。
+					   });
+					}
+				},
+				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