提交 0de0f498d7a26d75ba386ae77a928ce71f86cf2a

作者 juvenile
1 个父辈 50bb0442

fixbug

... ... @@ -29,12 +29,16 @@ export default {
29 29 },
30 30
31 31 onLaunch(e) {
  32 + if(e.path&&e.path=='pages/student/home/job-detail/job-detail'&&e.query&&e.query.id){
  33 + this.$u.vuex("vuex_alipay",true)
  34 + }
32 35 let colorObj = this.themeList[this.vuex_appId].value;
33 36 let styles = "";
34 37 for (let i in colorObj) {
35 38 styles += colorObj[i].name + ":" + colorObj[i].value + ";";
36 39 }
37 40
  41 +
38 42 this.$u.vuex("vuex_theme", styles);
39 43 this.$u.vuex("vuex_baseImgUrl", this.themeList[this.vuex_appId].imagePath);
40 44 // console.log('vuex_theme----', this.vuex_theme)
... ...
... ... @@ -53,14 +53,14 @@ let detailByStudentUrl = '/internship/v1/questionnaire/detailByStudent/';
53 53 let graduationStatisticsRosterUrl = '/internship/v1/graduationStatisticsRoster/save';
54 54 let questionnaireTemplateUrl = '/internship/v1/graduationStatisticsRoster/graduationSurvey/';
55 55 let myUserStaticsUrl = '/hro/recruit/v1/yxly/user/counts';
56   -let positionCollectUrl = '/hro/recruit/v1/user/collects/:id/op/delete';
  56 +let positionCollectUrl = '/hro/recruit/v1/yxly/user/collects';
57 57 let positionRecordUrl = '/hro/recruit/v1/yxly/user/delivery-records';
58 58 let resumeUpdateUrl = '/hro/recruit/v1/yxly/user/resumes/update';
59 59 let resumeDetailUrl = '/hro/recruit/v1/yxly/user/resumes/detail';
60 60 let isJobCollectedUrl = '/hro/recruit/v1/yxly/user/collects/check/'
61 61 let jobRecommendUrl = '/hro/recruit/v1/yxly/user/positions/recommend';
62 62 let jobReccommendListUrl = '/hro/recruit/v1/yxly/user/candidates/recommends';
63   -let applyJobUrl = '/hro/recruit/v1/yxly/user/delivery';
  63 +let applyJobUrl = '/hro/recruit/v1/yxly/zfb/user-delivery';
64 64 let getAuthUrl = '/user/v1/getAuthUrl';
65 65 let isJobAppliedUrl = '/hro/recruit/v1/yxly/user/delivery/check/';
66 66 let signstartUrl = '/internship/v1/treaty/sign/start';
... ... @@ -1244,6 +1244,7 @@ const install = (Vue, vm) => {
1244 1244 //C端 投递职位
1245 1245 let applyJobUrlApi = (params = {}) => vm.$u.post(applyJobUrl, params).then(res => {
1246 1246 if (res.code >= 300) {
  1247 + return res
1247 1248 uni.$u.toast(res.message);
1248 1249 } else {
1249 1250 return res
... ... @@ -1322,7 +1323,7 @@ const install = (Vue, vm) => {
1322 1323 });
1323 1324
1324 1325 //C端 取消收藏
1325   - let cancelJobCollectUrlApi = (params = {}) => vm.$u.put(`/hro/recruit/v1/user/collects/${params.id}/op/delete`, params).then(res => {
  1326 + let cancelJobCollectUrlApi = (params = {}) => vm.$u.put(`/hro/recruit/v1/yxly/user/collects/${params.id}/op/delete`, params).then(res => {
1326 1327 if (res.code >= 300) {
1327 1328 uni.$u.toast(res.message);
1328 1329 } else {
... ... @@ -1995,9 +1996,23 @@ const install = (Vue, vm) => {
1995 1996 }
1996 1997 });
1997 1998
  1999 + const getJobUserAuth = (params) => vm.$u.post(`/hro/recruit/v1/yxly/zfb/resume-agreement-sign`,params).then(res=>{
  2000 + if (res.code >= 300) {
  2001 + uni.showToast({
  2002 + title: res.msg,
  2003 + icon: 'none',
  2004 + duration: 1500
  2005 + });
  2006 + } else {
  2007 + return res
  2008 + }
  2009 + })
  2010 +
  2011 +
1998 2012
1999 2013 // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
2000 2014 vm.$u.api = {
  2015 + getJobUserAuth,
2001 2016 getLoginApi,
2002 2017 settingGetApi,
2003 2018 getSmsCodeApi,
... ...
... ... @@ -101,9 +101,7 @@
101 101 }
102 102 },
103 103 "quickapp" : {},
104   - "mp-weixin" : {
105   -
106   - },
  104 + "mp-weixin" : {},
107 105 "mp-alipay" : {
108 106 "usingComponents" : true,
109 107 "component2" : true,
... ... @@ -111,7 +109,7 @@
111 109 "uniStatistics" : {
112 110 "enable" : true
113 111 },
114   - "allowsBounceVertical": "NO"
  112 + "allowsBounceVertical" : "NO"
115 113 },
116 114 "mp-qq" : {
117 115 "optimization" : {
... ... @@ -152,5 +150,8 @@
152 150 }
153 151 }
154 152 }
  153 + },
  154 + "uniStatistics" : {
  155 + "version" : "2"
155 156 }
156 157 }
... ...
1 1 <template>
2 2 <view class="page" :style="vuex_theme">
3 3 <scroll-view
4   - style="position: absolute; left: 0; top: 0; width:33%; height: calc(100% - 200rpx); border-right: 1px solid rgba(0,0,0,0.05);"
5   - scroll-y="true">
  4 + style=" width:33%; height: calc(100vh - 200rpx); border-right: 1px solid rgba(0,0,0,0.05);"
  5 + :scroll-y="true">
6 6 <view class="list-title" v-for="(item,index) in firstCategorys" :key="index"
7 7 @click="firstCategorySel(item,index)">
8 8 <view :class="firstCategoryName == item.name?'item itemSel':'item'">
... ... @@ -11,8 +11,8 @@
11 11 </view>
12 12 </scroll-view>
13 13 <scroll-view
14   - style="position: absolute; left: 33%; top: 0; width:33%; height: calc(100% - 200rpx); border-right: 1px solid rgba(0,0,0,0.05);"
15   - scroll-y="true">
  14 + style=" width:34%; height: calc(100vh - 200rpx); border-right: 1px solid rgba(0,0,0,0.05);"
  15 + :scroll-y="true">
16 16 <view v-if="isAll=='1'" class="list-title" @click="secondCategorySel({name:'全部',sub_categories:[]},-1)">
17 17 <view :class="secondCategoryName == '全部'?'item itemSel':'item'">
18 18 全部
... ... @@ -25,8 +25,8 @@
25 25 </view>
26 26 </view>
27 27 </scroll-view>
28   - <scroll-view style="position: absolute; left: 66%; top: 0; width:33%; height: calc(100% - 200rpx);"
29   - scroll-y="true">
  28 + <scroll-view style=" width:32%; height: calc(100vh - 200rpx);"
  29 + :scroll-y="true">
30 30 <view v-if="isAll=='1'" class="list-title" @click="expectjobSel({name:'全部',sub_categories:[]},-1)">
31 31 <view :class="expectJobName == '全部'?'item itemSel':'item'">
32 32 全部
... ... @@ -121,10 +121,9 @@
121 121 loadData() {
122 122 this.$u.api.poscategorylistApi().then(res => {
123 123 if (res) {
124   - this.firstCategorys = res
125 124 if (this.firstCategoryName == '') {
126   - this.firstCategoryName = this.firstCategorys[0].name
127   - this.secondCategorys = this.firstCategorys[0].sub_categories
  125 + this.firstCategoryName =res[0].name
  126 + this.secondCategorys = res[0].sub_categories
128 127 // this.secondCategoryName = this.secondCategorys[0].name
129 128 // this.secondCategoryName = '全部'
130 129 // this.expectJobs = this.secondCategorys[0].sub_categories
... ... @@ -150,6 +149,7 @@
150 149 }
151 150 }
152 151 }
  152 + this.firstCategorys = res
153 153 }
154 154 })
155 155 },
... ... @@ -210,6 +210,7 @@
210 210 position: relative;
211 211 width: 100%;
212 212 height: 100%;
  213 + display: flex;
213 214
214 215 .list-title {
215 216 margin-top: 72rpx;
... ...
... ... @@ -320,8 +320,8 @@
320 320 </view>
321 321 <view
322 322 style="width: 100%; height: 100rpx; background-color: #ffffff"
323   - ></view
324   - ></view>
  323 + ></view>
  324 + </view>
325 325 </u-popup>
326 326 <u-popup
327 327 v-model="showResume"
... ... @@ -468,6 +468,23 @@
468 468 @callBack="sucesslogin"
469 469 ></yxly-login>
470 470 </u-popup>
  471 + <u-popup v-model="isClose" mode="center" border-radius="18">
  472 + <view class="callBackAlipay">
  473 + <view class="" style="padding-top: 40rpx">
  474 + <image
  475 + mode="widthFix"
  476 + style="width: 120rpx; height: 120rpx"
  477 + src="/static/img/common/123.png"
  478 + >
  479 + </image>
  480 + </view>
  481 + <view class="" style="margin-top: 30rpx"> 您已成功投递该岗位 </view>
  482 + <view class="" style="margin-top: 20rpx">
  483 + <c-button type="confirm" @click="alipayBack" text="返回支付宝就业">
  484 + </c-button>
  485 + </view>
  486 + </view>
  487 + </u-popup>
471 488 </view>
472 489 </template>
473 490
... ... @@ -484,6 +501,7 @@ export default {
484 501 return {
485 502 analysisArea,
486 503 formateSalary,
  504 + isClose: true,
487 505 yxlyLoginShow: false,
488 506 statusBarHeight: 44,
489 507 menuHeight: 32,
... ... @@ -542,7 +560,6 @@ export default {
542 560 },
543 561
544 562 onLoad(e) {
545   - console.log(e);
546 563 this.id = e.id;
547 564 this.candidate_id = e.candidate_id ? e.candidate_id : "";
548 565 this.statusAbandon = e.from_type && e.from_type == 3 ? true : false;
... ... @@ -575,6 +592,16 @@ export default {
575 592 this.getStatusDetail();
576 593 }
577 594 },
  595 + alipayBack() {
  596 + my.exitMiniProgram({
  597 + success:()=>{
  598 + console.log('成功');
  599 + },
  600 + fail:()=>{
  601 +
  602 + }
  603 + })
  604 + },
578 605
579 606 timeFormat(value, format = "yyyy-mm-dd") {
580 607 return this.$u.timeFormat(value, format);
... ... @@ -831,11 +858,69 @@ export default {
831 858
832 859 showApplyPop() {
833 860 if (this.vuex_token != "") {
834   - if (this.resumeDetailObj && this.resumeDetailObj.id) {
835   - this.showResume = true;
836   - } else {
837   - this.showNoResume = true;
838   - }
  861 + // if (this.resumeDetailObj && this.resumeDetailObj.id) {
  862 + // this.showResume = true;
  863 + // } else {
  864 + // this.showNoResume = true;
  865 + // }
  866 +
  867 + const params = {
  868 + position_id: this.id,
  869 + };
  870 + this.$u.api.getJobUserAuth(params).then((res) => {
  871 + console.log(res);
  872 + my.getAuthCode({
  873 + scopes: "yingpin",
  874 + success: (authRes) => {
  875 + my.ap.openCreditEvaluation({
  876 + signStr: res.sign_str,
  877 + // 调用成功的回调函数
  878 + success: ({ resultStatus }) => {
  879 + // 调用成功/失败,半屏关闭时的回调函数。如果调用方需要半屏关闭后进行一些操作,可以在这个回调函数里处理。
  880 + // 比如页面状态的刷新、页面的跳转等
  881 + if (resultStatus === "9003") {
  882 + // 用户取消操作
  883 + } else if (resultStatus === "9000") {
  884 + this.$u.api
  885 + .applyJobUrlApi({
  886 + position_id: this.id,
  887 + auth_code: authRes.authCode,
  888 + ...res,
  889 + })
  890 + .then((jobRes) => {
  891 + console.log(jobRes, "jobRes");
  892 + if (jobRes && jobRes.code > 300) {
  893 + uni.showToast({
  894 + title: jobRes.message,
  895 + icon: "none",
  896 + duration: 1500,
  897 + });
  898 + } else {
  899 + this.jobStatus = "new";
  900 + if (this.vuex_alipay) {
  901 + this.isClose = true;
  902 + } else {
  903 + uni.showToast({
  904 + title: "投递成功!",
  905 + icon: "none",
  906 + duration: 1500,
  907 + });
  908 + }
  909 + }
  910 + });
  911 +
  912 + // 用户授权成功
  913 + } else if (resultStatus === "4000") {
  914 + // 用户授权失败
  915 + }
  916 + },
  917 + fail: (res) => {
  918 + console.log(res, "slafasjlfjdsajk");
  919 + },
  920 + });
  921 + },
  922 + });
  923 + });
839 924 } else {
840 925 this.goLogin();
841 926 }
... ... @@ -1147,6 +1232,7 @@ export default {
1147 1232 .tenant_info {
1148 1233 flex: 1;
1149 1234 padding: 0px 16rpx;
  1235 +
1150 1236 .sxyq {
1151 1237 font-size: 28rpx;
1152 1238 font-family: PingFangSC-Medium, PingFang SC;
... ... @@ -1589,4 +1675,12 @@ export default {
1589 1675 }
1590 1676 }
1591 1677 }
1592   -</style>
  1678 +
  1679 +.callBackAlipay {
  1680 + display: flex;
  1681 + flex-direction: column;
  1682 + height: 360rpx;
  1683 + align-items: center;
  1684 + width: 600rpx;
  1685 +}
  1686 +</style>
\ No newline at end of file
... ...
... ... @@ -246,7 +246,6 @@
246 246 background:
247 247 'linear-gradient(to right,var(--primary-color100), #fff)',
248 248 bottom: '10px',
249   - left: '-10px',
250 249 zIndex: '0',
251 250 }"
252 251 :active-item-style="{
... ... @@ -309,7 +308,6 @@
309 308 background:
310 309 'linear-gradient(to right,var(--primary-color100), #fff)',
311 310 bottom: '10px',
312   - left: '50px',
313 311 zIndex: '0',
314 312 }"
315 313 :active-item-style="{
... ...
... ... @@ -62,7 +62,7 @@
62 62 form: {
63 63 expect_job: "",
64 64 salary: "",
65   - expect_workplace: "",
  65 + expect_workplace: {},
66 66 },
67 67 fromType: "",
68 68 selectMode: "",
... ...
1   -import Vue from 'vue'
2   -import Vuex from 'vuex'
3   -import user from './modules/user'
4   -import internship from './modules/internship'
5   -Vue.use(Vuex)
  1 +import Vue from "vue";
  2 +import Vuex from "vuex";
  3 +import user from "./modules/user";
  4 +import internship from "./modules/internship";
  5 +Vue.use(Vuex);
6 6
7 7 const appNameData = {
8   - '2021004125649367': '智用工',
9   - 'wx2a515776284cae17': '新华实习',
10   -}
  8 + 2021004125649367: "智用工",
  9 + wx2a515776284cae17: "新华实习",
  10 +};
11 11
12 12 let lifeData = {};
13   -let appId = '2021004125649367';
  13 +let appId = "2021004125649367";
14 14 // 新华网
15 15 // let appId = 'wx2a515776284cae17';
16 16
17 17 try {
18 18 // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
19   - lifeData = uni.getStorageSync('lifeData');
20   -} catch (e) {
21   -
22   -}
  19 + lifeData = uni.getStorageSync("lifeData");
  20 +} catch (e) {}
23 21
24 22 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
25 23 let saveStateKeys = [
26   - 'vuex_user',
27   - 'vuex_tenant',
28   - 'vuex_token',
29   - 'workai_vuex_token',
30   - 'vuex_phone',
31   - 'vuex_weixinUserInfo',
32   - 'vuex_role',
33   - 'vuex_userid',
34   - 'vuex_refresh_token',
35   - 'vuex_baseImgUrl',
36   - 'vuex_theme',
37   - 'vuex_expect_job'
  24 + "vuex_user",
  25 + "vuex_tenant",
  26 + "vuex_token",
  27 + "workai_vuex_token",
  28 + "vuex_phone",
  29 + "vuex_weixinUserInfo",
  30 + "vuex_role",
  31 + "vuex_userid",
  32 + "vuex_refresh_token",
  33 + "vuex_baseImgUrl",
  34 + "vuex_theme",
  35 + "vuex_expect_job",
38 36 ];
39 37
40 38 // 保存变量到本地存储中
... ... @@ -42,37 +40,35 @@ const saveLifeData = function (key, value) {
42 40 // 判断变量名是否在需要存储的数组中
43 41 if (saveStateKeys.indexOf(key) != -1) {
44 42 // 获取本地存储的lifeData对象,将变量添加到对象中
45   - let tmp = uni.getStorageSync('lifeData');
  43 + let tmp = uni.getStorageSync("lifeData");
46 44 // 第一次打开APP,不存在lifeData变量,故放一个{}空对象
47 45 tmp = tmp ? tmp : {};
48 46 tmp[key] = value;
49 47 // 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
50   - uni.setStorageSync('lifeData', tmp);
  48 + uni.setStorageSync("lifeData", tmp);
51 49 }
52   -}
53   -
54   -
  50 +};
55 51
56   -const handleTabBars = function(type) {
  52 +const handleTabBars = function (type) {
57 53 const tabBars = [
58 54 {
59   - "pagePath": "/pages/student/tabBar/home/home",
60   - "iconPath": "/static/img/common/home.png",
61   - "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/wx84b71301436652ce/homeHL.png`,
62   - "text": "首页"
63   - },
64   - // {
65   - // "pagePath": "/pages/student/tabBar/internship/internship",
66   - // "iconPath": "/static/img/common/internship.png",
67   - // "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/${appId}/internshipHL.png`,
68   - // "text": "实习"
69   - // },
70   - // {
71   - // "pagePath": "/pages/student/tabBar/promote/promote",
72   - // "iconPath": "/static/img/common/promote.png",
73   - // "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/${appId}/promoteHL.png`,
74   - // "text": "提升"
75   - // },
  55 + pagePath: "/pages/student/tabBar/home/home",
  56 + iconPath: "/static/img/common/home.png",
  57 + selectedIconPath: `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/wx84b71301436652ce/homeHL.png`,
  58 + text: "首页",
  59 + },
  60 + // {
  61 + // "pagePath": "/pages/student/tabBar/internship/internship",
  62 + // "iconPath": "/static/img/common/internship.png",
  63 + // "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/${appId}/internshipHL.png`,
  64 + // "text": "实习"
  65 + // },
  66 + // {
  67 + // "pagePath": "/pages/student/tabBar/promote/promote",
  68 + // "iconPath": "/static/img/common/promote.png",
  69 + // "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/${appId}/promoteHL.png`,
  70 + // "text": "提升"
  71 + // },
76 72 // {
77 73 // "pagePath": "/pages/student/tabBar/message/message",
78 74 // "iconPath": "/static/img/common/message.png",
... ... @@ -81,13 +77,13 @@ const handleTabBars = function(type) {
81 77 // 'isDot': true,
82 78 // 'count': 0,
83 79 // },
84   - {
85   - "pagePath": "/pages/student/tabBar/my/my",
86   - "iconPath": "/static/img/common/my.png",
87   - "selectedIconPath": `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/wx84b71301436652ce/myHL.png`,
88   - "text": "我的"
89   - }
90   - ]
  80 + {
  81 + pagePath: "/pages/student/tabBar/my/my",
  82 + iconPath: "/static/img/common/my.png",
  83 + selectedIconPath: `https://yxlypublic.oss-cn-beijing.aliyuncs.com/WeChat/wx84b71301436652ce/myHL.png`,
  84 + text: "我的",
  85 + },
  86 + ];
91 87 // if (appId == 'wx2a515776284cae17') {
92 88 // tabBars.splice(2, 1)
93 89 // }
... ... @@ -100,9 +96,8 @@ const handleTabBars = function(type) {
100 96 // if (type == 'student') {
101 97 // return tabBars
102 98 // }
103   - return tabBars
104   -
105   -}
  99 + return tabBars;
  100 +};
106 101
107 102 const store = new Vuex.Store({
108 103 modules: {
... ... @@ -112,46 +107,57 @@ const store = new Vuex.Store({
112 107 state: {
113 108 vuex_appId: appId,
114 109 vuex_appName: appNameData[appId],
  110 + vuex_alipay: false,
115 111 // 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
116 112 // 加上vuex_前缀,是防止变量名冲突,也让人一目了然
117 113 vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
118 114 vuex_tenant: lifeData.vuex_tenant ? lifeData.vuex_tenant : {},
119   - vuex_weixinUserInfo: lifeData.vuex_weixinUserInfo ? lifeData.vuex_weixinUserInfo : {},
120   - vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
121   - workai_vuex_token: lifeData.workai_vuex_token ? lifeData.workai_vuex_token : '',
122   - vuex_phone: lifeData.vuex_phone ? lifeData.vuex_phone : '',
123   - vuex_role: lifeData.vuex_role ? lifeData.vuex_role : '',
124   - vuex_userid: lifeData.vuex_userid ? lifeData.vuex_userid : '',
125   - vuex_refresh_token: lifeData.vuex_refresh_token ? lifeData.vuex_refresh_token : '',
  115 + vuex_weixinUserInfo: lifeData.vuex_weixinUserInfo
  116 + ? lifeData.vuex_weixinUserInfo
  117 + : {},
  118 + vuex_token: lifeData.vuex_token ? lifeData.vuex_token : "",
  119 + workai_vuex_token: lifeData.workai_vuex_token
  120 + ? lifeData.workai_vuex_token
  121 + : "",
  122 + vuex_phone: lifeData.vuex_phone ? lifeData.vuex_phone : "",
  123 + vuex_role: lifeData.vuex_role ? lifeData.vuex_role : "",
  124 + vuex_userid: lifeData.vuex_userid ? lifeData.vuex_userid : "",
  125 + vuex_refresh_token: lifeData.vuex_refresh_token
  126 + ? lifeData.vuex_refresh_token
  127 + : "",
126 128 // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
127   - vuex_version: '1.0.0',
  129 + vuex_version: "1.0.0",
128 130 vuex_noAuth: true,
129   - vuex_demo: '绛紫',
  131 + vuex_demo: "绛紫",
130 132 vuex_baseImgUrl: "",
131 133 vuex_ossUrl: "https://yxly.oss-cn-beijing.aliyuncs.com",
132 134 vuex_ossUrlPubilc: "https://yxlypublic.oss-cn-beijing.aliyuncs.com",
133 135 // vuex_ossUrl: "https://oss.workai.com.cn",
134 136 vuex_OssInit: {},
135 137 vuex_area: {},
136   - vuex_theme: '',
  138 + vuex_theme: "",
137 139 // vuex_theme: this.theme,
138 140 // 自定义tabbar数据
139   - vuex_tabbar: handleTabBars('worker'),
140   - vuex_tabbar_inter: handleTabBars('student'),
141   - vuex_expect_job: lifeData.vuex_expect_job ? lifeData.vuex_expect_job : '全部职位',
  141 + vuex_tabbar: handleTabBars("worker"),
  142 + vuex_tabbar_inter: handleTabBars("student"),
  143 + vuex_expect_job: lifeData.vuex_expect_job
  144 + ? lifeData.vuex_expect_job
  145 + : "全部职位",
142 146 },
143 147
144 148 getters: {
145   - doneTenantType: state => {
146   - return state.vuex_tenant && state.vuex_tenant.type ? String(state.vuex_tenant.type) : '';
147   - }
  149 + doneTenantType: (state) => {
  150 + return state.vuex_tenant && state.vuex_tenant.type
  151 + ? String(state.vuex_tenant.type)
  152 + : "";
  153 + },
148 154 },
149 155
150 156 mutations: {
151 157 $uStore(state, payload) {
152 158 // 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
153   - let nameArr = payload.name.split('.');
154   - let saveKey = '';
  159 + let nameArr = payload.name.split(".");
  160 + let saveKey = "";
155 161 let len = nameArr.length;
156 162 if (len >= 2) {
157 163 let obj = state[nameArr[0]];
... ... @@ -166,14 +172,14 @@ const store = new Vuex.Store({
166 172 saveKey = payload.name;
167 173 }
168 174 // 保存变量到本地,见顶部函数定义
169   - saveLifeData(saveKey, state[saveKey])
  175 + saveLifeData(saveKey, state[saveKey]);
170 176 },
171 177
172 178 setWenxinUserInfo(state, result) {
173 179 state.vuex_weixinUserInfo = result.userInfo;
174   - uni.$u.vuex('vuex_weixinUserInfo', result.userInfo);
  180 + uni.$u.vuex("vuex_weixinUserInfo", result.userInfo);
175 181 },
176   - }
177   -})
  182 + },
  183 +});
178 184
179   -export default store
  185 +export default store;
... ...
注册登录 后发表评论