cshenfu
2023-06-02 82be1991acab9b8d15c78fb6e2d6e9d9069074fa
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<template>
    <view class="home-bg">
        <view class="margin-top-xl home-head">
            <div class="gq"></div>
            <view v-if="config.site_title" class="flex align-center justify-center flex-direction padding">
                <image v-if="config.site_title" :src="main_model.icon ? `${setting_data.base_url+main_model.icon}` : ''" mode="aspectFill"
                    style="background-color: #f4f5f6;width: 200rpx;height: 200rpx;" class="round"></image>
                <view class="text-bold text-xxl padding-tb"> {{ main_model.title ? main_model.title : '专业版' }} </view>
                <!-- <view style="width: calc(100vw - 60rpx);" class="padding-bottom" v-if="config.home_notice">
                    <u-notice-bar :text="config.home_notice" mode="closable"></u-notice-bar>
                </view> -->
            </view>
        </view>
        <view class="flex justify-center align-center flex-direction">
            <button @click="toChat" style="width: calc(100vw - 60rpx); height: 100rpx;" class="cu-btn text-bold chat-button">
                开始咨询 (余{{num}}次) </button>
        </view>
        <view class="tool padding-top-xl">
            <view class="header">
                <view class="title text-bold">功能特性</view>
            </view>
            <u-transition :show="true" mode="slide-up">
                <view class="grid">
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01v7Y9311o5k2r5Rwaq_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">AI回答</view>
                        <view class="desc">浩繁法条直取答案</view>
                    </view>
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01H200mY1o5k2ythU1B_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">智能答案</view>
                        <view class="desc">免去千篇一律</view>
                    </view>
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01FDSoxG1o5k2xjTHUD_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">精准定位</view>
                        <view class="desc">免去繁琐搜索</view>
                    </view>
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i4/2064565174/O1CN01UP4ksa1o5k2rDpdOP_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">引导提示</view>
                        <view class="desc">AI发散思维</view>
                    </view>
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i2/2064565174/O1CN01Oep4C01o5k2zlWs2q_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">安全限制</view>
                        <view class="desc">道德逻辑自洽</view>
                    </view>
                    <view class="item">
                        <view class="icon">
                            <u-icon size="28"
                                name="https://img.alicdn.com/imgextra/i1/2064565174/O1CN01onUFC01o5k2uPHOqj_!!2064565174.png">
                            </u-icon>
                        </view>
                        <view class="title">在线工具</view>
                        <view class="desc">无需下载软件</view>
                    </view>
                </view>
            </u-transition>
        </view>
        <view class="padding-tb" v-if="config.copyright">
            <u-loadmore :line="true" status="loadmore" :loadmoreText="config.copyright" color="#909399"></u-loadmore>
        </view>
        <m-tabbar v-if="showTab" fixed fill :current="tabIndex" :tabbar="tabbar"></m-tabbar>
    </view>
</template>
 
<script>
    import setting from "@/common/config.js"
    import wx from '../../node_modules/jweixin-module/lib/index.js'
    import {
        mapState
    } from 'vuex';
    import mixin from "@/mixin/checkLoaded";
    export default {
        mixins: [mixin],
        data() {
            return {
                client_id: "",
                showTab: false,
                tabIndex: 0,
                setting_data:'null',
                user_data:'null',
                shar_openid:'null',
                open_id_data
            }
        },
        computed: {
            ...mapState(['config', 'num', 'userInfo', 'token', 'main_model', 'tabbar'])
        },
        onLoad(op) {
            this.getTabIndex()
            // #ifdef MP-WEIXIN || MP-JD
            uni.hideHomeButton()
            // #endif
            
            this.setting_data = setting
            
            
            
            
        },
        created() {
            let st_open = uni.getStorageSync('openid')
            this.shar_openid = st_open
            var url_local = location.href.split("#")[0]
            this.open_id_data = this.$store.state.userInfo.openid
            var urlLink = "http://ai.shsening.com/gpth5/#/pages/index/home?openid="+this.open_id_data
            this.$request("/api/Member/wxH5ShareId",'POST',{
                url:url_local
            }).then((res) => {
                this.user_data = res.data
                    wx.config({
                      debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来,若要查看传入的参数,可以在 pc 端打开,参数信息会通过 log 打出,仅在 pc 端时才会打印。
                      appId: this.user_data.appId, // 必填,公众号的唯一标识
                      timestamp: this.user_data.timestamp, // 必填,生成签名的时间戳
                      nonceStr: this.user_data.nonceStr, // 必填,生成签名的随机串
                      signature: this.user_data.signature, // 必填,签名
                      jsApiList: [
                        'updateAppMessageShareData',
                        'updateTimelineShareData',
                        'onMenuShareTimeline',
                        'onMenuShareAppMessage',
                        'onMenuShareQQ',
                        'onMenuShareQZone'
                      ] // 必填,需要使用的JS接口列表
                    })
            
                    wx.ready(function () {
                      //分享到好友
                      wx.updateAppMessageShareData({
                        title: "ChatFox", // 分享标题
                        desc: "ChatFox", // 分享描述
                        link: urlLink, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
                        imgUrl: "@/static/h5/download-app/ios.png", // 分享图标
                        success: function () {
                          // 设置成功
                          console.log('成功')
                        },
                        cancel: function () {
                          // 用户取消分享后执行的回调函数
                          console.log('取消')
                        },
                        fail: function () {
                          // 用户分享失败后执行的回调函数
                          console.log('失败')
                        }
                      })
                      //分享到朋友圈
                      wx.updateTimelineShareData({
                       title: "ChatFox", // 分享标题
                       link: urlLink, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
                       imgUrl: "@/static/h5/download-app/ios.png", // 分享图标
                        success: function () {
                          // 设置成功
                        }
                      })
                    })
                    
            });
        },
        onShareAppMessage() {
            console.log('转发+1')
        },
        methods: {
            getTabIndex() {
                let list = this.tabbar.list;
                for (var i = 0; i < list.length; i++) {
                    if (list[i].pagePath == '/pages/index/home') {
                        this.tabIndex = i
                        this.showTab = true
                    }
                }
            },
            toChat() {
                if (!this.userInfo.token) {
                    uni.navigateTo({
                        url: "/pages/login/newlogin"
                    })
                    return
                }
                uni.navigateTo({
                    url: "./chat?model=" + JSON.stringify(this.main_model)
                })
            },
            toTax() {
                uni.showModal({
                    content: "待开放,模型训练中..."
                })
            }
        }
    }
</script>
<style lang="scss">
    @import url("@/static/style/color-ui.css");
    
    .home-bg {
      background: url('@/static/home_bg.jpg') #ecf4fd no-repeat;
      background-size: 100% auto;
      background-position: 0 -32px;
      box-sizing: border-box;
      padding-top: 128rpx;
    }
    
    .home-head{
        position: relative;
        .gq{
            position: absolute;
            width: 328rpx;
            height: 328rpx;
            background: url('@/static/gq.png');
            background-size: 100% 100%;
            left: -164rpx;
            top: -40rpx;
            margin-left: 50%;
            z-index: 9;
        }
        .text-bold{
            color: #fff;
            margin-top: 12rpx;
            margin-bottom: 72rpx;
        }
    }
    .margin-top-xl{
        margin: 0;
    }
    .chat-button{
        background: #302cd9 !important;
        color: #fff;
        box-shadow: 0 2px 6px rgba(48,44,217,.5);
    }
    
    .tool {
        width: calc(100vw - 60rpx);
        margin: 15rpx auto;
 
        .header {
            .title {
                margin-bottom: 30rpx;
            }
        }
 
        .grid {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-between;
 
            .item {
                width: calc(calc(100vw - 60rpx - 30rpx) / 3);
                display: flex;
                flex-direction: column;
                align-items: center;
                background-color: #fff;
                margin: 12rpx 0rpx;
                padding: 30rpx 0rpx;
                border-radius: 10rpx;
 
                .title {
                    color: #30324f;
                    font-size: 28rpx;
                    margin-top: 15rpx;
                }
 
                .desc {
                    color: #93949d;
                    font-size: 24rpx;
                }
            }
        }
    }
</style>