chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
 
<div id="helpVue" class="none">
    <div class="Friends_help_header_warn">
        <div class="help_header_warn_icon">
            <img src="{yun:}$wap_style{/yun}/images/Friends_help_trumpet.png" alt="" width="100%" height="100%">
        </div>
        <div class="help_header_warn_text">参加活动需满足:至少有1个正在招聘中的职位</div>
    </div>
    <!-- 整体部分 -->
    <div class="Friends_help_body">
        <div class="help_body_banner" @click="addHelp">
            <img src="{yun:}$wap_style{/yun}/images/dredge_invite.png" alt="">
        </div>
        <div class="Friends_help_card" v-if="helping">
            <div class="Friends_help_card_title">活动助力进行中</div>
            <div class="help_card_linetiem">
                <div class="help_card_linetiem_name">活动时间</div>
                <div class="help_card_linetiem_time">{{helpInfo.stime_n}} 至 {{helpInfo.etime_n}}</div>
            </div>
 
            <div v-if="zlNum > 0">
                <div class="Friends_help_center" >
                    <div class="Friends_help_center_text">共有<i>{{zlNum}}</i>位好友为您助力,</div>
                    <div class="center_text" @click="getLog(helpInfo.id)">
                        <div class="center_text_ti">查看好友助力</div>
                        <div class="center_text_icon">
                            <img src="{yun:}$wap_style{/yun}/images/Friends_help_next.png" alt="" width="100%" height="100%">
                        </div>
                    </div>
                </div>
                <div class="Friends_help_btn" @click="getPackage(helpInfo.id)">领取权益</div>
            </div>
            <div v-else>
                <div class="Friends_help_center" >
                    <div class="Friends_help_center_text">共有<i>0</i>位好友为您助力,</div>
                </div>
                <div class="Friends_help_btn" @click="addHelp">邀请好友</div>
            </div>
        </div>
 
        <div class="Friends_help_card" v-for="(item,hKey) in helpList" :key="hKey">
            <div class="Friends_help_card_title">活动助力已结束</div>
            <div class="help_card_linetiem">
                <div class="help_card_linetiem_name">活动时间</div>
                <div class="help_card_linetiem_time">{{item.stime_n}} 至 {{item.etime_n}}</div>
            </div>
            <div class="Friends_help_center">
                <div class="Friends_help_center_text">共有<i>{{item.zlnum}}</i>位好友为您助力;</div>
                <div class="center_text" v-if="item.zlnum > 0" @click="getLog(item.id)">
                    <div class="center_text_ti">查看好友助力</div>
                    <div class="center_text_icon">
                        <img src="{yun:}$wap_style{/yun}/images/Friends_help_next.png" alt="" width="100%" height="100%">
                    </div>
                </div>
            </div>
            <div class="Friends_help_equity" v-if="item.zlnum > 0">
                <div class="help_equity_title">获得权益</div>
                <div class="help_equity_body">
                    <div v-for="(packList,gKey) in item.getpackage" :key="gKey">
                        <div class="equity_body_post">{{packList.name}}<i>{{packList.num}}</i>次</div>
                    </div>
                </div>
            </div>
            <div v-if="item.zlnum > 0">
                <div class="Friends_help_forbidbtn" v-if="item.state == 1">已领取权益</div>
                <div class="Friends_help_btn" @click="getPackage(item.id)" v-else>领取权益</div>
            </div>
        </div>
 
        <div v-if="total>limit">
            <van-pagination v-model="page" :total-items="total" :items-per-page="limit" force-ellipses @change="pageChange" />
        </div>
 
    </div>
 
    <van-popup v-model="showOther" position="center">
        <div class="tck_bg"></div>
        <div class="help_hytck">
            <div class="help_hytck_tit">助力好友<img src="{yun:}$wap_style{/yun}/images/close.png" class="help_hytck_close" @click="showOther=false"></div>
            <div class="help_hytck_tx_box">
                <div class="help_hytck_tx">
                    <div v-for="(item,okey) in otherLog" :key="okey">
                        <img :src="item.wxpic" class="help_hytck_tx_img">
                    </div>
                </div>
            </div>
        </div>
    </van-popup>
 
</div>
<script>
    var wapurl = '{yun:}url m=wap{/yun}';
    var currentPage = parseInt('{yun:}$smarty.get.page{/yun}') || 1;
    var helpVue = new Vue({
        el: '#helpVue',
        data() {
            return {
                helpInfo: {},
                helping: false,
 
                helpList: [],
 
                logList: [],
 
                zlNum: 0,
                otherLog: [],
                showOther: false,
                page: currentPage,
                limit: 10,
                total:0
            }
        },
        computed: {
            helpCount() {
                if (this.total > this.limit) {
                    return 2;
                } else if (this.helpList.length == 0) {
                    return 0;
                } else {
                    return 1;
                }
            }
        },
        created() {
            this.getHelp();
        },
        methods: {
            getHelp: function () {
                var that = this;
                var param = {
                    page: that.page,
                    limit: that.limit
                };
                showLoading();
                $.post('{yun:}url d=wxapp h=com m=friendhelp{/yun}', param, function (data) {
                    hideLoading();
                    if (data.error == 0) {
                        let res = data.data;
                        if (res.helpinfo) {
                            that.helpInfo = res.helpinfo;
                            that.zlNum = parseInt(res.helpinfo.zlnum);
                            that.logList = res.loglist;
                            that.helping = res.helping;
                        }
                        if (res.list && res.list.length > 0) {
                            that.helpList = that.helpList.concat(res.list);
                        }
                        that.total = res.total ? res.total : 0;
                        $('#helpVue').css('display', 'block');
                    }
                }, 'json')
            },
            addHelp:function () {
                var that = this;
                var param = {
                    rand: Math.random()
                };
                showLoading();
                $.post('{yun:}url d=wxapp h=com m=friendhelp c=addfriendhelp{/yun}', param, function (data) {
                    hideLoading();
                    if (data.error == 0) {
                        let res = data.data;
 
                        window.location.href = wapurl+ 'index.php?c=friendhelp&a=share&id='+res.id+'&token='+res.token;
                    } else {
                        showModal(data.msg);
                    }
                }, 'json')
            },
            getPackage:function (id) {
                var that = this;
                var param = {
                    id: id
                };
                showLoading();
                $.post('{yun:}url d=wxapp h=com m=friendhelp c=getpackage{/yun}', param, function (data) {
                    hideLoading();
                    if (data.msg) {
                        showModal(data.msg);
                    }else{
                        showModal('领取失败');
                    }
                }, 'json')
            },
            getLog:function (id) {
 
                var that = this;
                var param = {
                    id: id
                };
 
                showLoading();
                $.post('{yun:}url d=wxapp h=com m=friendhelp c=getlog{/yun}', param, function (data) {
                    hideLoading();
                    if (data.error == 0) {
                        let res = data.data;
                        that.otherLog = res.loglist;
                        that.showOther = true;
                    }
                }, 'json')
            },
            pageChange:function(e){
                location.href = 'index.php?c=friendhelp&page='+e;
            }
        }
    })
</script>
 
</body>
</html>