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/'
...@@ -30,13 +30,19 @@ let partsApiFun = function(vm){ ...@@ -30,13 +30,19 @@ let partsApiFun = function(vm){
*/ */
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
} }
......
...@@ -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="select-view">
<view class="u-flex bottom-left" v-if="showChecked"> <view class="u-flex bottom-left" v-if="showChecked">
<view class="left-list"><u-checkbox v-model="checked" @change="selectAll" shape="circle" width="30rpx" /></view> <view class="left-list"><u-checkbox icon-size="30" size="40" v-model="checked" @change="selectAll" shape="circle"/></view>
<view class="left-list">全选</view> <view class="left-list">全选</view>
</view> </view>
<view class="u-flex bottom-center"> <view class="u-flex bottom-center">
<view class="center-list">已选择 {{ partNum }} 种配件</view> <view class="center-list">已选择 {{ partNum }} 种</view>
<view class="center-list">合计 <text class="num"> {{ num }} </text> 件</view> <view class="center-list">合计:<text class="num"> {{ num }} </text> 件</view>
</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>
...@@ -54,6 +56,10 @@ ...@@ -54,6 +56,10 @@
} }
} }
}, },
customStyle: {
type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;'
},
data() { data() {
return { return {
checked: false checked: false
...@@ -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
} }
}, },
{ {
......
...@@ -18,22 +18,31 @@ ...@@ -18,22 +18,31 @@
</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>
<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 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,62 +76,83 @@ ...@@ -67,62 +76,83 @@
}, },
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'
}]
]
},
warehouseItems() {
return [
{
pathName: 'warehouse/index',
title: '我的配件',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
}, },
{ {
pathName: 'about', pathName: 'warehouse/spare',
title: '版本更新', title: '我的备件',
value: process.uniEnv.version, value: '',
icon: 'version.png', icon: process.uniEnv.qn_base_url + 'cangku.png',
imageStyle: 'width:32rpx;height:32rpx' },
} {
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() {
...@@ -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;
...@@ -226,11 +252,11 @@ ...@@ -226,11 +252,11 @@
.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;
...@@ -280,13 +306,43 @@ ...@@ -280,13 +306,43 @@
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 {
.group-view {
margin-top: 20rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 32rpx 32rpx 0 0; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
padding-top: 16rpx;
.item-title { .item-title {
font-size: 32rpx; font-size: 32rpx;
color: #333333; color: #333333;
...@@ -305,6 +361,8 @@ ...@@ -305,6 +361,8 @@
margin: 30rpx; 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>
<image class="image-view" :src="imageUrl"></image>
</view>
<view class="right-view"> <view class="right-view">
<view class="title-view">{{title}}</view> <view class="title-view">{{title}}</view>
<view>{{'物流公司:' + info.express.com}}</view> <view>{{'物流公司:' + info.express.com}}</view>
...@@ -15,7 +18,26 @@ ...@@ -15,7 +18,26 @@
</view> </view>
</view> </view>
<view class="record-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>
...@@ -26,7 +48,10 @@ ...@@ -26,7 +48,10 @@
export default { export default {
data() { data() {
return { return {
info: {items:[], express: []}, info: {
items: [],
express: []
},
logisticsRecords: [], // 物流 logisticsRecords: [], // 物流
}; };
}, },
...@@ -76,7 +101,6 @@ ...@@ -76,7 +101,6 @@
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()
...@@ -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)
...@@ -184,34 +208,117 @@ ...@@ -184,34 +208,117 @@
align-items: flex-start; align-items: flex-start;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
.image-view { .image-view {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 12rpx; border-radius: 12rpx;
} }
.right-view { .right-view {
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
padding-left: 30rpx; padding-left: 30rpx;
width: 100%; width: 100%;
.title-view { .title-view {
font-weight: bold; font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
margin-bottom: 12rpx;
} }
.number-view { .number-view {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-top: 12rpx;
.copy-view { .copy-view {
color: #2272FF; color: #2272FF;
padding-left: 30rpx; padding-left: 30rpx;
flex-shrink: 0;
} }
} }
} }
} }
.record-view { .record-view {
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; 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': '发货时间:',
} }
} }
}, },
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
.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