|
@@ -5,7 +5,7 @@
|
|
|
<view class="order-status">
|
|
|
<view class="status-title flex align_center justify_center">
|
|
|
<view class="t-icon icon t-icon-icon_service"></view>
|
|
|
- {{orderInfo.orderStateDictValue}}
|
|
|
+ {{orderInfo.orderStatusDictValue}}
|
|
|
</view>
|
|
|
<view class="status-care">
|
|
|
预约时间:2021-05-10 15:10:05
|
|
@@ -18,29 +18,34 @@
|
|
|
<view class="care">(切换分类可输入不同回收物的价格和重量)</view>
|
|
|
</view>
|
|
|
<view class="item flex">
|
|
|
- <view class="item-type active">
|
|
|
- 纸质类
|
|
|
+ <view :class="['item-type', curType == item.code ? 'active' : '']" v-for="item in typeData" :key="item.id">
|
|
|
+ {{item.dispName}}
|
|
|
</view>
|
|
|
- <view class="item-type">
|
|
|
+ <!-- <view class="item-type">
|
|
|
纸质类
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
- <view class="item flex justify_between align_center">
|
|
|
- <view class="flex flex_1 align_center">
|
|
|
+ <view class="table">
|
|
|
+ <view>单价(元/kg)</view>
|
|
|
+ <view>重量(kg)</view>
|
|
|
+ <view>合计金额(元)</view>
|
|
|
+ </view>
|
|
|
+ <view class="item flex justify_between">
|
|
|
+ <view class="flex align_center">
|
|
|
<text>黄纸</text>
|
|
|
- <u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="value" placeholder="" type="number" />元/kg
|
|
|
+ <u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="value" placeholder="" type="number" />
|
|
|
</view>
|
|
|
<view class="flex flex_1 align_center">
|
|
|
- <u-input class="flex_1" input-align="center" :clearable="false" v-model="value" placeholder="请输入重量" type="number" />kg
|
|
|
- <text>/0.00元</text>
|
|
|
+ <u-input input-align="center" :clearable="false" v-model="value" placeholder="请输入重量" type="number" />
|
|
|
</view>
|
|
|
+ <view class="flex_1"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 金额 -->
|
|
|
<view class="item-info">
|
|
|
<view class="item flex justify_between">
|
|
|
<text>应付金额</text>
|
|
|
- <text>22.20 元</text>
|
|
|
+ <text>{{orderInfo.payAmount}} 元</text>
|
|
|
</view>
|
|
|
<view class="item flex justify_between">
|
|
|
<text>支付方式</text>
|
|
@@ -48,18 +53,17 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 服务信息 -->
|
|
|
- <view class="info-main">
|
|
|
- <view class="flex align_center">
|
|
|
+ <view class="info-main flex flex_column">
|
|
|
+ <view class="flex flex_1 align_center">
|
|
|
<view class="new-left">
|
|
|
- 陕西省西安市未央区华
|
|
|
- 帝金座602室
|
|
|
+ {{orderInfo.contactAddress}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="time flex align_center justify_between">
|
|
|
- <text>百果园(贞观路店)</text>
|
|
|
+ <text>{{orderInfo.contactName}}</text>
|
|
|
<view class="flex align_center">
|
|
|
<view class="t-icon phone t-icon-icon_phone"></view>
|
|
|
- <text>18092252287</text>
|
|
|
+ <text>{{orderInfo.contactMobile}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -69,71 +73,35 @@
|
|
|
|
|
|
<script>
|
|
|
import moment from 'moment'
|
|
|
+ import { orderDetailFind, orderSubmit } from '@/api/order.js'
|
|
|
+ import { getLookUpDatas } from '@/api/data.js'
|
|
|
+ import { reservePriceFind } from '@/api/index.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- orderInfo: {
|
|
|
- id: '',
|
|
|
- createDate: '2021-05-10 15:22',
|
|
|
- orderStateDictValue: '待服务',
|
|
|
- storeName: '昆仑润滑·车领主 (西咸新区-...',
|
|
|
- location: '2.9km',
|
|
|
- orderState:'WAIT_PAY',
|
|
|
- type: [
|
|
|
- {
|
|
|
- name:'纸质类',
|
|
|
- id: '1'
|
|
|
- },
|
|
|
- {
|
|
|
- name:'衣物类',
|
|
|
- id: '12'
|
|
|
- }
|
|
|
- ],
|
|
|
- orderGoodsList: [
|
|
|
- {
|
|
|
- goodsImages: '',
|
|
|
- goodsName: '水蜡免擦洗车(轿车)',
|
|
|
- payGold: 200,
|
|
|
- buyQty: 2,
|
|
|
- goodsNum: 5,
|
|
|
- },
|
|
|
- {
|
|
|
- goodsImages: '',
|
|
|
- goodsName: '水蜡免擦洗车(轿车)',
|
|
|
- payGold: 200,
|
|
|
- buyQty: 2,
|
|
|
- goodsNum: 5,
|
|
|
- },
|
|
|
- ],
|
|
|
- payGold: 450
|
|
|
- },
|
|
|
+ orderInfo: {},
|
|
|
totalPrice: 0, // 支付合计
|
|
|
- password: '', // 支付密码
|
|
|
- showSetPswModal: false, // 设置支付密码弹窗
|
|
|
- showInputPsw: false, // 打开输入密码弹窗
|
|
|
- showLeavePsw: false, // 打开确定放弃弹窗
|
|
|
- orderId: '', // 订单id
|
|
|
- leftTime: null,
|
|
|
- payFinish: false , // 是否支付成功
|
|
|
- focus: false,
|
|
|
+ orderReserveNo: '', // 订单号
|
|
|
inputLeftStyle: {
|
|
|
Width: '120rpx',
|
|
|
borderBottom: '1px solid #707070',
|
|
|
padding: '0rpx 10rpx',
|
|
|
color: '#191919'
|
|
|
},
|
|
|
- inputRightStyle: {
|
|
|
-
|
|
|
- }
|
|
|
+ curType: '', // 当前类型
|
|
|
+ typeData: [], // 垃圾类型数据
|
|
|
+ paperList: [], // 纸张分类价格数据
|
|
|
+ clothesList: [], // 衣物分类价格数据
|
|
|
+ metalList: [], // 金属分类价格数据
|
|
|
+ plasticList: [], // 塑料分类价格数据
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- // 监听设置密码是否成功
|
|
|
- uni.$once('setPswSuccess', this.setPsw)
|
|
|
- if (options.id) {
|
|
|
- console.log(options.id)
|
|
|
- this.orderId = options.id
|
|
|
- // this.getOrderDetail()
|
|
|
+ if (options.orderNo) {
|
|
|
+ console.log(options.orderNo)
|
|
|
+ this.orderReserveNo = options.orderNo
|
|
|
+ this.getOrderDetail()
|
|
|
+ this.getRubbishType()
|
|
|
}
|
|
|
// 开启分享
|
|
|
uni.showShareMenu({
|
|
@@ -145,121 +113,55 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- // 支付剩余时间
|
|
|
- leftTimeFun() {
|
|
|
- const date1 = moment().toArray() // 当前时间 数组形式
|
|
|
- const date2 = moment(this.orderInfo.orderTime).toDate() // 下单时间 日期格式
|
|
|
- const date3 = moment(date2).toArray() // 下单时间 数组形式
|
|
|
- const date4 = moment(date1).diff(moment(date3), 'seconds')//计算相差的秒数
|
|
|
- const tt = 30 - Math.ceil(date4/60) //向上取整
|
|
|
- if (tt > 0) {
|
|
|
- this.leftTime = tt
|
|
|
- } else {
|
|
|
- // this.getOrderDetail()
|
|
|
- this.leftTime = '00'
|
|
|
- }
|
|
|
- },
|
|
|
// 获取订单详情
|
|
|
getOrderDetail() {
|
|
|
- orderDetail({
|
|
|
- id: this.orderId
|
|
|
+ orderDetailFind({
|
|
|
+ orderReserveNo: this.orderReserveNo
|
|
|
}).then(res => {
|
|
|
console.log(res,'rrrrrrrr')
|
|
|
if (res.status == 200) {
|
|
|
this.orderInfo = res.data
|
|
|
- if(this.orderInfo.orderState=='WAIT_PAY') {
|
|
|
- this.leftTimeFun()
|
|
|
- }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 跳转到设置支付密码页
|
|
|
- toSetPwd () {
|
|
|
- uni.navigateTo({
|
|
|
- url:"/pages/userCenter/userInfo/smsVerification"
|
|
|
- })
|
|
|
- },
|
|
|
- // 设置密码成功, 打开输入密码弹窗
|
|
|
- setPsw (e) {
|
|
|
- if (e.success) {
|
|
|
- this.showInputPsw = true
|
|
|
- setTimeout(()=>{
|
|
|
- this.focus = true
|
|
|
- },300)
|
|
|
- }
|
|
|
- },
|
|
|
- // 关闭输入密码弹窗
|
|
|
- closePayModal(){
|
|
|
- if(!this.payFinish) {
|
|
|
- this.showLeavePsw = true
|
|
|
- }
|
|
|
- },
|
|
|
- //确认放弃
|
|
|
- canclePay() {
|
|
|
- this.password = ''
|
|
|
- this.showLeavePsw = false
|
|
|
- this.showInputPsw = false
|
|
|
- this.focus = false
|
|
|
- },
|
|
|
- // 继续支付
|
|
|
- payAgain () {
|
|
|
- this.focus = false
|
|
|
- this.showLeavePsw = false
|
|
|
- this.showInputPsw = true
|
|
|
- setTimeout(()=>{
|
|
|
- this.focus = true
|
|
|
- },300)
|
|
|
- },
|
|
|
- // 支付 判断用户是否设置过支付密码
|
|
|
- toPay() {
|
|
|
- this.totalPrice = this.orderInfo.originalGold
|
|
|
- this.payFinish = false
|
|
|
- // 判断用户是否设置过支付密码
|
|
|
- existPayPwd().then(res=>{
|
|
|
- console.log(res,'rrrrrr')
|
|
|
+ // 获取垃圾类型数据
|
|
|
+ getRubbishType() {
|
|
|
+ getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
|
|
|
+ console.log(res,'------rrrrrr')
|
|
|
if(res.status == 200) {
|
|
|
- // 设置过支付密码,输入密码
|
|
|
- if(res.data) {
|
|
|
- this.showInputPsw = true
|
|
|
- setTimeout(()=>{
|
|
|
- this.focus = true
|
|
|
- },300)
|
|
|
- } else {
|
|
|
- // 没设置过支付密码,提示设置密码
|
|
|
- this.showSetPswModal = true
|
|
|
- }
|
|
|
- }
|
|
|
+ this.typeData = res.data || []
|
|
|
+ this.curType = this.typeData.length ? this.typeData[0].code : ''
|
|
|
+ this.getRow()
|
|
|
+ } else {
|
|
|
+ this.typeData = []
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
- // 支付
|
|
|
- toPayOrder() {
|
|
|
- if (this.password === '') {
|
|
|
- uni.showToast({
|
|
|
- title: '请先输入支付密码',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
- let id = this.orderInfo.id
|
|
|
- let params = {
|
|
|
- payPwd: this.password,
|
|
|
- id: id
|
|
|
- }
|
|
|
- signPay(params).then(res=>{
|
|
|
- this.btnLoading = false
|
|
|
- if(res.status == 200) {
|
|
|
- // 关闭弹窗 刷新页面
|
|
|
- this.payFinish = true
|
|
|
- this.showInputPsw = false
|
|
|
- this.getOrderDetail()
|
|
|
- // 刷新订单列表
|
|
|
- uni.$emit('refresh')
|
|
|
- // 跳转到支付完成界面
|
|
|
- uni.navigateTo({
|
|
|
- url:"/pagesA/toOrder/payFinish?id=" + id
|
|
|
- })
|
|
|
- } else{
|
|
|
- this.password = ''
|
|
|
+ // 查询列表
|
|
|
+ getRow() {
|
|
|
+ reservePriceFind({code:this.curType}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.list = res.data
|
|
|
+ // 纸质
|
|
|
+ if(this.curType == 'PAPER'){
|
|
|
+
|
|
|
+ }
|
|
|
+ // 衣物
|
|
|
+ if(this.curType == 'CLOTHES'){
|
|
|
+
|
|
|
+ }
|
|
|
+ // 金属
|
|
|
+ if(this.curType == 'METAL'){
|
|
|
+
|
|
|
+ }
|
|
|
+ // 塑料类
|
|
|
+ if(this.curType == 'PLASTIC'){
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.list = []
|
|
|
+ this.total = 0
|
|
|
+ this.noDataText = res.message
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -289,6 +191,7 @@
|
|
|
font-size: 28upx;
|
|
|
background-image: url(../../static/order_bg_stor.png);
|
|
|
background-repeat: no-repeat;
|
|
|
+ height: 260rpx;
|
|
|
.new-left{
|
|
|
width: 360rpx;
|
|
|
font-size: 36rpx;
|
|
@@ -350,6 +253,15 @@
|
|
|
margin-top: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
+ .table{
|
|
|
+ padding: 20rpx 0;
|
|
|
+ display: flex;
|
|
|
+ font-size: 28rpx;
|
|
|
+ view{
|
|
|
+ width: 33%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
.item{
|
|
|
padding: 28rpx 0;
|
|
|
font-size: 32rpx;
|
|
@@ -368,7 +280,7 @@
|
|
|
border-bottom: 1px solid #707070;
|
|
|
}
|
|
|
.item-type{
|
|
|
- width: 128rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
height: 56rpx;
|
|
|
border: 1px solid #979797;
|
|
|
opacity: 1;
|