Commit 7fe0bfe8 by zhangzhen

功能完善

parent 9a599823
...@@ -35,4 +35,10 @@ export const getStarOrder=()=>{ ...@@ -35,4 +35,10 @@ export const getStarOrder=()=>{
export const cleanList=(data)=>{ export const cleanList=(data)=>{
let url=`/cleanRecords/myCleanList` let url=`/cleanRecords/myCleanList`
return http.get(url,data) return http.get(url,data)
} }
\ No newline at end of file
//领取全部的待保洁的任务
export const getAllByStoreId=(data)=>{
let url=`/cleanRecords/startCleanByStore`
return http.get(url,data)
}
...@@ -36,3 +36,8 @@ export const deviceCtrlAuth=()=>{ ...@@ -36,3 +36,8 @@ export const deviceCtrlAuth=()=>{
let url=`/store/storeListByConsumer` let url=`/store/storeListByConsumer`
return http.get(url) return http.get(url)
} }
export const getListByIds=(data)=>{
let url=`/store/queryByStoreIds`
return http.post(url,data)
}
\ No newline at end of file
...@@ -23,4 +23,9 @@ ...@@ -23,4 +23,9 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
}
.flex-row-center{
display: flex;
flex-direction: row;
align-items: center;
} }
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</view> </view>
</view> </view>
<view v-for="(item,index) in list" :key="index" class="card-box"> <view v-for="(item,index) in list" :key="index" class="card-box card-box-item">
<view class="store-info"> <view class="store-info">
...@@ -38,8 +38,12 @@ ...@@ -38,8 +38,12 @@
</view> </view>
<view class="flex-col part-right"> <view class="flex-col part-right">
<view class="flex-between"> <view class="flex-between">
<text class="text-black text-bold text-xl">{{item.name}}</text> <text class="text-black text-bold text-lg">{{item.name}}</text>
<image :src="assetsPath+'/map_icon.png'" mode="widthFix" @tap="onNavLocation(item)"></image> <view class="flex-row-center">
<button v-if="item.cleanOrderNum" class="cu-btn bg-pink sm margin-right-sm" @tap="onGetAllByStoreId(item)">一键领取</button>
<image :src="assetsPath+'/map_icon.png'" mode="widthFix" @tap="onNavLocation(item)"></image>
</view>
</view> </view>
<view class="flex-row"> <view class="flex-row">
<image :src="assetsPath+'/location_icon.png'" mode="widthFix"></image> <image :src="assetsPath+'/location_icon.png'" mode="widthFix"></image>
...@@ -93,7 +97,7 @@ ...@@ -93,7 +97,7 @@
</template> </template>
<script> <script>
import {getListStore,getStarOrder} from "@/api/cleanRoom.js"; import {getListStore,getStarOrder,getAllByStoreId } from "@/api/cleanRoom.js";
import config from "@/config/index.config" import config from "@/config/index.config"
import { import {
getDictItem getDictItem
...@@ -189,8 +193,15 @@ import moment from "@/common/moment"; ...@@ -189,8 +193,15 @@ import moment from "@/common/moment";
if(res.data.code ===200){ if(res.data.code ===200){
let list =res.data.data&&res.data.data.length? res.data.data:[]; let list =res.data.data&&res.data.data.length? res.data.data:[];
this.list = list.map(item=>{ this.list = list.map(item=>{
let cleanOrderNum = 0
item.roolList.forEach(room=>{
if(room.recordsStatus===0){
cleanOrderNum+=1
}
})
return { return {
...item, ...item,
cleanOrderNum:cleanOrderNum,
roolList: item.roolList && item.roolList.length ? item.roolList.map(val=>{ roolList: item.roolList && item.roolList.length ? item.roolList.map(val=>{
return { return {
...val, ...val,
...@@ -247,11 +258,31 @@ import moment from "@/common/moment"; ...@@ -247,11 +258,31 @@ import moment from "@/common/moment";
url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId url:"/pages/cleanOrderInfo/cleanOrderInfo?id="+val.recordsId
}) })
} }
},
onGetAllByStoreId(val){
uni.showLoading("领取中...")
getAllByStoreId({
storeId: val.id
}).then(res=>{
uni.hideLoading()
if(res.data.code ==200){
uni.showToast({
icon:"none",
title:"操作成功"
})
this.onLoading();
}
console.log(res,9999)
})
} }
} }
} }
</script> </script>
<style>
page{
background: #f1f1f1;
}
</style>
<style lang="scss"> <style lang="scss">
.clean-manage{ .clean-manage{
display: flex; display: flex;
...@@ -265,6 +296,13 @@ import moment from "@/common/moment"; ...@@ -265,6 +296,13 @@ import moment from "@/common/moment";
width: 94%; width: 94%;
margin-top: 10upx; margin-top: 10upx;
} }
.card-box-item{
width: 100%;
background-color: #ffffff;
padding: 20upx 3%;
border-radius: 4upx;
margin-top: 24upx;
}
.title-box{ .title-box{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<view class="flex-between price use-coupon-box"> <view class="flex-between price use-coupon-box">
<text <text
class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text> class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text>
<view class="flex-row" @tap="onNavToSelectCoupon"> <view class="flex-1 flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'"> <text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: couponList.length? '请选择':'暂无可用'}}</text> {{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: couponList.length? '请选择':'暂无可用'}}</text>
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text> <text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
...@@ -2092,7 +2092,11 @@ ...@@ -2092,7 +2092,11 @@
.use-coupon-box { .use-coupon-box {
.flex-row { .flex-row {
max-width: 70%; display: flex;
justify-content: space-between;
align-items: center;
// max-width: 70%;
margin-left: 12upx;
} }
} }
......
...@@ -34,7 +34,13 @@ ...@@ -34,7 +34,13 @@
</view> </view>
<view class="part-left"> <view class="part-left">
<view class="select-btn" :class="{active: selectId === item.id }"> <view class="surplus-days">
<view v-if="item.surplusDays>=0" class="flex-row-center">
<text class="cuIcon-countdown text-red"></text>
<text class="text-red">{{item.surplusDays}}天后过期</text>
</view>
</view>
<view class="select-btn margin-top-sm" :class="{active: selectId === item.id }">
<radio-group v-if="item.isAvailable != 1" class="radio-group" > <radio-group v-if="item.isAvailable != 1" class="radio-group" >
<radio class='brown' :class="selectId === item.id?'checked':''" :checked="selectId === item.id?true:false" color="#AF7117"></radio> <radio class='brown' :class="selectId === item.id?'checked':''" :checked="selectId === item.id?true:false" color="#AF7117"></radio>
</radio-group> </radio-group>
...@@ -62,6 +68,7 @@ ...@@ -62,6 +68,7 @@
</template> </template>
<script> <script>
import moment from "@/common/moment.js"
import {dictList} from "@/api/index.js"; import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js" import {getDictItem} from "@/utils/tools.js"
import config from "@/config/index.config" import config from "@/config/index.config"
...@@ -131,9 +138,14 @@ ...@@ -131,9 +138,14 @@
if (res.statusCode == 200) { if (res.statusCode == 200) {
if (res.data && res.data.data.length) { if (res.data && res.data.data.length) {
let list = res.data.data.map(item=> { let list = res.data.data.map(item=> {
let endTime = moment(item.endDate).valueOf();
let nowTime = moment().valueOf();
let surplusDays = parseInt(moment.duration(endTime-nowTime).asDays())
return { return {
...item, ...item,
subPrice: item.subPrice || 0 subPrice: item.subPrice || 0,
surplusDays: surplusDays<=30? surplusDays:-10000
} }
}) })
...@@ -210,7 +222,10 @@ ...@@ -210,7 +222,10 @@
} }
.part-left { .part-left {
display: flex; display: flex;
flex-direction: row; flex-direction: column;
.surplus-days{
height: 40upx;
}
.select-btn{ .select-btn{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -265,9 +280,9 @@ ...@@ -265,9 +280,9 @@
filter: grayscale(100%); filter: grayscale(100%);
.select-btn{ .select-btn{
background: #ffffff!important; background: #ffffff!important;
height: 32px !important; height: 26px !important;
border-radius: 16px !important; border-radius: 16px !important;
padding: 12upx 24upx !important; padding: 0 12upx !important;
text{ text{
color: #929292 !important; color: #929292 !important;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment