This commit is contained in:
Mr.jiang 2024-07-11 17:24:37 +08:00
parent 39973f393e
commit c35641acd8
6 changed files with 277 additions and 49 deletions

View File

@ -0,0 +1,235 @@
<template>
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
{{tips.text}}
</view>
<block v-for="(item, index) in list" :key="index">
<view
@touchmove.stop.prevent
@tap="itemClick(index)"
:style="[itemStyle(index)]"
class="u-action-sheet-item u-line-1"
:class="[index < list.length - 1 ? 'u-border-bottom' : '']"
:hover-stay-time="150"
>
<text>{{item.text}}</text>
<text class="u-action-sheet-item__subtext u-line-1" v-if="item.subText">{{item.subText}}</text>
</view>
</block>
<input class="gongli" type="number" placeholder="请输入免费公里数" v-model="inpValue"/>
<view class="u-gab" v-if="cancelBtn">
</view>
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
</u-popup>
</template>
<script>
/**
* actionSheet 操作菜单
* @description 本组件用于从底部弹出一个操作菜单供用户选择并返回结果本组件功能类似于uni的uni.showActionSheetAPI配置更加灵活所有平台都表现一致
* @tutorial https://www.uviewui.com/components/actionSheet.html
* @property {Array<Object>} list 按钮的文字数组见官方文档示例
* @property {Object} tips 顶部的提示文字见官方文档示例
* @property {String} cancel-text 取消按钮的提示文字
* @property {Boolean} cancel-btn 是否显示底部的取消按钮默认true
* @property {Number String} border-radius 弹出部分顶部左右的圆角值单位rpx默认0
* @property {Boolean} mask-close-able 点击遮罩是否可以关闭默认true
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配默认false
* @property {Number String} z-index z-index值默认1075
* @property {String} cancel-text 取消按钮的提示文字
* @event {Function} click 点击ActionSheet列表项时触发
* @event {Function} close 点击取消按钮时触发
* @example <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
*/
export default {
name: "u-action-sheet",
props: {
// actionsheet
maskCloseAble: {
type: Boolean,
default: true,
chuzuValue:''
},
// rpx
list: {
type: Array,
default () {
//
// return [{
// text: '',
// color: '',
// fontSize: ''
// }]
return [];
}
},
//
tips: {
type: Object,
default () {
return {
text: '',
color: '',
fontSize: '26'
}
}
},
//
cancelBtn: {
type: Boolean,
default: true
},
// iPhoneX
safeAreaInsetBottom: {
type: Boolean,
default: false
},
//
value: {
type: Boolean,
default: false
},
//
borderRadius: {
type: [String, Number],
default: 0
},
// z-index
zIndex: {
type: [String, Number],
default: 0
},
//
cancelText: {
type: String,
default: '取消'
}
},
data(){
return{
inpValue:''
}
},
computed: {
//
tipsStyle() {
let style = {};
if (this.tips.color) style.color = this.tips.color;
if (this.tips.fontSize) style.fontSize = this.tips.fontSize + 'rpx';
return style;
},
//
itemStyle() {
return (index) => {
let style = {};
if (this.list[index].color) style.color = this.list[index].color;
if (this.list[index].fontSize) style.fontSize = this.list[index].fontSize + 'rpx';
//
if (this.list[index].disabled) style.color = '#c0c4cc';
return style;
}
},
uZIndex() {
// z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
mounted() {
console.log("listShow",this.listShow)
},
methods: {
chuzuInp(e){
this.chuzuValue=e.detail.value
},
//
close() {
// inputpropsvalue
// vue
this.popupClose();
this.$emit('close');
},
//
popupClose() {
this.$emit('input', false);
},
// item
itemClick(index) {
// disabled
var that=this;
if(that.list[index].disabled) return;
if(index=='1'){
console.log("this.inpValue",this.inpValue)
if(that.inpValue!=''){
that.$emit('tripWayData', this.inpValue);
that.$emit('click', index);
that.$emit('input', false);
}else{
that.$emit('tripWayData',' ');
uni.showToast({
icon:'error',
title:"请输入免费公里数"
})
}
}else{
that.$emit('tripWayData',' ');
that.$emit('click', index);
that.$emit('input', false);
}
}
}
}
</script>
<style lang="scss" scoped>
@import '../libs/css/style.components.scss';
/deep/.gongli{
text-align: center;
height: 50px;
border-top: 1px solid #e4e7ed;
}
.chuzuinp{
height: 40px;
width: 90%;
background: #f7f7f7;
margin: 5px auto;
text-align: center;
border-radius: 30px;
}
.u-tips {
font-size: 26rpx;
text-align: center;
padding: 34rpx 0;
line-height: 1;
color: $u-tips-color;
}
.u-action-sheet-item {
@include vue-flex;;
line-height: 1;
justify-content: center;
align-items: center;
font-size: 32rpx;
padding: 34rpx 0;
flex-direction: column;
}
.u-action-sheet-item__subtext {
font-size: 24rpx;
color: $u-tips-color;
margin-top: 20rpx;
}
.u-gab {
height: 12rpx;
background-color: rgb(234, 234, 236);
}
.u-actionsheet-cancel {
color: $u-main-color;
}
</style>

View File

@ -142,7 +142,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<view class="mian-content-list">
@ -248,7 +249,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<!-- <view class="mian-view-list">
<span class="mian-view-list-title">优惠券</span>
@ -462,7 +464,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text">{{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<view class="mian-content-list">
<span class="mian-content-list-title">是否提前结束</span>
@ -521,7 +524,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<!-- <view class="mian-view-list">
<span class="mian-view-list-title">优惠券</span>
@ -731,7 +735,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<view class="mian-content-list">
<span class="mian-content-list-title">是否提前结束</span>
@ -753,7 +758,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<!-- <view class="mian-view-list">
<span class="mian-view-list-title">优惠券</span>
@ -971,7 +977,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text">{{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<view class="mian-content-list">
<span class="mian-content-list-title">是否提前结束</span>
@ -993,7 +1000,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.projectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<!-- <view class="mian-view-list">
<span class="mian-view-list-title">优惠券</span>
@ -1205,7 +1213,8 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<view class="mian-content-list">
<span class="mian-content-list-title">是否提前结束</span>
@ -1264,8 +1273,10 @@
</view>
<view class="mian-view-list">
<span class="mian-view-list-title">项目收益</span>
<span class="mian-view-list-text"> {{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-if="order.isSupplement">{{order.oldProjectBenefits}}</span>
<span class="mian-view-list-text" v-else>{{order.projectBenefits}}</span>
</view>
<!-- <view class="mian-view-list">
<span class="mian-view-list-title">优惠券</span>
<span class="mian-view-list-text" style="color: #FF6000;" v-if="order.couponMoney">-{{order.couponMoney}}</span>
@ -1903,16 +1914,13 @@
that.$queue.showLoading('提交中...')
let resA = await post('/app/artificer/accomplishOrders', data);
uni.hideLoading();
try {
if (resA.code == 0||resA.code==200) {
websocketUtils.uploadAudioEnd(); //
uni.showToast({
title:'操作成功!'
})
this.$refs.popupW.close('bottom');
uni.switchTab({
url:'/pages/order/index'
})
} else {
uni.showToast({
icon:'error',
@ -1920,9 +1928,10 @@
})
// that.$queue.showToast(resA.msg);
}
} catch (e) {
//TODO handle the exception
}
uni.switchTab({
url:'/pages/order/index'
})
// let resB = await getXZX("/app/material/selectMaterialArtificer?artificerId=" +
// artificerId + "&page=" +
// (this

View File

@ -32,7 +32,7 @@
<span class="view-title-left-text" v-if="orderType == 2">本期{{isSfwc=='1'?'已加钟':'未加钟'}}订单</span>
<span class="view-title-left-text" v-if="orderType == 3">本期{{isSfwc=='1'?'已充值':'未充值'}}订单</span>
</view>
<view class="view-title-right">订单数量: {{listData.length}}</view>
<view class="view-title-right">订单数量: {{listData.totalCount}}</view>
</view>
<!--本期加钟 充值 订单-->
<view class="mina-view" v-if="isSfwc=='1'" v-for="item in listData" :key="item.id" @click="goOder(item)">

View File

@ -895,18 +895,18 @@ export default {
this.homePageCountNum[0].num = res?.data?.currentPeriodOrdersSum;
let formathomePageCountNum = (res?.data?.currentPeriodAddBellsSum * 1) * 100;
this.homePageCountNum[1].num = Math.floor(formathomePageCountNum) + "%";
this.homePageCountNum[1].num = Math.ceil(formathomePageCountNum) + "%";
this.homePageCountNumOne=this.homePageCountNum[1].num;
let currentPeriodRechargeSum = ((res?.data?.currentPeriodRechargeSum * 1) * 100);
this.homePageCountNum[2].num = Math.floor(currentPeriodRechargeSum) + "%";
this.homePageCountNum[2].num = Math.ceil(currentPeriodRechargeSum) + "%";
this.homePageCountNumTwo=this.homePageCountNum[2].num;
this.currentWholeIncome = Math.floor(res?.data?.currentPerformance);
this.currentWholeIncome = Math.ceil(res?.data?.currentPerformance);
this.currentRealIncome = res?.data?.earnings;
this.currentIntegral = res?.data?.integral;
this.maxStatus = res?.data.maxStatus;
this.currentRechargeNum = Math.floor(res?.data?.currentPeriodRechargeSum);
this.currentRechargeNum = Math.ceil(res?.data?.currentPeriodRechargeSum);
this.longUpgradeDescriptionSet = {
differenceOutstandingAchievement: res?.data?.differenceOutstandingAchievement,
differenceIntegral: res?.data?.differenceIntegral,

View File

@ -42,12 +42,14 @@
<image src="../../static/images/my/right.png" style="width: 12rpx;height: 21rpx;"></image>
</view>
</view>
<u-action-sheet :list="cxList" v-model="show" @click="cxCallback"></u-action-sheet>
<uActionSheet :list="cxList" @tripWayData="tripWayData" v-model="show" @click="cxCallback"></uActionSheet>
</view>
</template>
<script>
import uActionSheet from '../../components/u-action-sheets.vue'
export default {
components:{uActionSheet},
data() {
return {
tripWayNum:'',
@ -74,6 +76,9 @@
this.getArtificer();
},
methods: {
tripWayData(e){
this.tripWayNum=e;
},
//
getArtificer() {
this.$Request.getT("/app/artificer/selectArtificer").then(res => {
@ -83,13 +88,7 @@
});
},
cxCallback(index) {
if(index=='0'||index=='1'){
this.setChuXing(index + 1)
}else{
var that=this;
that.tripWayNum = uni.getStorageSync('tripWayNum');
that.setChuXing(index+1,that.tripWayNum)
}
this.setChuXing(index+1,this.tripWayNum)
},
setChuXing(tripWay,tripWayNum) {
this.$queue.showLoading('设置中...')

View File

@ -137,9 +137,7 @@
console.log("listShow",this.listShow)
},
methods: {
chuzuInp(e){
this.chuzuValue=e.detail.value
},
//
close() {
// inputpropsvalue
@ -155,22 +153,9 @@
itemClick(index) {
// disabled
var that=this;
// if(that.list[index].disabled) return;
if(index=='1'){
if(that.chuzuValue!=undefined){
uni.setStorageSync('tripWayNum',this.chuzuValue)
if(that.list[index].disabled) return;
that.$emit('click', index);
that.$emit('input', false);
}else{
uni.showToast({
icon:'error',
title:"请输入免费公里数"
})
}
}else{
that.$emit('click', index);
that.$emit('input', false);
}
}
}
}