| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <template>
- <view class="box">
- <view class="padding-t-20">
- <view class="alertItemTitle">
- 职业类型
- </view>
- <view class="flex alertTypeBox">
- <view class="alertTypeItem" @click="search.work_type_id=ltt.id" :key='inde'
- v-for="(ltt,inde) in workTypeList" :class="{action:search.work_type_id==ltt.id}">
- <text>
- {{ltt.title}}
- </text>
- </view>
- </view>
- <view class="alertItemTitle">
- 价格类型
- </view>
- <view class="flex alertTypeBox">
- <view class="alertTypeItem" :class="{action:search.timetype===''}" @click="search.timetype=''">
- <text>
- 无
- </text>
- </view>
- <view class="alertTypeItem" :class="{action:search.timetype==='hour'}" @click="search.timetype='hour'">
- <text>
- 小时
- </text>
- </view>
- <view class="alertTypeItem" :class="{action:search.timetype==='day'}" @click="search.timetype='day'">
- <text>
- 每天
- </text>
- </view>
- <view class="alertTypeItem" :class="{action:search.timetype==='month'}"
- @click="search.timetype='month'">
- <text>
- 每月
- </text>
- </view>
- </view>
- <view class="alertItemTitle" v-if="search.timetype!==''">
- 最低价格
- </view>
- <input v-if="search.timetype!==''" v-model="search.servicePrice" class="minMoney" type="number"
- placeholder-class="placeholderText" placeholder="自定义最低价格">
- <view class="alertItemTitle">
- 服务区域
- </view>
- <view class="flex alertTypeBox">
- <view class="alertTypeItem" :class="{action:search.is_china===''}" @click="search.is_china=''">
- <text>
- 全部
- </text>
- </view>
- <view class="alertTypeItem" :class="{action:search.is_china===1}" @click="search.is_china=1">
- <text>
- 国内
- </text>
- </view>
- <view class="alertTypeItem" :class="{action:search.is_china===0}" @click="search.is_china=0">
- <text>
- 国外
- </text>
- </view>
- </view>
- <view v-if="search.is_china===1" class="alertItemTitle">
- 区域选择
- </view>
- <view v-if="search.is_china===1" class="right">
- <view class="citylist">
- <view class="">
- <view class="flex margin-b-20" v-for="(item,ind) in search.service_area" :key="ind">
- <view>
- {{item.province+item.city+item.district}}
- <text class="margin-l-10 del" @click="search.service_area.splice(ind,1)">
- 删除
- </text>
- </view>
- </view>
- </view>
- <view class="flex">
- <pickerAddress class="buttom" @change="onCityClick">选择地区</pickerAddress>
- </view>
- </view>
- </view>
- </view>
- <view class="flex alertButtomBox">
- <view class="cancel" @click="cancelSearch">
- 清空选择
- </view>
- <view class="confirm" @click="confirmSearch">
- 确定
- </view>
- </view>
- </view>
- </template>
- <script>
- import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
- import {
- getUserWorkTypeList
- } from '@/api/model.js';
- export default {
- components: {
- pickerAddress
- },
- props: {
- isCom: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- workTypeList: [],
- search: {
- timetype: '', //hour,month,day
- servicePrice: '',
- work_type_id: '',
- service_area: [],
- is_china: '',
- }
- };
- },
- onReady() {
- this.init()
- },
- methods: {
- init() {
- const that = this;
- getUserWorkTypeList().then(
- (res) => {
- that.workTypeList = res.data.list
- }
- ).catch(
- (res) => {
- console.log(res);
- }
- )
- },
- onCityClick({
- data
- }) {
- let address = {};
- address.province = data[0];
- address.city = data[1];
- address.district = data[2];
- this.search.service_area.push(address)
- },
- confirmSearch() {
- const search = this.search
- const address =search.service_area.map(
- (item) => {
- return `${item.province},${item.city},${item.district}`
- }
- )
- uni.navigateTo({
- url:`/pages/index/listModel?type=2&timetype=${search.timetype}&servicePrice=${search.servicePrice}&work_type_id=${search.work_type_id}&service_area=${address.join('-')}&is_china=${search.is_china}`,
- })
- },
- cancelSearch() {
- this.$emit('init')
- this.search = {
- servicePrice: '',
- work_type_id: '',
- timetype: '',
- service_area: [],
- is_china: '',
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .box {
- line-height: 1;
- background-color: #FFF;
- padding: 20rpx 0 30rpx;
- border-radius: 20rpx 20rpx 0 0;
- min-height: 100vh;
- .right {
- color: $font-color-light;
- font-size: $font-base;
- flex-grow: 1;
- justify-content: flex-end;
- padding: 20rpx;
- .timetype {
- width: 100%;
- justify-content: flex-end;
- }
- .citylist {
- .del {
- font-size: $font-sm;
- border-radius: 10rpx;
- background-color: #eee;
- line-height: 1;
- padding: 5rpx 15rpx;
- }
- }
- .img {
- width: 26rpx;
- }
- .buttom {
- border-radius: 10rpx;
- line-height: 1;
- padding: 10rpx 20rpx;
- background-color: #eee;
- }
- }
- .alertTitle {
- font-weight: bold;
- font-size: 32rpx;
- flex-grow: 1;
- text-align: center;
- }
- .alertClose {
- width: 40rpx;
- height: 40rpx;
- }
- .alertItemTitle {
- font-size: 28rpx;
- padding-left: 20rpx;
- font-weight: bold;
- }
- .minMoney {
- margin: 20rpx;
- font-size: 24rpx;
- border-bottom: 1px solid #e9e9e9;
- }
- .placeholderText {
- font-size: 24rpx;
- }
- .alertTypeBox {
- flex-wrap: wrap;
- justify-content: flex-start;
- padding: 0 20rpx 10rpx;
- margin-top: 20rpx;
- .alertTypeItem {
- font-size: 24rpx;
- padding: 10rpx 20rpx;
- background-color: #eee;
- border-radius: 10rpx;
- margin-bottom: 14rpx;
- margin-right: 14rpx;
- &.action {
- background-color: #fee7e4;
- color: #F86859;
- }
- }
- }
- .moneyTitle {
- font-size: 28rpx;
- }
- .alertButtomBox {
- color: #FFF;
- border-top: 1px solid #e3e3e3;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- .confirm {
- background-color: #F86859;
- }
- .cancel {
- background-color: orange;
- }
- .cancel,
- .confirm {
- height: 70rpx;
- line-height: 70rpx;
- text-align: center;
- width: 375rpx;
- font-size: 28rpx;
- }
- }
- }
- .topSearch {
- position: sticky;
- top: 0;
- background-color: #FFF;
- padding-right: 100rpx;
- height: 80rpx;
- .itemBox {
- padding-left: 30rpx;
- align-items: center;
- .itemTip {
- background-color: #FFF;
- position: fixed;
- right: 0;
- top: 0;
- align-items: center;
- height: 80rpx;
- padding: 0 30rpx;
- }
- .typeTtem {
- flex-shrink: 0;
- height: 80rpx;
- align-items: center;
- margin-right: 30rpx;
- &.action {
- color: #F86859;
- border-bottom: 1px solid #F86859;
- }
- }
- }
- }
- </style>
|