Commit bbbb5319 authored by Facius's avatar Facius

Merge branch 'dev' into test

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