diff --git a/App.vue b/App.vue
index 3d74661..4ae28bd 100644
--- a/App.vue
+++ b/App.vue
@@ -1,14 +1,21 @@
diff --git a/pages/login/index.vue b/pages/login/index.vue
index ec32e73..e2f5138 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -19,7 +19,7 @@
{{ `(${timer}S后) ` }}
- 重新获取
+ 重新获取
获取验证码
@@ -40,9 +40,10 @@
diff --git a/pages/production-info/index.vue b/pages/production-info/index.vue
index d5e52a9..4f32399 100644
--- a/pages/production-info/index.vue
+++ b/pages/production-info/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -14,17 +14,17 @@
- {{ info.name || '设备' }}
+ {{ info.name || '产品' }}
- {{ info.machineDescribe || '没有描述' }}
+ {{ info.produceDescribe || '没有描述' }}
-
+
删除
-
+
编辑
@@ -34,13 +34,13 @@
diff --git a/pages/production-operation/index.vue b/pages/production-operation/index.vue
index c93fe4d..4ee0d5c 100644
--- a/pages/production-operation/index.vue
+++ b/pages/production-operation/index.vue
@@ -5,7 +5,7 @@
*
- 设备图片
+ 产品图片
(图片单张大小不超过2M,数量最多5张)
@@ -23,7 +23,7 @@
*
- 设备名称
+ 产品名称
-
-
- 设备类型
-
-
-
-
-
-
-
-
- 生产工艺
-
-
-
-
-
-
*
- 设备描述
+ 产品描述
-
-
-
- 摄像头ID
-
-
-
-
-
-
- 摄像头渠道号
-
-
-
-
-
-
- 云盒ID
-
-
-
@@ -136,7 +62,7 @@
import { go2, back, uploadImage } from '@/utils/hook.js'
import { validateField } from '@/utils/index.js'
import { fileType } from '@/enums/index.js'
-import { getDeviceTypeList, getTechnicsList, changeDevice, getEquipmentInfo } from '@/apis/deviceApi.js'
+import { changeProduction, getProductionInfo } from '@/apis/productionApi.js'
const validateFields = [
{
@@ -148,7 +74,7 @@ const validateFields = [
rules: [{ required: true, message: '请输入设备名称' }]
},
{
- name: 'machineDescribe',
+ name: 'produceDescribe',
rules: [{ required: true, message: '请输入设备描述' }]
}
]
@@ -161,16 +87,9 @@ export default {
form: {
id: null,
imgItemList: [],
- machineDescribe: '',
- cameraId: '',
- channelNum: '',
- cloudBoxId: '',
- name: '',
- type: '',
- technicsTypeList: []
+ produceDescribe: '',
+ name: ''
},
- deviceTypeList: [],
- technicsTypeList: [],
placeholderStyle: 'font-size: 28rpx;font-weight:400;'
}
},
@@ -194,18 +113,6 @@ export default {
})
}
},
- created() {
- getDeviceTypeList().then((res) => {
- if (res) {
- this.deviceTypeList = res.map((item) => ({ label: item.name, value: item.id }))
- }
- })
- getTechnicsList().then((res) => {
- if (res) {
- this.technicsTypeList = res.map((item) => ({ label: item.name, value: item.id }))
- }
- })
- },
methods: {
go2,
back,
@@ -214,12 +121,11 @@ export default {
},
// 编辑初始化
init(id) {
- getEquipmentInfo({ id }).then((res) => {
+ getProductionInfo({ id }).then((res) => {
if (res) {
Object.keys(this.form).forEach((key) => {
this.form[key] = res[key]
})
- this.form.technicsTypeList = res.technicsTypeList.map((item) => item.id)
}
})
},
@@ -260,19 +166,7 @@ export default {
return false
}
}
- if (this.form.cameraId) {
- if (!this.form.channelNum) {
- uni.showToast({
- title: '请输入摄像头渠道号',
- icon: 'none'
- })
- return false
- }
- }
- let list = this.technicsTypeList.filter((item) => this.form.technicsTypeList.includes(item.value))
- let technicsTypeList = list.map((item) => ({ id: item.value, name: item.label }))
- this.form.typeName = this.deviceTypeList.find((item) => item.value == this.form.type).label
- changeDevice({ ...this.form, technicsTypeList }).then((res) => {
+ changeProduction({ ...this.form }).then((res) => {
if (res) {
uni.showToast({
title: '保存成功',
diff --git a/pages/promotion/Banner.vue b/pages/promotion/Banner.vue
index 3e459c2..4cf0487 100644
--- a/pages/promotion/Banner.vue
+++ b/pages/promotion/Banner.vue
@@ -11,7 +11,7 @@
-
+
{{ swiperCurrent + 1 }}/{{ list.length }}
@@ -63,6 +63,9 @@ export default {
current: url,
urls: urls
})
+ },
+ shareFactory() {
+ this.$emit('share')
}
}
}
diff --git a/pages/promotion/index.vue b/pages/promotion/index.vue
index a418fd8..f8bb22d 100644
--- a/pages/promotion/index.vue
+++ b/pages/promotion/index.vue
@@ -9,7 +9,7 @@
-
+
@@ -59,11 +59,40 @@
+
+
+
+ {{ production.name }}
+
+
+
+
{{ hasMore ? '加载中~' : '没有更多~' }}
+
+
+ 立即分享给好友
+
+
+
+
+ 微信好友
+
+
+
+ 朋友圈
+
+
+
+
+ 取消
+
+
+
+
@@ -72,6 +101,7 @@ import Banner from './Banner.vue'
import { go2 } from '@/utils/hook.js'
import { getFactoryInfo } from '@/apis/factoryApi.js'
import { getEquipmentList } from '@/apis/deviceApi.js'
+import { getProductionList } from '@/apis/productionApi.js'
import { fileType } from '@/enums/index.js'
export default {
components: {
@@ -190,14 +220,14 @@ export default {
})
}
if (this.curTab == 'production') {
- getEquipmentList({ ...this.pagination }).then((res) => {
+ getProductionList({ ...this.pagination }).then((res) => {
if (res) {
if (res.current <= 1) {
- this.deviceList = res.records
+ this.productionList = res.records
} else {
- this.deviceList = this.deviceList.concat(res.records)
+ this.productionList = this.productionList.concat(res.records)
}
- this.hasMore = this.deviceList.length < res.total
+ this.hasMore = this.productionList.length < res.total
}
})
}
@@ -219,6 +249,29 @@ export default {
if (this.curTab == 'production') {
go2('production-operation', { operation: 'add' })
}
+ },
+ popupShow() {
+ this.$refs.popup.open('bottom')
+ },
+ popupHide() {
+ this.$refs.popup.close()
+ },
+ shareFactory(scene) {
+ uni.share({
+ provider: 'weixin',
+ type: 0,
+ title: factoryInfo.name,
+ summary: '印包客支持远程验厂,在线了解工厂',
+ scene: scene, // WXSceneTimeline,WXSceneSession
+ imageUrl: 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/wx-share-store.png',
+ href: H5_URL_FACTORY + `shareId=${res}`,
+ success: () => {
+ console.log('分享成功')
+ },
+ fail: (err) => {
+ console.log('err', err)
+ }
+ })
}
}
}
@@ -404,4 +457,87 @@ export default {
}
}
}
+.section_6 {
+ padding-top: 40rpx;
+ overflow: hidden;
+ border-radius: 40rpx 40rpx 0px 0px;
+ background-color: rgb(255, 255, 255);
+ height: 408rpx;
+ .text_13 {
+ align-self: center;
+ color: rgb(51, 51, 51);
+ font-size: 28rpx;
+ font-weight: 500;
+ line-height: 40rpx;
+ white-space: nowrap;
+ }
+ .group_20 {
+ margin-top: 40rpx;
+ .group_21 {
+ padding: 0 48rpx 32rpx;
+ color: rgb(51, 51, 51);
+ font-size: 24rpx;
+ line-height: 33rpx;
+ white-space: nowrap;
+ .group_23 {
+ width: 494rpx;
+ .image_15 {
+ width: 96rpx;
+ height: 96rpx;
+ }
+ .text_15 {
+ margin-left: 12rpx;
+ margin-top: 16rpx;
+ }
+ }
+ .image_14 {
+ border-radius: 50%;
+ width: 96rpx;
+ height: 96rpx;
+ }
+ .text_14 {
+ margin-top: 16rpx;
+ }
+ }
+ .section_7 {
+ background-color: rgb(247, 248, 250);
+ height: 16rpx;
+ }
+ .button {
+ padding: 26rpx 0;
+ color: rgb(51, 51, 51);
+ font-size: 32rpx;
+ line-height: 45rpx;
+ white-space: nowrap;
+ background-color: rgb(255, 255, 255);
+ }
+ }
+}
+.grid {
+ padding: 20rpx 32rpx 91rpx;
+ width: 750rpx;
+ color: rgb(31, 31, 31);
+ font-size: 28rpx;
+ font-weight: 500;
+ line-height: 40rpx;
+ white-space: nowrap;
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ grid-row-gap: 22rpx;
+ grid-column-gap: 16rpx;
+ .grid-item {
+ padding: 24rpx 20rpx 20rpx;
+ border-radius: 10rpx;
+ filter: drop-shadow(0px 5rpx 11rpx #00000014);
+ background-color: rgb(255, 255, 255);
+ background-position: 0px 0px;
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+ .image_7 {
+ margin-top: 20rpx;
+ width: 296rpx;
+ height: 296rpx;
+ }
+ }
+}
diff --git a/store/index.js b/store/index.js
index d2a44b4..8bd4326 100644
--- a/store/index.js
+++ b/store/index.js
@@ -12,7 +12,7 @@ let qnToken = null,
userInfo = null,
/**
* @value id 企业id
- * @value enterpriseType 企业类型
+ * @value enterpriseType 企业类型 印刷包装厂 2 ; 供应商 5 ; 个人 8
* @value name 企业名称
* @value fddEnterpriseStatus 法大大认证状态 。1未认证,2认证进行中,3认证成功,4认证失败
*/
diff --git a/utils/hook.js b/utils/hook.js
index af25558..7ca9b03 100644
--- a/utils/hook.js
+++ b/utils/hook.js
@@ -1,5 +1,5 @@
import store from '@/store/index'
-import { uploadUrl, XAPPID } from '@/enums/index.js'
+import { uploadUrl, XAPPID, enterpriseType } from '@/enums/index.js'
import { pushCustomerOff } from '@/apis/commonApi'
// 框架方法封装
const tabList = ['digital-workshops', 'promotion', 'mall', 'mine']
@@ -15,6 +15,29 @@ export function tab2(tabPage) {
})
}
}
+
+/**
+ * 根据用户角色动态改变tabbar
+ * @param {number} type 企业类型
+ * @return {null}
+ */
+export function changeTabbar(type) {
+ if (type == enterpriseType.PERSONAL) {
+ ;[0, 1].forEach((index) => {
+ uni.setTabBarItem({
+ index: index,
+ visible: false
+ })
+ })
+ } else {
+ ;[0, 1].forEach((index) => {
+ uni.setTabBarItem({
+ index: index,
+ visible: true
+ })
+ })
+ }
+}
/**
* @param {string} 返回上一级
* @return {null}