master
yujialong 2 years ago
parent 2451d46666
commit 623291a197
  1. 8
      apis/modules/user.js
  2. 2
      apis/request.js
  3. 26
      order/editCourse/editCourse.vue
  4. 19
      order/orderDetail/orderDetail.vue
  5. 2
      pages/clientDetail/clientDetail.vue
  6. 29
      pages/email/email.vue
  7. 26
      pages/index/index.vue
  8. BIN
      static/image/tab1-1.png
  9. BIN
      static/image/tab1.png
  10. BIN
      static/image/tab2-1.png
  11. BIN
      static/image/tab2.png
  12. BIN
      static/image/tab3-1.png
  13. BIN
      static/image/tab3.png

@ -25,12 +25,12 @@ export const queryUserInfoDetails = () => {
return get('users/users/userAccount/queryUserInfoDetails') return get('users/users/userAccount/queryUserInfoDetails')
} }
export const bindPhoneOrEmail = (data) => { export const updateMyEmail = (data) => {
return post('users/users/userAccount/bindPhoneOrEmail', data) return post('nakadai/partner-team/updateMyEmail', data)
} }
export const sendPhoneOrEmailCode = (data) => { export const mailCodeSend = (data) => {
return post('users/users/userAccount/sendPhoneOrEmailCode', data) return post('nakadai/partner-team/mailCodeSend', data)
} }
export const changeAccount = account => { export const changeAccount = account => {

@ -19,7 +19,7 @@ const request = options => {
const { url } = options const { url } = options
uni.request({ uni.request({
header, header,
url: (otherUrl.find(e => url.includes(e)) ? 'http://192.168.31.151:9000/' : config.baseURL) + url, url: (otherUrl.find(e => url.includes(e)) ? 'http://192.168.31.137:9000/' : config.baseURL) + url,
method: options.method || 'GET', // 请求类型,默认为GET method: options.method || 'GET', // 请求类型,默认为GET
data: options.data || {}, // 请求参数,默认空对象 data: options.data || {}, // 请求参数,默认空对象
success: ({ data }) => { success: ({ data }) => {

@ -20,7 +20,7 @@
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">使用期限</view> <view class="name">使用期限</view>
<input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item, !item.authority)"> <input class="period" type="number" v-model="item.periodOfUse" placeholder="请输入" @input="calcDate(item, !item.authority)">
<view class="val unit" @click="showUnit(i)"> <view class="val unit" @click="showUnit(i)">
<text>{{ units.find(e => e.value === item.options).text }}</text> <text>{{ units.find(e => e.value === item.options).text }}</text>
<image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image> <image class="icon" src="@/static/image/arrow-down.png" mode="widthFix"></image>
@ -40,7 +40,7 @@
<view class="line req"> <view class="line req">
<view class="name">数量</view> <view class="name">数量</view>
<view v-if="item.authority" class="val">1</view> <view v-if="item.authority" class="val">1</view>
<input v-else type="number" v-model="item.accountNum" placeholder="请输入" @change="calcFinalPrice(item)"> <input v-else type="number" v-model="item.accountNum" placeholder="请输入" @input="calcFinalPrice(item)">
</view> </view>
<view class="line"> <view class="line">
<view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view> <view class="name">{{ item.authority ? '市场价' : '市场单价' }}</view>
@ -61,7 +61,7 @@
<view class="line req"> <view class="line req">
<view class="name">成交价</view> <view class="name">成交价</view>
<view class="inline"> <view class="inline">
<input type="number" v-model="item.finalPrice" placeholder="请输入" @change="calcFinalValue(item)"> <input type="number" v-model="item.finalPrice" placeholder="请输入" @input="calcFinalValue(item)">
</view> </view>
</view> </view>
@ -82,6 +82,7 @@
data() { data() {
return { return {
customerId: '', customerId: '',
timer: null,
units: [{ units: [{
text: '日', text: '日',
value: 0 value: 0
@ -154,7 +155,6 @@
} catch (e) {} } catch (e) {}
}, },
showUnit(i) { showUnit(i) {
console.log(333, this.$refs, this.$refs.unit[i].show)
this.$refs.unit[i].show() this.$refs.unit[i].show()
}, },
// //
@ -173,6 +173,8 @@
}, },
// 使 // 使
calcDate(row, fromData) { calcDate(row, fromData) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { periodOfUse, options } = row const { periodOfUse, options } = row
let optionsData = 0 let optionsData = 0
if (periodOfUse) { if (periodOfUse) {
@ -227,9 +229,13 @@
} }
// //
this.calcDiscount(row) this.calcDiscount(row)
}, 500)
}, },
// //
dealSettlePrice(row) { dealSettlePrice(row) {
console.log(33, row)
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const unit = row.options // 使 const unit = row.options // 使
const useUnit = row.periodOfUse // 使 const useUnit = row.periodOfUse // 使
let sPrice = '' let sPrice = ''
@ -252,25 +258,36 @@
if (row.settlementPrice) { if (row.settlementPrice) {
row.serviceFee = (row.settlementPrice * 0.1).toFixed(2) row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
} }
}, 500)
}, },
// //
calcDiscount(row) { calcDiscount(row) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const price = row.authority ? row.finalPrice : row.finalValue const price = row.authority ? row.finalPrice : row.finalValue
const { marketValue } = row const { marketValue } = row
console.log(66, row)
// (-)÷ x100% // (-)÷ x100%
if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%' if (price) row.discountRate = marketValue != 0 ? ((marketValue - price) / marketValue * 100).toFixed(2) + '%' : '0%'
}, 500)
}, },
// //// // ////
calcFinalValue(row) { calcFinalValue(row) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { authority, periodOfUse, options, accountNum, finalPrice } = row const { authority, periodOfUse, options, accountNum, finalPrice } = row
if (!authority && periodOfUse && accountNum && finalPrice) { if (!authority && periodOfUse && accountNum && finalPrice) {
row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2) row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2)
} }
// //
this.calcDiscount(row) this.calcDiscount(row)
this.dealSettlePrice(row)
}, 500)
}, },
// **// // **//
calcFinalPrice(row) { calcFinalPrice(row) {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
const { finalValue, accountNum, periodOfUse, finalPrice } = row const { finalValue, accountNum, periodOfUse, finalPrice } = row
if (periodOfUse) { if (periodOfUse) {
if (accountNum) { if (accountNum) {
@ -288,6 +305,7 @@
} }
} }
this.dealSettlePrice(row) this.dealSettlePrice(row)
}, 500)
}, },
// //
submit() { submit() {

@ -5,7 +5,7 @@
<view class="form-list"> <view class="form-list">
<view class="line"> <view class="line">
<view class="name">商务经理</view> <view class="name">商务经理</view>
<view class="val">{{ $util.getBmName() }}</view> <view class="val">{{ userName }}</view>
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">客户名称</view> <view class="name">客户名称</view>
@ -53,7 +53,7 @@
</view> </view>
<template v-for="c in courseList"> <template v-for="c in courseList">
<view v-if="c.list.length" class="block pro-wrap"> <view v-if="c.list.length" class="block pro-wrap" id="products">
<view class="l-title">{{ c.name }}</view> <view class="l-title">{{ c.name }}</view>
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons> <uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons>
<ul class="pro-list" v-show="!c.shrink"> <ul class="pro-list" v-show="!c.shrink">
@ -142,6 +142,7 @@
data() { data() {
return { return {
isDetail: false, isDetail: false,
userName: uni.getStorageSync('team').userName,
orderId: '', orderId: '',
orderTypes: [{ orderTypes: [{
text: '正式', text: '正式',
@ -203,6 +204,12 @@
} }
this.courseList = store this.courseList = store
this.courses = list this.courses = list
this.$nextTick(() => {
uni.pageScrollTo({
selector: '#products',
})
})
try { try {
uni.removeStorageSync('courses') uni.removeStorageSync('courses')
} catch (e) {} } catch (e) {}
@ -525,7 +532,7 @@
} }
.product { .product {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
align-items: center; align-items: center;
padding: 24rpx; padding: 24rpx;
background-color: #fff; background-color: #fff;
@ -533,7 +540,6 @@
white-space: nowrap; white-space: nowrap;
} }
.line { .line {
text-align: right;
&:first-child { &:first-child {
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -561,15 +567,16 @@
.total { .total {
margin-bottom: 10rpx; margin-bottom: 10rpx;
text-align: right; text-align: right;
font-size: 24rpx; font-size: 30rpx;
color: #666; color: #666;
.num { .num {
font-weight: 600; font-weight: 600;
font-size: 34rpx;
} }
} }
.num { .num {
margin: 0 5rpx; margin: 0 5rpx;
font-size: 34rpx; font-size: 30rpx;
color: #007EFF; color: #007EFF;
} }
} }

@ -269,7 +269,7 @@
}).catch(res => {}) }).catch(res => {})
} else { } else {
addCustomer(form).then(res => { addCustomer(form).then(res => {
this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。') this.$util.errMsg('创建客户成功!你现在可以去订单给客户下单了。', 2000)
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1500) }, 1500)

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import { queryUserInfoDetails, bindPhoneOrEmail, sendPhoneOrEmailCode } from '@/apis/modules/user.js' import { updateMyEmail, mailCodeSend } from '@/apis/modules/user.js'
export default { export default {
data() { data() {
return { return {
@ -23,36 +23,23 @@
}, },
codeDisabled: false, codeDisabled: false,
phoneTimer: null, phoneTimer: null,
phoneOpener: '',
btnText: '发送验证码', btnText: '发送验证码',
} }
}, },
onShow() { onShow() {
this.getInfo()
}, },
methods: { methods: {
//
getInfo() {
queryUserInfoDetails().then(({ result }) => {
this.userId = result.hrUserInfo.userId
}).catch(e => {})
},
// //
sendCode() { sendCode() {
const { email } = this.form const { email } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱') if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) return this.$util.errMsg('请输入正确的请输入邮箱')
sendPhoneOrEmailCode({ mailCodeSend({
userId: this.userId,
email, email,
types: 1 platformId: 4
}).then(({ message }) => { }).then(res => {
if (message.opener) {
this.phoneCountdown() this.phoneCountdown()
this.phoneOpener = message.opener
} else {
this.$util.errMsg(message)
}
}).catch(res => {}) }).catch(res => {})
}, },
// //
@ -78,12 +65,10 @@
const { email, code } = this.form const { email, code } = this.form
if (!email) return this.$util.errMsg('请输入邮箱') if (!email) return this.$util.errMsg('请输入邮箱')
if (!code) return this.$util.errMsg('请输入验证码') if (!code) return this.$util.errMsg('请输入验证码')
bindPhoneOrEmail({ updateMyEmail({
userId: this.userId,
email, email,
types: 1,
code, code,
opener: this.phoneOpener platformId: 4
}).then(res => { }).then(res => {
this.$util.sucMsg('修改成功!') this.$util.sucMsg('修改成功!')
setTimeout(() => { setTimeout(() => {

@ -142,12 +142,12 @@
} }
generateAuth(permissionMenu[0].children, '') generateAuth(permissionMenu[0].children, '')
uni.setStorageSync('auth', auth) uni.setStorageSync('auth', auth)
uni.setStorageSync('reloadAuth', 1) this.$forceUpdate()
uni.reLaunch({
url: '../index/index'
})
this.initRole() this.initRole()
}).catch(e => {}) }).catch(e => {
uni.setStorageSync('auth', [])
this.initRole()
})
}, },
// //
getInfo() { getInfo() {
@ -158,14 +158,22 @@
e.partnerClassificationName = n.partnerClassificationName e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList delete e.partnerClassificationList
}) })
// if (data.length) {
if (data.length && !this.teamId) { //
if (!this.teamId) {
this.teamId = data[0].teamId this.teamId = data[0].teamId
uni.setStorageSync('team', data[0]) uni.setStorageSync('team', data[0])
} }
} else {
// 退
uni.clearStorageSync()
uni.navigateTo({
url: '../login/login'
})
}
this.list = data this.list = data
// reloadAuth this.getAuth()
uni.getStorageSync('reloadAuth') ? this.initRole() : this.getAuth()
}).catch(e => {}) }).catch(e => {})
}, },
// //

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 627 B

Loading…
Cancel
Save