|
|
|
@ -20,12 +20,15 @@ |
|
|
|
选择职位 |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flex jcsb mb40" v-for="(item ,index) in perData.filter_data.recruit" :key="index"> |
|
|
|
<view class="flex jcsb mb40" v-for="(item ,index) in positionList" :key="index"> |
|
|
|
<view class="selectItem" :class="item.recruit_id == selectType0 ? 'sType' : 'dType'" |
|
|
|
@click="clickItem(item, 1)"> |
|
|
|
{{ item.recruit_title }} |
|
|
|
</view> |
|
|
|
<input class="inputSel" v-model="item.num" :disabled="item.recruit_id != selectType0" :style="item.recruit_id == selectType0 ? 'border: 1px solid #85BAFC' : 'border: 1px solid #ffffff'" type="number" placeholder-style="color: #CACACA" placeholder="请输入使用份数" /> |
|
|
|
<input class="inputSel" v-model="useDay" v-if="item.recruit_id == selectType0" style="border: 1px solid #85BAFC" |
|
|
|
type="number" placeholder-style="color: #CACACA" placeholder="请输入使用份数" /> |
|
|
|
<input class="inputSel" value="" :disabled="true" v-else style="border: 1px solid #ffffff" |
|
|
|
type="number" placeholder-style="color: #CACACA" placeholder="请输入使用份数" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
@ -37,7 +40,7 @@ |
|
|
|
毕业院校 |
|
|
|
</view> |
|
|
|
<view style="flex-wrap: wrap;" class="flex"> |
|
|
|
<view class="gaojItem" :class="item == selectType2 ? 'sType' : 'dType'" v-for="(item, index) in perData.filter_data.school" :key="index" @click="clickItem(item, 3)"> |
|
|
|
<view class="gaojItem" :class="item == selectType2 ? 'sType' : 'dType'" v-for="(item, index) in perData.filter_data.graduated_school" :key="index" @click="clickItem(item, 3)"> |
|
|
|
{{ item }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -56,7 +59,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view style="font-size: 32upx;" class="selectBtn">确认使用</view> |
|
|
|
<view style="font-size: 32upx;" class="selectBtn" @click="useEquity">确认使用</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-else style="text-align: center;font-size: 30upx;margin: 60upx; 0;color: #999;">暂无职位</view> |
|
|
|
@ -70,12 +73,12 @@ |
|
|
|
<view class="buyBox"> |
|
|
|
<view class="flex jcsb mb40"> |
|
|
|
<view class="title">购买份数</view> |
|
|
|
<view style="color: #BBBBBB;font-size: 30upx;">剩余: 0天</view> |
|
|
|
<view style="color: #BBBBBB;font-size: 30upx;">剩余: {{dayNum}}{{diyUnit}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="margin-bottom: 40upx;align-items: center;" class="flex"> |
|
|
|
<view style="margin-right: 20upx;font-size: 28upx;">自定义份数:</view> |
|
|
|
<input style="text-align: left;padding-left: 18upx;width: 72%;" class="inputNum" type="number" placeholder-style="color: #CACACA" placeholder="请输入购买份数" /> |
|
|
|
<input style="text-align: left;padding-left: 18upx;width: 72%;" class="inputNum" @input="changeOrderPrice" v-model="diySelect" type="number" placeholder-style="color: #CACACA" placeholder="请输入购买份数" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="selectDay flex jcsb"> |
|
|
|
@ -85,7 +88,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="submitBtn"> |
|
|
|
<view class="submitBtn" @click="buy"> |
|
|
|
立即支付 ¥{{selectOptPrice}}/{{selectOptTxt}} |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -98,62 +101,89 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
list2: [ |
|
|
|
{ |
|
|
|
id: 1, |
|
|
|
txt: '10份' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
txt: '30份' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 3, |
|
|
|
txt: '50份' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 4, |
|
|
|
txt: '100份' |
|
|
|
} |
|
|
|
], |
|
|
|
selectType0: 1, |
|
|
|
selectOptPrice: '', |
|
|
|
selectOptTxt: '', |
|
|
|
selectType1: 1, |
|
|
|
selectType2: 0, |
|
|
|
selectType3: 0, |
|
|
|
dayNum: 0, |
|
|
|
perData: '', |
|
|
|
perData: {}, |
|
|
|
positionList: [], |
|
|
|
useDay: '', |
|
|
|
show: true, |
|
|
|
diySelect: '', |
|
|
|
diyUnit: '', |
|
|
|
diyPrice: '', |
|
|
|
selectOptPrice: '', |
|
|
|
selectOptTxt: '', |
|
|
|
selectType1: 1, |
|
|
|
rights_id: null, |
|
|
|
lock_1: false, |
|
|
|
lock_2: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(e){ |
|
|
|
this.rights_id = e.rights_id; |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.diySelect = ''; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
watch: { |
|
|
|
useDay(nVal){ |
|
|
|
clearTimeout(this.lock_1); |
|
|
|
this.lock_1 = setTimeout(()=>{ |
|
|
|
nVal = Math.floor(nVal); |
|
|
|
// console.log(nVal); |
|
|
|
this.useDay = nVal || ''; |
|
|
|
}, 500) |
|
|
|
}, |
|
|
|
// positionList: { |
|
|
|
// deep:true,// vue2无深层侦听 |
|
|
|
// handler (nPVal) { |
|
|
|
// console.log(nPVal,this.selectType0, 111); |
|
|
|
// clearTimeout(this.lock_1); |
|
|
|
// this.lock_1 = setTimeout(()=>{ |
|
|
|
// console.log(nPVal,this.selectType0); |
|
|
|
// for(let i=0;i<this.positionList.length;i++){ |
|
|
|
// // this.positionList[i].num = '';// 数据层处理了,视图层未刷新 |
|
|
|
// } |
|
|
|
// }, 500) |
|
|
|
// } |
|
|
|
// }, |
|
|
|
diySelect(nVal){ |
|
|
|
clearTimeout(this.lock_2); |
|
|
|
this.lock_2 = setTimeout(()=>{ |
|
|
|
nVal = Math.floor(nVal); |
|
|
|
console.log(nVal, 1111); |
|
|
|
this.diySelect = nVal || ''; |
|
|
|
}, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
clickItem(val, type){ |
|
|
|
// console.log(val, type); |
|
|
|
if(type == 1){ |
|
|
|
this.perData.filter_data.recruit.map(item => { |
|
|
|
item.num = '' |
|
|
|
}) |
|
|
|
this.selectType0 = val.recruit_id |
|
|
|
// 点击职位选项 |
|
|
|
this.selectType0 = val.recruit_id; |
|
|
|
this.useDay = ''; |
|
|
|
// console.log(val, this.positionList); |
|
|
|
} |
|
|
|
if(type == 2){ |
|
|
|
// 点击购买选项 |
|
|
|
this.selectType1 = val |
|
|
|
this.selectOptTxt = val + '份' |
|
|
|
this.selectOptPrice = val * this.diyPrice; |
|
|
|
this.selectOptTxt = val |
|
|
|
for(let key in this.perData.num_data){ |
|
|
|
if(this.perData.num_data[key]==val){ |
|
|
|
this.selectOptPrice = key * this.diyPrice; |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
if(type == 3){ |
|
|
|
// 点击院校选项 |
|
|
|
this.selectType2 = val |
|
|
|
} |
|
|
|
if(type == 4){ |
|
|
|
// 点击优先选项 |
|
|
|
this.selectType3 = val |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -162,24 +192,90 @@ |
|
|
|
rights_id: 5 |
|
|
|
}; |
|
|
|
App._post_form('&p=rights&do=getRightsTypeInfo', data, res => { |
|
|
|
res.data.filter_data.recruit.map(item =>{ |
|
|
|
item.num = '' |
|
|
|
}) |
|
|
|
this.dayNum = res.data.remaining_amount; |
|
|
|
this.diyUnit = res.data.amount_unit; |
|
|
|
this.diyPrice = res.data.price; |
|
|
|
this.perData = res.data |
|
|
|
// this.perData.filter_data.recruit = [] |
|
|
|
this.show = this.perData.filter_data.recruit.length>0 ? true : false |
|
|
|
|
|
|
|
this.perData = res.data; |
|
|
|
console.log(this.perData) |
|
|
|
this.positionList = res.data.filter_data.recruit; |
|
|
|
this.show = this.positionList.length>0 ? true : false; |
|
|
|
|
|
|
|
for(let key in this.perData.num_data){ |
|
|
|
// 初始化购买选项 |
|
|
|
this.selectOptPrice = key * res.data.price; |
|
|
|
this.selectType1 = this.perData.num_data[key]; |
|
|
|
this.selectOptTxt = this.perData.num_data[key]; |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeOrderPrice(e){ |
|
|
|
// console.log(e.detail.value, +(this.diyPrice)); |
|
|
|
if(!!e.detail.value){ |
|
|
|
this.selectOptPrice = (Math.floor(e.detail.value) * +(this.diyPrice)).toFixed(2); |
|
|
|
this.selectOptTxt = Math.floor(e.detail.value) + '份'; |
|
|
|
this.selectType1 = ''; |
|
|
|
}else{ |
|
|
|
for(let key in this.perData.num_data){ |
|
|
|
this.selectOptPrice = (key * this.diyPrice).toFixed(2); |
|
|
|
this.selectType1 = this.perData.num_data[key]; |
|
|
|
this.selectOptTxt = this.perData.num_data[key]; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
useEquity(){ |
|
|
|
let num,school,experience; |
|
|
|
// num = this.positionList.filter(item => { |
|
|
|
// return item.recruit_id == this.selectType0 |
|
|
|
// }); |
|
|
|
for(let key in this.perData.filter_data.graduated_school){ |
|
|
|
if(this.perData.filter_data.graduated_school[key]==this.selectType2){ |
|
|
|
school = key; |
|
|
|
} |
|
|
|
} |
|
|
|
for(let key in this.perData.filter_data.experience){ |
|
|
|
if(this.perData.filter_data.experience[key]==this.selectType3){ |
|
|
|
experience = key; |
|
|
|
} |
|
|
|
} |
|
|
|
let data = { |
|
|
|
rights_id: this.rights_id, |
|
|
|
position: JSON.stringify([{recruit_id: this.selectType0,num:this.useDay}]), |
|
|
|
graduated_school: school, |
|
|
|
experience: experience |
|
|
|
} |
|
|
|
console.log(data); |
|
|
|
App._post_form('&p=rights&do=memberUseRights', data, res => { |
|
|
|
console.log(res); |
|
|
|
uni.showToast({ |
|
|
|
title: res.message |
|
|
|
}) |
|
|
|
this.getData(); |
|
|
|
},(err)=>{},(com)=>{}) |
|
|
|
}, |
|
|
|
buy(){ |
|
|
|
let user = uni.getStorageSync('userinfo'); |
|
|
|
let num; |
|
|
|
for(let key in this.perData.num_data){ |
|
|
|
if(this.perData.num_data[key]==this.selectType1){ |
|
|
|
num = key; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let data = { |
|
|
|
rights_id: this.rights_id, |
|
|
|
type: 1, |
|
|
|
num: num || this.diySelect, |
|
|
|
contacts: user.nickname, |
|
|
|
contact_phone: user.truemobile |
|
|
|
}; |
|
|
|
console.log(data) |
|
|
|
App._post_form('&p=rights&do=createRightsPay', data, res => { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/mainPages/payment/payment?orderid=' + res.data.orderid + '&plugin=' + res.data.type |
|
|
|
}) |
|
|
|
console.log(res.data) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|