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
212
213
214
215
216
{yun:}include file="$wapstyle/header_gq.htm"{/yun}
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/style.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/umeditor/themes/default/css/umeditor.min.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
 
<!--任务发布-->
<div id="main" class="none">
    <van-form  @submit="pubTask">
        <van-field v-model="name" name="name" label="项目名称" placeholder="请填写项目名称"  input-align="right"></van-field>
        <van-field v-model="salary" name="salary" label="价格预算" placeholder="元"  input-align="right"></van-field>
        <van-field v-model="edate" name="edate" type="digit" label="预计工期" placeholder="天" input-align="right"></van-field>
        <van-field
              readonly
              clickable
              name="etime"
              :value="etime"
              label="接单截止时间"
              placeholder="请选择接单截止时间"
              input-align="right"
              @click="showCalendar = true">
        </van-field>
        <van-calendar v-model="showCalendar" @confirm="onConfirm" ></van-calendar>
 
        <van-cell-group>
            <van-cell title="项目需求" is-link @click="onProDescShow" placeholder="请填写">{{content | ellipsis}}</van-cell>
        </van-cell-group>
 
        <div class="yun_newwap_bth ">
            <input type="hidden" id="time" name="time" value="{yun:}$time{/yun}">
            <input id="id" name="id" value="{yun:}$rows.id{/yun}" type="hidden">
             <input type="hidden" id="state" name="state"  value="{yun:}if $rows.state{/yun}{yun:}$rows.state{/yun}{yun:}else{/yun}1{yun:}/if{/yun}">          
            <input id="pay" name="pay" value="{yun:}if $rows.pay{/yun}{yun:}$rows.pay{/yun}{yun:}else{/yun}{yun:}$pay{/yun}{yun:}/if{/yun}" type="hidden"> 
        </div>
        
        <van-field v-model="link_man" name="link_man" label="联系人" placeholder="请填写联系人"  input-align="right"></van-field>
        <van-field v-model="link_moblie" name="link_moblie" label="联系电话" placeholder="请填写联系电话"  input-align="right"></van-field>
        <van-button block type="info" >发布项目</van-button>
    </van-form>
    <van-popup  v-model="proDescShow"  closeable close-icon-position="top-left" position="right" :style="{ height: '100%',width:'100%'}">
        <div style="margin-top: 15%">
            <van-field
                v-model="content"
                rows="10"
                autosize
                label="项目描述"
                type="textarea"
                maxlength="500"
                placeholder="请输入项目描述描述500字以内"
                show-word-limit
            />
        </div>
 
        <div style="margin: 16px;">
            <van-button block type="info" @click="proDesc">确定</van-button>
        </div>
    </van-popup>
</div>
{yun:}include file="$wapstyle/publichtm/public_js.htm"{/yun}
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$wap_style{/yun}/js/umeditor/umeditor.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script language="javascript">
    $(document).ready(function(){
        var num = '{yun:}$num{/yun}';
        if(parseInt(num) > 0 ) {
            showConfirm('您还有{yun:}$num{/yun}个订单未付款,是否继续发布!',function(){
                setTimeout(function() {
                    location.href = "index.php?c=free&a=paylog";
                }, 0);
            },'继续发布','去付款');
        }
    });
    var formData = new FormData();
    var weburl = "{yun:}$config.sy_weburl{/yun}";
    var wapurl = "{yun:}url m=wap{/yun}";
    var headerUrl = "{yun:}if $backurl{/yun}{yun:}$backurl{/yun}{yun:}else{/yun}javascript:goBack();{yun:}/if{/yun}";
    var vm = new Vue({
        el: '#main',
        data:{
            proDescShow:false,
            showCalendar:false,
            name:'{yun:}$rows.name{/yun}',
            salary:'{yun:}$rows.salary{/yun}',
            edate:'{yun:}$rows.edate{/yun}',
            etime:'{yun:}if $rows.etime{/yun}{yun:}$rows.etime|date_format:'%Y-%m-%d'{/yun}{yun:}/if{/yun}',
            content:'{yun:}$rows.content{/yun}',
            link_man:'{yun:}if $rows.link_man{/yun}{yun:}$rows.link_man{/yun}{yun:}else{/yun}{yun:}$gqinfo.name{/yun}{yun:}/if{/yun}',
            link_moblie:'{yun:}if $rows.link_moblie{/yun}{yun:}$rows.link_moblie{/yun}{yun:}else{/yun}{yun:}$gqinfo.moblie{/yun}{yun:}/if{/yun}',
        },
        created(){
            $('#main').css('display', 'block');
        },
        filters: {
            ellipsis (value) {
              if (value && value.length > 3) {
                return value.slice(0,3);
              }
              return value;
            }
          },
        methods: {
            proDesc(value){
                this.proDescShow=false;
                $('#pop_show').attr('href',headerUrl);
                return false;
            },
            pubTask(value, index) {
                pubTaskSubmit(value, this.content);
            },
            onConfirm(date) {
                 this.etime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
                 this.showCalendar = false;
            },
            onProDescShow(){
                this.proDescShow = true;
                $('#pop_show').attr('href',"#");
                $('#pop_show').click(function(){
                    show();
                });
            }
        }
    });
 
    function show(){
        vm.$data.proDescShow = false;
        setTimeout(function() {
            $('#pop_show').attr('href',headerUrl);
        }, 0);
    }
 
    function pubTaskSubmit(that, content){
        var state = $.trim($('#state').val()),
            time = $.trim($('#time').val()),
            pay = $.trim($('#pay').val()),
            id = $.trim($('#id').val());
            if(!id || id == '') {
                id = 0;
            } else {
                id = id;
            }
            if(that.name == '') {
                return showToast('请填写项目名称!');
            }
            if(that.salary == '') {
                return showToast('请填写价格预算!');
            }
            if(that.edate == '') {
                return showToast('请填写预计工期!');
            }
            if(that.etime == '') {
                return showToast('请选择接单截止时间!');
            }else{
                if(time>that.etime){
                    return showToast('接单截止时间不能小于当前时间!');
                }
            }
            if(content == '') {
                return showToast('请填写项目需求!');
            }
            if(that.link_man == '') {
                return showToast('请填写联系人!');
            }
            if(that.link_moblie == '') {
                return showToast('请填写联系电话!');
            }else{
                if(isjsMobile(that.link_moblie)==false){
                    return showToast('联系电话格式错误!');
                }
            }
            formData.append('name', that.name);
            formData.append('salary', that.salary);
            formData.append('edate', that.edate);
            formData.append('etime', that.etime);
            formData.append('state', state);
            formData.append('content', content);
            formData.append('link_man', that.link_man);
            formData.append('link_moblie', that.link_moblie);
            formData.append('pay', pay);
            formData.append('id', id);
            formData.append('submit', 1);
            showLoading()
            $.ajax({
                url: wapurl +"index.php?c=free&a=addtask",
                type: 'post',
                data: formData,
                contentType: false,
                processData: false,
                dataType: 'json',
                success: function(res) {
                    hideLoading();
                    var res = JSON.stringify(res);
                    var data = JSON.parse(res);
                    if(data.errcode==10) {
                        showToast(data.msg, 2, function() {
                            location.href = data.url;
                        });
                    } else if(data.errcode==9) {
                        showToast(data.msg, 2, function() {
                            location.href = wapurl +"index.php?c=free&a=tasklist";
                        });
                    } else {
                        showToast(data.msg, 2);
                        return false;
                    }
                }
            })
    }
 
var umeditor = UM.getEditor('content', {
    toolbar: false,
    elementPathEnabled: false,
    wordCount: false,
    autoHeightEnabled: false
});
</script>
{yun:}include file="$wapstyle/member/public/phptoast.htm"{/yun}
</body>
</html>