App-Android(使用App+htnl5框架,解决消息推送兼容SignalR问题)
loulijun2021
2022-10-22 40711118c33369ccad7ceda0fdd729bd9f117f65
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>rpx4html-demo</title>
        <!-- <script src="../../js/rpx4html.js"></script> -->
 
 
        <!-- 引入样式文件 -->
        <link rel="stylesheet" href="../../css/vant.css" />
        <!-- 引入 Vue 和 Vant 的 JS 文件 -->
        <script src="../../js/vue.min.js"></script>
        <script src="../../js/vant.min.js"></script>
 
        <style>
            html,
            body {
                padding: 0;
                margin: 0;
                width: 100%;
                height: 100%;
            }
 
            .test {
                width: 750px;
                height: 100px;
                font-size: 32px;
                font-weight: bold;
                background-color: #2e66af;
                color: white;
                display: flex;
                justify-content: center;
                align-items: center;
                font-family: 'PingFangSC-Regular', '微软雅黑', 'Arial';
            }
        </style>
 
 
    </head>
    <body>
        <div id="app">
            <!-- <div class="test">标题栏</div> -->
            <div style="height: 50px;">
                <van-nav-bar title="标题" left-text="返回" right-text="按钮" left-arrow style="height: 1rem;width: 100%;"
                    @click-left="onClickLeft" @click-right="onClickRight" />
            </div>
            <div>
                <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
 
                    <div>
                        我的爱好是
                        <span @click='click' v-for="(item,index) in list" :key="index">
                            {{item}}{{index==list.length-1?'':','}}
                            <span>
                    </div>
                    <van-radio-group v-model="radio">
                        <van-radio name="1">单选框 1</van-radio>
                        <van-radio name="2">单选框 2</van-radio>
                    </van-radio-group>
                    <van-button type="primary">主要按钮</van-button>
 
 
                    <!-- <van-dialog v-model="show" title="标题" show-cancel-button>
                <img src="https://img01.yzcdn.cn/vant/apple-3.jpg" />
            </van-dialog> -->
 
                    <p>刷新次数: {{ count }}</p>
                </van-pull-refresh>
<!-- 
                <van-card num="2" tag="标签" price="2.00" desc="描述信息" title="商品标题"
                    thumb="https://img01.yzcdn.cn/vant/ipad.jpeg" origin-price="10.00" /> -->
 
 
                    <van-popover
                  v-model="showPopover"
                  trigger="click"
                  :actions="actions"
                  @select="onSelect"
                >
                  <template #reference>
                    <van-button type="primary">浅色风格</van-button>
                  </template>
                </van-popover>
                
            <van-dropdown-menu :overlay="false" style="width: 100px;">
                <van-dropdown-item style="width: 100px;" v-model="value1" :options="option1" />
            </van-dropdown-menu>
            
            
            
            <van-radio-group v-model="radio">
              <van-cell-group>
                  <div>1</div>
                <van-cell title="单选框 1" clickable @click="radio = '1'">
                  <template #right-icon>
                    <van-radio name="1" />
                  </template>
                </van-cell>
                  <div>2</div>
                  <div>3</div>
                <van-cell title="单选框 2" clickable @click="radio = '2'">
                  <template #right-icon>
                    <van-radio name="2" />
                  </template>
                </van-cell>
                <div>4</div>
              </van-cell-group>
            </van-radio-group>
            
            </div>
        </div>
    </body>
 
 
    <script>
        var app = new Vue({
            el: '#app',
 
            data: function() {
                return {
                    list: ['听音乐', '旅游', '打游戏'],
                    radio: '',
                    show: false,
                    count: 0,
                    isLoading: false,
                    showPopover: false,
                    // 通过 actions 属性来定义菜单选项
                    actions: [{
                        text: '选项一'
                    }, {
                        text: '选项二'
                    }, {
                        text: '选项三'
                    }],
                  value1: 0,
                      // value2: 'a',
                      option1: [
                        { text: '全部商品', value: 0 },
                        { text: '新款商品', value: 1 },
                        { text: '活动商品', value: 2 },
                      ],
                      // option2: [
                      //   { text: '默认排序', value: 'a' },
                      //   { text: '好评排序', value: 'b' },
                      //   { text: '销量排序', value: 'c' },
                      // ],
                }
            },
            created() {
                // console.log({
                //     Vue
                // })
                // console.log(vant.Toast('xxx'))
            },
            methods: {
 
                onSelect(action) {
                    Toast(action.text);
                },
                onClickLeft() {
 
                },
                onClickRight() {
 
                },
                onRefresh() {
                    setTimeout(() => {
                        // Toast('刷新成功');
                        vant.Notify('通知内容');
                        // vant.Toast('xxx')
                        this.isLoading = false;
                        this.count++;
                    }, 1000);
                },
                click() {
                    console.log(window)
                    console.log('111')
                    // this.show=true
                    vant.Dialog.confirm({
                            title: '标题',
                            message: '弹窗内容',
                        })
                        .then(() => {
                            // on confirm
                        })
                        .catch(() => {
                            // on cancel
                        });
                }
            }
        })
        // 通过 CDN 引入时不会自动注册 Lazyload 组件
        // 可以通过下面的方式手动注册
 
        // Vue.use(vant.Lazyload);
        // Vue.use(vant.Button);
        // Vue.use(vant.TreeSelect);
        // Vue.use(vant.Dialog);
        // Vue.use(vant.Notify);
    </script>
</html>