Commit f8d4dd3d authored by 李星剑's avatar 李星剑

fix:面料建模,登录

parent 740960a6
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:key="tab.name" @tap="switchTabbar(tab, index)" :key="tab.name" @tap="switchTabbar(tab, index)"
:class="[tab.path === currentPath ? 'active':'']"> :class="[tab.path === currentPath ? 'active':'']">
<div class="image"> <div class="image">
<img :src="tab.path === currentPath ? tab.activeImage : tab.image" style="height: 100%;width: 100%;"/> <image :src="tab.path === currentPath ? tab.activeImage : tab.image" style="height: 100%;width: 100%;"/>
<div class="num" v-if="tab.message && cartNum"> <div class="num" v-if="tab.message && cartNum">
{{cartNum}} {{cartNum}}
</div> </div>
...@@ -24,27 +24,80 @@ ...@@ -24,27 +24,80 @@
*/ */
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex'; import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
import { router } from '@/config/router'; import { router } from '@/config/router';
let menuIcon = {
index: {
active: require('@/static/images/components/tabBar/index.active.png'),
default: require('@/static/images/components/tabBar/index.png')
},
message:{
active: require('@/static/images/components/tabBar/message.active.png'),
default: require('@/static/images/components/tabBar/message.png')
},
center:{
active: require('@/static/images/components/tabBar/my.active.png'),
default: require('@/static/images/components/tabBar/my.png')
},
collection:{
active: require('@/static/images/components/tabBar/collection.active.png'),
default: require('@/static/images/components/tabBar/collection.png')
}
};
export default { export default {
name: 'hsTabBar', name: 'hsTabBar',
components: {}, components: {},
data() { data() {
return { return {
currentPath: '', //当前页面路径 currentPath: '', //当前页面路径
cartNum: '100', cartNum: '',
tabbarData: {
style: 1, type1: [
list: [
{ name: '首页', path: '/pages/home/index',activeImage: '',image:'' }, ]
{ name: '消息', path: '',activeImage: '',image:'', message: 1 },
{ name: '我的', path: '/pages/user/center/index',activeImage: '',image:'' },
]
}
}; };
}, },
mounted() { mounted() {
this.currentPath = this.$Route.path === '/pages/home/index' ? this.$Route.path : this.$Route.fullPath; this.currentPath = this.$Route.path ? this.$Route.path : this.$Route.fullPath;
}, },
computed: { computed: {
tabbarData() {
let type = uni.getStorageSync("assignType") || 1;
return {
style: 1,
list: type == 1 ? [
{ name: '首页', path: '/pages/home/index',
activeImage: menuIcon['index'].active,
image: menuIcon['index'].default,
},
{ name: '消息', path: '', message: 1 ,
activeImage: menuIcon['message'].active,
image: menuIcon['message'].default,
},
{ name: '我的',
path: '/pages/user/center/index',
// path: '',
activeImage: menuIcon['center'].active,
image: menuIcon['center'].default,
},
] : [
{ name: '首页', path: '/pages/brands/brands',
activeImage: menuIcon['index'].active,
image: menuIcon['index'].default,
},
{ name: '收藏', path: '/pages/brands/collection',
activeImage: menuIcon['collection'].active,
image: menuIcon['collection'].default,
},
{ name: '我的',
path: '/pages/user/center/index',
// path: '',
activeImage: menuIcon['center'].active,
image: menuIcon['center'].default,
},
]
}
},
// ...mapGetters(['cartNum', 'tabbarData']), // ...mapGetters(['cartNum', 'tabbarData']),
// 底部导航栏列表 // 底部导航栏列表
tabbarList() { tabbarList() {
...@@ -55,12 +108,15 @@ export default { ...@@ -55,12 +108,15 @@ export default {
// 后台tabbarList数据中必需含有'/pages/index/index',不然逻辑混乱 // 后台tabbarList数据中必需含有'/pages/index/index',不然逻辑混乱
showTabbar() { showTabbar() {
if (this.tabbarData && this.tabbarData.list) { if (this.tabbarData && this.tabbarData.list) {
let arr = ['/pages/home/index']; // let arr = ['/pages/home/index'];
let path = ''; // let path = '';
for (let item of this.tabbarData.list) { // for (let item of this.tabbarData.list) {
arr.push(item.path); // arr.push(item.path);
} // }
return arr.includes(this.currentPath); // console.log(this.tabbarData.list.map((item) => item.path))
// console.log(this.currentPath)
return this.tabbarData.list.map((item) => item.path)
.includes(this.currentPath)
} }
} }
}, },
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
import stylelibraryorder from './stylelibraryorder/index' import stylelibraryorder from './stylelibraryorder/index'
import modelingtask from './modelingtask' import modelingtask from './modelingtask'
import mobileBrand from './mobileBrand' import mobileBrand from './mobileBrand'
import branddevelop from "./branddevelop";
export default { export default {
...stylelibraryorder, ...stylelibraryorder,
...modelingtask, ...modelingtask,
...mobileBrand ...mobileBrand,
...branddevelop
} }
...@@ -58,6 +58,10 @@ export default { ...@@ -58,6 +58,10 @@ export default {
'shPay':{ 'shPay':{
url: `${baseUrl}/shPay`, url: `${baseUrl}/shPay`,
method: 'post' method: 'post'
},
'listingDetailsByCode':{
url: `${baseUrl}/listingDetailsByCode`,
method: 'get'
} }
} }
} }
...@@ -47,8 +47,8 @@ export default function http( ...@@ -47,8 +47,8 @@ export default function http(
// token过期注销 // token过期注销
if (response.code === 401) { if (response.code === 401) {
// store.dispatch('logout'); store.dispatch('logout');
// router.push("/pages/user/login/login") router.replace("/pages/home/tenantSelection")
throw (`登录已过期或注销,已阻止此次API请求: '${api.url}'`); throw (`登录已过期或注销,已阻止此次API请求: '${api.url}'`);
} }
return response return response
......
...@@ -17,7 +17,7 @@ export default class Request { ...@@ -17,7 +17,7 @@ export default class Request {
baseUrl: API_URL, baseUrl: API_URL,
header: { header: {
'content-type': 'application/json', 'content-type': 'application/json',
'app': "huansi", // 'app': "huansi",
'Authorization-Basic': 'Basic c3dvcmQ6c3dvcmRfc2VjcmV0', 'Authorization-Basic': 'Basic c3dvcmQ6c3dvcmRfc2VjcmV0',
'platform': platform.get() 'platform': platform.get()
}, },
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<view class="color_FA5353">{{ item.oddStatus == 1 ? '两天无人接单' : '' }} {{ item.oddStatus == 2 ? '未及时完成' : '' }}</view> <view class="color_FA5353">{{ item.oddStatus == 1 ? '两天无人接单' : '' }} {{ item.oddStatus == 2 ? '未及时完成' : '' }}</view>
<view> <view>
<view v-if="item.status == 1" @click="dateilEnt(item, 'edit')" 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 == 3 || item.status == 2" 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.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.oddStatus == 2 && item.status == 5" @click.stop="reminder(item.id)" 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 v-if="item.status == 7" @click="dateilEnt(item,'item' )" class="u-m-l-10 btn">前往审核</view>
......
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
.item{ .item{
padding: 36rpx 30px; padding: 36rpx 30px;
height: 160rpx; height: 160rpx;
background: url(../../static/images/home/exhibition.png) no-repeat; background: url(~@/static/images/home/exhibition.png) no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
margin-bottom: 20rpx; margin-bottom: 20rpx;
color: #fff; color: #fff;
...@@ -281,7 +281,7 @@ export default { ...@@ -281,7 +281,7 @@ export default {
.back_img { .back_img {
height: 486rpx; height: 486rpx;
width: 100%; width: 100%;
background: url(../../static/images/home/exhibition.png) no-repeat; background: url(~@/static/images/home/exhibition.png) no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.home_top { .home_top {
......
...@@ -34,7 +34,11 @@ export default { ...@@ -34,7 +34,11 @@ export default {
return { return {
selectedIndex: -1, selectedIndex: -1,
list: [] // list: []
list: [
// {"id":"1466279033363894272","userNo":"18268270336","userName":"18268270336","phone":"18268270336","tenantId":"1466279033363894272","tenantCode":"18268270336","tenantName":"18268270336","tenantPlat":"saas","globalUserId":"1466279033251729408"},
// {"id":"1466279033363894274","userNo":"18268270336","userName":"18268270336","phone":"18268270336","tenantId":"1466279033363894274","tenantCode":"18268270336dtd","tenantName":"18268270336的团队","tenantPlat":"paas","globalUserId":"1466279033251729408"}
]
}; };
}, },
created() { created() {
...@@ -90,7 +94,7 @@ export default { ...@@ -90,7 +94,7 @@ export default {
// #endif // #endif
}, },
testLogin(){ testLogin(){
uni.setStorageSync('encryptToken',"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJST0xFX0FETUlOIiwidXNlcl9pZCI6IjE0NzM1ODI0NDI5MTEwMjMxMDUiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInVzZXJfbmFtZSI6IiIsIm9hdXRoX2lkIjoiIiwidG9rZW5fdHlwZSI6ImFjY2Vzc190b2tlbiIsImFjY291bnQiOiIiLCJjbGllbnRfaWQiOiJzd29yZCIsImV4cCI6MTY0MDIwMDQwNywibmJmIjoxNjQwMTY0NDA3fQ.b2lDYtf8huuxRSfp0YKAHXgcsx59AEo2omgrE8V1tJQNwFIOTD7GzS-iAbpCalj6QXqw-OnNP9HKbsBEuloAMA")// uni.setStorageSync("encryptToken","11") uni.setStorageSync('encryptToken',"iX8yRPFVwT9LtD7Y4J/1X9OZUVca8RandOim1vTKkt+UGhc9H7rWuNxCbjmAm5Ky2g/xWcC7fNzwpHxX/wG5moHPvT6yqWr5p0EHt63kuc/vAwlPUju5XpFlnY1sfIRwIakXu1pZH4VVPdpB6IHkAtWeoVQjo2cc32Yh16SEWn8=")
this.login() this.login()
}, },
...@@ -98,9 +102,6 @@ export default { ...@@ -98,9 +102,6 @@ export default {
this.selectedIndex = item; this.selectedIndex = item;
}, },
login(){ login(){
// uni.showToast({
// title: "login"
// })
// 核对 // 核对
this.$http( this.$http(
"auth.checkSecretKey", "auth.checkSecretKey",
...@@ -116,6 +117,7 @@ export default { ...@@ -116,6 +117,7 @@ export default {
} = data; } = data;
this.userData = data; this.userData = data;
uni.setStorageSync('tenantId', data.tenantId); uni.setStorageSync('tenantId', data.tenantId);
uni.setStorageSync('assignType', data.identityType);
if(userId && enterpriseId){ if(userId && enterpriseId){
this.createToken(data); this.createToken(data);
}else{ }else{
...@@ -188,12 +190,11 @@ export default { ...@@ -188,12 +190,11 @@ export default {
} }
}, },
createToken(data){ createToken(data){
let identityType = uni.getStorageSync("assignType");
let type = identityType ? {identityType: identityType} : {};
this.$http("auth.createTokenByApp" ,{ this.$http("auth.createTokenByApp" ,{
...data, ...data,
...{ ...type
identityType: uni.getStorageSync("identityType")
}
}).then(res =>{ }).then(res =>{
let { let {
code, data code, data
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
<view v-if="!isEdit"> <view v-if="!isEdit">
<view <view
class="u-absolute prev" class="u-absolute prev"
@click="routerPush(true)" @click="routerPush(false)"
v-if="!isFirst" v-if="!isFirst"
>上一款</view >上一款</view
> >
<view <view
class="u-absolute next" class="u-absolute next"
@click="routerPush(false)" @click="routerPush(true)"
v-if="!isLast" v-if="!isLast"
>下一款</view >下一款</view
> >
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
:class="[selectedMaterial.id === color.id ? 'active' : '']" :class="[selectedMaterial.id === color.id ? 'active' : '']"
v-for="color in MaterialList" v-for="color in MaterialList"
> >
<image src="" style="width: 100%; height: 100%"></image> <image :src="`${$IMG_URL}${color}`" style="width: 100%; height: 100%"></image>
<view class="image-tip u-line-1">{{ color.materialName }}</view> <view class="image-tip u-line-1">{{ color.materialName }}</view>
</view> </view>
</view> </view>
<view class="overflow" v-if="selectedMaterialItemColors.length > 0"> <view class="overflow" v-if="selectedMaterialItemColors.length > 0">
<u-image <u-image
:src="`${$IMG_URL}${item.color}`" :src="`${$IMG_URL}${item.fileCode}`"
width="80rpx" width="80rpx"
height="80rpx" height="80rpx"
:class="[activeColor.id === item.id ? 'active' : '']" :class="[activeColor.id === item.id ? 'active' : '']"
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<view class="image-tip u-line-1">{{ color.colour }}</view> <view class="image-tip u-line-1">{{ color.colourName }}</view>
</view> </view>
</view> </view>
<view v-if="!isEditMode"> <view v-if="!isEditMode">
<view class="image u-m-r-10" v-for="color in mainPartBodyColor"> <view class="image u-m-r-10" v-for="color in mainPartBodyColor">
<image <image
:src="`${$IMG_URL}${color.fileCode}`" :src="`${$IMG_URL}${color.colourApi.fileCode}`"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
mode="aspectFit" mode="aspectFit"
></image> ></image>
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
mode="aspectFit" mode="aspectFit"
></image> ></image>
<view class="image-tip u-line-1">{{ color.colour }}</view> <view class="image-tip u-line-1">{{ color.colourName }}</view>
</view> </view>
</view> </view>
<view v-if="!isEditMode"> <view v-if="!isEditMode">
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
v-for="color in mainPartOtherColor" v-for="color in mainPartOtherColor"
> >
<image <image
:src="`${$IMG_URL}${color.fileCode}`" :src="`${$IMG_URL}${color.colourApi.fileCode}`"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
mode="aspectFit" mode="aspectFit"
></image> ></image>
...@@ -300,18 +300,14 @@ export default { ...@@ -300,18 +300,14 @@ export default {
}); });
}, },
selectedMaterialItemColors() { selectedMaterialItemColors() {
let key = (this.selectedMaterialItem.materialColourVOList || []).map( return (this.selectedMaterialItem.materialColourVOList || [])
(item) => item.colourId .map((item) => {
); return {
return this.colors ...item,
.filter((item) => key.indexOf(item.id) > -1) mdmMaterialColourId: item.colourId,
.map((item) => { materialId: this.selectedMaterialItem.id,
return { };
...item, })
mdmMaterialColourId: item.id,
materialId: this.selectedMaterialItem.id,
};
});
}, },
index() { index() {
return this.list.findIndex((item) => item.id === this.detail.id); return this.list.findIndex((item) => item.id === this.detail.id);
...@@ -327,11 +323,7 @@ export default { ...@@ -327,11 +323,7 @@ export default {
}, },
// 默认的物料颜色可选 // 默认的物料颜色可选
defaultColorList() { defaultColorList() {
let key = (this.materialDetail.materialColourVOList || []).map( return (this.materialDetail.materialColourVOList || [])
(item) => item.colourId
);
return this.colors
.filter((item) => key.indexOf(item.id) > -1)
.map((item) => { .map((item) => {
return { return {
...item, ...item,
...@@ -344,11 +336,14 @@ export default { ...@@ -344,11 +336,14 @@ export default {
selectColorList() { selectColorList() {
// 如果部位是主体 且 存在信息则回填老的数据 // 如果部位是主体 且 存在信息则回填老的数据
if (this.mainPart.length !== 0) { if (this.mainPart.length !== 0) {
console.log(
this.mainPart[0].materialColoursList
)
return this.mainPart[0].materialColoursList.map((item) => { return this.mainPart[0].materialColoursList.map((item) => {
return { return {
...item, ...item,
colour: item.colourName || item.colour, colour: item.colourName || item.colour,
mdmMaterialColourId: item.colourId || item.mdmMaterialColourId, mdmMaterialColourId: item.mdmMaterialColourId,
}; };
}); });
} else { } else {
...@@ -461,7 +456,7 @@ export default { ...@@ -461,7 +456,7 @@ export default {
}, },
pageReload() { pageReload() {
this.$Router.replace({ this.$Router.replace({
path: "pages/material/createMaterial", path: "/pages/material/createMaterial",
query: this.$Route.query, query: this.$Route.query,
}); });
}, },
...@@ -556,7 +551,7 @@ export default { ...@@ -556,7 +551,7 @@ export default {
let index = $data.findIndex( let index = $data.findIndex(
(item) => (item) =>
item.mdmMaterialColourId === color.mdmMaterialColourId && item.mdmMaterialColourId === color.mdmMaterialColourId &&
item.type === 2 && item.type === 0 &&
item.isMainBodyPart === 1 item.isMainBodyPart === 1
); );
if (index > -1) { if (index > -1) {
...@@ -649,6 +644,7 @@ export default { ...@@ -649,6 +644,7 @@ export default {
let parts = (data.styleLibraryPictureVOList || []).sort((a, b) => { let parts = (data.styleLibraryPictureVOList || []).sort((a, b) => {
return a.isMainBodyPart - b.isMainBodyPart < -1; return a.isMainBodyPart - b.isMainBodyPart < -1;
}); });
let selectedList = parts.reduce((res, item) => { let selectedList = parts.reduce((res, item) => {
let selectItem = item["styleLibraryMaterialVOList"].map(($i) => { let selectItem = item["styleLibraryMaterialVOList"].map(($i) => {
return { return {
......
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
</u-navbar> </u-navbar>
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}"> <view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}">
<view class="tip u-m-b-20" v-if="detail.status === 1">剩余59分1秒自动取消上架单</view> <!-- {{createTime | limitTimeFilter}}-->
<view class="tip u-m-b-20" v-if="detail.status === 1 && limitTimeFilter(detail.createTime)">
剩余{{ limitTimeFilter(detail.createTime) }}自动取消上架单
</view>
<view class="u-p-r-30 u-p-l-30"> <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="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"> <view class="u-border-bottom u-l-height-44 u-flex">
...@@ -81,7 +84,7 @@ ...@@ -81,7 +84,7 @@
</view> </view>
<view class="footer" id="footer" v-if="detail.status === 1"> <view class="footer" id="footer" v-if="detail.status === 1">
<view class="footer-btn"> <view class="footer-btn">
<view class="button button-default"> <view class="button button-default" @click="toPay(detail)">
立刻付款 立刻付款
</view> </view>
</view> </view>
...@@ -96,14 +99,28 @@ export default { ...@@ -96,14 +99,28 @@ export default {
mixins:[dom], mixins:[dom],
data(){ data(){
return { return {
title: '待付款',
detail:{ detail:{
styleLibraryTaskItemVOList:[] styleLibraryTaskItemVOList:[]
}, },
end: true end: true,
time: 60 * 60 * 1000,
createTime: '',
ticker: null
} }
}, },
computed:{ computed:{
title(){
let value = this.detail.status;
switch (value) {
case 1:
return '待付款';
case 2:
return '已付款';
case 3:
return '已取消';
}
},
list(){ list(){
let data = this.detail.styleLibraryTaskItemVOList || []; let data = this.detail.styleLibraryTaskItemVOList || [];
return this.end === true && data.length > 3 return this.end === true && data.length > 3
...@@ -115,9 +132,50 @@ export default { ...@@ -115,9 +132,50 @@ export default {
this.getItem(id) this.getItem(id)
}, },
methods:{ methods:{
limitTimeFilter (value,activeTime) {
let start = new Date(value).valueOf(),
end = activeTime - start,
active = this.time;
const MillisecondToDate = mss => {
/* eslint-disable */
let date='';
const days = parseInt(mss / (1000 * 60 * 60 * 24));
const hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
const seconds = (mss % (1000 * 60)) / 1000;
if(days>0){
date+=`${Math.floor(days)} 天`;
}
if(hours>0){
date+=`${Math.floor(hours)} 小时`;
}
if(minutes>0){
date+=`${Math.floor(minutes)} 分钟`;
}
if(seconds>0){
date+=`${Math.floor(seconds)} 秒`;
}
/* eslint-enable */
return date;
};
return active - end > 0 ? MillisecondToDate(active - end) : false;
},
beginTimer() { //这个计时器是每秒减去数组中指定字段的时间
this.ticker = setInterval(() => {
this.createTime = this.createTime - 60;
}, 1000);
},
toggle(){ toggle(){
this.end = !this.end; this.end = !this.end;
}, },
toPay(item){
this.$Router.push({
path: '/pages/webview/index',
query:{
id: item.payOrderCode
}
})
},
getItem(id){ getItem(id){
this.$http("stylelibraryorder.listingDetails",id).then(res =>{ this.$http("stylelibraryorder.listingDetails",id).then(res =>{
let { let {
...@@ -126,6 +184,11 @@ export default { ...@@ -126,6 +184,11 @@ export default {
if(code === 200){ if(code === 200){
if(Object.keys(data).length > 0){ if(Object.keys(data).length > 0){
this.detail = data; this.detail = data;
//这一段是防止进入页面出去后再进来计时器重复启动
if (this.ticker) {
clearInterval(this.ticker);
}
this.beginTimer();
} }
} }
}) })
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
</view> </view>
<view class="item-buttons u-flex-1 u-flex" > <view class="item-buttons u-flex-1 u-flex" >
<!-- v-if="item.putawayStatus === 3"--> <!-- v-if="item.putawayStatus === 3"-->
<view class="button button-plain button-plain--default u-m-r-20" @click.stop.self="cancel(item)" >取消上架</view> <view class="button button-plain button-plain--default u-m-r-20" @click.stop="cancel(item)" >取消上架</view>
<view class="button button-default" v-if="item.status === 1">付款</view> <view class="button button-default" v-if="item.status === 1" @click.stop="toPay(item)">付款</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -104,6 +104,14 @@ export default { ...@@ -104,6 +104,14 @@ export default {
} }
}, },
methods:{ methods:{
toPay(item){
this.$Router.push({
path: '/pages/webview/index',
query:{
id: item.payOrderCode
}
})
},
setStatus(index){ setStatus(index){
this.activeStatus = index; this.activeStatus = index;
this.getList(true); this.getList(true);
...@@ -130,7 +138,6 @@ export default { ...@@ -130,7 +138,6 @@ export default {
}) })
}, },
cancel(item){ cancel(item){
this.$http("stylelibraryorder.unlisted", { id: item.id}) this.$http("stylelibraryorder.unlisted", { id: item.id})
.then(res => { .then(res => {
let { let {
......
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
<view id="header"> <view id="header">
<!--新增委托navbar--> <!--新增委托navbar-->
<view class="navbar u-p-t-20 u-p-r-30 u-p-b-20 u-p-l-30 u-flex"> <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> <u-navbar title="款式委托" :custom-back="() =>{ $Router.back()}"
<text class="u-flex-1 text-center">款式委托</text> :border-bottom="false"
<text @click="goEntrustList">上架单</text> :background="{backgroundColor: 'whitesmoke'}">
<template slot="right">
<text @click="goEntrustList">上架单</text>
</template>
</u-navbar>
</view> </view>
<view class="u-p-30"> <view class="u-p-30">
<u-search placeholder="请输入款式名称或面料名称" v-model="keyword" <u-search placeholder="请输入款式名称或面料名称" v-model="keyword"
...@@ -49,7 +53,11 @@ ...@@ -49,7 +53,11 @@
@click="() => { triggerSelectItem(item)}" @click="() => { triggerSelectItem(item)}"
/> />
<view class="item u-flex-1 u-flex u-p-l-30" @click="goItem(item)"> <view class="item u-flex-1 u-flex u-p-l-30" @click="goItem(item)">
<view class="item-img"></view> <view class="item-img">
<u-image
width="100%" height="100%"
:src="`${$IMG_URL}${item.originalImageCode}`"></u-image>
</view>
<view class="u-flex-1 u-p-l-20"> <view class="u-flex-1 u-p-l-20">
<view class="item-title u-line-1 u-font-28">{{ item.materialName}}</view> <view class="item-title u-line-1 u-font-28">{{ item.materialName}}</view>
<view class="u-flex u-m-t-6 u-m-b-6"> <view class="u-flex u-m-t-6 u-m-b-6">
...@@ -83,14 +91,19 @@ ...@@ -83,14 +91,19 @@
<text class="u-flex-1 u-p-l-30"> <text class="u-flex-1 u-p-l-30">
{{ item.label}} {{ item.label}}
</text> </text>
<u-icon name="arrow-down" <u-icon
:name="checkToggle(index) ? 'arrow-up': 'arrow-down'"
color="#000" size="40" color="#000" size="40"
@click="triggerToggle(index)" @click="triggerToggle(index)"
/> />
</view> </view>
<view class="u-flex u-p-t-30" v-for="item in item.children"> <view class="u-flex u-p-t-30" v-for="item in item.children">
<view class="item u-flex-1 u-flex u-p-l-30" @click="goItem(item)"> <view class="item u-flex-1 u-flex u-p-l-30" @click="goItem(item)">
<view class="item-img"></view> <view class="item-img">
<u-image
width="100%" height="100%"
:src="`${$IMG_URL}${item.originalImageCode}`"></u-image>
</view>
<view class="u-flex-1 u-p-l-20"> <view class="u-flex-1 u-p-l-20">
<view class="item-title u-line-1 u-font-28">{{ item.materialName }}</view> <view class="item-title u-line-1 u-font-28">{{ item.materialName }}</view>
<view class="u-flex u-m-t-6 u-m-b-6"> <view class="u-flex u-m-t-6 u-m-b-6">
...@@ -134,6 +147,9 @@ ...@@ -134,6 +147,9 @@
<view class="u-flex u-p-t-30"> <view class="u-flex u-p-t-30">
<view class="item u-flex-1 u-flex u-p-l-30"> <view class="item u-flex-1 u-flex u-p-l-30">
<view class="item-img"> <view class="item-img">
<u-image
width="100%" height="100%"
:src="`${$IMG_URL}${item.originalImageCode}`"></u-image>
<!-- <image :src="`${$IMG_URL}${item.pci}`"></image>--> <!-- <image :src="`${$IMG_URL}${item.pci}`"></image>-->
</view> </view>
<view class="u-flex-1 u-p-l-20"> <view class="u-flex-1 u-p-l-20">
...@@ -167,7 +183,7 @@ ...@@ -167,7 +183,7 @@
<view class="footer-btn"> <view class="footer-btn">
<view class="custom-style-round-circle custom-style-btn custom-style" <view class="custom-style-round-circle custom-style-btn custom-style"
> >
<view class="custom-style-left save">删除</view> <!-- <view class="custom-style-left save">删除</view>-->
<view class="custom-style-right submit" @click="submit"> <view class="custom-style-right submit" @click="submit">
一键上架({{selected.length}}) 一键上架({{selected.length}})
</view> </view>
...@@ -269,10 +285,16 @@ export default { ...@@ -269,10 +285,16 @@ export default {
}) })
}, },
submit(){ submit(){
if(this.selectedIds.length === 0){
this.$refs.uToast.show({
title: '请选择一个款式'
})
return;
}
this.$http("stylelibraryorder.oneClickListing", this.selectedIds) this.$http("stylelibraryorder.oneClickListing", this.selectedIds)
.then(res => { .then(res => {
let { let {
code, msg code, msg, data
} = res; } = res;
if(code === 200){ if(code === 200){
this.$refs['uToast'].show({ this.$refs['uToast'].show({
...@@ -280,7 +302,12 @@ export default { ...@@ -280,7 +302,12 @@ export default {
}) })
this.selected = []; this.selected = [];
this.hideList = []; this.hideList = [];
this.getList(); this.$Router.push({
path: '/pages/webview/index',
query:{
id: data
}
})
}else{ }else{
this.$refs['uToast'].show({ this.$refs['uToast'].show({
title: msg title: msg
...@@ -302,7 +329,7 @@ export default { ...@@ -302,7 +329,7 @@ export default {
// 获取所有id // 获取所有id
let childrenIds = children.map(item => item.id); let childrenIds = children.map(item => item.id);
// 核对是否存在 // 核对是否存在
return this.selectedIds.filter(id => childrenIds.indexOf(id)).length return this.selectedIds.filter(id => childrenIds.indexOf(id) > -1).length
}, },
checkToggle(index){ checkToggle(index){
return this.hideList.indexOf(index) > -1 return this.hideList.indexOf(index) > -1
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<!--指定面料颜色数量--> <!--指定面料颜色数量-->
<u-form-item label="指定面料颜色数量" prop="component" required> <u-form-item label="指定面料颜色数量" prop="component" required>
<u-number-box v-model="detail.clothRowColourQuantity" <u-number-box v-model="detail.clothRowColourQuantity"
:max="10" :max="10" ref="clothRowColourQuantity"
@minus="addModelingTaskColourDTOList" @minus="addModelingTaskColourDTOList"
@plus="addModelingTaskColourDTOList" @plus="addModelingTaskColourDTOList"
@blur="addModelingTaskColourDTOList"></u-number-box> @blur="addModelingTaskColourDTOList"></u-number-box>
...@@ -169,15 +169,50 @@ ...@@ -169,15 +169,50 @@
</template> </template>
</u-navbar> </u-navbar>
<view class="body" :style="{ bottom: footerHeight + 'px', top: headerHeight+ 'px'}"> <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="u-p-t-20 u-p-r-30 u-p-b-20 u-p-l-30" :style="{-->
<view class="pre-item pre-item--80 u-relative" <!-- background:'whitesmoke'-->
:class="[color.checked ? 'active': '']" <!-- } ">-->
@click="selectColor(color)" <!-- <u-search-->
v-for="(color,index) in computedModelingTaskColorLibraryList" :key="index"> <!-- :show-action="false"-->
<image class="pre-item-image" :src="`${imgUrl}${color.pictureCode}`" mode="aspectFill"></image> <!-- bg-color="#fff"-->
<text class="u-absolute pre-item-text text-center">{{ color.colorName }}</text> <!-- placeholder="请输入颜色名称"-->
<!-- ></u-search>-->
<!-- </view>-->
<scroll-view scroll-y="true" class="u-height-100 color--tree">
<view class="u-flex u-col-top u-height-100">
<view class="left u-border-right u-height-100">
<view class="color--tree-label u-line-1"
@click="activeColorsTab = index"
:class="[ activeColorsTab === index ? 'active': '']"
v-for="(color,index) in colors">
<text>{{color.colour}}</text>
<text>
({{color.children.filter((item) => {return checkedList.indexOf(item.id) > -1}).length }})
</text>
</view>
</view>
<view class="right u-flex-1 color--tree-children">
<view class="tree-item u-flex"
@click="selectColor(item)"
v-for="(item) in activeColorTree">
<u-checkbox
v-model="item.checked"
></u-checkbox>
<view class="tree-level-text">
{{ item.colour }}
</view>
</view>
</view>
</view> </view>
</view>
<!-- <view class="pre-item pre-item&#45;&#45;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>-->
</scroll-view>
</view> </view>
<!--底部按钮--> <!--底部按钮-->
<view class="footer"> <view class="footer">
...@@ -304,7 +339,7 @@ export default { ...@@ -304,7 +339,7 @@ export default {
clothWidth:[ clothWidth:[
{ {
validator:(rule, value, callback) => { validator:(rule, value, callback) => {
let reg = new RegExp(/^([1-9][0-9]*)+(\\.[0-9]{1,2})?$/); let reg = new RegExp(/(^[0-9][0-9]*$)|(^[0-9][0-9]*[\.]{1}[0-9]{1,2}$)/);
return reg.test(value); return reg.test(value);
}, },
message: '门幅应保留小数点后两位', message: '门幅应保留小数点后两位',
...@@ -332,6 +367,10 @@ export default { ...@@ -332,6 +367,10 @@ export default {
show: false show: false
}, },
checkedList: [], checkedList: [],
colorsSource: [],
colors: [],
activeColorsTab: 0,
} }
}, },
computed:{ computed:{
...@@ -370,13 +409,22 @@ export default { ...@@ -370,13 +409,22 @@ export default {
return this.activeTaskMaterialColour.map(item => item.colorId) return this.activeTaskMaterialColour.map(item => item.colorId)
}, },
computedModelingTaskColorLibraryList(){ // computedModelingTaskColorLibraryList(){
return this.modelingTaskColorLibraryList.map((item) =>{ // return this.modelingTaskColorLibraryList.map((item) =>{
return { // return {
...item, // ...item,
checked: this.checkedList.indexOf(item.id) > -1 // checked: this.checkedList.indexOf(item.id) > -1
} // }
}) // })
// }
activeColorTree(){
return this.colors.length === 0 ? []:
this.colors[this.activeColorsTab]['children'].map((item) =>{
return {
...item,
checked: this.checkedList.indexOf(item.id) > -1
}
})
} }
}, },
methods:{ methods:{
...@@ -391,14 +439,16 @@ export default { ...@@ -391,14 +439,16 @@ export default {
submitColor(){ submitColor(){
if(this.checkedList.length === this.designAgencyColourQuantity){ if(this.checkedList.length === this.designAgencyColourQuantity){
this.removeColor(); this.removeColor();
let row = this.computedModelingTaskColorLibraryList let row = this.colorsSource
.filter((item) => item.checked) .filter((item) => this.checkedList.indexOf(item.id) > -1)
.map((item) =>{ .map((item) =>{
let { id,...other} = item; let { id,colour,...other} = item;
return { return {
...other, ...other,
colorName: colour,
colorId: id, colorId: id,
type: 2 type: 2,
isDeleted: false
} }
}); });
this.addColor(row); this.addColor(row);
...@@ -424,8 +474,8 @@ export default { ...@@ -424,8 +474,8 @@ export default {
} }
} }
} }
list = list.filter((item) => checked.indexOf(item.id) > -1); this.detail.modelingTaskMaterialColourList = list.filter((item) => item.id && checked.indexOf(item.id) > -1);
// console.log(list) console.log(list)
}, },
// 颜色库选择 点击时间 存一份选中状态 在确定的时候过滤 // 颜色库选择 点击时间 存一份选中状态 在确定的时候过滤
selectColor(colorItem){ selectColor(colorItem){
...@@ -478,6 +528,39 @@ export default { ...@@ -478,6 +528,39 @@ export default {
this.detail.modelingCategoryText = label; this.detail.modelingCategoryText = label;
this.detail.price = extra; this.detail.price = extra;
}, },
getSelectColour(){
function arr2Tree(data, id = "colourGroup") {
const newList = [],
map = Array.from(
new Set(
data.map((item) => {
return item["colourGroup"];
})
)
);
for (let i = 0; i < data.length; i++) {
let item = data[i],
name = item[id],
index = map.indexOf(name);
if (newList[index]) {
newList[index]["children"].push(item);
} else {
newList.push({
colour: name,
children: [item]
});
}
}
return newList;
}
this.$http("colour.selectColour", { color: "" }).then((res) => {
let { code, data } = res;
if (code === 200) {
this.colorsSource = data;
this.colors = arr2Tree(data);
}
});
},
getModelingTaskCategoryList(){ getModelingTaskCategoryList(){
this.$http("modelingTaskCategory.list") this.$http("modelingTaskCategory.list")
.then(res =>{ .then(res =>{
...@@ -508,7 +591,8 @@ export default { ...@@ -508,7 +591,8 @@ export default {
}, },
init(){ init(){
this.getModelingTaskCategoryList(); this.getModelingTaskCategoryList();
this.getModelingTaskColorLibrary(); // this.getModelingTaskColorLibrary();
this.getSelectColour();
}, },
validateList(callback){ validateList(callback){
// 指定面料颜色 // 指定面料颜色
...@@ -669,6 +753,26 @@ export default { ...@@ -669,6 +753,26 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.color--tree{
&-label{
width: 200rpx;
padding: 30rpx;
&.active{
color: #D5AA7A;
}
}
&-children{
overflow-y: auto;
.tree-item{
padding: 26rpx 30rpx;
}
}
}
.u-height-100{
height: 100%
}
.u-width-100{ .u-width-100{
width: 200rpx; width: 200rpx;
} }
...@@ -677,8 +781,6 @@ export default { ...@@ -677,8 +781,6 @@ export default {
height: 64rpx; height: 64rpx;
} }
.required::before{ .required::before{
//position: absolute;
//left: 8px;
color: #ee0a24; color: #ee0a24;
font-size: 14px; font-size: 14px;
content: '*'; content: '*';
......
...@@ -374,7 +374,8 @@ ...@@ -374,7 +374,8 @@
<view class="title">建模合格</view> <view class="title">建模合格</view>
</view> </view>
</view> </view>
<view class="custom-style-round-circle custom-style-btn custom-style" v-if="detail.status === 3"> <view class="custom-style-round-circle custom-style-btn custom-style"
v-if="detail.status === 3 || detail.status === 2">
<!-- <view class="custom-style-left save" @click="cancel(3)">撤回</view>--> <!-- <view class="custom-style-left save" @click="cancel(3)">撤回</view>-->
<view class="custom-style-right submit" @click="cancel"> <view class="custom-style-right submit" @click="cancel">
<view class="title">撤回</view> <view class="title">撤回</view>
...@@ -492,7 +493,7 @@ export default { ...@@ -492,7 +493,7 @@ export default {
clothWidth:[ clothWidth:[
{ {
validator:(rule, value, callback) => { validator:(rule, value, callback) => {
let reg = new RegExp(/^([1-9][0-9]*)+(\\.[0-9]{1,2})?$/); let reg = new RegExp(/(^[0-9][0-9]*$)|(^[0-9][0-9]*[\.]{1}[0-9]{1,2}$)/);
return reg.test(value); return reg.test(value);
}, },
message: '门幅应保留小数点后两位', message: '门幅应保留小数点后两位',
...@@ -603,12 +604,14 @@ export default { ...@@ -603,12 +604,14 @@ export default {
}, },
submit(type){ submit(type){
let {modelingTaskPictureDTOList, ...onther} = this.detail; let {modelingTaskPictureDTOList, ...onther} = this.detail;
this.$http("modeling.submit",Object.assign({}, this.$http("modeling.submit",
Object.assign({},
onther, onther,
{ {
designAgencyColourQuantity: this.designAgencyColourQuantity, designAgencyColourQuantity: this.designAgencyColourQuantity,
operationType:type, operationType:type,
modelingTaskPictureDTOList: modelingTaskPictureDTOList.concat(this.delModelingTaskPictureDTOList)}) modelingTaskPictureDTOList: modelingTaskPictureDTOList}),
"请求中"
).then(res =>{ ).then(res =>{
let { let {
code,msg code,msg
...@@ -654,10 +657,10 @@ export default { ...@@ -654,10 +657,10 @@ export default {
this.$http("modeling.sendSamples",{ this.$http("modeling.sendSamples",{
...this.formData, ...this.formData,
modelingTaskId: this.detail.id modelingTaskId: this.detail.id
}).then(res =>{ },"请求中").then(res =>{
let { let {
code ,msg code ,msg
} = data; } = res;
if(code === 200){ if(code === 200){
this.$refs.uToast.show({ this.$refs.uToast.show({
title: msg, title: msg,
...@@ -675,11 +678,20 @@ export default { ...@@ -675,11 +678,20 @@ export default {
...this.detail, ...this.detail,
...data, ...data,
modelingTaskReviewer:this.modelingTaskReviewer modelingTaskReviewer:this.modelingTaskReviewer
}).then(res =>{ },"请求中").then(res =>{
this.$refs.uToast.show({ let {
title: msg, msg,code
back: true } = res;
}); if(code === 200){
this.$refs.uToast.show({
title: msg,
back: true
});
}else{
this.$refs.uToast.show({
title: msg
});
}
}) })
}, },
validate(operationType,callback){ validate(operationType,callback){
...@@ -704,7 +716,7 @@ export default { ...@@ -704,7 +716,7 @@ export default {
cancel(){ cancel(){
this.$http("modeling.withdraw", { this.$http("modeling.withdraw", {
...this.detail ...this.detail
}).then(res =>{ },"请求中").then(res =>{
let { let {
code,msg code,msg
} = res; } = res;
......
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
this.$http("materialLabel.save",{ this.$http("materialLabel.save",{
"labelName": value, "labelName": value,
"labelType": 0 "labelType": 0
}).then(res =>{ },'加载中').then(res =>{
let { let {
code, data,msg code, data,msg
} = res; } = res;
...@@ -173,13 +173,20 @@ export default { ...@@ -173,13 +173,20 @@ export default {
submitLabel(){ submitLabel(){
// console.log(this.detail.modelingTaskLabelList) // console.log(this.detail.modelingTaskLabelList)
this.$http("modeling.saveOrUpdateLabel", this.detail.modelingTaskLabelList) this.$http("modeling.saveOrUpdateLabel", this.detail.modelingTaskLabelList,'加载中')
.then(res =>{ .then(res =>{
let { let {
code, data,msg code,msg
} = res; } = res;
if(code === 200){ if(code === 200){
this.$refs.uToast.show({
title: msg,
back: true
})
}else{
this.$refs.uToast.show({
title: msg
})
} }
}) })
}, },
......
<!--我的--> <!--我的-->
<template> <template>
<view> <view>
<view class=""> <view class="head">
<text class="u-font-40">我的</text> <text class="text1">我的</text>
<text class="">my</text> <text class="text2">My</text>
</view> </view>
<view> <view class="u-p-30">
<view class=""></view> <view class="item item--round" @click="edit">
<view class="u-font-32 u-m-b-8 u-line-1">{{msg.fullName}}</view>
<view class="u-font-24">{{msg.userName}}</view>
</view>
<view @click="toRegister" class="u-l-height-44">切换身份</view>
</view> </view>
<hs-tab-bar></hs-tab-bar> <hs-tab-bar></hs-tab-bar>
</view> </view>
</template> </template>
...@@ -20,12 +25,82 @@ export default { ...@@ -20,12 +25,82 @@ export default {
components: {HsTabBar}, components: {HsTabBar},
data(){ data(){
return{ return{
msg: uni.getStorageSync("userInfo")
}
},
created() {
// let msg = uni.getStorageSync("userInfo")
// console.log(msg)
},
methods:{
edit(){
let type = uni.getStorageSync("assignType");
this.$Router.push({
path: '/pages/user/register/completeInformation',
query:{
type
}
})
},
toRegister(){
let type = uni.getStorageSync("assignType");
this.$Router.push({
path: '/pages/user/register/stepSelectType',
query:{
type
}
})
} }
} }
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.item--round{ border-radius: 8rpx;}
.item{
padding: 36rpx 30px;
height: 160rpx;
background: url(~@/static/images/home/exhibition.png) no-repeat;
background-size: 100% 100%;
margin-bottom: 20rpx;
color: #fff;
}
.head {
width: 100%;
margin-top: 16rpx;
position: relative;
.text1 {
width: 160rpx;
height: 56rpx;
font-size: 40rpx;
font-family: PingFangSC, PingFangSC-Medium;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
line-height: 56rpx;
margin-left: 38rpx;
}
.text2 {
width: 194rpx;
height: 40-rpx;
font-size: 28rpx;
font-family: PingFangSC, PingFangSC-Regular;
font-weight: 400;
color: #dda973;
line-height: 40rpx;
margin-left: 10rpx;
}
.btn {
width: 56rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFangSC, PingFangSC-Medium;
font-weight: 700;
text-align: right;
color: rgba(0, 0, 0, 0.6);
line-height: 40rpx;
position: absolute;
right: 30rpx;
bottom: 0;
}
}
</style> </style>
<!-- 完善信息 -->
<template>
<view>
<view class="body" :style="{ bottom: footerHeight + 'px'}">
<!-- 完善信息 -->
<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="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.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.self="delBrandRow(item)">删除</text>
</view>
<view @click="InfoCollapseChange(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>
<!-- 底部按钮 -->
<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">
<!-- :class="[!canSubmit ? 'button&#45;&#45;submit&#45;&#45;disabled' : '' ]"-->
<u-button type="primary" @click="submit" shape="circle"
v-if="current === 1" class="button--submit"
:custom-style=" assignType === -1 ? {background: '#b5b5b5 !important'} : {background: '#333 !important'}"
:disabled="!canSubmit">下一步</u-button>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps";
import dom from '@/mixins/dom'
import goIndex from "./mixins/goIndex";
export default {
name: "register",
components: {Steps, UserSelect},
mixins: [dom,goIndex],
data(){
return{
current: 1,
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,
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) {
this.comData = {
...options,
...{
pcUserId: uni.getStorageSync("pcUserId") || options.pcUserId,
pcBasicsId: uni.getStorageSync("pcBasicsId") || options.pcBasicsId,
tenantId: uni.getStorageSync("tenantId") || options.tenantId,
}
};
this.assignType = Number(options.type)
if(this.comData.pcBasicsId && this.comData.pcUserId){
this.getItem();
}
},
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;
},
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 && identityType){
this.assignType = identityType;
}
this.form3.cooperationMethodList = supplierStudioCooperationMethodList['cooperationMethod'] || [];
this.form1.subsidiaryInfoDTOList = addressList.length > 0 ? addressList.map((item) =>{
return {
...item,
stallAddress: item.detailedAddress
}
}) : [
{stallAddress: '',isDeleted: false}
]
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
}
}
})
},
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 ;
}
},
goEndPage(isSuccess){
this.$Router.push({
path: '/pages/user/register/success',
query:{
status: isSuccess ? 'success':'error'
}
})
},
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() {
this.$http(
"user.register",
this.getData()
).then(res =>{
let { code ,data,msg} = res;
if(code === 200){
uni.setStorageSync("identityType", this.assignType);
this.createToken(data,()=>{
this.$Router.back()
})
}else{
uni.showToast({
title: msg
})
// this.error = true;
//this.goEndPage(false)
}
})
},
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);
uni.setStorageSync('userInfo', data);
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">
@import './css/index';
</style>
export default {
methods:{
// 注册成功 跳转到首页
goIndex(){
uni.setStorageSync('assignType', this.assignType)
if(this.assignType !== 2){
this.$Router.replace({
path: '/pages/home/index'
})
}else{
this.$Router.replace({
path: '/pages/brands/brands'
})
}
},
}
}
...@@ -170,10 +170,11 @@ ...@@ -170,10 +170,11 @@
import UserSelect from "./components/UserSelect"; import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps"; import Steps from "./components/Steps";
import dom from '@/mixins/dom' import dom from '@/mixins/dom'
import goIndex from "./mixins/goIndex";
export default { export default {
name: "register", name: "register",
components: {Steps, UserSelect}, components: {Steps, UserSelect},
mixins: [dom], mixins: [dom,goIndex],
data(){ data(){
return{ return{
current: 1, current: 1,
...@@ -268,7 +269,7 @@ export default { ...@@ -268,7 +269,7 @@ export default {
}, },
form2:{ form2:{
subsidiaryInfoDTOList:[ subsidiaryInfoDTOList:[
{stallAddress: ''} {stallAddress: '',isDeleted: false}
], ],
brandInfoDTOList: [ brandInfoDTOList: [
// { // {
...@@ -363,7 +364,7 @@ export default { ...@@ -363,7 +364,7 @@ export default {
} }
}; };
this.assignType = Number(options.type) this.assignType = Number(options.type)
if(options.pcBasicsId && options.pcUserId){ if(this.comData.pcBasicsId && this.comData.pcUserId){
this.getItem(); this.getItem();
} }
}, },
...@@ -403,13 +404,6 @@ export default { ...@@ -403,13 +404,6 @@ export default {
InfoCollapseChange(index){ InfoCollapseChange(index){
this.infoActive = this.infoActive === index ? null: index; this.infoActive = this.infoActive === index ? null: index;
}, },
// 注册成功 跳转到首页
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
getItem(){ getItem(){
this.$http( this.$http(
...@@ -428,7 +422,7 @@ export default { ...@@ -428,7 +422,7 @@ export default {
basics, basics,
contact contact
} = data; } = data;
if(identityType !== -1){ if(identityType !== -1 && identityType){
this.assignType = identityType; this.assignType = identityType;
} }
...@@ -571,6 +565,7 @@ export default { ...@@ -571,6 +565,7 @@ export default {
uni.setStorageSync('token', data.accessToken); uni.setStorageSync('token', data.accessToken);
uni.setStorageSync('pcUserId', data.userId); uni.setStorageSync('pcUserId', data.userId);
uni.setStorageSync('pcBasicsId', data.enterpriseId); uni.setStorageSync('pcBasicsId', data.enterpriseId);
uni.setStorageSync('userInfo', data);
callback(); callback();
} }
}) })
......
...@@ -35,13 +35,14 @@ ...@@ -35,13 +35,14 @@
<script> <script>
import dom from "@/mixins/dom"; import dom from "@/mixins/dom";
import goIndex from "./mixins/goIndex";
import UserSelect from "./components/UserSelect"; import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps"; import Steps from "./components/Steps";
export default { export default {
name: "register", name: "register",
components: {Steps, UserSelect}, components: {Steps, UserSelect},
mixins: [dom], mixins: [dom,goIndex],
data(){ data(){
return{ return{
current: 0, current: 0,
...@@ -103,9 +104,6 @@ export default { ...@@ -103,9 +104,6 @@ export default {
}, },
onLoad(options) { onLoad(options) {
// let {
// redirect
// } = options;
this.comData = { this.comData = {
...options, ...options,
...{ ...{
...@@ -114,6 +112,9 @@ export default { ...@@ -114,6 +112,9 @@ export default {
tenantId: uni.getStorageSync("tenantId") || options.tenantId, tenantId: uni.getStorageSync("tenantId") || options.tenantId,
} }
}; };
uni.setStorageSync("pcUserId", this.comData.pcUserId)
uni.setStorageSync("pcBasicsId",this.comData.pcBasicsId)
uni.setStorageSync("tenantId",this.comData.tenantId)
let { let {
pcBasicsId,pcUserId pcBasicsId,pcUserId
} = this.comData; } = this.comData;
...@@ -144,13 +145,6 @@ export default { ...@@ -144,13 +145,6 @@ export default {
}, },
userSelectCallback(type){ userSelectCallback(type){
this.assignType = type; this.assignType = type;
// let {
// pcUserId,
// pcBasicsId
// } = this.comData;
// if(pcUserId && pcBasicsId){
// this.getItem();
// }
}, },
// 重新选择时 核对当前选中状态 // 重新选择时 核对当前选中状态
checkStatusByType(assignType){ checkStatusByType(assignType){
...@@ -162,33 +156,45 @@ export default { ...@@ -162,33 +156,45 @@ export default {
} = this.status; } = this.status;
switch (assignType){ switch (assignType){
case 1: case 1:
isFabricSupplier ? this.goIndex() : ''; if(isFabricSupplier){
return ; this.goIndex();
return false;
}else{
return true
}
case 2: case 2:
isBrandOwner ? this.goIndex() : ''; if(isBrandOwner){
return ; this.goIndex();
return false;
}else{
return true
}
case 3: case 3:
isDesignAgency ? this.goIndex() : ''; if(isDesignAgency){
return ; this.goIndex();
return false;
}else{
return true
}
case 4: case 4:
isTestingFacility ? this.goIndex() : ""; if(isTestingFacility){
return ; this.goIndex();
return false;
}else{
return true
}
} }
}, },
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
next(){ next(){
this.checkStatusByType(this.assignType); if(this.checkStatusByType(this.assignType)){
this.$Router.push({ this.$Router.push({
path: '/pages/user/register/perfectInformation', path: '/pages/user/register/perfectInformation',
query:{ query:{
...this.comData, ...this.comData,
type: this.assignType type: this.assignType
} }
}) })
}
}, },
checkStatus(){ checkStatus(){
this.$http( this.$http(
...@@ -201,6 +207,7 @@ export default { ...@@ -201,6 +207,7 @@ export default {
let { identityType} = data.userLastIdentity; let { identityType} = data.userLastIdentity;
if(identityType){ if(identityType){
this.assignType = identityType; this.assignType = identityType;
this.status = data;
} }
} }
}) })
......
...@@ -49,13 +49,14 @@ ...@@ -49,13 +49,14 @@
<script> <script>
import dom from "@/mixins/dom"; import dom from "@/mixins/dom";
import goIndex from "./mixins/goIndex";
import UserSelect from "./components/UserSelect"; import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps"; import Steps from "./components/Steps";
export default { export default {
name: "register", name: "register",
components: {Steps, UserSelect}, components: {Steps, UserSelect},
mixins: [dom], mixins: [dom,goIndex],
data(){ data(){
return{ return{
current: 2, current: 2,
...@@ -116,11 +117,6 @@ export default { ...@@ -116,11 +117,6 @@ export default {
back(){ back(){
this.$Router.back(); this.$Router.back();
}, },
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
success() { success() {
let timer = setInterval(() => { let timer = setInterval(() => {
this.time--; this.time--;
......
...@@ -11,6 +11,8 @@ export default { ...@@ -11,6 +11,8 @@ export default {
return{ return{
baseUrl: 'http://pay.huansi.net/#/payorder/', baseUrl: 'http://pay.huansi.net/#/payorder/',
orderId: '', orderId: '',
timer: null,
loading: false,
// html: 'http://pay.huansi.net/#/payorder/1483979726701785089' // html: 'http://pay.huansi.net/#/payorder/1483979726701785089'
} }
}, },
...@@ -19,16 +21,53 @@ export default { ...@@ -19,16 +21,53 @@ export default {
return `${this.baseUrl}${this.orderId}` return `${this.baseUrl}${this.orderId}`
} }
}, },
created() { methods:{
this.$http("stylelibraryorder.shPay").then(res => { checkStatus(){
let { if(this.loading){
success, result return;
} = res;
// console.log(res)
if(success){
this.orderId = result.orderId;
} }
}) this.loading = true;
this.$http("stylelibraryorder.listingDetailsByCode",this.orderId)
.then(res =>{
let {
code, data,msg
} = res;
if(code === 200){
if(data.status === 2){
uni.showToast({
title: msg,
complete:() =>{
this.$Router.back();
}
})
}
}else{
uni.showToast({
title: msg
})
}
})
.complete(() =>{
this.loading = false;
})
}
},
created() {
this.orderId = this.$Router.currentRoute.query.id;
},
onShow() {
if(this.ticker){
clearInterval(this.ticker);
}else {
this.ticker = setInterval(this.checkStatus, 1000);
}
//
// this.$once("hooks:onHide", () =>{
// clearInterval(this.ticker);
// })
},
onHide(){
clearInterval(this.ticker);
} }
} }
</script> </script>
......
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