Pārlūkot izejas kodu

7.28上午上传

李万涛 1 gadu atpakaļ
vecāks
revīzija
04587fa6c7

+ 5 - 3
common/index.js

xqd
@@ -48,13 +48,15 @@ export async function init(options) {
 	options.scene !== 1154 && wechat.checkMiniProgramUpdate();
 	// #endif
 	await store.dispatch("appInit", options); // 加载基本信息
-	await store.dispatch("getTemplate", options);//获取模板消息
+
+	//获取模板消息
+	await store.dispatch("getTemplate", options);
 	// #ifdef MP-WEIXIN
 	await store.dispatch('getMessageIds'); //订阅消息
 	// #endif
-	
+
 }
 
 export default {
 	install
-}
+}

+ 13 - 32
common/store/modules/init.js

xqd xqd xqd xqd xqd
@@ -4,11 +4,13 @@ import ws from "@/store/ws.js";
 
 const state = {
 	appInfo: {},
-	wechat: {autologin:true}, // 微信配置
+	wechat: {
+		autologin: true
+	}, // 微信配置
 	share: {}, // 分享配置
 	payment: {}, // 支付配置
 	recharge: uni.getStorageSync("recharge") || {}, //充值配置
-	shareInfo: {} ,// 默认分享数据
+	shareInfo: {}, // 默认分享数据
 	homeTemplate: [], // 首页模板数据
 }
 
@@ -26,50 +28,26 @@ const actions = {
 		commit,
 		dispatch
 	}, options) {
+		// 暂时中断获取系统配置
+		return
 		var params = 'system.config';
 		const result = await http('conf.getGroupConf', {
 			group: params
 		}).then(res => {
-			// uni.hideTabBar()
 			if (res.code === 0) {
-				// uni.setNavigationBarTitle({
-				// 	title: res.data.site_name
-				// });
 				commit('appInfo', res.data);
 				uni.setStorageSync('appInfo', res.data);
 				if (!options?.query?.token) {
 					dispatch('autoLogin');
 				}
-				// ws.init();
 				// #ifdef MP-WEIXIN
-				if(res.data.examine_mode == 1){
+				if (res.data.examine_mode == 1) {
 					uni.reLaunch({
-						url:'/pages/wx/wx'
+						url: '/pages/wx/wx'
 					});
 					return false;
 				}
 				// #endif
-				// if(res.data.bottom_menu_status == 1){
-				// 	dispatch('getbottom_menu',res.data)
-				// }else{
-				// 	uni.setTabBarItem({
-				// 	  index: 0,
-				// 	  text: '找好活',
-				// 	})
-				// 	uni.setTabBarItem({
-				// 	  index: 1,
-				// 	  text: '找师傅',
-				// 	})
-				// 	uni.setTabBarItem({
-				// 	  index: 2,
-				// 	  text: '消息',
-				// 	})
-				// 	uni.setTabBarItem({
-				// 	  index: 3,
-				// 	  text: '我的',
-				// 	})
-				// 	// uni.showTabBar({animation:true})
-				// }
 				return res.data;
 			}
 			return false;
@@ -79,6 +57,9 @@ const actions = {
 	async getTemplate({
 		commit
 	}, options) {
+
+		// 暂时中断获取模板
+		return
 		const result = await http('common.template');
 		if (result.code === 0) {
 			commit('TEMPLATE', result.data);
@@ -88,7 +69,7 @@ const actions = {
 			return false;
 		}
 	},
-	
+
 }
 
 const mutations = {
@@ -109,4 +90,4 @@ export default {
 	mutations,
 	actions,
 	getters
-}
+}

+ 11 - 9
common/store/modules/user.js

xqd xqd xqd xqd xqd xqd xqd
@@ -11,8 +11,8 @@ const state = {
 	userInfo: uni.getStorageSync("userInfo") || {}, // 用户信息
 	userData: {}, //用户其他相关数据
 	subscribeMessageIdsMap: [], //小程序订阅消息模板ids
-	authType: '' ,// smsLogin:手机号登录注册, accountLogin:密码登录, forgotPwd:忘记密码, changePwd:修改密码, bindMobile:绑定手机号
-	tabbarList:[]
+	authType: '', // smsLogin:手机号登录注册, accountLogin:密码登录, forgotPwd:忘记密码, changePwd:修改密码, bindMobile:绑定手机号
+	tabbarList: []
 }
 
 const getters = {
@@ -36,8 +36,8 @@ const actions = {
 		return new Promise((resolve, reject) => {
 			console.log(token);
 			token && uni.setStorageSync('token', token);
-			http('user.info').then(res => {		
-				// console.log(res);
+			http('user.info').then(res => {
+					// console.log(res);
 					if (res.code === 0) {
 						let lastLoginStatus = getters.isLogin;
 						commit('userInfo', res.data);
@@ -52,7 +52,7 @@ const actions = {
 							uni.removeStorageSync('spm');
 						}
 						resolve(res.data)
-					} 
+					}
 				}).then(() => {
 					// uni.showModal({
 					// 	title:'提示',
@@ -78,7 +78,7 @@ const actions = {
 		commit
 	}) {
 		return new Promise((resolve, reject) => {
-			http('user.userData').then(res => {				
+			http('user.userData').then(res => {
 				commit('USER_DATA', res.data);
 				resolve(res)
 			}).catch(e => {
@@ -134,7 +134,9 @@ const actions = {
 		commit,
 		state
 	}) {
-		http('conf.getGroupConf',{group:'system.notification'}).then(res => {
+		http('conf.getGroupConf', {
+			group: 'system.notification'
+		}).then(res => {
 			commit('formatMessage', res.data)
 			Promise.resolve(res.data)
 		}).catch(e => {
@@ -190,7 +192,7 @@ const mutations = {
 	formatMessage(state, messageIdsObj) {
 		// 各场景下用到的订阅模板
 		let typeMap = {
-			'unread_msg': ['pay_suc','examine_result','company_examine'],
+			'unread_msg': ['pay_suc', 'examine_result', 'company_examine'],
 			// 'order':['pay_suc','recommend','new_video']
 		}
 		let idsMap = {}
@@ -211,4 +213,4 @@ export default {
 	mutations,
 	actions,
 	getters
-}
+}

+ 1 - 11
pages/user/user.vue

xqd
@@ -1,20 +1,10 @@
 <template>
 	<view>
-		<view class="user" v-if="appInfo.page_template == 2 || appInfo.page_template == 1">
+		<view class="user">
 
 			<!-- 头部 -->
 			<view class="user-wrap" style="">
 				<view class="setting iconfont icon31shezhi"></view>
-				<!-- 	<view v-if="isLogin" class="info">
-					<image @click="modify" class="avatar" mode="aspectFill"
-						:src="userInfo.avatar ? userInfo.avatar : '/static/images/head.jpg'"></image>
-					<view class="nickname">
-						<text
-							@click="copyText(userInfo.id_number)">{{ userInfo.nickname ? userInfo.nickname : '默认用户'}}</text>
-						<u-icon name="edit-pen" color="#18b566" size="20" @click="modify"></u-icon>
-					</view>
-				</view> -->
-				<!-- <view class="info" @click="getlogin"> -->
 				<view class="info" @click="getlogin" v-if="!hasLogin">
 					<image class="avatar" mode="aspectFill" src="/static/images/head.jpg"></image>
 					<view class="nickname">点击立即登录/注册</view>

+ 1 - 1
utils/request/responseInterceptors.js

xqd
@@ -40,7 +40,7 @@ module.exports = (vm) => {
 					url: '/pages/user/signin'
 				})
 			}, 1500)
-		} else if (statusCode == 500) {
+		} else if (statusCode >= 500) {
 			uni.$u.toast('接口报错')
 		}
 		return Promise.reject(response)