Commit bbbb5319 authored by Facius's avatar Facius

Merge branch 'dev' into test

parents 48c237ad 9abcf5ea
......@@ -62,6 +62,9 @@
</view>
<!-- 不是从我的页面进来才显示 -->
<template v-if="!isFromMine">
<view>
<u-toast ref="uToast" />
</view>
<BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons>
<take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo>
<!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> -->
......@@ -557,7 +560,7 @@
}
},
handleClickSure() {
if (this.submitType == 'orderAccept' || this.submitType == 'orderGan') {
if ((this.submitType == 'orderAccept' || this.submitType == 'orderGan') && process.uniEnv.node_env == 'prod') {
this.$u.api.checkAddCustomer().then((res) => {
if (res.code == 200) {
if(res.data === true){
......
<template>
<view class="doc-tag">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="安装文件" titleColor="#333333"
<u-navbar back-icon-color="#333333" background="#FFFFFF" :title="titles[type]" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- 合作商或品牌标签列表 -->
<view class="label-content">
......@@ -20,38 +20,56 @@
data() {
return {
labels: [], // 标签列表
selectedId: ''
selectedId: '',
type: '1'
};
},
onLoad(e) {
if (e && e.selectedId) {
this.selectedId = e.selectedId
}
if (e && e.partnerCompanyId) { // 合作商id
this.tagTitle = '品牌'
this.loadFileLabel('2', e.partnerCompanyId)
this.type = '2'
this.loadFileLabel(e.partnerCompanyId)
} else { // 获取所有文件资料
this.tagTitle = '合作商'
this.loadFileLabel('1')
this.type = '1'
this.loadFileLabel()
}
},
computed:{
titles() {
return ['合作商', '品牌']
}
},
methods: {
// 选中标签
handleClick(key, label) {
handleClick(label) {
this.selectedId = label.id
// 向上个页面传值
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.selectedItem= {
type: this.type,
id: this.selectedId
}
}
uni.navigateBack()
},
// 获取合作商列表
async loadFileLabel(type, partnerCompanyId) {
async loadFileLabel(partnerCompanyId) {
let param = {
type: type, // 1:合作商标签,2:品牌标签
}
if (type == '2') {
param.partnerCompanyId = partnerCompanyId // 合作商的标签id
type: this.type, // 1:合作商标签,2:品牌标签
}
if (this.type == '2') {
param.partnerCompanyId = partnerCompanyId // 品牌的时候有效
}
let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) {
this.labels = res.data || []
// this.labels = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
}
},
......@@ -70,7 +88,8 @@
width: 100%;
display: flex;
align-items: center;
overflow: auto;
overflow: auto;
flex-wrap: wrap;
padding: 0 10rpx 44rpx 30rpx;
.label-item {
......@@ -79,7 +98,7 @@
.label-normal {
height: 104rpx;
width: 200rpx;
width: 216rpx;
font-size: 26rpx;
color: #666666;
background-color: #FFFFFF;
......
......@@ -121,6 +121,20 @@
this.loadFileLabel('1')
}
},
onShow() {
// 从标签列表页面返回,获取选中的标签
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let selectedItem = page.selectedItem;
if (selectedItem) {
for (var item of this.labels[selectedItem.type]) {
if (item.id == selectedItem.id) {
this.handleClick(selectedItem.type, item)
return
}
}
}
},
methods: {
// 选中标签
......
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