Commit 4c028b62 authored by 李星剑's avatar 李星剑

提交

parent 9dfa8a2a
......@@ -9,7 +9,7 @@ export const BASE_URL = process.env.NODE_ENV === 'development' ? '/dev':'/prod-a
export const BASE_URL = "http://octopus-dev.textile-saas.huansi.net/dev-api/"
// export const BASE_URL = "http://10.10.10.31/"
// #endif
export const UPLOAD_URL = `${BASE_URL}/gdep-system/virtualfile/uploadFile`
export const API_URL = `${BASE_URL}` //后台接口域名
export const IMG_URL = `${BASE_URL}/gdep-system/virtualfile/downloadFile?fileCode=` //全局网络图片地址变量,css背景图片地址变量在uni.scss
export const IMG_URL = `https://huansi-gdep-dev.oss-cn-hangzhou.aliyuncs.com/` //全局网络图片地址变量,css背景图片地址变量在uni.scss
<script>
// import nativeEventReceive from "./mixins/nativeEventReceive";
export default {
// mixins:[nativeEventReceive],
data(){
return{
appVersion: ''
}
},
onLaunch: function() {
// // #ifdef APP-PLUS
// #ifdef APP-PLUS
// this.getAppVersion();
// // #endif
// this.initEvent();
// #endif
},
onShow: function() {
console.log('App Show')
......@@ -21,7 +24,7 @@
//获取App版本号
getAppVersion() {
let that = this;
console.log(plus.runtime.appid)
// console.log(plus.runtime.appid)
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
that.appVersion = wgtinfo.version;
// that.update(this.appVersion)
......
// 挂载变量
import {
API_URL,
IMG_URL
IMG_URL,
UPLOAD_URL
} from '../../env.js';
// import store from '@/config/store';
import http from '@/config/request';
......@@ -22,6 +23,7 @@ import wechat from '@/config/wechat/wechat';
const install = Vue => {
Vue.prototype.$API_URL = API_URL;
Vue.prototype.$IMG_URL = IMG_URL;
Vue.prototype.$UPLOAD_URL = UPLOAD_URL;
// 挂载请求
Vue.prototype.$http = http;
// 平台判断
......
......@@ -5,15 +5,15 @@ export default {
method: "POST",
},
register:{
url: "gdep-enterprise/basics/basicsSaveAndroid",
url: "/gdep-enterprise/basics/basicsSaveAndroid",
method: "post"
},
checkMagStatus:{
url: "gdep-enterprise/basics/basicsWhetherOrNotPerfectAndroid",
url: "/gdep-enterprise/basics/basicsWhetherOrNotPerfectAndroid",
method: "post"
},
getItemMsg:{
url: "gdep-enterprise/basics/basicsDetailAndroid",
url: "/gdep-enterprise/basics/basicsDetailAndroid",
method: "post"
}
}
......
......@@ -5,6 +5,7 @@ import user from './apiList/user.js'
import auth from './apiList/auth.js'
import color from './apiList/colors.js'
import orderTicket from './apiList/orderTicket.js'
import modeling from './apiList/modeling.js'
// import goods from './apiList/goods.js'
// import base from './apiList/base.js'
......@@ -12,5 +13,6 @@ export default {
...user,
...auth,
...color,
...orderTicket
...orderTicket,
...modeling
};
......@@ -47,8 +47,8 @@ export default function http(
// token过期注销
if (response.code === 401) {
store.dispatch('logout');
router.push("/pages/user/login/login")
// store.dispatch('logout');
// router.push("/pages/user/login/login")
throw (`登录已过期或注销,已阻止此次API请求: '${api.url}'`);
}
return response
......
......@@ -9,6 +9,7 @@ import {
API_URL
} from '../../../env'
import platform from '@/config/platform/index';
import { sha256 } from 'js-sha256'
export default class Request {
constructor() {
// 默认配置
......@@ -105,11 +106,16 @@ export default class Request {
let query = Request.addQueryString(options.params);
mergeUrl += mergeUrl.indexOf('?') === -1 ? `?${query}` : `&${query}`
}
// fix this.$http('detail',1) get => /detail/1
if(typeof options.data !== 'object' && options.method === 'get'){
mergeUrl = mergeUrl + '/' +options.data;
options.data = {};
}
// fix 后台鉴权
if(options.url.startsWith("/gdep")||options.url.startsWith("gdep")){
// 让每个请求携带自定义hs-auth 请根据实际情况自行修改
options.header["hs-auth"] = sha256(options.url.substring(options.url.indexOf("/",1)) + " " +options.method.toLowerCase());
}
options.url = mergeUrl
options.success = res => {
......
......@@ -55,7 +55,7 @@ const router = createRouter({
router.beforeEach((to, from, next) => {
// 权限控制登录
if (to.meta && to.meta.auth && !store.getters.isLogin) {
next('/login');
// next('/login');
} else {
next()
}
......
......@@ -5,12 +5,18 @@ const state = {
token: uni.getStorageSync("token") || "",
isLogin: uni.getStorageSync("isLogin") || false, // 是否登陆
userInfo: uni.getStorageSync("userInfo") || {}, // 用户信息
tenanList: [
// {
// globalId: "1375592964957573120", tenantId: "1442659610786926593", subId: "1442659610786926600"
// }
] // 租户列表
}
const getters = {
token: state => state.token,
isLogin: state => state.isLogin,
userInfo: state => state.userInfo,
tenanList: state => state.tenanList,
}
const actions = {
......@@ -51,7 +57,10 @@ const mutations = {
userInfo(state, data) {
state.userInfo = data;
uni.setStorageSync("userInfo", data);
}
},
tenanList(state, payload) {
state.tenanList = payload
},
}
export default {
state,
......
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();
}
}
}
......@@ -5,20 +5,57 @@
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/user/tenanList/index",
"path": "pages/home/tenantSelection",
"style": {
"navigationBarTitleText": "选择租户",
"enablePullDownRefresh": false
"navigationBarTitleText": "租户选择",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/user/register",
"path": "pages/user/register/stepSelectType",
"style": {
"navigationBarTitleText": "完善信息",
"enablePullDownRefresh": false
// "navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/user/register/perfectInformation",
"style": {
"navigationBarTitleText": "完善信息",
// "navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/user/register/success",
"style": {
"navigationBarTitleText": "完善信息",
// "navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/index/index",
......@@ -114,7 +151,8 @@
"allowsBounceVertical": "NO"
}
}
}, {
},
{
"path": "pages/home/fabricList",
"style": {
"navigationBarTitleText": "我的面料",
......@@ -127,7 +165,8 @@
"allowsBounceVertical": "NO"
}
}
}, {
},
{
"path": "pages/home/fabricDetails",
"style": {
"navigationBarTitleText": "面料详情",
......@@ -140,7 +179,8 @@
"allowsBounceVertical": "NO"
}
}
}, {
},
{
"path": "pages/home/styleDetails",
"style": {
"navigationBarTitleText": "款式详情",
......@@ -153,7 +193,8 @@
"allowsBounceVertical": "NO"
}
}
}, {
},
{
"path": "pages/home/sampleConfirmation",
"style": {
"navigationBarTitleText": "寄样确认",
......@@ -166,7 +207,8 @@
"allowsBounceVertical": "NO"
}
}
}, {
},
{
"path": "pages/home/styleEntrustment",
"style": {
"navigationBarTitleText": "款式委托",
......@@ -179,6 +221,48 @@
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/listSelectToAdd",
"style": {
"navigationBarTitleText": "面料建模",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/addItem",
"style": {
"navigationBarTitleText": "面料建模",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
},
{
"path": "pages/modeling/item",
"style": {
"navigationBarTitleText": "建模详情",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
}
}
],
"globalStyle": {
......
......@@ -21,7 +21,8 @@
<view class="u-border-bottom">
<view class="u-font-28 u-m-t-18 u-m-b-8">已指定颜色</view>
<view class="u-flex" @click="colorDialog.show = true;">
<view class="u-line-1 u-flex-1 u-font-32 u-l-height-32">
<view class="u-line-1 u-flex-1 u-font-28 u-l-height-32"
:class="[activeColorIds.length > 0 ? '': 'color-placeholder']">
{{activeColorText}}
</view>
<u-icon name="arrow-right"></u-icon>
......@@ -61,8 +62,8 @@
<view>
<view class="u-font-28 u-m-t-18 u-m-b-8"></view>
<view class="u-flex">
<view class="u-line-1 u-flex-1 u-font-32">
<input v-model="detail.expirationDate" @click="timePickerShow = true" readonly disabled/>
<view class="u-line-1 u-flex-1 u-font-28" :class="[detail.expirationDate ? '': 'color-placeholder']">
<view @click="timePickerShow = true">{{detail.expirationDate ? detail.expirationDate : '请选择日期'}}</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
......@@ -300,14 +301,14 @@ export default {
},
// 选中的颜色id List
activeColorText(){
return this.detail.colourList
let List = this.detail.colourList
.filter((item) =>{
return item.isDeleted === false
})
.map((item) =>{
return item.colour
})
.join("|");
});
return List.length > 0 ? List.join("|"): "请选择指定颜色";
},
// 最小颜色长度
minColorsLength(){
......
......@@ -24,7 +24,9 @@
</view>
<u-number-box v-model="item.quantity"></u-number-box>
</view>
<u-button plain @click="addBrandList" type="primary">+添加风格</u-button>
<view class="button-plain" @click="addBrandList">
+添加风格
</view>
</view>
<u-select
......@@ -213,6 +215,11 @@ export default {
flex-direction: $direction;
/* #endif */
}
.button-plain{
text-align: center;
color: #DDA973;
line-height: 88rpx;
}
.del{
color: #FA5353;
}
......
......@@ -155,10 +155,7 @@ export default {
};
},
onLoad() {
this.entrustmentPage();
this.toBeSelectedQuantity();
this.orderTicketExceptionNum();
this.noSampleOrder();
},
onShow() {
// 获取查询条件
......@@ -172,6 +169,10 @@ export default {
// #ifdef APP-PLUS
this.setOffestTop();
// #endif
this.entrustmentPage();
this.toBeSelectedQuantity();
this.orderTicketExceptionNum();
this.noSampleOrder();
},
onHide() {
this.enable = false;
......
<!--新增委托-->
<template>
<view>
<view id="header"><u-navbar title="租户选择" :border-bottom="false" :background="{ backgroundColor: 'whitesmoke' }"></u-navbar></view>
<view id="header"><u-navbar :is-back="false" title="租户选择" :border-bottom="false" :background="{ backgroundColor: 'whitesmoke' }"></u-navbar></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-p-30 body" :style="{ bottom: footerHeight + 'px', top: headerHeight + 'px' }" v-if="list.length > 0">
<view v-for="(item, index) in list" :key="item.id" class="u-flex u-m-b-20 s--item" @click="triggerSelectItem(index)">
<view class="u-m-r-30">
<u-icon :name="index === selectedIndex ? 'checkmark-circle-fill' : 'checkmark-circle'" color="#000" size="40" @click="triggerSelectItem(index)" />
<u-icon :name="index === selectedIndex ? 'checkmark-circle-fill' : 'checkmark-circle'" color="#000" size="40" />
</view>
<view :class="{ tenant_list: true, border_000: index === selectedIndex }">租户{{ index }}</view>
<view :class="{ tenant_list: true, border_000: index === selectedIndex }">{{ item.userName }}</view>
</view>
</view>
<view v-if="list.length === 0">
<u-empty text="没有数据" mode="list"></u-empty>
</view>
<!-- 底部按钮 确定-->
<view class="footer" id="footer">
<view class="footer-btn">
<!-- /* 以下形式在微信小程序会无效,APP和H5有效 */-->
<u-button :disabled="selectedIndex === -1" @click="toAddItem" class="custom-style" shape="circle">确定</u-button>
<u-button :disabled="selectedIndex === -1" @click="next" class="custom-style" shape="circle">确定</u-button>
<!-- <u-button @click="testLogin" class="custom-style" shape="circle">确定</u-button> -->
</view>
</view>
</view>
......@@ -23,82 +27,186 @@
<script>
import dom from '@/mixins/dom';
import HsSelectItem from '../../components/hs-select-item/hs-select-item';
import HsMaterialThumbnail from '../../components/hs-material-thumbnail/hs-material-thumbnail';
export default {
name: 'listSelectToAdd',
components: { HsMaterialThumbnail, HsSelectItem },
mixins: [dom],
data() {
return {
keyword: '',
selectedIndex: -1,
list: [
{
title: '加厚荷兰绒绒布布料',
id: 2
},
{
title: '加厚荷兰绒绒布布料加厚荷兰绒绒布布料',
id: 12
},
{
title: '加厚荷兰绒绒布布料',
id: 221
},
{
title: '加厚荷兰绒绒布布料',
id: 22
},
{
title: '加厚荷兰绒绒布布料',
id: 224
},
{
title: '加厚荷兰绒绒布布料',
id: 222
}
]
selectedIndex: -1,
list: []
};
},
onLoad() {
this.getList();
created() {
this.getTenanList();
},
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;
},
// 跳转到新增详情页面
toAddItem() {
uni.setStorageSync('_item', this.list[this.selectedIndex]);
this.$Router.push({
path: '/pages/designCommissioned/addItem'
// query:{
// id: this.list[this.selectedIndex].id
// }
});
},
// 跳转到面料详情
toMaterialDetail({ id }) {
this.$Router.push({
path: '/pages/home/fabricDetails',
query: {
id
}
});
}
mounted() {
},
methods: {
getTenanList(){
// #ifdef APP-PLUS
// 向宿主App发送事件
uni.sendNativeEvent('getTenantList', {}, ret => {
this.list = JSON.parse(ret).filter((item) =>{
return item.tenantPlat === 'sass'
});
})
// #endif
},
encryptToken(){
// #ifdef APP-PLUS
const active = this.list[this.selectedIndex];
uni.sendNativeEvent('encryptToken',JSON.stringify(
{
globalId: active.globalUserId,
tenantId: active.tenantId,
subId: active.id,
}
), ret => {
uni.setStorageSync('encryptToken', ret);
this.login()
})
// #endif
},
initEvent() {
// #ifdef APP-PLUS
uni.onNativeEventReceive((event, data)=>{
this.err = JSON.stringify(event);
this.err1 = true;
if(event === 'getTenantList'){
this.list = JSON.parse(data);
}else if(event === 'encryptToken'){
// this.token = data;
uni.setStorageSync('encryptToken', data);
this.login()
}
})
this.getTenanList();
// #endif
},
testLogin(){
uni.setStorageSync('encryptToken',"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJST0xFX0FETUlOIiwidXNlcl9pZCI6IjE0NzM1ODI0NDI5MTEwMjMxMDUiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInVzZXJfbmFtZSI6IiIsIm9hdXRoX2lkIjoiIiwidG9rZW5fdHlwZSI6ImFjY2Vzc190b2tlbiIsImFjY291bnQiOiIiLCJjbGllbnRfaWQiOiJzd29yZCIsImV4cCI6MTY0MDIwMDQwNywibmJmIjoxNjQwMTY0NDA3fQ.b2lDYtf8huuxRSfp0YKAHXgcsx59AEo2omgrE8V1tJQNwFIOTD7GzS-iAbpCalj6QXqw-OnNP9HKbsBEuloAMA")// uni.setStorageSync("encryptToken","11")
this.login()
},
triggerSelectItem(item){
this.selectedIndex = item;
},
login(){
// uni.showToast({
// title: "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" ,{
...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();
}
}
};
</script>
......
This diff is collapsed.
<template>
</template>
<script>
export default {
name: "editItem"
}
</script>
<style scoped>
</style>
<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="u-flex u-p-b-20">
<view class="item-status">
待寄样
</view>
<text class="item-status u-flex-1 text-right">
完工日期:2020-11-11
</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-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">
光泽度要高,90%以上
</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">
213.12元
</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">
213.12元
</view>
</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>
<u-image url="https://huansi-gdep-dev.oss-cn-hangzhou.aliyuncs.com/2dc07ee4-3b1c-45be-ae79-2bbdb61571af" width="150" height="150"></u-image>
<u-image url="https://huansi-gdep-dev.oss-cn-hangzhou.aliyuncs.com/2dc07ee4-3b1c-45be-ae79-2bbdb61571af" width="150" height="150"></u-image>
</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">
光泽度要高,90%以上
</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">
213.12元
</view>
</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">
加厚荷兰绒绒布布料
</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">
牛仔面料
</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">
牛仔面料
</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">
牛仔面料
</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">
牛仔面料
</view>
</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">标准1</view>
<view class="u-line-1 u-flex-1 content">
光泽度要高,90%以上
</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">
213.12元
</view>
</view>
</view>
<!--委托建模信息-->
<view class="bg-fff u-p-r-30 u-p-b-30 u-p-l-30 ">
<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">
2021-12-12 21:21
</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">
2021-12-12 21:21
</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">
2021-12-12
</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">
213.12元
</view>
</view>
</view>
</view>
<!--底部按钮-->
<view class="footer" id="footer">
<view class="footer-btn">
<!---->
<view class="custom-style-round-circle custom-style-btn custom-style">
<view class="custom-style-right submit">
<view class="title">选款</view>
</view>
</view>
</view>
</view>
<!--提示-->
<u-toast ref="uToast" />
</view>
</template>
<script>
import dom from "../../mixins/dom"
import HsTipTitle from "../../components/hs-tip-title/hs-tip-title";
import HsMaterialThumbnail from "../../components/hs-material-thumbnail/hs-material-thumbnail";
export default {
name: "index",
components: {HsMaterialThumbnail, HsTipTitle},
mixins:[dom],
data(){
return {}
},
onLoad({id}){
},
mounted() {
},
methods:{
}
}
</script>
<style scoped lang="scss">
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.label{
color: rgba(0,0,0,0.40);
font-size: 28rpx;
min-width: 140rpx;
}
.context{
color: #000;
font-size: 28rpx;
}
.u-l-height-32{
height: 64rpx;
line-height: 64rpx;
}
.u-l-height-44{
height: 88rpx;
line-height: 88rpx;
}
.u-m-l-75{ margin-left: 150rpx;}
.u-m-l-53{ margin-left: 108rpx;}
.del{
color: #FA5353;
}
.bg-fff{
background: #fff;
}
.body{
background: #fafafa;
position: absolute;
width: 100%;
height: auto;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow-y: auto;
}
.tree {
@include vue-flex;
flex-wrap: wrap;
.tree-level {
@include vue-flex;
width: 100%;
font-size: 32rpx;
.active-text{
color: #DDA973;
}
.tree-level-text {
flex: 1;
overflow: hidden;
.tree-level-text--selected {
font-size: 28rpx;
color: red;
}
}
}
}
.brandList-tip{
height: 88rpx;
background: #fcfaf7;
border: 1px solid rgba(68,53,37,0.10);
border-radius: 8rpx;
line-height: 88rpx;
padding-left: 30rpx;
}
.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;
}
}
}
}
.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;
}
}
</style>
<!--新增委托-->
<template>
<view>
<view id="header">
<!--新增委托navbar-->
<u-navbar title="面料建模"
:border-bottom="false"
:background="{backgroundColor: 'whitesmoke'}">
</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" @click="toMaterialDetail(item)"></hs-material-thumbnail>
</view>
</view>
<!-- 底部按钮 确定-->
<view class="footer" id="footer">
<view class="footer-btn">
<!-- /* 以下形式在微信小程序会无效,APP和H5有效 */-->
<u-button :disabled="selectedIndex === -1"
@click="toAddItem"
class="custom-style" shape="circle"
>
确定
</u-button>
</view>
</view>
</view>
</template>
<script>
import dom from '../../mixins/dom'
import HsSelectItem from "../../components/hs-select-item/hs-select-item";
import HsMaterialThumbnail from "../../components/hs-material-thumbnail/hs-material-thumbnail";
export default {
name: "listSelectToAdd",
components: {HsMaterialThumbnail, HsSelectItem},
mixins:[dom],
data(){
return {
keyword: "",
selectedIndex: -1,
list: [
{
title: '加厚荷兰绒绒布布料',
id: 2
},
{
title: '加厚荷兰绒绒布布料加厚荷兰绒绒布布料',
id: 12
},
{
title: '加厚荷兰绒绒布布料',
id: 221
},
{
title: '加厚荷兰绒绒布布料',
id: 22
},
{
title: '加厚荷兰绒绒布布料',
id: 224
},
{
title: '加厚荷兰绒绒布布料',
id: 222
}
]
}
},
onLoad(){
this.getList();
},
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;
},
// 跳转到新增详情页面
toAddItem(){
uni.setStorageSync("_item", this.list[this.selectedIndex]);
this.$Router.push({
path:"/pages/modeling/addItem",
// query:{
// id: this.list[this.selectedIndex].id
// }
})
},
// 跳转到面料详情
toMaterialDetail({id}){
this.$Router.push({
path:"/pages/home/fabricDetails",
query:{
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>
This diff is collapsed.
......@@ -87,10 +87,10 @@ export default {
<style scoped lang="scss">
.active{
background: #1677FF !important;
background: #D5AA7A !important;
}
.active-color{
color: #1677FF !important;
color: #D5AA7A !important;
}
.step{
display: flex;
......
.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: #DDA973;
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;
&--error{
background: #f95253;
}
}
.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;
}
}
.button--submit{
background: #333 !important;
&--disabled{
background: #b5b5b5 !important;
}
}
This diff is collapsed.
<!--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>
<!-- 底部按钮 -->
<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="[assignType === -1 ? 'button&#45;&#45;submit&#45;&#45;disabled' : '' ]"-->
<u-button type="primary" @click="next" shape="circle"
class="button--submit"
:custom-style=" assignType === -1 ? {background: '#b5b5b5 !important'} : {background: '#333 !important'}"
:disabled="assignType === -1"
v-if="current === 0">下一步
</u-button>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import dom from "@/mixins/dom";
import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps";
export default {
name: "register",
components: {Steps, UserSelect},
mixins: [dom],
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: '完成'
}
],
status:{
isBrandOwner: 0, // 我要选款
isDesignAgency: 0, // 完善设计机构信息
isFabricSupplier: 0, //完善面料供应商信息
isTestingFacility: 0, // 完善检测机构信息
},
comData:{
pcBasicsId: '', //PC端注册的企业id
pcUserId: '', //PC端注册的企业id
corporateContactId: '', //企业联系人id
institutionAddressId: '',//企业/机构地址id
},
}
},
onLoad(options) {
// let {
// redirect
// } = options;
this.comData = {
...options,
...{
pcUserId: uni.getStorageSync("pcUserId") || options.pcUserId,
pcBasicsId: uni.getStorageSync("pcBasicsId") || options.pcBasicsId,
tenantId: uni.getStorageSync("tenantId") || options.tenantId,
}
};
let {
pcBasicsId,pcUserId
} = this.comData;
if(pcBasicsId && pcUserId){
this.checkStatus();
}
},
mounted() {
this.uGetRect("#footer").then(res =>{
this.footerHeight = res.height;
})
},
methods:{
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 ;
}
},
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
next(){
this.checkStatusByType(this.assignType);
this.$Router.push({
path: '/pages/user/register/perfectInformation',
query:{
...this.comData,
type: this.assignType
}
})
},
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;
}
}
})
}
}
}
</script>
<style scoped lang="scss">
@import './css/index';
</style>
<!-- 完善信息 -->
<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 === 2">
<view class="status u-text-center">
<view class="circle" :class="[error ? 'circle--error':'']">
<u-icon size="36"
color="#fff"
:name="error ? 'close':'checkbox-mark'"
></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="back" shape="circle"
v-if="current === 2 && error" class="button--submit">返回</u-button>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import dom from "@/mixins/dom";
import UserSelect from "./components/UserSelect";
import Steps from "./components/Steps";
export default {
name: "register",
components: {Steps, UserSelect},
mixins: [dom],
data(){
return{
current: 2,
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",
}
],
steps: [
{
title: '第一步',
desc: '选择身份'
},
{
title: '第二步',
desc: '完善信息'
},
{
title: '第三步',
desc: '完成'
}
],
error: true,
time: 3
}
},
onLoad(options) {
this.error = options.status === 'error';
if(!this.error){
this.success();
}
},
onShow(){
this.time = 3;
},
methods:{
back(){
this.$Router.back();
},
goIndex(){
this.$Router.replace({
path: '/pages/home/index'
})
},
success() {
let timer = setInterval(() => {
this.time--;
if (this.time === 0) {
clearInterval(timer);
this.goIndex();
}
}, 1000);
},
}
}
</script>
<style scoped lang="scss">
@import './css/index';
</style>
......@@ -7,7 +7,7 @@
</view>
<!-- <button @click="getTenanList">getTenanList</button>-->
<button @click="next" :disabled="active === -1">下一步</button>
<!-- <button @click="login">下一步</button>-->
<button @click="login">下一步</button>
<!-- <view>encryptToken结果:{{token}}</view>-->
</view>
</template>
......
......@@ -41,4 +41,8 @@
width: $i + rpx;
height: $i + rpx;
}
}
\ No newline at end of file
}
.color-placeholder{
color: #c5c9cf;
}
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