wangfukang 3 months ago
parent
commit
31e22f6f9b
  1. 218
      package2/group/groupBuyList.vue
  2. 33
      package2/group/groupBuySingle.vue
  3. 119
      package2/group/studentStoreList.vue
  4. 121
      package2/myCenter/partTimeJobRegister.vue

218
package2/group/groupBuyList.vue

@ -18,42 +18,42 @@
<view class="search-trend" @tap.stop="goSearch">搜索</view>
</view>
</view>
<view class="title-tab" style="margin-top: 12rpx;">
<view class="campus-banner" @tap="goPendingGroup">
<view class="banner-glow"></view>
<view class="steam steam-one"></view>
<view class="steam steam-two"></view>
<view class="steam steam-three"></view>
<!-- <view class="food-float float-one">🍜</view>
</view>
<view class="title-fixed-holder"></view>
<view class="title-tab" style="margin-top: 12rpx;">
<view class="campus-banner" @tap="goPendingGroup">
<view class="banner-glow"></view>
<view class="steam steam-one"></view>
<view class="steam steam-two"></view>
<view class="steam steam-three"></view>
<!-- <view class="food-float float-one">🍜</view>
<view class="food-float float-two">🥤</view>
<view class="food-float float-three">🍢</view>
<view class="food-float float-four">🥟</view> -->
<view class="banner-copy">
<view class="banner-sticker">大家正在拼</view>
<view class="banner-title">快来加入成团</view>
<!-- <view class="banner-desc">楼下热乎的那口,凑个饭搭子就出发。</view> -->
<view class="banner-bubbles">
<swiper class="banner-live-swiper" vertical circular autoplay :interval="2600" :duration="1500">
<swiper-item v-for="(item,index) in liveFeeds" :key="index">
<view class="banner-live-bubble">
<view class="live-avatar">{{item.avatar}}</view>
<view class="live-copy">
<view class="live-main">{{item.name}} · {{item.dorm}}</view>
<view class="live-sub">{{item.food}}</view>
</view>
<view class="banner-copy">
<view class="banner-sticker">大家正在拼</view>
<view class="banner-title">快来加入成团</view>
<!-- <view class="banner-desc">楼下热乎的那口,凑个饭搭子就出发。</view> -->
<view class="banner-bubbles">
<swiper class="banner-live-swiper" vertical circular autoplay :interval="2600" :duration="1500">
<swiper-item v-for="(item,index) in liveFeeds" :key="index">
<view class="banner-live-bubble">
<view class="live-avatar">{{item.avatar}}</view>
<view class="live-copy">
<view class="live-main">{{item.name}} · {{item.dorm}}</view>
<view class="live-sub">{{item.food}}</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
<view class="banner-food-card">
<img src="/static/images/img/loading.gif" alt="" />
<!-- <view class="food-card-tag">刚刚有人拼成功</view> -->
</view>
</swiper-item>
</swiper>
</view>
</view>
<view class="banner-food-card">
<img src="/static/images/img/loading.gif" alt="" />
<!-- <view class="food-card-tag">刚刚有人拼成功</view> -->
</view>
</view>
</view>
<view class="title-fixed-holder"></view>
<view class="interest-card" :class="{'interest-card-expanded': categoryExpanded}">
<view class="section-head">
<text>校园美食兴趣入口</text>
@ -106,7 +106,7 @@
</view>
</view>
<view class="shop-list">
<view class="shop-member" :class="{'shop-member-disabled': item.status != 1}" v-for="(item,index) in shopList" :key="index" @tap="goDetail('shop',item)">
<view class="shop-member" :class="{'shop-member-disabled': item.status != 1}" v-for="(item,index) in shopList" :key="item._renderKey" @tap="goDetail('shop',item)">
<view class="shop-disabled-mask" @tap.stop="buyingye" v-if="item.status != 1">
</view>
<view class="shop-card-bg"></view>
@ -162,7 +162,7 @@
</view>
<view class="shop-bottom" v-if="item._visibleProducts && item._visibleProducts.length > 0">
<view class="menu-member"
v-for="(item1,index1) in item._visibleProducts" :key="index1" @tap="goDetail('shop',item)">
v-for="(item1,index1) in item._visibleProducts" :key="item1._renderKey" @tap="goDetail('shop',item)">
<view class="menu-img">
<img :src="item1.productPicture" lazy-load alt="">
<view class="menu-img-gloss"></view>
@ -171,12 +171,12 @@
<view class="shop-menu-name">
{{item1.productName}}
</view>
<view class="shop-menu-price">
¥{{item1.attributeListPrice | sliceMsg}}
<view class="shop-menu-price" :class="{'shop-menu-price-solo': !item1._hasGroupBuyPrice}">
¥{{item1._displayPrice}}
</view>
<view class="shop-menu-purchase">
<view class="shop-menu-purchase" v-if="item1._hasGroupBuyPrice">
<text class="group-badge">拼</text>
<text class="group-price">¥{{item1.productGroupBuyPrices | slicePrice}}</text>
<text class="group-price">¥{{item1._displayGroupPrice}}</text>
</view>
</view>
</view>
@ -202,6 +202,10 @@
</template>
<script>
const GROUP_META_CACHE_TTL = 5 * 60 * 1000
const GROUP_EAT_TYPE_CACHE_KEY = 'group_buy_eat_type_cache_v1'
const GROUP_SHOP_AREA_CACHE_PREFIX = 'group_buy_shop_area_cache_v1_'
export default {
data() {
return {
@ -375,9 +379,6 @@
},
onLoad() {
this.getShopList();
this.getEatType();
this.getShopArea();
this.getOnlineWorkerCountByCanteenArea();
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
@ -429,44 +430,80 @@
toggleCategory() {
this.categoryExpanded = !this.categoryExpanded
},
isFreshCache(cache) {
return !!(cache && cache.time && Date.now() - cache.time < GROUP_META_CACHE_TTL)
},
scheduleGroupMetaLoad() {
clearTimeout(this._groupMetaTimer)
this._groupMetaTimer = setTimeout(() => {
this.getEatType()
this.getShopArea()
}, 300)
},
getEatType() {
const cache = uni.getStorageSync(GROUP_EAT_TYPE_CACHE_KEY)
if (this.isFreshCache(cache)) {
this.applyEatTypeList(cache.list || [])
return
}
let that = this
that.tui.request("/dictData/getByCondition", "GET", {
sort: 'sortOrder',
order: 'asc',
dictId: '1712359407444168704'
}, false, true).then((res) => {
}, false, true, true).then((res) => {
if (res.code == 200) {
for (let i = 0; i < res.result.content.length; i++) {
for (let m = 0; m < this.menuBtn.length; m++) {
if (this.menuBtn[m].name == res.result.content[i].title) {
this.menuBtn[m].value = res.result.content[i].value
}
}
for (let m = 0; m < this.menuBtn1.length; m++) {
if (this.menuBtn1[m].name == res.result.content[i].title) {
this.menuBtn1[m].value = res.result.content[i].value
}
}
}
const list = res.result.content || []
this.applyEatTypeList(list)
uni.setStorageSync(GROUP_EAT_TYPE_CACHE_KEY, {
time: Date.now(),
list
})
} else {
that.tui.toast(res.message)
return
}
}).catch((res) => {})
},
applyEatTypeList(list) {
for (let i = 0; i < list.length; i++) {
for (let m = 0; m < this.menuBtn.length; m++) {
if (this.menuBtn[m].name == list[i].title) {
this.menuBtn[m].value = list[i].value
}
}
for (let m = 0; m < this.menuBtn1.length; m++) {
if (this.menuBtn1[m].name == list[i].title) {
this.menuBtn1[m].value = list[i].value
}
}
}
},
getShopArea() {
const regionId = JSON.parse(uni.getStorageSync('area')).id
const cacheKey = GROUP_SHOP_AREA_CACHE_PREFIX + regionId
const cache = uni.getStorageSync(cacheKey)
if (this.isFreshCache(cache)) {
this.shopArea = cache.list || []
return
}
let that = this
that.tui.request("/app/shopArea/getByParentId/" + JSON.parse(uni.getStorageSync('area')).id, "GET", {},
false, true).then((res) => {
that.tui.request("/app/shopArea/getByParentId/" + regionId, "GET", {},
false, true, true).then((res) => {
if (res.code == 200) {
const shopArea = []
if (res.result != null) {
for (let m = 0; m < res.result.length; m++) {
if (res.result[m].isCanteen == 1) {
that.shopArea.push(res.result[m])
shopArea.push(res.result[m])
}
}
}
that.shopArea = shopArea
uni.setStorageSync(cacheKey, {
time: Date.now(),
list: shopArea
})
} else {
that.tui.toast(res.message)
return
@ -477,7 +514,7 @@
let that = this
that.tui.request("/worker/getOnlineWorkerByArea", "GET", {
parentId: JSON.parse(uni.getStorageSync('area')).id
}, false, true).then((res) => {
}, false, true, true).then((res) => {
if (res.code == 200) {
const list = Array.isArray(res.result) ? res.result : []
that.onlineWorkerAreaList = list
@ -517,6 +554,10 @@
that.totalPages = res.result.totalPages
that.judgeBusinessStatus()
that.isArea = false
if (that.searchForm.pageNumber == 1) {
that.scheduleGroupMetaLoad()
that.scheduleOnlineWorkerCountLoad()
}
} else {
that.tui.toast(res.message);
return
@ -524,10 +565,17 @@
uni.hideLoading()
}).catch((res) => {})
},
scheduleOnlineWorkerCountLoad() {
clearTimeout(this._onlineWorkerCountTimer)
this._onlineWorkerCountTimer = setTimeout(() => {
this.getOnlineWorkerCountByCanteenArea()
}, 300)
},
prepareShopList(list, offset) {
return (list || []).map((item, i) => {
const index = (offset || 0) + i
const products = Array.isArray(item.products) ? item.products : []
item._renderKey = item.id || ('shop-' + index)
const cookingTimeValue = item.shopTakeaway && item.shopTakeaway.cookingTime ? Number(item.shopTakeaway.cookingTime) : 0
const cookingTime = isNaN(cookingTimeValue) ? 0 : cookingTimeValue
const selfDeliveryTime = Number(item.shopDeliveryDuration)
@ -549,10 +597,48 @@
this.groupAvatars[(index + 1) % this.groupAvatars.length],
this.groupAvatars[(index + 2) % this.groupAvatars.length]
]
item._visibleProducts = products.filter(product => product.isPush == 1 && product.delFlag == 1)
item._visibleProducts = products.filter(product => product.isPush == 1 && product.delFlag == 1).map((product, productIndex) => {
product._renderKey = product.id || product.productId || ('product-' + index + '-' + productIndex)
product._displayPrice = this.getProductDisplayPrice(product.attributeListPrice)
product._displayGroupPrice = this.getProductGroupDisplayPrice(product.productGroupBuyPrices)
product._hasGroupBuyPrice = this.hasProductGroupBuyPrice(product)
return product
})
return item
})
},
getProductDisplayPrice(value) {
let price = ''
if (typeof(value) == 'string') {
try {
const priceMap = JSON.parse(value)
for (let key in priceMap) {
price = priceMap[key].specPrice
}
} catch (e) {
price = ''
}
}
return price
},
hasProductGroupBuyPrice(product) {
if (!product || product.isMoreBuy == 1) return false
return this.getProductGroupDisplayPrice(product.productGroupBuyPrices) !== ''
},
getProductGroupDisplayPrice(value) {
let price = ''
if (value != null && value.length > 0) {
const firstPrice = parseFloat(value[0].groupPrice)
price = isNaN(firstPrice) ? '' : firstPrice
for (let i = 0; i < value.length; i++) {
const groupPrice = parseFloat(value[i].groupPrice)
if (!isNaN(groupPrice) && (price === '' || groupPrice < price)) {
price = groupPrice
}
}
}
return price
},
formatSelfDeliveryTag(item) {
const fee = parseFloat(item.orderBkge || 0)
const feeText = fee > 0 ? `¥${fee.toFixed(1)}` : '免配送费'
@ -716,7 +802,7 @@
}
.title-fixed-holder {
height: 466rpx;
height: 210rpx;
}
.title-fixed::before {
@ -869,11 +955,16 @@
.banner-title {
margin-top: 18rpx;
font-size: 48rpx;
line-height: 56rpx;
display: inline-block;
font-size: 50rpx;
line-height: 60rpx;
font-weight: 900;
color: #083f34;
letter-spacing: 1rpx;
color: #075240;
letter-spacing: 2rpx;
font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
text-shadow:
0 4rpx 0 rgba(255, 255, 255, 0.76),
0 10rpx 18rpx rgba(5, 120, 91, 0.2);
}
.banner-desc {
@ -1591,6 +1682,13 @@
text-decoration: line-through;
}
.shop-menu-price-solo {
color: #ff1f1f;
font-size: 24rpx;
font-weight: 900;
text-decoration: none;
}
.shop-menu-purchase {
display: inline-flex;
align-items: center;

33
package2/group/groupBuySingle.vue

@ -151,13 +151,13 @@
<view class="goods-img">
<img :src="item.productPicture" alt="" style="border-radius: 20rpx;">
<view class="group-corner-badge" v-if="item.isMoreBuy != 1">可拼团</view>
<view class="group-corner-badge" v-if="isProductGroupBuyAvailable(item)">可拼团</view>
</view>
<view class="goods-content">
<view class="goods-name">
{{item.productName}}
</view>
<view class="goods-vibe" v-if="item.isMoreBuy != 1">
<view class="goods-vibe" v-if="isProductGroupBuyAvailable(item)">
<text class="goods-vibe-tag">拼团价更香</text>
<text class="goods-vibe-copy">约人一起下单</text>
</view>
@ -165,9 +165,12 @@
<view class="goods-deal1">
销量 <text> {{item.tailWarn != null ? item.tailWarn : 0}}</text>
</view>
<view
style="width: 40%;text-align: right;font-size: 14px;color: #777;font-weight: 700;text-decoration: line-through;"
v-if="groupId && item.isMoreBuy != 0">
<view class="goods-join-price goods-join-price-origin"
v-if="groupId && isProductGroupBuyAvailable(item)">
¥{{item.attributeListPrice | sliceMsg}}
</view>
<view class="goods-join-price"
v-if="groupId && !isProductGroupBuyAvailable(item)">
¥{{item.attributeListPrice | sliceMsg}}
</view>
</view>
@ -187,7 +190,7 @@
</view>
<view class="goods-bottom">
<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1"
<view v-if="isProductGroupBuyAvailable(item)"
class="goods-btn group-buy-btn" style="margin-left: 6%;"
:style="{'float':groupId != ''?'right':''}" @tap.stop="openPopup('xiadan','pintuan',item)">
<view class="btn-spark">
@ -2103,9 +2106,13 @@
return isNaN(price) ? 0 : price;
},
getDetailGroupPrice(item) {
if (!item || !item.productGroupBuyPrices || item.isMoreBuy == 1) return '';
if (!this.isProductGroupBuyAvailable(item)) return '';
return this.getGroupPrice(item);
},
isProductGroupBuyAvailable(item) {
return !!(item && Array.isArray(item.productGroupBuyPrices) && item.productGroupBuyPrices.length > 0 &&
item.isMoreBuy != 1);
},
buyingye() {
uni.showToast({
title: '商品不在售卖时间!',
@ -3739,6 +3746,18 @@
font-weight: 700;
}
.goods-join-price {
width: 40%;
text-align: right;
font-size: 28rpx;
color: #777;
font-weight: 700;
}
.goods-join-price-origin {
text-decoration: line-through;
}
.group-buy-btn {
display: flex;
align-items: center;

119
package2/group/studentStoreList.vue

@ -1,42 +1,15 @@
<template>
<view class="student-store-page">
<view class="student-fixed">
<view class="hero">
<!-- <view class="hero-glow hero-glow-a"></view>
<view class="hero-glow hero-glow-b"></view>
<view class="hero-sticker sticker-near">附近正在拼</view> -->
<view class="top-bar">
<view class="back-btn" @tap="back"
:style="{'top': menuButtonInfo.top + 'px','width': menuButtonInfo.height + 'px','height': menuButtonInfo.height + 'px'}">
<uni-icons type="left" size="30" color="#8b4324"></uni-icons>
</view>
<view class="page-title"></view>
</view>
<view class="hero-community" @tap="goPendingGroup">
<view class="hero-left">
<!-- <view class="hand-tag">Campus walk</view> -->
<view class="hero-title">团购杂货铺
<view class="brand-chip" style="width: 340rpx;">半径里# 有拼团在等你</view>
</view>
<view class="pending-entry">
<view class="pending-copy">
<view class="pending-title">查看待成团列表</view>
<view class="pending-sub">看看同校还有哪些拼团差人</view>
</view>
<view class="pending-arrow">去看看</view>
</view>
</view>
<view class="squirrel-card">
<image class="squirrel-img" src="/static/images/img/songshu.png" mode="aspectFit"></image>
<view class="squirrel-dialog">待成团入口</view>
<view class="group-pop">拼</view>
</view>
<view class="top-bar">
<view class="back-btn" @tap="back"
:style="{'top': menuButtonInfo.top + 'px','width': menuButtonInfo.height + 'px','height': menuButtonInfo.height + 'px'}">
<uni-icons type="left" size="30" color="#8b4324"></uni-icons>
</view>
<view class="page-title"></view>
</view>
<view class="search-strip-wrap">
<view class="search-strip-wrap" :style="{'padding-top': menuButtonInfo.top + 'px'}">
<view class="hot-search-card">
<view class="hot-search-main" @tap="focusSearch">
<view class="hot-search-icon">🔎</view>
@ -55,7 +28,33 @@
</view>
</view>
</view>
<view class="hero-holder"></view>
<view class="hero-holder" :style="{'height': (menuButtonInfo.top + menuButtonInfo.height + 8) + 'px'}"></view>
<view class="hero">
<!-- <view class="hero-glow hero-glow-a"></view>
<view class="hero-glow hero-glow-b"></view>
<view class="hero-sticker sticker-near">附近正在拼</view> -->
<view class="hero-community" @tap="goPendingGroup">
<view class="hero-left">
<!-- <view class="hand-tag">Campus walk</view> -->
<view class="hero-title">团购杂货铺
<view class="brand-chip" style="width: 340rpx;">半径里# 有拼团在等你</view>
</view>
<view class="pending-entry">
<view class="pending-copy">
<view class="pending-title">查看待成团列表</view>
<view class="pending-sub">看看同校还有哪些拼团差人</view>
</view>
<view class="pending-arrow">去看看</view>
</view>
</view>
<view class="squirrel-card">
<image class="squirrel-img" src="/static/images/img/songshu.png" mode="aspectFit"></image>
<view class="squirrel-dialog">待成团入口</view>
<view class="group-pop">拼</view>
</view>
</view>
</view>
<view class="interest-scroll">
<view class="interest-list">
@ -565,14 +564,20 @@
left: 0;
right: 0;
z-index: 1000;
padding: 0 24rpx 16rpx;
box-sizing: border-box;
background:
radial-gradient(circle at 82% 120rpx, rgba(255, 241, 210, 0.9) 0, rgba(255, 241, 210, 0) 260rpx),
linear-gradient(180deg, #ffd0b8 0%, #ffe6d6 100%);
box-shadow: 0 12rpx 26rpx rgba(172, 93, 45, 0.08);
}
.hero {
width: 100%;
min-height: 452rpx;
padding: 0 24rpx 20rpx;
padding: 0 24rpx 16rpx;
box-sizing: border-box;
color: #fff;
margin-top: 12rpx;
position: relative;
overflow: hidden;
background:
@ -585,7 +590,7 @@
}
.hero-holder {
height: 576rpx;
height: 170rpx;
}
.hero::after {
@ -717,8 +722,8 @@
}
.hero-community {
margin-top: 112rpx;
padding: 22rpx 22rpx 20rpx;
margin-top: 4rpx;
padding: 18rpx 22rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
@ -978,7 +983,7 @@
}
.hero-title {
margin-top: 28rpx;
margin-top: 8rpx;
font-size: 54rpx;
font-weight: 900;
line-height: 66rpx;
@ -1045,34 +1050,34 @@
.hot-search-card {
width: 100%;
margin: 0;
padding: 16rpx;
border-radius: 34rpx;
background: rgba(255, 255, 255, 0.58);
border: 1rpx solid rgba(255, 255, 255, 0.72);
box-shadow: 0 18rpx 42rpx rgba(178, 102, 48, 0.12);
padding: 0;
border-radius: 0;
background: transparent;
border: 0;
box-shadow: none;
box-sizing: border-box;
position: relative;
z-index: 5;
backdrop-filter: blur(14rpx);
}
.search-strip-wrap {
width: 94%;
margin: -40rpx auto 12rpx;
width: calc(100% - 294rpx);
margin: 0 0 0 94rpx;
position: relative;
z-index: 5;
box-sizing: border-box;
}
.hot-search-main {
height: 76rpx;
height: 72rpx;
padding: 0 16rpx;
border-radius: 26rpx;
background: rgba(255, 255, 255, 0.72);
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.86);
display: flex;
align-items: center;
position: relative;
overflow: hidden;
box-shadow: inset 0 0 0 1rpx rgba(255, 205, 158, 0.32);
box-shadow: 0 10rpx 26rpx rgba(178, 102, 48, 0.1), inset 0 0 0 1rpx rgba(255, 205, 158, 0.32);
}
.hot-search-main::after {
@ -1102,7 +1107,7 @@
.hot-search-field {
flex: 1;
min-width: 0;
height: 76rpx;
height: 72rpx;
margin-left: 16rpx;
position: relative;
z-index: 1;
@ -1110,7 +1115,7 @@
.hot-word-swiper {
width: 100%;
height: 76rpx;
height: 72rpx;
position: absolute;
left: 0;
top: 0;
@ -1122,7 +1127,7 @@
color: #4f311f;
font-size: 24rpx;
font-weight: 900;
line-height: 76rpx;
line-height: 72rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -1131,7 +1136,7 @@
.hot-search-input {
width: 100%;
min-width: 0;
height: 76rpx;
height: 72rpx;
color: #4f311f;
font-size: 24rpx;
position: relative;
@ -1174,7 +1179,7 @@
.interest-scroll {
width: 94%;
margin: -20rpx auto 12rpx;
margin: 12rpx auto 12rpx;
position: relative;
z-index: 4;
}

121
package2/myCenter/partTimeJobRegister.vue

@ -90,9 +90,9 @@
</view>
<view class="box1" v-if="formData.waima != false || formData.paotui != false">
<view class="reg-name rule-section-title">
<text style="color:red;">*</text> 我的赚钱地盘
<text v-if="formData.waima" style="color:red;">*</text> 我的赚钱地盘
</view>
<view class="rule-section-desc">选择你愿意配送的取货点和楼栋,再设置最低配送费。系统只会按这些范围给你派单。</view>
<view class="rule-section-desc">外卖需选择愿意配送的取货点和楼栋;快递接单范围可稍后再设置。</view>
<view class="reg-value">
<view class="value1" v-if="formData.waima">
<view class="value-title">
@ -153,7 +153,7 @@
<view class="rule-empty-card" v-if="paotuiRuleList.length == 0" @tap="checkAddress('paotui')">
<view class="rule-empty-icon">地盘</view>
<view class="rule-empty-title">你还没有划定快递赚钱地盘</view>
<view class="rule-empty-desc">选择快递站和宿舍楼,系统才会把符合范围的快递单派给你。</view>
<view class="rule-empty-desc">可先提交注册,之后再选择快递站和宿舍楼来开启对应范围派单。</view>
</view>
<view class="guize-list">
<view class="guize1 route-card" v-for="(item, index) in paotuiRuleList" :key="index">
@ -262,6 +262,10 @@
<view class="area-popup-title">{{currentConfigType == 'waima' ? '生成外卖接单路线' : '生成快递接单路线'}}</view>
<view class="area-popup-scroll">
<view class="area-popup-desc">选中的取货点和送达区域会两两组合生成路线,新路线默认使用本弹窗填写的最低配送费和备注。</view>
<view class="full-area-btn" v-if="currentConfigType == 'waima'" @tap="toggleWaimaFullAreaOrder"
:class="{'full-area-btn--active': waimaFullAreaOrder}">
{{waimaFullAreaOrder ? '已开启全域接单' : '全域接单'}}
</view>
<view class="route-default-card">
<view class="route-default-row">
<view class="route-default-label">本次最低配送费</view>
@ -426,7 +430,8 @@
dispatchSaving: false,
zhipaiCheck: false,
pendingNewDispatchRuleKeys: [],
workerNameAuditTip: ''
workerNameAuditTip: '',
waimaFullAreaOrder: false
}
},
components: {
@ -465,6 +470,15 @@
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
methods: {
getCurrentRegionId() {
try {
const area = uni.getStorageSync('area')
if (!area) return ''
return (typeof area == 'string' ? JSON.parse(area) : area).id || ''
} catch (e) {
return ''
}
},
formatMoneyInput(value) {
value = String(value || '');
value = value.replace(/[^\d.]/g, '');
@ -598,8 +612,9 @@
getWorkerMessage(openDispatchAfterLoad, enablePushOrderAfterLoad) {
const worker = uni.getStorageSync('worker')
if (!worker || !worker.workerId) return
const regionId = this.getCurrentRegionId()
let that = this
that.tui.request("/app/workerRelaPrice/getByWorkerId?workerId=" + worker.workerId,
that.tui.request("/app/workerRelaPrice/getByWorkerId?workerId=" + worker.workerId + "&regionId=" + regionId,
"GET", {}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != null) {
@ -704,6 +719,45 @@
})
this.$forceUpdate()
},
toggleWaimaFullAreaOrder() {
this.waimaFullAreaOrder = !this.waimaFullAreaOrder
this.buildRouteAreaOptions('waima')
},
buildRouteAreaOptions(type) {
let that = this
this.qucan = [];
this.songcan = [];
let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList;
let isCanteenVal = type == 'waima' ? 1 : 2;
let isFullAreaOrder = type == 'waima' && this.waimaFullAreaOrder;
this.shopArea.forEach(item => {
let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id);
let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id);
if (isFullAreaOrder) {
that.qucan.push({
...item,
checked: isGetChecked
});
that.songcan.push({
...item,
checked: isPutChecked
});
} else if (item.isCanteen == isCanteenVal) {
that.qucan.push({
...item,
checked: isGetChecked
});
} else {
that.songcan.push({
...item,
checked: isPutChecked
});
}
});
this.$forceUpdate()
},
closeGuize() {
let selectedQucan = this.qucan.filter(item => item.checked);
let selectedSongcan = this.songcan.filter(item => item.checked);
@ -728,6 +782,7 @@
let currentRuleList = this.currentConfigType == 'waima' ? this.waimaRuleList : this.paotuiRuleList;
let newRules = [];
let userId = uni.getStorageSync('id') || '';
let regionId = this.getCurrentRegionId();
selectedQucan.forEach(q => {
selectedSongcan.forEach(s => {
let existing = currentRuleList.find(r => r.getAreaId == q.id && r.putAreaId == s
@ -737,6 +792,7 @@
} else {
newRules.push({
workerId: "W" + userId,
regionId: regionId,
getAreaId: q.id,
getAreaName: q.title,
putAreaId: s.id,
@ -837,6 +893,7 @@
this.dispatchSaving = true
this.tui.request('/app/workerRelaPrice/batchUpdate', 'post', {
userId: uni.getStorageSync('id'),
regionId: this.getCurrentRegionId(),
workerRelaPriceList: selectRuleList,
getPushOrder: this.zhipaiCheck ? 1 : 0
}).then(res => {
@ -866,29 +923,8 @@
})
},
checkAddress(type) {
let that = this
this.currentConfigType = type;
this.qucan = [];
this.songcan = [];
let currentRuleList = type == 'waima' ? this.waimaRuleList : this.paotuiRuleList;
let isCanteenVal = type == 'waima' ? 1 : 2;
this.shopArea.forEach(item => {
let isGetChecked = currentRuleList.some(r => r.getAreaId == item.id);
let isPutChecked = currentRuleList.some(r => r.putAreaId == item.id);
if (item.isCanteen == isCanteenVal) {
that.qucan.push({
...item,
checked: isGetChecked
});
} else {
that.songcan.push({
...item,
checked: isPutChecked
});
}
});
this.buildRouteAreaOptions(type)
this.$refs.guizePopup.open()
},
removeRule(type, index) {
@ -916,13 +952,6 @@
icon: 'none'
});
}
if (this.formData.paotui && this.paotuiRuleList.length == 0) {
return uni.showToast({
title: '请先划定快递赚钱地盘',
icon: 'none'
});
}
let workerRelaPriceList = [];
if (this.formData.waima) {
this.waimaRuleList.forEach(item => this.normalizeOrderBkge(item));
@ -945,8 +974,11 @@
workerRelaPriceList = workerRelaPriceList.concat(this.paotuiRuleList);
}
const regionId = this.getCurrentRegionId();
workerRelaPriceList.forEach(item => item.regionId = regionId);
let submitData = {
userId: uni.getStorageSync('id'),
regionId: regionId,
workerName: this.formData.name,
cardPicture: this.formData.studentCard,
highFloorFee: this.formatOneDecimalInput(this.formData.highFloorFee),
@ -976,7 +1008,7 @@
worker1.workerName = this.formData.name
if (hasNewRule) worker1.getPushOrder = 1
uni.setStorageSync('worker', worker1)
this.getWorkerMessage(true, hasNewRule)
this.getWorkerMessage(workerRelaPriceList.length > 0, hasNewRule)
} else {
const message = this.getResponseMessage(res, '提交失败')
if (this.isWorkerNameAuditMessage(message)) {
@ -1632,6 +1664,25 @@
line-height: 36rpx;
}
.full-area-btn {
margin-top: 16rpx;
height: 70rpx;
line-height: 70rpx;
border-radius: 70rpx;
background: rgba(247, 248, 248, 0.9);
border: 1px solid rgba(0, 35, 28, 0.12);
color: #00624f;
font-size: 26rpx;
font-weight: 900;
text-align: center;
}
.full-area-btn--active {
background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
border-color: rgba(166, 255, 234, 1);
color: #00231C;
}
.area-popup-scroll {
flex: 1;
min-height: 0;

Loading…
Cancel
Save