1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
| <template>
| <view>
|
| <!-- taobao -->
| <u-popup v-model="empowerModel" mode="center" border-radius="12">
| <empowerModel @closemodel='closeMdl' @updataInfo='updataUser'></empowerModel>
| </u-popup>
| </view>
|
| </template>
|
| <script>
| import empowerModel from '../../components/empowerModel.vue'
| var wv;
| export default {
| components: {
| empowerModel
| },
| data() {
| return {
| user:'',
| webshow:true,
| empowerModel: false,
| }
| },
| onLoad(options) {
| console.log(options);
| if(options.needlogin)
| {//是否需要登录
| if(!this.hasLogin){
| uni.reLaunch({
| url:"/pages/login/wxlogin"
| })
| }
| }
| switch(options.trantype)
| {
| case "totb":
| this.targetTb(options.tburl);
| break;
| }
| if(options.back)
| {
| uni.navigateBack({
| delta: 1
| });
| }
| },
| onReady() {
|
| },
|
| methods: {
| targetTb(tburl)
| {
| // #ifdef APP-PLUS
| if (plus.runtime.isApplicationExist({
| pname: 'com.taobao.taobao',
| action: 'taobao://'
| })) {
| const plug = uni.requireNativePlugin('xiguazhu-baichuan')
| plug.detailPage({
| url: tburl,
| "openType": 0
| }, result => {
| });
| } else {
| uni.navigateTo({
| url:'@/webView/webView?url=' + tburl
| })
| }
| // #endif
| },
| closeMdl() {
| this.empowerModel = false;
| this.webshow=true;
| },
| openTbMd()
| {
| this.webshow=false;
| this.empowerModel = true
| },
| updataUser() {
| var that = this;
| this.$u.api.getUserInfo({}).then(e => {
| utils.setCache('userInfo', e.data.userinfo)
| that.user = e.data.userinfo;
| }).catch(function(err) {})
| },
| },
| }
| </script>
|
| <style>
|
| </style>
|
|