Commit 1dcf0d9f by ym

1.0.6.1

1 parent cd635ac3
...@@ -42,14 +42,6 @@ export const equity = { ...@@ -42,14 +42,6 @@ export const equity = {
checkConcern(){ checkConcern(){
return request({}, 'scrm.api.user.concern.wechat.get') return request({}, 'scrm.api.user.concern.wechat.get')
}, },
/**体验卡领取天数 */
expCardDay(data){
return request(data, 'scrm.api.equity.class.free.day.get')
},
/**绑定体验卡 */
bindExpCard(data){
return request(data, 'scrm.api.equity.h5.free.card.bind')
}
} }
export const common = { export const common = {
getSessionId(data) { getSessionId(data) {
...@@ -147,7 +139,7 @@ export const cardRoll = { ...@@ -147,7 +139,7 @@ export const cardRoll = {
export const oilStation = { export const oilStation = {
/**获取油号 */ /**获取油号 */
getOilNoList(data) { getOilNoList(data) {
return request(data, 'scrm.api.equity.oil.no.list') return request(data, 'scrm.api.equity.oil.oilNoList')
}, },
/**获取加油站列表 */ /**获取加油站列表 */
getStationList(data) { getStationList(data) {
...@@ -159,11 +151,11 @@ export const oilStation = { ...@@ -159,11 +151,11 @@ export const oilStation = {
}, },
/**获取全部订单列表 */ /**获取全部订单列表 */
getStationOrderList(data) { getStationOrderList(data) {
return request(data, 'scrm.api.equity.oil.order.list') return request(data, 'scrm.api.equity.oil.orderList')
}, },
/**分页获取订单列表 */ /**分页获取订单列表 */
getStationOrderPage(data) { getStationOrderPage(data) {
return request(data, 'scrm.api.equity.oil.order.list.with.page') return request(data, 'scrm.api.equity.oil.orderPage')
}, },
/**获取支付url地址 */ /**获取支付url地址 */
getStationPayUrl(data) { getStationPayUrl(data) {
...@@ -174,19 +166,19 @@ export const oilStation = { ...@@ -174,19 +166,19 @@ export const oilStation = {
}, },
/**获取搜索记录 */ /**获取搜索记录 */
getStationSearchList(data) { getStationSearchList(data) {
return request(data, 'scrm.api.equity.oil.search.record.list') return request(data, 'scrm.api.equity.oil.search.list')
}, },
/**新增搜索记录 */ /**新增搜索记录 */
getStationSearchInsert(data) { getStationSearchInsert(data) {
return request(data, 'scrm.api.equity.oil.search.record.insert') return request(data, 'scrm.api.equity.oil.search.insert')
}, },
/**删除搜索记录 */ /**删除搜索记录 */
getStationSearchDelete(data) { getStationSearchDelete(data) {
return request(data, 'scrm.api.equity.oil.search.record.delete') return request(data, 'scrm.api.equity.oil.search.delete')
}, },
/**清空搜索记录 */ /**清空搜索记录 */
getStationSearchDeleteAll(data) { getStationSearchDeleteAll(data) {
return request(data, 'scrm.api.equity.oil.search.record.delete.all') return request(data, 'scrm.api.equity.oil.search.deleteAll')
}, },
} }
export const commodity = { export const commodity = {
......
...@@ -58,7 +58,7 @@ service.interceptors.response.use( ...@@ -58,7 +58,7 @@ service.interceptors.response.use(
: this.$store.state; : this.$store.state;
let [href] = window.location.href.split("/#/"); let [href] = window.location.href.split("/#/");
let url = `${href}/#/common/phoneLogin?sessionId=${sessionId}`; let url = `${href}/#/common/phoneLogin?sessionId=${sessionId}`;
window.vm.openWindows(url, "common.phoneLogin"); this.openWindows(url, "common.phoneLogin");
// window.vm.$router.replace({ name: 'common.phoneLogin' }) // window.vm.$router.replace({ name: 'common.phoneLogin' })
} else { } else {
let equipmentType = "" let equipmentType = ""
......
...@@ -10,9 +10,9 @@ import store from "./store" ...@@ -10,9 +10,9 @@ import store from "./store"
import axios from 'axios' import axios from 'axios'
Vue.use(VueWechatTitle) Vue.use(VueWechatTitle)
Vue.use(Vant) Vue.use(Vant)
import VConsole from 'vconsole' // import VConsole from 'vconsole'
const vConsole = new VConsole() // const vConsole = new VConsole()
Vue.use(vConsole) // Vue.use(vConsole)
import preview from 'vue-photo-preview' import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css' import 'vue-photo-preview/dist/skin.css'
Vue.use(preview) Vue.use(preview)
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 4; payMannerId = 4;
}else { }else {
payMannerId = 7; // 5 payMannerId = 5; // 7
} }
let para = { let para = {
orderCode, orderCode,
......
...@@ -37,9 +37,6 @@ router.beforeEach((to, from, next) => { ...@@ -37,9 +37,6 @@ router.beforeEach((to, from, next) => {
} }
return return
} }
if(params.freecards=='1'){
sessionStorage.setItem('URL_PARAM', JSON.stringify(params))
}
if (to.matched.some(recode => recode.meta.wxAuth)) { if (to.matched.some(recode => recode.meta.wxAuth)) {
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (window.__wxjs_environment === 'miniprogram') { if (window.__wxjs_environment === 'miniprogram') {
...@@ -76,7 +73,6 @@ const getSessionAppId = (sid,status) => { ...@@ -76,7 +73,6 @@ const getSessionAppId = (sid,status) => {
if(status) { if(status) {
store.commit('reload'); store.commit('reload');
}else { }else {
console.log('请求的时间:',new Date().getTime());
equity.getCardInfo().then(res => { equity.getCardInfo().then(res => {
let { code } = res; let { code } = res;
if (code == 0) { if (code == 0) {
......
const pages = { const pages = {
equity: [ equity: [
{name: 'index'}, {name: 'index', wxAuth: true},
{name: 'road', title: '道路救援'}, {name: 'road', title: '道路救援'},
{name: 'tyre', title: '轮胎保障'}, {name: 'tyre', title: '轮胎保障'},
{name: 'collision', title: '碰撞维修'}, {name: 'collision', title: '碰撞维修'},
...@@ -19,8 +19,6 @@ const pages = { ...@@ -19,8 +19,6 @@ const pages = {
{name: 'explain', title: '常见疑问'}, {name: 'explain', title: '常见疑问'},
{name: 'phoneLogin', title: '登录',wxAuth: true}, {name: 'phoneLogin', title: '登录',wxAuth: true},
{name: 'nothing'}, {name: 'nothing'},
{name: 'appTip'},
{name: 'expcard',title: '体验卡领取'},
{name: 'marketing', wxAuth: true}, {name: 'marketing', wxAuth: true},
], ],
car: [{ car: [{
...@@ -91,32 +89,10 @@ const pages = { ...@@ -91,32 +89,10 @@ const pages = {
] ]
} }
const getParams = str => {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
}
let routes = [] let routes = []
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
let isWeiXin = ua.match(/MicroMessenger/i) == 'micromessenger' let isWeiXin = ua.match(/MicroMessenger/i) == 'micromessenger'
let defaultName = isWeiXin?'common.phoneLogin':'common.marketing' let defaultName = isWeiXin?'common.phoneLogin':'common.marketing'
let urlParam = getParams(location.href)
let freecards = sessionStorage.getItem('freecards')
let flag = Object.keys(urlParam);
if(flag.length){
if((urlParam.freecards=='1') || (freecards=='1')){
defaultName = 'common.expcard'
sessionStorage.setItem('freecards','1')
}
}
Object.keys(pages).map(parent => { Object.keys(pages).map(parent => {
pages[parent].map((val, index) => { pages[parent].map((val, index) => {
let {name} = val let {name} = val
......
...@@ -210,29 +210,6 @@ const equityLogin = () => { ...@@ -210,29 +210,6 @@ const equityLogin = () => {
}) })
} }
} }
//自定义弹框dialog
const myDialog = (message,confirmText,cancelText,comfirmFn,cancelFn)=>{
Dialog.confirm({
title: '提示',
message: message,
confirmButtonText: confirmText,
cancelButtonText: cancelText,
confirmButtonColor:'#008fff',
closeOnClickOverlay:true,
beforeClose(action,done){
if(action==='confirm'){
comfirmFn()
done()
}else if(action==='cancel'){
cancelFn()
done()
}else{
done()
}
}
})
}
const utils = { const utils = {
removeLocalStorage, removeLocalStorage,
setLocalStorage, setLocalStorage,
...@@ -252,8 +229,7 @@ const utils = { ...@@ -252,8 +229,7 @@ const utils = {
dialog, dialog,
alert, alert,
cloneText, cloneText,
getParams, getParams
myDialog
} }
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
......
...@@ -73,9 +73,8 @@ export default { ...@@ -73,9 +73,8 @@ export default {
mounted(){ mounted(){
this.payStatus = this.$route.query; this.payStatus = this.$route.query;
console.log(this.getLocalStorage('whereInOpen'),'本地缓存的页面入口') console.log(this.getLocalStorage('whereInOpen'),'本地缓存的页面入口')
const merchantId2 = sessionStorage.getItem("GL_WX_MERCHANTID"); let { sessionId} = this.$store.state;
let { sessionId,merchantId} = this.$store.state; this.merchantId = sessionStorage.getItem('GL_WX_MERCHANTID');
this.merchantId = merchantId || merchantId2;
this.sessionId = sessionId; this.sessionId = sessionId;
this.showLoading(); this.showLoading();
let para = { let para = {
...@@ -102,9 +101,9 @@ export default { ...@@ -102,9 +101,9 @@ export default {
let payMannerId; let payMannerId;
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 5; //6 payMannerId = 6; //6
}else { }else {
payMannerId = 6; //2 payMannerId = 2; //2
} }
let para = { let para = {
merchantId: this.merchantId, merchantId: this.merchantId,
...@@ -146,7 +145,8 @@ export default { ...@@ -146,7 +145,8 @@ export default {
window.myjs.jumpNativeApp(JSON.stringify({ type: 7, homePage: 'equity' })) window.myjs.jumpNativeApp(JSON.stringify({ type: 7, homePage: 'equity' }))
} }
}else{ }else{
self.setLocalStorage('reLoadIndex',self.sessionId) // console.log(1111);
// console.log(temp,'**-**');
if (self.checkPhoneType() == 'ios') { if (self.checkPhoneType() == 'ios') {
window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 1, reloadView: 'equity' })) window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({ type: 1, reloadView: 'equity' }))
} else { } else {
...@@ -164,26 +164,20 @@ export default { ...@@ -164,26 +164,20 @@ export default {
let temp = this.getLocalStorage('whereInOpen') let temp = this.getLocalStorage('whereInOpen')
equity.getCardInfo().then(res => { equity.getCardInfo().then(res => {
this.hideLoading() this.hideLoading()
let { code ,data} = res; let { code } = res;
if (code == 0&&data.cardNo) { if (code == 0) {
this.openingStatus = false; this.openingStatus = false;
this.isOpen = 1 this.isOpen = 1
clearInterval(this.timer); clearInterval(this.timer);
// this.payStatus? window.vm.$router.go(-1):window.vm.$router.replace({ name: 'equity.index' });
console.log(temp,'获取页面入口');
if(temp=='goods'){ if(temp=='goods'){
window.vm.$router.go(-1) window.vm.$router.go(-1)
}else{ }else{
const ua = navigator.userAgent.toLowerCase() const ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
window.vm.$router.replace({ name: 'equity.index' }) window.vm.$router.replace({ name: 'equity.index' })
}else{
window.vm.$router.go(-1)
} }
// if (this.checkPhoneType() == 'ios') {
// window.webkit.messageHandlers.jumpNativeApp.postMessage(JSON.stringify({type:1}))
// } else {
// window.myjs.jumpNativeApp(JSON.stringify({type:1}))
// window.vm.$router.replace({ name: 'equity.index' });
// }
} }
} else { } else {
clearInterval(this.timer); clearInterval(this.timer);
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
//import { indexMixin } from '@/mixins' //import { indexMixin } from '@/mixins'
import { equity } from '@r/api.js' import { equity,common } from '@r/api.js'
export default { export default {
name: '', name: '',
data () { data () {
...@@ -145,40 +145,33 @@ export default { ...@@ -145,40 +145,33 @@ export default {
methods: { methods: {
init() { init() {
//如果能够获取到这个缓存,说明已经是登录过 let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
let isReload = this.getLocalStorage('reLoadIndex') // let { sessionId, phone } = this.$store.state
console.log('sessionId',isReload); const ua = navigator.userAgent.toLowerCase()
if(isReload){ let sid = urlObj.sessionId
this.removeLocalStorage('reLoadIndex') console.log(sid);
equity.getCardInfo().then(res => { if (!this.isMiniprogram) {
let { code } = res if (ua.match(/MicroMessenger/i) == 'micromessenger') {
if (code == 0) { console.log(888);
}
}else{//确保sessionId存在
common.getAppSessionId({ sid }).then(res => {
let { data,code } = res
if(data.sessionId&&code==0){
console.log(123456);
equity.getCardInfo().then(result => {
console.log(result,'987--');
// let { code } = result
if (result.code == 0) {
console.log(789101);
this.$router.replace({ name: 'equity.index' }) this.$router.replace({ name: 'equity.index' })
} }
}) })
this.$store.commit('setUserInfo', data)
}
})
return
} }
this.removeLocalStorage('showMydialog1')
// let urlObj = JSON.parse(sessionStorage.getItem('URL_PARAM'))
// // let { sessionId, phone } = this.$store.state
// const ua = navigator.userAgent.toLowerCase()
// let sid = urlObj.sessionId
// console.log(sid);
// if (ua.match(/MicroMessenger/i) != 'micromessenger') {
// common.getAppSessionId({ sid }).then(res => {
// let { data,code } = res
// if(data.sessionId&&code==0){
// console.log(123456);
// equity.getCardInfo().then(result => {
// console.log(result,'987--');
// if (result.code == 0) {
// console.log(789101);
// this.$router.replace({ name: 'equity.index' })
// }
// })
// this.$store.commit('setUserInfo', data)
// }
// })
// }
// if (sessionId) { // if (sessionId) {
// if (!this.isMiniprogram) { // if (!this.isMiniprogram) {
// if (ua.match(/MicroMessenger/i) == 'micromessenger') { // if (ua.match(/MicroMessenger/i) == 'micromessenger') {
......
...@@ -170,10 +170,6 @@ export default { ...@@ -170,10 +170,6 @@ export default {
if(!past_due){ if(!past_due){
this.jump() this.jump()
} }
// 此处为公众号入口必经的页面,清空一些缓存(权益使用页的弹框拦截)
this.removeLocalStorage('showMydialog')
this.removeLocalStorage('showMydialog1')
this.removeLocalStorage('bindinfo')
}, },
methods: { methods: {
getSms() { getSms() {
......
...@@ -113,9 +113,6 @@ export default { ...@@ -113,9 +113,6 @@ export default {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => { WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => {
console.log(res) console.log(res)
}) })
}else{
let url = `http://uri.amap.com/marker?position=${Number(val.gasAddressLongitude)},${Number(val.gasAddressLatitude)}&name=${val.gasAddress}&coordinate=gaode&callnative=1`;
this.openWindows(url);
} }
}, },
changeOilSno(item) { changeOilSno(item) {
......
...@@ -243,9 +243,6 @@ export default { ...@@ -243,9 +243,6 @@ export default {
WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => { WX.openLocation(Number(val.gasAddressLatitude),Number(val.gasAddressLongitude),val.gasName,val.gasAddress,18).then(res => {
console.log(res) console.log(res)
}) })
}else{
let url = `http://uri.amap.com/marker?position=${Number(val.gasAddressLongitude)},${Number(val.gasAddressLatitude)}&name=${val.gasAddress}&coordinate=gaode&callnative=1`;
this.openWindows(url);
} }
}, },
//更新定位 //更新定位
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!