| small-program/pages/demand-hall/demand-hall.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/employment-certification/employment-certification.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/freight/freight.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/index/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/order-details/order-details.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/packaging-worker/packaging-worker.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/sorting/sorting.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/success/success.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/pages/using-workers/using-workers.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/utils/http.api.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| small-program/utils/http.interceptor.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
small-program/pages/demand-hall/demand-hall.vue
@@ -11,7 +11,7 @@ <view class="index-wu" v-if="!isLogin"> <image src="/static/icon/default_login@2x.png" mode="widthFix"></image> <text>您还没有登录,请登录后查看订单</text> <button>登录</button> <button @click="toLogin">登录</button> </view> <!-- 已登陆 --> @@ -36,7 +36,7 @@ </view> <!-- 发单方 --> <view class="index-list" v-if="typeViewId === 0"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index" @click="jumpDesc(item)"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> @@ -50,7 +50,7 @@ <view class="index-list-item-head-r" v-if="item.status === 2">已接单</view> <view class="index-list-item-head-r" v-if="item.status === 3">进行中</view> <view class="index-list-item-head-r" v-if="item.status === 2 && item.isUpdate === 1">已修改,待接单方确认</view> <view class="index-list-item-head-r hui" v-if="item.status === 4">已完成</view> <view class="index-list-item-head-r hui" v-if="item.status === 4 && item.commentStatus !== 0">已完成</view> <view class="index-list-item-head-r hui" v-if="item.status === 99">已取消</view> <view class="index-list-item-head-r" v-if="item.status === 4 && item.commentStatus === 0">待评价</view> </view> @@ -85,7 +85,7 @@ </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> <text>{{item.startDate}} 至 {{item.endDate}}({{item.totalDays}}天)</text> </view> </template> <view class="index-list-item-price"> @@ -95,23 +95,20 @@ <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click="orderId = item.id, show = true">取消订单</view> <view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click.stop="orderId = item.id, show = true">取消订单</view> <view class="eidt-phone" v-if="[2].includes(item.status)">联系师傅</view> <view class="eidt-phone" v-if="item.status === 4 && item.commentStatus === 0">评价订单</view> <view class="eidt-btn" v-if="[0,1,2].includes(item.status)" @click="jumpEdit(item)">修改订单</view> <view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) || (item.type === 2 && item.status === 3)" @click="jumpEdit(item)">继续支付</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> <view class="eidt-btn" v-if="[0,1,2].includes(item.status) && item.type !== 2" @click.stop="jumpEdit(item)">修改订单</view> <view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) || (item.type === 2 && item.status === 3)" @click.stop="jumpEdit(item)">继续支付</view> <view class="eidt-btn" v-if="item.status === 2" @click.stop="startJobs(item.id)">开始作业</view> <view class="eidt-btn" v-if="item.status === 3" @click.stop="jumpDesc(item)">完成并支付</view> </view> </view> </view> </view> <!-- 接单方 --> <view class="index-list" v-if="typeViewId === 1"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index" @click="jumpDesc(item)"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> @@ -174,90 +171,11 @@ <view class="eidt-tips" v-else></view> <view class="eidt-right"> <view class="eidt-close" v-if="item.status === 2" @click="orderId = item.id, show = true">取消订单</view> <view class="eidt-phone" v-if="[2,3].includes(item.status)" @click="phoneCall(item.linkPhone)">联系业主</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> <view class="eidt-close" v-if="item.status === 2" @click.stop="orderId = item.id, show = true">取消订单</view> <view class="eidt-phone" v-if="[2,3].includes(item.status)" @click.stop="phoneCall(item.linkPhone)">联系业主</view> </view> </view> </view> <!-- <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>运货单-小货车-厢式</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">已接单</view> </view> <view class="index-list-item-info"> 葡萄|20000斤|需2辆 </view> <view class="index-list-item-date"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="address"> <view class="address-xian"></view> <view class="address-row"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园东门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text>安徽莲花科技产业园豆米科技有限公司</text> </view> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> </view> </view> </view> --> <!-- <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>用工单-采摘工</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">待接单</view> </view> <view class="index-list-item-info"> 葡萄|2000斤 </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> </view> </view> </view> --> </view> </template> @@ -288,12 +206,21 @@ onShow(options) { this.typeViewId = 0 if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){ console.log('已登陆') this.isLogin = true if (!this.isOnce) { this.commentStatus = '' this.orderList = [] this.next = true this.page = 1 this.getOrderList() } } else { this.isLogin = false console.log('未登陆') } if (this.userInfo && this.userInfo.useIdentity == 1) { this.typeViewId = 1 } else { this.typeViewId = 0 } }, data() { @@ -324,7 +251,8 @@ next: true, page: 1, orderList: [] orderList: [], isOnce: true }; }, async onLoad() { @@ -344,6 +272,30 @@ this.getOrderList() }, methods: { toLogin() { uni.navigateTo({ url: '/pages/login/login' }) }, startJobs(orderId) { this.$u.api.begin({ orderId }) .then(res => { if (res.code === 200) { this.status = '' this.commentStatus = '' this.orderList = [] this.next = true this.page = 1 this.getOrderList() } }) }, jumpDesc(item) { uni.navigateTo({ url: `/pages/order-details/order-details?id=${item.id}` }) }, // 修改 jumpEdit(item) { if (item.type === 0 && item.workType === 0) { @@ -358,17 +310,24 @@ uni.navigateTo({ url: `/pages/packaging-worker/packaging-worker?id=${item.id}` }) } else if (item.type === 1) { uni.navigateTo({ url: `/pages/freight/freight?id=${item.id}` }) } }, cancelOrder() { this.$u.api.receiveCancelOrder({ this.$u.api.cancelOrder({ orderId: this.orderId }).then(res => { this.show = false this.orderList = [] this.next = true this.page = 1 this.getOrderList() if (res.code === 200) { this.show = false this.orderList = [] this.next = true this.page = 1 this.getOrderList() } }) }, phoneCall(phoneNumber) { @@ -389,6 +348,8 @@ queryLgt: this.longitude } }).then(res => { if (res.code !== 200) return; this.isOnce = false res.data.records.forEach(item => { // 订餐单 if (item.type === 2) { @@ -404,6 +365,8 @@ if (this.orderList.length === res.data.total) { this.next = false } else { this.page += 1 } }) }, @@ -522,6 +485,7 @@ display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; .eidt-close { width: 160rpx; height: 64rpx; small-program/pages/employment-certification/employment-certification.vue
@@ -460,7 +460,6 @@ that.form.img21Full = that.info.imgList.length>1?that.info.imgList[1]:null } } } }) }, small-program/pages/freight/freight.vue
@@ -6,20 +6,24 @@ <view class="list-item-label-x"></view> <text>车辆及路线</text> </view> <view class="list-item-row" @click="show = true"> <view class="list-item-row-label">车辆类型<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.categoryName ? '#111111' : '' }">{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item-row" @click="show = true"> <view class="list-item-row-label">车辆类型<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.categoryName ? '#111111' : '' }">{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> </view> <view class="list-item-row" @click="show3 = true"> <view class="list-item-row-label">货车型号<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.carUnit ? '#111111' : '' }">{{form.carUnit ? form.carUnit : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> <view class="list-item-row" @click="show3 = true"> <view class="list-item-row-label">货车型号<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.carUnit ? '#111111' : '' }">{{form.carUnit ? form.carUnit : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> </view> </template> <view class="list-item-row" @click="show2 = true"> <view class="list-item-row-label">用车时间<b>*</b></view> <view class="list-item-row-val"> @@ -27,132 +31,138 @@ <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label"> 运货地址<b>*</b> <view class="list-item-row-label-add" @click="addAddr">+增加途经点</view> </view> <view class="address"> <view class="address-item" @click="selectAddress(2)"> <view class="address-item-img"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text :style="{color: form.location ? '#111111' : ''}">{{form.location ? form.location : '请选择起点'}}</text> </view> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item-row"> <view class="list-item-row-label"> 运货地址<b>*</b> <view class="list-item-row-label-add" @click="addAddr">+增加途经点</view> </view> <view class="address-item" v-for="(item, index) in form.wayInfoDTOList" :key="index" @click="selectAddress(4, index)"> <view class="address-item-img"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text :style="{color: item.location ? '#111111' : ''}">{{item.location ? item.location : '请选择途经地点'}}</text> <view class="address"> <view class="address-item" @click="selectAddress(2)"> <view class="address-item-img"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text :style="{color: form.location ? '#111111' : ''}">{{form.location ? form.location : '请选择起点'}}</text> </view> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> <view style="display: flex; align-items: center; flex-shrink: 0;"> <image src="/static/icon/ic_delete@2x.png" style="margin-right: 22rpx; width: 32rpx; height: 32rpx;" @click.stop="form.wayInfoDTOList.splice(index, 1)" mode="widthFix"></image> <view class="address-item" v-for="(item, index) in form.wayInfoDTOList" :key="index" @click="selectAddress(4, index)"> <view class="address-item-img"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text :style="{color: item.location ? '#111111' : ''}">{{item.location ? item.location : '请选择途经地点'}}</text> </view> <view style="display: flex; align-items: center; flex-shrink: 0;"> <image src="/static/icon/ic_delete@2x.png" style="margin-right: 22rpx; width: 32rpx; height: 32rpx;" @click.stop="form.wayInfoDTOList.splice(index, 1)" mode="widthFix"></image> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="address-item" @click="selectAddress(3)"> <view class="address-item-img"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text :style="{color: form.locationEnd ? '#111111' : ''}">{{form.locationEnd ? form.locationEnd : '请选择终点'}}</text> </view> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="address-item" @click="selectAddress(3)"> <view class="address-item-img"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text :style="{color: form.locationEnd ? '#111111' : ''}">{{form.locationEnd ? form.locationEnd : '请选择终点'}}</text> </view> </view> </template> </view> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">运输品种<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.transportTypeName ? '#111111' : '' }">{{form.transportTypeName ? form.transportTypeName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">运输品种<b>*</b></view> <view class="list-item-row-val"> <text :style="{ color: form.transportTypeName ? '#111111' : '' }">{{form.transportTypeName ? form.transportTypeName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">用车数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" disabled placeholder="1" /> <text>辆</text> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">运输重量/数量<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.transportNum" placeholder="请输入" /> <text @click="show4 = true">{{form.transportUnit}}</text> <u-icon name="arrow-down" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea cols="30" v-model="form.supplement" rows="10" placeholder="请输入" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> <view class="list-item-row"> <view class="list-item-row-label">用车数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" disabled placeholder="1" /> <text>辆</text> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> <view class="list-item-row"> <view class="list-item-row-label">运输重量/数量<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.transportNum" placeholder="请输入" /> <text @click="show4 = true">{{form.transportUnit}}</text> <u-icon name="arrow-down" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea cols="30" v-model="form.supplement" rows="10" placeholder="请输入" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url || item.fileurlFull" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-cate"> <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">按天付费</view> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum1" disabled placeholder="请输入" /> <text>天</text> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input type="number" @blur="getPrice" v-model="form.price" placeholder="请输入" /> <text>{{form.priceUnit}}</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-cate"> <view :class="item.id === form.carType ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in ff" :key="index" @click="form.carType = item.id">按天付费</view> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum1" disabled placeholder="请输入" /> <text>天</text> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input type="number" @blur="getPrice" v-model="form.price" placeholder="请输入" /> <text>{{form.priceUnit}}</text> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> </template> </view> <view style="width: 100%; height: calc(214rpx + env(safe-area-inset-bottom));"></view> <view class="footer"> @@ -228,12 +238,14 @@ }, data() { return { info: {}, show: false, show1: false, show2: false, show3: false, show4: false, form: { id: null, startDate: '', endDate: '', lat: '', @@ -284,22 +296,43 @@ } } }, onLoad() { const res = uni.getStorageSync('carData'); this.form.linkPhone = this.userInfo.telephone this.form.startDate = res.startDate this.form.endDate = res.endDate this.form.lat = res.lat this.form.lgt = res.lgt this.form.priceNum1 = res.days this.form.categoryId = res.categoryId this.form.categoryName = res.categoryName this.form.location = res.location this.form.latEnd = res.latEnd this.form.lgtEnd = res.lgtEnd this.form.locationEnd = res.locationEnd this.form.wayInfoDTOList = res.wayInfoDTOList uni.removeStorageSync('carData'); onLoad(option) { if (option.id) { this.form.id = option.id this.$u.api.getDetail({ orderId: option.id }).then(res => { if (res.code === 200) { this.info = res.data for (const key in this.form) { this.form[key] = res.data[key] } this.form.price = Number(this.form.price) / 100 if (!this.form.multifileList) { this.form.multifileList = [] } if (!this.form.wayInfoDTOList) { this.form.wayInfoDTOList = [] } } }) } else { const res = uni.getStorageSync('carData'); this.form.linkPhone = this.userInfo.telephone this.form.startDate = res.startDate this.form.endDate = res.endDate this.form.lat = res.lat this.form.lgt = res.lgt this.form.priceNum1 = res.days this.form.categoryId = res.categoryId this.form.categoryName = res.categoryName this.form.location = res.location this.form.latEnd = res.latEnd this.form.lgtEnd = res.lgtEnd this.form.locationEnd = res.locationEnd this.form.wayInfoDTOList = res.wayInfoDTOList uni.removeStorageSync('carData'); } this.getCategoryLists() }, methods: { @@ -324,31 +357,66 @@ if (!this.form.linkPhone) { return uni.showToast({ title: '请输入联系电话', icon: 'none' }) } this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100, wayInfoDTOList: [ { lat: this.form.lat, lgt: this.form.lgt, location: this.form.location }, ...this.form.wayInfoDTOList, { lat: this.form.latEnd, lgt: this.form.lgtEnd, location: this.form.locationEnd if (!this.form.id) { this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100, wayInfoDTOList: [ { lat: this.form.lat, lgt: this.form.lgt, location: this.form.location }, ...this.form.wayInfoDTOList, { lat: this.form.latEnd, lgt: this.form.lgtEnd, location: this.form.locationEnd } ] }).then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } ] }).then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) }) } else { this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100, wayInfoDTOList: [ { lat: this.form.lat, lgt: this.form.lgt, location: this.form.location }, ...this.form.wayInfoDTOList, { lat: this.form.latEnd, lgt: this.form.lgtEnd, location: this.form.locationEnd } ] }).then(res => { if (res.code == 200) { uni.showToast({ title: '编辑成功', icon: 'success', mask: true, duration: 2000 }) setTimeout(() => { uni.navigateBack({ delta: 1 }); // uni.$emit('refresh') }, 1500) } }) } }, uploadImg() { var that = this; uni.chooseImage({ success: (chooseImageRes) => { const tempFilePaths = chooseImageRes.tempFilePaths; @@ -361,7 +429,7 @@ }, success: (uploadFileRes) => { const res = JSON.parse(uploadFileRes.data) this.form.multifileList.push({ that.form.multifileList.push({ fileurl: res.data.imgaddr, name: res.data.originname, url: res.data.url, @@ -382,23 +450,31 @@ priceNum2: this.form.priceNum2, type: 1 }).then(res => { this.form.estimatedAccount = res.data if (res.code === 200) { this.form.estimatedAccount = res.data } }) } }, getCategoryLists() { this.$u.api.getCategoryList({ type: 1 }) .then(res => { this.car = [res.data] res.data.forEach(item => { if (item.id === this.form.categoryId) { this.carArr = [item.detailList] } }) if (res.code === 200) { this.car = [res.data] res.data.forEach(item => { if (item.id === this.form.categoryId) { this.carArr = [item.detailList] } }) } }) this.$u.api.getCategoryList({ type: 0 }) .then(res => { this.variety = [res.data] if (res.code === 200) { this.variety = [res.data] } }) }, confirmCategary(e) { small-program/pages/index/index.vue
@@ -66,7 +66,7 @@ </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> <text>{{item.startDate}} 至 {{item.endDate}}({{item.totalDays}}天)</text> </view> </template> <view class="index-list-item-price"> @@ -223,10 +223,10 @@ </view> <view class="box-hz-list-item" @click="selectAddress(1)"> <view class="box-hz-list-item-label"><text>用工地点:</text></view> <view :class="form.location ? 'box-hz-list-item-val active' :'box-hz-list-item-val'"> <view :class="form.address ? 'box-hz-list-item-val active' :'box-hz-list-item-val'"> <view class="box-hz-list-item-val-left"> <image class="icon" src="/static/icon/ic_location@2x.png" mode="widthFix"></image> <text>{{form.location ? form.location : '请选择用工地点'}}</text> <text>{{form.address ? form.address : '请选择用工地点'}}</text> </view> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> @@ -326,15 +326,6 @@ return this.form.estimatedAccount / 100 } }, onShow(options) { this.typeViewId = 0 if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){ this.isLogin = true } if (this.userInfo && this.userInfo.useIdentity == 1) { this.typeViewId = 1 } }, data() { return { show: false, @@ -394,14 +385,40 @@ orderList: [], typeVal: '', page: 1, next: true next: true, isOnce: true } }, async onLoad() { await this.$onLaunched; this.getCategoryLists() this.getOrderList() if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') { this.getOrderList() this.getCategoryLists() } this.form.linkPhone = this.userInfo.telephone }, onShow(options) { this.typeViewId = 0 if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') { console.log('已登陆') this.isLogin = true if (!this.isOnce && this.userInfo.useIdentity == 1) { this.page = 1 this.next = true this.orderList = [] this.getOrderList() } } else { this.isLogin = false console.log('未登陆') } if (this.userInfo && this.userInfo.useIdentity == 1) { this.typeViewId = 1 } }, watch: { typeId: { @@ -413,7 +430,7 @@ this.form.longitude = '' this.form.location = '' this.form.locationEnd = '' this.form.wayInfoDTOList = '' this.form.wayInfoDTOList = [] this.form.workType = '' this.form.days = '' this.form.locationRemark = '' @@ -459,13 +476,15 @@ getaccept(e, orderId, index) { this.$u.api.accept({ orderId }) .then(res => { uni.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 }) setTimeout(() => { this.page = 1 this.next = true this.orderList = [] this.getOrderList() }, 2000) if (res.code === 200) { uni.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 }) setTimeout(() => { this.page = 1 this.next = true this.orderList = [] this.getOrderList() }, 2000) } }) }, clickSort(id) { @@ -496,6 +515,8 @@ queryLgt: this.longitude } }).then(res => { if (res.code !== 200) return; this.isOnce = false res.data.records.forEach(item => { // 订餐单 if (item.type === 2) { @@ -511,6 +532,8 @@ if (this.orderList.length === res.data.total) { this.next = false } else { this.page += 1 } }) }, @@ -608,7 +631,9 @@ priceNum1: that.form.days, type: 2 }).then(res => { that.form.estimatedAccount = res.data if (res.code === 200) { that.form.estimatedAccount = res.data } }) } }, @@ -687,17 +712,17 @@ // 采摘工 if (this.form.workType === 0) { uni.navigateTo({ url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}` url: `/pages/using-workers/using-workers?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}` }) // 分拣工 } else if (this.form.workType === 1) { uni.navigateTo({ url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}` url: `/pages/sorting/sorting?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}` }) // 包装工 } else if (this.form.workType === 2) { uni.navigateTo({ url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.location}&workType=${form.workType}` url: `/pages/packaging-worker/packaging-worker?days=${form.days}&startDate=${form.startDate}&endDate=${form.endDate}&latitude=${form.latitude}&longitude=${form.longitude}&address=${form.address}&workType=${form.workType}` }) } // 运货 @@ -746,24 +771,28 @@ getCategoryLists() { this.$u.api.getCategoryList({ type: 1 }) .then(res => { this.car = res.data this.form.categoryId = res.data[0].id this.form.categoryName = res.data[0].name this.carRemark = res.data[0].remark this.carImage = res.data[0].iconFull if (res.code === 200) { this.car = res.data this.form.categoryId = res.data[0].id this.form.categoryName = res.data[0].name this.carRemark = res.data[0].remark this.carImage = res.data[0].iconFull } }) this.$u.api.getCategoryList({ type: 2 }) .then(res => { res.data.forEach(item => { item.num = '' item.list = item.detailList.map(child => { return { active: false, price: child } if (res.code === 200) { res.data.forEach(item => { item.num = '' item.list = item.detailList.map(child => { return { active: false, price: child } }) }) }) this.orderFood = res.data this.orderFood = res.data } }) } } small-program/pages/order-details/order-details.vue
@@ -163,16 +163,17 @@ </view> </view> </view> <view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));"></view> <view class="order-footer"> <view style="width: 100%; height: calc(108rpx + env(safe-area-inset-bottom));" v-if="![99].includes(info.status)"></view> <view class="order-footer" v-if="![99].includes(info.status)"> <view class="order-footer-btn"> <view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.acceptMemberId && info.status ===2">取消订单</view> <view class="order-footer-btn-a" @click="show = true" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">取消订单</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===4 && info.commentStatus!=1)">去评价</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))">去支付</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)">修改订单</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.isUpdate==1 && info.status ===2)">修改确认</view> <view class="order-footer-btn-b" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">抢单</view> <view class="order-footer-btn-b" @click="show2=true" v-if="userInfo.id === info.releaseMemberId && (info.status ===4 && info.commentStatus!=1)">去评价</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId &&((info.status ===3 && info.type !==2)|| (info.status ===0 && info.type===2))" @click="show1 = true">去支付</view> <view class="order-footer-btn-b" v-if="userInfo.id === info.releaseMemberId && (info.status ===0 || info.status ===1|| info.status ===2)" @click="jumpEdit()">修改订单</view> <view class="order-footer-btn-b" @click="show5 =true" v-if="userInfo.id === info.acceptMemberId && (info.isUpdate==1 && info.status ===2)">修改确认</view> <view class="order-footer-btn-b" @click="show3 =true" v-if="userInfo.id === info.releaseMemberId && (info.status ===2)">开始作业</view> <view class="order-footer-btn-b" @click="show6 =true" v-if="userInfo.id !== info.releaseMemberId && (info.status ===1)">抢单</view> </view> <view style="width: 100%; height: env(safe-area-inset-bottom);"></view> </view> @@ -188,10 +189,54 @@ </view> <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;"> <view class="btn1" @click="show = false">我再想想</view> <view class="btn2" @click="show = false">确认取消</view> <view class="btn2" @click="cancelDo">确认取消</view> </view> </u-modal> <u-modal title="温馨提示" :show="show4" closeOnClickOverlay showCancelButton > <view class="slot-content"> 确认取消订单吗? </view> <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;"> <view class="btn1" @click="show = false">我再想想</view> <view class="btn2" @click="cancelDo">确认取消</view> </view> </u-modal> <u-modal title="温馨提示" :show="show6" closeOnClickOverlay showCancelButton > <view class="slot-content"> 确认抢单吗? </view> <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;"> <view class="btn1" @click="show6 = false">我再想想</view> <view class="btn2" @click="acceptDo">确认接单</view> </view> </u-modal> <u-modal title="温馨提示" :show="show5" closeOnClickOverlay showCancelButton > <view class="slot-content"> 是否同意订单修改内容? </view> <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;"> <view class="btn1" @click="show5=false">我再想想</view> <view style="width: 20rpx; height: 100%;"></view> <view class="btn2" style="background-color: #f56c6c; color: #ffffff;" @click="confirmUpdDo(1)">不同意</view> <view style="width: 20rpx; height: 100%;"></view> <view class="btn2" @click="confirmUpdDo(0)">同意</view> </view> </u-modal> <!-- 支付弹窗 --> <u-popup :show="show1" round="15" mode="bottom"> <view class="zhifu"> @@ -201,16 +246,16 @@ <image @click="show1 = false" src="/static/icon/ic_close@2x.png" mode="widthFix"></image> </view> <view class="zhifu-c"> <view class="zhifu-c-info"> 请确认金额并支付费用给 <text>莲花劳务公司</text> <view class="zhifu-c-info" v-if="info.type !== 2"> 请确认金额并支付费用给 <text>{{info.acceptName}}</text> </view> <view class="zhifu-c-info1">支付金额:</view> <view class="zhifu-c-input"> <image src="/static/icon/¥@2x.png" mode="widthFix"></image> <input type="number" placeholder="请输入" /> <input type="number" v-model="amount" :disabled="info.type === 2" placeholder="请输入" /> </view> </view> <view class="zhifu-botton">确认支付</view> <view class="zhifu-botton" @click="payment">确认支付</view> </view> </u-popup> @@ -225,14 +270,14 @@ <view class="zhifu-pj"> <view class="zhifu-pj-label">服务评价</view> <view class="zhifu-pj-val"> <u-rate :count="count" activeColor="#FFC331" size="26" v-model="value"></u-rate> <u-rate :count="count" activeColor="#FFC331" size="26" v-model="value" @click=""></u-rate> </view> </view> <view class="zhifu-textarea"> <image src="/static/icon/ic_pingjia@2x.png" mode="widthFix"></image> <u--textarea placeholder="请说说您对本次交易的感受" border="none" count></u--textarea> <u--textarea placeholder="请说说您对本次交易的感受" border="none" v-model="commentInfo" count></u--textarea> </view> <view class="zhifu-botton" style="margin-top: 60rpx;">立即评价</view> <view class="zhifu-botton" style="margin-top: 60rpx;" @click="commentDo">立即评价</view> </view> </u-popup> </view> @@ -250,11 +295,18 @@ show1: false, show2: false, count: 5, show3:false, show4:false, show5:false, show6:false, value:0, wayList:[], bgImg: require('@/static/image/bg_green@2x.png'), id: null, loading:false, info: {}, commentInfo:'', info: {}, amount: '' }; }, onLoad(options) { @@ -264,6 +316,144 @@ this.getOrderData() }, methods:{ // 修改 jumpEdit() { if (this.info.type === 0 && this.info.workType === 0) { uni.navigateTo({ url: `/pages/using-workers/using-workers?id=${this.info.id}` }) } else if (this.info.type === 0 && this.info.workType === 1) { uni.navigateTo({ url: `/pages/sorting/sorting?id=${this.info.id}` }) } else if (this.info.type === 0 && this.info.workType === 2) { uni.navigateTo({ url: `/pages/packaging-worker/packaging-worker?id=${this.info.id}` }) } else if (this.info.type === 1) { uni.navigateTo({ url: `/pages/freight/freight?id=${this.info.id}` }) } }, payment() { var that = this // 订餐 if (this.info.type === 2) { this.$u.api.reusePay({ orderId: this.info.id }).then(res => { if (res.code === 200) { wx.requestPayment({ timeStamp: res.data.object.timeStamp, nonceStr: res.data.object.nonceStr, package: res.data.object.packageVal, signType: res.data.object.signType, paySign: res.data.object.paySign, success (res1) { if (res1.errMsg = 'requestPayment:ok') { that.show1 = false uni.showToast({ title: '支付成功', icon: 'success', duration: 2000 }); that.getOrderData() } }, fail(err) { console.log(err) } }) } }) } else { this.$u.api.doneOrder({ orderId: this.info.id, amount: Number(this.amount) * 100 }).then(res => { if (res.code === 200) { wx.requestPayment({ timeStamp: res.data.object.timeStamp, nonceStr: res.data.object.nonceStr, package: res.data.object.packageVal, signType: res.data.object.signType, paySign: res.data.object.paySign, success (res1) { if (res1.errMsg = 'requestPayment:ok') { that.show1 = false uni.showToast({ title: '支付成功', icon: 'success', duration: 2000 }); that.getOrderData() } }, fail(err) { console.log(err) } }) } }) } }, commentDo(){ var that = this var param = { info: that.commentInfo,level:that.value||0,orderId: this.id} this.$u.api.comment(param).then(res =>{ if(res.code ===200){ that.show2=false uni.showToast({ title: '评价成功', icon: 'error', duration: 2000 }); that.getOrderData() } }) }, beginDo(){ var that = this var param = {orderId: this.id} this.$u.api.begin(param).then(res =>{ if(res.code ===200){ that.show3=false uni.showToast({ title: '操作成功', icon: 'error', duration: 2000 }); that.getOrderData() } }) }, confirmUpdDo(status){ var that = this var param = {orderId: this.id,status:status} this.$u.api.confirmUpd(param).then(res =>{ if(res.code ===200){ that.show5=false uni.showToast({ title: '确认成功', icon: 'error', duration: 2000 }); if(status==1){ uni.navigateBack({ delta: 1 }) }else{ that.getOrderData() } } }) }, acceptDo(){ var that = this var param = {orderId: this.id} this.$u.api.accept(param).then(res =>{ if(res.code ===200){ that.show6=false uni.showToast({ title: '抢单成功', icon: 'error', duration: 2000 }); that.getOrderData() } }) }, cancelDo(){ var that = this var param ={ orderId:that.id} this.$u.api.cancelOrder(param).then(res =>{ if(res.code ===200){ that.show=false uni.showToast({ title: '订单取消成功', icon: 'error', duration: 2000 }); that.getOrderData() if(that.userInfo.id !== that.info.releaseMemberId){ uni.navigateBack({ delta: 1 }) }else{ that.getOrderData() } } }) }, previemImg(src){ uni.previewImage({ current: src, // 当前显示图片的http链接 @@ -318,6 +508,7 @@ if(res.code ===200){ if(that.userInfo.id === res.data.releaseMemberId || that.userInfo.id === res.data.acceptMemberId ){ that.info = res.data that.amount = ((that.info.estimatedAccount || 0) / 100).toFixed(2) if(that.info.wayInfo){ that.wayList = JSON.parse(that.info.wayInfo) } @@ -508,9 +699,9 @@ box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; justify-content: space-between; .order-footer-btn-a { width: 334rpx; flex: 1; height: 88rpx; line-height: 88rpx; text-align: center; @@ -521,7 +712,7 @@ border: 1rpx solid #B2B2B2; } .order-footer-btn-b { width: 334rpx; flex: 1; height: 88rpx; line-height: 88rpx; text-align: center; small-program/pages/packaging-worker/packaging-worker.vue
@@ -13,105 +13,112 @@ <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">包装品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">用工数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" @blur="getPrice" placeholder="请输入" /> <text>人</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="如果有特殊要求,请在此处说明" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </template> </view> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">包装品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">用工数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" @blur="getPrice" placeholder="请输入" /> <text>人</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="如果有特殊要求,请在此处说明" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url || item.fileurlFull" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-cate"> <view :class="form.carType === item.id ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in settlementType" :key="index" @click="clickType(item.id)">{{item.name}}</view> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input v-model="form.priceNum1" disabled @blur="getPrice" type="number" placeholder="请输入" /> <text>天</text> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>{{form.priceUnit}}</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-cate"> <view :class="form.carType === item.id ? 'list-item-cate-item active' : 'list-item-cate-item'" v-for="(item, index) in settlementType" :key="index" @click="clickType(item.id)">{{item.name}}</view> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input v-model="form.priceNum1" disabled @blur="getPrice" type="number" placeholder="请输入" /> <text>天</text> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>{{form.priceUnit}}</text> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> </template> </view> <view style="width: 100%; height: calc(214rpx + env(safe-area-inset-bottom));"></view> <view class="footer"> @@ -162,9 +169,11 @@ }, data() { return { info: {}, show: false, show1: false, form: { id: null, days: '', startDate: '', endDate: '', @@ -197,14 +206,35 @@ }; }, onLoad(option) { this.form.linkPhone = this.userInfo.telephone this.form.priceNum1 = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType if (option.id) { this.form.id = option.id this.$u.api.getDetail({ orderId: option.id }).then(res => { if (res.code === 200) { this.info = res.data for (const key in this.form) { this.form[key] = res.data[key] } this.form.days = res.data.totalDays this.form.price = Number(this.form.price) / 100 if (!this.form.multifileList) { this.form.multifileList = [] } // this.clickType() } }) } else { this.form.linkPhone = this.userInfo.telephone this.form.priceNum1 = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType } this.getCateList() }, methods: { @@ -222,14 +252,29 @@ if (!this.form.linkPhone) { return uni.showToast({ title: '请输入联系电话', icon: 'none' }) } this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) if (!this.form.id) { this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) } else { this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { if (res.code == 200) { uni.showToast({ title: '编辑成功', icon: 'success', mask: true, duration: 2000 }) setTimeout(() => { uni.navigateBack({ delta: 1 }); // uni.$emit('refresh') }, 1500) } } }) } }, // 计算金额 getPrice() { @@ -241,15 +286,19 @@ type: this.form.type, workType: this.form.workType }).then(res => { this.form.estimatedAccount = res.data if (res.code === 200) { this.form.estimatedAccount = res.data } }) } }, confirmDate(e) { this.form.startDate = e[0] this.form.endDate = e[e.length - 1] this.form.days = e.length; this.form.priceNum1 = e.length; this.show = false this.getPrice() }, selectAddress() { uni.chooseLocation({ @@ -277,7 +326,9 @@ this.$u.api.getCategoryList({ type: 0 }).then(res => { this.cateList = [res.data] if (res.code === 200) { this.cateList = [res.data] } }) }, uploadImg() { small-program/pages/sorting/sorting.vue
@@ -13,102 +13,108 @@ <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">分拣品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">用工数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" @blur="getPrice" placeholder="请输入" /> <text>人</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="如果有特殊要求,请在此处说明" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </template> </view> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">分拣品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">用工数量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum2" @blur="getPrice" placeholder="请输入" /> <text>人</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="如果有特殊要求,请在此处说明" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url || item.fileurlFull" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input v-model="form.priceNum1" disabled @blur="getPrice" type="number" placeholder="请输入" /> <text>天</text> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>元/人/天</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-row"> <view class="list-item-row-label">天数</view> <view class="list-item-row-val"> <input v-model="form.priceNum1" disabled @blur="getPrice" type="number" placeholder="请输入" /> <text>天</text> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>元/人/天</text> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> </template> </view> <view style="width: 100%; height: calc(214rpx + env(safe-area-inset-bottom));"></view> <view class="footer"> @@ -159,9 +165,11 @@ }, data() { return { info: {}, show: false, show1: false, form: { id: null, days: '', startDate: '', endDate: '', @@ -188,14 +196,34 @@ }; }, onLoad(option) { this.form.linkPhone = this.userInfo.telephone this.form.priceNum1 = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType if (option.id) { this.form.id = option.id this.$u.api.getDetail({ orderId: option.id }).then(res => { if (res.code === 200) { this.info = res.data for (const key in this.form) { this.form[key] = res.data[key] } this.form.days = res.data.totalDays this.form.price = Number(this.form.price) / 100 if (!this.form.multifileList) { this.form.multifileList = [] } } }) } else { this.form.linkPhone = this.userInfo.telephone this.form.priceNum1 = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType } this.getCateList() }, methods: { @@ -213,14 +241,27 @@ if (!this.form.linkPhone) { return uni.showToast({ title: '请输入联系电话', icon: 'none' }) } this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) if (!this.form.id) { this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) } else { this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.showToast({ title: '编辑成功', icon: 'success', mask: true, duration: 2000 }) setTimeout(() => { uni.navigateBack({ delta: 1 }); // uni.$emit('refresh') }, 1500) } }) } }, // 计算金额 getPrice() { @@ -233,15 +274,19 @@ type: this.form.type, workType: this.form.workType }).then(res => { this.form.estimatedAccount = res.data if (res.code === 200) { this.form.estimatedAccount = res.data } }) } }, confirmDate(e) { this.form.startDate = e[0] this.form.endDate = e[e.length - 1] this.form.days = e.length; this.form.priceNum1 = e.length; this.show = false this.getPrice() }, selectAddress() { uni.chooseLocation({ @@ -261,7 +306,10 @@ this.$u.api.getCategoryList({ type: 0 }).then(res => { this.cateList = [res.data] if (res.code === 200) { this.cateList = [res.data] } }) }, uploadImg() { small-program/pages/success/success.vue
@@ -4,9 +4,9 @@ <text class="success-a">发单成功</text> <text class="success-b">请等待接单</text> <view class="success-footer"> <view class="success-footer-btn">回到首页</view> <view class="success-footer-btn" @click="toIndex">回到首页</view> <view style="width: 20rpx; height: 100%;"></view> <view class="success-footer-btn1">查看详情</view> <view class="success-footer-btn1" @click="toDesc">查看详情</view> </view> </view> </template> @@ -15,8 +15,23 @@ export default { data() { return { orderId: null }; }, onLoad(option) { this.orderId = option.orderId }, methods: { toIndex() { uni.switchTab({ url: '/pages/index/index' }); }, toDesc() { uni.navigateTo({ url: `/pages/order-details/order-details?id=${this.orderId}` }) } } } </script> small-program/pages/using-workers/using-workers.vue
@@ -13,95 +13,101 @@ <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">采摘品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">采摘重量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum1" @blur="getPrice" placeholder="请输入" /> <text>斤</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="请输入" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item-row" @click="selectAddress()"> <view class="list-item-row-label">用工地点<b>*</b></view> <view class="list-item-row-val"> <text>{{form.location ? form.location : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> <view class="list-item-row"> <view class="list-item-row-label">地点描述</view> <view class="list-item-row-val"> <input type="text" v-model="form.locationRemark" placeholder="请输入" /> </view> </view> </template> </view> <template v-if="!(info.type !== 2 && info.status === 2)"> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>需求</text> </view> <view class="list-item-row" @click="show1 = true"> <view class="list-item-row-label">采摘品种<b>*</b></view> <view class="list-item-row-val"> <text>{{form.categoryName ? form.categoryName : '请选择'}}</text> <u-icon name="arrow-right" color="#111111" size="16"></u-icon> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">采摘重量<b>*</b></view> <view class="list-item-row-val"> <input type="number" v-model="form.priceNum1" @blur="getPrice" placeholder="请输入" /> <text>斤</text> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">需求补充</view> <view class="list-item-row-val"> <textarea v-model="form.supplement" cols="30" rows="10" placeholder="请输入" maxlength="200"></textarea> </view> </view> <view class="list-item-row" v-if="viewStatus"> <view class="list-item-row-label">图片</view> <view class="list-item-row-upload"> <view class="upload-item" v-for="(item, index) in form.multifileList" :key="index"> <image :src="item.url || item.fileurlFull" mode="widthFix"></image> <image class="upload-item-dele" @click="form.multifileList.splice(index, 1)" src="/static/icon/ic_delete1@2x.png" mode="widthFix"></image> </view> <view class="upload-item" @click="uploadImg"> <u-icon name="plus" color="#999999" size="24"></u-icon> <text>点击上传</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>元/斤</text> </view> </view> </view> <view class="list-item-zk" @click="viewStatus = !viewStatus"> <text>{{viewStatus ? '收起' : '补充需求'}}</text> <u-icon :name="viewStatus ? 'arrow-up' : 'arrow-down'" color="#00BC12" size="16"></u-icon> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>费用</text> </view> <view class="list-item-row"> <view class="list-item-row-label">费用标准<b>*</b></view> <view class="list-item-row-val"> <input v-model="form.price" type="number" @blur="getPrice" placeholder="请输入" /> <text>元/斤</text> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> </view> <view class="list-item"> <view class="list-item-label"> <view class="list-item-label-x"></view> <text>联系人信息</text> <text class="list-item-label-info">默认发单方联系方式,可修改联系人</text> </view> <view class="list-item-row"> <view class="list-item-row-label">联系人姓名</view> <view class="list-item-row-val"> <input type="text" v-model="form.linkName" placeholder="请补充" /> </view> </view> <view class="list-item-row"> <view class="list-item-row-label">联系电话<b>*</b></view> <view class="list-item-row-val"> <input type="text" v-model="form.linkPhone" maxlength="11" placeholder="请补充" /> </view> </view> </view> </template> </view> <view style="width: 100%; height: calc(214rpx + env(safe-area-inset-bottom));"></view> <view class="footer"> @@ -152,9 +158,11 @@ }, data() { return { info: {}, show: false, show1: false, form: { id: null, days: '', startDate: '', endDate: '', @@ -175,19 +183,41 @@ estimatedAccount: '', type: 0 }, modify: false, cateList: [], viewStatus: false }; }, onLoad(option) { this.form.linkPhone = this.userInfo.telephone this.form.days = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType // 编辑 if (option.id) { this.form.id = option.id this.$u.api.getDetail({ orderId: option.id }).then(res => { if (res.code === 200) { this.info = res.data for (const key in this.form) { this.form[key] = res.data[key] } this.form.days = res.data.totalDays this.form.price = Number(this.form.price) / 100 if (!this.form.multifileList) { this.form.multifileList = [] } } }) } else { this.form.linkPhone = this.userInfo.telephone this.form.days = option.days this.form.startDate = option.startDate this.form.endDate = option.endDate this.form.lat = option.latitude this.form.lgt = option.longitude this.form.location = option.address this.form.workType = option.workType } this.getCateList() }, methods: { @@ -205,14 +235,33 @@ if (!this.form.linkPhone) { return uni.showToast({ title: '请输入联系电话', icon: 'none' }) } this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) if (!this.form.id) { this.$u.api.release({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.navigateTo({ url: `/pages/success/success?orderId=${res.data.id}` }) } }) } else { this.$u.api.updateOrder({ ...this.form, price: Number(this.form.price) * 100 }) .then(res => { if (res.code == 200) { uni.showToast({ title: '编辑成功', icon: 'success', mask: true, duration: 2000 }) setTimeout(() => { uni.navigateBack({ delta: 1 }); // uni.$emit('refresh') }, 1500) } }) } }, // 计算金额 getPrice() { @@ -225,7 +274,10 @@ type: this.form.type, workType: this.form.workType }).then(res => { this.form.estimatedAccount = res.data if (res.code === 200) { this.modify = true this.form.estimatedAccount = res.data } }) } }, @@ -253,7 +305,9 @@ this.$u.api.getCategoryList({ type: 0 }).then(res => { this.cateList = [res.data] if (res.code === 200) { this.cateList = [res.data] } }) }, uploadImg() { small-program/utils/http.api.js
@@ -22,8 +22,7 @@ let doneOrder = (data = {}) => vm.$u.http.post('web/orders/doneOrder', data); // 完成订单 - 发单方 let getDetail = (params = {}) => vm.$u.http.get('web/orders/getDetail', { params }); // 订单详情 let orderPage = (data) => vm.$u.http.post('web/orders/page', data); // 分页查询 let receiveCancelOrder = (params = {}) => vm.$u.http.get('web/orders/receiveCancelOrder', { params }); // 取消接单 - 接单方 let releaseCancelOrder = (params = {}) => vm.$u.http.get('web/orders/releaseCancelOrder', { params }); // 取消接单 - 接单方 let cancelOrder = (params = {}) => vm.$u.http.get('web/orders/cancelOrder', { params }); // 取消接单 - 接单方 let release = (data = {}) => vm.$u.http.post('web/orders/release', data); // 发布订单 - 发单方 let updOrderData = (data = {}) => vm.$u.http.post('web/orders/updOrderData', data); // 修改订单日期 - 发单方 let updateOrder = (data = {}) => vm.$u.http.post('web/orders/updateOrder', data); // 修改订单 - 接单方 @@ -55,8 +54,7 @@ doneOrder, getDetail, orderPage, receiveCancelOrder, releaseCancelOrder, cancelOrder, release, updOrderData, updateOrder, small-program/utils/http.interceptor.js
@@ -2,6 +2,7 @@ // 请求拦截器 uni.$u.http.interceptors.request.use((config) => { const Headtoken = vm.$store.state.token uni.showLoading({ title: '加载中' }); // 判断有无token,有则加入请求头中 if (Headtoken) { config.header['token'] = Headtoken; @@ -13,6 +14,7 @@ // 响应拦截器 uni.$u.http.interceptors.response.use((response) => { uni.hideLoading(); // console.log(response.data) if (response.data.code === 5113) { uni.switchTab({