Browse Source

订单详情

devlop
邓雄飞 4 years ago
parent
commit
ad123896ef
9 changed files with 55 additions and 23 deletions
  1. 2
      components/qn-datetime-picker/qn-datetime-picker.vue
  2. 2
      enums/index.js
  3. 3
      pages.json
  4. 6
      pages/mine/index.vue
  5. 49
      pages/order-detail/index.vue
  6. 2
      pages/order-make/index.vue
  7. 4
      pages/test/index.vue
  8. 6
      utils/hook.js
  9. 4
      utils/http/index.js

2
components/qn-datetime-picker/qn-datetime-picker.vue

@ -5,7 +5,7 @@
<view class="uni-date-editor--x" :class="{ 'uni-date-editor--x__disabled': disabled, 'uni-date-x--border': border }"> <view class="uni-date-editor--x" :class="{ 'uni-date-editor--x__disabled': disabled, 'uni-date-x--border': border }">
<view v-if="!isRange" class="uni-date-x uni-date-single"> <view v-if="!isRange" class="uni-date-x uni-date-single">
<input class="uni-date__x-input" type="text" v-model="singleVal" :placeholder="singlePlaceholderText" :disabled="true" /> <input class="uni-date__x-input" type="text" v-model="singleVal" :placeholder="singlePlaceholderText" :disabled="true" />
<uni-icons v-if="showClearIcon && singleVal" type="calendar" color="#e1e1e1" size="22"></uni-icons>
<uni-icons v-if="!showClearIcon && !singleVal" type="calendar" color="#e1e1e1" size="22"></uni-icons>
<view v-if="showClearIcon && singleVal" @click.stop="clear"> <view v-if="showClearIcon && singleVal" @click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="15"></uni-icons> <uni-icons type="clear" color="#e1e1e1" size="15"></uni-icons>
</view> </view>

2
enums/index.js

@ -1,6 +1,8 @@
import env from '@/env/index.js' import env from '@/env/index.js'
const urlEnv = env === 'production' ? '' : `-${env}` const urlEnv = env === 'production' ? '' : `-${env}`
export const XAPPID = '503258978847966404'
/** /**
* 账号类型 * 账号类型
*/ */

3
pages.json

@ -118,6 +118,7 @@
"path": "pages/enquiry-list/index", "path": "pages/enquiry-list/index",
"style": { "style": {
"navigationBarTitleText": "询价列表", "navigationBarTitleText": "询价列表",
"navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -125,6 +126,7 @@
"path": "pages/for-comparison/index", "path": "pages/for-comparison/index",
"style": { "style": {
"navigationBarTitleText": "实单询比价", "navigationBarTitleText": "实单询比价",
"navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -132,6 +134,7 @@
"path": "pages/add-address-manage/index", "path": "pages/add-address-manage/index",
"style": { "style": {
"navigationBarTitleText": "新建收货地址", "navigationBarTitleText": "新建收货地址",
"navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }

6
pages/mine/index.vue

@ -75,7 +75,7 @@
<image <image
class="poster" class="poster"
v-if="fsInfo.status == fsAuditStatus.AUDITING" v-if="fsInfo.status == fsAuditStatus.AUDITING"
src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/fs-to-apply.png"
src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/fs-applying.png"
></image> ></image>
<view class="fs-card" v-if="fsInfo.status == fsAuditStatus.PASS"> <view class="fs-card" v-if="fsInfo.status == fsAuditStatus.PASS">
<view class="left"> <view class="left">
@ -100,11 +100,11 @@
<image class="icon" src="/static/imgs/mine/account-icon.png"></image> <image class="icon" src="/static/imgs/mine/account-icon.png"></image>
<text class="label">账号管理</text> <text class="label">账号管理</text>
</view> </view>
<view class="icon-item" style="margin-right: 64rpx" @click="go2('enquiry-list')">
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('enquiry-list')">
<image class="icon" src="/static/imgs/mine/enquiry-icon.png"></image> <image class="icon" src="/static/imgs/mine/enquiry-icon.png"></image>
<text class="label">我的询价</text> <text class="label">我的询价</text>
</view> </view>
<view class="icon-item" style="margin-right: 64rpx">
<view class="icon-item" style="margin-right: 64rpx" @click="loginGo2('address-manage')">
<image class="icon" src="/static/imgs/mine/address-icon.png"></image> <image class="icon" src="/static/imgs/mine/address-icon.png"></image>
<text class="label">收货地址</text> <text class="label">收货地址</text>
</view> </view>

49
pages/order-detail/index.vue

@ -11,7 +11,7 @@
<view class="flex-col-start-start"> <view class="flex-col-start-start">
<text style="font-size: 30rpx; color: #333333; font-weight: 600">{{ orderInfo.customerEnterpriseName }}</text> <text style="font-size: 30rpx; color: #333333; font-weight: 600">{{ orderInfo.customerEnterpriseName }}</text>
<text style="font-size: 26rpx; color: #333333; margin-top: 26rpx"> <text style="font-size: 26rpx; color: #333333; margin-top: 26rpx">
联系人: {{ `${orderInfo.deliveryAddress.receiver} ${orderInfo.deliveryAddress.receiverMobile}` }}
联系人: {{ `${orderInfo.deliveryAddress.receiver || '-'} ${orderInfo.deliveryAddress.receiverMobile || '-'}` }}
</text> </text>
</view> </view>
</view> </view>
@ -27,16 +27,14 @@
<!-- 待收货展示 --> <!-- 待收货展示 -->
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)">确认收货</view> <view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)">确认收货</view>
<!-- 待借款展示 --> <!-- 待借款展示 -->
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_LOAN" class="button-item" @click="goBorrowing(supplierOrder)">
去借款
</view>
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_LOAN" class="button-item" @click="goFsPage()">去借款</view>
<!-- 飞算支付且待还款状态 --> <!-- 飞算支付且待还款状态 -->
<view <view
v-else-if="orderInfo.paymentMethod == paymentMethodEnum.FLY_PAY && supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_REPAY" v-else-if="orderInfo.paymentMethod == paymentMethodEnum.FLY_PAY && supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_REPAY"
class="button-item" class="button-item"
@click="goRepaying(supplierOrder)"
@click="goFsPage()"
> >
</view> </view>
<text v-else style="font-size: 30rpx; color: #ff5368; font-weight: 600">{{ supplierOrderStatusMap[supplierOrder.status] }}</text> <text v-else style="font-size: 30rpx; color: #ff5368; font-weight: 600">{{ supplierOrderStatusMap[supplierOrder.status] }}</text>
</view> </view>
@ -147,7 +145,7 @@
<script> <script>
import { go2, back, uploadImage } from '@/utils/hook.js' import { go2, back, uploadImage } from '@/utils/hook.js'
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder } from '@/apis/orderApi.js' import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder } from '@/apis/orderApi.js'
import { transformFileToImg } from '@/apis/commonApi.js'
import { transformFileToImg, getFeisuanUrl } from '@/apis/commonApi.js'
import { orderStatusEnum, supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodMap, paymentMethodEnum } from '@/enums/index.js' import { orderStatusEnum, supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodMap, paymentMethodEnum } from '@/enums/index.js'
const statusImg = { const statusImg = {
[orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认', [orderStatusEnum.WAIT_SUPPLIER_CONFIRM]: '待供应商确认',
@ -210,7 +208,7 @@ export default {
}, },
transformAddress(address) { transformAddress(address) {
let res = '' let res = ''
if (address) {
if (address.provinceName) {
res = `${address.provinceName}${address.cityName}${address.districtName}${address.detail}` res = `${address.provinceName}${address.cityName}${address.districtName}${address.detail}`
} }
return res return res
@ -287,7 +285,21 @@ export default {
return showVoucherStatus.includes(status) return showVoucherStatus.includes(status)
}, },
// //
goBorrowing(order) {},
goFsPage() {
getFeisuanUrl().then((res) => {
if (res) {
// #ifdef APP-PLUS
go2('page-view', {
title: '飞算申请',
url: encodeURIComponent(res)
})
// #endif
// #ifdef H5
window ? (window.location.href = res) : ''
// #endif
}
})
},
// //
confirmReceive(order) { confirmReceive(order) {
uni.showModal({ uni.showModal({
@ -374,10 +386,21 @@ export default {
}, },
// //
viewContract() { viewContract() {
let url = this.orderInfo.contractUrl
if (url) {
transformFileToImg({ fileUrl: url }).then((res) => {
uni.previewImage({ urls: [res.imgUrl], current: res.imgUrl })
let urls = this.orderInfo.contractUrls
if (urls && urls.length > 0) {
let promises = []
urls.forEach((item) => {
promises.push(transformFileToImg({ fileUrl: item }))
})
Promise.all(promises).then((res) => {
let urls = []
res.forEach((item) => {
urls.push(item.imgUrl)
})
uni.previewImage({
urls,
current: urls[0].imgUrl
})
}) })
} }
} }

2
pages/order-make/index.vue

@ -100,7 +100,7 @@
</view> </view>
<image <image
v-if="payMap['fs'] != null && payMap['fs'].availableCreditLine > orderInfo.totalOfferPrice" v-if="payMap['fs'] != null && payMap['fs'].availableCreditLine > orderInfo.totalOfferPrice"
@click="selectPayMethod('month')"
@click="selectPayMethod('fs')"
class="img" class="img"
:src="currentPayType == 'fs' ? '/static/imgs/order/selected-icon.png' : '/static/imgs/order/select-icon.png'" :src="currentPayType == 'fs' ? '/static/imgs/order/selected-icon.png' : '/static/imgs/order/select-icon.png'"
></image> ></image>

4
pages/test/index.vue

@ -30,11 +30,11 @@ export default {
let form = { let form = {
orderGoodsList: [ orderGoodsList: [
{ {
buyTon: 1,
buyTon: 0.1,
gramWeight: 200, gramWeight: 200,
length: 1000, length: 1000,
mallSupplierId: '677166944742412288', mallSupplierId: '677166944742412288',
pieceQuantity: 5000,
pieceQuantity: 500,
productId: '678972506887032832', productId: '678972506887032832',
productSkuId: '678972507222577152', productSkuId: '678972507222577152',
unitPrice: 10000, unitPrice: 10000,

6
utils/hook.js

@ -1,5 +1,5 @@
import store from '@/store/index' import store from '@/store/index'
import { uploadUrl } from '@/enums/index.js'
import { uploadUrl, XAPPID } from '@/enums/index.js'
// 框架方法封装 // 框架方法封装
const tabList = ['store', 'cart', 'mine'] const tabList = ['store', 'cart', 'mine']
@ -136,6 +136,10 @@ export function uploadFile(path, type = 'image') {
url: uploadUrl[type], url: uploadUrl[type],
filePath: path, filePath: path,
name: type, name: type,
header: {
Authorization: store.state.qnToken,
'X-APP-ID': XAPPID
},
// fileType: type, // fileType: type,
success: (res) => { success: (res) => {
let result = JSON.parse(res.data) let result = JSON.parse(res.data)

4
utils/http/index.js

@ -1,9 +1,9 @@
import Http from './http.js' import Http from './http.js'
import env from '@/env/index.js' import env from '@/env/index.js'
import { XAPPID } from '@/enums/index.js'
// 请求封装文件 // 请求封装文件
const urlEnv = env === 'production' ? '' : `-${env}` const urlEnv = env === 'production' ? '' : `-${env}`
const xappid = '503258978847966404'
/** /**
* 系统默认的请求域名 * 系统默认的请求域名
*/ */
@ -49,7 +49,7 @@ const reqInterceptor = (config, options) => {
config.header = { config.header = {
...config.header, ...config.header,
Authorization: token || '', Authorization: token || '',
'X-APP-ID': xappid
'X-APP-ID': XAPPID
} }
// 改变url // 改变url
let newUrl = '' let newUrl = ''

Loading…
Cancel
Save