Commit 4a20d3fd by gyfnice

handleEslint

parent 727e9315
......@@ -7,7 +7,10 @@
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
"build": "node build/build.js",
"lint": "eslint src",
"lint:create": "eslint --init",
"lint:fix": "eslint src --fix"
},
"transformModules": {
"cube-ui": {
......@@ -61,6 +64,7 @@
"copy-webpack-plugin": "^4.5.0",
"cross-env": "^5.0.1",
"css-loader": "^0.28.0",
"eslint": "^5.9.0",
"eventsource-polyfill": "^0.9.6",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,10 +12,10 @@
.cube-view {
// transform: translate(0, 0)
}
// .page-move-enter, .page-move-leave-active {
// transform: translate(100%, 0)
// }
// .page-move-enter-active, .page-move-leave-active {
// transition: transform .3s
// }
.page-move-enter, .page-move-leave-active {
transform: translate(100%, 0)
}
.page-move-enter-active, .page-move-leave-active {
transition: transform .3s
}
</style>
\ No newline at end of file
......@@ -15,29 +15,29 @@ Date.prototype.Format = function(fmt) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
};
export function currency (value) {
return i18n.toCurrency(value).replace('$','¥ ') // $1,000.00
return i18n.toCurrency(value).replace("$","¥ "); // $1,000.00
}
export function onlyCurrency (value) {
return i18n.toCurrency(value).replace('$','') // $1,000.00
return i18n.toCurrency(value).replace("$",""); // $1,000.00
}
export function convertCurrency(money) {
//汉字的数字
var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
var cnNums = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
//基本单位
var cnIntRadice = new Array('', '拾', '佰', '仟');
var cnIntRadice = new Array("", "拾", "佰", "仟");
//对应整数部分扩展单位
var cnIntUnits = new Array('', '万', '亿', '兆');
var cnIntUnits = new Array("", "万", "亿", "兆");
//对应小数部分单位
var cnDecUnits = new Array('角', '分', '毫', '厘');
var cnDecUnits = new Array("角", "分", "毫", "厘");
//整数金额时后面跟的字符
var cnInteger = '整';
var cnInteger = "整";
//整型完以后的单位
var cnIntLast = '元';
var cnIntLast = "元";
//最大处理的数字
var maxNum = 999999999999999.9999;
//金额整数部分
......@@ -45,26 +45,26 @@ export function convertCurrency(money) {
//金额小数部分
var decimalNum;
//输出的中文金额字符串
var chineseStr = '';
var chineseStr = "";
//分离金额后用的数组,预定义
var parts;
if (money == '') { return ''; }
if (money === "") { return ""; }
money = parseFloat(money);
if (money >= maxNum) {
//超出最大处理数字
return '';
return "";
}
if (money == 0) {
if (money === 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr;
}
//转换为字符串
money = money.toString();
if (money.indexOf('.') == -1) {
if (money.indexOf(".") === -1) {
integerNum = money;
decimalNum = '';
decimalNum = "";
} else {
parts = money.split('.');
parts = money.split(".");
integerNum = parts[0];
decimalNum = parts[1].substr(0, 4);
}
......@@ -77,7 +77,7 @@ export function convertCurrency(money) {
var p = IntLen - i - 1;
var q = p / 4;
var m = p % 4;
if (n == '0') {
if (n === "0") {
zeroCount++;
} else {
if (zeroCount > 0) {
......@@ -87,32 +87,32 @@ export function convertCurrency(money) {
zeroCount = 0;
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
}
if (m == 0 && zeroCount < 4) {
if (m === 0 && zeroCount < 4) {
chineseStr += cnIntUnits[q];
}
}
chineseStr += cnIntLast;
}
//小数部分
if (decimalNum != '') {
if (decimalNum !== "") {
var decLen = decimalNum.length;
for (var i = 0; i < decLen; i++) {
var n = decimalNum.substr(i, 1);
if (n != '0') {
if (n !== "0") {
chineseStr += cnNums[Number(n)] + cnDecUnits[i];
}
}
}
if (chineseStr == '') {
if (chineseStr === "") {
chineseStr += cnNums[0] + cnIntLast + cnInteger;
} else if (decimalNum == '') {
} else if (decimalNum === "") {
chineseStr += cnInteger;
}
return chineseStr;
}
export function accurateTime(timeStramp) {
if(!timeStramp) {
return '-'
return "-";
}
let date = new Date(timeStramp);
var year = date.getFullYear();
......@@ -121,20 +121,20 @@ export function accurateTime(timeStramp) {
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
date = year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second; // + '分' + second + '秒';
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
hour = hour < 10 ? "0" + hour : hour;
minute = minute < 10 ? "0" + minute : minute;
second = second < 10 ? "0" + second : second;
date = year + "/" + month + "/" + day + " " + hour + ":" + minute + ":" + second; // + '分' + second + '秒';
return date;
}
export function normalDate (timeStramp) {
if(!timeStramp) {
return '没有数据'
return "没有数据";
}
let date = new Date(timeStramp)
return date.Format("yyyy/MM/dd")
let date = new Date(timeStramp);
return date.Format("yyyy/MM/dd");
// var year = date.getFullYear();
// var month = date.getMonth() + 1;
// var day = date.getDate();
......@@ -152,18 +152,18 @@ export function normalDate (timeStramp) {
//2017年12月19日 21:38:49
export function chinaDate (timeStramp) {
let date = new Date(timeStramp)
let date = new Date(timeStramp);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
date = year + '年' + month + '月' + day + '日 ' + hour + ':' + minute + ':' + second;
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
hour = hour < 10 ? "0" + hour : hour;
minute = minute < 10 ? "0" + minute : minute;
second = second < 10 ? "0" + second : second;
date = year + "年" + month + "月" + day + "日 " + hour + ":" + minute + ":" + second;
return date;
}
\ No newline at end of file
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Vue from "vue";
//import WechatAuth from '@/utils/auth';
//import './pollyjs'
import FastClick from 'fastclick'
import VueLazyload from 'vue-lazyload'
import FastClick from "fastclick";
import VueLazyload from "vue-lazyload";
import Vant from 'vant';
import '@/assets/css/vant_index.css';
import Vant from "vant";
import "@/assets/css/vant_index.css";
import '@/assets/font/font_sail_client'
import "@/assets/font/font_sail_client";
import getQueryString from '@/utils/getQueryString'
import getQueryString from "@/utils/getQueryString";
// Import Helpers for filters
import { currency, onlyCurrency, convertCurrency, normalDate, chinaDate, accurateTime } from '@/filter'
import { currency, onlyCurrency, convertCurrency, normalDate, chinaDate, accurateTime } from "@/filter";
// Import Install and register helper items
Vue.filter('currency', currency)
Vue.filter('onlyCurrency', onlyCurrency)
Vue.filter('convertCurrency', convertCurrency)
Vue.filter('normalDate', normalDate)
Vue.filter('accurateTime', accurateTime)
Vue.filter('chinaDate', chinaDate)
Vue.filter("currency", currency);
Vue.filter("onlyCurrency", onlyCurrency);
Vue.filter("convertCurrency", convertCurrency);
Vue.filter("normalDate", normalDate);
Vue.filter("accurateTime", accurateTime);
Vue.filter("chinaDate", chinaDate);
import { Toast } from 'vant';
import { Toast } from "vant";
Vue.use(Vant);
// By default we import all the components.
......@@ -60,28 +60,28 @@ import {
//IndexList,
//Swipe,
Upload
} from 'cube-ui'
} from "cube-ui";
import {sync} from 'vuex-router-sync'
import {sync} from "vuex-router-sync";
//import {INIT_ADD_HOT} from './store/mutation_types.js'
import locStore from '@/utils/store';
import locStore from "@/utils/store";
import Api from '@/api/index.js'
import store from './store'
import Api from "@/api/index.js";
import store from "./store";
import App from './App'
import router from './router'
import { List } from 'vant'
Vue.use(List)
import { Cell, CellGroup } from 'vant';
import App from "./App";
import router from "./router";
import { List } from "vant";
Vue.use(List);
import { Cell, CellGroup } from "vant";
Vue.use(Cell).use(CellGroup);
//import { Popup } from 'vant'
import { Search } from 'vant';
import { Search } from "vant";
Vue.use(Search);
//Vue.use(Toolbar)
//Vue.use(CheckboxGroup)
Vue.use(Radio)
Vue.use(Radio);
//Vue.use(Input)
//Vue.use(Textarea)
//Vue.use(Select)
......@@ -89,14 +89,14 @@ Vue.use(Radio)
//Vue.use(Rate)
//Vue.use(Validator)
//Vue.use(Form)
Vue.use(Loading)
Vue.use(Tip)
Vue.use(Loading);
Vue.use(Tip);
//Vue.use(Toast)
//Vue.use(Picker)
Vue.use(CascadePicker)
Vue.use(DatePicker)
Vue.use(SegmentPicker)
Vue.use(TimePicker)
Vue.use(CascadePicker);
Vue.use(DatePicker);
Vue.use(SegmentPicker);
Vue.use(TimePicker);
//Vue.use(Dialog)
//Vue.use(ActionSheet)
//Vue.use(Drawer)
......@@ -104,18 +104,18 @@ Vue.use(TimePicker)
//Vue.use(Slide)
//Vue.use(IndexList)
//Vue.use(Swipe)
Vue.use(Upload)
Vue.use(Upload);
Vue.config.productionTip = false
Vue.config.productionTip = false;
//匹配要渲染的视图后,再获取数据:
Vue.mixin({
beforeMount () {
const { asyncData, initData } = this.$options
const { asyncData, initData } = this.$options;
setTimeout(()=> {
window.scrollTo(0, 0)
}, 10)
window.scrollTo(0, 0);
}, 10);
if (asyncData) {
// 将获取数据操作分配给 promise
// 以便在组件中,我们可以在数据准备就绪后
......@@ -124,8 +124,8 @@ Vue.mixin({
const toast = Toast.loading({
duration: 0, // continuous display toast
forbidClick: true, // forbid click background
loadingType: 'spinner',
message: '正在加载...'
loadingType: "spinner",
message: "正在加载..."
});
this.dataPromise = asyncData({
store: this.$store,
......@@ -133,70 +133,84 @@ Vue.mixin({
}).then(() => {
Toast.clear();
//store.commit('UPDATE_LOADING_STATUS', false)
})
});
}
if(initData) {
initData({
store: this.$store,
route: this.$route
})
});
}
}
})
});
// Some middleware to help us ensure the user is authenticated.
router.beforeEach((to, from, next) => {
let cUrl = location.href
if(cUrl.indexOf('login') === -1 && cUrl.indexOf('code') === -1 && cUrl.indexOf('state') === -1) {
locStore('lastPage', location.href)
let cUrl = location.href;
if(cUrl.indexOf("login") === -1 && cUrl.indexOf("code") === -1 && cUrl.indexOf("state") === -1) {
locStore("lastPage", location.href);
}
//console.log('location-href------------>', location.href)
let code = getQueryString('code');
let code = getQueryString("code");
//console.log('--->code', code)
let state = getQueryString('state');
let state = getQueryString("state");
if(code && !state) {
console.log('正在登录')
store.dispatch('loginModule/wxLoginInfo', code).then(res => {
console.log("正在登录");
store.dispatch("loginModule/wxLoginInfo", code).then(res => {
//console.log('loginInfo', res.data)
//console.log(res, '2222222222')
if(res.data.code !== 10000) {
// next({
// path: '/login'
// })
location.href = "/wx/index.html#/login"
location.href = "/wx/index.html#/login";
return;
}
if(to.matched.some(record => record.meta.requiresLogin) &&
(!router.app.$store.state.loginModule.loginInfo.phone
|| router.app.$store.state.loginModule.loginInfo.phone === '')){
|| router.app.$store.state.loginModule.loginInfo.phone === "")){
next({
path: '/login'
})
path: "/login"
});
}
})
});
}
if(code && state) {
store.dispatch('loginModule/wxPoneLoginCallBack', {
store.dispatch("loginModule/wxPoneLoginCallBack", {
code,
state
}).then(res => {
//console.log('to.matched.some(record => record.meta.requiresLogind', to.matched.some(record => record.meta.requiresLogin))
if(to.matched.some(record => record.meta.requiresLogin) &&
(!router.app.$store.state.loginModule.loginInfo.phone
|| router.app.$store.state.loginModule.loginInfo.phone === '')){
|| router.app.$store.state.loginModule.loginInfo.phone === "")){
// let hasLogout = locStore('hasLogout')
// if(hasLogout) {
// }
next({
path: '/login'
})
path: "/login"
});
return;
//console.log('router.app.$store.state.loginModule.loginInfo.phone', router.app.$store.state.loginModule.loginInfo.phone)
// store.dispatch('loginModule/wxLogin').then(res => {
// if(res) {
// location.href = res.data.data
// }else {
// next({
// path: '/login'
// })
// }
// })
}
//console.log('loginInfo', res.data)
})
});
}
//console.log('code-------->', code)
if(!code && !state && to.matched.some(record => record.meta.requiresLogin) &&
(!router.app.$store.state.loginModule.loginInfo.phone
|| router.app.$store.state.loginModule.loginInfo.phone === '')){
|| router.app.$store.state.loginModule.loginInfo.phone === "")){
//console.log('router.app.$store.state.loginModule.loginInfo.phone', router.app.$store.state.loginModule.loginInfo.phone)
// let hasLogout = locStore('hasLogout')
// if(hasLogout === true) {
......@@ -205,39 +219,39 @@ router.beforeEach((to, from, next) => {
// })
// return;
// }
next({
path: '/login'
})
// store.dispatch('loginModule/wxLogin').then(res => {
// if(res) {
// location.href = res.data.data
// }else {
// }
// next({
// path: '/login'
// })
store.dispatch("loginModule/wxLogin").then(res => {
if(res) {
location.href = res.data.data;
}else {
}
});
}
if (to.matched.some(record => record.meta.requiresAuth) &&
(!router.app.$store.state.loginModule.loginInfo.cardCode
|| router.app.$store.state.loginModule.loginInfo.cardCode === '')) {
|| router.app.$store.state.loginModule.loginInfo.cardCode === "")) {
// this route requires auth, check if logged in
// if not, redirect to login page.
next({
path: '/RealNameCheck/auth'
})
path: "/RealNameCheck/auth"
});
} else {
next()
next();
}
})
});
sync(store, router);
/* eslint-disable no-new */
let vm = new Vue({
el: '#app',
el: "#app",
store,
router,
template: '<App/>',
template: "<App/>",
components: { App }
})
});
Api.interceptorsMethod(store, vm)
Api.interceptorsMethod(store, vm);
......@@ -149,18 +149,20 @@
},
onSubmit() {
this.loading = true
this.$store.dispatch('applyModule/depositGetPayUrl',{
applyLiveId:store('depositInfo').applyLiveId
}).then(res => {
this.loading = false
if(res.data.code === 10000 ){
location.href= res.data.data.ccbPaymentUrl
}
})
// setTimeout(() => {
// this.$store.dispatch('applyModule/depositGetPayUrl',{
// applyLiveId:store('depositInfo').applyLiveId
// }).then(res => {
// this.loading = false
// location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbc03a72497d53424&redirect_uri=http%3a%2f%2fc.sailapartment.com%2fwx%2fwxuser.html&response_type=code&scope=snsapi_base&state=${store('depositInfo').paymentPo.orderCode}&connect_redirect=1#wechat_redirect`
// },500)
// console.log('res==',res.data)
// //return
// if(res.data.code === 10000 ){
// location.href= res.data.data.ccbPaymentUrl
// }
// })
setTimeout(() => {
this.loading = false
location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbc03a72497d53424&redirect_uri=http%3a%2f%2fc.sailapartment.com%2fwx%2fwxuser.html&response_type=code&scope=snsapi_base&state=${store('depositInfo').paymentPo.orderCode}&connect_redirect=1#wechat_redirect`
},500)
......
import {Polly} from "@pollyjs/core";
const polly = new Polly('<Recording Name>');
const polly = new Polly("<Recording Name>");
const { server } = polly;
// Events & Middleware
server
.any()
.on('request', (req, res) => {
req.headers['X-Auth-Token'] = 'abc123';
.on("request", (req, res) => {
req.headers["X-Auth-Token"] = "abc123";
});
//console.log('--------gyf')
// Intercept requests
server.get('/sail-web/parameterSetting/selectServiceTel').intercept((req, res) => {
server.get("/sail-web/parameterSetting/selectServiceTel").intercept((req, res) => {
res.status(200).json({"code":10000,"msg":"操作成功","data":{"id":11,"phone":"gyf0851-85637098"}});
});
// Passthrough requests
server.get('/coverage').passthrough();
\ No newline at end of file
server.get("/coverage").passthrough();
\ No newline at end of file
......@@ -52,7 +52,7 @@ import myBillModule from "./modules/billStore/myBillStore"; //我的账单
import api from '@/api/index.js'
import api from "@/api/index.js";
import weixin from "@/utils/wx.config.js";
......@@ -92,56 +92,56 @@ export default new Vuex.Store({
filterOption: {
region: {
visible: false,
selected: '',
selected: "",
options: []
},
room: {
visible: false,
selected: '',
selected: "",
options: []
},
unit: {
visible: false,
selected: '',
selected: "",
options: []
},
floor: {
visible: false,
selected: '',
selected: "",
options: []
},
roomNumber: {
visible: false,
selected: '',
selected: "",
options: []
},
relation: {
visible: false,
selected: 'parent',
selected: "parent",
options: [
{
label: '父母',
value: 'em_contact_re_parent'
label: "父母",
value: "em_contact_re_parent"
},
{
label: '子女',
value: 'em_contact_re_children'
label: "子女",
value: "em_contact_re_children"
},
{
label: '配偶',
value: 'em_contact_re_spouse'
label: "配偶",
value: "em_contact_re_spouse"
},
{
label: '朋友',
value: 'em_contact_re_firend'
label: "朋友",
value: "em_contact_re_firend"
},
{
label: '同事',
value: 'em_contact_re_workmate'
label: "同事",
value: "em_contact_re_workmate"
},
{
label: '其他',
value: 'em_contact_re_other'
label: "其他",
value: "em_contact_re_other"
}
]
}
......@@ -149,25 +149,25 @@ export default new Vuex.Store({
},
actions: {
initWxShare({commit, state}) {
let url = location.href.split('#')[0];
console.log('-------share---', url)
let url = location.href.split("#")[0];
console.log("-------share---", url);
return api
.request("get",api.getURL("WxShare/sign"), {
url: url
}).then(res =>{
console.log('res.data--share--', res.data)
console.log("res.data--share--", res.data);
//commit('SET_GLOBAL_PHONE', res.data.data.phone)
weixin.init(res.data)
return res
})
weixin.init(res.data);
return res;
});
},
selectServiceTel({commit,state}){
return api
.request("get",api.getURL("parameterSetting/selectServiceTel")).then(res =>{
//console.log('tele',res)
commit('SET_GLOBAL_PHONE', res.data.data.phone)
return res
})
commit("SET_GLOBAL_PHONE", res.data.data.phone);
return res;
});
},/*
delete({ commit, state }, info) {
return api.request("get", api.getURL("systemMsg/delete"), {
......@@ -179,7 +179,7 @@ export default new Vuex.Store({
},*/
fetchSelectDataType({ commit, state }, typeName) {
//if (state.columsOptions.length > 0) return;
if(typeName !== 'LayoutIntent'){ // 特殊情况 选择户型 判断渔安新城无单间
if(typeName !== "LayoutIntent"){ // 特殊情况 选择户型 判断渔安新城无单间
if(state[typeName]) return; //对已缓存的数据无需发送请求
}
return api
......@@ -196,31 +196,31 @@ export default new Vuex.Store({
text: item.name || item.remark
};
});
commit('GET_SELECT_HOUSE_TYPE', {
commit("GET_SELECT_HOUSE_TYPE", {
list: opt,
keyName: typeName
});
});
},
commitBindHouse( { commit, state }, params) {
return api.request("post", api.getURL('cAPPHouse/commitBindHouse'), {
return api.request("post", api.getURL("cAPPHouse/commitBindHouse"), {
houseId: state.houseId,
relationship: state.filterOption['relation'].selected
relationship: state.filterOption["relation"].selected
}).then(res => {
return res;
})
});
},
sendDiffList( { commit, state }, payload) {
let urlMap = {
region: {
url: api.getURL('cAPPHouse/regions'),
url: api.getURL("cAPPHouse/regions"),
params: {
pn: 1,
pageSize: 2000 * payload.times
}
},
room: {
url: api.getURL('cAPPHouse/buildingNums'),
url: api.getURL("cAPPHouse/buildingNums"),
params: {
pn: 1,
pageSize: 2000 * payload.times,
......@@ -228,7 +228,7 @@ export default new Vuex.Store({
}
},
unit: {
url: api.getURL('cAPPHouse/units'),
url: api.getURL("cAPPHouse/units"),
params: {
pn: 1,
pageSize: 2000 * payload.times,
......@@ -237,7 +237,7 @@ export default new Vuex.Store({
}
},
floor: {
url: api.getURL('cAPPHouse/floors'),
url: api.getURL("cAPPHouse/floors"),
params: {
pn: 1,
pageSize: 2000 * payload.times,
......@@ -247,7 +247,7 @@ export default new Vuex.Store({
}
},
roomNumber: {
url: api.getURL('cAPPHouse/houses'),
url: api.getURL("cAPPHouse/houses"),
params: {
pn: 1,
pageSize: 2000 * payload.times,
......@@ -260,59 +260,59 @@ export default new Vuex.Store({
// relation: {
// }
}
};
return api.request("get", urlMap[payload.type].url, urlMap[payload.type].params).then(res => {
if(payload.type === 'room') {
if(payload.type === "room") {
res.data.data.list.map(item => {
item.name = item.buildingNum
item.id = item.buildingNum
})
item.name = item.buildingNum;
item.id = item.buildingNum;
});
}
if(payload.type === 'unit') {
if(payload.type === "unit") {
res.data.data.list.map(item => {
item.name = item.unit
item.id = item.unit
})
item.name = item.unit;
item.id = item.unit;
});
}
if(payload.type === 'floor') {
if(payload.type === "floor") {
res.data.data.list.map(item => {
item.name = item.floor
item.id = item.floor
})
item.name = item.floor;
item.id = item.floor;
});
}
if(payload.type === 'roomNumber') {
if(payload.type === "roomNumber") {
res.data.data.list.map(item => {
item.name = item.houseCode
item.id = item.houseId
})
item.name = item.houseCode;
item.id = item.houseId;
});
}
commit('UPDATE_FILTER_OPTION_LIST', {
commit("UPDATE_FILTER_OPTION_LIST", {
type: payload.type,
list: res.data.data.list
})
});
return res.data.data;
})
});
}
},
mutations: {
SET_GLOBAL_PHONE(state, phone) {
console.log('phone', phone)
Vue.set(state, 'telephone', phone)
console.log("phone", phone);
Vue.set(state, "telephone", phone);
},
GET_SELECT_HOUSE_TYPE(state, data) {
//console.log('data.list', data.list)
Vue.set(state, data.keyName, data.list)
Vue.set(state, data.keyName, data.list);
},
UPDATE_LOADING_STATUS(state, status) {
state.loading = status
state.loading = status;
//更新全局loading状态
},
UPDATE_STATUS_VISIBLE(state, type) {
state.modalData[type].visible = !state.modalData[type].visible
state.modalData[type].visible = !state.modalData[type].visible;
},
UPDATE_FILTER_HOUSE_OPTION(state, type) {
state.filterOption[type].visible = !state.filterOption[type].visible
state.filterOption[type].visible = !state.filterOption[type].visible;
},
UPDATE_FILTER_OPTION_LIST(state, payload) {
state.filterOption[payload.type].options = payload.list;
......@@ -321,23 +321,23 @@ export default new Vuex.Store({
// })
},
SET_CURRENT_REGION_ID(state, payload) {
state.regionName = payload.name
state.regionName = payload.name;
state.regionId = payload.id;
},
SET_CURRENT_BUILDINGNUM(state, payload) {
state.buildNumName = payload.name
state.buildingNum = payload.id
state.buildNumName = payload.name;
state.buildingNum = payload.id;
},
SET_CURRENT_UNIT(state, payload) {
state.unitName = payload.name
state.unit = payload.id
state.unitName = payload.name;
state.unit = payload.id;
},
SET_CURRENT_FLOOR(state, payload) {
state.floorName = payload.name
state.floor = payload.id
state.floorName = payload.name;
state.floor = payload.id;
},
SET_CURRENT_HOUSEID(state, payload) {
state.houseCode = payload.name
state.houseCode = payload.name;
state.houseId = payload.id;
}
},
......
......@@ -53,42 +53,42 @@ export default {
},
actions: {
activityApplyList( { commit, state }, params) {
return api.request("get", api.getURL('activity/findUserActicity'), {
return api.request("get", api.getURL("activity/findUserActicity"), {
pn:1,
pageSize: 10000
}).then(res => {
commit('SET_APPLY_ACTIVITY_LIST', res.data.data.list)
commit("SET_APPLY_ACTIVITY_LIST", res.data.data.list);
return res;
})
});
},
cancelApply( { commit, state }, id) {
return api.request("get", api.getURL('activity/cancelApply'), {
return api.request("get", api.getURL("activity/cancelApply"), {
id,
}).then(res => {
return res;
})
});
},
deleteApply( { commit, state }, id) {
return api.request("get", api.getURL('activity/deleteApply'), {
return api.request("get", api.getURL("activity/deleteApply"), {
id,
}).then(res => {
if(res) {
res.Toast.success('活动删除成功')
res.Toast.success("活动删除成功");
}
return res;
})
});
},
addApplyOther( { commit, state, rootState }) {
state.activityForm = Object.assign({}, state.activityForm, state.applyActivityDetailInfo)
delete state.activityForm.id
return api.request("post", api.getURL('activity/addApply'), state.activityForm).then(res => {
state.activityForm = Object.assign({}, state.activityForm, state.applyActivityDetailInfo);
delete state.activityForm.id;
return api.request("post", api.getURL("activity/addApply"), state.activityForm).then(res => {
return res;
})
});
},
payAppyCostOnCAPP( { commit, state }, params) {
return api.request("post", api.getURL('activity/payAppyCostOnCAPP'), params).then(res => {
return api.request("post", api.getURL("activity/payAppyCostOnCAPP"), params).then(res => {
return res;
})
});
},
addApply({ commit, state, rootState }) {
state.activityForm = Object.assign({}, state.activityForm, state.communityActivityDetailInfo);
......@@ -101,18 +101,18 @@ export default {
state.activityForm.applicantHouseId = rootState.loginModule.loginInfo.cappUserInfo.houseId;
state.activityForm.applicantHouseName = rootState.loginModule.loginInfo.cappUserInfo.houseCode;
//console.log('state.activityForm', state.activityForm)
state.activityForm.platform = 1
state.activityForm.platform = 1;
return api.request("post", api.getURL("activity/addApply"), state.activityForm).then(res => {
return res;
})
});
},
findApplyDetail( { commit, state }, id) {
return api.request("get", api.getURL('activity/findApplyDetail'), {
return api.request("get", api.getURL("activity/findApplyDetail"), {
id,
}).then(res => {
commit("SET_APPLY_ACTIVITY_INFO", res.data.data);
return res;
})
});
},
getCommunityActivityInfo({ commit, state }, payload) {
// 社区活动列表
......@@ -148,7 +148,7 @@ export default {
Vue.set(state, "communityActivityDetailInfo", data);
},
SET_APPLY_ACTIVITY_LIST(state, data) {
console.log('activityList----', data)
console.log("activityList----", data);
Vue.set(state, "activityList", data);
},
SET_ACTIVITY_LIST_ADD_INFO(state, data) {
......@@ -164,13 +164,13 @@ export default {
Vue.set(state, "applyActivityDetailInfo", data);
},
CLEAN_NAME(state,data) {
state.activityForm.applicantName = ''
state.activityForm.applicantName = "";
},
CLEAN_PHONE(state,data) {
state.activityForm.applicantPhone = ''
state.activityForm.applicantPhone = "";
},
CLEAN_APPLY_NUM(state,data) {
state.activityForm.activityParticipants = 1
state.activityForm.activityParticipants = 1;
},
INTE_NEW_PAY_FORM(state,data){
state.newPayForm.billId = null,
......@@ -179,7 +179,7 @@ export default {
state.newPayForm.orderAmount = "",
state.newPayForm.orderTitle = "",
state.newPayForm.orderType = "",
state.newPayForm.remark = ""
state.newPayForm.remark = "";
}
},
getters: {}
......
......@@ -4,16 +4,16 @@ import api from "@/api/index.js";
export default {
namespaced: true,
state: {
title: '我是活动详情nice',
title: "我是活动详情nice",
detail: {
},
loading: false,
num : '1'
num : "1"
},
actions: {
fetchActivityDetail({ commit, state }, ids) {
console.log('fetchActivityDetail--->')
console.log("fetchActivityDetail--->");
// return api.request("get", api.getURL("houseLayout/delete"), {
// ids: ids.join(",")
// });
......@@ -22,10 +22,10 @@ export default {
return api.request("get", api.getURL("houseLayout/delete"), {
ids: ids.join(",")
}).then((res) => {
console.log('后端返回的数据', res)
commit('CHANGE_ACTIVITY_DETAIL', res)
console.log("后端返回的数据", res);
commit("CHANGE_ACTIVITY_DETAIL", res);
return res;
})
});
},
},
mutations: {
......@@ -36,7 +36,7 @@ export default {
state.detail = data;
},
CHANGE_TITLE_TXT(state) {
state.title = Date.now()
state.title = Date.now();
},
CHANGE_NUM(state) {
state.num ++;
......
......@@ -2,7 +2,7 @@
//9.复审不通过 10.待支付 11.待缴费 12.交易关闭 13.待退款 14.已退款 15.支付失效
import Vue from "vue";
import api from "@/api/index.js";
import store from '@/utils/store'
import store from "@/utils/store";
export default {
namespaced: true,
state: {
......@@ -15,9 +15,9 @@ export default {
education: "",
spousePhone: "",
spouseCardCode: "",
spouseSex: '1',
company:'',
regionId:''
spouseSex: "1",
company:"",
regionId:""
},
applyList: [],
applyDetail: {},
......@@ -28,19 +28,19 @@ export default {
depositForm:{
businessId:0,
orderAmount:0, 
orderTitle:'选房定金', 
orderTitle:"选房定金", 
orderType:4, 
remark:'', 
wxCode:''
remark:"", 
wxCode:""
}
},
actions: {
cancelApply( { commit, state }, id) {
return api.request("get", api.getURL('cAPPHouse/applyLiveCancel'), {
return api.request("get", api.getURL("cAPPHouse/applyLiveCancel"), {
id,
}).then(res => {
return res;
})
});
},
applyLiveDetail({ commit, state }, id) {
return api
......@@ -86,8 +86,8 @@ export default {
});
},
commitApply({ commit, state }, params) {
let imgs = state.applyInfo.liveProps
state.applyInfo = Object.assign({}, state.applyInfo, store('applyInfo'))
let imgs = state.applyInfo.liveProps;
state.applyInfo = Object.assign({}, state.applyInfo, store("applyInfo"));
state.applyInfo.applicantPhone = state.applyInfo.phone;
delete state.applyInfo.id;
delete state.applyInfo.flag;
......@@ -114,7 +114,7 @@ export default {
return api
.request("post", api.getURL("scanningPay/selHouseOrder"),depositForm)
.then(res => {
console.log('deposit-',res.data)
console.log("deposit-",res.data);
return res;
});
},
......@@ -130,19 +130,19 @@ export default {
mutations: {
INIT_DATA_STATUS(state, data) {},
SET_APPLY_OCCUPATION(state, data) {
state.applyInfo.occupation = data
state.applyInfo.occupation = data;
},
SET_APPLY_EDUCATION(state, data) {
state.applyInfo.education = data
state.applyInfo.education = data;
},
SET_APPLY_REGIONID(state, data) {
state.applyInfo.regionId = data
state.applyInfo.regionId = data;
},
SET_APPLY_INFO(state, data) {
let loginInfo = store('login')
let loginInfo = store("login");
state.applyInfo = Object.assign({}, state.applyInfo, data);
if(!state.applyInfo.userName) {
state.applyInfo.userName = loginInfo.zhName
state.applyInfo.userName = loginInfo.zhName;
}
console.log("state.applyInfo-->", state.applyInfo);
},
......@@ -155,13 +155,13 @@ export default {
spouseName: "",
spousePhone: "",
spouseCardCode: "",
spouseSex: '1',
regionId:''
}
spouseSex: "1",
regionId:""
};
},
ADD_IMG_INFO(state, data) {
state.applyInfo.liveProps.push(data);
console.log('state.applyInfo.liveProps--',state.applyInfo.liveProps)
console.log("state.applyInfo.liveProps--",state.applyInfo.liveProps);
},
REMOVE_IMG_INFO(state, url) {
let targetIndex = 0;
......@@ -177,13 +177,13 @@ export default {
},
CHANGE_APPLY_DETAIL_STATUS(state, status) {
state.applyDetail.status = 8;
state.applyDetail.cancelTime = Date.now()
state.applyDetail.cancelTime = Date.now();
},
SET_APPLY_DETAIL(state, data) {
Vue.set(state, "applyDetail", data);
},
SET_APPLY_MARRYSTATUS(state, data) {
state.applyInfo.marryStatus = data
state.applyInfo.marryStatus = data;
}
},
getters: {}
......
......@@ -36,12 +36,12 @@ export default {
if(res) {
//console.log(res.data)
commit('SET_CURRENT_BILL_INFO', res.data.data)
commit("SET_CURRENT_BILL_INFO", res.data.data);
state.payForm.billId = res.data.data.id;
state.payForm.mustGetMoney = res.data.data.mustGetMoney;
}else {
//console.log('未绑定房源20000')
commit('SET_CURRENT_BILL_INFO', '')
commit("SET_CURRENT_BILL_INFO", "");
}
return res;
});
......@@ -62,7 +62,7 @@ export default {
// }
// })
//console.log(state.billList)
commit('SET_ALL_BILL_INFO', res.data.data)
commit("SET_ALL_BILL_INFO", res.data.data);
}
return res;
});
......@@ -73,12 +73,12 @@ export default {
).then(res => {
//console.log(res.data)
if(res) {
commit('SET_USER_BILL_DETAIL_INFO', res.data.data)
commit("SET_USER_BILL_DETAIL_INFO", res.data.data);
state.payForm.billId = res.data.data.id;
state.payForm.mustGetMoney = res.data.data.mustGetMoney;
}else {
//console.log('未绑定房源20000')
commit('SET_USER_BILL_DETAIL_INFO', '')
commit("SET_USER_BILL_DETAIL_INFO", "");
}
return res;
});
......@@ -124,29 +124,29 @@ export default {
},
mutations: {
SET_CURRENT_BILL_INFO(state, data) {
Vue.set(state,'userCurrentBillInfo',data)
Vue.set(state,"userCurrentBillInfo",data);
},
SET_USER_BILL_DETAIL_INFO(state, data) {
Vue.set(state,'userBillDetailInfo',data)
Vue.set(state,"userBillDetailInfo",data);
},
SET_COUPON_PRICE(state,data) {
Vue.set(state,'couponPrice',data)
Vue.set(state,"couponPrice",data);
},
SET_ALL_BILL_INFO(state,data) {
Vue.set(state,'allBillListInfo',data)
Vue.set(state,"allBillListInfo",data);
},
SET_COUPON_FEE(state,payMinus) {
state.payForm.payMinus = payMinus
state.payForm.payMinus = payMinus;
},
SET_COUPON_ID(state,couponId) {
state.payForm.couponId = couponId
state.payForm.couponId = couponId;
},
SET_ACTUALGETMONEY(state, actualGetMoney){
state.payForm.actualGetMoney = actualGetMoney
state.payForm.actualGetMoney = actualGetMoney;
},
CLEAN_COUPONPRICE(state, couponPrice) {
state.couponPrice = 0
state.couponPrice = 0;
},
INTE_NEW_PAY_FORM(state,data){
state.newPayForm.billId = null,
......@@ -155,7 +155,7 @@ export default {
state.newPayForm.orderAmount = "",
state.newPayForm.orderTitle = "",
state.newPayForm.orderType = "",
state.newPayForm.remark = ""
state.newPayForm.remark = "";
}
......
......@@ -5,31 +5,31 @@ import store from "@/utils/store.js";
export default {
namespaced: true,
state: {
info: store('bindHouseInfo'),
houseInfo: store('houseInfo'),
info: store("bindHouseInfo"),
houseInfo: store("houseInfo"),
myInfo: {
}
},
actions: {
checkLiveWith( { commit, state }, id) {
return api.request("get", api.getURL('cAPPHouse/checkLiveWith'), {
return api.request("get", api.getURL("cAPPHouse/checkLiveWith"), {
id
}).then(res => {
return res;
})
});
},
deleteLiveWith( { commit, state }, id) {
return api.request("get", api.getURL('cAPPHouse/deleteLiveWith'), {
return api.request("get", api.getURL("cAPPHouse/deleteLiveWith"), {
id,
}).then(res => {
return res;
})
});
},
outBindHouse( { commit, state }, params) {
return api.request("get", api.getURL('customer/outBindHouse')).then(res => {
return api.request("get", api.getURL("customer/outBindHouse")).then(res => {
return res;
})
});
},
bindHouseFirst({ commit, state }, userInfo) {
return api.request("post", api.getURL("customer/bindHouseFirst"), userInfo).then(res => {
......@@ -43,16 +43,16 @@ export default {
}).then(res => {
//commit('INIT_BIND_HOUSE_INFO', res.data.data)
return res;
})
});
},
viewHouseInfo( { commit, state, rootState }, params) {
return api.request("get", api.getURL('customer/myHouseInfo')).then(res => {
return api.request("get", api.getURL("customer/myHouseInfo")).then(res => {
if(res) {
commit('INIT_SELF_INFO', res.data.data)
rootState.loginModule.loginInfo.cappUserInfo = res.data.data
commit("INIT_SELF_INFO", res.data.data);
rootState.loginModule.loginInfo.cappUserInfo = res.data.data;
}
return res;
})
});
}
},
mutations: {
......@@ -60,19 +60,19 @@ export default {
},
INIT_BIND_HOUSE_INFO(state, data) {
data.houseInfo.normalStartTime = new Date(data.houseInfo.liveStartTime).Format('yyyy/MM/dd')
data.houseInfo.normalEndTime = new Date(data.houseInfo.liveEndTime).Format('yyyy/MM/dd')
data.houseInfo.normalStartTime = new Date(data.houseInfo.liveStartTime).Format("yyyy/MM/dd");
data.houseInfo.normalEndTime = new Date(data.houseInfo.liveEndTime).Format("yyyy/MM/dd");
//console.log('data.houseInfo.normalEndTime-->', data.houseInfo.normalEndTime)
data.houseInfo.outputDate = data.houseInfo.normalStartTime + ' - ' + data.houseInfo.normalEndTime
data.houseInfo.outputDate = data.houseInfo.normalStartTime + " - " + data.houseInfo.normalEndTime;
data.houseInfo.fullName = `${data.houseInfo.regionName} ${data.houseInfo.houseCode.slice(0, 2)}${data.houseInfo.houseCode.slice(2)}`
Vue.set(state, 'info', data)
Vue.set(state, 'houseInfo', data.houseInfo)
store('houseInfo', data.houseInfo)
store('bindHouseInfo', data)
data.houseInfo.fullName = `${data.houseInfo.regionName} ${data.houseInfo.houseCode.slice(0, 2)}${data.houseInfo.houseCode.slice(2)}`;
Vue.set(state, "info", data);
Vue.set(state, "houseInfo", data.houseInfo);
store("houseInfo", data.houseInfo);
store("bindHouseInfo", data);
},
INIT_SELF_INFO(state, data) {
Vue.set(state, 'myInfo', data)
Vue.set(state, "myInfo", data);
}
},
getters: {}
......
import Vue from "vue";
import api from "@/api/index.js";
import { Toast } from 'vant';
import { Toast } from "vant";
export default {
namespaced: true,
......@@ -11,22 +11,22 @@ export default {
findpage({ commit, state }, commonProblem) {
return api.request("get", api.getURL("CommonProblem/cfindpage"), commonProblem).then(res => {
if(res) {
commit('SET_PROBLEM_LIST', res.data.data.list)
commit("SET_PROBLEM_LIST", res.data.data.list);
}else {
setTimeout(() => {
Toast.fail('未登录')
}, 500)
Toast.fail("未登录");
}, 500);
}
return res;
});
},
getDetails({commit,state},details){
return api.request('get',api.getURL('CommonProblem/cgetDetails'),{
return api.request("get",api.getURL("CommonProblem/cgetDetails"),{
id:details
}).then(res =>{
console.log('sssss',res)
console.log("sssss",res);
return res;
})
});
}
},
mutations: {
......@@ -34,8 +34,8 @@ export default {
},
SET_PROBLEM_LIST(state, data) {
console.log('---list', data)
Vue.set(state, 'commonProblemList', data)
console.log("---list", data);
Vue.set(state, "commonProblemList", data);
}
},
getters: {}
......
......@@ -14,18 +14,18 @@ export default {
actions: {
getCouponDetailInfo({ commit, state }, payload) { // 优惠券详情
return api.request("get", api.getURL("coupon/findCouponDetails"), payload).then(res => {
commit('SET_LOADING_FLAG',false)
commit('SET_DISABLE_FLAG',false)
commit("SET_LOADING_FLAG",false);
commit("SET_DISABLE_FLAG",false);
if(res) {
commit('SET_COUPON_DETAIL_INFO',res.data.data)
if(res.data.data.getStatus == 0) {
state.couponDetailInfo.couponButton = '领取优惠券'
}else if(res.data.data.getStatus == 1) {
state.couponDetailInfo.couponButton = '未到领用时间'
}else if(res.data.data.getStatus == 2) {
state.couponDetailInfo.couponButton = '已经过期'
}else if(res.data.data.getStatus == 3) {
state.couponDetailInfo.couponButton = '已领完'
commit("SET_COUPON_DETAIL_INFO",res.data.data);
if(res.data.data.getStatus === 0) {
state.couponDetailInfo.couponButton = "领取优惠券";
}else if(res.data.data.getStatus === 1) {
state.couponDetailInfo.couponButton = "未到领用时间";
}else if(res.data.data.getStatus === 2) {
state.couponDetailInfo.couponButton = "已经过期";
}else if(res.data.data.getStatus === 3) {
state.couponDetailInfo.couponButton = "已领完";
}
}
return res;
......@@ -33,13 +33,13 @@ export default {
},
getCoupon({ commit, state }, payload) { // 领取优惠券
return api.request("get", api.getURL("coupon/userGetCoupon"), payload).then(res => {
commit('SET_LOADING_FLAG',false)
commit('SET_DISABLE_FLAG',true)
commit("SET_LOADING_FLAG",false);
commit("SET_DISABLE_FLAG",true);
if(res) {
res.Toast.success({
duration: 1000,
message: '领取成功'
message: "领取成功"
});
......@@ -53,9 +53,9 @@ export default {
return api.request("get", api.getURL("coupon/findUsersCoupons"), payload).then(res => {
//console.log('res--',res.data.data.list)
if(res) {
commit('SET_COUPON_LIST_ADD_INFO',res.data.data.list)
commit("SET_COUPON_LIST_ADD_INFO",res.data.data.list);
}else {
commit('SET_COUPON_LIST_ADD_INFO',[])
commit("SET_COUPON_LIST_ADD_INFO",[]);
}
return res;
......@@ -64,16 +64,16 @@ export default {
},
mutations: {
SET_COUPON_DETAIL_INFO(state,data) {
Vue.set(state,'couponDetailInfo',data)
Vue.set(state,"couponDetailInfo",data);
},
SET_MY_GET_COUPON_INFO(state,data) {
Vue.set(state,'myGetCouponInfo',data)
Vue.set(state,"myGetCouponInfo",data);
},
SET_USE_COUPON_INFO(state,data) {
Vue.set(state,'userCouponList',data)
Vue.set(state,"userCouponList",data);
},
SET_COUPON_LIST_ADD_INFO(state, data) {
Vue.set(state,'myGetCouponListInfo',data)
Vue.set(state,"myGetCouponListInfo",data);
// data.map(item => {
// state.myGetCouponListInfo.push(item)
// })
......@@ -82,10 +82,10 @@ export default {
//state.homeProjectListInfo = [...state.homeProjectListInfo, ...data]
},
SET_LOADING_FLAG(state,data) {
Vue.set(state,'loadingFlag',data)
Vue.set(state,"loadingFlag",data);
},
SET_DISABLE_FLAG(state,data) {
Vue.set(state,'disable',data)
Vue.set(state,"disable",data);
}
},
......
......@@ -10,7 +10,7 @@ export default {
remoteOpen({ commit, state }, payload) { //智能门开锁
return api.request("get", api.getURL("device/remoteOpen"),payload).then(res => {
return res;
})
});
},
},
mutations: {
......
......@@ -81,7 +81,7 @@ export default {
status: 0,
systomInfo: "",
version: ""
}
};
},
CLEAR_COMPLAIN_INFO(state) {
state.complainInfo = {
......@@ -94,7 +94,7 @@ export default {
id: 0,
remark: "",
suggestProps: []
}
};
},
INIT_DATA_STATUS(state, data) {},
ADD_IMG_INFO(state, files) {
......
......@@ -16,7 +16,7 @@ export default {
return api.request("get", api.getURL("Region/findMoreRegions"), payload).then(res => {
//
if(res) {
commit('SET_HOME_PROJECT_LIST_INFO', res.data.data.list)
commit("SET_HOME_PROJECT_LIST_INFO", res.data.data.list);
}
return res;
});
......@@ -30,12 +30,12 @@ export default {
if(res) {
//console.log(res.data.data.list)
if(res.data.data.list.length === 1) {
res.data.data.list.push(res.data.data.list[0],res.data.data.list[0])
res.data.data.list.push(res.data.data.list[0],res.data.data.list[0]);
}
if(res.data.data.list.length === 2) {
res.data.data.list.push(res.data.data.list[0])
res.data.data.list.push(res.data.data.list[0]);
}
commit('SET_HOME_LAYOUT_LIST_INFO', res.data.data.list)
commit("SET_HOME_LAYOUT_LIST_INFO", res.data.data.list);
}
return res;
});
......@@ -47,18 +47,18 @@ export default {
},
SET_HOME_PROJECT_LIST_ADD_INFO(state, data) {
data.map(item => {
state.homeAddList.push(item)
})
state.homeAddList.push(item);
});
//state.homeProjectListInfo = state.homeProjectListInfo.concat(data)
console.log('state.homeProjectListInfo.length', state.homeAddList.length)
console.log("state.homeProjectListInfo.length", state.homeAddList.length);
//state.homeProjectListInfo = [...state.homeProjectListInfo, ...data]
},
SET_HOME_PROJECT_LIST_INFO(state, data) {
//[1,2,3] = [4,5,6]
Vue.set(state, 'homeProjectListInfo', data)
Vue.set(state, "homeProjectListInfo", data);
},
SET_HOME_LAYOUT_LIST_INFO(state, data) {
Vue.set(state, 'homeLayoutListInfo', data)
Vue.set(state, "homeLayoutListInfo", data);
}
},
......
......@@ -33,9 +33,9 @@ export default {
if(res) {
//
if(payload.type === 1) {
commit('SET_COLLECTION_REGION_INFO', res.data.data.list)
commit("SET_COLLECTION_REGION_INFO", res.data.data.list);
}else {
commit('SET_COLLECTION_LAYOUT_INFO', res.data.data.list)
commit("SET_COLLECTION_LAYOUT_INFO", res.data.data.list);
}
}
......@@ -49,10 +49,10 @@ export default {
},
SET_COLLECTION_REGION_INFO(state, data) {
Vue.set(state,"collectionRegionInfo",data)
Vue.set(state,"collectionRegionInfo",data);
},
SET_COLLECTION_LAYOUT_INFO(state, data) {
Vue.set(state,"collectionLayoutInfo",data)
Vue.set(state,"collectionLayoutInfo",data);
}
......
......@@ -13,27 +13,27 @@ export default {
if(res) {
res.data.data.imgList = res.data.data.props.filter(item => {
if(item.propCode == 'showImage') {
if(item.propCode === "showImage") {
return true;
}
})
});
res.data.data.supList = res.data.data.props.filter(item => {
if(item.propCode == 'suppo') {
if(item.propCode === "suppo") {
return true;
}
})
});
res.data.data.regionToggle = true;
if(res.data.data.collectionId != null) {
if(res.data.data.collectionId !== null) {
res.data.data.regionToggle = false;
}
if(res.data.data.layoutListPos.length === 1) {
res.data.data.layoutListPos.push(res.data.data.layoutListPos[0],res.data.data.layoutListPos[0])
res.data.data.layoutListPos.push(res.data.data.layoutListPos[0],res.data.data.layoutListPos[0]);
}
if(res.data.data.layoutListPos.length === 2) {
res.data.data.layoutListPos.push(res.data.data.layoutListPos[0])
res.data.data.layoutListPos.push(res.data.data.layoutListPos[0]);
}
//
commit('SET_PROJECT_DETAIL_INFO_INFO', res.data.data)
commit("SET_PROJECT_DETAIL_INFO_INFO", res.data.data);
}
return res;
});
......@@ -43,22 +43,22 @@ export default {
if(res) {
res.data.data.imgList = res.data.data.prop.filter(item => {
if(item.propCode == 'showImg') {
if(item.propCode === "showImg") {
return true;
}
})
});
res.data.data.supList = res.data.data.prop.filter(item => {
if(item.propCode == 'suppo') {
if(item.propCode === "suppo") {
return true;
}
})
});
//
res.data.data.layoutToggle = true;
if(res.data.data.collectionId != null) {
if(res.data.data.collectionId !== null) {
res.data.data.layoutToggle = false;
}
commit('SET_HOUSE_DETAIL_INFO_INFO', res.data.data)
commit("SET_HOUSE_DETAIL_INFO_INFO", res.data.data);
}
return res;
......@@ -71,10 +71,10 @@ export default {
},
SET_PROJECT_DETAIL_INFO_INFO(state, data) {
Vue.set(state, 'projectDetailInfo', data)
Vue.set(state, "projectDetailInfo", data);
},
SET_HOUSE_DETAIL_INFO_INFO(state, data){
Vue.set(state, 'houseDetailInfo', data)
Vue.set(state, "houseDetailInfo", data);
}
},
......
......@@ -11,39 +11,39 @@ export default {
selectListPriceInfo: [
{
price_id:0,
name:'不限'
name:"不限"
},
{
price_id:1,
name:'500元以下'
name:"500元以下"
},
{
price_id:2,
name:'500-1000元'
name:"500-1000元"
},
{
price_id:3,
name:'1000-1500元'
name:"1000-1500元"
},
{
price_id:4,
name:'1500-2000元'
name:"1500-2000元"
},
{
price_id:5,
name:'2000-2500元'
name:"2000-2500元"
},
{
price_id:6,
name:'2500-3000元'
name:"2500-3000元"
},
{
price_id:7,
name:'3000-3500元'
name:"3000-3500元"
},
{
price_id:8,
name:'3500-4000元'
name:"3500-4000元"
}
],
},
......@@ -53,7 +53,7 @@ export default {
if(res) {
//
commit('SET_LAYOUT_REGION_SELECT_INFO', res.data.data)
commit("SET_LAYOUT_REGION_SELECT_INFO", res.data.data);
}
return res;
});
......@@ -63,7 +63,7 @@ export default {
if(res) {
//
commit('SET_LAYOUT_AREA_SELECT_INFO', res.data.data)
commit("SET_LAYOUT_AREA_SELECT_INFO", res.data.data);
}
return res;
});
......@@ -73,7 +73,7 @@ export default {
if(res) {
//
commit('SET_LAYOUT_HOUSE_TYPE_SELECT_INFO', res.data.data)
commit("SET_LAYOUT_HOUSE_TYPE_SELECT_INFO", res.data.data);
}
return res;
});
......@@ -82,7 +82,7 @@ export default {
return api.request("get", api.getURL("houseLayout/findAllOnCApp"), payload).then(res => {
//
if(res) {
commit('SET_HOME_LAYOUT_LIST_INFO', res.data.data.list)
commit("SET_HOME_LAYOUT_LIST_INFO", res.data.data.list);
}
return res;
});
......@@ -95,40 +95,40 @@ export default {
},
SET_LAYOUT_REGION_SELECT_INFO(state, data) { //项目下拉数据
Vue.set(state,"selectListRegionInfo",data)
Vue.set(state,"selectListRegionInfo",data);
},
SET_LAYOUT_AREA_SELECT_INFO(state,data) { //地区下拉数据
Vue.set(state,"selectListAreaInfo",data)
Vue.set(state,"selectListAreaInfo",data);
},
SET_LAYOUT_HOUSE_TYPE_SELECT_INFO(state,data) { //户型下拉数据
Vue.set(state,"selectListHouseTypeInfo",data)
Vue.set(state,"selectListHouseTypeInfo",data);
},
REGION_MARK_SELECTED_ITEM(state, curIndex) { //先清空选中状态,后设置选中状态
state.selectListRegionInfo.map(item => {
item.selected = false;
})
state.selectListRegionInfo[curIndex].selected = true
});
state.selectListRegionInfo[curIndex].selected = true;
},
PRICE_MARK_SELECTED_ITEM(state, curIndex) {
state.selectListPriceInfo.map(item => {
item.selected = false;
})
state.selectListPriceInfo[curIndex].selected = true
});
state.selectListPriceInfo[curIndex].selected = true;
},
AREA_MARK_SELECTED_ITEM(state, curIndex) {
state.selectListAreaInfo.map(item => {
item.selected = false;
})
state.selectListAreaInfo[curIndex].selected = true
});
state.selectListAreaInfo[curIndex].selected = true;
},
HOUSE_MARK_SELECTED_ITEM(state, curIndex) {
state.selectListHouseTypeInfo.map(item => {
item.selected = false;
})
state.selectListHouseTypeInfo[curIndex].selected = true
});
state.selectListHouseTypeInfo[curIndex].selected = true;
},
SET_HOME_LAYOUT_LIST_INFO(state, data) {
Vue.set(state, 'homeLayoutListInfo', data)
Vue.set(state, "homeLayoutListInfo", data);
}
......
......@@ -4,7 +4,7 @@ import api from "@/api/index.js";
export default {
namespaced: true,
state: {
house:'',
house:"",
regionId: null,
layoutId: null,
buildingNum: null,
......@@ -30,14 +30,14 @@ export default {
data: {
data: state.regionColums
}
}
};
}
return api.request("get", api.getURL("houseSailWebsite/listRegion"), payload).then(res => {
if(res) {
//
console.log(res.data.data)
commit('SET_REGION_LIST', res.data.data)
console.log(res.data.data);
commit("SET_REGION_LIST", res.data.data);
}
return res;
});
......@@ -49,27 +49,27 @@ export default {
//
if(res) {
//
commit('SET_LAYOUT_LIST', res.data.data)
commit("SET_LAYOUT_LIST", res.data.data);
}
return res;
});
},
getBuildingNum( { commit, state }) {
return api.request("get", api.getURL('cAPPHouse/buildingNumsNotRent'), {
return api.request("get", api.getURL("cAPPHouse/buildingNumsNotRent"), {
pn: 1,
pageSize: 30000,
regionId: state.regionId,
layoutId: state.layoutId
}).then(res => {
if(res && res.data.data.list.length > 0) {
commit('SET_CURRENT_BUILDINGNUM', res.data.data.list[0].buildingNum)
commit("SET_CURRENT_BUILDINGNUM", res.data.data.list[0].buildingNum);
}
commit('SET_BUILD_NUMS', res.data.data.list)
commit("SET_BUILD_NUMS", res.data.data.list);
return res;
})
});
},
getUnit( { commit, state }) {
return api.request("get", api.getURL('cAPPHouse/unitsNotRent'), {
return api.request("get", api.getURL("cAPPHouse/unitsNotRent"), {
pn: 1,
pageSize: 30000,
regionId: state.regionId,
......@@ -77,14 +77,14 @@ export default {
buildingNum: state.buildingNum
}).then(res => {
if(res && res.data.data.list.length > 0) {
commit('SET_CURRENT_UNIT', res.data.data.list[0].unit)
commit("SET_CURRENT_UNIT", res.data.data.list[0].unit);
}
commit('SET_UNIT_NUMS', res.data.data.list)
commit("SET_UNIT_NUMS", res.data.data.list);
return res;
})
});
},
getHouseList( { commit, state }, params) {
return api.request("get", api.getURL('cAPPHouse/housesNotRent'), {
return api.request("get", api.getURL("cAPPHouse/housesNotRent"), {
pn: params.currentPage,
pageSize: 10,
regionId: state.regionId,
......@@ -93,20 +93,20 @@ export default {
unit: state.unit
}).then(res => {
if(res && res.data.data.list.length > 0 && !params.isScroll) {
commit('SET_HOUSE_DETAIL', res.data.data.list[0])
commit("SET_HOUSE_DETAIL", res.data.data.list[0]);
}
if(params.isScroll) {
commit('SET_SCROLL_HOUSE_LIST', res.data.data.list)
commit("SET_SCROLL_HOUSE_LIST", res.data.data.list);
}else {
commit('SET_HOUSE_LIST', res.data.data.list)
commit("SET_HOUSE_LIST", res.data.data.list);
}
return res;
})
});
},
chooseHouseCommit( { commit, state, rootState }, params) {
return api.request("post", api.getURL('cAPPHouse/newchooseHouseCommit'), params).then(res => {
return api.request("post", api.getURL("cAPPHouse/newchooseHouseCommit"), params).then(res => {
return res;
})
});
}
},
mutations: {
......@@ -116,61 +116,61 @@ export default {
SET_REGION_LIST(state, list) {
list.map(item => {
item.text = item.name;
})
Vue.set(state, 'regionColums', list)
});
Vue.set(state, "regionColums", list);
},
SET_LAYOUT_LIST(state, list) {
//console.log('list-->', list)
list.map(item => {
item.text = item.layoutName
})
Vue.set(state, 'layoutColums', list)
item.text = item.layoutName;
});
Vue.set(state, "layoutColums", list);
},
SET_CURRENT_REGION_ID(state, id) {
Vue.set(state, 'regionId', id)
Vue.set(state, "regionId", id);
},
SET_CURRENT_LAYOUT_ID(state, id) {
Vue.set(state, 'layoutId', id)
Vue.set(state, "layoutId", id);
},
SET_BUILD_NUMS(state, list) {
list.map(item => {
item.buildingNumText = item.buildingNum + '栋'
})
Vue.set(state, 'buildNums', list)
item.buildingNumText = item.buildingNum + "栋";
});
Vue.set(state, "buildNums", list);
},
SET_UNIT_NUMS(state, list) {
list.map(item => {
item.unitText = item.unit + '单元'
})
Vue.set(state, 'units', list)
item.unitText = item.unit + "单元";
});
Vue.set(state, "units", list);
},
SET_CURRENT_BUILDINGNUM(state, num) {
Vue.set(state, 'buildingNum', num)
Vue.set(state, "buildingNum", num);
},
SET_CURRENT_UNIT(state, unit) {
Vue.set(state, 'unit', unit)
Vue.set(state, "unit", unit);
},
SET_SCROLL_HOUSE_LIST(state, list) {
list.map(item => {
state.houseList.push(item)
})
state.houseList.push(item);
});
},
SET_HOUSE_LIST(state, list) {
Vue.set(state, 'houseList', list)
Vue.set(state, "houseList", list);
},
CLEAR_HOUSE_LIST(state,data) {
state.houseList = []
state.houseList = [];
},
CLEAR_BUILDNUMS(state,data) {
state.buildNums = []
state.buildNums = [];
},
CLEAR_UNINTS(state,data) {
state.units = []
state.units = [];
},
SET_HOUSE_DETAIL(state, house) {
Vue.set(state, 'houseDetail', house)
Vue.set(state, "houseDetail", house);
}
},
getters: {}
......
......@@ -8,7 +8,7 @@ export default {
imgTab: [],
sampleRoomDetail: {
tabMap: {
'厨房': {
"厨房": {
list: []
}
}
......@@ -20,17 +20,17 @@ export default {
pn: 1,
pageSize: 100000
}).then(res => {
commit('SET_SAMPE_ROOM_LISE', res.data.data.list)
commit("SET_SAMPE_ROOM_LISE", res.data.data.list);
return res;
})
});
},
findModelDetail( { commit, state }, id) {
return api.request("get", api.getURL('houseLayout/findModelDetail'), {
return api.request("get", api.getURL("houseLayout/findModelDetail"), {
id
}).then(res => {
commit('SET_SAMPLE_ROOM_DETAIL', res.data.data)
commit("SET_SAMPLE_ROOM_DETAIL", res.data.data);
return res;
})
});
}
},
mutations: {
......@@ -42,34 +42,34 @@ export default {
if(item.houselayouts) {
return true;
}
})
console.log('ListRoom-->', ListRoom)
Vue.set(state, 'sampleRoomList', ListRoom)
});
console.log("ListRoom-->", ListRoom);
Vue.set(state, "sampleRoomList", ListRoom);
},
SET_SAMPLE_ROOM_DETAIL(state, data) {
data.tabMap = {
};
data.prop.map(item => {
if(item.propCode === 'Sample-room') {
item.name = item.propName.slice(4)
if(item.propCode === "Sample-room") {
item.name = item.propName.slice(4);
if(!data.tabMap[item.name]) {
data.tabMap[item.name] = {
list: []
}
};
//data.tabMap[item.name].list = []
}
data.tabMap[item.name].list.push(item)
data.tabMap[item.name].list.push(item);
}
})
});
state.imgTab = [];
for(let key in data.tabMap) {
state.imgTab.push({
list: data.tabMap[key].list
})
});
}
console.log('state.imgTab', state.imgTab)
Vue.set(state, 'sampleRoomDetail', data)
console.log("state.imgTab", state.imgTab);
Vue.set(state, "sampleRoomDetail", data);
}
},
getters: {}
......
import Vue from "vue";
import api from "@/api/index.js";
import {Toast} from 'vant';
import store from '@/utils/store';
import {Toast} from "vant";
import store from "@/utils/store";
export default {
namespaced: true,
state: {
loginInfo: store('login')
loginInfo: store("login")
},
actions: {
wxPoneLoginCallBack({ commit, state }, params) {
console.log('state.loginInfo.phone', state.loginInfo.phone)
console.log("state.loginInfo.phone", state.loginInfo.phone);
if(state.loginInfo.phone) {
return;
}
Toast.loading({
duration: 0, // continuous display toast
forbidClick: true, // forbid click background
loadingType: 'spinner',
message: '正在加载登录信息...'
})
return api.request("get", api.getURL('system/wxPoneLoginCallBack'), {
loadingType: "spinner",
message: "正在加载登录信息..."
});
return api.request("get", api.getURL("system/wxPoneLoginCallBack"), {
code: params.code,
state: params.state
}).then(res => {
Toast.clear();
//console.log('lll-->res', res.data.code, res)
if(res && res.data.code === 10000) {
commit('INIT_LOGIN_INFO', res.data.data) //初始化登陆信息
commit("INIT_LOGIN_INFO", res.data.data); //初始化登陆信息
}
return res;
})
});
},
wxPoneLoginInfo( { commit, state }, params) {
console.log('state.loginInfo.phone', state.loginInfo)
console.log("state.loginInfo.phone", state.loginInfo);
if(state.loginInfo.phone) {
return;
}
return api.request("get", api.getURL('system/wxPoneLoginInfo')).then(res => {
return api.request("get", api.getURL("system/wxPoneLoginInfo")).then(res => {
//console.log('lll-->res', res.data.code)
if(res && res.data.code === 10000) {
commit('INIT_LOGIN_INFO', res.data.data) //初始化登陆信息
commit("INIT_LOGIN_INFO", res.data.data); //初始化登陆信息
}
return res;
})
});
},
wxLoginInfo( { commit, state }, code) {
if(state.loginInfo.phone) {
return;
}
return api.request("get", api.getURL('system/wxLoginInfo'), {
return api.request("get", api.getURL("system/wxLoginInfo"), {
code: code
}).then(res => {
if(res && res.data.code === 10000) {
commit('INIT_LOGIN_INFO', res.data.data) //初始化登陆信息
commit("INIT_LOGIN_INFO", res.data.data); //初始化登陆信息
}
return res;
})
});
},
wxLogin( { commit, state }) {
return api.request("get", api.getURL('system/wxLogin'), {
toUrl: 'wx/index.html'
return api.request("get", api.getURL("system/wxLogin"), {
toUrl: "wx/index.html"
}).then(res => {
console.log('wxLogin------->', res)
console.log("wxLogin------->", res);
return res;
})
});
},
submitPassword( { commit, state }, params) {
return api.request("post", api.getURL('customer/updatePasswordthird'), params).then(res => {
return api.request("post", api.getURL("customer/updatePasswordthird"), params).then(res => {
return res;
})
});
},
submitForgetPhoneCode( { commit, state }, info) {
//console.log('忘记提交验证')
return api.request("post", api.getURL('customer/updatePasswordSecond'), info).then(res => {
return api.request("post", api.getURL("customer/updatePasswordSecond"), info).then(res => {
return res;
})
});
},
sendForgetCode( { commit, state }, phone) {
return api.request("get", api.getURL('customer/updatePasswordSms'), {
return api.request("get", api.getURL("customer/updatePasswordSms"), {
phone,
}).then(res => {
return res;
})
});
},
sendLogin({ commit, state, dispatch }, loginInfo) {
// let lastPage = store('lastPage')
......@@ -101,11 +101,14 @@ export default {
return api.request("post", api.getURL("system/login"), loginInfo).then(res => {
if(res) {
store('hasLogout', false)
commit('INIT_LOGIN_INFO', res.data.data) //初始化登陆信息
//location.href = res.data.data
// dispatch('wxPoneLoginInfo').then(over => {
// })
store("hasLogout", false);
commit("INIT_LOGIN_INFO", res.data.data); //初始化登陆信息
}
return res
})
return res;
});
},
sendLogout({ commit, state }) {
return api
......@@ -115,25 +118,25 @@ export default {
});
},
sendRegister({ commit, state }, payload) {
payload.toUrl = "wx/index.html#/bindHouseCheck"
payload.toUrl = "wx/index.html#/bindHouseCheck";
return api
.request("post", api.getURL("customer/register"), payload)
.then(res => {
if(res) {
location.href = res.data.data
location.href = res.data.data;
}
return res;
});
},
sendVerficationCode( { commit, state }, code) {
return api.request("get", api.getURL('customer/smsverification'), {
return api.request("get", api.getURL("customer/smsverification"), {
mobileNumber: code
}).then(res => {
if(res) {
Toast.success('验证码发送成功')
Toast.success("验证码发送成功");
}
return res;
})
});
}
},
mutations: {
......@@ -142,10 +145,10 @@ export default {
},
INIT_LOGIN_INFO(state, data) {
if(!data.cappUserInfo) {
data.cappUserInfo = {}
data.cappUserInfo = {};
}
store('login', data) //设置浏览器缓存 localStorage
Vue.set(state, 'loginInfo', data)
store("login", data); //设置浏览器缓存 localStorage
Vue.set(state, "loginInfo", data);
},
INIT_LOGIN_NAME_CART(state, data) {
state.loginInfo = Object.assign({}, state.loginInfo, {
......@@ -153,40 +156,40 @@ export default {
cappUserInfo: {
userName: null
}
})
store('login', state.loginInfo)
});
store("login", state.loginInfo);
},
CHANGE_NICK_NAME(state, name) {
state.loginInfo.nickname = name
store('login', state.loginInfo)
state.loginInfo.nickname = name;
store("login", state.loginInfo);
},
CLEAR_LOGIN_INFO(state) {
state.loginInfo = {
cappUserInfo: {
}
}
store('login', {
};
store("login", {
cappUserInfo: {
}
})
});
},
CLEAR_LOGIN_HOUSE_INFO(state) {
state.loginInfo.cappUserInfo = {}
store('login', state.loginInfo)
state.loginInfo.cappUserInfo = {};
store("login", state.loginInfo);
},
SET_LOGIN_HOUSE_INFO(state, data) {
state.loginInfo.cappUserInfo = data
store('login', state.loginInfo)
state.loginInfo.cappUserInfo = data;
store("login", state.loginInfo);
},
SET_LOGIN_HEADE_IMG(state, url) {
state.loginInfo.headImg = url
store('login', state.loginInfo)
state.loginInfo.headImg = url;
store("login", state.loginInfo);
},
updateUserInfo(state, data) {
state.loginInfo = Object.assign({}, state.loginInfo, data)
store('login', state.loginInfo)
state.loginInfo = Object.assign({}, state.loginInfo, data);
store("login", state.loginInfo);
}
},
getters: {}
......
orderStore.js
\ No newline at end of file
orderStore.js;
\ No newline at end of file
......@@ -9,7 +9,7 @@ export default {
actions: {
updatePassword({ commit, state }, password) {
return api.request("post", api.getURL("customer/updatePassword"), password).then(res => {
console.log('==>res',res)
console.log("==>res",res);
return res;
});
},
......
......@@ -186,7 +186,7 @@ export default {
.then(res => {
return res;
});
} else {
}
return api
.request("get", api.getURL("RepairManage/cAgainMake"), {
id: state.repairForm.id,
......@@ -195,7 +195,7 @@ export default {
.then(res => {
return res;
});
}
},
fetchData({ commit, state }, ids) {
return api.request("get", api.getURL("houseLayout/delete"), {
......
......@@ -11,7 +11,7 @@ export default {
return api.request("get", api.getURL("search/listSelect"), payload).then(res => {
if(res) {
commit('SET_CLEAN_SEARCH_INFO', res.data.data)
commit("SET_CLEAN_SEARCH_INFO", res.data.data);
}
return res;
......@@ -24,7 +24,7 @@ export default {
},
SET_CLEAN_SEARCH_INFO(state, data) {
Vue.set(state,'searchListInfo',data)
Vue.set(state,"searchListInfo",data);
},
......
......@@ -12,26 +12,26 @@ export default {
},
actions: {
findDetailOnCAPP( { commit, state }, params) {
return api.request("get", api.getURL('systemMsg/findDetailOnCAPP'), params).then(res => {
return api.request("get", api.getURL("systemMsg/findDetailOnCAPP"), params).then(res => {
if(res) {
commit('SET_SYSTEM_DETAIL_INFO', res.data.data)
commit("SET_SYSTEM_DETAIL_INFO", res.data.data);
}
return res;
})
});
},
findAllOnCAPP( { commit, state }, noCache) {
// if(state.businessList.length > 0 && !noCache) {
// return;
// }
return api.request("get", api.getURL('systemMsg/findAllOnCAPP'), {
return api.request("get", api.getURL("systemMsg/findAllOnCAPP"), {
pn: 1,
pageSize: 10000
}).then(res => {
if(res) {
commit('SET_SYSTEM_LIST', res.data.data.list)
commit("SET_SYSTEM_LIST", res.data.data.list);
}
return res;
})
});
},
businessFindPage({ commit, state }, noCache) {
// if(state.systemList.length > 0 && !noCache) {
......@@ -43,10 +43,10 @@ export default {
}).then(res => {
//console.log('res.data.data.list',res.data.data.list)
if(res) {
commit('SET_BUSINESS_LIST', res.data.data.list)
commit("SET_BUSINESS_LIST", res.data.data.list);
}
return res;
})
});
},
},
mutations: {
......@@ -54,13 +54,13 @@ export default {
},
SET_SYSTEM_DETAIL_INFO(state, data) {
Vue.set(state, 'systemDetail', data)
Vue.set(state, "systemDetail", data);
},
SET_BUSINESS_LIST(state, list) {
Vue.set(state, 'businessList', list)
Vue.set(state, "businessList", list);
},
SET_SYSTEM_LIST(state, list) {
Vue.set(state, 'systemList', list)
Vue.set(state, "systemList", list);
}
},
getters: {}
......
import Vue from "vue";
import api from "@/api/index.js";
import store from '@/utils/store';
import store from "@/utils/store";
export default {
namespaced : true,
state:{
......@@ -26,7 +26,7 @@ export default {
return api.request("get", api.getURL("content/choiceness"), payload).then(res => {
if(res) {
commit('SET_SELECTION_ACTIVITY_INFO',res.data.data.list)
commit("SET_SELECTION_ACTIVITY_INFO",res.data.data.list);
}
return res;
});
......@@ -35,7 +35,7 @@ export default {
return api.request("get", api.getURL("content/detail"), payload).then(res => {
if(res) {
commit('SET_SELECTION_ACTIVITY_DETAIL_INFO',res.data.data)
commit("SET_SELECTION_ACTIVITY_DETAIL_INFO",res.data.data);
let couponList = res.data.data.contentProps;
// console.log(couponList)
// couponList.map(item => {
......@@ -55,7 +55,7 @@ export default {
return api.request("get", api.getURL("coupon/findCouponDetails"), payload).then(res => {
if(res) {
commit('SET_COUPON_DETAIL_INFO',res.data.data)
commit("SET_COUPON_DETAIL_INFO",res.data.data);
}
return res;
});
......@@ -64,7 +64,7 @@ export default {
return api.request("get", api.getURL("cAPPHouse/myStewards"), payload).then(res => {
if(res) {
commit('SET_SERVICE_TEAM_INFO',res.data.data)
commit("SET_SERVICE_TEAM_INFO",res.data.data);
}
return res;
});
......@@ -74,8 +74,8 @@ export default {
if(res.data.code === 10000) {
// console.log(res.data)
commit('SET_CURRENT_ELEWATER_DATAINFO',res.data.data)
store('payForm',res.data.data)
commit("SET_CURRENT_ELEWATER_DATAINFO",res.data.data);
store("payForm",res.data.data);
}
return res;
});
......@@ -84,12 +84,12 @@ export default {
return api.request("get", api.getURL("WEGMeter/findMeterReding"), payload).then(res => {
//console.log(res.data)
if(res.data.code === 10000){
if(res.data.data.meterType === '40') { //电表
commit('SET_CURRENT_AMMETERBALANCE_DATA',res.data.data.balance)
commit('SET_CURRENT_AMMETERREAD_DATA',res.data.data.thisRead)
if(res.data.data.meterType === "40") { //电表
commit("SET_CURRENT_AMMETERBALANCE_DATA",res.data.data.balance);
commit("SET_CURRENT_AMMETERREAD_DATA",res.data.data.thisRead);
}else {
commit('SET_CURRENT_WATERMETERBALANCE_DATA',res.data.data.balance)
commit('SET_CURRENT_WATERMETERREAD_DATA',res.data.data.thisRead)
commit("SET_CURRENT_WATERMETERBALANCE_DATA",res.data.data.balance);
commit("SET_CURRENT_WATERMETERREAD_DATA",res.data.data.thisRead);
}
}
//commit('SET_CURRENT_ELECTRICITY_DATA',res.data.data)
......@@ -101,7 +101,7 @@ export default {
if(res.data.code === 10000) {
//console.log(res.data.data)
commit('SET_PAYMONEY_RECORD_DATA',res.data.data.list)
commit("SET_PAYMONEY_RECORD_DATA",res.data.data.list);
}
return res;
......@@ -112,7 +112,7 @@ export default {
payForm
).then(res => {
if(res.data.code === 10000) {
console.log(res.data)
console.log(res.data);
//commit('SET_PAYMONEY_RECORD_DATA',res.data.data.list)
}
......@@ -123,55 +123,55 @@ export default {
},
mutations: {
SET_SELECTION_ACTIVITY_INFO(state,data) {
Vue.set(state,'selectionActivityInfo',data)
Vue.set(state,"selectionActivityInfo",data);
},
SET_SELECTION_ACTIVITY_DETAIL_INFO(state,data) {
Vue.set(state,'selectionActivityDetail',data)
Vue.set(state,"selectionActivityDetail",data);
},
SET_COUPON_DETAIL_INFO(state,data) {
//Vue.set(state,'selectionActivityDetail',state.selectionActivityDetail)
state.selectionActivityDetail.contentProps.map(item => {
if(item.propValueInt === data.id) {
item.getStartTime = data.getStartTime
item.getEndTime = data.getEndTime
item.couponFee = data.couponFee
item.couponNum = data.couponNum
item.minimumFee = data.minimumFee
item.getStartTime = data.getStartTime;
item.getEndTime = data.getEndTime;
item.couponFee = data.couponFee;
item.couponNum = data.couponNum;
item.minimumFee = data.minimumFee;
}
})
});
},
SET_SERVICE_TEAM_INFO(state, data) {
Vue.set(state,'serviceTeamInfo',data)
Vue.set(state,"serviceTeamInfo",data);
},
SET_CURRENT_ELEWATER_DATAINFO(state,data) {
Vue.set(state,'waterElectricityInfo',data)
Vue.set(state,"waterElectricityInfo",data);
},
SET_CURRENT_AMMETERBALANCE_DATA(state,data) {
state.waterElectricityInfo.ammeterBalance = data
state.waterElectricityInfo.ammeterBalance = data;
},
SET_CURRENT_AMMETERREAD_DATA(state,data) {
state.waterElectricityInfo.ammeterRead = data
state.waterElectricityInfo.ammeterRead = data;
},
SET_CURRENT_WATERMETERBALANCE_DATA(state,data) {
state.waterElectricityInfo.watermeterBalance = data
state.waterElectricityInfo.watermeterBalance = data;
},
SET_CURRENT_WATERMETERREAD_DATA(state,data) {
state.waterElectricityInfo.watermeterRead = data
state.waterElectricityInfo.watermeterRead = data;
},
SET_PAYMONEY_RECORD_DATA(state,data) {
Vue.set(state,'payMoneyRecordData',data)
Vue.set(state,"payMoneyRecordData",data);
},
CLEAR_PAY_FORM(state,data) {
state.payForm.billType = ""
state.payForm.billTypeName = ""
state.payForm.houseCode = ""
state.payForm.houseId = 0
state.payForm.payMoney = 0
state.payForm.payStatus = 0
state.payForm.payWay = 0
state.payForm.regionId = 0
state.payForm.regionName = ""
state.payForm.billType = "";
state.payForm.billTypeName = "";
state.payForm.houseCode = "";
state.payForm.houseId = 0;
state.payForm.payMoney = 0;
state.payForm.payStatus = 0;
state.payForm.payWay = 0;
state.payForm.regionId = 0;
state.payForm.regionName = "";
}
},
......
......@@ -64,12 +64,12 @@ export default {
},
actions: {
cselectDetail( { commit, state }, id) {
return api.request("get", api.getURL('wellCustomer/cselectDetail'), {
return api.request("get", api.getURL("wellCustomer/cselectDetail"), {
id,
}).then(res => {
commit('SET_SUBSCRIBE_DETAIL', res.data.data)
commit("SET_SUBSCRIBE_DETAIL", res.data.data);
return res;
})
});
},
fetchData({ commit, state }, ids) {
return api.request("get", api.getURL("houseLayout/delete"), {
......@@ -83,7 +83,7 @@ export default {
pageSize: 19000
})
.then(res => {
commit('SET_SUBSCRIBE_LIST', res.data.data.list)
commit("SET_SUBSCRIBE_LIST", res.data.data.list);
return res;
});
},
......@@ -151,11 +151,11 @@ export default {
state.subscribeForm.planLiveTime = data;
},
SET_SUBSCRIBE_LIST(state, data) {
Vue.set(state, 'subscribeList', data)
Vue.set(state, "subscribeList", data);
},
SET_SUBSCRIBE_DETAIL(state, data) {
//console.log('-000000', data)
Vue.set(state, 'subscribeDetail', data)
Vue.set(state, "subscribeDetail", data);
},
},
getters: {}
......
......@@ -6,9 +6,9 @@
* ------------------------------------------------------------------
*/
import WeChatAuth from './wechat-auth'
import url from 'url'
import querystring from 'querystring'
import WeChatAuth from "./wechat-auth";
import url from "url";
import querystring from "querystring";
//const setWechatTitle = function(title) {
......@@ -33,44 +33,44 @@ import querystring from 'querystring'
export default {
install (Vue, options) {
console.log(options);
let weChatAuth = new WeChatAuth(options)
let router = options.router
let store = options.store
if (!router) return false
let weChatAuth = new WeChatAuth(options);
let router = options.router;
let store = options.store;
if (!router) return false;
function urlCodeQueryFilter (code) {
if (code) {
weChatAuth.setAuthCode(code)
weChatAuth.removeUrlCodeQuery()
weChatAuth.setAuthCode(code);
weChatAuth.removeUrlCodeQuery();
}
}
function checkRouterAuth (to, from, next) {
let authCode = weChatAuth.getAuthCode()
if ((!to.meta || !to.meta.wxauth) && !authCode) return true
let authCode = weChatAuth.getAuthCode();
if ((!to.meta || !to.meta.wxauth) && !authCode) return true;
if (!authCode && !weChatAuth.getAccessToken()) {
weChatAuth.openAuthPage(window.location.href)
return false
weChatAuth.openAuthPage(window.location.href);
return false;
} else if (authCode && !weChatAuth.getAccessToken()) {
weChatAuth.getCodeCallback(next)
return false
weChatAuth.getCodeCallback(next);
return false;
}
return true
return true;
}
function beforeEach (to, from, next) {
let query = querystring.parse(url.parse(window.location.href).query)
let code = query.code
let query = querystring.parse(url.parse(window.location.href).query);
let code = query.code;
//console.log('coded-d-d-d-d->', code)
urlCodeQueryFilter(code)
urlCodeQueryFilter(code);
//setWechatTitle(to.meta.description);
if (!code && !checkRouterAuth(to, from, next)) {
return false
return false;
}
//next()
//store.commit('updateLoadingStatus', {isLoading: true, type: 'load', text: '正在加载'})
//console.log('toName', to.name);
if(to.name === 'NotFoundView') {
if(to.name === "NotFoundView") {
next();
return;
}
......@@ -78,7 +78,7 @@ export default {
}
router.beforeEach((to, from, next) => {
beforeEach(to, from, next)
})
beforeEach(to, from, next);
});
}
}
\ No newline at end of file
};
\ No newline at end of file
class WeChatAuth {
constructor (config) {
let defaultConfig = {
appid: '',
responseType: 'code',
scope: 'snsapi_base ',
appid: "",
responseType: "code",
scope: "snsapi_base ",
getCodeCallback: () => {}
}
this.config = Object.assign(defaultConfig, config)
};
this.config = Object.assign(defaultConfig, config);
}
openAuthPage (redirectUri = window.location.href) {
let redirectUriArr = redirectUri.split('#')
window.sessionStorage.setItem('redirect_path', redirectUriArr[1])
redirectUri = encodeURIComponent(redirectUriArr[0])
this.removeAccessToken()
this.removeAuthCode()
let authPageBaseUri = 'https://open.weixin.qq.com/connect/oauth2/authorize'
let authParams = `?appid=${this.config.appid}&redirect_uri=${redirectUri}&response_type=${this.config.responseType}&scope=${this.config.scope}#wechat_redirect`
window.location.href = authPageBaseUri + authParams
let redirectUriArr = redirectUri.split("#");
window.sessionStorage.setItem("redirect_path", redirectUriArr[1]);
redirectUri = encodeURIComponent(redirectUriArr[0]);
this.removeAccessToken();
this.removeAuthCode();
let authPageBaseUri = "https://open.weixin.qq.com/connect/oauth2/authorize";
let authParams = `?appid=${this.config.appid}&redirect_uri=${redirectUri}&response_type=${this.config.responseType}&scope=${this.config.scope}#wechat_redirect`;
window.location.href = authPageBaseUri + authParams;
}
setAuthCode (code) {
if (!code) return false
window.sessionStorage.setItem('auth_code', code)
return true
if (!code) return false;
window.sessionStorage.setItem("auth_code", code);
return true;
}
getAuthCode () {
let codeValue = window.sessionStorage.getItem('auth_code')
if (!codeValue) return ''
return codeValue
let codeValue = window.sessionStorage.getItem("auth_code");
if (!codeValue) return "";
return codeValue;
}
removeAuthCode () {
window.sessionStorage.removeItem('auth_code')
window.sessionStorage.removeItem("auth_code");
}
removeUrlCodeQuery () {
let location = window.location
let search = location.search
let location = window.location;
let search = location.search;
if (search) {
search = search.substr(1)
search = search.substr(1);
}
let href = location.origin
let pathName = location.pathname
let href = location.origin;
let pathName = location.pathname;
if (pathName) {
href += pathName
href += pathName;
}
let searchArr = search.split('&').filter(item => {
if (item.indexOf('code=') !== -1) {
return false
let searchArr = search.split("&").filter(item => {
if (item.indexOf("code=") !== -1) {
return false;
}
if (item.indexOf('state=') !== -1) {
return false
if (item.indexOf("state=") !== -1) {
return false;
}
return true
})
return true;
});
if (searchArr.length > 0) {
href += '?' + searchArr.join('&')
href += "?" + searchArr.join("&");
}
let hash = location.hash
let hash = location.hash;
if (hash) {
href += hash
href += hash;
}
window.location.href = href
window.location.href = href;
}
setAccessToken (accessToken) {
if (!accessToken) return false
window.localStorage.setItem('access_token_openid', accessToken)
return true
if (!accessToken) return false;
window.localStorage.setItem("access_token_openid", accessToken);
return true;
}
getAccessToken () {
return window.localStorage.getItem('access_token_openid')
return window.localStorage.getItem("access_token_openid");
}
removeAccessToken () {
window.localStorage.removeItem('access_token_openid')
window.localStorage.removeItem("access_token_openid");
}
next (next) {
let self = this
let self = this;
return (accessToken, to) => {
if (accessToken) {
self.setAccessToken(accessToken)
self.setAccessToken(accessToken);
to
? next(to)
: next()
: next();
} else {
self.removeAccessToken()
to && next(to)
}
self.removeAuthCode()
self.removeAccessToken();
to && next(to);
}
self.removeAuthCode();
};
}
getCodeCallback (next) {
return this.config.getCodeCallback(this.getAuthCode(), this.next(next), window.sessionStorage.getItem('redirect_path'))
return this.config.getCodeCallback(this.getAuthCode(), this.next(next), window.sessionStorage.getItem("redirect_path"));
}
}
export default WeChatAuth
\ No newline at end of file
export default WeChatAuth;
\ No newline at end of file
export default function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
if (r !== null) {
return unescape(r[2]);
}
return null;
......
export default function (namespace, data) {
if (arguments.length > 1) {
return localStorage.setItem(namespace, JSON.stringify(data));
} else {
}
var store = localStorage.getItem(namespace);
return (store && JSON.parse(store)) || {};
}
}
function sonsTree(obj, arr) {
var children = new Array();
for (var i = 0; i < arr.length; i++) {
if (arr[i].pId == obj.id) {
if (arr[i].pId === obj.id) {
//pid等于加入数组
sonsTree(arr[i], arr); //递归出子元素
arr[i].text = arr[i].typeName;
......@@ -21,7 +21,7 @@ function treeUtils(data) {
// console.log('2222',data)
// return;
for (var i = 0; i < data.length; i++) {
if (data[i].pId == null||data[i].pId==0) {
if (data[i].pId === null || data[i].pId === 0) {
//获取父元素
let o = sonsTree(data[i], data);
o.text = o.typeName;
......
......@@ -5,7 +5,7 @@
export default {
init: function (data) {
//this.getToken();
console.log('res.data---------->share', data)
console.log("res.data---------->share", data);
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: data.appid,//appId通过微信服务号后台查看
......@@ -13,18 +13,18 @@ export default {
nonceStr: data.noncestr,//生成签名的随机字符串
signature: data.signature,//签名
jsApiList: [
'getLocation',
'openLocation',
'getNetworkType',
'onMenuShareTimeline',
'onMenuShareAppMessage'
"getLocation",
"openLocation",
"getNetworkType",
"onMenuShareTimeline",
"onMenuShareAppMessage"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
this._shareDefault = {
title: '赛领公寓',
desc: '赛领公寓',
title: "赛领公寓",
desc: "赛领公寓",
link: location.href,
imgUrl: 'http://spread.static.diditaxi.com.cn/bus/spread/static/static/img/logo_diditaxi_a918fd1.jpg'
imgUrl: "http://spread.static.diditaxi.com.cn/bus/spread/static/static/img/logo_diditaxi_a918fd1.jpg"
};
this.initShareMessage();
this.initShareTimeline();
......@@ -42,8 +42,8 @@ export default {
link: _settings.link, // 分享链接
imgUrl: _settings.imgUrl, // 分享图标
desc: _settings.desc, // 分享描述
type: '', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
options.callback && options.callback();
// 用户确认分享后执行的回调函数
......@@ -86,4 +86,4 @@ export default {
});
});
}
}
\ No newline at end of file
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment