添加分享

master
mhsnet 2 months ago
parent 41c8136fb5
commit de57d4e18d

@ -38,6 +38,11 @@ onShow(() => {
console.log(queryParams.value)
fnGetDeviceList()
}
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
// -
const getLocationInfo = () => {

@ -49,7 +49,7 @@ const getUnitData = async () => {
return
}
const params = {
mobilePhone: clientMobile.value
mobilePhone: clientMobile.value,
}
const res = await getUnitListAPI(params)
unitList.value = res.data
@ -57,6 +57,14 @@ const getUnitData = async () => {
onLoad(() => {
getData()
})
//
onShow(() => {
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
//
const sumVal = computed(() => {
@ -77,7 +85,7 @@ const sumVal = computed(() => {
const priceChange = (item: any) => {
const val = item.actualRecoveryPrice - item.recoveryPrice
const num1 = Math.abs(val)
const percent = (Math.round(num1 / item.recoveryPrice * 10000) / 100).toFixed();
const percent = (Math.round((num1 / item.recoveryPrice) * 10000) / 100).toFixed()
if (percent > 10) {
if (val < 0) {
item.actualRecoveryPrice = Number(item.recoveryPrice * 0.9).toFixed(2)
@ -103,7 +111,7 @@ const handlePayment = async () => {
return
}
const arrFlag = siteProductList.value.map((q) => {
const childFlag = q.children.some(q => {
const childFlag = q.children.some((q) => {
return q?.productActualWeight && q?.actualRecoveryPrice
})
return childFlag
@ -264,12 +272,23 @@ const popupDel = (idx) => {
<view class="cont">
<view class="form-phone">
<view class="label">手机号</view>
<input type="number" maxlength="11" class="val" @blur="handlePhoneChange" v-model="clientMobile"
placeholder="请输入手机号" />
<input
type="number"
maxlength="11"
class="val"
@blur="handlePhoneChange"
v-model="clientMobile"
placeholder="请输入手机号"
/>
</view>
<view class="switch" v-if="unitList.length">
<view class="label">是否单位订单</view>
<switch color="#3775F6" :checked="isUnit" @change="switchUnitChange" style="transform:scale(0.7)" />
<switch
color="#3775F6"
:checked="isUnit"
@change="switchUnitChange"
style="transform: scale(0.7)"
/>
</view>
<view class="uni-list-cell" v-if="isUnit">
<view class="uni-list-cell-left">单位名称</view>
@ -284,14 +303,25 @@ const popupDel = (idx) => {
</view>
<view class="switch">
<view class="label">{{ selectText }}</view>
<switch color="#3775F6" :checked="allSelectd" @change="switchChange" style="transform:scale(0.7)" />
<switch
color="#3775F6"
:checked="allSelectd"
@change="switchChange"
style="transform: scale(0.7)"
/>
</view>
<view class="form">
<uni-collapse>
<uni-collapse-item v-for="item in siteProductList " :key="item.id" :name="item.id" :open="item.open"
:title="item.name" :thumb="item.imgUrl">
<uni-collapse-item
v-for="item in siteProductList"
:key="item.id"
:name="item.id"
:open="item.open"
:title="item.name"
:thumb="item.imgUrl"
>
<view class="children">
<view class="detail-item" v-for=" item2 in item.children " :key="item2.id">
<view class="detail-item" v-for="item2 in item.children" :key="item2.id">
<view class="hd">
<view class="product-info">
<image class="img-url" :src="item2.imgUrl"></image>
@ -304,12 +334,19 @@ const popupDel = (idx) => {
</view>
<view class="weight">
<view class="label">实际价格</view>
<input class="val uni-input" @change="priceChange(item2)" v-model="item2.actualRecoveryPrice"
type="digit" placeholder="请输入实际价格" />
<input
class="val uni-input"
@change="priceChange(item2)"
v-model="item2.actualRecoveryPrice"
type="digit"
placeholder="请输入实际价格"
/>
</view>
<view class="weight">
<view class="label">实际重量Kg</view>
<view class="val uni-input" @click="popupShow(item2)">{{ item2.productActualWeight }}</view>
<view class="val uni-input" @click="popupShow(item2)">{{
item2.productActualWeight
}}</view>
</view>
</view>
</view>
@ -333,7 +370,12 @@ const popupDel = (idx) => {
<view class="popup-cont">
<view class="weight-item" v-for="(item, index) in weightArr" :key="item.id">
<view class="label">{{ index + 1 }}次称重</view>
<input class="val uni-input" v-model="item.val" type="digit" placeholder="请输入实际重量" />
<input
class="val uni-input"
v-model="item.val"
type="digit"
placeholder="请输入实际重量"
/>
<view class="del" v-if="index > 0" @click="popupDel(index)"></view>
</view>
</view>
@ -520,7 +562,7 @@ page {
}
.pay-action {
background: linear-gradient(143deg, #51B6FF 1%, #3775F6 92%);
background: linear-gradient(143deg, #51b6ff 1%, #3775f6 92%);
width: 400rpx;
margin: 20rpx auto 0;
padding: 10rpx 0;
@ -562,7 +604,7 @@ page {
color: #333;
font-size: 32rpx;
text-align: center;
background-color: #3775F6;
background-color: #3775f6;
border-radius: 25rpx;
color: #fff;
}
@ -602,7 +644,7 @@ page {
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
background: linear-gradient(143deg, #51B6FF 1%, #3775F6 92%);
background: linear-gradient(143deg, #51b6ff 1%, #3775f6 92%);
color: #fff;
text-align: center;
margin: 40rpx auto 10rpx;

@ -7,6 +7,14 @@ import { onReady, onShow } from '@dcloudio/uni-app'
//
const orderAcceptPopup = ref<UniHelper.UniPopupInstance>()
const memberStore = useMemberStore()
//
onShow(async () => {
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
const isLogin = computed(() => {
const token = memberStore.profile?.token
@ -49,18 +57,31 @@ const handleOrderAccept = (item: any) => {
<template v-if="isLogin">
<view class="cont">
<view class="tabs">
<text class="item" v-for="(item, index) in orderTabs" :key="item.title" @tap="handleIndexChange(index)">
<text
class="item"
v-for="(item, index) in orderTabs"
:key="item.title"
@tap="handleIndexChange(index)"
>
{{ item.title }}
</text>
<!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
</view>
<!-- 滑动容器 -->
<swiper class="swiper" :current="activeIndex" @change="handleIndexChange($event.detail.current)">
<swiper
class="swiper"
:current="activeIndex"
@change="handleIndexChange($event.detail.current)"
>
<!-- 滑动项 -->
<swiper-item v-for="item in orderTabs" :key="item.title">
<!-- 订单列表 -->
<DataList v-if="item.isRender" :order-state="item.orderState" @accept="handleOrderAccept" />
<DataList
v-if="item.isRender"
:order-state="item.orderState"
@accept="handleOrderAccept"
/>
</swiper-item>
</swiper>
</view>
@ -190,7 +211,7 @@ page {
.primary {
color: #fff;
background-color: #3775F6;
background-color: #3775f6;
border: none;
}
}
@ -252,13 +273,13 @@ page {
}
.title {
color: #0D0D26;
color: #0d0d26;
font-size: 36rpx;
margin: 20rpx 0;
}
.desc {
color: #999A9F;
color: #999a9f;
font-size: 28rpx;
margin: 20rpx 0;
}
@ -273,7 +294,7 @@ page {
margin: 60rpx auto;
color: #fff;
width: 400rpx;
background: linear-gradient(149deg, #51B6FF 19%, #3775F6 82%);
background: linear-gradient(149deg, #51b6ff 19%, #3775f6 82%);
}
}
}

@ -22,6 +22,12 @@ onShow(() => {
if (isLogin.value) {
getData()
}
//
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
const version = ref('')
onLoad(() => {

@ -91,7 +91,7 @@ const getOrderData = async () => {
if (res.data.list.length) {
res.data.list.forEach((e) => {
if (e.housingEstateInfo) {
const arr = e.housingEstateInfo.images && JSON.parse(e.housingEstateInfo.images) || []
const arr = (e.housingEstateInfo.images && JSON.parse(e.housingEstateInfo.images)) || []
const imgUrl = serviceDomain + arr[0]?.url
e.housingEstateInfo.imgUrl = imgUrl
}
@ -166,14 +166,13 @@ const sumVal = computed(() => {
//
const handlePayment = async () => {
const arrFlag = siteProductList.value.map((q) => {
const childFlag = q.children?.some(q => {
const childFlag = q.children?.some((q) => {
return q?.productActualWeight && q?.actualRecoveryPrice
})
return childFlag
})
const flag = arrFlag.some((e) => e)
if (flag) {
uni.showModal({
title: '提示',
@ -230,6 +229,11 @@ onShow(() => {
queryParams.pageNo = 1
getOrderData()
}
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
const handlePhone = (clientMobile) => {
@ -262,7 +266,7 @@ const switchChange = (e) => {
const priceChange = (item: any) => {
const val = item.actualRecoveryPrice - item.recoveryPrice
const num1 = Math.abs(val)
const percent = (Math.round(num1 / item.recoveryPrice * 10000) / 100).toFixed();
const percent = (Math.round((num1 / item.recoveryPrice) * 10000) / 100).toFixed()
if (percent > 10) {
if (val < 0) {
item.actualRecoveryPrice = Number(item.recoveryPrice * 0.9).toFixed(2)
@ -339,17 +343,32 @@ const popupDel = (idx) => {
<view class="house">
<view class="item arrow">
<view class="label">选择小区</view>
<picker mode="selector" :value="houseIndex" range-key="name" :range="houseList" @change="bindPickerChange">
<picker
mode="selector"
:value="houseIndex"
range-key="name"
:range="houseList"
@change="bindPickerChange"
>
<view class="val">{{ houseInfo.name }}</view>
</picker>
</view>
<view class="item">
<view class="label">小区回收时间</view>
<view class="val">{{ houseInfo.appointmentTimeStart }} - {{ houseInfo.appointmentTimeEnd }}</view>
<view class="val"
>{{ houseInfo.appointmentTimeStart }} - {{ houseInfo.appointmentTimeEnd }}</view
>
</view>
</view>
<scroll-view enablorderStatee-back-to-top scroll-y class="orders" refresher-enabled
:refresher-triggered="isTriggered" @refresherrefresh="onRefresherrefresh" @scrolltolower="getOrderData">
<scroll-view
enablorderStatee-back-to-top
scroll-y
class="orders"
refresher-enabled
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getOrderData"
>
<view class="item" v-for="item in orderList" :key="item.id">
<view class="hd">
<view class="num">订单编号{{ item.orderNumber }}</view>
@ -380,22 +399,41 @@ const popupDel = (idx) => {
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
</view>
</scroll-view>
<uni-popup ref="popup" class="popup" :mask-click="false" type="bottom" background-color="#fff">
<uni-popup
ref="popup"
class="popup"
:mask-click="false"
type="bottom"
background-color="#fff"
>
<view class="popup-hd">
<view class="popup-title">回收品类</view>
<view class="popup-close" @click="handlePopClose"><uni-icons type="closeempty" size="24"></uni-icons></view>
<view class="popup-close" @click="handlePopClose"
><uni-icons type="closeempty" size="24"></uni-icons
></view>
</view>
<view class="popup-content">
<view class="switch">
<view class="label">{{ selectText }}</view>
<switch color="#3775F6" :checked="allSelectd" @change="switchChange" style="transform:scale(0.7)" />
<switch
color="#3775F6"
:checked="allSelectd"
@change="switchChange"
style="transform: scale(0.7)"
/>
</view>
<view class="form">
<uni-collapse>
<uni-collapse-item v-for="item in siteProductList " :key="item.id" :name="item.id" :open="item.open"
:title="item.name" :thumb="item.imgUrl">
<uni-collapse-item
v-for="item in siteProductList"
:key="item.id"
:name="item.id"
:open="item.open"
:title="item.name"
:thumb="item.imgUrl"
>
<view class="children">
<view class="detail-item" v-for=" item2 in item.children " :key="item2.id">
<view class="detail-item" v-for="item2 in item.children" :key="item2.id">
<view class="hd">
<view class="product-info">
<image class="img-url" :src="item2.imgUrl"></image>
@ -408,12 +446,19 @@ const popupDel = (idx) => {
</view>
<view class="weight">
<view class="label">实际价格</view>
<input class="val uni-input" @change="priceChange(item2)" v-model="item2.actualRecoveryPrice"
type="digit" placeholder="请输入实际价格" />
<input
class="val uni-input"
@change="priceChange(item2)"
v-model="item2.actualRecoveryPrice"
type="digit"
placeholder="请输入实际价格"
/>
</view>
<view class="weight">
<view class="label">实际重量Kg</view>
<view class="val uni-input" @click="popupShow(item2)">{{ item2.productActualWeight }}</view>
<view class="val uni-input" @click="popupShow(item2)">{{
item2.productActualWeight
}}</view>
</view>
</view>
</view>
@ -439,7 +484,12 @@ const popupDel = (idx) => {
<view class="popup-cont">
<view class="weight-item" v-for="(item, index) in weightArr" :key="item.id">
<view class="label">{{ index + 1 }}次称重</view>
<input class="val uni-input" v-model="item.val" type="digit" placeholder="请输入实际重量" />
<input
class="val uni-input"
v-model="item.val"
type="digit"
placeholder="请输入实际重量"
/>
<view class="del" v-if="index > 0" @click="popupDel(index)"></view>
</view>
</view>
@ -555,7 +605,7 @@ page {
.statusLabel {
font-size: 24rpx;
color: #FF7D00;
color: #ff7d00;
}
}
@ -563,8 +613,8 @@ page {
padding: 10rpx;
min-height: 100rpx;
font-size: 28rpx;
border-top: 2rpx solid #F2F2F2;
border-bottom: 2rpx solid #F2F2F2;
border-top: 2rpx solid #f2f2f2;
border-bottom: 2rpx solid #f2f2f2;
.order-details {
display: flex;
@ -665,9 +715,9 @@ page {
margin: 20rpx;
}
.popup-close {}
.popup-close {
}
}
.popup-content {
height: 68vh;
@ -804,7 +854,6 @@ page {
.label {
width: 260rpx;
;
color: #0d0d26;
font-size: 36rpx;
}
@ -822,7 +871,7 @@ page {
}
.pay-action {
background: linear-gradient(143deg, #51B6FF 1%, #3775F6 92%);
background: linear-gradient(143deg, #51b6ff 1%, #3775f6 92%);
width: 400rpx;
margin: 20rpx auto 0;
padding: 10rpx 0;
@ -864,7 +913,7 @@ page {
color: #333;
font-size: 32rpx;
text-align: center;
background-color: #3775F6;
background-color: #3775f6;
border-radius: 25rpx;
color: #fff;
}
@ -904,7 +953,7 @@ page {
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
background: linear-gradient(143deg, #51B6FF 1%, #3775F6 92%);
background: linear-gradient(143deg, #51b6ff 1%, #3775f6 92%);
color: #fff;
text-align: center;
margin: 40rpx auto 10rpx;

Loading…
Cancel
Save