From 98bf599434ef289952d8de6a58490b52c42139f9 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 7 Jun 2022 16:32:16 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 14 --
apis/modules/order.js | 4 +
apis/modules/parner.js | 12 ++
apis/request.js | 16 +-
libs/util.js | 4 +-
pages.json | 28 ++--
pages/addCourse/addCourse.vue | 4 +-
pages/addStaff/addStaff.vue | 2 +-
pages/clientDetail/clientDetail.vue | 6 +-
pages/clients/clients.vue | 48 ++++--
pages/editCourse/editCourse.vue | 178 ++++++++++++++---------
pages/{main/main.vue => index/index.vue} | 61 ++++----
pages/invite/invite.vue | 2 +-
pages/login/login.vue | 18 ++-
pages/orderDetail/orderDetail.vue | 22 ++-
pages/orders/orders.vue | 142 ++++++++++++++----
pages/person/person.vue | 16 +-
pages/plans/plans.vue | 67 ++++++---
pages/products/products.vue | 30 +++-
pages/qrcode/qrcode.vue | 2 +-
pages/teams/teams.vue | 65 +++++++--
static/avatar.jpg | Bin 6723 -> 0 bytes
static/customicons.css | 20 ---
static/customicons.ttf | Bin 2416 -> 0 bytes
styles/common.scss | 1 +
25 files changed, 504 insertions(+), 258 deletions(-)
rename pages/{main/main.vue => index/index.vue} (71%)
delete mode 100644 static/avatar.jpg
delete mode 100644 static/customicons.css
delete mode 100644 static/customicons.ttf
diff --git a/App.vue b/App.vue
index ee288b1..233affd 100644
--- a/App.vue
+++ b/App.vue
@@ -14,19 +14,5 @@
diff --git a/apis/modules/order.js b/apis/modules/order.js
index 0ec1924..ee4b22f 100644
--- a/apis/modules/order.js
+++ b/apis/modules/order.js
@@ -23,4 +23,8 @@ export const renew = (data) => {
export const list = (data) => {
return post('nakadai/applets/order/getOrderBasedOnBusinessManagerId', data)
+}
+
+export const del = (data) => {
+ return post('nakadai/nakadai/order/delete', data)
}
\ No newline at end of file
diff --git a/apis/modules/parner.js b/apis/modules/parner.js
index 16b5fd1..5f6581e 100644
--- a/apis/modules/parner.js
+++ b/apis/modules/parner.js
@@ -3,4 +3,16 @@ const { get, post } = request
export const savePartnerAccount = (data) => {
return post('nakadai/partnerAccount/savePartnerAccount', data)
+}
+
+export const teamList = (data) => {
+ return get('nakadai/partner-team/teamList', data)
+}
+
+export const generateInvitationCode = (data) => {
+ return post('nakadai/partnerAccount/generateInvitationCode', data)
+}
+
+export const generationQrCode = (data) => {
+ return get('nakadai/partnerAccount/generationQrCode ', data)
}
\ No newline at end of file
diff --git a/apis/request.js b/apis/request.js
index 0849b32..01d9e70 100644
--- a/apis/request.js
+++ b/apis/request.js
@@ -13,19 +13,31 @@ const request = options => {
}
const header = Object.assign({}, config.headers, {
// token: uni.getStorageSync('token')
- token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NDg1NjgzLCJleHAiOjE2NTQ1Mjg4ODMsImFjY291bnRJZCI6IjQ1MiJ9.rsgoTtE1l0ooK7TBTQjC8Xd1nKGYTfoQrM8BDZqODGU'
+ token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjU0NTY5OTA1LCJleHAiOjE2NTQ2MTMxMDUsImFjY291bnRJZCI6IjQ1MiJ9.IwVDQSpfYctr3ScaBiwXApNiSFjfwVbivt_uLCEPiW0'
})
return new Promise((resolve, reject)=>{
const { url } = options
uni.request({
header,
- url: ((url.includes('weChatAppletCallback') || url.includes('userBinding')) ? 'http://192.168.31.151:9000/' : config.baseURL) + url,
+ url: ((url.includes('teamList')) ? 'http://192.168.31.137:9000/' : config.baseURL) + url,
method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => {
// 状态判断,根据后台定义并提示
if (data.status === 200) {
resolve(data)
+ } else if (data.status == 401) {
+ // 登录过期
+ uni.showToast({
+ title: data.message,
+ icon: 'none'
+ })
+ setTimeout(() => {
+ uni.navigateTo({
+ url: '../login/login'
+ })
+ }, 1500)
+ reject(data)
} else {
uni.showToast({
title: data.message,
diff --git a/libs/util.js b/libs/util.js
index 02e05f6..0889fb9 100644
--- a/libs/util.js
+++ b/libs/util.js
@@ -46,10 +46,10 @@ export default {
},
// 获取商务经理id
getBmId(val) {
- return uni.getStorageSync('partnerId')
+ return uni.getStorageSync('team').partnerId
},
// 获取商务经理名称
getBmName(val) {
- return uni.getStorageSync('partnerClassificationName')
+ return uni.getStorageSync('team').partnerClassificationName
},
}
\ No newline at end of file
diff --git a/pages.json b/pages.json
index f14e044..aee1f88 100644
--- a/pages.json
+++ b/pages.json
@@ -1,18 +1,26 @@
{
"pages": [
{
- "path" : "pages/main/main",
+ "path" : "pages/login/login",
"style" :
{
- "navigationBarTitleText": "",
+ "navigationBarTitleText": "登录",
"enablePullDownRefresh": false
}
},
{
- "path" : "pages/login/login",
+ "path" : "pages/invite/invite",
"style" :
{
- "navigationBarTitleText": "登录",
+ "navigationBarTitleText": "加入团队",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path" : "pages/index/index",
+ "style" :
+ {
+ "navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
@@ -64,14 +72,6 @@
"enablePullDownRefresh": false
}
},
- {
- "path" : "pages/invite/invite",
- "style" :
- {
- "navigationBarTitleText": "加入团队",
- "enablePullDownRefresh": false
- }
- },
{
"path" : "pages/addStaff/addStaff",
"style" :
@@ -182,10 +182,8 @@
"selectedColor": "#007FFF",
"borderStyle": "white",
"backgroundColor": "#ffffff",
- "height": "100px",
- "spacing": "10px",
"list": [{
- "pagePath": "pages/main/main",
+ "pagePath": "pages/index/index",
"iconPath": "static/image/tab1.png",
"selectedIconPath": "static/image/tab1-1.png",
"text": "首页"
diff --git a/pages/addCourse/addCourse.vue b/pages/addCourse/addCourse.vue
index 7d1bd75..c18a9a8 100644
--- a/pages/addCourse/addCourse.vue
+++ b/pages/addCourse/addCourse.vue
@@ -211,13 +211,13 @@
const { customerId } = this
list.map(e => {
// 新勾选的产品,则获取到id,下面要调用,
- if (!result.find(n => n.dataOrCourseId == e.id)) {
+ if (!result.find(n => n.dataOrCourseId == e.id && n.authority == e.authority)) {
e.productType === 2 ? dataIds.push(e.id) : courseIds.push(e.id)
result.push(this.createParam(e))
}
})
-
const promises = []
+ // 课程和数据的分别调接口
dataIds.length && promises.push(new Promise((resolve, reject) => {
this.handleRenew(0, customerId, dataIds, result, resolve, reject)
}))
diff --git a/pages/addStaff/addStaff.vue b/pages/addStaff/addStaff.vue
index e63c6c3..7efc6c2 100644
--- a/pages/addStaff/addStaff.vue
+++ b/pages/addStaff/addStaff.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/pages/clientDetail/clientDetail.vue b/pages/clientDetail/clientDetail.vue
index 9dd3cd2..9a4d0e0 100644
--- a/pages/clientDetail/clientDetail.vue
+++ b/pages/clientDetail/clientDetail.vue
@@ -185,11 +185,7 @@
}).then(({ result }) => {
const { customer } = result
this.form = customer
- this.$refs.nameInput.val = customer.name
- this.$refs.phoneInput.val = customer.phone
- this.$refs.accountInput.val = customer.account
- this.$refs.positionInput.val = customer.position
- this.$refs.emailInput.val = customer.email
+ !this.isDetail && customer.industryClassId && this.getIndustry()
this.customerType = this.customerTypeList.find(e => e.value === customer.customerType).name
}).catch(e => {})
},
diff --git a/pages/clients/clients.vue b/pages/clients/clients.vue
index 5361e34..fb9f08b 100644
--- a/pages/clients/clients.vue
+++ b/pages/clients/clients.vue
@@ -14,13 +14,25 @@
-
- {{ item.customerName }}
+ {{ item.customerName }}
- 联系人:{{ item.orderContact }}
- 账号:{{ item.account }}
- 产品到期时间:{{ item.expireDate.replace(' 00:00:00', '') }}
- 商务经理:{{ item.account }}
+
+ 联系人:
+ {{ item.orderContact }}
+
+
+ 账号:
+ {{ item.account }}
+
+
+ 产品到期时间:
+ {{ item.expireDate.replace(' 00:00:00', '') }}
+
+
+ 商务经理:
+ {{ item.account }}
+
{{ menuList[0].detailList.find(e => e.value === item.customerType).title }}客户
@@ -49,6 +61,10 @@
'key': 'customerType',
'isMutiple': false,
'detailList': [
+ {
+ 'title': '全部',
+ 'value': ''
+ },
{
'title': '正式',
'value': 1
@@ -177,8 +193,8 @@
padding: 20rpx 40rpx;
border-bottom: 1px solid #f1f1f1;
}
- .num {
- font-size: 32rpx;
+ .c-name {
+ font-size: 30rpx;
color: #333;
}
.info {
@@ -187,10 +203,20 @@
align-items: center;
margin-top: 10rpx;
}
- .text {
- padding: 8rpx 0;
- font-size: 26rpx;
- color: #ccc;
+ .line {
+ display: flex;
+ padding: 10rpx 0;
+ }
+ .name {
+ width: 200rpx;
+ margin-right: 10rpx;
+ font-size: 28rpx;
+ color: #999;
+ }
+ .val {
+ max-width: 70%;
+ font-size: 28rpx;
+ color: #333;
}
.type {
font-size: 28rpx;
diff --git a/pages/editCourse/editCourse.vue b/pages/editCourse/editCourse.vue
index 038baf4..c811e5f 100644
--- a/pages/editCourse/editCourse.vue
+++ b/pages/editCourse/editCourse.vue
@@ -1,68 +1,72 @@
-
- 基本信息
-
-
-
-
-
- {{ item.productName }}
-
-
-
-
-
- 产品类型
- {{ item.provinceName }}
-
-
- 使用期限
-
-
-
- 使用期限单位
-
-
-
- 起止日期
-
-
- {{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}
+
+
+ {{ c.name }}
+
+
+
+
+
+
+ {{ item.productName }}
+
+
+
+
+
+ 产品类型
+ {{ item.provinceName }}
+
+
+ 使用期限
+
+
+
+ 使用期限单位
+
+
+
+ 起止日期
+
+
+ {{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}
+
+
+
+
+ 数量
+ 1
+
+
+
+ {{ item.authority ? '市场价' : '市场单价' }}
+ {{ item.marketValue }}元
+
+
+ 结算价
+ {{ item.settlementPrice }}元
+
+
+ 折扣率
+ {{ item.discountRate }}
+
+
+ 平台服务费
+ {{ item.serviceFee }}元
+
+
+ 成交价
+
+
+ 元
+
-
-
-
- 数量
- 1
-
-
-
- {{ item.authority ? '市场价' : '市场单价' }}
- {{ item.marketValue }}元
-
-
- 结算价
- {{ item.settlementPrice }}元
-
-
- 折扣率
- {{ item.discountRate }}
-
-
- 平台服务费
- {{ item.serviceFee }}元
-
-
- 成交价
-
-
- 元
-
+
确定
@@ -85,7 +89,7 @@
text: '年',
value: 2
}],
- courses: [], // 上一页缓存的产品
+ courses: {} , // 上一页缓存的产品
orderRepeat: [],
repeatMsg: ''
}
@@ -94,23 +98,54 @@
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.customerId = options.customerId
- const store = uni.getStorageSync('courses')
- if (store) {
- this.courses = store
+ this.handleProduct()
+ },
+ methods: {
+ // 转换产品列表
+ handleProduct() {
+ const list = uni.getStorageSync('courses')
+ const courses = {
+ practice: {
+ shrink: false,
+ name: '实训课程产品',
+ list: []
+ },
+ theory: {
+ shrink: false,
+ name: '理论课程产品',
+ list: []
+ },
+ data: {
+ shrink: false,
+ name: '数据产品',
+ list: []
+ }
+ }
+ // 3个分类的课程分别push到不同数组(0->理论 1-实训 2 数据产品)
+ list.map(e => {
+ const type = e.productType
+ !type ?
+ courses.theory.list.push(e) :
+ type === 1 ?
+ courses.practice.list.push(e) :
+ courses.data.list.push(e)
+ })
+ this.courses = courses
try {
uni.removeStorageSync('courses')
} catch (e) {}
- }
- },
- methods: {
+ },
+ // 收缩产品
+ toggle(c) {
+ c.shrink = !c.shrink
+ },
// 删除课程
- delCourse(i) {
- const that = this
+ delCourse(c, i) {
uni.showModal({
title: '提示',
content: '确定要删除吗?',
success(res) {
- res.confirm && that.courses.splice(i, 1)
+ res.confirm && c.list.splice(i, 1)
}
})
},
@@ -236,8 +271,13 @@
},
// 确定
submit() {
- const list = this.courses
+ const courses = this.courses
+ const list = []
let msg = ''
+ // 全部产品push到一个数组,方便校验
+ for (const i in courses) {
+ list.push(...courses[i].list)
+ }
// 必填校验
for (const i in list) {
const e = list[i]
diff --git a/pages/main/main.vue b/pages/index/index.vue
similarity index 71%
rename from pages/main/main.vue
rename to pages/index/index.vue
index bcc65fd..b23c1c0 100644
--- a/pages/main/main.vue
+++ b/pages/index/index.vue
@@ -1,39 +1,40 @@
+
-
+
-
+
-
-
+
客户
-
-
+
方案
-
-
+
订单
-
-
+
产品
-
+
-
+
销售进展
-
+
本月
-
+
@@ -62,12 +63,12 @@
-
+
-
+
年度业绩看板
-
+
@@ -109,26 +110,21 @@
// 获取团队
getInfo() {
getTeamsByAccountId().then(({ data }) => {
- const result = []
- data.map(e => {
- result.push({
- text: e.partnerClassificationName,
- value: e.partnerId
- })
- })
// 默认选择第一个团队
- if (result.length) {
- const val = result[0].value
- this.partnerId = val
- uni.setStorageSync('partnerId', val)
- uni.setStorageSync('partnerClassificationName', result[0].text)
+ if (data.length) {
+ this.partnerId = data[0].partnerId
+ uni.setStorageSync('team', data[0])
}
- this.list = result
+ this.list = data
}).catch(e => {})
},
// 团队选择回调
teamChange() {
uni.setStorageSync('partnerId', this.partnerId)
+ },
+ // 提示暂未开放
+ toPanel(i) {
+ this.$util.errMsg('功能暂未开放!')
}
}
}
@@ -136,9 +132,17 @@
diff --git a/pages/qrcode/qrcode.vue b/pages/qrcode/qrcode.vue
index 9ca1023..e2363b5 100644
--- a/pages/qrcode/qrcode.vue
+++ b/pages/qrcode/qrcode.vue
@@ -2,7 +2,7 @@
-
+
Jane 邀请你加入
diff --git a/pages/teams/teams.vue b/pages/teams/teams.vue
index 1985901..f2a16d2 100644
--- a/pages/teams/teams.vue
+++ b/pages/teams/teams.vue
@@ -1,12 +1,12 @@
-
+
- -
-
+
-
+
Luna
手机号码:1352351253
@@ -15,26 +15,67 @@
-
+