Commit c4b62188 by 杨北旺

修改为上线的配置参数

1 parent 3fd629b7
......@@ -15,82 +15,81 @@ Vue.use(Lazyload);
Vue.use(Vant)
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
import VConsole from 'vconsole'
const vConsole = new VConsole()
Vue.use(vConsole)
// import VConsole from 'vconsole'
// const vConsole = new VConsole()
// Vue.use(vConsole)
Vue.use(preview)
Vue.config.productionTip = false
Vue.prototype.isMiniprogram = window.__wxjs_environment === 'miniprogram'
Vue.prototype.track = track;
if (!localStorage['sessionId'] || !localStorage['expirationTime'] || (localStorage['sessionId'] && (new Date().getTime() - localStorage['expirationTime']) > 60 * 60 * 1000)) {
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
if (Vue.prototype.checkPhoneType() == 'ios') {
terminal = 'ios'
const ua = navigator.userAgent.toLowerCase();
let terminal;
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
terminal = 'h5'
} else {
terminal = 'android'
if (Vue.prototype.checkPhoneType() == 'ios') {
terminal = 'ios'
} else {
terminal = 'android'
}
}
}
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id = '';
track.setCommonConfig({ project_id, secret, client_id, user_id })
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": '',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": Vue.prototype.getDetect().brand,
"resolution": window.screen.width + '*' + window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": Vue.prototype.getDetect().userAgent,
"os_name": Vue.prototype.getDetect().os_name,
"os_version": Vue.prototype.getDetect().version,
"network_type": window.navigator.connection ? window.navigator.connection.effectiveType : '',
"terminal": terminal
})
track.getSessionId('/collectdata/login', user, function () {
let project_id = process.env.VUE_APP_PROJECR_VERSION;
let secret = process.env.VUE_APP_PROJECR_SECRET;
let client_id = '';
let user_id = '';
track.setCommonConfig({ project_id, secret, client_id, user_id })
let user = JSON.stringify({
"user_id": user_id,
"client_ip": returnCitySN.cip,
"client_id": localStorage['client_id'],
"wx_open_id": '',
"loc_city": returnCitySN.name,
"loc_province": returnCitySN.name,
"loc_country": '',
"network_carrier": '',
"device_model": '',
"brand": Vue.prototype.getDetect().brand,
"resolution": window.screen.width + '*' + window.screen.height,
"browser_version": window.navigator.appVersion,
"browser": Vue.prototype.getDetect().userAgent,
"os_name": Vue.prototype.getDetect().os_name,
"os_version": Vue.prototype.getDetect().version,
"network_type": window.navigator.connection ? window.navigator.connection.effectiveType : '',
"terminal": terminal
})
track.getSessionId('/collectdata/login', user, function() {
axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
}).then(({
data: config
}) => {
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
})
})
} else {
axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
}).then(({
data: config
data: config
}) => {
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
})
})
} else {
axios({
baseURL: process.env.VUE_APP_REPO + '/scrm-equity-mobile-config',
method: 'get'
}).then(({
data: config
}) => {
window.$baseConfig = config
window.vm = new Vue({
router,
store,
render: h => {
return h(App)
}
}).$mount('#app')
})
}
}
\ No newline at end of file
......@@ -5,8 +5,7 @@ export default {
data() {
return {}
},
mounted() {
},
mounted() {},
methods: {
async chooseWXPay() {
if (this.appearance == 2 && !/^[a-zA-Z0-9]+$/.test(this.rechargeNumber)) {
......@@ -23,10 +22,10 @@ export default {
pagename: "商品详情",
event_name: '购买',
extra_data: {
brandName: this.selectData?this.selectData.brandName:this.brandName,
productName: this.selectData?this.selectData.productName:this.businessList[ this.typeSno].productName,
brandName: this.selectData ? this.selectData.brandName : this.brandName,
productName: this.selectData ? this.selectData.productName : this.businessList[this.typeSno].productName,
rechargeNumber: this.rechargeNumber,
denomination: this.denomination?this.denomination.denomination:undefined
denomination: this.denomination ? this.denomination.denomination : undefined
}
}
});
......@@ -50,7 +49,7 @@ export default {
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
payMannerId = 4;
} else {
payMannerId = 7; // 5
payMannerId = 5; // 7
}
let para = {
orderCode,
......@@ -70,7 +69,7 @@ export default {
}
})
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
this.handlePay(payData,orderCode);
this.handlePay(payData, orderCode);
} else {
if (this.checkPhoneType() == 'ios') {
if (window["payWebOrder"] && typeof window.payWebOrder === "function") {
......@@ -82,12 +81,13 @@ export default {
window.myjs.payWebOrder("wxpay", JSON.stringify(payData));
}
let self = this;
window.onMessageFromPayBack = function (result) {
window.onMessageFromPayBack = function(result) {
if (result == 0) {
if (self.appearance == 2) {
let productName = self.brandName + self.businessList[self.typeSno].productName + self.denomination.denomination
window.vm.$router.push({
name: 'commodity.process', query: {
name: 'commodity.process',
query: {
rechargeNumber: self.rechargeNumber,
productName
}
......@@ -95,26 +95,27 @@ export default {
} else {
window.vm.$router.push({ name: 'commodity.success', query: { price: self.selectData.salesPrice } })
}
self.payCollect(orderCode,1);
self.payCollect(orderCode, 1);
} else {
self.payCollect(orderCode,0);
self.payCollect(orderCode, 0);
window.vm.showToast(result == -1 ? '支付失败' : '取消支付')
}
}
}
},
handlePay(payData,orderCode) {
handlePay(payData, orderCode) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData;
WX.chooseWXPay(timeStamp, nonceStr, packages, signType, paySign).then(res => {
if(res) {
this.payCollect(orderCode,1);
}else {
this.payCollect(orderCode,0);
if (res) {
this.payCollect(orderCode, 1);
} else {
this.payCollect(orderCode, 0);
}
if (this.appearance == 2) {
let productName = this.brandName + this.businessList[this.typeSno].productName + this.denomination.denomination
window.vm.$router.push({
name: 'commodity.process', query: {
name: 'commodity.process',
query: {
rechargeNumber: this.rechargeNumber,
productName
}
......@@ -124,9 +125,9 @@ export default {
}
})
},
payCollect(orderCode,status) {
payCollect(orderCode, status) {
let extra_data;
if(this.selectData) {
if (this.selectData) {
extra_data = {
brandName: this.selectData.brandName,
productName: this.selectData.productName,
......@@ -137,12 +138,12 @@ export default {
goodsPrice: this.selectData.salesPrice,
goodsStock: this.selectData.stock,
orderCode,
result: status?'成功':'失败'
result: status ? '成功' : '失败'
}
}else {
} else {
extra_data = {
brandName: this.brandName,
productName: this.businessList[ this.typeSno].productName,
productName: this.businessList[this.typeSno].productName,
goodsID: this.denomination.id,
account: this.rechargeNumber,
denomination: this.denomination.denomination,
......@@ -150,7 +151,7 @@ export default {
goodsPriceSales: this.denomination.salesPrice,
goodsPrice: this.denomination.salesPrice,
orderCode,
result: status?'成功':'失败'
result: status ? '成功' : '失败'
}
}
let logs = window.vm.trackConfig({
......@@ -164,4 +165,4 @@ export default {
window.vm.track.collect(logs);
}
}
}
}
\ No newline at end of file
......@@ -124,17 +124,20 @@ export default {
async buyCard() {
this.showLoading();
let payMannerId;
let orderSource = 3
const ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
payMannerId = 5; //6
payMannerId = 6; //6
orderSource = 3
} else {
payMannerId = 6; //2
payMannerId = 2; //2
orderSource = 2
}
let para = {
merchantId: this.merchantId,
orderCode: this.orderCode,
payMannerId: payMannerId,
orderSource: 3,
orderSource: orderSource,
sessionId: this.sessionId,
};
let logs = window.vm.trackConfig({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!