Commit 504a5596 authored by 李星剑's avatar 李星剑

提交

parent 6c6c64be
<template>
<view class="shopro-tabbar-wrap" v-if="tabbarList && tabbarList.length && showTabbar">
<view class="navbar" :style="{ background: tabbarData.bgcolor || '#fff' }">
<view class="navbar-item" v-for="(tab, index) in tabbarList"
:key="tab.name" @tap="switchTabbar(tab, index)"
:class="[tab.path === currentPath ? 'active':'']">
<div class="image">
<img :src="tab.path === currentPath ? tab.activeImage : tab.image" style="height: 100%;width: 100%;"/>
<div class="num" v-if="tab.message && cartNum">
{{cartNum}}
</div>
</div>
<div class="text">{{tab.name}}</div>
</view>
</view>
</view>
</template>
<script>
/**
* 自定义底部导航
* @property {Array} tabbarList - vuex初始化的底部导航数据
* @property {String} currentPath -computed解析当前页面路径。
*/
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
import { router } from '@/config/router';
export default {
name: 'hsTabBar',
components: {},
data() {
return {
currentPath: '', //当前页面路径
cartNum: '100',
tabbarData: {
style: 1,
list: [
{ name: '首页', path: '/pages/home/index',activeImage: '',image:'' },
{ name: '消息', path: '',activeImage: '',image:'', message: 1 },
{ name: '我的', path: '/pages/user/center/index',activeImage: '',image:'' },
]
}
};
},
mounted() {
this.currentPath = this.$Route.path === '/pages/home/index' ? this.$Route.path : this.$Route.fullPath;
},
computed: {
// ...mapGetters(['cartNum', 'tabbarData']),
// 底部导航栏列表
tabbarList() {
if (this.tabbarData) {
return this.tabbarData.list;
}
},
// 后台tabbarList数据中必需含有'/pages/index/index',不然逻辑混乱
showTabbar() {
if (this.tabbarData && this.tabbarData.list) {
let arr = ['/pages/home/index'];
let path = '';
for (let item of this.tabbarData.list) {
arr.push(item.path);
}
return arr.includes(this.currentPath);
}
}
},
methods: {
// 切换tabbar
switchTabbar(tab, index) {
this.$tools.routerTo(tab.path, true);
}
}
};
</script>
<style lang="scss">
.shopro-tabbar-wrap {
height: calc(142rpx + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
position: relative;
width: 100%;
z-index: 70;
.tabbar-box {
position: fixed;
display: flex;
align-items: center;
width: 100%;
height: calc(100rpx + env(safe-area-inset-bottom) / 2);
border-top: 1rpx solid #eeeeee;
background-color: #fff;
z-index: 998;
bottom: 0;
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
.tabbar-item {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
.img-box {
position: relative;
.badge {
position: absolute;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
justify-content: center;
align-items: center;
line-height: 24rpx;
padding: 4rpx 10rpx;
border-radius: 100rpx;
color: #fff;
font-size: 24rpx;
z-index: 9;
background-color: $u-type-error;
transform: scale(0.8);
transform-origin: center center;
top: 0;
left: 46rpx;
white-space: nowrap;
}
}
.tabbar-icon {
width: 50rpx;
height: 50rpx;
display: block;
}
.tabbar-text {
font-size: 20rpx;
margin-top: 4rpx;
}
}
}
}
.navbar{
//position: absolute;
//left: 0;
//bottom: 0;
//background: #fff;
width: 100%;display: flex; flex: 1;
position: fixed;
display: flex;
align-items: center;
//width: 100%;
height: calc(120rpx + env(safe-area-inset-bottom) / 2);
border-top: 1rpx solid #eeeeee;
background-color: #fff;
z-index: 998;
bottom: 0;
padding-bottom: calc(env(safe-area-inset-bottom) / 2);
}
.navbar-item{
background: #fff;
text-align: center;
height: 60px;
position: relative;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.navbar-item .text{
font-size: 12px;
position: relative; z-index: 2;
}
.navbar-item .image{
height: 25px;
width: 25px; margin: 0 auto;
position: relative; z-index: 2;
}
.navbar-item.active::after{
position: absolute; content: "";
height: 71px;
width: 71px;
background: #fff; border-radius: 50%;
z-index: 1;
left: 0;
right: 0;
top: -11px;
margin: 0 auto;
bottom: 0;
}
.num{
position: absolute;
background: #af8d66;
right: -12px;
top: -6px;
width: 23px;
height: 16px; line-height: 16px;
color: #fff;border-radius: 9px;
}
</style>
let base = "/gdep-plm/materiallabel"
export default {
materialLabel:{
list:{
url: `${base}/labelListToApp`,
method: 'get'
},
save:{
url: `${base}/save`,
method: 'post'
},
}
}
......@@ -30,6 +30,15 @@ export default {
confirm:{
url: `${base}/confirm`,
method: "post",
}
},
// 保存修改 标签
saveOrUpdateLabel:{
url: `${base}/saveOrUpdateLabel`,
method: "post",
},
withdraw:{
url: `${base}/withdraw`,
method: "post",
},
}
}
let base = '/gdep-plm/modelingtaskcolorlibrary'
export default {
modelingTaskColorLibrary:{
list: {
url: `${base}/getAllList`,
method: 'get'
}
}
}
......@@ -9,6 +9,10 @@ import color from './apiList/colors.js'
import modeling from './apiList/modeling.js'
// 建模品类表接口
import modelingTaskCategory from './apiList/modelingTaskCategory.js'
// 标签接口
import materialLabel from './apiList/materialLabel.js'
// 颜色库接口
import modelingTaskColorLibrary from './apiList/modelingTaskColorLibrary'
import plm from './apiList/plm.js'
export default {
......@@ -18,5 +22,7 @@ export default {
// ...orderTicket,
...modeling,
...plm,
...modelingTaskCategory
...modelingTaskCategory,
...materialLabel,
...modelingTaskColorLibrary
};
......@@ -5,18 +5,19 @@ const state = {
token: uni.getStorageSync("token") || "",
isLogin: uni.getStorageSync("isLogin") || false, // 是否登陆
userInfo: uni.getStorageSync("userInfo") || {}, // 用户信息
tenanList: [
// {
// globalId: "1375592964957573120", tenantId: "1442659610786926593", subId: "1442659610786926600"
// }
] // 租户列表
Tabs: [
{
activeImage: '',
image: '',
}
]
}
const getters = {
token: state => state.token,
isLogin: state => state.isLogin,
userInfo: state => state.userInfo,
tenanList: state => state.tenanList,
Tabs: state => state.Tabs
}
const actions = {
......@@ -57,10 +58,7 @@ const mutations = {
userInfo(state, data) {
state.userInfo = data;
uni.setStorageSync("userInfo", data);
},
tenanList(state, payload) {
state.tenanList = payload
},
}
}
export default {
state,
......
......@@ -6,10 +6,10 @@
"versionCode" : "110",
"transformPx" : false,
"app-plus" : {
"compatible": {
"ignoreVersion": true
// true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
"compatible" : {
"ignoreVersion" : true
},
// true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
/* 5+App特有相关 */
"usingComponents" : true,
"splashscreen" : {
......@@ -41,27 +41,27 @@
"android" : {
/* android打包配置 */
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
......@@ -85,7 +85,8 @@
},
/* ios打包配置 */
"sdkConfigs" : {
"geolocation" : {}
"geolocation" : {},
"ad" : {}
}
},
"nvueLaunchMode" : ""
......@@ -131,7 +132,11 @@
"proxy" : {
"/dev" : {
// "target" : "http://47.96.138.212:8321",
"target" : "http://10.10.10.31/",
// "target" : "http://10.10.10.242/",
// "target" : "http://10.10.10.31/",
// "target" : "http://10.10.10.218/",
// "target" : "http://10.10.10.132/",
"target" : "http://octopus-dev.textile-saas.huansi.net/dev-api/",
"changeOrigin" : true,
"pathRewrite" : {
"^/dev" : ""
......@@ -141,3 +146,4 @@
}
}
}
export default {
methods:{
initEvent() {
// #ifdef APP-PLUS
uni.onNativeEventReceive((event, data)=>{
if(event === 'getTenantList'){
this.$store.commit("tenanList",JSON.parse(data))
// this.$store.tenanList = JSON.parse(data);
}else if(event === 'encryptToken'){
// this.token = data;
uni.setStorageSync('encryptToken', data);
this.login()
}
})
// #endif
},
getTenanList(){
// 向宿主App发送事件
uni.sendNativeEvent('getTenantList', {}, ret => {})
},
encryptToken(){
const active = this.list[this.selectedIndex];
uni.sendNativeEvent('encryptToken',JSON.stringify(
{
globalId: active.globalUserId,
tenantId: active.tenantId,
subId: active.id,
}
), ret => {})
},
triggerSelectItem(item){
this.selectedIndex = item;
},
login(){
// 核对
this.$http(
"auth.checkSecretKey",
uni.getStorageSync('encryptToken')
).then(res =>{
let {
code, data
} = res;
if(code === 200){
let {
userId, // 用户id
enterpriseId // 企业id
} = data;
this.userData = data;
uni.setStorageSync('tenantId', data.tenantId);
if(userId && enterpriseId){
this.createToken(data);
}else{
this.toRegister();
}
}
})
},
// 跳转到注册
toRegister(){
let {userId,enterpriseId,subId,tenantId} = this.userData;
this.$Router.push({
path: "/pages/user/register/stepSelectType",
query:{
pcUserId: userId || "",
pcBasicsId: enterpriseId || "",
tenantUserId:subId,
tenantId,
}
})
},
// 跳转到首页
toIndexPage(){
this.$Router.push({
path: "/pages/home/index"
})
},
checkStatus(data){
this.$http(
"user.checkMagStatus",{
pcUserId: data.userId,
pcBasicsId: data.enterpriseId,
}).then(res =>{
let { code ,data} = res;
if(code === 200){
// 1-面料供应商, 2-品牌商, 3-设计机构, 4-检测机构
let { identityType} = data.userLastIdentity;
if(identityType){
this.assignType = identityType;
this.filterStatus(data)
}
}
})
},
filterStatus(data){
// 0-未完善 1-已完善
let{
isBrandOwner, // 我要选款
isDesignAgency, // 完善设计机构信息
isFabricSupplier, //完善面料供应商信息
isTestingFacility, // 完善检测机构信息
} = data;
let { assignType} = this;
switch (assignType){
case "1":
isFabricSupplier ? this.toIndexPage() : this.toRegister();
return ;
case "2":
isBrandOwner ? this.toIndexPage() : this.toRegister();
return ;
case "3":
isDesignAgency ? this.toIndexPage() : this.toRegister();
return ;
case "4":
isTestingFacility ? this.toIndexPage() : this.toRegister();
return ;
default:
this.toRegister();
return;
}
},
createToken(data){
this.$http("auth.createTokenByApp" ,{
...{
identityType: uni.getStorageSync("identityType")
},
...data,
}).then(res =>{
let {
code, data
} = res;
if(code === 200){
uni.setStorageSync('token', data.accessToken);
uni.setStorageSync('pcUserId', data.userId);
uni.setStorageSync('pcBasicsId', data.enterpriseId);
// uni.setStorageSync('tenantId', this.userData.tenantId);
this.checkStatus(data);
}
})
},
next(){
this.encryptToken();
}
}
}
......@@ -4,6 +4,7 @@
"^hs-(.*)": "@/components/hs-$1/hs-$1.vue"
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/home/tenantSelection",
"style": {
......@@ -18,6 +19,90 @@
}
}
},
{
"path": "pages/user/login/login",
"style": {
"navigationBarTitleText": "模拟登录",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/user/center/index",
"style": {
"navigationBarTitleText": "用户中心",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/list",
"style": {
"navigationBarTitleText": "选择面料",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/selectType",
"style": {
"navigationBarTitleText": "选款",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/entrustList",
"style": {
"navigationBarTitleText": "款式委托上架单",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/entrustItem",
"style": {
"navigationBarTitleText": "款式委托上架单详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/entrustManagement",
"style": {
"navigationBarTitleText": "款式委托上架管理",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/entrustManagementItem",
"style": {
"navigationBarTitleText": "款式委托上架管理详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/material/createMaterial",
"style": {
"navigationBarTitleText": "搜款选择面料选款",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/user/register/stepSelectType",
"style": {
......@@ -106,16 +191,7 @@
}
},
{
"path": "pages/user/login/login",
"style": {
"navigationBarTitleText": "模拟登录",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/designCommissioned/splitItem",
"style": {
......@@ -277,6 +353,62 @@
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/fabricModeling/item",
"style": {
"navigationBarTitleText": "建模详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/reviewHistory",
"style": {
"navigationBarTitleText": "评审历史",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/imgList",
"style": {
"navigationBarTitleText": "指定面料颜色模型",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/tags",
"style": {
"navigationBarTitleText": "编辑标签",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
}
],
"globalStyle": {
......
......@@ -57,13 +57,13 @@
</view>
<!-- list -->
<view class="u-p-t-20 u-p-l-30 u-p-r-30 u-p-b-20">
<view v-if="!isEmpty" class="u-m-b-20 bd_rad1 u-p-30" @click="detaileCli(item)" v-for="item in entrustmentList" :key="item.id" style="background: #fff;">
<view v-if="!isEmpty" class="u-m-b-20 bd_rad1 u-p-30" @click="dateilEnt(item,'item')" v-for="item in entrustmentList" :key="item.id" style="background: #fff;">
<view class="u-m-b-30 u-flex justify-between">
<view class="entrus_list_title u-font-32">{{ item.materialName }}</view>
<view class="u-font-28">{{ item.status | filterStatus }}</view>
</view>
<view class="dis_flex">
<image class="hs-img-160" :src="`${$IMG_URL}${item.pictureCode}`" mode=""></image>
<image class="hs-img-160" :src="`${$IMG_URL}${item.pictureCode}`" mode="cover"></image>
<view class="u-m-l-20">
<view class="u-m-b-10">
<span class="color_00004">建模服务商</span>
......@@ -83,11 +83,11 @@
<view class="justify-between u-m-t-30 u-flex u-flex-nowrap">
<view class="color_FA5353">{{ item.oddStatus == 1 ? '两天无人接单' : '' }} {{ item.oddStatus == 2 ? '未及时完成' : '' }}</view>
<view>
<view v-if="item.status == 1 || item.status == 2" @click="dateilEnt(item, '即刻发布')" class="u-m-l-10 btn">即刻发布</view>
<view v-if="item.status == 3" class="u-m-l-10 btn">撤回</view>
<view v-if="item.status == 4" @click="dateilEnt(item, '马上寄送')" class="u-m-l-10 btn">马上寄送</view>
<view v-if="item.status == 1" @click="dateilEnt(item, 'edit')" class="u-m-l-10 btn">即刻发布</view>
<view v-if="item.status == 3" class="u-m-l-10 btn" @click="dateilEnt(item, 'item')">撤回</view>
<view v-if="item.status == 4" @click="dateilEnt(item, 'item')" class="u-m-l-10 btn">马上寄送</view>
<view v-if="item.oddStatus == 2 && item.status == 5" @click.stop="reminder(item.id)" class="u-m-l-10 btn">催单</view>
<view v-if="item.status == 7" class="u-m-l-10 btn">前往审核</view>
<view v-if="item.status == 7" @click="dateilEnt(item,'item' )" class="u-m-l-10 btn">前往审核</view>
</view>
</view>
</view>
......@@ -355,11 +355,9 @@ export default {
},
// 编辑 拆单
dateilEnt(item, val) {
if (val == '即刻发布') {
if (val === 'edit') {
this.$Router.push(`/pages/modeling/addItem?id=${item.id}`);
} else if (val == '选款') {
this.$Router.push(`/pages/modeling/item?id=${item.id}`);
} else if (val == '马上寄送') {
} else if (val === 'item') {
this.$Router.push(`/pages/modeling/item?id=${item.id}`);
} else {
this.$Router.push('/pages/modeling/addItem');
......
......@@ -64,10 +64,14 @@
</view>
</view>
</view>
<hs-tab-bar></hs-tab-bar>
</view>
</template>
<script>
import HsTabBar from "../../components/hs-tab-bar/hs-tab-bar";
export default {
components: {HsTabBar},
data() {
return {
background: { backgroundColor: 'rgba(245,245,245,0)' },
......@@ -85,12 +89,12 @@ export default {
{
name: '搜款',
img: '../../static/images/home/styleEntrustment@2x.png',
url: ''
url: '/pages/material/list'
},
{
name: '上架管理',
img: '../../static/images/home/styleManageme@2x.png',
url: ''
url: '/pages/material/entrustManagement'
}
// TODO 旧版本 可能以后会用到
// {
......@@ -117,10 +121,10 @@ export default {
};
},
onLoad() {
this.toBeSelectedQuantity();
this.orderTicketExceptionNum();
this.noSampleOrder();
this.materialList();
// this.toBeSelectedQuantity();
// this.orderTicketExceptionNum();
// this.noSampleOrder();
// this.materialList();
},
onPageScroll(object) {
let height = 486 / 2;
......
......@@ -50,6 +50,10 @@ export default {
this.list = JSON.parse(ret).filter((item) =>{
return item.tenantPlat === 'saas'
});
if(this.list.length === 1){
this.selectedIndex = 0;
this.encryptToken();
}
})
// #endif
},
......
<template>
<view>
<!--导航栏 navbar-->
<view id="header">
<u-navbar :title="title"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
</view>
<view class="body " :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="u-relative">
<u-image height="750rpx"></u-image>
<view class="u-absolute prev">上一款</view>
<view class="u-absolute next">下一款</view>
<view class="u-absolute step u-p-r-30 u-p-l-30">
<view class="step-main u-p-r-20 u-p-l-20 u-flex">
<text class="width_100">{{angle}}°</text>
<view class="u-relative u-flex-1">
<view class="line" id="line">
<view class="line-center"></view>
<view class="line-step" id="line-step"
:style="{
left:
(offset.x - lineOffset.left) / lineWidth * 100
+ '%'
}"
@touchmove="touchMove"
@touchend="touchEnd"
@touchstart="touchStart"
/>
</view>
</view>
<text class="u-m-l-24">重置</text>
</view>
</view>
</view>
<view class="">
<view class="u-m-b-20 bg-fff u-p-r-30 u-p-l-30">
<view class="title u-flex u-p-t-26 u-p-b-18">
<view class="title-tip u-m-r-10"></view>
可调整部位
</view>
<view class="overflow u-m-b-24">
<view class="button inline-block active">主身</view>
<view class="button inline-block">主身</view>
</view>
<view class="u-p-b-20">
<u-search placeholder="请输入面料名称" v-model="keyword"
border-color="#e1e1e1" height="76"
bg-color="#fff" :show-action="false"></u-search>
</view>
<view class="overflow u-p-b-30 u-border-bottom">
<view class="image u-m-r-10 active">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
</view>
<view class="u-p-t-30 u-p-b-20 text-right">
<view class="button inline-block button-plain button-plain-default">取消</view>
<view class="button inline-block button-default">主身</view>
</view>
</view>
<view class="bg-fff u-p-r-30 u-p-l-30">
<view class="title u-flex u-p-t-26 u-p-b-18">
<view class="title-tip u-m-r-10"></view>
颜色选择
</view>
<view class="u-border-bottom u-p-b-32">
<view class="">主图颜色</view>
<view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
</view>
</view>
<view>
<view class="u-p-t-32">
其他可选颜色
<text>(可多选)</text>
</view>
<view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view id="footer" class="footer">
<view class="footer-btn">
<view class="button button-default button-plain button-plain--default">
加入待上架
</view>
</view>
</view>
</view>
</template>
<script>
import dom from "@/mixins/dom";
export default {
name: "createMaterial",
mixins:[dom],
data(){
return {
title: '111',
keyword: '',
offset :{
x: 0
},
startTime: 0,
lineStepWidth: 0,
lineWidth: 0,
lineOffset: 0,
}
},
computed:{
angle(){
let { lineOffset,offset,lineWidth} = this;
let left = (offset.x - lineOffset.left) / lineWidth * 100;
return Math.ceil((left-50) / 50 * 180);
}
},
mounted() {
this.uGetRect("#line").then(res => {
this.lineWidth = res.width;
this.lineOffset = {
left: res.left,
right: res.right,
};
this.offset.x = res.width /2 + res.left
})
this.uGetRect("#line-step").then(res => {
this.lineStepWidth = res.width;
})
},
methods:{
touchMove(e){
let left = e.changedTouches[0].pageX;
if(
left >= this.lineOffset.left &&
left <= this.lineOffset.right
){
this.offset.x = left
}
},
touchEnd(e){
let left = e.changedTouches[0].pageX;
// console.log(left)
// console.log(this.lineOffset.right)
if(
left >= this.lineOffset.left &&
left <= this.lineOffset.right
){
this.offset.x = left
}
},
touchStart(e){
this.offset.x = e.changedTouches[0].pageX;
}
}
}
</script>
<style scoped lang="scss">
.bg-fff{ background: #fff}
.width_100{ width: 100rpx}
.inline-block{
display: inline-block;
margin-right: 10rpx;
}
.step{
width: 100%; height: 60rpx;
bottom: 16rpx;
left: 0;
color: #fff;
&-main{
background: rgba(0,0,0,0.20);
}
}
.line{
height: 6rpx;
width: 100%;
background: #fff;
position: relative;
&-center{
border-radius: 50%;
height: 16rpx; width: 16rpx;
position: absolute;
left: 50%; top: 50%;
margin-right: -8rpx;
margin-top: -8rpx;
background: #fff;
}
&-step{
border-radius: 50%;
height: 40rpx; width: 40rpx;
position: absolute;
top: 50%;
margin-top: -20rpx;
background: #fff;
}
}
.prev,.next{
width: 144rpx; height: 88rpx; line-height: 88rpx;
color: #D5AA7A; text-align: center;
font-size: 28rpx;
box-shadow: 0px 2rpx 8rpx 0px rgba(0,0,0,0.10);
bottom: 60rpx;
}
.prev{
border-top-right-radius: 100rpx;
border-bottom-right-radius: 100rpx;
left: 0;
}
.next{
border-top-left-radius: 100rpx;
border-bottom-left-radius: 100rpx;
right: 0;
}
.title{
&-tip{
width: 8rpx;
height: 32rpx;
background: #af8d66;
border-radius: 6rpx;
}
}
.image{
position: relative;
width: 160rpx;
height: 160rpx;
display: inline-block;
border-radius: 8rpx;
&-tip{
text-align: center;
width: 100%;
height: 40rpx;line-height: 40rpx;
background: rgba(255,255,255,0.80);
font-size: 24rpx;
position: absolute;
bottom: 0;
left: 0;
}
&.active{
border: 1px solid #DDA973;
}
}
.button{
border: 1px solid #333;
border-radius: 44rpx;
width: 160rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
&-plain{
&--default{
color: #333;
}
}
&-default{
background: #333;
color: #fff;
}
&.active{
color: #AF8D66;
border: 1px solid #DDA973;
}
}
.body{
position: absolute;
background: rgba(239,239,239,0.61);
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.overflow{
overflow-x: auto;
white-space: nowrap;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 60rpx;
.button{
border: 1px solid #333;
border-radius: 44rpx;
width: 100%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 34rpx;
&-default{
background: #333;
color: #fff;
}
}
}
}
</style>
<!--委托详情-->
<template>
<view>
<!--导航栏 navbar-->
<u-navbar :title="title" id="header"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="tip u-m-b-20">剩余59分1秒自动取消上架单</view>
<view class="u-p-r-30 u-p-l-30">
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20">
<view class="u-border-bottom u-l-height-44 u-flex">
<text class="u-flex-1">款式明细</text>
<text>总共50款</text>
</view>
<view class="u-p-t-20 u-p-b-20">
加厚荷兰绒绒布布料(3)
</view>
<view class="item u-flex">
<view class="item-img"></view>
<view class="u-flex-1 u-p-l-20">
<view class="item-title u-line-1 u-font-28">男装-上装-青年-时尚休闲</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">款号</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">所选面料</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="item-tags">
<view class="item-tag u-font-20">
标签
</view>
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
</view>
<view class="u-p-b-20 u-border-bottom text-center" @click="toggle">
<text>展开<u-icon name="arrow-down" size="22" color="#000"></u-icon></text>
</view>
<view class="price text-right u-m-t-30 u-p-r-30">
总金额 <text class="price-num u-m-l-40">2000</text>
</view>
</view>
<!--订单信息-->
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20">
<view class="u-border-bottom u-l-height-44">订单信息</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">订单编号</view>
<view class="u-line-1 u-flex-1 content">
11
</view>
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">创建时间</view>
<view class="u-line-1 u-flex-1 content" >
111
</view>付款时间
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">付款时间</view>
<view class="u-line-1 u-flex-1 content">
11
</view>
</view>
</view>
</view>
</view>
<view class="footer" id="footer">
<view class="footer-btn">
<view class="button button-default">
立刻付款
</view>
</view>
</view>
</view>
</template>
<script>
import dom from "@/mixins/dom";
export default {
name: "entrustItem",
mixins:[dom],
data(){
return {
title: '待付款',
detail:{
}
}
},
methods:{
toggle(){}
}
}
</script>
<style scoped lang="scss">
$h-color: #AF8D66;
$color: rgba(175,141,102,0.10);
$main-color: #fff;
.bg-fff{ background: #fff;}
.u-l-height-44{ line-height: 88rpx}
.tip{
background: #DDA973;
color: #000;
font-size: 32rpx; line-height: 80rpx;
text-align: center;
}
.price{
background: #fcfaf7;
line-height: 80rpx;
border: 1px solid rgba(68,53,37,0.10);
border-radius: 8rpx;
&-num{
color: $h-color;
}
}
.item{
width: 100%;
margin-bottom: 40rpx;
&--round{
border-radius: 16rpx;
border: 1px solid rgba(0,0,0,0.10);
}
&--status{
left: 0;
top: 0;
position: absolute;
}
&-img{
width: 160rpx;
height: 160rpx;
//height: 100%
}
&-title{}
&-desc{}
&-tags{
}
&-tag{
padding: 6rpx 2px;
background: $color;
text-align: center;
color: $h-color;
display: inline-block;
margin-right: 10rpx;
}
}
.label{
color: rgba(0,0,0,0.40);
font-size: 28rpx;
min-width: 140rpx;
}
.context{
color: #000;
font-size: 28rpx;
}
.body{
position: absolute;
background: rgba(239,239,239,0.61);
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 60rpx;
.button{
border: 1px solid #333;
border-radius: 44rpx;
width: 100%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 34rpx;
&-default{
background: #333;
color: #fff;
}
}
}
}
</style>
<template>
<view>
<view id="header">
<!--新增委托navbar-->
<u-navbar title="上架单"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
<template v-slot:right>
</template>
</u-navbar>
<view class="status-list bg-fff u-flex">
<text v-for="(status,index) in statusList"
@click="setStatus(index)"
class="status-item u-m-r-20 u-m-l-16"
:class="[index === activeStatus ? 'active':'']"
:key="status.value">
{{status.label}}
</text>
</view>
</view>
<!-- 列表 确定-->
<view class="body u-p-r-30 u-p-l-30" :style="{ bottom: footerHeight+ 'px', top: headerHeight + 'px' }">
<view class="u-p-t-24 u-p-b-24">
{{statusList[activeStatus].label }}上架单:{{list.length}}单
</view>
<view v-for="(item) in list" :key="item.id"
@click="goEntrustItemPage(item)"
class="item u-m-b-20 bg-fff u-p-30">
<view class="item-header u-flex">
<view class="u-flex-1 u-line-1 u-font-32 u-flex">
<view class="item-header-tip u-m-r-10"></view>
AS2312424234
</view>
<view class="item-header-status u-flex-1 u-line-1 u-font-28">
待付款倒计时:59分21秒
</view>
</view>
<view class="item-body ">
<view class="item-desc u-m-t-28 u-m-b-22">
<text class="u-m-r-20 item-desc-label">上架款数</text>
<text class="item-desc-value">50款</text>
</view>
<view class="item-images">
<image src="" fit="fit" class="item-image"></image>
<image src="" fit="fit" class="item-image"></image>
<image src="" fit="fit" class="item-image"></image>
<image src="" fit="fit" class="item-image"></image>
<image src="" fit="fit" class="item-image"></image>
<image src="" fit="fit" class="item-image"></image>
</view>
</view>
<view class="item-hr"></view>
<view class="item-footer u-flex">
<view class="item-desc u-flex-1 u-line-1">
<text class="u-m-r-20 item-desc-label">待支付:</text>
<text class="item-desc-value item--status">23211元</text>
</view>
<view class="item-buttons u-flex-1 u-flex">
<view class="button button-plain button-plain--default u-m-r-20">取消上架</view>
<view class="button button-default">付款</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import dom from "@/mixins/dom";
export default {
name: "entrustList",
mixins:[dom],
data(){
return{
activeStatus: 0,
statusList: [
{label: '全部',value: '1'},
{label: '待付款',value: '2'},
{label: '已付款',value: '3'},
{label: '已取消',value: '4'},
],
list: [
{}
]
}
},
methods:{
setStatus(index){
this.activeStatus = index;
this.getList();
},
getList(){
// this.
},
goEntrustItemPage({id}){
this.$Router.push({
path: '/pages/material/entrustItem',
query:{
id: id
}
})
}
}
}
</script>
<style scoped lang="scss">
$activeColor: #DDA973;
$mainColor: #000;
$subColor: rgba(0,0,0,0.40);
.bg-fff{
background: #fff;
}
.body{
position: absolute;
background: rgba(239,239,239,0.61);
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.status-list{
height: 80rpx;
.status-item{
color: #666;
font-size: 28rpx;
&.active{
font-size: 32rpx;
color:$activeColor;
}
}
}
.item{
border-radius: 16rpx;
&--status{
color: $activeColor;
}
&-header{
&-tip{
width: 8rpx;
height: 32rpx;
background: #af8d66;
border-radius: 6rpx;
}
}
&-body{
}
&-desc{
&-label{
color: $subColor;
}
}
&-images{
overflow-x: auto;
white-space: nowrap;
.item-image{
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
margin-right: 20rpx;
}
}
&-hr{
width: 100%;
border-top: 1px solid #f6f6f6;
padding: 20rpx;
position: relative;
&:before{
content: " ";
position: absolute;
left: -22px;
top: -7px;
display: block;
width: 15px;
height: 15px;
background: #f6f6f6;
border-radius: 50px;
}
&:after{
content: " ";
position: absolute;
right: -22px;
top: -7px;
display: block;
width: 15px;
height: 15px;
background: #f6f6f6;
border-radius: 50px;
}
}
&-footer{}
&-buttons{
.button{
border: 1px solid #333;
border-radius: 44rpx;
width: 160rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
&-plain{
&--default{
color: #333;
}
}
&-default{
background: #333;
color: #fff;
}
}
}
}
</style>
<template>
<view>
<view id="header">
<!--新增委托navbar-->
<view class="navbar u-p-t-20 u-p-r-30 u-p-b-20 u-p-l-30 u-flex">
<u-icon name="arrow-left" color="#000" @click="$Router.back()"></u-icon>
<text class="u-flex-1 text-center">款式委托</text>
<text @click="goEntrustList">上架单</text>
</view>
<view class="u-p-30">
<u-search placeholder="请输入款式名称或面料名称" v-model="keyword"
border-color="#e1e1e1" height="76"
bg-color="#fff" :show-action="false"></u-search>
</view>
<view class="status-list u-flex bg-fff">
<view v-for="(status,index) in statusList"
class="status-item u-flex-1 text-center"
:class="[activeStatus === index ? 'active' : '']"
@click="setActiveStatus(index)"
>
{{status.label}}
</view>
</view>
</view>
<view id="body" class="body u-p-r-30 u-p-l-30" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view v-if="activeStatus === 0">
<view class="u-p-t-24 u-p-b-24">待上架:300款</view>
<view class="entrust bg-fff u-p-30">
<view class="entrust-title u-flex">
<!-- :name="index === selectedIndex ? 'checkmark-circle-fill': 'checkmark-circle'"-->
<u-icon name="checkmark-circle"
color="#000" size="40"
@click="triggerSelectItem()"
/>
<text class="u-flex-1 u-p-l-30">
加厚荷兰绒绒布布料(<text class="active-color">1</text>/3)
</text>
<u-icon name="arrow-down"
color="#000" size="40"
@click="triggerToggle()"
/>
</view>
<view class="u-flex u-p-t-30">
<u-icon name="checkmark-circle"
color="#000" size="40"
@click="triggerSelectItem()"
/>
<view class="item u-flex-1 u-flex u-p-l-30">
<view class="item-img"></view>
<view class="u-flex-1 u-p-l-20">
<view class="item-title u-line-1 u-font-28">男装-上装-青年-时尚休闲</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">款号</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">所选面料</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="item-tags">
<view class="item-tag u-font-20">
标签
</view>
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view v-if="activeStatus === 1">
<view class="u-p-t-24 u-p-b-24">已上架:300款</view>
<view class="entrust bg-fff u-p-30">
<view class="entrust-title u-flex">
<text class="u-flex-1 u-p-l-30">
加厚荷兰绒绒布布料(3)
</text>
<u-icon name="arrow-down"
color="#000" size="40"
@click="triggerToggle()"
/>
</view>
<view class="u-flex u-p-t-30">
<view class="item u-flex-1 u-flex u-p-l-30">
<view class="item-img"></view>
<view class="u-flex-1 u-p-l-20">
<view class="item-title u-line-1 u-font-28">男装-上装-青年-时尚休闲</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">款号</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label u-font-24">所选面料</view>
<view class="u-line-1 u-flex-1 content u-font-24">
11
</view>
</view>
<view class="item-tags">
<view class="item-tag u-font-20">
标签
</view>
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view v-if="activeStatus === 2">
<view class="u-p-t-24 u-p-b-24">全部:300款</view>
<view class="entrust bg-fff u-p-30">
<view class="entrust-title u-flex">
<view class="entrust-tip"></view>
<text class=" u-flex-1 u-p-l-30">
加厚荷兰绒绒布布料(3)
</text>
<text>已上架</text>
</view>
<view class="u-flex u-p-t-30">
<view class="item u-flex-1 u-flex u-p-l-30">
<view class="item-img"></view>
<view class="u-flex-1 u-p-l-20">
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label ">款号</view>
<view class="u-line-1 u-flex-1 content">
11
</view>
</view>
<view class="u-flex u-m-t-6 u-m-b-6">
<view class="u-m-r-40 label">所选面料</view>
<view class="u-line-1 u-flex-1 content">
11
</view>
</view>
<view class="item-tags">
<view class="item-tag u-font-20">
标签
</view>
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view id="footer" class="footer" v-if="activeStatus === 0">
<view class="footer-btn">
<view class="custom-style-round-circle custom-style-btn custom-style"
>
<view class="custom-style-left save">删除</view>
<view class="custom-style-right submit">
一键上架(3)
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import dom from "@/mixins/dom";
export default {
name: "entrustManagement",
mixins:[dom],
data(){
return{
keyword: '',
activeStatus: 0,
statusList: [
{label: '待上架', value: '1'},
{label: '已上架', value: '2'},
{label: '全部', value: '3'},
]
}
},
methods:{
resetPage(){
this.getHeaderHeight();
this.getFooterHeight();
},
setActiveStatus(index){
this.activeStatus = index;
this.resetPage();
},
triggerSelectItem(){
},
triggerToggle(){
},
goEntrustList(){
this.$Router.push({
path: '/pages/material/entrustList'
})
}
}
}
</script>
<style scoped lang="scss">
$h-color: #AF8D66;
$activeColor: #DDA973;
$color: rgba(175,141,102,0.10);
$main-color: #fff;
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.active-color{ color: $color}
.bg-fff{ background: #fff;}
.item{
width: 100%;
margin-bottom: 28rpx;
&--round{
border-radius: 16rpx;
border: 1px solid rgba(0,0,0,0.10);
}
&--status{
left: 0;
top: 0;
position: absolute;
}
&-img{
width: 160rpx;
height: 160rpx;
//height: 100%
}
&-title{}
&-desc{}
&-tags{
}
&-tag{
padding: 6rpx 2px;
background: $color;
text-align: center;
color: $h-color;
display: inline-block;
margin-right: 10rpx;
}
}
.entrust{
border-radius: 8rpx;
&-tip{
width: 8rpx;
height: 32rpx;
background: #af8d66;
border-radius: 6rpx;
}
}
.custom-style{
color: #fff; height: 88rpx; line-height: 88rpx;
@include vue-flex;
&-btn{
overflow: hidden;
}
&-round-circle{
border-radius: 100rpx;
}
/*background: #000;*/
.custom-style-left{ width: 240rpx; background: #d6d6d6; text-align: center }
.custom-style-right{ flex: 1; background: rgba(0,0,0,0.80);text-align: center}
.save{
font-size: 34rpx;
color: #000000;
}
.submit{
font-weight: 500;
font-size: 34rpx;
//line-height: 100%;
.title{
//margin: 8rpx 0;
}
.desc{
font-size: 20rpx;
.color{
color: #DDA973;
}
}
}
}
.label{
color: rgba(0,0,0,0.40);
font-size: 28rpx;
min-width: 140rpx;
}
.context{
color: #000;
font-size: 28rpx;
}
.status-list{
height: 80rpx;
border-top-right-radius: 8rpx;
border-top-left-radius: 8rpx;
.status-item{
color: #666;
font-size: 28rpx;
&.active{
font-size: 32rpx;
color:$activeColor;
}
}
}
.body{
position: absolute;
background: rgba(239,239,239,0.61);
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 60rpx;
.button{
border: 1px solid #333;
border-radius: 44rpx;
width: 100%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 34rpx;
&-default{
background: #333;
color: #fff;
}
}
}
}
</style>
<template>
<view>
<view>
<u-image height="750rpx"></u-image>
</view>
<view class="u-p-t-20 u-p-r-30 u-p-l-30 ">
<view class="bg-fff u-p-t-20 u-p-r-30 u-p-b-30 u-p-l-30 item">
<view class="u-flex">
<text class="u-flex-1">男装-上装-青年-时尚</text>
<text class="active">待上架</text>
</view>
<view class="u-flex">
<text class="u-flex-1 u-font-28">AS23124</text>
<text class="u-font-24">
加入日期:2021-12-11
</text>
</view>
<view class="item-tags">
<view class="item-tag u-font-20">
标签
</view>
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 item">
<view class="u-border-bottom u-line-88">所选面料</view>
<view class="u-m-t-30 u-m-b-56">
<hs-material-thumbnail :item="item"></hs-material-thumbnail>
</view>
<view class="u-flex">
<view class="">
<view>主图颜色</view>
<view class="image">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
</view>
<view class="overflow u-flex-1">
<view>其他颜色</view>
<view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
<view class="image u-m-r-10">
<image src="" style="width: 100%;height: 100%"></image>
<view class="image-tip u-line-1">颜色</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import HsMaterialThumbnail from "@/components/hs-material-thumbnail/hs-material-thumbnail";
export default {
name: "entrustManagementItem",
components: {HsMaterialThumbnail},
data(){
return{
item:{}
}
}
}
</script>
<style scoped lang="scss">
$h-color: #AF8D66;
$activeColor: #DDA973;
$color: rgba(175,141,102,0.10);
$main-color: #fff;
.u-line-88{
line-height: 88rpx;
}
.bg-fff{
background: #fff;
}
.item{
width: 100%;
margin-bottom: 28rpx;
&--round{
border-radius: 16rpx;
border: 1px solid rgba(0,0,0,0.10);
}
&-tag{
padding: 6rpx 2px;
background: $color;
text-align: center;
color: $h-color;
display: inline-block;
margin-right: 10rpx;
}
}
.image{
position: relative;
width: 160rpx;
height: 160rpx;
display: inline-block;
&-tip{
text-align: center;
width: 100%;
height: 40rpx;line-height: 40rpx;
background: rgba(255,255,255,0.80);
font-size: 24rpx;
position: absolute;
bottom: 0;
left: 0;
}
}
.overflow{
overflow-x: auto;
white-space: nowrap;
}
</style>
<template>
<view>
<view id="header">
<!--新增委托navbar-->
<u-navbar title="选择面料"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
<template v-slot:right>
<view class="u-p-r-30 u-font-27"
@click="addMaterialModeling">新增面料</view>
</template>
</u-navbar>
<view class="title u-p-30">选择面料</view>
<view class="u-p-30 bg-fff">
<!--新增委托navbar-->
<u-search placeholder="请输入面料名称" v-model="keyword"
border-color="#e1e1e1" height="76"
bg-color="#fff" :show-action="false"></u-search>
</view>
</view>
<!-- 列表 确定-->
<view class="u-p-30 body" :style="{ bottom: footerHeight+ 'px', top: headerHeight + 'px' }">
<view v-for="(item, index) in list" :key="item.id" class="u-flex u-m-b-20">
<view class="u-m-r-30">
<u-icon :name="index === selectedIndex ? 'checkmark-circle-fill': 'checkmark-circle'"
color="#000" size="40"
@click="triggerSelectItem(index)"
/>
</view>
<hs-material-thumbnail :item="item"></hs-material-thumbnail>
</view>
</view>
<!-- 底部按钮 确定-->
<view class="footer" id="footer">
<view class="footer-btn">
<!-- /* 以下形式在微信小程序会无效,APP和H5有效 */-->
<u-button :disabled="selectedIndex === -1"
@click="selectType"
class="custom-style" shape="circle"
>
确定
</u-button>
</view>
</view>
</view>
</template>
<script>
import dom from "../designCommissioned/mixins/dom";
export default {
name: "list",
mixins:[dom],
data(){
return {
keyword: '',
selectedIndex: -1,
list: [
{
materialName: '加厚荷兰绒绒布布料',
id: 2
},
{
materialName: '加厚荷兰绒绒布布料加厚荷兰绒绒布布料',
id: 12
},
{
materialName: '加厚荷兰绒绒布布料',
id: 221
},
{
materialName: '加厚荷兰绒绒布布料',
id: 22
},
{
materialName: '加厚荷兰绒绒布布料',
id: 224
},
{
materialName: '加厚荷兰绒绒布布料',
id: 222
}
]
}
},
onLoad(){
},
methods:{
getList(){
this.$http('orderTicket.materialList', {
size: 4,
materialCode: '',
materialName: ''
}).then(res => {
let { code, data } = res;
if (code == 200) {
this.list = data.data;
}
});
},
triggerSelectItem(index){
this.selectedIndex = index === this.selectedIndex ? -1 : index;
},
// 跳转到面料详情
toMaterialDetail({id}){
this.$Router.push({
path:"/pages/home/fabricDetails",
query:{
id
}
})
},
// 新增面料建模
addMaterialModeling(){
this.$Router.push({
path:"/pages/modeling/addItem"
})
},
// 跳转到选款
selectType(){
let selectItem = this.list[this.selectedIndex];
this.$Router.push({
path:"/pages/material/selectType",
query:{
materialId: selectItem.id
}
})
}
}
}
</script>
<style scoped lang="scss">
$h-color: #AF8D66;
$main-color: #fff;
.body{
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.title{
color: $h-color;
background-color: whitesmoke;
}
.bg-fff{
background: $main-color;
}
.item{
border-radius: 8rpx;
border: 1px solid #bd4848;
height: 160rpx; width: 100%;
overflow: hidden;
background-size: contain;
.active{
border: 1px solid #000;
}
}
.custom-style{
color: #fff;
background: #000;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 30rpx;
}
}
</style>
<template>
<view>
<view id="header">
<!--选款-->
<u-navbar title="选款"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
<view class="u-p-30 u-font-32 u-flex">
<text class="title">选择面料</text>
<u-icon size="24" color="#000" name="arrow-right" class="u-m-r-10 u-m-l-10"></u-icon>
<text>选择款式</text>
</view>
<view class="u-p-30 bg-fff">
<!--新增委托navbar-->
<u-search placeholder="请输入面料名称" v-model="keyword"
border-color="#e1e1e1" height="76"
bg-color="#fff" :show-action="false"></u-search>
</view>
</view>
<!-- 列表 确定-->
<view class="body bg-fff u-p-r-30 u-p-b-30 u-p-l-30" :style="{ bottom: footerHeight+ 'px', top: headerHeight + 'px' }">
<view v-for="(item, index) in list" :key="item.id"
@click=""
class="u-flex u-m-b-20">
<view class="item item--round u-flex ">
<view class="item-img u-relative">
<image src="" mode="fit" style="width:100%; height: 100%"></image>
<u-image width="100rpx" height="100rpx"
class="item--status"
mode="widthFix"
src="@/static/images/material/status.png">
</u-image>
</view>
<view class="u-flex-1 u-p-l-20 u-p-r-30 u-border-left">
<view class="item-title u-flex ">
<view class="u-flex-1 u-line-1 u-font-32 u-p-t-20 u-p-b-8">男装</view>
<u-icon size="24" color="#000" name="arrow-right"></u-icon>
</view>
<view class="item-desc u-font-24">ASD</view>
<view class="item-tags u-p-b-24">
<view class="item-tag u-font-20">
标签
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import dom from "../designCommissioned/mixins/dom";
export default {
name: "selectType",
mixins:[dom],
data(){
return {
keyword: '',
selectedIndex: -1,
list: [
{
materialName: '加厚荷兰绒绒布布料',
id: 2
},
{
materialName: '加厚荷兰绒绒布布料加厚荷兰绒绒布布料',
id: 12
},
{
materialName: '加厚荷兰绒绒布布料',
id: 221
},
{
materialName: '加厚荷兰绒绒布布料',
id: 22
},
{
materialName: '加厚荷兰绒绒布布料',
id: 224
},
{
materialName: '加厚荷兰绒绒布布料',
id: 222
}
]
}
},
onLoad(){
},
methods:{
}
}
</script>
<style scoped lang="scss">
$h-color: #AF8D66;
$color: rgba(175,141,102,0.10);
$main-color: #fff;
.body{
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.title{
color: $h-color;
background-color: whitesmoke;
}
.bg-fff{
background: $main-color;
}
.custom-style{
color: #fff;
background: #000;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 30rpx;
}
}
.item{
width: 100%;
&--round{
border-radius: 16rpx;
border: 1px solid rgba(0,0,0,0.10);
}
&--status{
left: 0;
top: 0;
position: absolute;
}
&-img{
width: 160rpx;
height: 150rpx;
//height: 100%
}
&-title{}
&-desc{}
&-tags{
}
&-tag{
padding: 6rpx 2px;
background: $color;
text-align: center;
color: $h-color;
display: inline-block;
margin-right: 10rpx;
}
}
</style>
......@@ -25,7 +25,7 @@
</view>
</view>
<u-form-item label="面料门幅" prop="clothWidth">
<u-number-box v-model="detail.clothWidth"></u-number-box>cm
<u-number-box v-model="detail.clothWidth" :step="0.1"></u-number-box>cm
</u-form-item>
<u-form-item label="面料成分" prop="component" required>
<u-input v-model="detail.component" placeholder="请输入面料成分" />
......@@ -44,6 +44,7 @@
<u-upload :custom-btn="true" :ref="`upload${index}`" :disabled="!!item.pictureCode"
@on-success="(data) => { uploadSuccess(data,index)}" width="160" height="160"
class="pre-item--80 float-left" :header="header"
@on-choose-fail="beforeUploadWithError"
:show-upload-list="true" :action="action" :max-count="1">
<view slot="addBtn" class=" slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<u-icon name="plus" size="60" color="#c0c4cc"></u-icon>
......@@ -60,14 +61,18 @@
<view class="u-p-30 bg-fff u-m-b-20">
<hs-tip-title title="委托建模信息"></hs-tip-title>
<u-form-item label="完成期限" prop="expirationDate" required>
<u-input v-model="detail.expirationDate" readonly @click="timePickerShow = true"/>
<u-input v-model="detail.expirationDate" :disabled="true" @click="timePickerShow = true"/>
</u-form-item>
<!--指定面料颜色数量-->
<u-form-item label="指定面料颜色数量" prop="component" required>
<u-number-box v-model="detail.clothRowColourQuantity" @change="addModelingTaskColourDTOList"></u-number-box>
<u-number-box v-model="detail.clothRowColourQuantity"
:max="10"
@minus="addModelingTaskColourDTOList"
@plus="addModelingTaskColourDTOList"
@blur="addModelingTaskColourDTOList"></u-number-box>
</u-form-item>
<view class="brandList-tips u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" >
<view class="u-border-bottom u-flex u-p-b-8 ">
<view class="u-border-bottom u-flex u-p-b-18 ">
<view class="u-flex-1">
<view class="u-flex" @click="showAddColorListDialog">
<view class="label u-flex-1">指定面料颜色名称</view>
......@@ -78,11 +83,21 @@
</view>
<u-icon name="arrow-right"></u-icon>
</view>
<view class="u-border-bottom u-flex u-p-b-8 ">
<view class="u-border-bottom u-flex u-p-t-18 u-p-b-18">
<view class="label u-flex-1">设计机构提供颜色数量</view>
<view class="value">{{designAgencyColourQuantity}}</view>
</view>
<view class="u-border-bottom u-p-b-8"></view>
<view class="u-border-bottom u-flex u-p-t-18 u-p-b-18">
<view class="u-flex-1">
<view class="u-flex" @click="showAddColorDialog">
<view class="label u-flex-1">设计机构提供颜色名称</view>
<view class="value u-width-100" >
{{taskColorNames}}
</view>
</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
......@@ -120,7 +135,7 @@
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="u-p-t-26 u-p-r-30 u-p-l-30">
<hs-tip-title title="面料颜色名称"></hs-tip-title>
<view v-for="(color,index) in modelingTaskColourDTOList" :key="index">
<view v-for="(color,index) in activeColors" :key="index">
<view class="u-font-28 u-m-t-18 u-m-b-8 required">颜色{{index+1}}</view>
<view class="u-flex">
......@@ -141,6 +156,41 @@
</view>
</view>
</u-popup>
<!--颜色库选择-->
<u-popup v-model="color.show" mode="bottom" height="100%">
<!--导航栏 navbar-->
<u-navbar title="选择设计机构提供的颜色"
:border-bottom="false" :custom-back="() => {color.show = false}"
:background="{backgroundColor: 'whitesmoke'}">
<template v-slot:right>
<view class="u-p-40">
<u-icon name="close" @click="color.show = false;"></u-icon>
</view>
</template>
</u-navbar>
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="u-p-t-26 u-p-r-30 u-p-l-30">
<view class="pre-item pre-item--80 u-relative"
:class="[color.checked ? 'active': '']"
@click="selectColor(color)"
v-for="(color,index) in computedModelingTaskColorLibraryList" :key="index">
<image class="pre-item-image" :src="`${imgUrl}${color.pictureCode}`" mode="aspectFill"></image>
<text class="u-absolute pre-item-text text-center">{{ color.colorName }}</text>
</view>
</view>
</view>
<!--底部按钮-->
<view class="footer">
<view class="u-p-t-18 u-p-r-30 u-p-b-18 u-p-l-30">
<view class="u-flex">
<view class="u-flex-1">共填写{{detail.clothRowColourQuantity}}种颜色名称,请不要重名</view>
<view class="custom-style-round-circle custom-style-btn custom-style dialog-btn">
<view class="custom-style-right" @click="submitColor">确定</view>
</view>
</view>
</view>
</view>
</u-popup>
<!--建模品类选择-->
<u-select mode="single-column" :list="modelingTaskCategory" v-model="show" @confirm="confirm">
</u-select>
......@@ -151,6 +201,7 @@
<script>
import dom from "../../mixins/dom";
import permission from "../../js_sdk/wa-permission/permission";
export default {
name: "addItem",
mixins: [dom],
......@@ -167,6 +218,7 @@ export default {
modelingCategoryId: '', // 建模品类id
modelingCategoryText: '', // 建模品类文本
modelingTaskColourDTOList: [], // 布行指定面料颜色名称集合
modelingTaskMaterialColourList: [], //建模任务的图片 颜色库
modelingTaskPictureDTOList: [
{pictureType: 1},
{pictureType: 2},
......@@ -202,11 +254,18 @@ export default {
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
// {
// rule: '',
// message: '请不要输入特殊符号',
// trigger: ['change','blur'],
// }
{
// reg '^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$',
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说,返回true表示校验通过,返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
let reg = new RegExp('^[\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$')
return reg.test(value);
},
message: '请不要输入特殊符号',
trigger: ['change','blur'],
}
],
modelingCategoryText: [
{
......@@ -215,12 +274,20 @@ export default {
trigger: 'change'
}
],
component:{
component: [
{
required: true,
message: '请输入面料成分',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
{
max: 20,
message: '文字字数不能超过20字',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
],
modelingTaskPictureDTOList: {
validator: (rule,value) =>{
return value.filter((item) => {
......@@ -237,15 +304,23 @@ export default {
},
// 暂存用的颜色组
modelingTaskColourDTOList: [],
// 暂存用的颜色库
modelingTaskMaterialColourList: [],
// 物料建模品类
modelingTaskCategory: [],
// 设计机构提供的颜色库m
modelingTaskColorLibraryList: [],
show: false,
delModelingTaskPictureDTOList: [],
modal:{
show: false,
content: '是否删除图片',
index: '',
}
},
color:{
show: false
},
checkedList: [],
}
},
computed:{
......@@ -264,11 +339,90 @@ export default {
},
colorListNames(){
return this.activeColors
.map((item) => item.colourName).join("|")
.map((item) => item.colourName)
.filter(item => item)
.join("|")
},
// 设计机构提供颜色
activeTaskMaterialColour(){
return this.detail.modelingTaskMaterialColourList
.filter((item) => item.isDeleted === false)
},
//
taskColorNames(){
return this.activeTaskMaterialColour
.map((item) => item.colorName).join("|")
},
//
modelingTaskMaterialColourIds(){
return this.activeTaskMaterialColour.map(item => item.colorId)
},
computedModelingTaskColorLibraryList(){
return this.modelingTaskColorLibraryList.map((item) =>{
return {
...item,
checked: this.checkedList.indexOf(item.id) > -1
}
})
}
},
methods:{
clearColors(){
let target = this.detail.modelingTaskMaterialColourList;
for (let i = 0; i < target.length; i++) {
this.$set(target[i],'isDeleted', true)
}
this.checkedList = []
},
// 颜色库选择好回调
submitColor(){
if(this.checkedList.length === this.designAgencyColourQuantity){
this.removeColor();
let row = this.computedModelingTaskColorLibraryList
.filter((item) => item.checked)
.map((item) =>{
let { id,...other} = item;
return {
...other,
colorId: id,
type: 2
}
});
this.addColor(row);
this.color.show = false;
}else{
this.$refs.uToast.show({
title: `请选择${this.designAgencyColourQuantity}条数据`
})
}
},
addColor(row){
this.detail.modelingTaskMaterialColourList = this.detail.modelingTaskMaterialColourList.concat(row);
},
removeColor(){
let list = this.detail.modelingTaskMaterialColourList;
let checked = this.checkedList;
for (let i = 0; i < list.length; i++) {
if(checked.indexOf(list[i].id) > -1){
this.$set(list[i],'isDeleted',true)
}else{
list.splice(i,1)
}
}
},
// 颜色库选择 点击时间 存一份选中状态 在确定的时候过滤
selectColor(colorItem){
let index = this.checkedList.indexOf(colorItem.id);
if(index > -1){
this.checkedList.splice(index,1);
}else{
this.checkedList.push(colorItem.id);
}
},
triggerDel(index){
this.modal.show = true;
this.modal.activeIndex = index;
......@@ -287,6 +441,12 @@ export default {
}
this.$set(this.detail.modelingTaskPictureDTOList,index,{pictureType: index+1});
},
beforeUploadWithError(err){
// permission.requestAndroidPermission('camera')
// .then(res =>{
// permission.gotoAppPermissionSetting()
// })
},
uploadSuccess(data, index, lists, name){
if(data.code === 200){
let item = this.detail.modelingTaskPictureDTOList[index];
......@@ -304,7 +464,7 @@ export default {
this.detail.modelingCategoryText = label;
this.detail.price = extra;
},
init(){
getModelingTaskCategoryList(){
this.$http("modelingTaskCategory.list")
.then(res =>{
let {
......@@ -321,10 +481,40 @@ export default {
}
})
},
getModelingTaskColorLibrary(){
this.$http("modelingTaskColorLibrary.list")
.then(res =>{
let {
code,data
} = res;
if(code === 200){
this.modelingTaskColorLibraryList = data
}
})
},
init(){
this.getModelingTaskCategoryList();
this.getModelingTaskColorLibrary();
},
validateList(callback){
// 指定面料颜色
let colorList = this.activeColors;
// 设计机构提供颜色
let colorPicList = this.activeTaskMaterialColour;
let checkColorPicList = colorPicList.filter((item) => !item.colorId).length === 0 && colorPicList.length === this.designAgencyColourQuantity;
let checkColorList = colorList.filter((item) => !item.colourName).length === 0;
if(checkColorPicList && checkColorList){
callback()
}else{
this.$refs.uToast.show({
title: '颜色不能为空'
})
}
},
validate(callback){
this.$refs['uForm'].validate((res) =>{
if (res) {
callback()
this.validateList(callback)
}
})
},
......@@ -365,23 +555,42 @@ export default {
return { colourName: '',isDeleted: false}
},
addModelingTaskColourDTOList(item){
let res = [];
let res = [],target = this.detail.modelingTaskColourDTOList;
// 如果存在历史数据
for (let i = 0; i < target.length; i++) {
if(target[i].id){
this.$set(target[i], 'isDeleted',true)
}
}
for (let i = 0; i < item.value; i++) {
res.push(this.getDefaultColor())
}
this.modelingTaskColourDTOList = res;
// console.log(target)
// console.log(res)
this.detail.modelingTaskColourDTOList = target.filter((item) => item.id).concat(res)
this.clearColors();
},
validateColorName(){
return this.activeColors.filter((item) => {
return !item.colourName
}).length
},
validateColors(){
let res = this.modelingTaskColourDTOList.map((item) => {
let res = this.activeColors.map((item) => {
return item.colourName
});
let diff = new Set(res)
return diff.size === res.length;
},
submitColors(){
if(this.validateColorName().length > 1){
this.$refs.uToast.show({
title: '颜色名称不能为空'
});
return;
}
if(this.validateColors()){
this.detail.modelingTaskColourDTOList = this.modelingTaskColourDTOList;
this.colorListDialogOptions.show = false;
}else{
this.$refs.uToast.show({
......@@ -390,9 +599,15 @@ export default {
}
},
showAddColorListDialog(){
if(this.detail.clothRowColourQuantity > 0){
this.colorListDialogOptions.show = true;
}
},
showAddColorDialog(){
if(this.designAgencyColourQuantity > 0){
this.color.show = true;
}
},
timePickerCallback(e){
let {
day,
......@@ -413,6 +628,8 @@ export default {
modelingTaskColourDTOList: data['modelingTaskColourList'],
modelingTaskPictureDTOList: data['modelingTaskPictureList']
});
this.checkedList = this.detail.modelingTaskMaterialColourList.map((item) => item.colorId);
this.$nextTick(() =>{
this.modelingTaskColourDTOList = data['modelingTaskColourList'];
})
......@@ -424,7 +641,7 @@ export default {
let id = options.id;
this.init();
if(id){
this.getDetail(id)
this.getDetail(id);
}
},
......@@ -487,6 +704,9 @@ export default {
//overflow: hidden;
position: relative;
margin-right: 30rpx;
&.active{
border: 1px solid red;
}
&-text{
bottom: 0;
left: 0;
......
......@@ -7,8 +7,12 @@
</u-navbar>
<!--主体内容-->
<view class="body u-p-30" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="u-flex u-p-b-20">
<view class="item-status">
<view class="u-flex u-p-b-20" >
<view class="item-status"
:class="[
detail.status >=3 && detail.status <= 7 ? 'warning':
[1,2].indexOf(detail.oddStatus) > -1 ? 'error': ''
]">
{{ status }}
</view>
<text class="item-status u-flex-1 text-right">
......@@ -16,22 +20,28 @@
</text>
</view>
<!--面料模型-->
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20">
<view class="u-border-bottom u-p-b-32">
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20" v-if="detail.status >= 7">
<view class="u-border-bottom ">
<view class="u-l-height-44 u-flex">
<view class="u-flex-1">面料模型</view>
<view class="lightgrey" @click="">
编辑便签
<view class="lightgrey"
v-if="detail.status === 8"
@click="$Router.push({
path: '/pages/modeling/tags',
query: {id:detail.id}
})">
编辑标签
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view v-if="detail.modelingTaskLabelList.length > 0">
<view v-if="detail.modelingTaskLabelList.length > 0" class="u-p-b-32">
<view class="tag" v-for="(modelingTaskLabel) in detail.modelingTaskLabelList">
{{modelingTaskLabel.labelName}}
</view>
</view>
</view>
<view class="u-m-t-18 u-m-b-8">
<view class="u-m-t-18 u-p-b-18 u-border-bottom">
<view class="u-m-r-40">指定面料颜色模型({{detail.clothRowColourQuantity}}种)</view>
<view class="overflow">
<view v-for="(item, index) in modelingTaskMaterialColourList_type1"
......@@ -57,18 +67,42 @@
</view>
</view>
</view>
<template v-if="detail.status === 7">
<view class="u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">标签<text class="color_cda475 u-font-xs">(若建模合格,则必须选择标签)</text></view>
<view class="u-line-1 u-flex-1 content">
{{labelNames}}
<view class="u-line-1 u-flex-1 content" @click="$Router.push({
path: '/pages/modeling/tags',
query: {id:detail.id}
})">
{{labelNames ? labelNames: '请选择标签'}}
</view>
</view>
<view class="u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">建模评审<text class="color_cda475 u-font-xs">(若驳回,则必须填写意见)</text></view>
<view class="label">
<view>
建模评审
<text class="color_cda475 u-font-xs">(若驳回,则必须填写意见)</text>
<text style="float: right"
@click="$Router.push({
path: '/pages/modeling/reviewHistory',
query: {id:detail.id}
})">
评审历史</text>
</view>
</view>
<view class="u-line-1 u-flex-1 content">
<u-input v-model="modelingTaskReviewer.reviewerComment" placeholder="请输入评审意见"></u-input>
</view>
</view>
</template>
<template v-if="detail.status === 8">
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">评审意见</view>
<view class="u-line-1 u-flex-1 content" >
{{detail.modelingTaskReviewerList[0] ? detail.modelingTaskReviewerList[0].reviewerComment: '无'}}
</view>
</view>
</template>
</view>
<!--委托建模服务商-->
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20" v-if="detail.status >= 4">
......@@ -105,9 +139,12 @@
</view>
<template v-if="detail.status > 4">
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">服务商</view>
<view class="u-m-r-40 label">快递服务商</view>
<view class="u-line-1 u-flex-1 content">
{{detail.modelingTaskSampleInformation.courier}}
{{
(courierList.find((item) => item.value == detail.modelingTaskSampleInformation.courier) || { label: ''}).label
}}
</view>
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
......@@ -119,7 +156,7 @@
</template>
<template v-if="detail.status === 4">
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">服务商</view>
<view class="u-m-r-40 label">快递服务商</view>
<view class="u-line-1 u-flex-1 content">
<u-input v-model="formData.courierText" readonly placeholder="请选择快递" type="select" :select-open="show" @click="show = true;"/>
</view>
......@@ -216,10 +253,12 @@
<view class="u-m-r-40 label width_300">设计机构提供颜色数量</view>
<view class="u-line-1 u-flex-1 content ">{{ designAgencyColourQuantity }}</view>
</view>
<!-- <view class="u-flex u-m-t-18 u-m-b-8">-->
<!-- <view class="u-m-r-40 label width_300">设计机构提供颜色名称</view>-->
<!-- <view class="u-flex-1 content wordKeepAll"></view>-->
<!-- </view>-->
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label width_300">设计机构提供颜色名称</view>
<view class="u-flex-1 content wordKeepAll">
{{taskColorNames}}
</view>
</view>
</view>
</view>
......@@ -240,6 +279,12 @@
<view class="title">建模合格</view>
</view>
</view>
<view class="custom-style-round-circle custom-style-btn custom-style" v-if="detail.status === 3">
<!-- <view class="custom-style-left save" @click="cancel(3)">撤回</view>-->
<view class="custom-style-right submit" @click="cancel">
<view class="title">撤回</view>
</view>
</view>
</view>
</view>
......@@ -251,6 +296,7 @@
<!--建模品类选择-->
<u-select mode="single-column" :list="courierList" v-model="show" @confirm="confirm">
</u-select>
</view>
</template>
......@@ -295,19 +341,19 @@ export default {
},
show: false,
courierList: [
{ label: '顺丰', value: 0},
{ label: 'EMS', value: 1},
{ label: '邮政包裹', value: 2},
{ label: '百世汇通', value: 3},
{ label: '申通', value: 4},
{ label: '中通', value: 5},
{ label: '圆通', value: 6},
{ label: '国通', value: 7},
{ label: '韵达', value: 8},
{ label: '天天', value: 9},
{ label: '优速', value: 10},
{ label: '京东', value: 11},
{ label: '宅急送', value: 12},
{ label: '顺丰', value: "0"},
{ label: 'EMS', value: "1"},
{ label: '邮政包裹', value: "2"},
{ label: '百世汇通', value: "3"},
{ label: '申通', value: "4"},
{ label: '中通', value: "5"},
{ label: '圆通', value: "6"},
{ label: '国通', value: "7"},
{ label: '韵达', value: "8"},
{ label: '天天', value: "9"},
{ label: '优速', value: "10"},
{ label: '京东', value: "11"},
{ label: '宅急送', value: "12"},
],
modelingTaskReviewer:{
isDeleted: false,
......@@ -321,10 +367,18 @@ export default {
.filter(item => item.isDeleted === false)
.map((item) => item.labelName).join("|")
},
activeTaskMaterialColour(){
return this.detail.modelingTaskMaterialColourList
.filter((item) => item.isDeleted === false && item.type === 2)
},
colourNameList(){
return this.detail.modelingTaskColourDTOList
.map((item) => item.colourName).join("|")
},
taskColorNames(){
return this.activeTaskMaterialColour
.map((item) => item.colorName).join("|")
},
designAgencyColourQuantity(){
return 10 - this.detail.clothRowColourQuantity
},
......@@ -334,7 +388,7 @@ export default {
},
// 2-设计机构提供颜色
modelingTaskMaterialColourList_type2(){
return this.detail.modelingTaskMaterialColourList.filter(item => item.type === 2)
return this.detail.modelingTaskMaterialColourList.filter(item => item.type === 3 )
},
status(){
if([1,2].indexOf(this.detail.oddStatus) > -1){
......@@ -364,7 +418,19 @@ export default {
...this.formData,
modelingTaskId: this.detail.id
}).then(res =>{
let {
code ,msg
} = data;
if(code === 200){
this.$refs.uToast.show({
title: msg,
back: true
});
}else{
this.$refs.uToast.show({
title: msg
});
}
})
},
confirmHttp(data){
......@@ -372,18 +438,56 @@ export default {
...this.detail,
...data,
modelingTaskReviewer:this.modelingTaskReviewer
}).then(res =>{
this.$refs.uToast.show({
title: msg,
back: true
});
})
},
validate(){
validate(operationType,callback){
if(operationType === 3){
if(!this.modelingTaskReviewer.reviewerComment){
this.$refs.uToast.show({
title: '驳回理由不能为空'
})
} else{
callback();
}
}else{
if(this.detail.modelingTaskLabelList.length === 0){
this.$refs.uToast.show({
title: '建模标签不能为空'
})
} else {
callback();
}
}
},
cancel(){
this.$http("modeling.withdraw", {
...this.detail
}).then(res =>{
let {
code,msg
} = res;
if(code === 200){
this.$refs.uToast.show({
title: msg,
back: true
});
}else{
this.$refs.uToast.show({
title: msg,
});
}
})
},
taskConfirm(operationType){
this.validate(operationType,() =>{
this.confirmHttp({operationType})
// if(operationType === 2){
//
// }else{
// this.v
// }
})
},
getDetail(id){
this.$http("modeling.detail",{ modelingTaskId:id })
......@@ -395,7 +499,8 @@ export default {
this.detail = Object.assign({},data,{
modelingCategoryText: data['modelingCategory']['name'],
modelingTaskColourDTOList: data['modelingTaskColourList'],
modelingTaskPictureDTOList: data['modelingTaskPictureList']
modelingTaskPictureDTOList: data['modelingTaskPictureList'],
// modelingTaskSampleInformation:
});
// 委托建模服务商
let info = data.modelingTaskSampleInformation;
......@@ -403,7 +508,7 @@ export default {
trackingNumber: info.trackingNumber,
courier: info.courier,
id: info.id,
courierText: this.courierList.find((item) => item.value == info.courier).label
courierText: (this.courierList.find((item) => item.value == info.courier) || { label: ''}).label
}
}
})
......@@ -413,6 +518,13 @@ export default {
</script>
<style scoped lang="scss">
.error{
color: #f95253;
}
.warning{
color: rgb(95 81 64);
}
.lightgrey{
color: lightgrey;
font-size: 28rpx;
......
......@@ -10,3 +10,5 @@
撤回 3
催单
面料 布行
<template>
<view>
<!--导航栏 navbar-->
<u-navbar title="评审历史" id="header"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
<view class="body u-p-30" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 u-m-b-20" >
<view v-for="(item,index) in detail.modelingTaskReviewerList">
<view class="u-border-bottom u-p-t-14 u-p-b-14">
{{detail.modelingTaskReviewerList.length - index}}次评审
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">评审人</view>
<view class="u-line-1 u-flex-1 content">
{{ detail.enterpriseName }}
</view>
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">评审时间</view>
<view class="u-line-1 u-flex-1 content">
{{ detail.createTime }}
</view>
</view>
<view class="u-flex u-m-t-18 u-m-b-8">
<view class="u-m-r-40 label">评审意见</view>
<view class="u-line-1 u-flex-1 content">
{{ detail.reviewerComment }}
</view>
</view>
</view>
</view>
</view>
<view class="footer" id="footer" ></view>
</view>
</template>
<script>
import dom from "../../mixins/dom"
import utils from "../../mixins/utils";
export default {
name: "reviewHistory",
mixins:[dom,utils],
data(){
return {
detail:{
clothRowColourQuantity: 0, // 布行指定面料颜色数量
clothWidth: 0, // 门幅
clothWidthUnit: 'cm', // 门幅单位
component: '', // 成分
// designAgencyColourQuantity: '', // 设计机构提供的颜色数量
expirationDate: '', // 截止日期
materialName: '', // 面料名称
modelingCategoryId: '', // 建模品类id
modelingCategoryText: '', // 建模品类文本
modelingTaskColourDTOList: [], // 布行指定面料颜色名称集合
modelingTaskPictureDTOList: [
{pictureType: 1},
{pictureType: 2},
], // 建模单 图片信息
price: 0,
modelingTaskSampleInformation: {},
modelingTaskMaterialColourList: [],
modelingTaskLabelList: [] , // 建模任务的标签
modelingTaskReviewerList: [] , // 历史评论
},
}
},
onLoad({id}){
if(id){
this.getDetail(id)
}
},
methods:{
getDetail(id){
this.$http("modeling.detail",{ modelingTaskId:id })
.then(res => {
let {
code, data
} = res;
if(code === 200){
this.detail = Object.assign({},data,{
modelingCategoryText: data['modelingCategory']['name'],
modelingTaskColourDTOList: data['modelingTaskColourList'],
modelingTaskPictureDTOList: data['modelingTaskPictureList']
});
}
})
},
}
}
</script>
<style scoped lang="scss">
.bg-fff{
background: #fff;
}
.body{
background: #fafafa;
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.label{
color: rgba(0,0,0,0.40);
font-size: 28rpx;
min-width: 140rpx;
}
</style>
<template>
<view>
<u-navbar title="添加标签" id="header"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</u-navbar>
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="bg-fff u-p-30" >
<view class="u-m-b-16">已有标签</view>
<view class="u-flex ">
<view class="tags overflow">
<view v-for="item in computedModelingTaskLabelList" class="tag active">
{{item.labelName}}
</view>
</view>
<view class="u-p-l-20">
<u-input v-model="key" @confirm="enter" placeholder="选择或输入标签"></u-input>
</view>
</view>
</view>
<view class="u-p-30">
<view class="u-m-b-20">可选标签</view>
<view class="">
<view class="tag u-p-l-42 u-p-r-42" v-for="item in materialLabelList"
:class="[computedModelingTaskLabelIds.indexOf(item.materialLabelId) > -1 ? 'active':'']"
@click="triggerClick(item)">
{{item.labelName}}
</view>
</view>
</view>
</view>
<view class="footer" id="footer">
<!-- <view class="u-flex">-->
<!-- <view class="u-flex-1"></view>-->
<!-- <view class="custom-style-round-circle custom-style-btn custom-style dialog-btn">-->
<!-- <view class="custom-style-right" @click="submitLabel">确定</view>-->
<!-- </view>-->
<!-- </view>-->
<view class="u-p-t-18 u-p-r-30 u-p-b-18 u-p-l-30">
<view class="u-flex">
<view class="u-flex-1"></view>
<view class="custom-style-round-circle custom-style-btn custom-style dialog-btn u-m-r-20 ">
<view class="custom-style-right cancel" @click="$Router.back()">取消</view>
</view>
<view class="custom-style-round-circle custom-style-btn custom-style dialog-btn">
<view class="custom-style-right" @click="submitLabel">确定</view>
</view>
</view>
</view>
</view>
<!--提示-->
<u-toast ref="uToast" />
</view>
</template>
<script>
import dom from "../../mixins/dom";
export default {
name: "tags",
mixins: [dom],
data(){
return {
key: '',
id: '',
detail:{
clothRowColourQuantity: 0, // 布行指定面料颜色数量
clothWidth: 0, // 门幅
clothWidthUnit: 'cm', // 门幅单位
component: '', // 成分
// designAgencyColourQuantity: '', // 设计机构提供的颜色数量
expirationDate: '', // 截止日期
materialName: '', // 面料名称
modelingCategoryId: '', // 建模品类id
modelingCategoryText: '', // 建模品类文本
modelingTaskColourDTOList: [], // 布行指定面料颜色名称集合
modelingTaskPictureDTOList: [
{pictureType: 1},
{pictureType: 2},
], // 建模单 图片信息
price: 0,
modelingTaskSampleInformation: {},
modelingTaskMaterialColourList: [],
modelingTaskLabelList: [] , // 建模任务的标签
modelingTaskReviewerList: [] , // 历史评论
},
materialLabelList: [],
}
},
computed:{
// selectedTagIdList(){
// return this.detail.modelingTaskLabelList.map((item) => item.id);
// },
// computedMaterialLabelList(){
// return this.materialLabelList.filter((item) => !item.isDeleted && this.selectedTagIdList.indexOf(item.id) === -1)
// },
computedModelingTaskLabelList(){
return this.detail.modelingTaskLabelList.filter((item) => !item.isDeleted)
},
computedModelingTaskLabelIds(){
return this.computedModelingTaskLabelList.map((item) => item.materialLabelId);
}
},
onLoad({id}){
this.labelListTo();
if(id){
this.id = id;
this.getDetail(id)
}
},
methods:{
enter(value){
// let data = {
// createTime: "2021-12-31 16:45:43",
// createUser: "钱星",
// enterpriseId: 26,
// id: 4,
// isDeleted: false,
// labelName: "11",
// labelType: 0,
// updateTime: "",
// updateUser: "",
// }
// this.materialLabelList.push(data);
// let { id ,...other} = data;
// this.detail.modelingTaskLabelList.push({
// ...other,
// materialLabelId: data.id,
// modelingTaskId: this.detail.id
// })
this.$http("materialLabel.save",{
"labelName": value,
"labelType": 0
}).then(res =>{
let {
code, data,msg
} = res;
if(code === 200){
this.materialLabelList.push(data);
let { id ,...other} = data;
this.this.detail.modelingTaskLabelList.push({
...other,
materialLabelId: data.id,
modelingTaskId: this.id
})
}else{
this.$refs.uToast.show({
title: msg
})
this.labelListTo();
}
})
},
triggerClick(item){
let list = this.detail.modelingTaskLabelList;
let $Item = list.find(($i) => $i.materialLabelId === item.materialLabelId);
// debugger
if($Item){
if($Item.id){
this.$set($Item,'isDeleted',true)
}else{
let index = this.detail.modelingTaskLabelList.findIndex(($v) => $v === $Item)
if(index > -1){
this.detail.modelingTaskLabelList.splice(index,1)
}
}
}else{
this.detail.modelingTaskLabelList.push(item)
}
},
submitLabel(){
// console.log(this.detail.modelingTaskLabelList)
this.$http("modeling.saveOrUpdateLabel", this.detail.modelingTaskLabelList)
.then(res =>{
let {
code, data,msg
} = res;
if(code === 200){
}
})
},
labelListTo(){
this.$http("materialLabel.list",{
isDeleted: 0
}).then(res =>{
let {
code, data
} = res;
if(
code === 200
){
this.materialLabelList = data.platformLabel.map(($item) => {
let { id, ...item} = $item;
return {
...item,
materialLabelId: id,
modelingTaskId: this.id
}
});
// console.log(this.materialLabelList)
}
})
},
getDetail(id){
this.$http("modeling.detail",{ modelingTaskId:id })
.then(res => {
let {
code, data
} = res;
if(code === 200){
this.detail = Object.assign({},data,{
modelingCategoryText: data['modelingCategory']['name'],
modelingTaskColourDTOList: data['modelingTaskColourList'],
modelingTaskPictureDTOList: data['modelingTaskPictureList']
});
}
})
},
}
}
</script>
<style scoped lang="scss">
.bg-fff{
background: #fff;
}
.dialog-btn{
width: 160rpx;
height: 64rpx;
}
.overflow{
white-space: nowrap;
overflow-x: auto;
overflow-y: scroll;
}
.tags{
max-width: 80%;
}
.tag{
border-radius: 32rpx;
color: #818181;
background: #e4e4e4;
display: inline-block;
min-width: 100rpx;
text-align: center;
line-height: 64rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
&.active{
color: #b89874;
background: #efe8e0;
}
}
.body{
background: #f4f4f4;
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
box-shadow: 0px -4rpx 6rpx 0px rgba(178,182,214,0.10);
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn{
padding: 20rpx 60rpx;
}
}
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.custom-style{
color: #fff; height: 88rpx; line-height: 88rpx;
@include vue-flex;
&-btn{
overflow: hidden;
border: 1px solid rgba(0,0,0,0.80);
}
&-round-circle{
border-radius: 100rpx;
}
/*background: #000;*/
.custom-style-left{ width: 240rpx; background: #d6d6d6; text-align: center }
.custom-style-right{ flex: 1; background: rgba(0,0,0,0.80);text-align: center}
.save{
font-size: 34rpx;
color: #000000;
}
.cancel{
font-size: 34rpx;
color: rgba(0,0,0,0.80);
background: #fff;
}
.submit{
font-weight: 500;
font-size: 34rpx;
.desc{
font-size: 20rpx;
.color{
color: #DDA973;
}
}
}
}
</style>
获取token => userId && enterpriseId =>
=>
<!--我的-->
<template>
<view>
<view class="">
<text class="u-font-40">我的</text>
<text class="">my</text>
</view>
<view>
<view class=""></view>
</view>
<hs-tab-bar></hs-tab-bar>
</view>
</template>
<script>
import HsTabBar from "../../../components/hs-tab-bar/hs-tab-bar";
export default {
name: "index",
components: {HsTabBar},
data(){
return{
}
}
}
</script>
<style scoped>
</style>
<!--todo 页面逻辑重新过滤-->
<!-- 完善信息 -->
<template>
<view>
<view class="body" :style="{ bottom: footerHeight + 'px'}">
<!-- 操作step -->
<view class="u-p-30">
<steps :list="steps" :current="current"></steps>
</view>
<!-- 身份选择 -->
<view v-if="current === 0">
<view class="u-p-30">
<user-select :list="userSelect" @change="userSelectCallback"></user-select>
</view>
</view>
<!-- 完善信息 -->
<view v-if="current === 1">
<!-- 面料供应商 -->
<template v-if="assignType === 1">
<u-form labelWidth="100" labelPosition="top" class="bg-fff">
<u-form-item label="企业名称" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.enterpriseName" :border="false" placeholder="请输入企业名称" />
</u-form-item>
<u-form-item label="企业联系人" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.corporateContactName" :border="false" placeholder="请输入企业联系人" />
</u-form-item>
</u-form>
<view class="u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30 u-m-b-30 u-m-t-30 bg-fff">
<view v-for="(item,index) in subsidiaryInfo" :key="index">
<view class="u-flex">
<view class="u-flex-1">
<view class="title u-m-r-22">
<view class="line"></view>
档口{{ index + 1 }}
</view>
<text class="button--delete" @click.stop="delBrandRow(item)">删除</text>
</view>
<view @click="delSubsidiaryInfoRow(index)">
{{
brandActive === index ? "收起":"展开"
}}
</view>
</view>
<view class="collapse-body" :style="[{
height: brandActive === index ? 'auto' : '0'
}]">
<u-form labelWidth="100" labelPosition="top" >
<u-form-item label="档口名称" :style="style">
<u-input v-model="item.stallName" :border="false" placeholder="请输入档口名称" />
</u-form-item>
<u-form-item label="档口地址" :style="style">
<u-input v-model="item.stallAddress" :border="false" placeholder="请输入档口地址"
/>
</u-form-item>
</u-form>
</view>
</view>
</view>
<view class="button-plain" @click="addSubsidiaryInfoRow">+添加档口</view>
</template>
<!-- 我要选款 -->
<template v-if="assignType === 2">
<u-form labelWidth="100" labelPosition="top" class="bg-fff">
<u-form-item label="企业名称" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.enterpriseName" :border="false" placeholder="请输入企业名称" />
</u-form-item>
<u-form-item label="企业联系人" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.corporateContactName" :border="false" placeholder="请输入企业联系人" />
</u-form-item>
<u-form-item label="档口地址" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input :border="false" placeholder="请输入档口地址"
v-model="form2.subsidiaryInfoDTOList[form2.subsidiaryInfoDTOList.length - 1].stallAddress"
/>
</u-form-item>
</u-form>
<view class="u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30 u-m-b-30 u-m-t-30 bg-fff">
<view v-for="(item,index) in brandInfo" :key="index">
<view class="u-flex">
<view class="u-flex-1">
<view class="title u-m-r-22">
<view class="line"></view>
品牌{{ index + 1 }}
</view>
<text class="button--delete" @click.stop="delBrandRow(item)">删除</text>
</view>
<view @click="brandCollapseChange(index)">
{{
brandActive === index ? "收起":"展开"
}}
</view>
</view>
<view class="collapse-body" :style="[{
height: brandActive === index ? 'auto' : '0'
}]">
<u-form labelWidth="100" labelPosition="top" >
<u-form-item label="品牌名称" :style="style">
<u-input v-model="item.brandName" :border="false" placeholder="请输入品牌名称" />
</u-form-item>
<u-form-item label="品牌定位" :style="style">
<u-input v-model="item.brandFixedText" :border="false" placeholder="请输入品牌定位"
:select-open="show"
type="select" @click="() => { show = true; rowIndex = index}"
readonly/>
</u-form-item>
</u-form>
</view>
</view>
</view>
<view class="button-plain" @click="addBrandRow">+添加品牌</view>
<u-select v-model="show" mode="single-column" :list="column" @confirm="selectConfirm"></u-select>
</template>
<!-- 设计机构 -->
<template v-if="assignType === 3">
<u-form labelWidth="150" labelPosition="top">
<u-form-item label="机构名称" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.enterpriseName" :border="false" placeholder="请输入机构名称" />
</u-form-item>
<u-form-item label="机构联系人" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.corporateContactName" :border="false" placeholder="请输入机构联系人" />
</u-form-item>
<u-form-item label="机构地址" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.institutionAddress" :border="false" placeholder="请输入机构地址" />
</u-form-item>
<u-form-item label="合作方式(可多选)" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-checkbox-group>
<view class="u-tag u-size-default u-shape-circle u-mode-plain-primary"
:key="index"
v-for="(item, index) in checkbox">
<u-checkbox iconClass="displayNone" @change="checkChange"
v-model="item.checked"
:name="item.value"
>{{item.label}}</u-checkbox>
</view>
</u-checkbox-group>
</u-form-item>
</u-form>
</template>
<!-- 检测结构 -->
<template v-if="assignType === 4">
<u-form labelWidth="100" labelPosition="top">
<u-form-item label="机构名称" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.enterpriseName" :border="false" placeholder="请输入机构名称" />
</u-form-item>
<u-form-item label="机构联系人" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.corporateContactName" :border="false" placeholder="请输入机构联系人" />
</u-form-item>
<u-form-item label="机构地址" class="u-border-bottom u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" :style="style">
<u-input v-model="formData.institutionAddress" :border="false" placeholder="请输入机构地址" />
</u-form-item>
</u-form>
</template>
</view>
<!-- 完成 -->
<view v-if="current === 2">
<view class="status u-text-center">
<view class="circle">
<u-icon name="checkbox-mark" color="#fff" size="36"></u-icon>
</view>
<view class="u-m-t-40">
<view class="status-text">
{{
error ? "提交失败" : "提交成功"
}}
</view>
<view v-if="error" class="status-desc">请返回上一步重新提交</view>
<view v-if="!error" class="status-desc">
<view>确认后立刻跳转首页</view>
<view>({{time}}秒)后自动跳转</view>
</view>
</view>
</view>
</view>
<!-- 删除模态框 -->
<!-- <u-modal v-model="modal.show" :content="modal.content" @confirm="modalConfirm" ></u-modal>-->
</view>
<!-- 底部按钮 -->
<view class="footer" id="footer">
<view class="footer-btn u-p-t-12 u-p-r-60 u-p-b-12 u-p-l-60">
<u-button type="primary" @click="next" shape="circle" :disabled="assignType === -1" v-if="current === 0">下一步
</u-button>
<u-button type="primary" @click="submit" shape="circle" v-if="current === 1" :disabled="!canSubmit">下一步</u-button>
<u-button type="primary" @click="back" shape="circle" v-if="current === 2 && error">返回</u-button>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import UserSelect from "./register/components/UserSelect";
import Steps from "./register/components/Steps";
export default {
name: "register",
components: {Steps, UserSelect},
data(){
return{
current: 0,
userSelect: [
{
title: "我是面料供应商",
desc: "Fabric supplier",
imgSrc: "/static/images/index/userSelect/type_1.png",
activeImgSrc: "/static/images/index/userSelect/type_1_active.png",
},
{
title: "我要选款",
desc: "I want to choose",
imgSrc: "/static/images/index/userSelect/type_2.png",
activeImgSrc: "/static/images/index/userSelect/type_2_active.png",
},
{
title: "我是设计机构",
desc: "Design agency",
imgSrc: "/static/images/index/userSelect/type_3.png",
activeImgSrc: "/static/images/index/userSelect/type_3_active.png",
},
{
title: "我是检测机构",
desc: "Testing institutions",
imgSrc: "/static/images/index/userSelect/type_4.png",
activeImgSrc: "/static/images/index/userSelect/type_4_active.png",
}
],
assignType: -1, //身份类型: 1-我是面料供应商 2-我要选款 3-我是设计机构 4-我是检测机构
steps: [
{
title: '第一步',
desc: '选择身份'
},
{
title: '第二步',
desc: '完善信息'
},
{
title: '第三步',
desc: '完成'
}
],
formData:{
"enterpriseName": "", //企业名称
"corporateContactName": "", //企业联系人姓名
"institutionAddress": "" //企业/机构地址
},
error: true,
time: 3,
// modal:{
// show: false,
// content: "确认删除?"
// },
show: false,
rowIndex: null,
row: {},
column: [
{
value: '1',
label: '高端'
},
{
value: '2',
label: '终端'
}
],
typeDir: [
{
label: "承接面料建模",
value: 1,
},
{
label: "承接款式开发",
value: 2
},
],
style: {lineHeight: 'inherit'},
comData:{
pcBasicsId: '', //PC端注册的企业id
pcUserId: '', //PC端注册的企业id
corporateContactId: '', //企业联系人id
institutionAddressId: '',//企业/机构地址id
// "pcBasicsId": 5,
// "pcUserId": "1422769059341709341"
},
form1:{
subsidiaryInfoDTOList: [
// {
// "stallAddress": "档口地址", //档口地址
// "stallName": "档口名称" //档口名称
// }
]
},
form2:{
subsidiaryInfoDTOList:[
{stallAddress: ''}
],
brandInfoDTOList: [
// {
// "brandName": "品牌名称", //品牌名称
// "brandFixed": "品牌定位" //品牌定位
// }
]
},
form3:{
cooperationMethodList: [] // 合作方式
},
form4:{},
footerHeight: 0,
isInit: true,
status:{
isBrandOwner: 0, // 我要选款
isDesignAgency: 0, // 完善设计机构信息
isFabricSupplier: 0, //完善面料供应商信息
isTestingFacility: 0, // 完善检测机构信息
},
brandActive: 0,
infoActive: 0,
}
},
computed:{
canSubmit(){
if(this.assignType === 4){
return this.formData.corporateContactName && this.formData.enterpriseName && this.formData.institutionAddress;
}else if(this.assignType === 3){
return this.formData.corporateContactName && this.formData.enterpriseName && this.formData.institutionAddress && this.form3.cooperationMethodList.length > 0;
}else if(this.assignType === 2){
return this.formData.corporateContactName && this.formData.enterpriseName && (
this.form2.brandInfoDTOList.length === 0 ||
this.validateBrandItem(
this.form2.brandInfoDTOList.filter((item) =>{
return item.isDeleted === false
})
)
)
}else {
return (
this.formData.corporateContactName && this.formData.enterpriseName && (
this.form1.subsidiaryInfoDTOList.length === 0 ||
this.validateInfoItem(
this.form1.subsidiaryInfoDTOList.filter((item) =>{
return item.isDeleted === false
})
)
)
)
}
},
checkbox(){
let value = this.form3.cooperationMethodList,
{typeDir} = this,
res = [];
for (let i = 0; i < typeDir.length; i++) {
res.push({
...typeDir[i],
checked: value.indexOf(typeDir[i].value) > -1
})
}
return res;
},
subsidiaryInfo(){
return this.form1.subsidiaryInfoDTOList.filter((item) =>{
return item.isDeleted === false
})
},
brandInfo(){
return this.form2.brandInfoDTOList.filter((item) =>{
return item.isDeleted === false
})
}
},
onLoad(options) {
let {
// pcUserId,
// pcBasicsId,
// tenantUserId,
// tenantId,
redirect
} = options;
this.comData = {
...options,
...{
pcUserId: uni.getStorageSync("pcUserId") || options.pcUserId,
pcBasicsId: uni.getStorageSync("pcBasicsId") || options.pcBasicsId,
tenantId: uni.getStorageSync("tenantId") || options.tenantId,
}
};
this.isInit = redirect !== "1";
this.checkStatus();
},
mounted() {
this.uGetRect("#footer").then(res =>{
this.footerHeight = res.height;
})
},
methods:{
validateInfoItem(data){
let res = true;
for (let i = 0; i < data.length; i++) {
let item = data[i];
if(item.stallAddress && item.stallName){
}else{
res = false
}
}
return res;
},
validateBrandItem(data){
let res = true;
for (let i = 0; i < data.length; i++) {
let item = data[i];
if(item.brandName && item.brandFixed){
}else{
res = false
}
}
return res;
},
brandCollapseChange(index){
this.brandActive = this.brandActive === index ? null: index;
},
InfoCollapseChange(index){
this.infoActive = this.infoActive === index ? null: index;
},
// 注册成功 跳转到首页
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
// 获取详情 过滤状态 如果完善就跳转首页
filterStatus(data){
// 0-未完善 1-已完善
let{
isBrandOwner, // 我要选款
isDesignAgency, // 完善设计机构信息
isFabricSupplier, //完善面料供应商信息
isTestingFacility, // 完善检测机构信息
} = data;
// 存一份身份状态
this.status = data;
let { isInit, assignType} = this;
switch (assignType){
case 1:
isFabricSupplier && isInit ? this.goIndex() : '';
return ;
case 2:
isBrandOwner && isInit ? this.goIndex() : '';
return ;
case 3:
isDesignAgency && isInit ? this.goIndex() : '';
return ;
case 4:
isTestingFacility && isInit ? this.goIndex() : "";
return ;
}
},
checkStatus(){
this.$http(
"user.checkMagStatus",
this.comData
).then(res =>{
let { code ,data} = res;
if(code === 200){
// 1-面料供应商, 2-品牌商, 3-设计机构, 4-检测机构
let { identityType} = data.userLastIdentity;
if(identityType){
this.assignType = identityType;
this.filterStatus(data)
}
}
})
},
getItem(){
this.$http(
"user.getItemMsg",
{
...this.comData,
assignType: this.assignType
}
).then(res =>{
let { code ,data} = res;
if(code === 200){
let {identityType,
supplierStudioCooperationMethodList,
addressList,
brandInfoList,
basics,
contact
} = data;
if(identityType !== -1){
this.assignType = identityType;
}
this.form3.cooperationMethodList = supplierStudioCooperationMethodList['cooperationMethod'] || [];
this.form1.subsidiaryInfoDTOList = addressList.length > 0 ? addressList.map((item) =>{
return {
...item,
stallAddress: item.detailedAddress,
}
}) : [
{stallAddress: ''}
]
this.form2.brandInfoDTOList = brandInfoList.map((item) => {
return{
...item,
brandFixedText: this.column.find(($item) => {
return $item.value === item.brandFixed
})?.label || ''
}
}) || [];
this.form2.subsidiaryInfoDTOList = addressList.length > 0 ? addressList.map((item) =>{
return {
...item,
stallAddress: item.detailedAddress,
}
}): [
{stallAddress:'' ,isDeleted: false}
]
this.formData = {
enterpriseName: basics.fullName,
corporateContactName: contact[contact.length - 1]?.name || '',
institutionAddress: addressList[addressList.length - 1]?.detailedAddress || '',
corporateContactId: contact[contact.length - 1]?.id || '', //企业联系人id
institutionAddressId: addressList[addressList.length - 1]?.id || '',//企业/机构地址id
}
if(this.isInit){
this.next();
}
// this.comData =
}
})
},
uGetRect(selector, all) {
return new Promise((resolve) => {
uni.createSelectorQuery()
.in(this)[all ? 'selectAll' : 'select'](selector)
.boundingClientRect((rect) => {
if (all && Array.isArray(rect) && rect.length) {
resolve(rect)
}
if (!all && rect) {
resolve(rect)
}
})
.exec()
})
},
userSelectCallback(type){
this.assignType = type;
let {
pcUserId,
pcBasicsId
} = this.comData;
if(pcUserId && pcBasicsId){
this.getItem();
}
},
// 重新选择时 核对当前选中状态
checkStatusByType(assignType){
let{
isBrandOwner, // 我要选款
isDesignAgency, // 完善设计机构信息
isFabricSupplier, //完善面料供应商信息
isTestingFacility, // 完善检测机构信息
} = this.status;
switch (assignType){
case 1:
isFabricSupplier ? this.goIndex() : '';
return ;
case 2:
isBrandOwner ? this.goIndex() : '';
return ;
case 3:
isDesignAgency ? this.goIndex() : '';
return ;
case 4:
isTestingFacility ? this.goIndex() : "";
return ;
}
},
next() {
this.checkStatusByType(this.assignType);
this.current++;
},
back() {
this.current--;
this.time = 3;
},
success() {
let timer = setInterval(() => {
this.time--;
if (this.time === 0) {
clearInterval(timer);
this.$Router.replace({
path: '/pages/home/index'
})
}
}, 1000);
},
filterData(type){
switch (type){
case 1:
return this.form1;
case 2:
return this.form2
case 3:
return this.form3
case 4:
return this.form4
}
},
getData(){
return {
...this.comData,
...this.formData,
assignType: this.assignType,
...this.filterData(this.assignType),
}
},
submit() {
// return;
this.$http(
"user.register",
this.getData()
).then(res =>{
let { code ,data} = res;
this.next();
if(code === 200){
uni.setStorageSync("identityType", this.assignType);
this.error = false;
this.createToken(data,()=>{
this.success();
})
}else{
this.error = true;
}
})
},
createToken(data,callback){
this.$http("auth.createTokenByApp" ,data).then(res =>{
let {
code, data
} = res;
if(code === 200){
uni.setStorageSync('token', data.accessToken);
uni.setStorageSync('pcUserId', data.userId);
uni.setStorageSync('pcBasicsId', data.enterpriseId);
callback();
}
})
},
defaultSubsidiaryInfoRow() {
return {
"stallAddress": "", //品牌名称
"stallName": "", //品牌定位
"isDeleted": false
}
},
addSubsidiaryInfoRow() {
let list = this.form1.subsidiaryInfoDTOList.filter((item) =>{
return item.isDeleted === false
});
if(list.length < 10){
this.form1.subsidiaryInfoDTOList.push(this.defaultSubsidiaryInfoRow())
}else{
this.$refs.uToast.show({
title: '最多添加10条',
})
}
},
delSubsidiaryInfoRow(item,index) {
this.row = item;
this.rowIndex = index;
this.delModal();
// this.modal.show = true;
},
defaultBrandInfoRow() {
return {
"brandName": "", //品牌名称
"brandFixed": "", //品牌定位
"brandFixedText": "", //品牌定位站位文本
"isDeleted": false
}
},
addBrandRow() {
let list = this.form2.brandInfoDTOList.filter((item) =>{
return item.isDeleted === false
});
if(list.length < 10){
this.form2.brandInfoDTOList.push(this.defaultBrandInfoRow())
}else{
this.$refs.uToast.show({
title: '最多添加10条',
})
}
},
delModal(){
uni.showModal({
title: '提示',
content: '是否删除数据',
success: (res) =>{
if (res.confirm) {
this.modalConfirm();
// console.log('用户点击确定');
} else if (res.cancel) {
// console.log('用户点击取消');
}
}
});
},
delBrandRow(item,index) {
this.row = item;
this.rowIndex = index;
this.delModal();
// this.modal.show = true;
},
selectConfirm(e,index){
let item = e[0];
if(this.assignType === 1){
}else{
this.$set(
this.form2.brandInfoDTOList,
this.rowIndex,
{
...this.form2.brandInfoDTOList[this.rowIndex],
brandFixedText: item.label,
brandFixed: item.value
},
)
}
},
modalConfirm(){
if(this.assignType === 2){
let {row} = this, data = this.form2.brandInfoDTOList;
if(row.id){
let index = data.findIndex((item) =>{
return item.id === row.id
});
if(index > -1){
this.$set(data,index,{
...this.row,
isDeleted: true
})
}
}else{
data.splice(
data.findIndex((item) =>{
return item === row;
}),
1);
}
}else{
let {row} = this, data = this.form1.subsidiaryInfoDTOList;
if(row.id){
let index = data.findIndex((item) =>{
return item.id === row.id
});
if(index > -1){
this.$set(this.form1.subsidiaryInfoDTOList,index,{
...this.row,
isDeleted: true
})
}
}else{
data.splice(
data.findIndex((item) =>{
return item === row;
}),
1);
}
}
},
checkChange(e){
let { name, value} = e;
if(value){
this.form3.cooperationMethodList.push(name)
}else{
let index = this.form3.cooperationMethodList.findIndex((item) => {
return item === name
});
this.form3.cooperationMethodList.splice(index,1);
}
}
}
}
</script>
<style scoped lang="scss">
.collapse-body{
overflow: hidden;
transition: all 0.3s;
}
.title {
font-size: 28rpx;
font-weight: 600;
position: relative;
padding-left: 20rpx;
display: inline-block;
.line{
position: absolute;
width: 8rpx;
height: 28rpx;
background-color: #AF8D66;
border-radius: 4rpx;
left: 0;
top: 50%;
margin-top: -14rpx;
}
}
.button--delete{
color: red;
display: inline-block;
}
.button-plain{
text-align: center;
//color: #DDA973;
color: rgb(60, 156, 255);
background: #fff;
line-height: 88rpx;
}
.circle {
border-radius: 50%;
width: 96rpx;
height: 96rpx;
background-color: rgb(60, 156, 255);
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
}
.bg-fff{
background-color: #fff;
}
.body{
background: #fafafa;
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.displayNone{
display: none;
}
.status {
padding-top: 96rpx;
height: 500rpx;
background: #fff;
.status-text {
font-size: 36rpx;
margin-bottom: 16rpx;
}
.status-desc {
color: #999999;
font-size: 26rpx;
line-height: 36rpx;
}
}
.footer {
position: fixed;
width: 100%;
bottom: 0;
z-index: 998;
background: #fff;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.footer-btn {
// padding: 12rpx 60rpx;
}
}
</style>
<template>
<view>
<view v-for="item in mockData" @click="click(item)"
class="item"
:class="[item === active? 'u-border active' :'']">
用户名:{{item.userName}}
</view>
<!-- <button @click="getTenanList">getTenanList</button>-->
<button @click="next" :disabled="active === -1">下一步</button>
<button @click="login">下一步</button>
<!-- <view>encryptToken结果:{{token}}</view>-->
</view>
</template>
<script>
export default {
name: "index",
data(){
return {
back: '',
mockData: [
// {
// "id": 0,
// "userNo": "string",
// "userName": "string",
// "phone": "string",
// "tenantId": "string",
// "tenantCode": "string",
// "tenantName": "string",
// "tenantPlat": "string",
// "globalUserId": "string"
// }
// {globalId: "1375592964957573120", tenantId: "1442659610786926593", subId: "1442659610786926600"}
],
active: -1,
token: "",
userData: {}
}
},
onLoad(){
// #ifdef APP-PLUS
uni.onNativeEventReceive((event,data)=>{
if(event === 'getTenantList'){
this.mockData = JSON.parse(data);
}else if(event === 'encryptToken'){
this.token = data;
uni.setStorageSync('encryptToken', data);
this.login()
}
})
this.getTenanList();
// #endif
},
methods:{
click(item){
this.active = item;
},
getTenanList(){
// 向宿主App发送事件
uni.sendNativeEvent('getTenantList', {
}, ret => {
// 返回的是 String 还是 JsonObject
// this.back = ret;
// this.mockData = JSON.parse(ret);
})
},
encryptToken(){
uni.sendNativeEvent('encryptToken',JSON.stringify(
{
globalId: this.active.globalUserId,
tenantId: this.active.tenantId,
subId: this.active.id,
}
), ret => {
// 返回的是 String 还是 JsonObject
// this.token = ret;
})
},
getToken(){
uni.setStorageSync('encryptToken',"")
},
login(){
// uni.setStorageSync('encryptToken',"MBN9Om00MUE9CEcnizCOwinwRe5NJNdZb4JyDT3/ze+vyyv5QNXVoo0Sb65Gptgdy9BZZFX36tEge08iDEzLHIYsLS95bnrcwUOh1tp9pMiJ0XYNBFnFcHFXP9AgeAmYe9EXW+akUkx4Zr7PGiG7eqhuabLlPisHhoQOBfFFTwQ=")
// 核对
this.$http(
"auth.checkSecretKey",
uni.getStorageSync('encryptToken')
).then(res =>{
let {
code, data
} = res;
if(code === 200){
let {
userId, // 用户id
enterpriseId // 企业id
} = data;
this.userData = data;
uni.setStorageSync('tenantId', data.tenantId);
if(userId && enterpriseId){
this.createToken(data);
}else{
this.toRegister();
}
}
})
},
// 跳转到注册
toRegister(){
let {userId,enterpriseId,subId,tenantId} = this.userData;
this.$Router.push({
path: "/pages/user/register",
query:{
pcUserId: userId || "",
pcBasicsId: enterpriseId || "",
tenantUserId:subId,
tenantId,
}
})
},
// 跳转到首页
toIndexPage(){
this.$Router.push({
path: "/pages/home/index"
})
},
checkStatus(data){
this.$http(
"user.checkMagStatus",{
pcUserId: data.userId,
pcBasicsId: data.enterpriseId,
}).then(res =>{
let { code ,data} = res;
if(code === 200){
// 1-面料供应商, 2-品牌商, 3-设计机构, 4-检测机构
let { identityType} = data.userLastIdentity;
if(identityType){
this.assignType = identityType;
this.filterStatus(data)
}
}
})
},
filterStatus(data){
// 0-未完善 1-已完善
let{
isBrandOwner, // 我要选款
isDesignAgency, // 完善设计机构信息
isFabricSupplier, //完善面料供应商信息
isTestingFacility, // 完善检测机构信息
} = data;
let { assignType} = this;
switch (assignType){
case "1":
isFabricSupplier ? this.toIndexPage() : this.toRegister();
return ;
case "2":
isBrandOwner ? this.toIndexPage() : this.toRegister();
return ;
case "3":
isDesignAgency ? this.toIndexPage() : this.toRegister();
return ;
case "4":
isTestingFacility ? this.toIndexPage() : this.toRegister();
return ;
default:
this.toRegister();
return;
}
},
createToken(data){
this.$http("auth.createTokenByApp" ,{
...data,
...{
identityType: uni.getStorageSync("identityType")
}
}).then(res =>{
let {
code, data
} = res;
if(code === 200){
uni.setStorageSync('token', data.accessToken);
uni.setStorageSync('pcUserId', data.userId);
uni.setStorageSync('pcBasicsId', data.enterpriseId);
// uni.setStorageSync('tenantId', this.userData.tenantId);
this.checkStatus(data);
}
})
},
next(){
this.encryptToken();
// this.encryptToken();
// uni.setStorageSync('encryptToken',"MBN9Om00MUE9CEcnizCOwinwRe5NJNdZb4JyDT3/ze+vyyv5QNXVoo0Sb65Gptgdy9BZZFX36tEge08iDEzLHIYsLS95bnrcwUOh1tp9pMiJ0XYNBFnFcHFXP9AgeAmYe9EXW+akUkx4Zr7PGiG7eqhuabLlPisHhoQOBfFFTwQ=")
// this.$Router.push({
// path: "/pages/user/register"
// })
}
}
}
</script>
<style scoped>
.item{
padding: 30rpx;
}
.active{
color: #1E90FF;
}
</style>
src/static/images/components/tabBar/collection.active.png

1.22 KB

src/static/images/components/tabBar/collection.active@2x.png

2.8 KB

src/static/images/components/tabBar/collection.png

1.05 KB

src/static/images/components/tabBar/collection@2x.png

2.37 KB

src/static/images/components/tabBar/index.active.png

970 Bytes

src/static/images/components/tabBar/index.active@2x.png

1.92 KB

src/static/images/components/tabBar/index.png

860 Bytes

src/static/images/components/tabBar/index@2x.png

1.65 KB

src/static/images/components/tabBar/message.active.png

952 Bytes

src/static/images/components/tabBar/message.active@2x.png

1.97 KB

src/static/images/components/tabBar/message.png

913 Bytes

src/static/images/components/tabBar/message@2x.png

1.85 KB

src/static/images/components/tabBar/my.active.png

1 KB

src/static/images/components/tabBar/my.active@2x.png

2.07 KB

src/static/images/components/tabBar/my.png

853 Bytes

src/static/images/components/tabBar/my@2x.png

1.73 KB

src/static/images/material/status.png

1.64 KB

src/static/images/material/status@2x.png

3.41 KB

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