添加分享

master
mhsnet 2 months ago
parent 41c8136fb5
commit de57d4e18d

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

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

@ -7,6 +7,14 @@ import { onReady, onShow } from '@dcloudio/uni-app'
// //
const orderAcceptPopup = ref<UniHelper.UniPopupInstance>() const orderAcceptPopup = ref<UniHelper.UniPopupInstance>()
const memberStore = useMemberStore() const memberStore = useMemberStore()
//
onShow(async () => {
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
})
const isLogin = computed(() => { const isLogin = computed(() => {
const token = memberStore.profile?.token const token = memberStore.profile?.token
@ -49,18 +57,31 @@ const handleOrderAccept = (item: any) => {
<template v-if="isLogin"> <template v-if="isLogin">
<view class="cont"> <view class="cont">
<view class="tabs"> <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 }} {{ item.title }}
</text> </text>
<!-- 游标 --> <!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view> <view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
</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"> <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-item>
</swiper> </swiper>
</view> </view>
@ -190,7 +211,7 @@ page {
.primary { .primary {
color: #fff; color: #fff;
background-color: #3775F6; background-color: #3775f6;
border: none; border: none;
} }
} }
@ -252,13 +273,13 @@ page {
} }
.title { .title {
color: #0D0D26; color: #0d0d26;
font-size: 36rpx; font-size: 36rpx;
margin: 20rpx 0; margin: 20rpx 0;
} }
.desc { .desc {
color: #999A9F; color: #999a9f;
font-size: 28rpx; font-size: 28rpx;
margin: 20rpx 0; margin: 20rpx 0;
} }
@ -273,7 +294,7 @@ page {
margin: 60rpx auto; margin: 60rpx auto;
color: #fff; color: #fff;
width: 400rpx; 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) { if (isLogin.value) {
getData() getData()
} }
//
uni.showShareMenu({
title: '宁夏回收端',
menus: ['shareAppMessage', 'shareTimeline'],
path: '/pages/index/index',
})
}) })
const version = ref('') const version = ref('')
onLoad(() => { onLoad(() => {

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

Loading…
Cancel
Save