diff --git a/config/index.js b/config/index.js index e99f7c1..8805c67 100644 --- a/config/index.js +++ b/config/index.js @@ -8,7 +8,7 @@ module.exports = { assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: 'static', assetsPublicPath: '/', - productionSourceMap: true, + productionSourceMap: false, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: @@ -23,7 +23,8 @@ module.exports = { }, dev: { env: require('./dev.env'), - port: 8080, + host: '192.168.31.52', + port: 8081, autoOpenBrowser: true, assetsSubDirectory: 'static', assetsPublicPath: '/', diff --git a/package.json b/package.json index 31ba20d..38cc52a 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "style-loader": "^0.16.1", "url-loader": "^0.5.9", "vue-awesome-swiper": "^3.1.3", + "vue-infinite-scroll": "^2.0.2", "vue-loader": "^11.1.4", "vue-style-loader": "^2.0.0", "webpack": "^2.7.0", diff --git a/src/api/chooseCommunity.js b/src/api/chooseCommunity.js new file mode 100644 index 0000000..00c91b7 --- /dev/null +++ b/src/api/chooseCommunity.js @@ -0,0 +1,16 @@ +export default { + getAddressInfo:{ + method:"get", + url:"/mall/web/estate/addressInfo" + }, + // -- 查询单个小区信息 -- + getEstateInfo: { + method: 'GET', + url: '/mall/web/estate/query/estateInfo', + }, + getEstateList: { + method: 'GET', + url: '/mall/web/estate/query/estateList', + }, + +} \ No newline at end of file diff --git a/src/api/home.js b/src/api/home.js index 3eb1b9b..fba5297 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -15,16 +15,16 @@ export default { method: 'GET', url: '/mall/web/defaultDistrict' }, - getLocation:{ - method:"get", - url:"/mall/web/addressInfo" - }, countExtend:{ method:"POST", url:"/mall/web/center/insert/data" }, + countPartner:{ + method:"POST", + url:"/mall/web/center/insert/housing/data" + }, updateUniqueId:{ method:"get", url:"/mall/web/center/update/uniqueId" - } + }, } \ No newline at end of file diff --git a/src/api/wxShare.js b/src/api/wxShare.js index 546378a..b5b5f50 100644 --- a/src/api/wxShare.js +++ b/src/api/wxShare.js @@ -1,5 +1,10 @@ -export default { +export default { + // -- 获取分享信息 -- + getWXCheck: { + method: 'GET', + url: '/mall/web/wx/api/check', + } , // -- 获取分享信息 -- getShare: { method: 'GET', diff --git a/src/assets/styles/common/common.scss b/src/assets/styles/common/common.scss index 41697cc..603c975 100644 --- a/src/assets/styles/common/common.scss +++ b/src/assets/styles/common/common.scss @@ -1050,7 +1050,7 @@ textarea { height:0; border-width:0 3.5px 3.5px; border-style:solid; - border-color:transparent transparent #009DDF;/*灰 透明 透明 */ + border-color:transparent transparent rgba(0, 186, 134, 1);/*灰 透明 透明 */ position:relative; } @@ -1080,14 +1080,14 @@ textarea { } .weui-dialog__btn_primary { - color: #009DDF!important; + color: rgba(0, 186, 134, 1)!important; } .vux-popup-header-right { padding-right: 15px; - color: #00A0E8!important; + color: rgba(0, 186, 134, 1)!important; } .dp-header .dp-item.dp-right { - color: #00A0E8!important; + color: rgba(0, 186, 134, 1)!important; } diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index c796e82..7b1a9c7 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -126,9 +126,6 @@ ul li { p { word-break: break-word; } -.el-input { - width: auto!important; -} .el-input--suffix .el-input__inner { height: 28px; line-height: 28px; @@ -137,7 +134,7 @@ p { border-radius: 16px; } .el-input__icon { - line-height: 28px; + line-height: 28px!important; } .el-dropdown-menu { padding: 5px 0!important; diff --git a/src/main.js b/src/main.js index 90df4d8..5566b17 100644 --- a/src/main.js +++ b/src/main.js @@ -25,7 +25,9 @@ import "@/assets/styles/swiper.css"; //import wx from 'weixin-js-sdk' //import axios from 'axios' import "@/models/wxShare.js"; +import "@/models/wxLocation.js"; import VueCookies from 'vue-cookies' +import infiniteScroll from 'vue-infinite-scroll' Vue.config.productionTip = false; Vue.use(WechatPlugin); @@ -34,6 +36,8 @@ Vue.use(LoadingPlugin); Vue.use(ToastPlugin); Vue.use(AlertPlugin); Vue.use(VueCookies) +Vue.use(ElementUI) +Vue.use(infiniteScroll) // Vue.use(BMap, { // // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */ // ak: 'm8sGHZTpKuDeDAU5qs4YUWWDP1v6XZsq' diff --git a/src/models/choose-community.js b/src/models/choose-community.js new file mode 100644 index 0000000..86de4b9 --- /dev/null +++ b/src/models/choose-community.js @@ -0,0 +1,24 @@ +import utilsModel from "./utils-model"; +import chooseCommunity from "../api/chooseCommunity"; + +export default { + getAddressInfo : (params) => + utilsModel + .config(chooseCommunity.getAddressInfo) + .request({ + params : params, + }), + getEstateInfo : (params) => + utilsModel + .config(chooseCommunity.getEstateInfo) + .request({ + params : params, + }), + + getEstateList : (params) => + utilsModel + .config(chooseCommunity.getEstateList) + .request({ + params : params, + }) +} \ No newline at end of file diff --git a/src/models/home-model.js b/src/models/home-model.js index 178af7c..e08c53d 100644 --- a/src/models/home-model.js +++ b/src/models/home-model.js @@ -18,19 +18,27 @@ export default { version: "2.5.0" } }), - getLocation: params => - utilsModel.config(homeApi.getLocation).request({ - params: params, - // headers: { - // "x-forwarded-for": "113.65.207.218" - // } - }), + // getLocation: params => + // utilsModel.config(homeApi.getLocation).request({ + // params: params, + // // headers: { + // // "x-forwarded-for": "113.65.207.218" + // // } + // }), countExtend: params => utilsModel.config(homeApi.countExtend).request({ params: params }), + countPartner: params => + utilsModel.config(homeApi.countPartner).request({ + params: params + }), updateUniqueId: params => utilsModel.config(homeApi.updateUniqueId).request({ params: params - }) + }), + // getEstateInfo: params => + // utilsModel.config(homeApi.getEstateInfo).request({ + // params: params + // }), }; diff --git a/src/models/utils-model.js b/src/models/utils-model.js index 8ff992c..ed4db32 100644 --- a/src/models/utils-model.js +++ b/src/models/utils-model.js @@ -102,7 +102,7 @@ const config = function(config, params) { // console.log(newConfig) // newConfig.headers.Authorization=params.token //执行http接口请求 - return instance(newConfig).then(successCallback, errorCallback); + return instance(newConfig).then(successCallback).catch(errorCallback); } }; }; diff --git a/src/models/wxLocation.js b/src/models/wxLocation.js new file mode 100644 index 0000000..68690ca --- /dev/null +++ b/src/models/wxLocation.js @@ -0,0 +1,51 @@ +import Vue from "vue"; +import wx from "weixin-js-sdk"; +import axios from "axios"; +import wxShareModel from "../models/wxShare-model.js"; + + +Vue.prototype.wxLocation = function () { + wxShareModel.getWXCheck().then(response =>{ + if (response.code != 0) { + return; + } + var jsApiSignConfig = response.response.jsApiSignConfig; + wx.config({ + debug: false, // 开启调试模式,开发时可以开启 + appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 + timestamp: jsApiSignConfig.timestamp, // 必填,生成签名的时间戳 由接口返回 + nonceStr: jsApiSignConfig.nonceStr, // 必填,生成签名的随机串 由接口返回 + signature: jsApiSignConfig.signature, // 必填,签名 由接口返回 + jsApiList: [ + "onMenuShareAppMessage", + "onMenuShareTimeline", + "onMenuShareQQ", + "onMenuShareWeibo", + "onMenuShareQZone" + ] + }); + wx.ready(() => { + // 首次进入页面进会弹窗确认地理位置 + if (localStorage.getItem("latitude") == null) { + wx.getLocation({ + type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + success: function (res) { + localStorage.setItem("latitude", res.latitude); + localStorage.setItem("longitude", res.longitude); + }, + cancel: function () { + alter("拒绝定位"); + } + }); + } else { + + } + alert("lat:" + localStorage.getItem("latitude") + ";lng:" + localStorage.getItem("longitude")); + wx.error(function (res) { + alter("wx-js初始化: " + res); + }); + }); + }); + + } + \ No newline at end of file diff --git a/src/models/wxShare-model.js b/src/models/wxShare-model.js index 10ea5c6..d8db097 100644 --- a/src/models/wxShare-model.js +++ b/src/models/wxShare-model.js @@ -9,4 +9,10 @@ export default { .request({ params : params, }), + getWXCheck : () => + utilsModel + .config(wxShareApi.getWXCheck) + .request({ + + }), } \ No newline at end of file diff --git a/src/models/wxShare.js b/src/models/wxShare.js index 6893183..8743ccb 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -7,15 +7,12 @@ import homeApi from "../models/home-model.js"; Vue.prototype.wxShare = function (params) { var params = params || {}; - -wxShareModel.getShare(params).then(response => { +wxShareModel.getWXCheck().then(response =>{ if (response.code != 0) { return; } - var jsApiSignConfig = response.response.jsApiSignConfig; - var shareConfig = response.response.shareConfig; - var couponNo = response.response.couponNo + wx.config({ debug: false, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 @@ -30,82 +27,103 @@ wxShareModel.getShare(params).then(response => { "onMenuShareQZone" ] }); - var urlParams = ''; - let uuniqueId = this.$cookies.get('1hjz_mall_unique_id') - if (couponNo !== undefined && couponNo !== null && couponNo !== "") { - urlParams = '?batchNo=' + couponNo - } - if (uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== "") { - if (urlParams.length > 0) { - urlParams += '&uniqueId=' + uuniqueId - } else { - urlParams = '?uniqueId=' + uuniqueId + wxShareModel.getShare(params).then(response => { + if (response.code != 0) { + return; } - - } - wx.ready(() => { - //获取“分享给朋友”按钮点击状态及自定义分享内容接口 - wx.onMenuShareAppMessage({ - // 分享给朋友 - title: shareConfig.title, // 分享标题 - desc: shareConfig.desc, // 分享描述 - link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 - imgUrl: shareConfig.img, // 分享图标 - success: function (res) {} - }); - //转发到朋友圈 - wx.onMenuShareTimeline({ - title: shareConfig.title, // 分享标题 - desc: shareConfig.desc, // 分享描述 - link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 - imgUrl: shareConfig.img, // 分享图标 - success: function (res) {} - }); - //微信分享qq - wx.onMenuShareQQ({ - title: shareConfig.title, // 分享标题 - desc: shareConfig.desc, // 分享描述 - link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 - imgUrl: shareConfig.img, // 分享图标 - success: function (res) {} - }); - - //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 - wx.onMenuShareWeibo({ - title: shareConfig.title, // 分享标题 - desc: shareConfig.desc, // 分享描述 - link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 - imgUrl: shareConfig.img, // 分享图标 - success: function (res) {} - }); - - //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口(即将废弃) - wx.onMenuShareQZone({ - title: shareConfig.title, // 分享标题 - desc: shareConfig.desc, // 分享描述 - link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 - imgUrl: shareConfig.img, // 分享图标 - success: function (res) {} - }); - // 首次进入页面进会弹窗确认地理位置 - if (localStorage.getItem("latitude") == null) { - wx.getLocation({ - type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' - success: function (res) { - localStorage.setItem("latitude", res.latitude); - localStorage.setItem("longitude", res.longitude); - }, - cancel: function () { - alter("拒绝定位"); + var shareConfig = response.response.shareConfig; + var couponNo = response.response.couponNo + + var urlParams = ''; + let uuniqueId = this.$cookies.get('1hjz_mall_unique_id') + if (couponNo !== undefined && couponNo !== null && couponNo !== "") { + urlParams = '?batchNo=' + couponNo + } + if (uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== "") { + if (urlParams.length > 0) { + urlParams += '&uniqueId=' + uuniqueId + } else { + urlParams = '?uniqueId=' + uuniqueId + } + } + let estateStr = localStorage.getItem("estate") || ""; + if(estateStr && estateStr.length > 0){ + let estateArr = estateStr.split("&"); + let estateId = estateArr[0]; + if (estateId !== undefined && estateId !== null && estateId !== "") { + if (urlParams.length > 0) { + urlParams += '&estateId=' + estateId + } else { + urlParams = '?estateId=' + estateId } - }); - } else { - + } } - alert("lat:" + localStorage.getItem("latitude") + ";lng:" + localStorage.getItem("longitude")); - wx.error(function (res) { - alter("wx-js初始化: " + res); + wx.ready(() => { + //获取“分享给朋友”按钮点击状态及自定义分享内容接口 + wx.onMenuShareAppMessage({ + // 分享给朋友 + title: shareConfig.title, // 分享标题 + desc: shareConfig.desc, // 分享描述 + link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 + imgUrl: shareConfig.img, // 分享图标 + success: function (res) {} + }); + //转发到朋友圈 + wx.onMenuShareTimeline({ + title: shareConfig.title, // 分享标题 + desc: shareConfig.desc, // 分享描述 + link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 + imgUrl: shareConfig.img, // 分享图标 + success: function (res) {} + }); + //微信分享qq + wx.onMenuShareQQ({ + title: shareConfig.title, // 分享标题 + desc: shareConfig.desc, // 分享描述 + link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 + imgUrl: shareConfig.img, // 分享图标 + success: function (res) {} + }); + + //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 + wx.onMenuShareWeibo({ + title: shareConfig.title, // 分享标题 + desc: shareConfig.desc, // 分享描述 + link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 + imgUrl: shareConfig.img, // 分享图标 + success: function (res) {} + }); + + //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口(即将废弃) + wx.onMenuShareQZone({ + title: shareConfig.title, // 分享标题 + desc: shareConfig.desc, // 分享描述 + link: shareConfig.url + urlParams, // 分享链接 默认以当前链接 + imgUrl: shareConfig.img, // 分享图标 + success: function (res) {} + }); + // 首次进入页面进会弹窗确认地理位置 + if (localStorage.getItem("latitude") == null) { + + wx.getLocation({ + type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' + success: function (res) { + localStorage.setItem("latitude", res.latitude); + localStorage.setItem("longitude", res.longitude); + }, + cancel: function () { + alter("拒绝定位"); + } + }); + } else { + + } + // alert("lat:" + localStorage.getItem("latitude") + ";lng:" + localStorage.getItem("longitude")); + wx.error(function (res) { + alter("wx-js初始化: " + res); + }); }); }); }); + } diff --git a/src/router/index.js b/src/router/index.js index 4a0875b..0e7ec97 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ const putMoneySuccess = resolve => const serviceEvaluationStatus = resolve => require(["@/view/service-evaluation-status"], resolve); const home = resolve => require(["@/view/home"], resolve); +const chooseCommnity = resolve => require(["@/view/choose-community"], resolve); const poster = resolve => require(["@/view/poster"], resolve); const demo = resolve => require(["@/view/demo"], resolve); const goodsClassify = resolve => require(["@/view/goods-classify"], resolve); @@ -56,6 +57,11 @@ let router = new Router({ name: "首页", component: home }, + { + path: "/choose-community", + name: "选择小区", + component: chooseCommnity + }, { path: "/poster", name: "分销海报", @@ -94,6 +100,7 @@ let router = new Router({ path: "/demo", component: resolve => require(["@/view/demo.vue"], resolve) } + ] }); diff --git a/src/utils/scroll.js b/src/utils/scroll.js new file mode 100644 index 0000000..bba9a57 --- /dev/null +++ b/src/utils/scroll.js @@ -0,0 +1,20 @@ +/** + * 本文件用于 keep-alive的页面返回离开前的位置使用 + * 未知 Vue-Router scrollBehavior 记录有误,所以使用手动记录位置。 + */ +var myScroll = { + activated() { + console.log("pageNum---pages:"+this.pageNum,this.pages) + if (this.pageNum < this.pages) this.busy = false + + this.$nextTick(function() { + const position = this.$route.meta.savedPosition // 返回页面取出来 + window.scroll(0, position) + }) + }, + deactivated() { + this.busy = true + } +} + +export default myScroll diff --git a/src/view/choose-community.vue b/src/view/choose-community.vue index ffb40ce..4f0164b 100644 --- a/src/view/choose-community.vue +++ b/src/view/choose-community.vue @@ -1,19 +1,427 @@ + + \ No newline at end of file diff --git a/src/view/goods-classify.vue b/src/view/goods-classify.vue index 56e17cf..f06393e 100644 --- a/src/view/goods-classify.vue +++ b/src/view/goods-classify.vue @@ -17,7 +17,7 @@
-
+

{{item.combinationName}}

diff --git a/src/view/home.vue b/src/view/home.vue index 7994a01..45fc583 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -3,9 +3,9 @@
- + - {{defaultCity}} + {{defaultCommunity}}