|
@@ -18,7 +18,7 @@
|
|
<view class="care">(切换分类可输入不同回收物的价格和重量)</view>
|
|
<view class="care">(切换分类可输入不同回收物的价格和重量)</view>
|
|
</view>
|
|
</view>
|
|
<view class="item flex">
|
|
<view class="item flex">
|
|
- <view :class="['item-type', curType == item.code ? 'active' : '']" v-for="item in typeData" :key="item.id">
|
|
|
|
|
|
+ <view :class="['item-type', curType == item.code ? 'active' : '']" v-for="(item,index) in typeData" :key="item.id" @click="getRow(item.code,index)">
|
|
{{item.dispName}}
|
|
{{item.dispName}}
|
|
</view>
|
|
</view>
|
|
<!-- <view class="item-type">
|
|
<!-- <view class="item-type">
|
|
@@ -30,27 +30,30 @@
|
|
<view>重量(kg)</view>
|
|
<view>重量(kg)</view>
|
|
<view>合计金额(元)</view>
|
|
<view>合计金额(元)</view>
|
|
</view>
|
|
</view>
|
|
- <view class="item flex justify_between">
|
|
|
|
|
|
+ <view v-if="list.length && list[curIndex].typeList.length" v-for="item in list[curIndex].typeList" :key="item.id" class="item flex justify_between align_center">
|
|
<view class="flex align_center">
|
|
<view class="flex align_center">
|
|
- <text>黄纸</text>
|
|
|
|
- <u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="value" placeholder="" type="number" />
|
|
|
|
|
|
+ <text>{{item.name}}</text>
|
|
|
|
+ <u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="item.customerPrice" placeholder="" type="number" />
|
|
</view>
|
|
</view>
|
|
<view class="flex flex_1 align_center">
|
|
<view class="flex flex_1 align_center">
|
|
- <u-input input-align="center" :clearable="false" v-model="value" placeholder="请输入重量" type="number" />
|
|
|
|
|
|
+ <u-input input-align="center" :clearable="false" v-model="item.rubbishWeight" placeholder="请输入重量" type="number" />
|
|
</view>
|
|
</view>
|
|
- <view class="flex_1"></view>
|
|
|
|
|
|
+ <view class="flex_1 flex align_center justify_center">{{item.customerPrice*item.rubbishWeight}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 金额 -->
|
|
<!-- 金额 -->
|
|
<view class="item-info">
|
|
<view class="item-info">
|
|
<view class="item flex justify_between">
|
|
<view class="item flex justify_between">
|
|
<text>应付金额</text>
|
|
<text>应付金额</text>
|
|
- <text>{{orderInfo.payAmount}} 元</text>
|
|
|
|
|
|
+ <text>{{originalAmount}} 元</text>
|
|
</view>
|
|
</view>
|
|
<view class="item flex justify_between">
|
|
<view class="item flex justify_between">
|
|
<text>支付方式</text>
|
|
<text>支付方式</text>
|
|
- <text>线下</text>
|
|
|
|
|
|
+ <v-select class="flex_1" ref="payType" placeholder="请选择支付方式" @itemChange="chooseType" code="ORDER_RESERVE_PAY_TYPE" style="width: 100%"></v-select>
|
|
|
|
+ <!-- <vSelect :code="ORDER_RESERVE_PAY_TYPE"></vSelect> -->
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- <view class="item">
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
<!-- 服务信息 -->
|
|
<!-- 服务信息 -->
|
|
<view class="info-main flex flex_column">
|
|
<view class="info-main flex flex_column">
|
|
@@ -68,6 +71,9 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="footer">
|
|
|
|
+ <u-button @click="submit" :loading="loading" class="flex_1" type="primary">提交</u-button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -76,7 +82,11 @@
|
|
import { orderDetailFind, orderSubmit } from '@/api/order.js'
|
|
import { orderDetailFind, orderSubmit } from '@/api/order.js'
|
|
import { getLookUpDatas } from '@/api/data.js'
|
|
import { getLookUpDatas } from '@/api/data.js'
|
|
import { reservePriceFind } from '@/api/index.js'
|
|
import { reservePriceFind } from '@/api/index.js'
|
|
|
|
+ import vSelect from '@/components/select/v-select.vue'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ vSelect
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
orderInfo: {},
|
|
orderInfo: {},
|
|
@@ -89,11 +99,11 @@
|
|
color: '#191919'
|
|
color: '#191919'
|
|
},
|
|
},
|
|
curType: '', // 当前类型
|
|
curType: '', // 当前类型
|
|
|
|
+ curIndex: 0, // 当前类型index
|
|
typeData: [], // 垃圾类型数据
|
|
typeData: [], // 垃圾类型数据
|
|
- paperList: [], // 纸张分类价格数据
|
|
|
|
- clothesList: [], // 衣物分类价格数据
|
|
|
|
- metalList: [], // 金属分类价格数据
|
|
|
|
- plasticList: [], // 塑料分类价格数据
|
|
|
|
|
|
+ list: [],
|
|
|
|
+ payType: '', // 支付方式
|
|
|
|
+ loading: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -110,7 +120,18 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
-
|
|
|
|
|
|
+ // 支付总金额
|
|
|
|
+ originalAmount() {
|
|
|
|
+ let total = 0
|
|
|
|
+ if(this.list.length){
|
|
|
|
+ this.list.map(item =>{
|
|
|
|
+ item.typeList.map(k =>{
|
|
|
|
+ total = total + (k.customerPrice*k.rubbishWeight)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return total
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 获取订单详情
|
|
// 获取订单详情
|
|
@@ -126,11 +147,22 @@
|
|
},
|
|
},
|
|
// 获取垃圾类型数据
|
|
// 获取垃圾类型数据
|
|
getRubbishType() {
|
|
getRubbishType() {
|
|
|
|
+ this.list = []
|
|
getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
|
|
getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
|
|
console.log(res,'------rrrrrr')
|
|
console.log(res,'------rrrrrr')
|
|
if(res.status == 200) {
|
|
if(res.status == 200) {
|
|
this.typeData = res.data || []
|
|
this.typeData = res.data || []
|
|
|
|
+ this.typeData.map(k =>{
|
|
|
|
+ let p = {
|
|
|
|
+ typeCode: k.code,
|
|
|
|
+ typeList: []
|
|
|
|
+ }
|
|
|
|
+ console.log(p,'pppppp')
|
|
|
|
+ this.list.push(p)
|
|
|
|
+ })
|
|
|
|
+ console.log(this.list,'this.list----------')
|
|
this.curType = this.typeData.length ? this.typeData[0].code : ''
|
|
this.curType = this.typeData.length ? this.typeData[0].code : ''
|
|
|
|
+ this.curIndex = 0
|
|
this.getRow()
|
|
this.getRow()
|
|
} else {
|
|
} else {
|
|
this.typeData = []
|
|
this.typeData = []
|
|
@@ -138,33 +170,73 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 查询列表
|
|
// 查询列表
|
|
- getRow() {
|
|
|
|
|
|
+ getRow(code,num) {
|
|
|
|
+ this.curType = code || this.curType
|
|
|
|
+ this.curIndex = num || 0
|
|
|
|
+ if(this.list[this.curIndex].typeList.length) return
|
|
reservePriceFind({code:this.curType}).then(res => {
|
|
reservePriceFind({code:this.curType}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.list = res.data
|
|
|
|
- // 纸质
|
|
|
|
- if(this.curType == 'PAPER'){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 衣物
|
|
|
|
- if(this.curType == 'CLOTHES'){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- // 金属
|
|
|
|
- if(this.curType == 'METAL'){
|
|
|
|
|
|
+ let data = res.data
|
|
|
|
+ data.forEach(item =>{
|
|
|
|
+ item.rubbishWeight = ''
|
|
|
|
+ item.totalAmount = ''
|
|
|
|
+ })
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ this.list[this.curIndex].typeList = data
|
|
|
|
+ console.log(this.list[this.curIndex].typeList,this.curIndex,'----------lllll22222222')
|
|
|
|
+ })
|
|
|
|
|
|
- }
|
|
|
|
- // 塑料类
|
|
|
|
- if(this.curType == 'PLASTIC'){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
- this.list = []
|
|
|
|
|
|
+ this.list[this.curIndex].typeList = []
|
|
this.total = 0
|
|
this.total = 0
|
|
this.noDataText = res.message
|
|
this.noDataText = res.message
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 选择支付方式
|
|
|
|
+ chooseType(code) {
|
|
|
|
+ this.payType = code
|
|
|
|
+ console.log(this.payType,'this.payType')
|
|
|
|
+ },
|
|
|
|
+ // 提交
|
|
|
|
+ submit() {
|
|
|
|
+ let arr = []
|
|
|
|
+ this.list.map(item =>{
|
|
|
|
+ item.typeList.map(k =>{
|
|
|
|
+ if(k.rubbishWeight !=='') {
|
|
|
|
+ let p = {
|
|
|
|
+ rubbishType: item.typeCode, //垃圾大类型
|
|
|
|
+ rubbishTypeItem: k.code, // 垃圾细分类型
|
|
|
|
+ rubbishWeight: k.rubbishWeight, // 垃圾重量(克)
|
|
|
|
+ rubbishPrice: k.rubbishPrice, // 单价
|
|
|
|
+ totalAmount: k.rubbishWeight* k.rubbishPrice // 总价金额
|
|
|
|
+ }
|
|
|
|
+ arr.push(p)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ let params = {
|
|
|
|
+ "payType": this.payType, //支付方式
|
|
|
|
+ originalAmount: this.originalAmount, // 支付总金额
|
|
|
|
+ contactName: this.orderInfo.contactName, //联系人姓名
|
|
|
|
+ contactMobile: this.orderInfo.contactMobile, //联系人手机号
|
|
|
|
+ contactAddress: this.orderInfo.contactAddress,//联系人地址
|
|
|
|
+ orderReserveNo: this.orderReserveNo,
|
|
|
|
+ orderReserveItemEntityList: arr
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ orderSubmit(params).then(res=>{
|
|
|
|
+ if(res.status == 200) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message
|
|
|
|
+ })
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/order/finish?money=' + res.data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -316,33 +388,6 @@
|
|
padding: 20rpx 32rpx;
|
|
padding: 20rpx 32rpx;
|
|
display: flex;
|
|
display: flex;
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
- .btn{
|
|
|
|
- flex: 1;
|
|
|
|
- height: 84rpx;
|
|
|
|
- font-size: 32rpx;
|
|
|
|
- text-align: center;
|
|
|
|
- line-height: 84rpx;
|
|
|
|
- }
|
|
|
|
- .btnCancleStyle{
|
|
|
|
- color: #666666;
|
|
|
|
- background: #E5E5E5;
|
|
|
|
- border-radius: 60rpx 0px 0px 60rpx;
|
|
|
|
- }
|
|
|
|
- .btnPayStyle{
|
|
|
|
- color: #191919;
|
|
|
|
- background: #FFD100;
|
|
|
|
- border-radius: 0rpx 60px 60px 0rpx;
|
|
|
|
- }
|
|
|
|
- .useBtn{
|
|
|
|
- width: 100%;
|
|
|
|
- height: 84rpx;
|
|
|
|
- font-size: 32rpx;
|
|
|
|
- text-align: center;
|
|
|
|
- line-height: 84rpx;
|
|
|
|
- color: #191919;
|
|
|
|
- background: #FFD100;
|
|
|
|
- border-radius: 60rpx
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|