diff --git a/apis/modules/client.js b/apis/modules/client.js
index 1c9fa4c..560370c 100644
--- a/apis/modules/client.js
+++ b/apis/modules/client.js
@@ -6,11 +6,11 @@ export const queryCustomer = (data) => {
}
export const list = (data) => {
- return post('nakadai/applets/customer/getCustomerListBasedOnBusinessManagerId', data)
+ return post('nakadai/nakadai/applets/customer/getCustomerListBasedOnBusinessManagerId', data)
}
export const all = (data) => {
- return post('nakadai/applets/customer/customerList', data)
+ return post('nakadai/nakadai/applets/customer/customerList', data)
}
export const queryCustomerDetails = (data) => {
@@ -46,9 +46,9 @@ export const getProductsSubscribedByCustomers = (data) => {
}
export const getTeamsByAccountId = (data) => {
- return post('nakadai/applets/customer/getTeamsByAccountId', data)
+ return post('nakadai/nakadai/applets/customer/getTeamsByAccountId', data)
}
export const getTheBusinessManagerIdsUnderTheTeam = id => {
- return post(`nakadai/applets/customer/getTheBusinessManagerIdsUnderTheTeam?id=${id}`)
+ return post(`nakadai/nakadai/applets/customer/getTheBusinessManagerIdsUnderTheTeam?id=${id}`)
}
\ No newline at end of file
diff --git a/apis/modules/order.js b/apis/modules/order.js
index 345afca..202586c 100644
--- a/apis/modules/order.js
+++ b/apis/modules/order.js
@@ -22,7 +22,7 @@ export const renew = (data) => {
}
export const list = (data) => {
- return post('nakadai/applets/order/orderList', data)
+ return post('nakadai/nakadai/applets/order/orderList', data)
}
export const orderList = (data) => {
diff --git a/apis/modules/parner.js b/apis/modules/parner.js
index 7bd1800..8d9925e 100644
--- a/apis/modules/parner.js
+++ b/apis/modules/parner.js
@@ -2,25 +2,25 @@ import request from '@/apis/request.js'
const { get, post } = request
export const savePartnerAccount = (data) => {
- return post('nakadai/partnerAccount/savePartnerAccount', data)
+ return post('nakadai/nakadai/partnerAccount/savePartnerAccount', data)
}
export const teamList = (data) => {
- return post('nakadai/partnerAccount/partnerAccountList', data)
+ return post('nakadai/nakadai/partnerAccount/partnerAccountList', data)
}
export const generateInvitationCode = accountId => {
- return post(`nakadai/partnerAccount/generateInvitationCode?accountId=${accountId}`)
+ return post(`nakadai/nakadai/partnerAccount/generateInvitationCode?accountId=${accountId}`)
}
export const treeList = (data) => {
- return post('nakadai/partnerClassification/treeList', data)
+ return post('nakadai/nakadai/partnerClassification/treeList', data)
}
export const my = (data) => {
- return get('nakadai/partner-team/my', data)
+ return get('nakadai/nakadai/partner-team/my', data)
}
export const mailFileSend = (data) => {
- return post('nakadai/partnerAccount/mailFileSend', data)
+ return post('nakadai/nakadai/partnerAccount/mailFileSend', data)
}
\ No newline at end of file
diff --git a/apis/modules/user.js b/apis/modules/user.js
index 79c5ab8..e7c1ac7 100644
--- a/apis/modules/user.js
+++ b/apis/modules/user.js
@@ -14,7 +14,7 @@ export const examinePassword = (data) => {
}
export const getUserRolesPermissionMenu = (data) => {
- return get('users/user-role/getUserRolesPermissionMenu', data)
+ return get('users/users/user-role/getUserRolesPermissionMenu', data)
}
export const updatePersonCenter = (data) => {
@@ -26,27 +26,27 @@ export const queryUserInfoDetails = () => {
}
export const updateMyEmail = (data) => {
- return post('nakadai/partner-team/updateMyEmail', data)
+ return post('nakadai/nakadai/partner-team/updateMyEmail', data)
}
export const mailCodeSend = (data) => {
- return post('nakadai/partner-team/mailCodeSend', data)
+ return post('nakadai/nakadai/partner-team/mailCodeSend', data)
}
export const changeAccount = account => {
- return post(`users/applets/mine/changeAccount?account=${account}`)
+ return post(`users/users/applets/mine/changeAccount?account=${account}`)
}
export const changePhoneNumber = (phone, code) => {
- return post(`users/applets/mine/changePhoneNumber?phone=${phone}&code=${code}`)
+ return post(`users/users/applets/mine/changePhoneNumber?phone=${phone}&code=${code}`)
}
export const checkIfAnAccountExists = account => {
- return post(`users/applets/mine/checkIfAnAccountExists?account=${account}`)
+ return post(`users/users/applets/mine/checkIfAnAccountExists?account=${account}`)
}
export const checkIfThePhoneNumberExists = phone => {
- return post(`users/applets/mine/checkIfThePhoneNumberExists?phone=${phone}`)
+ return post(`users/users/applets/mine/checkIfThePhoneNumberExists?phone=${phone}`)
}
export const updateUserAvatars = `http://39.108.250.202:9000/users/users/userAccount/updateUserAvatars`
\ No newline at end of file
diff --git a/apis/request.js b/apis/request.js
index b42f7bb..20fb794 100644
--- a/apis/request.js
+++ b/apis/request.js
@@ -19,7 +19,7 @@ const request = options => {
const { url } = options
uni.request({
header,
- url: (otherUrl.find(e => url.includes(e)) ? 'http://192.168.31.151:9000/' : config.baseURL) + url,
+ url: config.baseURL + url,
method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => {
diff --git a/config/request.js b/config/request.js
index 24cd55b..25bb4a5 100644
--- a/config/request.js
+++ b/config/request.js
@@ -5,7 +5,7 @@
*/
export default {
- baseURL: 'http://192.168.31.151:9000/',
+ baseURL: 'https://huorantech.cn/',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
diff --git a/order/addCourse/addCourse.vue b/order/addCourse/addCourse.vue
index e534a2f..b06fef6 100644
--- a/order/addCourse/addCourse.vue
+++ b/order/addCourse/addCourse.vue
@@ -10,7 +10,8 @@
-
- checkChange(e, i)">
+ checkChange(e, i)">
+ checkChange(e, i)">
{{ item.productName }}
@@ -30,7 +31,7 @@
export default {
data() {
return {
- orderType: 0,
+ orderType: 1,
customerId: '',
curTab: '',
tabs: [
@@ -61,6 +62,8 @@
listAll: [],
page: 1,
pageSize: 10,
+ check: [1],
+ noCheck: [],
checkData: [{
text: '',
value: 1
@@ -108,7 +111,7 @@
// 获取课程列表
getList() {
AppletsDataProductList({
- sort: '',
+ sort: 'desc',
keywords: this.keyword,
productType: this.curTab,
pageNum: this.page,
@@ -125,12 +128,12 @@
text: '',
value: 1
}
- e.check = (all && pageChange) || checked.find(n => n.id === e.id && n.productType === e.productType) ? [1] : []
+ e.check = (all && pageChange) || checked.find(n => n.id === e.id && n.productType === e.productType) ? 1 : 0
// 筛选已经勾选的产品
if (list.find(n => n.dataOrCourseId == e.id && n.productType == e.productType)) {
// 已经选择了的则禁止选择,并且直接选中
checkData.disable = true
- e.check = [1]
+ e.check = 1
}
e.checkData = [checkData]
})
@@ -159,6 +162,7 @@
const item = this.list[i]
const { id, productType } = item
const include = checked.findIndex(e => e.id === id && e.productType === productType)
+ console.log(11, this.list, e, i)
// 选中的情况下,该产品如果没有push到已选数组里,则push
if (e.detail.value.length) {
include === -1 && checked.push(item)
@@ -249,7 +253,7 @@
Promise.all(promises).then(_ => {
uni.setStorageSync('courses', result) // 把选中的产品添加至缓存
uni.redirectTo({
- url: `../editCourse/editCourse?customerId=${customerId}`
+ url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}`
})
})
} else {
diff --git a/order/editCourse/editCourse.vue b/order/editCourse/editCourse.vue
index cb13d64..ae21e0e 100644
--- a/order/editCourse/editCourse.vue
+++ b/order/editCourse/editCourse.vue
@@ -78,6 +78,7 @@
export default {
data() {
return {
+ orderType: 1,
customerId: '',
timer: null,
units: [{
@@ -114,6 +115,7 @@
onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
+ this.orderType = options.orderType
this.customerId = options.customerId
this.handleProduct()
},
@@ -160,6 +162,7 @@
itemList: that.unitText,
success: ({ tapIndex }) => {
item.options = tapIndex
+ that.calcDate(item)
}
})
},
@@ -242,27 +245,33 @@
},
// 计算结算价及平台服务费
dealSettlePrice(row) {
- const unit = row.options // 使用期限单位
- const useUnit = row.periodOfUse // 使用期限
- let sPrice = ''
- if (row.settlementMethod == 0) {
- // 结算单价。计算规则:结算单价(**元/年)*购买时长(单位年)*数量(课程为1,数据为账号数量)
- const priceUnit = row.settlementPriceUnit
- sPrice = ((!unit ?
- priceUnit / 365 * useUnit :
- unit === 1 ?
- priceUnit / 12 * useUnit :
- priceUnit * useUnit) * (row.authority ?
- 1 :
- row.accountNum)).toFixed((2))
+ // 如果是试用,结算价和平台服务费都是0
+ if (this.orderType == 2) {
+ row.settlementPrice = 0
+ row.serviceFee = 0
} else {
- // 比例分成。计算规则:成交价*商务分成比例
- sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
- }
- row.settlementPrice = this.$util.handleNaN(sPrice)
- // 平台服务费(结算价*10%)
- if (row.settlementPrice) {
- row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
+ const unit = row.options // 使用期限单位
+ const useUnit = row.periodOfUse // 使用期限
+ let sPrice = ''
+ if (row.settlementMethod == 0) {
+ // 结算单价。计算规则:结算单价(**元/年)*购买时长(单位年)*数量(课程为1,数据为账号数量)
+ const priceUnit = row.settlementPriceUnit
+ sPrice = ((!unit ?
+ priceUnit / 365 * useUnit :
+ unit === 1 ?
+ priceUnit / 12 * useUnit :
+ priceUnit * useUnit) * (row.authority ?
+ 1 :
+ row.accountNum)).toFixed((2))
+ } else {
+ // 比例分成。计算规则:成交价*商务分成比例
+ sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
+ }
+ row.settlementPrice = this.$util.handleNaN(sPrice)
+ // 平台服务费(结算价*10%)
+ if (row.settlementPrice) {
+ row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
+ }
}
},
// 计算折扣率
diff --git a/order/orderDetail/orderDetail.vue b/order/orderDetail/orderDetail.vue
index a53cda5..cf0d528 100644
--- a/order/orderDetail/orderDetail.vue
+++ b/order/orderDetail/orderDetail.vue
@@ -76,7 +76,7 @@
结算价
- {{ item.settlementPrice }}元
+ {{ form.orderType === 2 ? 0 : item.settlementPrice }}元
折扣率
@@ -84,7 +84,7 @@
平台服务费
- {{ item.serviceFee }}元
+ {{ form.orderType === 2 ? 0 :item.serviceFee }}元
成交价格
@@ -167,7 +167,7 @@
customerName: '',
profit: 0, // 利润
purchaseCost: 0, // 采购成本
- teamId: uni.getStorageSync('team').teamId,
+ teamId: uni.getStorageSync('team').id,
businessManagerId: this.$util.getBmId()
},
courseList: {},
@@ -389,9 +389,17 @@
总成本和总利润为单个产品的采购成本价和利润的和
*/
list.map(e => {
- const curPurchase = +e.settlementPrice + +e.serviceFee
- purchase += curPurchase
- profit += +e.finalPrice - curPurchase
+ if (isTrial) {
+ e.settlementPrice = 0
+ e.serviceFee = 0
+ e.finalPrice = 0
+ e.finalValue = 0
+ e.discountRate = '0%'
+ } else {
+ const curPurchase = +e.settlementPrice + +e.serviceFee
+ purchase += curPurchase
+ profit += +e.finalPrice - curPurchase
+ }
})
form.purchaseCost = isTrial ? 0 : Math.round(purchase)
form.profit = isTrial ? 0 : Math.round(profit)
diff --git a/order/orders/orders.vue b/order/orders/orders.vue
index f1908cf..81385e8 100644
--- a/order/orders/orders.vue
+++ b/order/orders/orders.vue
@@ -174,7 +174,7 @@
getList() {
const data = {
businessManagerId: this.$util.getBmId(),
- teamId: uni.getStorageSync('team').partnerClassificationId,
+ teamId: uni.getStorageSync('team').id,
keywords: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
diff --git a/pages/clientDetail/clientDetail.vue b/pages/clientDetail/clientDetail.vue
index 4b65981..355849d 100644
--- a/pages/clientDetail/clientDetail.vue
+++ b/pages/clientDetail/clientDetail.vue
@@ -159,11 +159,13 @@
}, 500)
}
},
- onLoad(option) {
- this.customerId = option.customerId
- this.isDetail = !!option.show
+ onShow() {
+ const pages = getCurrentPages()
+ const { options } = pages[pages.length - 1]
+ this.customerId = options.customerId
+ this.isDetail = !!options.show
- option.customerId && this.getInfo()
+ options.customerId && this.getInfo()
// 非详情才需要查询学校和行业
if (!this.isDetail) {
this.getSchool()
@@ -171,8 +173,8 @@
}
// 设置标题
uni.setNavigationBarTitle({
- title: option.customerId ?
- (option.show ?
+ title: options.customerId ?
+ (options.show ?
'客户详情' :
'编辑客户') :
'新增客户'
@@ -294,7 +296,7 @@
uni.hideLoading()
this.$util.sucMsg('编辑成功')
setTimeout(() => {
- this.$util.to('../clients/clients')
+ uni.navigateBack()
}, 1500)
}).catch(res => {})
} else {
diff --git a/pages/clients/clients.vue b/pages/clients/clients.vue
index bb18d03..4c6e853 100644
--- a/pages/clients/clients.vue
+++ b/pages/clients/clients.vue
@@ -142,7 +142,7 @@
getList() {
const data = {
businessManagerId: this.$util.getBmId(),
- teamId: uni.getStorageSync('team').teamId,
+ teamId: uni.getStorageSync('team').id,
customerType: this.customerType,
keywords: this.keyword,
pageNum: this.page,
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 16a73c9..280097f 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -155,6 +155,7 @@
getTeamsByAccountId().then(({ data }) => {
data.map(e => {
const n = e.partnerClassificationList
+ e.id = n.id
e.teamId = e.partnerClassificationId
e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList
diff --git a/pages/products/products.vue b/pages/products/products.vue
index f00c4c4..f859590 100644
--- a/pages/products/products.vue
+++ b/pages/products/products.vue
@@ -73,7 +73,7 @@
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据
status: 'more', // 上拉加载状态 more|loading|noMore
searchTimer: null,
- sort: '',
+ sort: 'desc',
keyword: '',
list: [],
page: 1,
diff --git a/styles/common.scss b/styles/common.scss
index 31ddb0b..65f0dda 100644
--- a/styles/common.scss
+++ b/styles/common.scss
@@ -100,7 +100,6 @@ ul {
}
}
.err {
- border-bottom-color: #f00;
.name {
color: #f00;
}