Commit db22cdc3 authored by Morson's avatar Morson

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

# Conflicts:
#	src/common/api/parts.js
parents fa906c14 01db4852
let partsApiFun = function(vm){ let partsApiFun = function (vm) {
// 接口公共前缀 // 接口公共前缀
const prefix = '/wxh-worker-rest/rest/' const prefix = '/wxh-worker-rest/rest/'
const coverage = '/wxh-worker-rest/rest/coverage/' const coverage = '/wxh-worker-rest/rest/coverage/'
const parts = '/wxh-worker-rest/rest/parts/' const parts = '/wxh-worker-rest/rest/parts/'
const base = '/wxh-worker-rest/rest/base/' const base = '/wxh-worker-rest/rest/base/'
/** /**
* 配件申请单-查询网点地址信息 * 配件申请单-查询网点地址信息
*/ */
...@@ -21,25 +21,31 @@ let partsApiFun = function(vm){ ...@@ -21,25 +21,31 @@ let partsApiFun = function(vm){
* 配件过滤-品牌列表 * 配件过滤-品牌列表
*/ */
let getBrandList = async (params = {}) => await vm.$u.get(base + vm.vuex_token + '/allow/brand/list', params); 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', params); let getPartsList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/parts', params);
/** /**
* 配件申请单-创建申请单/使用备件 * 配件申请单-创建申请单/使用备件
*/ */
let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params) let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params)
/**
* 查询自己的备件仓
*/
let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
const partsApi = { const partsApi = {
getSiteAddress, getSiteAddress,
updateAddress, updateAddress,
getCategoryList, getCategoryList,
getBrandList, getBrandList,
getPartsList, getPartsList,
applyParts applyParts,
getMyReserve
} }
return partsApi return partsApi
} }
module.exports = { module.exports = {
partsApiFun partsApiFun
} }
\ No newline at end of file
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
case '-1': // 审核未通过 case '-1': // 审核未通过
return '#FA5A49' return '#FA5A49'
case '1': // 已取消 case '1': // 已取消
return '#666666' return '#333333'
default: default:
return '#2272FF' return '#2272FF'
} }
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
quantity: 1, quantity: 1,
min: 1, min: 1,
max: 100, max: 100,
image: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png", images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false, checked: false,
disabled: true disabled: true
}, },
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
quantity: 3, quantity: 3,
min: 1, min: 1,
max: 5, max: 5,
image: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png", images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false, checked: false,
disabled: true disabled: true
}, },
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
height: 50rpx;
overflow: hidden;
} }
.right-content-desc { .right-content-desc {
font-size: 24rpx; font-size: 24rpx;
...@@ -105,6 +107,7 @@ ...@@ -105,6 +107,7 @@
color: #999; color: #999;
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
height: 36rpx;
} }
.num { .num {
flex: 1; flex: 1;
......
<template> <template>
<view class="u-flex bottom"> <view class="u-flex bottom" :style="customStyle">
<view class="u-flex bottom-left" v-if="showChecked"> <view class="select-view">
<view class="left-list"><u-checkbox v-model="checked" @change="selectAll" shape="circle" width="30rpx" /></view> <view class="u-flex bottom-left" v-if="showChecked">
<view class="left-list">全选</view> <view class="left-list"><u-checkbox icon-size="30" size="40" v-model="checked" @change="selectAll" shape="circle"/></view>
</view> <view class="left-list">全选</view>
<view class="u-flex bottom-center"> </view>
<view class="center-list">已选择 {{ partNum }} 种配件</view> <view class="u-flex bottom-center">
<view class="center-list">合计 <text class="num"> {{ num }} </text> 件</view> <view class="center-list">已选择 {{ partNum }} 种</view>
</view> <view class="center-list">合计:<text class="num"> {{ num }} </text> 件</view>
</view>
</view>
<view class="u-flex bottom-right"> <view class="u-flex bottom-right">
<button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button> <button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button>
</view> </view>
...@@ -53,6 +55,10 @@ ...@@ -53,6 +55,10 @@
return '确定' return '确定'
} }
} }
},
customStyle: {
type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;'
}, },
data() { data() {
return { return {
...@@ -86,28 +92,33 @@ ...@@ -86,28 +92,33 @@
.bottom { .bottom {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
background: #fff; // background: #fff;
justify-content: space-between; justify-content: space-between;
.u-flex { .u-flex {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.select-view {
display: flex;
align-items: center;
}
.bottom-left { .bottom-left {
margin-left: 30rpx; // margin-left: 30rpx;
.left-list { .left-list {
width: 100%; width: 100%;
&:nth-of-type(1) { &:nth-of-type(1) {
padding-left: 10rpx; padding-left: 3rpx;
} }
&:nth-of-type(2) { &:nth-of-type(2) {
padding-top: 20rpx; margin-top: 8rpx;
font-size: 20rpx;
} }
} }
} }
.bottom-center { .bottom-center {
flex: 1; flex: 1;
align-items: flex-start; align-items: flex-start;
margin: 0 20rpx; // margin: 0 20rpx;
.center-list { .center-list {
&:nth-of-type(1) { &:nth-of-type(1) {
color: #666; color: #666;
...@@ -115,18 +126,19 @@ ...@@ -115,18 +126,19 @@
} }
&:nth-of-type(2) { &:nth-of-type(2) {
color: #333; color: #333;
font-size: 28rpx; font-size: 32rpx;
margin-top: 20rpx; margin-top: 8rpx;
font-weight: bold;
.num { .num {
color: #2272FF; color: #2272FF;
padding: 0 10rpx; padding-right: 10rpx;
} }
} }
} }
} }
.bottom-right { .bottom-right {
width: 340rpx; width: 360rpx;
margin-right: 20rpx; // margin-right: 20rpx;
.btn { .btn {
width: 100%; width: 100%;
padding: 30rpx; padding: 30rpx;
......
...@@ -262,6 +262,22 @@ ...@@ -262,6 +262,22 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "我的备件",
"enablePullDownRefresh": false
}
},
{
"path": "warehouse/return",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "返件信息",
"enablePullDownRefresh": false
}
},
{ {
"path": "warehouse/searchParts", "path": "warehouse/searchParts",
"style": { "style": {
...@@ -276,7 +292,8 @@ ...@@ -276,7 +292,8 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": " ", // 配件单物流 "navigationBarTitleText": " ", // 配件单物流
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
} }
}, },
{ {
......
...@@ -17,23 +17,32 @@ ...@@ -17,23 +17,32 @@
</view> </view>
</view> </view>
<view v-if="showSuperButton" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view> <view v-if="showSuperButton" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view>
<view class="ware-house-view">
<view class="ware-house-title">我的仓库</view>
<view class="ware-house-content">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
<image :src="item.icon" class="ware-house-image"></image>
<view>{{item.title}}</view>
</view>
</view>
</view> </view>
<view class="list-view"> <view class="list-view">
<view v-for="(group, ind) in items" :key="ind" class="group-view">
<u-cell-group :border="false"> <u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index"> <view v-for="(item, index) in group" :key="index.pathName">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)"> <u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)">
<image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image> <image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image>
<view slot="title" class="item-title">{{item.title}}</view> <view slot="title" class="item-title">{{item.title}}</view>
<view slot="value" class="item-value">{{value}}</view> <view slot="value" class="item-value">{{value}}</view>
</u-cell-item> </u-cell-item>
<view v-if="index == 3" class="line-view"></view>
</view> </view>
</u-cell-group> </u-cell-group>
</view>
</view> </view>
</view> </view>
<u-modal v-model="show" :content="content" show-cancel-button @confirm="logout"></u-modal> <u-modal v-model="show" :content="content" show-cancel-button @confirm="logout"></u-modal>
</view> </view>
</template> </template>
...@@ -67,63 +76,84 @@ ...@@ -67,63 +76,84 @@
}, },
items() { items() {
return [ return [
{ [{
pathName: 'wallet', pathName: 'wallet/index',
title: '我的钱包', title: '我的钱包',
value: '', value: '',
icon: 'qianbao.png', icon: 'qianbao.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ {
pathName: 'deposit', pathName: 'deposit/index',
title: '配件押金', title: '配件押金',
value: '', value: '',
icon: 'yajin.png', icon: 'yajin.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
{ {
pathName: 'contract', pathName: 'contract/index',
title: '我的合同', title: '我的合同',
value: '', value: '',
icon: 'hetong.png', icon: 'hetong.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ {
pathName: 'cert', pathName: 'cert/index',
title: '我的证件', title: '我的证件',
value: '', value: '',
icon: 'zhengjian.png', icon: 'zhengjian.png',
imageStyle: 'width:36rpx;height:28rpx' imageStyle: 'width:36rpx;height:28rpx'
}, }],[
{ {
pathName: 'address', pathName: 'address/index',
title: '收货地址', title: '收货地址',
value: '', value: '',
icon: 'wddizhi.png', icon: 'wddizhi.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
// {
// pathName: 'warehouse',
// title: '我的仓库',
// value: '',
// icon: 'cangku.png',
// imageStyle: 'width:36rpx;height:32rpx'
// },
{ {
pathName: 'warehouse', pathName: 'customer/index',
title: '我的仓库',
value: '',
icon: 'cangku.png',
imageStyle: 'width:36rpx;height:32rpx'
},
{
pathName: 'customer',
title: '联系客服', title: '联系客服',
value: this.serviceTel, value: this.serviceTel,
icon: 'lxkefu.png', icon: 'lxkefu.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, }]
{
pathName: 'about',
title: '版本更新',
value: process.uniEnv.version,
icon: 'version.png',
imageStyle: 'width:32rpx;height:32rpx'
}
] ]
},
warehouseItems() {
return [
{
pathName: 'warehouse/index',
title: '我的配件',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/spare',
title: '我的备件',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/return',
title: '返件信息',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/records',
title: '出入库记录',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
]
}, },
telTip() { telTip() {
return this.mobile || '绑定手机号' return this.mobile || '绑定手机号'
...@@ -162,12 +192,8 @@ ...@@ -162,12 +192,8 @@
}, },
handleClick(path) { handleClick(path) {
if(this.vuex_token) { if(this.vuex_token) {
if (path === 'about') {
app.updateApp(1)
return
}
this.$u.route({ this.$u.route({
url: 'pages/mine/' + path + '/index' url: 'pages/mine/' + path
}) })
} else { } else {
this.$u.route({url: "pages/login/index"}) this.$u.route({url: "pages/login/index"})
...@@ -209,7 +235,7 @@ ...@@ -209,7 +235,7 @@
position: relative; position: relative;
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
background-color: #FFFFFF; background-color: #F4F5F7;
.header-image { .header-image {
position: absolute; position: absolute;
...@@ -225,12 +251,12 @@ ...@@ -225,12 +251,12 @@
} }
.mine-content { .mine-content {
position: relative; position: relative;
padding: 30rpx;
.header-view { .header-view {
padding: 30rpx 30rpx 80rpx 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 60rpx;
.head-image { .head-image {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
...@@ -279,31 +305,63 @@ ...@@ -279,31 +305,63 @@
.super-button { .super-button {
margin-left: 20rpx; margin-left: 20rpx;
} }
}
.ware-house-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx;
height: 240rpx;
.ware-house-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin-bottom: 12rpx;
}
.ware-house-content {
display: flex;
justify-content: space-around;
align-items: center;
.ware-house-content-item {
color: #333333;
font-size: 26rpx;
text-align: center;
.ware-house-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 12rpx;
}
}
}
} }
.list-view { .list-view {
background-color: #FFFFFF;
border-radius: 32rpx 32rpx 0 0; .group-view {
overflow: hidden; margin-top: 20rpx;
padding-top: 16rpx; background-color: #FFFFFF;
border-radius: 12rpx;
.item-title { overflow: hidden;
font-size: 32rpx; .item-title {
color: #333333; font-size: 32rpx;
margin-left: 16rpx; color: #333333;
line-height: 32rpx; margin-left: 16rpx;
} line-height: 32rpx;
}
.item-value {
font-size: 26rpx; .item-value {
color: #999999; font-size: 26rpx;
} color: #999999;
}
.line-view {
height: 2rpx; .line-view {
background-color: #F4F5F7; height: 2rpx;
margin: 30rpx; background-color: #F4F5F7;
margin: 30rpx;
}
} }
} }
} }
......
<template> <template>
<view class="parts-detail"> <view class="parts-detail">
<u-navbar back-icon-color="#333333" background="#F4F5F7" title="物流信息" titleColor="#333333" :border-bottom="false" title-bold> <u-navbar back-icon-color="#333333" background="#F4F5F7" title="物流信息" titleColor="#333333"
:border-bottom="false" title-bold>
</u-navbar> </u-navbar>
<view class="content-view"> <view class="content-view">
<view class="contacts-view"> <view class="contacts-view">
<view><image class="image-view" :src="imageUrl"></image></view> <view>
<view class="right-view"> <image class="image-view" :src="imageUrl"></image>
<view class="title-view">{{title}}</view> </view>
<view>{{'物流公司:' + info.express.com}}</view> <view class="right-view">
<view class="number-view"> <view class="title-view">{{title}}</view>
<text>{{'物流单号:' + info.express.number}}</text> <view>{{'物流公司:' + info.express.com}}</view>
<text class="copy-view" @click="$u.throttle(handleClick, 500)">复制</text> <view class="number-view">
</view> <text>{{'物流单号:' + info.express.number}}</text>
</view> <text class="copy-view" @click="$u.throttle(handleClick, 500)">复制</text>
</view> </view>
<view class="record-view"> </view>
</view>
<view class="record-view">
<view class="express-record-list">
<view class="dashed-line-view"></view>
<view class="express-list">
<view v-for="(item, index) in logisticsRecords" :key="index" class="order-cell">
<view class="node-view">
<view :class="['node-border-view', {'first': index == 0}]">
<view :class="['node-middle-view', {'first': index == 0}]"></view>
</view>
</view>
<view class="right-view">
<view class="line-view-time">
<text>{{item.datetime}}</text>
</view>
<view class="line-view-context">
<text>{{item.context}}</text>
</view>
</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
...@@ -26,7 +48,10 @@ ...@@ -26,7 +48,10 @@
export default { export default {
data() { data() {
return { return {
info: {items:[], express: []}, info: {
items: [],
express: []
},
logisticsRecords: [], // 物流 logisticsRecords: [], // 物流
}; };
}, },
...@@ -44,10 +69,10 @@ ...@@ -44,10 +69,10 @@
'-1': '审核未通过', '-1': '审核未通过',
'1': '已取消' '1': '已取消'
} }
}, },
imageUrl() { imageUrl() {
let item = this.info.items[0] || {} let item = this.info.items[0] || {}
return item.images ? item.images.split(',').shift() : this.placeholderImage return item.images ? item.images.split(',').shift() : this.placeholderImage
}, },
titleColor() { titleColor() {
switch (String(this.info.status)) { switch (String(this.info.status)) {
...@@ -60,11 +85,11 @@ ...@@ -60,11 +85,11 @@
} }
}, },
total() { // 合计 total() { // 合计
var i = 0 var i = 0
for (var item of this.info.items) { for (var item of this.info.items) {
i += item.quantity i += item.quantity
} }
return i return i
}, },
placeholderImage() { placeholderImage() {
...@@ -72,13 +97,12 @@ ...@@ -72,13 +97,12 @@
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('配件单物流信息') getApp().trackPage('配件单物流信息')
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length >= 2) { if (pages.length >= 2) {
var page = pages[pages.length - 2]; var page = pages[pages.length - 2];
console.log('-------page.info------', page.info) this.info = page.info
this.info = page.info }
}
this.getLogistics() this.getLogistics()
}, },
methods: { methods: {
...@@ -139,8 +163,8 @@ ...@@ -139,8 +163,8 @@
} }
} }
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.records) { if (res.data && res.data.expressInfo && res.data.expressInfo.records) {
this.logisticsRecords = res.data.records this.logisticsRecords = res.data.expressInfo.records
} }
} else { } else {
console.log(res.message) console.log(res.message)
...@@ -148,13 +172,13 @@ ...@@ -148,13 +172,13 @@
}); });
}, },
handleClick() { handleClick() {
uni.setClipboardData({ uni.setClipboardData({
data: this.info.orderNumber, data: this.info.orderNumber,
success: function() { success: function() {
console.log('success'); console.log('success');
} }
}); });
} }
} }
}; };
...@@ -168,50 +192,133 @@ ...@@ -168,50 +192,133 @@
background-color: #F4F5F7; background-color: #F4F5F7;
height: 100vh; height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.content-view { .content-view {
padding: 30rpx; padding: 30rpx;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
.contacts-view { .contacts-view {
padding: 30rpx; padding: 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
.image-view {
width: 120rpx; .image-view {
height: 120rpx; width: 120rpx;
border-radius: 12rpx; height: 120rpx;
} border-radius: 12rpx;
.right-view { }
font-size: 26rpx;
color: #333333; .right-view {
padding-left: 30rpx; font-size: 26rpx;
width: 100%; color: #333333;
.title-view { padding-left: 30rpx;
font-weight: bold; width: 100%;
.title-view {
font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
} margin-bottom: 12rpx;
.number-view { }
display: flex;
justify-content: space-between; .number-view {
align-items: center; display: flex;
.copy-view { justify-content: space-between;
color: #2272FF; align-items: center;
padding-left: 30rpx; margin-top: 12rpx;
} .copy-view {
} color: #2272FF;
} padding-left: 30rpx;
flex-shrink: 0;
}
}
}
} }
.record-view {
background-color: #FFFFFF; .record-view {
border-radius: 12rpx; background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx 30rpx 0 30rpx;
position: relative;
display: flex;
justify-content: space-between;
.express-record-list {
position: relative;
.dashed-line-view {
position: absolute;
width: 2rpx;
border-left: 1px dashed #999999;
height: calc(100% - 64rpx);
top: 14rpx;
left: 11rpx;
}
.express-list {
width: 100%;
.order-cell {
margin-bottom: 50rpx;
display: flex;
.node-view {
margin-right: 18rpx;
flex-shrink: 0;
margin-top: 8rpx;
z-index: 1;
.node-border-view {
border: 2rpx solid #999999;
border-radius: 11rpx;
width: 22rpx;
height: 22rpx;
padding: 5rpx;
background-color: #FFFFFF;
&.first {
border: 2rpx solid #2272FF;
}
.node-middle-view {
width: 10rpx;
height: 10rpx;
background-color: #999999;
border-radius: 6rpx;
&.first {
background-color: #2272FF;
}
}
}
}
.right-view {
width: 100%;
.line-view-time {
font-size: 28rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.line-view-context {
font-size: 26rpx;
color: #666666;
}
}
}
}
}
} }
} }
......
<template> <template>
<!-- 我的配件 -->
<view class="ware-house"> <view class="ware-house">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="我的仓库" titleColor="#333333" <u-navbar back-icon-color="#333333" background="#FFFFFF" title="我的配件" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
<!-- <view class="tools-box"> <!-- <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="detail-info-view"> <view class="detail-info-view">
<view v-for="(value, key) in detailKey" :key="key" class="info-item"> <view v-for="(value, key) in detailKey" :key="key" class="info-item">
<view class="detail-left-view"> <view class="detail-left-view">
<text>{{ value }}:</text> <text>{{ value }}</text>
<text @longpress="handleLongpress(key, detail[key] )">{{ detail[key] }}</text> <text @longpress="handleLongpress(key, detail[key] )">{{ detail[key] }}</text>
</view> </view>
<text class="copy-view" v-if="key == 'orderNumber'" @click="$u.throttle(handleClickCopy, 500)"> <text class="copy-view" v-if="key == 'orderNumber'" @click="$u.throttle(handleClickCopy, 500)">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<text class="amount-view">{{total}}</text> <text class="amount-view">{{total}}</text>
<text>件</text> <text>件</text>
</view> </view>
<u-button v-if="buttonText" :custom-style="customStyle" shape="circle" @click="handleClick" type="primary"> <u-button :custom-style="customStyle" shape="circle" @click="handleClick" type="primary">
{{buttonText}} {{buttonText}}
</u-button> </u-button>
</view> </view>
...@@ -131,9 +131,9 @@ ...@@ -131,9 +131,9 @@
}, },
detailKey() { // 详情 detailKey() { // 详情
return { return {
'orderNumber': '申请单号', 'orderNumber': '申请单号:',
'createTime': '申请时间', 'createTime': '申请时间:',
'deliveryTime': '发货时间', 'deliveryTime': '发货时间:',
} }
} }
}, },
...@@ -207,7 +207,8 @@ ...@@ -207,7 +207,8 @@
.express-view { .express-view {
color: #2272FF; color: #2272FF;
font-size: 26rpx; font-size: 26rpx;
margin-bottom: 6rpx;
} }
} }
...@@ -279,7 +280,7 @@ ...@@ -279,7 +280,7 @@
.left-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: flex-start;
.image-view { .image-view {
width: 120rpx; width: 120rpx;
......
This diff is collapsed.
This diff is collapsed.
<template> <template>
<view class="u-flex det-wrap"> <view class="u-flex det-wrap">
<view class="search">
<u-search
:clearabled="true"
:action-style="searchStyle"
bg-color="#fff"
v-model="keyword"
@custom="searchParts"
@search="searchParts"
></u-search>
</view>
<view class="content" v-if="lists.length > 0"> <view class="content" v-if="lists.length > 0">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<select-parts <select-parts
...@@ -9,7 +20,6 @@ ...@@ -9,7 +20,6 @@
:show-checked="true" :show-checked="true"
@numChange="numChange($event, index)" @numChange="numChange($event, index)"
@selectChange="selectChange($event, index)" @selectChange="selectChange($event, index)"
@apply="apply(index)"
></select-parts> ></select-parts>
</scroll-view> </scroll-view>
</view> </view>
...@@ -27,7 +37,7 @@ ...@@ -27,7 +37,7 @@
<submit-bar <submit-bar
:partNum="partNum" :partNum="partNum"
:num="num" :num="num"
:btnStatus="btnStatus" :btnStatus="partNum > 0"
:allChecked="allChecked" :allChecked="allChecked"
@select="allSelect" @select="allSelect"
@submit="submit" @submit="submit"
...@@ -46,48 +56,23 @@ ...@@ -46,48 +56,23 @@
}, },
data() { data() {
return { return {
lists: [ lists: [],
{ keyword: ''
id: 1,
name: "正泰漏保",
no: 'NO.202006170015',
desc: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
num: 1,
min: 1,
max: 100,
img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
},
{
id: 1,
name: "挚达广汽充电桩",
no: 'NO.202006170014',
desc: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
num: 3,
min: 1,
max: 5,
img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
}
],
val: []
} }
}, },
computed: { computed: {
searchStyle() {
return {
color: "#2272FF"
};
},
// 配件数 // 配件数
partNum() { partNum() {
return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0) return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
}, },
// 总数 // 总数
num() { num() {
return this.lists.reduce((counter, { checked, num }) => checked ? counter += num : counter, 0) return this.lists.reduce((counter, { checked, quantity }) => checked ? counter += quantity : counter, 0)
},
// 按钮状态
btnStatus() {
const count = this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
return count > 0 || false
}, },
// 全选状态 // 全选状态
allChecked() { allChecked() {
...@@ -95,12 +80,34 @@ ...@@ -95,12 +80,34 @@
return count === 0 || false return count === 0 || false
} }
}, },
created() {
this.getReserve()
},
methods: { methods: {
apply(index) { getReserve() {
this.$set(this.lists[index], 'disabled', false) const params = {
keyword: this.keyword
}
this.$u.api.getMyReserve(params).then(res => {
if (res.code === 200) {
const data = res.data || []
this.lists = data.map(v => {
v.min = 1
v.max = v.stock
v.checked = false
v.quantity = v.stock
return v
})
}
})
},
// 搜索配件
searchParts(val) {
this.keyword = val
this.getReserve()
}, },
numChange(val, index) { numChange(val, index) {
this.$set(this.lists[index], 'num', val) this.$set(this.lists[index], 'quantity', val)
}, },
selectChange(val, index) { selectChange(val, index) {
this.$set(this.lists[index], 'checked', val) this.$set(this.lists[index], 'checked', val)
...@@ -112,7 +119,16 @@ ...@@ -112,7 +119,16 @@
}) })
}, },
submit() { submit() {
console.log('submit') let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
const lists = this.lists.filter(v => v.checked).map(v => {
return {
part_id: v.skuId,
quantity: v.quantity
}
})
console.log(lists)
}, },
qnFile(src) { qnFile(src) {
return process.uniEnv.qn_base_url + src return process.uniEnv.qn_base_url + src
...@@ -123,11 +139,15 @@ ...@@ -123,11 +139,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.det-wrap { .det-wrap {
background: #fff;
flex-flow: column; flex-flow: column;
height: 100vh; height: 100vh;
.search {
width: 100%;
padding: 30rpx;
}
.content { .content {
border-radius: 12rpx; background: #fff;
border-radius: 30rpx 30rpx 0 0;
padding: 10rpx 10rpx 0 10rpx; padding: 10rpx 10rpx 0 10rpx;
width: 100%; width: 100%;
flex: 1; flex: 1;
......
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
submit() { submit() {
const lists = this.lists.filter(v => !v.disabled).map(v => { const lists = this.lists.filter(v => !v.disabled).map(v => {
return { return {
part_id: v.id, part_id: v.skuId,
quantity: v.quantity quantity: v.quantity
} }
}) })
......
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