Commit fc9e3a70 by 李嘉林

原生订单详情页

parent cbba0fca
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
"pages/memberCode/main", "pages/memberCode/main",
"pages/toMini/main", "pages/toMini/main",
"pages/paySuccess/main", "pages/paySuccess/main",
"pages/stateAccountList/main" "pages/stateAccountList/main",
"pages/order/main"
], ],
"subPackages": [ "subPackages": [
{ {
......
<!-- 原生订单页面 -->
<template>
<div class="order">
<web-view v-if="showPage" :src="newPageUrl" @message="getMessage" @error="handleError"
@load="handleLoad"></web-view>
</div>
</template>
<script type="text/ecmascript-6">
let forUrlAddKey = require("mayi-front-tools/forUrlAddKey").default;
import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
const app = getApp();
const { log } = app;
export default {
name: "order",
data() {
return {
showPage: false,
newPageUrl: "",
shopId: this.$store.state.mixid,
baseUrl: process.env.BASE_URL,
page: "/order/orderList",
params: "?mixid=" + this.$store.state.mixid + `&native_test=1`,
}
},
components: {},
computed: {
pageUrl() {
if (wx.getStorageSync("sessionid")) {
this.params += `&sessionid=${wx.getStorageSync("sessionid")}`;
}
if (wx.getStorageSync("enterpriseAccount")) {
this.params += `&enterpriseAccount=${wx.getStorageSync("enterpriseAccount")}`;
}
console.log(this.baseUrl, '=======', this.page, '++++++++++++++', this.params, '************')
let pageUrl1 = (this.page.startsWith('http://') || this.page.startsWith('https://')) ? (this.page + this.params) : this.baseUrl + this.page + this.params
console.log(pageUrl1, '--------pageUrl1--')
let pageUrl = forUrlAddKey(decodeURIComponent(pageUrl1));
console.log(pageUrl, '--------pageUrl')
return pageUrl;
},
},
watch: {
pageUrl() {
console.log(wx.getStorageSync("sessionid"), '--wx.getStorageSync("sessionid")')
this.newPageUrl = this.pageUrl;
},
},
created() { },
mounted() { },
onLoad(options) {
this.newPageUrl = this.pageUrl;
console.log(this.newPageUrl,wx.getStorageSync("sessionid"), '----------------------52')
if (wx.getStorageSync("sessionid")) {
this.showPage = true;
} else {
// 跳转到登录
let backUrl = `/pages/order/main`;
const url = `/pages/login/main?back=${encodeURIComponent(
backUrl
)}&hideBack=1`;
wx.navigateTo({
url: url
});
}
},
onShow() {
console.log('order页面------onShow')
log.info('order页面------onShow')
},
methods: {
getMessage(res) {
console.log(res, '----------------23')
},
//加载成功
handleLoad() {
log.info('网页加载成功');
},
handleError(data) {
log.info('handleError', data)
wx.showLoading({
title: "网页加载失败 请右上角刷新"
});
this.$mpAnalytics.recordError({
data,
extendsInfo: {
mixid: this.$store.state.mixid || null
}
});
},
}
}
</script>
<style lang="scss" scoped>
.order {}
</style>
import Vue from 'vue'
import App from './index'
const app = new Vue(App)
app.$mount()
{}
\ No newline at end of file
...@@ -203,7 +203,11 @@ export default { ...@@ -203,7 +203,11 @@ export default {
if (this.link.includes('$%7Btoken%7D') && wx.getStorageSync("sessionid")) { if (this.link.includes('$%7Btoken%7D') && wx.getStorageSync("sessionid")) {
this.getSsoBcakUrl(decodeURIComponent(this.link)); this.getSsoBcakUrl(decodeURIComponent(this.link));
} }
if ((!this.link.includes('sessionid')) && wx.getStorageSync("sessionid")) {
this.link +=`${this.link.includes('?')?'&':'?'}sessionid=${wx.getStorageSync("sessionid")}`
}
this.useLink = this.link; this.useLink = this.link;
console.log(this.useLink,'--this.useLink')
}, },
}, },
methods: { methods: {
......
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