Commit dbfb6872 authored by Facius's avatar Facius

Merge branch 'dev'

parents 314f818a 80b90562
......@@ -5,7 +5,7 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl: {
apiUrl: 'http://192.168.0.62:37080', //java端域名请求头
apiUrl: 'http://192.168.1.22', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
......
(function () {
let NODE_ENV = 'prod'; // dev:开发环境 | test:测试环境 | prod:生产环境
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null;
let VERSION_NUMBER = '1.3.9';//版本号
let VERSION_NUMBER = '1.3.13';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') {
......@@ -11,13 +11,16 @@
} else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js');
}
// 百度地图AK,请勿删除
ENV_VAR['bmapAK'] = 'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A'
} else if (process.env.NODE_ENV === "production") {
if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js');
} else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js');
}
// 百度地图AK,请勿删除
ENV_VAR['bmapAK'] = 'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI'
}
if (ENV_VAR) {
process.uniEnv = {};
......
......@@ -6,6 +6,7 @@ const UNI_APP = {
},
systemUrl: {
apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'https://qn-static.banshouhui.com',
......
......@@ -2,15 +2,10 @@
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "remote"
},
"mp-weixin" :
{
"launchtype" : "remote"
},
"type" : "uniCloud"
}
"type": "uniCloud",
"default": {
"launchtype": "local"
}
}
]
}
......@@ -8,6 +8,7 @@ import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js";
import {assessmentApiFun} from"@/common/api/assessment.js"
import {certApiFun} from"@/common/api/cert.js"
import {partsApiFun} from"@/common/api/parts.js"
let apiFun = function(vm) {
let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm)
......@@ -15,6 +16,7 @@ let apiFun = function(vm) {
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm)
let certApi=certApiFun(vm)
let partsApi=partsApiFun(vm)
let apiUrl = {
...commonApi,
...settledApi,
......@@ -22,6 +24,7 @@ let apiFun = function(vm) {
...orderApi,
...assessmentApi,
...certApi,
...partsApi,
}
return apiUrl
}
......
......@@ -182,6 +182,20 @@ let orderApiFun = function(vm){
let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params);
// 工单文件列表
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
// 订单配件列表
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params);
// 返件列表
let returnedParts = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/return', params);
// 备件仓列表
let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params);
// 配件物流
let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/'+ orderId +'/express',{}, formType);
// 配件申请单-数量统计
let getOrderPartsSum = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/' + orderId +'/sum',{}, formType);
// 配件申请单-签收
let receiveParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/' + partOrderId +'/receive',{}, formType);
// 配件申请单-取消申请
let cancelParts = async (partOrderId) => await vm.$u.put(prefix + 'parts/' + vm.vuex_token + '/orders/'+ partOrderId +'/cancel',{}, formType);
const orderApi = {
listByRecommendOrder,
......@@ -226,7 +240,14 @@ let orderApiFun = function(vm){
checkAddCustomer,
fileLabel,
fileList,
completeNextStep
completeNextStep,
applyList,
returnedParts,
reserveList,
getLogistics,
getOrderPartsSum,
receiveParts,
cancelParts
}
return orderApi
}
......
let partsApiFun = function (vm) {
// 接口公共前缀
const prefix = '/wxh-worker-rest/rest/'
const coverage = '/wxh-worker-rest/rest/coverage/'
const parts = '/wxh-worker-rest/rest/parts/'
const base = '/wxh-worker-rest/rest/base/'
const formType = {'content-type': 'application/x-www-form-urlencoded'}
const dataType = {'content-type': 'multipart/form-data'}
/**
* 配件申请单-查询网点地址信息
*/
let getSiteAddress = async () => await vm.$u.get(coverage + vm.vuex_token + '/getSiteAddress');
/**
* 配件申请单-修改网点地址信息
*/
let updateAddress = async (params = {}) => await vm.$u.post(coverage + vm.vuex_token + '/updateSiteAddress', params, formType);
/**
* 配件过滤-品类列表
*/
let getCategoryList = async () => await vm.$u.get(base + vm.vuex_token + '/allow/category/list');
/**
* 配件过滤-品牌列表
*/
let getBrandList = async (params = {}) => await vm.$u.get(base + vm.vuex_token + '/allow/brand/list', params);
/**
* 查询配件列表
*/
let getPartsList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/parts/v2', params);
/**
* 配件申请单-创建申请单/使用备件
*/
let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params, dataType)
let createParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders/create', params, formType)
/**
* 查询自己的备件仓
*/
let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
/**
* 查询工单的配件明细
*/
let getWorkOrderParts = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/workOrder/' + params.workOrderId);
/**
* 返件-备件/新件
*/
let returnParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/return/new', params, formType);
const partsApi = {
getSiteAddress,
updateAddress,
getCategoryList,
getBrandList,
getPartsList,
applyParts,
getMyReserve,
getWorkOrderParts,
returnParts,
createParts
}
return partsApi
}
module.exports = {
partsApiFun
}
\ No newline at end of file
@font-face {
font-family: "wxh"; /* Project id 2600874 */
/* Color fonts */
src:
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAHYAAwAAAAAA3wAAAGNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIhgjEgZgADwKYGwBNgIkAwwLCgAEIAWBVAcgG6sCyL5APLajkgSQKlA9xTEuxLtPw+avikE32OCp3+939u3+/1Gp7skkindRuVQ8k0iUaNNpRCLDdLF04f9/532v+ifKCgIKskACGvLAxrTW4SE+1iqP8/+6guhXXAM8hf9vEasvfKVwncDD1TkrNzR1E+lJXq2Jk7a1bQ3roijRNAvX4KcCSyxqd7YWLiJliUdasyQ5XAICJABpCMZgAkDSE0gAP2OGrgmRg5tgCnRTF5lSK4fYlCRE6qmni0ey3kWdd6AOt3OGAD8DWYQiKJCG+oE0jAWEMQIW696D9G/KUxg1AKI02plA7vAtAEFB+v7O7tkkdNLjvbjTF5h7OrYl920W6m8dFljELe5HnXjRVxjkRJ65+0r0u+pq6/XtP1pP8E4/1AFhLCAv7zVIoOnH2TR4MIAZYTWjM0p5KABhHoosGhHQgGmEmthvxABkBq2gMBm5GwxWbNsxY8CkaZsWjFpTTQVVKdtAj149uirJqit35ACW9XfEpDXrZi1bkqVWQeFDBQCPX3IBAA==') format('woff2');
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAARkAAsAAAAACPwAAAQWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDGgqFWIUMATYCJAMUCwwABCAFhDEHRRvdBxHVm4XJfiTGtg+yTC2LnrCTqAkevne2v5OZdE2zi2lbTLxyICWLqCTgFUz9z+W5gP9uA2Bzrgc2KkKN5OyTR19I22F6WQZ/cE39X1ikznYL4alEpmZa0sBmFhFUKT4fiOwBu2vZhyCAZGrSHK1t+64+0scMnDKOYii0RgFhrhgzcvhAElkzqoQqSNS56k5ViC/ooC3XHgAr3e+Lf6ktEkFDl2g79RzWbgi3/hB/KGnHbULyOxb0VwLdNUAHJFB1ZlbRr9ztQ/rhqkiS89wKL7ZXCPhDxeN/CFs8b15QSLQ/D+FCU6cCvmVEwR/CFIcaDYxIkIKKtEaBdP/Vuq1NxoyfQQTRCCVQSz0gjKKZRmFOsfTy+bPDvhdAsf0vKZHga4oTeGWYETaFjtMJvk45I/6XBU7b96LOzzQD0jkSPoRmG/71kaNOy9bJ4SOin3M0JSVymL5WU/vQ7PCRLVvzgwHfOk/hUJc6evt8Jf/h7bu8vnXucN6wDc7RiDF0/eZNhyaEK2/YUdzc2WL4xoP7DycKcoesy/UFN+Yzjsjh7cwK1+oOWDczPfzqldCd169T0iJ3u1jmNMp+8aKMLDK+oIFZr77ZoOB7Q+AYzPpWxg9W/VD9eikBLhOqZzVwfd40wvKaFWMxt+mxHhsCSI5FTbflfZJDcUejiFeAiopAiZkVh/eevGyZx/i+yv9G07zCjRvfVQn0jMIMNbB+QBrgGrB+aGDVCyGbGR7Tzf8J/kkrt+UZe+6V8b2hNbNUwjQm7R1y0vfUzgpmrLrW/8jGjY8fbRi7+bstm8ul/Z3500/sfFIubPEu23iXn/eu8veVnc8esa6u+u91yTr3V9esV3JuOcfevOFAuVEjly9wrtSo+v591c9XHOddlYdJ7xY4WX+VqteTervsc5XaVfS28vzisQRep0o3S7Ru+fnhwo2ljPhqNAQgPk8h58cL447S5AIiasvP0vmb9qPjxj3lCzKafk1MUQB8T93hrrA+bl4GiWjAiP8dJ4oSpLCSLESTAmWmsFzaJg2dLkgIakCy7oc4+rP5oR+98VKiAokRgkYCRUAiKY0qfDnQSaEiuJDUhGSqUGd2CjlYSIRKAiozkQCBi62gkc5ukLg4iSr8edDJ46rSpWufAiQT4PWSKbhFteQ2PqMStKD/UBnqndFSLvMSXujHVrEvhFY/5KGiHvIki8We2CPXHzFMvhBx4Jg6eDTcDduWIDLVaCQJIrFMU5d3p8RQt7pwZVSCFvQfKkO9s3eVC/MSXujHVnFaAs4fSu6hqp0NeZLlo091X1ZxjFWHyRciDhxTB9rHqE5s9TBBzC+u0UiCohbBWKZkPVdXncxe211FJVCDdhNdaEIKJXTh4jil6pBG2ZuWTLON2G8tmdUKAAA=') format('woff2');
}
.wxh {
......@@ -13,6 +12,18 @@
-moz-osx-font-smoothing: grayscale;
}
.wxh-timeout:before {
content: "\e604";
}
.wxh-clock:before {
content: "\e603";
}
.wxh-pen:before {
content: "\e602";
}
.wxh-doc:before {
content: "\e601";
}
<!-- ******************* 配件选择 ******************* -->
<template>
<view>
<view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view>
<view class="u-flex-1 add-parts" @click="toParts" v-if="!disabled && lists.length > 0">
添加备件<u-icon name="arrow-right" color="#2979ff" size="30"></u-icon>
</view>
</view>
<view class="complete-part">
<view v-if="lists.length > 0">
<adjust-parts v-for="(item, index) in lists" :key="index" :info="item" @change="partsChange($event, index)" :disabled="disabled"></adjust-parts>
</view>
<view class="u-flex select-part" v-else>
<view class="img">
<image :src="noPartsImage" class="part-icon" />
</view>
<view class="u-flex content">
<text class="title">暂无备件信息</text>
<text class="desc">可选择备件仓备件</text>
</view>
<view class="btn">
<u-button shape="circle" :custom-style="customStyle" @click="toParts">
去选择
</u-button>
</view>
</view>
</view>
</view>
</template>
<script>
import adjustParts from "@/components/select-parts/adjust"
import stringMixin from './stringMixin'
export default {
name: 'XhParts',
components: {
adjustParts
},
mixins: [stringMixin],
props: {
orderId: {
type: String,
default: ''
},
categoryId: {
type: String,
default: ''
},
brandId: {
type: String,
default: ''
}
},
data() {
return {
lists: []
}
},
computed: {
customStyle() {
return {
'width': '200rpx',
'height': '80rpx',
'color': '#2272FF',
'font-size': '32rpx',
}
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
},
noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png'
},
selectedParts() {
return this.lists.filter((item) => {
return item.quantity > 0
})
}
},
mounted() {
this.getWorkOrderParts()
},
methods: {
getWorkOrderParts() {
// this.lists = JSON.parse(this.dataValue) || []
this.lists = this.dataValue ? JSON.parse(this.dataValue) : []
},
partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val)
this.valueChange(JSON.stringify(this.selectedParts))
},
valChange(val) {
val.forEach(v => {
const index = this.lists.findIndex(k => k.part_id === v.part_id)
if (index < 0) {
this.lists.push(v)
} else {
this.$set(this.lists, index, v)
}
})
this.valueChange(JSON.stringify(this.selectedParts))
},
toParts() {
uni.navigateTo({
url: `/pages/order/parts?workOrderId=${this.orderId}&brandId=${this.brandId}&categoryId=${this.categoryId}`
})
}
}
}
</script>
<style lang="scss" scoped>
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.add-parts {
color: #2272FF;
text-align: right;
}
.complete-part {
.select-part {
align-items: center;
height: 240rpx;
.img {
display: flex;
align-items: center;
margin-right: 30rpx;
.part-icon {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
}
}
.content {
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
.title {
text-align: left;
color: #2272FF;
font-size: 38rpx;
font-weight: bold;
margin-right: auto;
}
.desc {
text-align: left;
color: #999;
font-size: 26rpx;
margin-right: auto;
}
}
}
}
</style>
<!-- ******************* 扫码 ******************* -->
<template>
<view class="">
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
<view class="">
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<view class="u-flex">
<u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" />
......@@ -23,33 +23,25 @@
return {}
},
computed: {
valueTxt() {
let str = ''
const dataValue = this.dataValue
if(dataValue && dataValue.length>1){
str = '经度:'+dataValue[0]+','+'维度:'+dataValue[1]
}
return str
}
},
watch: {},
mounted() {},
methods: {
scanCode(type){
const self = this
// qrCode 二维码;barCode 条形码
let scanType = type && [type] || ['qrCode']
uni.scanCode({
// scanType: scanType,
success: function (res) {
self.dataValue = res.result
self.valueChange(res.result)
let result = res.result
if (result.substring(0, 4) === 'http') {
let arr = result.split('/#/')
if (arr.length < 2) arr = result.split('?')
result = arr[1]
}
self.dataValue = result
self.valueChange(result)
}
});
},
// setValue(txt) {
// this.valueChange(this.dataValue)
// }
}
}
}
</script>
......@@ -59,10 +51,10 @@
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
</style>
<template>
<view class="bottom-button">
<view v-for="(item, index) in list" :class="['button-view', item.type]">
<view v-for="(item, index) in list" :class="['button-view', item.type]" :key="index">
<u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
:custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
......@@ -9,6 +9,7 @@
</view>
<view :class="['text-content', item.type]">{{item.label}}</view>
</u-button>
<view v-if="item.count && item.count > 0" class="bradge-vidw">{{item.count}}</view>
</view>
</view>
</template>
......@@ -25,37 +26,57 @@
buttons: {
type: Array,
default () {
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: true,
disabled: false,
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false,
disabled: false
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: true,
disabled: false,
},
{
label: '接单',
type: 'text',
show: true,
disabled: true,
customStyle: {
'background-color': '#2272FF'
}
}
]
// id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照; 4 配件申请
// label: 按钮文字,
// type: 'image' 上图片下文字;'text' 纯文字,
// image: 图片名,
// show: 是否显示,
// disabled: 是 禁用;否 正常,
// id: 区分各个按钮
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: false,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false, // 待签到显示
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: false,
disabled: false,
id: 3
},
{
label: '备件申请',
type: 'image',
image: 'peijian.png',
show: false,
disabled: false,
count: 0,
id: 4
},
{
label: '去接单',
type: 'text',
image: '',
show: true,
disabled: false,
id: 0,
customStyle: {
'background-color': '#D1D4D4'
}
}]
}
}
},
......@@ -116,10 +137,11 @@
justify-content: center;
align-items: center;
padding: 0 30rpx 44rpx 30rpx;
.button-view {
max-width: 600rpx;
display: flex;
display: flex;
position: relative;
&.image {}
&.text {
......@@ -133,12 +155,12 @@
flex-direction: column;
width: 100%;
&.image {
margin-right: 40rpx;
margin-right: 22rpx;
}
&.text {
width: 400rpx;
margin-left: 40rpx;
width: 360rpx;
margin-left: 18rpx;
&.one {
width: 600rpx;
margin-left: 0rpx;
......@@ -173,6 +195,21 @@
}
}
}
}
.bradge-vidw {
height: 24rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
position: absolute;
top: -10rpx;
right: 4rpx;
border: 2rpx solid #FA5A49;
color: #FA5A49;
font-size: 16rpx;
line-height: 24rpx;
text-align: center;
min-width: 36rpx;
z-index: 1;
}
}
}
</style>
......@@ -9,7 +9,7 @@
</view>
<view class="order-cell">
<text>工单编号:</text>
<text>{{ order.orderNumber }}</text>
<text @longpress="handleLongpress(order.orderNumber)">{{ order.orderNumber }}</text>
</view>
<view class="order-cell">
<text>合作厂商:</text>
......@@ -158,6 +158,14 @@
},
handleClick(val) {
this.$emit('update:readMore', val)
},
handleLongpress(text) {
uni.setClipboardData({
data: text,
success: function () {
console.log('success');
}
});
}
}
}
......
......@@ -10,14 +10,14 @@
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
</view>
<view class="content-view">
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<view class="info-title">
<text>{{item.name + ':'}}</text>
</view>
<view class="info-content">
<text>{{orderData[key]}}</text>
<text v-if="item.content">{{' / ' + orderData[item.content]}}</text>
</view>
<view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<view class="info-title">
<text>{{item.name + ':'}}</text>
</view>
<view class="info-content">
<text @longpress="handleLongpress(key, orderData[key])">{{orderData[key]}}</text>
<text v-if="item.content">{{' / ' + orderData[item.content]}}</text>
</view>
</view>
<view class="address-view">
<view class="address-left-view">
......@@ -110,10 +110,19 @@
orderText() { // 按钮文字
return this.typeTexts[this.orderType]
},
buttonStyle() { // 按钮样式
buttonStyle() { // 按钮样式
/** orderType
0 待接单、
1 待预约、
2 待签到、
3 待完工、
4 审核中、
5 异常单、
6 已完工
*/
switch (this.orderType) {
case 0:
if (this.orderData.orderBusinessType != 'R') {
if (!this.isCompetition ) {
return this.buttonStyles[0]
} else {
return this.buttonStyles[1]
......@@ -129,8 +138,7 @@
}
},
showCountTime() { // ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单)) && 有超过时间点
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')) && this.orderData.currentOverTime
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && !this.isCompetition)) && this.orderData.currentOverTime
},
showTime() {
return [4, 5, 6].indexOf(this.orderType) != -1
......@@ -145,9 +153,12 @@
},
typeTexts() {
return [this.type0Text, '去预约', '去签到', '去完工', '审核中', '去处理', '已完工']
},
isCompetition() { // 是:订单池,抢单; 否:指派单,接单
return this.orderData.orderBusinessType == 'R'
},
type0Text() {
return this.orderData.orderBusinessType != 'R' ? '接单' : '抢单'
return !this.isCompetition ? '接单' : '抢单'
},
buttonStyles() {
return [{
......@@ -194,33 +205,25 @@
},
showDistance() {
return this.orderType == 0 && this.location.length >= 2 && (this.orderData.contactAddressLatitud || this.orderData.contactAddressLongitud)
},
titles() {
return {
'waitAccept': '待' + this.type0Text, // 待接单、
'waitAppointment': '待预约', // 待预约、
'waitCheckIn': '待签到', // 待签到、
'waitFinish': '待完工', // 待完工、
'audit': '审核中', // 审核中、
'exception': '异常单', // 异常单、
'finish': '已完工', //已完工
}
},
types() {
return {
'waitAccept': 0, // 待接单、
'waitAppointment': 1, // 待预约、
'waitCheckIn': 2, // 待签到、
'waitFinish': 3, // 待完工、
'audit': 4, // 审核中、
'exception': 5, // 异常单、
'finish': 6, //已完工
}
},
title() {
return this.titles[this.type]
},
orderDistance() {
},
isWaitFinish() {
return this.orderType == 3
},
isException() {
return this.orderType == 5
},
types() {
return {
'waitAccept': 0, // 待接单、
'waitAppointment': 1, // 待预约、
'waitCheckIn': 2, // 待签到、
'waitFinish': 3, // 待完工、
'audit': 4, // 审核中、
'exception': 5, // 异常单、
'finish': 6, //已完工
}
},
orderDistance() {
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
},
/** orderType
......@@ -280,11 +283,18 @@
methods: {
// title:标题,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
handleClick() {
// if (this.buttonDisabled) return
this.$emit('action', this.orderData, this.title, this.showCountTime ? 'show' : '')
var func = 'click'
if (this.isWaitFinish || this.isException) { // 不是待完工、不是异常单点按钮算点cell
func = 'action'
}
this.$emit(func, this.orderData, this.type, this.showCountTime ? 'show' : '')
},
handleClickCell() {
this.$emit('click', this.orderData, this.title, this.showCountTime ? 'show' : '')
handleClickCell() {
var func = 'click'
if (this.isException) { // 异常单点cell算点按钮
func = 'action'
}
this.$emit(func, this.orderData, this.type, this.showCountTime ? 'show' : '')
},
handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2
......@@ -306,33 +316,43 @@
}
return address
},
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1 经度
* @param float $lat1 维度
* @param float $lon2 经度
* @param float $lat2 维度
* @return float 浮点数
*/
distance(lat1, lng1, lat2, lng2) {
var radLat1 = this.Rad(lat1);
var radLat2 = this.Rad(lat2);
var a = radLat1 - radLat2;
var b = this.Rad(lng1) - this.Rad(lng2);
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
s = s *6378.137 ;// EARTH_RADIUS;
s = Math.round(s * 10000)/10000 //输出为米
return Number(s?s.toFixed(2):0);
},
Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
},
updateTime() {
var time = new Date().getTime()
this.timeout = this.orderData.currentOverTime < time
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - time) / 1000)
/**
* echo distance(116.3896,39.91917,116.3940,39.91726);
* 计算两点之间直线距离
* @param float $lon1 纬度
* @param float $lat1 经度
* @param float $lon2 纬度
* @param float $lat2 经度
* @return float 浮点数
*/
distance(lat1, lng1, lat2, lng2) {
var radLat1 = this.Rad(lat1);
var radLat2 = this.Rad(lat2);
var a = radLat1 - radLat2;
var b = this.Rad(lng1) - this.Rad(lng2);
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));
s = s *6378.137 ;// EARTH_RADIUS;
s = Math.round(s * 10000)/10000 //输出为米
return Number(s?s.toFixed(2):0);
},
Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
},
updateTime() {
var time = new Date().getTime()
this.timeout = this.orderData.currentOverTime < time
this.timestamp = Math.round(Math.abs(this.orderData.currentOverTime - time) / 1000)
},
handleLongpress(key, text) { // 长按复制单号
if (key == 'orderNumber') {
uni.setClipboardData({
data: text,
success: function () {
console.log('success');
}
});
}
}
}
}
......
<template>
<view class="no-order-view" :style="customStyle">
<image class="no-order-image" :src="wudingdanImage"></image>
<text>当前暂无订单</text>
<text>{{text}}</text>
</view>
</template>
......@@ -12,22 +12,18 @@
type: String,
default: 'background-color: #FFFFFF'
},
type: { // 图片
imageName: { // 图片
type: String,
default: 'white',
default: 'wudingdan.png'
},
text: { // 提示文字
type: String,
default: '当前暂无订单'
}
},
computed: {
wudingdanImage() {
var name = 'wudingdan.png'
switch(this.type) {
case 'black':
name = "zwdd.png"
break
default:
break
}
return process.uniEnv.qn_base_url + name
return process.uniEnv.qn_base_url + this.imageName
}
}
}
......@@ -48,7 +44,7 @@
.no-order-image {
width: 374rpx;
height: 218rpx;
margin-top: 50rpx;
margin-top: 30rpx;
margin-bottom: 20rpx;
}
}
......
......@@ -16,8 +16,8 @@
</view>
<view class="right-view">
<view class="line-view-top">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.exception?'异常':''}}</text>
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd &nbsp hh:MM:ss')}}</text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.overTime && record.exception ? '/' : ''}}{{record.exception?'异常':''}}</text>
<text style="color: #2272FF;" v-show="record.isTrace">跟进</text>
</view>
<view class="line-view-item">
......
<template>
<!-- 已申请配件cell -->
<view class="return-cell" @click="handleClick">
<view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view class="express-view" @click.stop="$u.throttle(handleClickExpress, 500)" v-if="info.express.number">
<text>物流单号:</text>
<view class="order-file-right">
<text>{{info.express.number}}</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
<view class="line-view"></view>
<view class="list-content" v-if="isHorizontal">
<view class="image-list">
<image class="image-view" v-for="(item, index) in images" :key="index" :src="item"></image>
<view class="info-view" v-if="info.items.length == 1">
<view class="name-text">{{info.items[0] ? info.items[0].name : ''}}</view>
<view>{{noteText}}</view>
</view>
</view>
<view class="count-view">共{{info.items.length}}种</view>
</view>
<view v-else class="list-vertical-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index">
<SpareCell :item="item"/>
</view>
</view>
<view class="bottom-view">
<view class="total-view">
<text>合计:</text>
<text class="amount-view">{{total}}</text>
<text>件</text>
</view>
<u-button v-if="buttonText" :custom-style="customStyle" shape="circle" @click.stop="handleOperate" type="primary">{{buttonText}}</u-button>
</view>
</view>
</template>
<script>
import SpareCell from "@/components/parts/spareCell.vue"
export default {
components: {
SpareCell
},
props: {
info: { // 申请材料列表
type: Object,
default() {
return {
status: 0, // 待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20
items: [],
express: {}
}
}
},
type: { // horizontal;vertical
type: String,
default: 'horizontal'
}
},
data() {
return {
}
},
computed: {
texts() {
return {
'1': '取消申请',
'10': '',
'15': '签收',
'20': '',
'-2': '',
'-1': '',
'100': ''
}
},
isHorizontal() {
return this.type == 'horizontal'
},
operateTypes() {
return {
'1': 'cancelParts',
'10': '',
'15': 'receiveParts',
'20': '',
'-2': '',
'-1': '',
'100': ''
}
},
buttonOperateType() {
return this.operateTypes[this.info.status]
},
buttonText() {
return this.texts[this.info.status]
},
noteText() {
if (this.info.items[0] && (this.info.items[0].categoryName || this.info.items[0].brandName)) {
return (this.info.items[0].categoryName || '通用') + '-' + (this.info.items[0].brandName || '通用')
} else {
return '通用'
}
},
buttonStyle() {
return {
'height': '104rpx',
'width': '100%',
}
},
// 待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20; 已完成 100
title() {
return this.titles[String(this.info.status)] || this.info.statusText
},
titles() {
// 待签收 15; 待发货 10; 待审核 1; 已取消 -1; 已驳回 -2; 已签收 20;已完成 100;已核销 91
// 已核销展示为已签收
return {
'1': '待审核',
'10': '待发货',
'15': '待签收',
'20': '已签收',
'-2': '已驳回',
'-1': '已取消',
'100': '已完成',
'91': '已签收' // 已核销
}
},
titleColor() {
switch (String(this.info.status)) {
case '-2': // 已驳回
return '#FA5A49'
case '-1': // 已取消
return '#333333'
default:
return '#2272FF'
}
},
// 待签收 15 -> 已签收 20; 待审核 1 -> 已取消 -1
willStatuses() {
return {
'1': '-1',
'10': '',
'15': '20',
'20': '',
'-2': '',
'-1': '',
'100': '',
'91': ''
}
},
willStatus() {
return this.willStatuses[this.info.status]
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
i += item.quantity
}
return i
},
images() {
var array = []
for (var item of this.info.items) {
if (item.images) {
array.push(process.uniEnv.systemUrl.apiUrl + item.images.split(',').shift())
} else {
array.push(this.placeholderImage)
}
}
return array
},
placeholderImage() {
return process.uniEnv.qn_base_url + 'morentupian.png'
},
customStyle() {
return {
'height': '80rpx',
'width': '200rpx',
}
}
},
methods: {
handleClick() {
this.$emit('action', this.info)
},
handleOperate() {
this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
},
handleClickExpress() {
this.$emit('express', this.info)
}
}
}
</script>
<style lang="scss" scoped>
.return-cell {
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
display: flex;
flex-direction: column;
height: 100%;
.title-view{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #333333;
.title-text {
font-size: 36rpx;
font-weight: bold;
}
.express-view {
display: flex;
justify-content: center;
.order-file-right {
font-weight: 400;
color: #2272FF;
font-size: 26rpx;
}
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 20rpx;
}
.list-content {
display: flex;
width: 100%;
margin-top: 40rpx;
margin-bottom: 30rpx;
.image-list {
overflow-x: auto;
display: flex;
width: 100%;
border-right: 2rpx solid #F4F5F7;
margin-right: 30rpx;
.image-view {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.info-view {
font-size: 24rpx;
color: #333333;
.name-text {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 30rpx;
}
}
}
.count-view {
width: 30rpx;
text-align: center;
font-size: 26rpx;
color: #666666;
}
}
.list-vertical-content {
height: 100%;
overflow: auto;
.list-item {
margin-bottom: 30rpx;
margin-top: 20rpx;
}
}
.bottom-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
.total-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
.amount-view {
color: #2272FF;
padding-right: 10rpx;
}
}
}
}
</style>
<template>
<!-- 申请配件按钮 -->
<view class="apply-button">
<u-button :custom-style="customStyle" shape="circle" @click.stop="handleClick" type="primary">
<u-icon class="apply-icon" name="plus"></u-icon>
<text class="apply-text" v-if="showText">申请备件</text>
</u-button>
</view>
</template>
<script>
export default {
props: {
type: { // 按钮宽'collapse': '80rpx', 'expand': '220rpx'
type: String,
default: 'expand'
}
},
computed: {
typeWidth() {
return {
'collapse': '80rpx',
'expand': '220rpx'
}
},
showText() {
return this.type == 'expand'
},
customStyle() {
return {
'height': '80rpx',
'width': this.typeWidth[this.type],
}
}
},
created() {
setTimeout(()=> {
this.$emit('update:type', 'collapse')
}, 3000)
},
methods: {
handleClick() {
this.$emit('click')
},
}
}
</script>
<style lang="scss" scoped>
.apply-button {
.apply-icon {
font-size: 36rpx;
}
.apply-text {
font-size: 32rpx;
padding-left: 10rpx;
}
}
</style>
<template>
<u-popup v-model="show" mode="center" safe-area-inset-bottom width="690rpx" :mask-close-able="flase"
close-icon-color="#FFFFFF" height="86%">
<!-- 申请列表 -->
<view class="apply-list-view">
<view class="content-view">
<view class="list-content">
<swiper class="swiper" :indicator-dots="true" style="height: 100%;" :current="currentIndex">
<swiper-item v-for="(item, index) in list" :key="index">
<view class="cell-view">
<view class="shadow-view">
<AppliedCell @operate="handleOperate" @express="handleClickExpress" @action="handleClickCell" :info="item" :type="vertical" class="applied-cell"></AppliedCell>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="bottom-view">
<view class="bottom-warehouse">
<view class="bottom-title">
<text>备件订单</text>
<view class="order-file-right" @click="$u.throttle(handleClick, 500)">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="bottom-content">
<view v-for="(item, index) in bottomItems" :key="index" class="bottom-content-item"
@click="handleClick(item.index)">
<view class="bottom-image">
<image :src="item.icon" :style="item.imageStyle"></image>
</view>
<view>{{item.title}}</view>
</view>
</view>
</view>
<view class="line-view"></view>
<view class="apply-button" @click="$u.throttle(handleApply, 500)">
<text :custom-style="applyStyle" type="primary">继续申请</text>
</view>
</view>
</view>
<view class="colse-view">
<image class="image-view" :src="closeImage" @click.throttle="$u.throttle(handleClose, 500)"></image>
</view>
</view>
</u-popup>
</template>
<script>
import AppliedCell from "@/components/parts/appliedPartsCell.vue"
export default {
components: {
AppliedCell
},
props: {
list: { // 申请材料列表
type: Array,
default () {
return []
}
},
show: {
type: Boolean,
default: false
}
},
data() {
return {
currentIndex: 0
}
},
computed: {
closeImage() {
return process.uniEnv.qn_base_url + 'dianjiquxiao.png'
},
bottomItems() {
// index: 跳转到我的订单页面之后第几个tab,
return [{
index: 3,
title: '待签收',
icon: process.uniEnv.qn_base_url + 'daiqianshou.png',
imageStyle: 'width:48rpx;height:48rpx'
},
{
index: 2,
title: '待发货',
icon: process.uniEnv.qn_base_url + 'daifahuo.png',
imageStyle: 'width:48rpx;height:48rpx'
},
{
index: 1,
title: '待审核',
icon: process.uniEnv.qn_base_url + 'daishenhe.png',
imageStyle: 'width:44rpx;height:54rpx'
},
{
index: 4,
title: '已签收',
icon: process.uniEnv.qn_base_url + 'qianshou.png',
imageStyle: 'width:48rpx;height:48rpx'
},
]
}
},
methods: {
handleClose() {
this.$emit('update:show', false)
},
handleOperate(partsId, operateType, willStatus) {
this.$emit('operate', partsId, operateType, willStatus)
},
handleClickCell(info) {
this.$emit('action', info)
},
handleClickExpress() {
this.$emit('express', info)
},
handleApply() {
this.$emit('apply')
},
handleClick(index = 0) {
uni.navigateTo({
url: 'pages/mine/warehouse/index?index=' + index
})
}
}
}
</script>
<style lang="scss" scoped>
.apply-list-view {
height: 100%;
display: flex;
flex-direction: column;
.content-view {
border-radius: 12rpx;
background-color: #FFFFFF;
height: 100%;
display: flex;
flex-direction: column;
.list-content {
height: 100%;
.swiper {
.cell-view {
height: 100%;
padding-bottom: 100rpx;
// display: flex;
// flex-direction: column;
.shadow-view{
border-radius: 12rpx;
margin:30rpx;
height: 100%;
box-shadow: 0px 6px 10px rgba(22,72,155,0.15);
}
}
}
}
.bottom-view {
.bottom-warehouse {
background-color: #FFFFFF;
border-radius: 12rpx;
.bottom-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin: 0rpx 30rpx 40rpx 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.order-file-right {
font-weight: 400;
color: #2272FF;
font-size: 26rpx;
}
}
.bottom-content {
display: flex;
justify-content: space-around;
align-items: center;
.bottom-content-item {
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.bottom-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 10rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 24rpx;
}
.apply-button {
width: 100%;
color: #2272FF;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
height: 112rpx;
}
}
}
.colse-view {
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
.image-view {
width: 60rpx;
height: 60rpx;
}
}
}
</style>
<template>
<!-- 已申请配件cell -->
<view class="applied-cell" @click="handleClick">
<view class="title-view">
<text class="title-text">{{title}}</text>
<view>
<text>退件时间:</text>
<text>{{info.createTime ? $u.timeFormat(info.createTime, 'yyyy.mm.dd hh:MM:ss') : ''}}</text>
</view>
</view>
<view class="line-view"></view>
<view class="list-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index">
<SpareCell :item="item"/>
</view>
</view>
<view class="line-view"></view>
<view class="info-item">
<view>
<text>退件编号:</text>
<text @longpress="handleLongpress">{{info.batchNumber}}</text>
</view>
<text class="copy-view" @click="$u.throttle(handleLongpress, 500)">复制</text>
</view>
<view class="line-view"></view>
<view class="bottom-view">
<view class="total-view">
<text>合计:</text>
<text class="amount-view">{{total}}</text>
<text>件</text>
</view>
</view>
</view>
</template>
<script>
import SpareCell from "@/components/parts/spareCell.vue"
export default {
components: {
SpareCell
},
props: {
info: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
}
},
computed: {
title() {
// 退件中:32 已打回,其他:退件中
var text = '退件中'
for (var item of this.info.items) {
if (item.status == 32) {
text = '已打回'
break
}
}
return this.info.finished ? '退件完成' : text
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
i += item.quantity
}
return i
},
},
methods: {
handleLongpress() { // 长按复制单号
uni.setClipboardData({
data: this.info.number,
success: function () {
console.log('success');
}
})
}
}
}
</script>
<style lang="scss" scoped>
.applied-cell {
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.title-view{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #333333;
.title-text {
font-size: 36rpx;
font-weight: bold;
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 20rpx;
}
.list-content {
margin-top: 40rpx;
margin-bottom: 40rpx;
.list-item {
margin-bottom: 30rpx;
}
}
.info-item {
margin-top: 24rpx;
margin-bottom: 24rpx;
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
.detail-left-view {}
.copy-view {
color: #2272FF;
padding-left: 30rpx;
}
}
.bottom-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
margin-bottom: 4rpx;
.total-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
.amount-view {
color: #2272FF;
padding-right: 10rpx;
}
}
}
}
</style>
<template>
<view class="spare-item">
<view class="left-view">
<u-checkbox v-if="showChecked" icon-size="28" size="40" v-model="check" @change="handleChange"
shape="circle" />
<image class="image-view" :src="imageUrl"></image>
<view class="info-view">
<view class="name-text">{{item.name}}</view>
<view>{{remarkText}}</view>
</view>
</view>
<view class="count-view">
<view v-if="showChecked">
<u-number-box v-model="value" :min="item.min || 0" :max="item.max || item[type]" @minus="numChange"
@plus="numChange" @blur="numChange"></u-number-box>
</view>
<text v-else>x{{item[type]|| 0}}</text>
</view>
</view>
</template>
<script>
export default {
props: {
showChecked: { // 是否显示勾选
type: Boolean,
default () {
return false
}
},
type: { // 'stock' 仓库; 'quantity' 订单
type: String,
default: 'quantity'
},
item: {
type: Object,
default () {
return {}
}
},
noteText: {
type: String,
default: ''
},
},
data() {
return {
value: 0, // 选数
check: false, // 选中
}
},
computed: {
remarkText() {
if (this.item.categoryName || this.item.brandName) {
return (this.item.categoryName || '通用') + '-' + (this.item.brandName || '通用')
} else {
return '通用'
}
},
imageUrl() {
return this.item.images ? process.uniEnv.systemUrl.apiUrl + this.item.images.split(',').shift() : this
.placeholderImage
},
placeholderImage() {
return process.uniEnv.qn_base_url + 'morentupian.png'
},
},
watch: {
'item.quantity'(val) {
this.check = val > 0
this.value = val
},
'item.selected'(val) {
this.check = val
this.value = val ? this.item.stock : 0
},
},
methods: {
handleChange(event) {
this.value = event.value ? this.item.stock : 0
this.$emit('change', event.value)
this.$emit('numChange', this.value)
},
numChange(event) {
this.check = event.value > 0
this.$emit('change', this.check)
this.$emit('numChange', event.value)
},
}
}
</script>
<style lang="scss" scoped>
.spare-item {
display: flex;
justify-content: space-between;
align-items: flex-end;
.left-view {
display: flex;
align-items: center;
.image-view {
width: 120rpx;
height: 120rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.info-view {
font-size: 24rpx;
color: #333333;
.name-text {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 30rpx;
}
}
}
.count-view {
font-size: 28rpx;
color: #333333;
}
}
</style>
## 配件数量调整组件使用说明
```
该组件用于仓库配件的数量调整
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :-----: | :----: | :--------: | :-----------------: |
| info | Boject | {} | - | 数据 **格式见下文** |
| disabled | Boolean | true | true/false | 是否禁用 |
### lists 格式
```json
{
"name": "正泰漏保", // 配件名称
"quantity": 1, // 配件数量
"min": 1, // 数量最小值
"max": 100 // 数量最大值
}
```
### Events
| 事件称名 | 说明 | 返回值 |
| :------: | :----------------: | :------: |
| @change | 数量发生改变时返回 | 新的数量 |
## 组件用法
### 基础用法
```html
<adjust-parts
v-for="(item, index) in lists"
:key="index"
:info="item"
@change="partsChange($event, index)"
:disabled="disabled"
></adjust-parts>
```
```js
import adjustParts from "@/components/parts/adjust"
export default {
components: {
adjustParts,
},
data() {
return {
lists: [
{
id: 1,
name: "正泰漏保",
quantity: 1,
min: 1,
max: 100,
},
{
id: 1,
name: "挚达广汽充电桩",
quantity: 3,
min: 1,
max: 5,
},
],
}
},
methods: {
partsChange(val, index) {
console.log("val", val, index)
},
},
}
```
<template>
<view class="parts">
<view class="u-flex u-col-center u-row-around lists">
<view class="u-flex-1 name">
{{info.name}}
</view>
<view class="num">
<u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || 9999" @change="numChange"></u-number-box>
<text class="nums" v-else>x{{ info.quantity || 1 }}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
info: {
default () {
return {}
}
},
disabled: {
type: Boolean,
default () {
return false
}
}
},
data() {
return {
}
},
created() {
},
methods: {
numChange(event) {
this.$emit('change', event.value)
}
}
}
</script>
<style scoped lang="scss">
.parts{
.lists {
padding: 10rpx 0;
.name {
font-size: 26rpx;
}
.num {
width: 200rpx;
text-align: center;
.nums {
//color: #F59A23;
}
}
}
}
</style>
## 配件选择组件使用说明
```
该组件用于备件申请,数量调整
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| info | Object | {} | - | 列表数据 **格式见下文** |
### lists 格式
```json
{
id: 1,
name: "正泰漏保", // 名称
code: 'NO.202006170015', // 编号
remark: '这个空开盒子和其他的空开有什么不一样,这里可以写一下', // 描述
quantity: 1, // 默认数量
min: 1, // 数量最小值
max: 100, // 数量最大值
images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png", // 图片
checked: false, // 是否勾选
disabled: true // 是否禁用数量调整,如果禁用则会显示添加申请按钮
}
```
### Events
| 事件称名 | 说明 | 返回值 |
| :-----------: | :----------: | :--------: |
| @numChange | 数量发生改变 | 改变的数量 |
| @selectChange | 勾选发生改变 | 勾选的状态 |
| @apply | 点击添加申请 | 无 |
## 组件用法
### 基础用法
```html
<select-parts
v-for="(item, index) in lists"
:key="index"
:info="item"
:show-checked="false"
@numChange="numChange($event, index)"
@selectChange="selectChange($event, index)"
@apply="apply(index)"
></select-parts>
```
```js
import selectParts from "@/components/parts/index"
export default {
components: {
selectParts,
},
data() {
return {
lists: [
{
id: 1,
name: "正泰漏保",
code: 'NO.202006170015',
remark: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
quantity: 1,
min: 1,
max: 100,
images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
},
{
id: 1,
name: "挚达广汽充电桩",
code: 'NO.202006170014',
remark: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
quantity: 3,
min: 1,
max: 5,
images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
},
],
}
},
methods: {
apply(index) { // 添加申请
this.$set(this.lists[index], 'disabled', false)
},
numChange(val, index) { // 设置数量
this.$set(this.lists[index], 'num', val)
},
selectChange(val, index) { // 设置勾选状态
this.$set(this.lists[index], 'checked', val)
},
},
}
```
<template>
<view class="u-flex parts">
<view class="u-flex left" v-if="showChecked">
<u-checkbox v-model="info.checked" @change="selectChange" shape="circle" width="30rpx"></u-checkbox>
</view>
<view class="u-flex right">
<view class="right-img">
<u-image :src="partsImage(info.images)" width="200rpx" height="200rpx" />
</view>
<view class="u-flex right-content">
<view class="right-content-name">{{ info.name }}</view>
<view class="right-content-desc">{{ info.remark }}</view>
<view class="u-flex right-content-opera">
<view class="no" v-if="info.stock">
可用{{ info.stock }}件
</view>
<view class="num">
<u-number-box v-show="!info.disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || info.quantity" @change="numChange"></u-number-box>
<u-button v-show="info.disabled" type="primary" size="mini" shape="circle" @click="addApply">加入申请</u-button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
info: {
info () {
return {}
}
},
showChecked: { // 是否需要勾选
type: Boolean,
default () {
return true
}
},
disabled: { // 是否可编辑数量
type: Boolean,
default () {
return false
}
}
},
data() {
return {
}
},
created() {
},
methods: {
partsImage(images) {
return images ? process.uniEnv.systemUrl.apiUrl + images : process.uniEnv.qn_base_url + 'morentupian.png'
},
selectChange(event) {
this.$emit('selectChange', event.value)
},
numChange(event) {
this.$emit('numChange', event.value)
},
addApply() {
this.$emit('apply')
}
}
}
</script>
<style scoped lang="scss">
.parts{
justify-content: center;
align-items: center;
padding: 30rpx 10rpx;
border-bottom: 1px solid #F4F5F7;
.left {
width: 60rpx;
}
.right {
flex: 1;
overflow: hidden;
.right-img {
padding-right: 20rpx;
}
.right-content {
flex: 1;
flex-direction: column;
align-items: flex-start;
overflow: hidden;
.right-content-name {
font-size: 32rpx;
color: #333;
font-weight: bold;
height: 48rpx;
overflow: hidden;
}
.right-content-desc {
font-size: 24rpx;
color: #999;
overflow: hidden;
line-height: 40rpx;
height: 80rpx;
margin: 10rpx 0;
}
.right-content-opera {
justify-content: space-between;
width: 100%;
.no {
font-size: 24rpx;
color: #999;
overflow: hidden;
flex: 1;
height: 36rpx;
}
.num {
flex: 1;
text-align: right;
}
}
}
}
}
</style>
<template>
<view class="u-flex bottom" :style="customStyle">
<view class="select-view" v-if="showChecked">
<view class="u-flex bottom-left">
<view class="left-list"><u-checkbox icon-size="28" size="40" v-model="checked" @change="selectAll" shape="circle"/></view>
<view class="left-list">全选</view>
</view>
<view class="u-flex bottom-center">
<view class="center-list">已选择 {{ partNum }} 种</view>
<view class="center-list">共:<text class="num"> {{ num }} </text> 件</view>
</view>
</view>
<view class="u-flex select-num" v-if="!showChecked">
<view class="num-left" @click="submit">
<u-badge type="error" :show-zero="true" :count="partNum" :offset="[0, 0]"></u-badge>
<u-image width="72rpx" height="72rpx" :lazy-load="false" :src="partsImage"></u-image>
</view>
<view class="num-right">共:<text class="num"> {{ num }} </text> 件</view>
</view>
<view class="u-flex bottom-right">
<button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button>
</view>
</view>
</template>
<script>
export default {
props: {
showChecked: { // 是否显示勾选
type: Boolean,
default() {
return true
}
},
allChecked: { // 是否全选
type: Boolean,
default() {
return false
}
},
btnStatus: { // 确定按钮是否可点击
type: Boolean,
default() {
return false
}
},
partNum: { // 配件数量
type: Number,
default () {
return 0
}
},
num: { // 合计总件数
type: Number,
default () {
return 0
}
},
submitTxt: { // 提交按钮文字
type: String,
default () {
return '确定'
}
},
customStyle: {
type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;'
},
},
data() {
return {
checked: false
}
},
computed: {
partsImage() {
return process.uniEnv.qn_base_url + 'part_num.png'
},
btnActive() {
return this.btnStatus ? 'btn-active' : ''
}
},
watch: {
'allChecked': function(newValue, oldValue) {
if (this.showChecked) this.checked = newValue
}
},
created() {
if (this.showChecked) this.checked = this.allChecked
},
methods: {
selectAll(event) {
this.$emit('select', event.value)
},
submit() {
if (this.btnStatus) this.$emit('submit')
}
}
}
</script>
<style scoped lang="scss">
.bottom {
width: 100%;
height: 180rpx;
background: #fff;
justify-content: space-between;
.select-view {
display: flex;
align-items: center;
.u-flex {
flex-direction: column;
align-items: center;
}
.bottom-left {
// margin-left: 30rpx;
.left-list {
width: 100%;
&:nth-of-type(1) {
padding-left: 3rpx;
}
&:nth-of-type(2) {
margin-top: 8rpx;
font-size: 20rpx;
}
}
}
.bottom-center {
flex: 1;
align-items: flex-start;
margin: 0 20rpx;
.center-list {
&:nth-of-type(1) {
color: #666;
font-size: 26rpx;
}
&:nth-of-type(2) {
color: #333;
font-size: 32rpx;
margin-top: 8rpx;
font-weight: bold;
.num {
color: #2272FF;
padding-right: 10rpx;
}
}
}
}
}
.select-num {
flex: 1;
.num-left {
position: relative;
min-width: 92rpx;
}
.num-right {
color: #333;
font-size: 32rpx;
margin-left: 10rpx;
font-weight: bold;
.num {
color: #2272FF;
padding-right: 10rpx;
}
}
}
.bottom-right {
width: 360rpx;
// margin-right: 20rpx;
.btn {
width: 100%;
padding: 30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size: 32rpx;
text-align: center;
background: #D1D4D4;
color: #fff;
&::after {
content: '';
height: 0;
border: none;
}
}
.btn-active {
background: #2272ff;
}
}
}
</style>
## 提交工具栏组件使用说明
```
该组件用于勾选配件,显示配件数量以及提交操作
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :-----: | :----: | :--------: | :-----------------: |
| showChecked | Boolean | true | true/false | 是否显示勾选 |
| allChecked | Boolean | true | true/false | 是否全选 |
| btnStatus | Boolean | true | true/false | 确定按钮是否可点击 |
| partNum | Number | 0 | | 配件数量 |
| num | Number | 0 | | 合计总件数 |
| submitTxt | String | 确定 | | 确定按钮文字 |
### Events
| 事件称名 | 说明 | 返回值 |
| :------: | :----------------: | :------: |
| @select | 全选状态改变 | 新的状态 |
| @submit | 点击提交按钮 | |
## 组件用法
### 基础用法
```html
<submit-bar
:partNum="partNum"
:num="num"
:btnStatus="btnStatus"
:allChecked="allChecked"
@select="allSelect"
@submit="submit"
/>
```
```js
import submitBar from "@/components/submit-bar/index"
export default {
components: {
submitBar,
},
data() {
return {
}
},
computed: {
// 配件数
partNum() {
return 0
},
// 总数
num() {
return 0
},
// 按钮状态
btnStatus() {
return false
},
// 全选状态
allChecked() {
return false
}
},
methods: {
allSelect(value) {
console.log(value)
},
submit() {
console.log('submit')
}
},
}
```
This diff is collapsed.
This diff is collapsed.
<template>
<!-- #ifndef APP-NVUE -->
<view class="uni-list uni-border-top-bottom">
<view v-if="border" class="uni-list--border-top"></view>
<slot />
<view v-if="border" class="uni-list--border-bottom"></view>
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<list class="uni-list" :class="{ 'uni-list--border': border }" :enableBackToTop="enableBackToTop" loadmoreoffset="15"><slot /></list>
<!-- #endif -->
</template>
<script>
/**
* List 列表
* @description 列表组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
* @property {String} border = [true|false] 标题
*/
export default {
name: 'uniList',
'mp-weixin': {
options: {
multipleSlots: false
}
},
props: {
enableBackToTop: {
type: [Boolean, String],
default: false
},
scrollY: {
type: [Boolean, String],
default: false
},
border: {
type: Boolean,
default: true
}
},
// provide() {
// return {
// list: this
// };
// },
created() {
this.firstChildAppend = false;
},
methods: {
loadMore(e) {
this.$emit('scrolltolower');
}
}
};
</script>
<style lang="scss">
.uni-list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
background-color: $uni-bg-color;
position: relative;
flex-direction: column;
}
.uni-list--border {
position: relative;
/* #ifdef APP-NVUE */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
border-bottom-color: $uni-border-color;
border-bottom-style: solid;
border-bottom-width: 0.5px;
/* #endif */
z-index: -1;
}
/* #ifndef APP-NVUE */
.uni-list--border-top {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
z-index: 1;
}
.uni-list--border-bottom {
position: absolute;
bottom: 0;
right: 0;
left: 0;
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
/* #endif */
</style>
<template>
<view class="item" @click="$u.throttle(editSite, 500)">
<view class="userinfo u-flex">
<view class="name">{{ formatName }}</view>
<view class="mobile">{{ formatMobile }}</view>
</view>
<view class="siteinfo u-flex u-row-between u-col-top">
<view class="txt">{{ formatAddress }}</view>
<u-icon custom-prefix="wxh" name="pen" size="32"></u-icon>
</view>
<view class="default" v-show="isDefault">
<u-icon name="checkmark-circle" color="#2272FF" size="32"></u-icon>
<text class="txt">默认地址</text>
</view>
</view>
</template>
<script>
/**
* navbar 自定义地址单元格
* @description 此组件一般用于地址显示列。
* @property {Object} info 地址信息(默认{name: '', mobile: '', address: ''})
* @property {Boolean} is-default 是否为默认地址(默认 false)
* @event {Function()} edit-site 编辑地址
* @example <w-address :info="addressInfo" :isDefault="true" />
*/
export default {
name: 'w-address',
props: {
info: {
type: Object,
default() {
return {name: '', mobile: '', address: '', region: []};
}
},
isDefault: {
type: Boolean,
default: false
},
siteType: {
type: String,
default: 'edit'
}
},
data() {
return {};
},
computed: {
formatName() {
let name = this.info && this.info.name;
if (this.$u.test.isEmpty(name)) {
return '--';
} else {
return name;
}
},
formatMobile() {
let mobile = this.info && this.info.mobile;
if (this.$u.test.isEmpty(mobile)) {
return '--';
}
if (mobile.length == 11) {
let tmps = [];
tmps[0] = mobile.slice(0, 3);
tmps[1] = mobile.slice(3, 7);
tmps[2] = mobile.slice(7);
return tmps.join(' ');
} else {
return mobile;
}
},
formatAddress() {
let address = this.info && this.info.address;
if (this.$u.test.isEmpty(address)) {
return '--';
}
let region = this.info && this.info.region;
let regionStr = region.join('');
if(this.$u.test.contains(address, regionStr)) {
return address;
} else {
return regionStr + address;
}
}
},
methods: {
editSite() {
this.$emit('edit-site', this.info)
},
}
};
</script>
<style lang="scss" scoped>
.item {
.userinfo {
.name {
height: 92rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 92rpx;
}
.mobile {
margin-left: 20rpx;
height: 92rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 92rpx;
}
}
.siteinfo {
.txt {
width: 500rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 34rpx;
word-wrap: break-word;
}
}
.default {
border-top: 2rpx solid #F4F5F7;
margin-top: 22rpx;
padding-top: 30rpx;
.txt {
margin-left: 12rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
}
}
}
</style>
<template>
<u-navbar
:height="40"
:height="height"
:background="background"
:back-icon-color="navbarColor"
:title="title"
......@@ -31,7 +31,7 @@
props: {
height: {
type: String,
default: "40"
default: "44"
},
background: {
type: Object,
......
......@@ -55,7 +55,7 @@
"sdkConfigs" : {}
},
"uniStatistics" : {
"enable" : true
"enable" : false
}
},
/* SDK配置 */
......@@ -76,7 +76,7 @@
}
},
"uniStatistics" : {
"enable" : true
"enable" : false
}
},
"mp-alipay" : {
......
......@@ -250,16 +250,82 @@
"path": "deposit/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "配件押金",
"navigationBarTitleText": "备件押金",
"enablePullDownRefresh": false
}
},
{
"path": "setting/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/index",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "我的仓库",
"enablePullDownRefresh": false
"navigationBarTitleText": "备件订单",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "备件库",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/return",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "返件信息",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/searchParts",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单搜索
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
},
{
"path": "warehouse/express",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": " ", // 备件单物流
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
}
},
{
"path": "warehouse/records",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "出库记录",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "warehouse/partsDetail",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "", // 备件详情
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
......@@ -349,6 +415,13 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "parts",
"style": {
"navigationBarTitleText": "可用备件",
"disableScroll": true
}
}
]
},
......@@ -468,6 +541,44 @@
}
}
]
},
{
"root":"pages/parts",
"pages":[
{
"path":"application",
"style": {
"navigationBarTitleText": "备件申请",
"navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "addParts",
"style": {
"navigationBarTitleText": "备件选择",
"disableScroll": true
}
}
,{
"path" : "nodes",
"style" :
{
"navigationBarTitleText": "备件申请、返件成功",
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
}
,{
"path" : "returnParts",
"style" :
{
"navigationBarTitleText": "退件",
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
}
]
}
],
"preloadRule": {
......
......@@ -3,9 +3,8 @@
<view class="content-view">
<scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
refresher-background="#F4F5F7" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" enable-back-to-top>
<!-- <TabBarPage title="扳手会"> -->
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
<view class="msg-view">
......@@ -23,12 +22,9 @@
</view>
</view>
</view>
<!-- 订单推荐吸顶 -->
<!-- <u-sticky offset-top="0"> -->
<view class="sticky">
<text>订单推荐</text>
</view>
<!-- </u-sticky> -->
<view class="sticky">
<text>订单推荐</text>
</view>
<view class="order-view">
<!-- 入驻成功之后显示推荐订单列表 -->
<view class="order-list-view" v-if="loaded">
......@@ -47,28 +43,21 @@
<NoOrder />
</view>
<view v-else class="order-item-view">
<!-- <scroll-view scroll-y style="margin-bottom: 20rpx;" @scrolltolower="reachBottom"
scroll-anchoring> -->
<view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick" @action="handleClick">
</OrderCell>
</view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
<!-- </scroll-view> -->
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 1" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</view>
</view>
<!-- </view> -->
<!-- </scroll-view> -->
<view class="bottom-view" v-if="needSettled || orderList.length <= 0">
<view class="bottom-line-view"></view>
<view class="bottom-text">我也是有底线哒</view>
<view class="bottom-line-view"></view>
</view>
<!-- </TabBarPage> -->
</scroll-view>
</view>
</TabBarPage>
......@@ -106,8 +95,7 @@
pageSize: 100,
},
waitInit: false, // 当token为空时,等待自动登录结束
triggered: false,
_freshing: false,
triggered: true,
scrollTop: 0,
old: {
scrollTop: 0
......@@ -166,9 +154,11 @@
this.getOrderCount()
this.initSettleInfo();
},
handleClick(item, title) { // 跳转工单详情页面
handleClick(item, type, showCountTime) { // 跳转工单详情页面 showCountTime:是否显示倒计时
// type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
url: 'pages/order/detail?id=' + item.orderId + '&type=' + type + '&showCountTime=' + showCountTime
})
},
async initSettleInfo() {
......@@ -219,11 +209,9 @@
let self = this;
// 加载订单列表
self.search.token = self.vuex_token;
self.$u.api.listByRecommendOrder(self.search).then((res) => {
uni.stopPullDownRefresh() // 结束下拉刷新
self.$u.api.listByRecommendOrder(self.search).then((res) => {
self.loadedOrder = true
self.triggered = false;
self._freshing = false;
if (res.code == 200 && res.data) {
if (self.search.pageNumber == 1) {
self.orderList = []
......@@ -243,7 +231,13 @@
} else {
console.log(res.message, "初始化订单列表异常");
}
}
self.$nextTick(()=>{
if (self._freshing) {
self.triggered = false;
self._freshing = false;
}
})
});
},
reachBottom() {
......@@ -254,8 +248,8 @@
}
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
if (this._freshing) return
this._freshing = true
this.initSettleInfo()
},
onRestore() {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<view class="address-wrap">
<w-navbar title="收货地址"></w-navbar>
<view class="item" v-if="hasAdderss" @tap="toAddSite('修改地址')">
<view class="top">
<view class="name">{{ settled.id_card_name || settled.nickname || settled.name || '--' }}</view>
<view class="phone">{{ settled.mobile }}</view>
</view>
<view class="bottom">
<view class="address">{{ settled.address }}</view>
<u-icon :name="editPen" :size="32" color="#999999"></u-icon>
</view>
<view class="default" v-show="true">
<u-icon name="checkmark-circle" color="#2272FF" size="32"></u-icon>
<text class="txt">默认地址</text>
</view>
<view class="body" v-if="hasAdderss">
<w-address @editSite="toAddSite" :info="info" :is-default="true" />
</view>
</view>
</template>
......@@ -26,40 +15,70 @@ export default {
background: {
backgroundColor: 'none'
},
siteList: []
info: {
name: '',
mobile: '',
address: '',
region: [],
},
};
},
computed: {
editPen() {
return process.uniEnv.qn_base_url + 'icon/edit-pen.png'
},
settled() {
return this.vuex_settled && this.vuex_settled.record || null
},
hasAdderss() {
return this.settled && this.settled.address && this.settled.id_card_name
return this.info.address
},
addressInfo() {
return {
name: this.name,
mobile: this.mobile,
address: this.address,
region: this.region || [],
}
}
},
onLoad() {
getApp().trackPage('我的收获地址页')
},
onShow() {
if(!this.vuex_token) {
if(this.$u.test.isEmpty(this.vuex_token)) {
this.$u.route({url: 'pages/login/index'})
} else if(!this.settled) {
this.getData();
}
this.getData();
},
methods: {
getData() {
let self = this
app.getBaseInfo(self);
this.getMineSite()
},
getMineSite() {
this.$u.api.getSiteAddress().then((res) => {
const data = res.data
if(res.code == 200 && !this.$u.test.isEmpty(data)) {
let region = []
if(data.provinceName && data.cityName && data.districtName) {
region = [data.provinceName, data.cityName, data.districtName]
}
this.info = {
name: data.name,
mobile: data.mobile,
address: data.address,
region: region,
}
}
})
},
toAddSite(title){
const region = this.info.region.join('-')
this.$u.route({
url: 'pages/mine/address/addSite',
params: {
title: title
type: 'edit',
region: region,
name: this.info.name,
mobile: this.info.mobile,
address: this.info.address,
}
})
}
......@@ -71,48 +90,10 @@ export default {
.address-wrap {
background-color: #F4F5F7;
}
.item {
.body {
padding: 30rpx;
margin: 30rpx;
padding: 50rpx 30rpx 48rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
border-radius: 12px;
.top {
display: flex;
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 32rpx;
.phone {
margin-left: 20rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
}
}
.bottom {
display: flex;
margin-top: 24rpx;
justify-content: space-between;
align-items: flex-start;
font-size: 28rpx;
font-weight: 400;
color: #333333;
.address{
max-width: 500rpx;
line-height: 40rpx;
}
}
.default {
border-top: 2rpx solid #F4F5F7;
margin-top: 22rpx;
padding-top: 30rpx;
.txt {
margin-left: 12rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
}
}
}
</style>
<template>
<!-- 设置 -->
<view class="setting-view">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="设置" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<view class="list-view">
<u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)">
<image slot="icon" :src="item.icon" :style="item.imageStyle"></image>
<view slot="title" class="item-title">{{item.title}}</view>
<view slot="value" class="item-value">{{value}}</view>
</u-cell-item>
</view>
</u-cell-group>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
computed: {
items() {
return [
{
pathName: 'about',
title: '当前版本',
value: process.uniEnv.version,
icon: process.uniEnv.qn_base_url + 'version.png',
imageStyle: 'width:32rpx;height:32rpx'
}
]
}
},
onLoad() {
getApp().trackPage('设置')
},
methods: {
handleClick(path) {
if(this.vuex_token) {
if (path === 'about') {
getApp().updateApp(1)
return
}
this.$u.route({
url: 'pages/mine/' + path + '/index'
})
} else {
this.$u.route({url: "pages/login/index"})
}
},
}
};
</script>
<style lang="scss" scoped>
.setting-view {
padding-bottom: 44px;
height: 100vh;
display: flex;
flex-direction: column;
background-color: #F4F5F7;
.list-view {
height: 100%;
margin-top: 30rpx;
.item-title {
font-size: 32rpx;
color: #333333;
margin-left: 16rpx;
line-height: 32rpx;
}
.item-value {
font-size: 26rpx;
color: #999999;
}
.line-view {
height: 2rpx;
background-color: #F4F5F7;
margin: 30rpx;
}
}
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment