yujialong 1 year ago
parent cf1162858b
commit 19f0e898af
  1. 2
      apis/request.js
  2. 2
      order/addCourse/addCourse.vue
  3. 5
      order/curClient/curClient.vue
  4. 35
      order/editCourse/editCourse.vue
  5. 60
      order/orderDetail/orderDetail.vue
  6. 15
      order/productDetail/productDetail.vue
  7. 4
      order/shopCart/shopCart.vue
  8. 25
      pages.json
  9. 3
      pages/index/index.vue
  10. 21
      pages/login/login.vue
  11. 2
      pages/orders/orders.vue
  12. 8
      pages/person/person.vue
  13. 219
      pages/products/products.vue
  14. 10
      pages/workbench/workbench.vue
  15. 0
      team/plans/plans.vue

@ -41,7 +41,7 @@ const request = options => {
})
}, 1500)
reject(data)
} else if (status == 10028) { // 用户不存在
} else if (status == 10028 || status == 10014) { // 用户不存在
resolve(data)
} else if (!status) {
resolve(data)

@ -232,7 +232,7 @@
settlementPriceUnit: e.settlementPrice || 0, //
serviceFee: 0, //
mallNonAssociatedLinks: e.mallNonAssociatedLinks, //
typeName: e.typeName
typeName: e.typeName,
}
},
//

@ -132,6 +132,11 @@
const { options } = pages[pages.length - 1]
this.customerId = options.customerId
this.customerName = options.name
//
try {
uni.removeStorageSync('orderForm')
uni.removeStorageSync('courses')
} catch (e) {}
this.initList()
},
methods: {

@ -1,11 +1,12 @@
<template>
<view class="page">
<template v-for="c in courses">
<view v-if="c.list.length" class="block">
<view v-if="c.list.length && c.list.filter(e => !e.edited).length" class="block">
<view class="l-title">{{ c.name }}</view>
<uni-icons class="arrow" type="top" size="20" color="#007EFF" @click="toggle(c)"></uni-icons>
<view v-show="!c.shrink">
<view v-for="(item, i) in c.list">
<template v-for="(item, i) in c.list">
<view v-if="!item.edited" :key="i">
<view class="pro-name">
<view class="left">
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
@ -64,6 +65,7 @@
</view>
</view>
</view>
</template>
</view>
</view>
</template>
@ -74,7 +76,7 @@
</template>
<script>
import { getOrderOtherTime } from '@/apis/modules/order.js'
import { getOrderOtherTime, queryCitySettlementPrice } from '@/apis/modules/order.js'
import { getPartnerTeamRates } from '@/apis/modules/parner.js'
import { productCategoryList } from '@/apis/modules/product.js'
export default {
@ -83,6 +85,8 @@
orderType: 1,
customerId: '',
action: '',
provinceId: '',
cityId: '',
timer: null,
units: [{
text: '日',
@ -108,14 +112,17 @@
this.orderType = options.orderType
this.customerId = options.customerId
this.action = options.action
this.provinceId = options.provinceId
this.cityId = options.cityId
this.handleProduct()
this.getRate()
},
methods: {
//
handleProduct() {
async handleProduct() {
const list = uni.getStorageSync('courses')
let courses = {}
//
productCategoryList().then(res => {
res.classificationList.forEach(e => {
@ -125,14 +132,20 @@
list: []
}
})
list.map(e => {
const { provinceId, cityId } = this
list.map(async e => {
//
if (provinceId) {
const res = await queryCitySettlementPrice(e.mallId, provinceId, cityId)
if (res.mallPrice) e.settlementPriceUnit = res.mallPrice.discountRate || 0
}
courses['list' + e.authority].list.push(e)
})
this.courses = courses
}).catch(e => {})
try {
uni.removeStorageSync('courses')
} catch (e) {}
// try {
// uni.removeStorageSync('courses')
// } catch (e) {}
},
selectUnit(item) {
const that = this
@ -244,8 +257,8 @@
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed((2))
console.log('dealSettlePrice2=>', row, this.orderType, this.$util.handleNaN(sPrice))
row.settlementPrice = this.$util.handleNaN(sPrice)
console.log('dealSettlePrice2=>', row, this.$util.handleNaN(sPrice))
//
if (row.settlementPrice) {
row.serviceFee = (row.finalPrice * (this.rate / 100)).toFixed(2)
@ -343,13 +356,13 @@
msg = '请输入成交价!'
break
}
e.edited = 1 //
}
console.log(33, this.err)
if (msg) return this.$util.errMsg(msg)
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) //
uni.setStorageSync('courses', this.courses)
uni.redirectTo({
url: `../orderDetail/orderDetail`
url: `../orderDetail/orderDetail?edited=1`
})
},
}

@ -40,6 +40,7 @@
<view v-if="isDetail" class="val">{{ orderTypes.find(e => e.value === form.orderType).text }}</view>
<uni-data-picker v-else class="picker-input" placeholder="请选择订单类型" popup-title="请选择订单类型" preload :clear-icon="false" :localdata="orderTypes" v-model="form.orderType" @change="calcTotal(1)"></uni-data-picker>
</view>
<template v-if="edited">
<view class="line">
<view class="name">订单编号</view>
<view class="val">{{ form.orderNumber }}</view>
@ -52,6 +53,7 @@
<view class="name">订单金额</view>
<view class="val">{{ form.orderAmount }}</view>
</view>
</template>
</view>
</view>
@ -68,7 +70,7 @@
</view>
<view class="course-action">
<image v-if="!isDetail" class="del" src="@/static/image/trash.png" mode="widthFix" @click.stop="delCourse(c, i)"></image>
<button v-if="(item.authority == 3 || item.authority == 4) && (!isDetail || (isDetail && item.shipContent))" class="info-btn" type="primary" @click.stop="showShip(item)">发货信息</button>
<button v-if="(item.authority == 0 || item.authority == 3 || item.authority == 4) && ((!isDetail && item.mallNonAssociatedLinks && item.mallNonAssociatedLinks.length) || (isDetail && item.shipContent))" class="course-btn" type="primary" @click.stop="showShip(item)">发货信息</button>
</view>
</view>
<view class="info">
@ -134,8 +136,14 @@
</template>
<view class="bottom">
<template v-if="!edited && !orderId">
<view class="next-wrap">
<view class="lg-btn next" @click="toAdd(0)">下一步</view>
</view>
</template>
<template v-else>
<view v-if="!orderId" class="add-wrap">
<view class="add-btn" @click="toAdd">
<view class="lg-btn" @click="toAdd(1)">
<uni-icons class="icon" type="plus" color="#007FFF"></uni-icons>
添加产品
</view>
@ -158,6 +166,7 @@
</view>
<view v-if="!isDetail" class="btn" @click="submit">提交({{ courses.length }})</view>
</view>
</template>
</view>
<view class="popup-mask" v-show="customerVisible" @click="closeCustomer"></view>
@ -186,6 +195,8 @@
return {
isDetail: false,
orderId: '',
edited: false,
shopCart: false,
orderTypes: [{
text: '正式',
value: 1
@ -259,6 +270,8 @@
const { options } = pages[pages.length - 1]
this.orderId = options.orderId
this.isDetail = !!options.show
this.edited = options.edited //
this.shopCart = options.shopCart //
const store = uni.getStorageSync('courses')
const form = uni.getStorageSync('orderForm')
if (form) {
@ -268,7 +281,7 @@
this.getRate()
if (this.orderId) {
this.getInfo()
} else if (store) {
} else if (options.edited && store) { //
console.log(11, store)
//
const list = []
@ -418,22 +431,18 @@
}).catch(res => {})
},
//
toAdd() {
uni.setStorageSync('courses', this.courses)
toAdd(add) {
add && uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form
//
const url = this.shopCart ?
`../editCourse/editCourse` :
`../addCourse/addCourse`
customerId ?
this.$util.to(`../addCourse/addCourse?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) :
this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) :
this.$util.errMsg('请先选择客户!')
},
//
editCourse(c, i) {
if (this.isDetail) return false
uni.setStorageSync('courses', this.courses)
uni.setStorageSync('orderForm', this.form)
const { customerId, orderType } = this.form
this.$util.to(`../editCourse/editCourse?orderType=${orderType}&customerId=${customerId}`)
},
//
toClient() {
uni.setStorageSync('courses', this.courseList)
@ -812,15 +821,12 @@
}
.course-btn {
padding: 0 16rpx;
margin-right: 10rpx;
font-size: 28rpx;
white-space: nowrap;
&.mg {
margin-left: 10rpx;
}
}
.del {
width: 40rpx;
margin-right: 20rpx;
}
.icon {
width: 60rpx;
@ -834,9 +840,12 @@
.line {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
margin: 5px 0;
padding: 28rpx 0;
font-size: 12px;
border-bottom: 1px solid #E6E8ED;
&:last-child {
border-bottom: 0;
}
}
.label {
font-size: 28rpx;
@ -877,12 +886,14 @@
background-color: #fff;
box-shadow: 0 -2px 2px #f5f5f5;
box-sizing: border-box;
}
.add-wrap {
padding: 16rpx 24rpx 40rpx;
background-color: #f5f5f5;
}
/deep/.add-btn {
.next-wrap {
padding: 24rpx 24rpx 0;
}
/deep/.lg-btn {
display: flex;
justify-content: center;
align-items: center;
@ -898,6 +909,11 @@
.uni-icons {
font-size: 38rpx !important;
}
&.next {
color: #fff;
background-color: #007EFF;
}
}
}
.product {
display: flex;

@ -76,14 +76,14 @@
<image class="icon" src="@/static/image/product/5.png"></image>
产品参数
</view>
<view class="download" @click="downloadAll">
<view v-if="auth('产品:下载')" class="download" @click="downloadAll">
下载全部
<image class="icon" src="@/static/image/product/6.png"></image>
</view>
</view>
<view v-if="form.mallAnnex" class="files">
<view v-for="(file, i) in form.mallAnnex" :key="i" class="file" @click="download(file)">
<view v-for="(file, i) in form.mallAnnex" :key="i" class="file">
<view class="text">
<image class="icon" src="@/static/image/product/ppt.png"></image>
{{ file.fileName }}
@ -141,8 +141,8 @@
selectedBorder: '1px rgba(83, 200, 249,0.9) solid'
},
mpStyle: {
p: 'font-size: 26rpx !important;font-family: Microsoft Yahei !important;color: #333 !important;',
span: 'font-size: 26rpx !important;font-family: Microsoft Yahei !important;color: #333 !important;'
p: 'font-size: 25rpx !important;font-family: Microsoft Yahei !important;font-weight: 400 !important;color: #333 !important;',
span: 'font-size: 25rpx !important;font-family: Microsoft Yahei !important;font-weight: 400 !important;color: #333 !important;'
}
}
},
@ -159,6 +159,11 @@
this.getInfo()
this.getShopCart()
this.getTypes()
//
try {
uni.removeStorageSync('orderForm')
uni.removeStorageSync('courses')
} catch (e) {}
},
methods: {
//
@ -282,7 +287,7 @@
settlementPriceUnit: 0, //
serviceFee: 0 //
}])
this.$util.to(`/order/editCourse/editCourse`)
this.$util.to(`../orderDetail/orderDetail?shopCart=1`)
}
}
}

@ -84,6 +84,8 @@
//
try {
uni.removeStorageSync('orderForm')
uni.removeStorageSync('courses')
uni.removeStorageSync('orderEdited')
} catch (e) {}
this.initList()
},
@ -239,7 +241,7 @@
})
Promise.all(promises).then(_ => {
uni.setStorageSync('courses', courses)
this.$util.to(`/order/editCourse/editCourse`)
this.$util.to(`../orderDetail/orderDetail?shopCart=1`)
})
} else {
this.$util.errMsg('请先添加产品!')

@ -32,22 +32,6 @@
"enablePullDownRefresh": true
}
},
{
"path" : "pages/products/products",
"style" :
{
"navigationBarTitleText": "产品",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/plans/plans",
"style" :
{
"navigationBarTitleText": "产品方案",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/person/person",
"style" :
@ -164,7 +148,14 @@
"navigationBarTitleText": "学习",
"enablePullDownRefresh": true
}
},
{
"path" : "plans/plans",
"style" :
{
"navigationBarTitleText": "产品方案",
"enablePullDownRefresh": true
}
}
,{
"path" : "info/info",

@ -138,6 +138,7 @@
title: '加载中'
})
getTeamsByAccountId().then(({ data }) => {
let hasOwnTeam = 0 //
data.map(e => {
const n = e.partnerClassificationList
e.id = n.id
@ -145,7 +146,9 @@
e.teamId = e.isTeam == 1 ? +e.partnerClassificationId : n.id
e.partnerClassificationName = n.partnerClassificationName
delete e.partnerClassificationList
if (e.isTeam == 1) hasOwnTeam = 1
})
uni.setStorageSync('hasOwnTeam', hasOwnTeam)
if (data.length) {
/**
* @description 如果是第一次进则默认选中第一个团队并把该团队的信息存入缓存

@ -152,10 +152,29 @@
phone,
unionid: this.unionid,
platformId: 4
}).then(({ token }) => {
}).then(res => {
const { token, status } = res
if (status == 10014) {
// unilogincode
uni.login({
success: ({ code }) => {
getSessionKey({
code,
}).then(({ sessionKey }) => {
this.sessionKey = sessionKey.session_key
this.openid = sessionKey.openid
uni.redirectTo({
url: `../reg/reg?openid=${this.openid}&phone=${phone}`
})
}).catch(e => {})
this.isReg = true
}
})
} else {
this.submiting = false
uni.setStorageSync('token', token)
this.toIndex()
}
}).catch(e => {
this.submiting = false
uni.showToast({

@ -146,7 +146,7 @@
},
onShow() {
this.per = true
//
//
try {
uni.removeStorageSync('orderForm')
uni.removeStorageSync('courses')

@ -20,7 +20,7 @@
</view>
<uni-icons type="right" size="15" color="#ccc"></uni-icons>
</view>
<view v-if="disabled && auth('我的:我的团队')" class="item" @click="createTeam">
<view v-if="!hasOwnTeam && auth('我的:我的团队')" class="item" @click="createTeam">
<view class="left">
<image class="icon" src="@/static/image/person4.png" mode=""></image>
<text class="name">创建自己的团队</text>
@ -115,6 +115,7 @@
},
avatar: uni.getStorageSync('avatar') || '@/static/image/avatar.png',
userName: uni.getStorageSync('userName'),
hasOwnTeam: uni.getStorageSync('hasOwnTeam') == 1, //
disabled: true,
provinces: [],
cities: [],
@ -156,8 +157,9 @@
teamId
}).then(({ my }) => {
this.my = my
this.avatar = my.info.userAvatars
uni.setStorageSync('avatar', my.info.userAvatars)
const avatar = my.info.userAvatars || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
this.avatar = avatar
uni.setStorageSync('avatar', avatar)
this.provinceId = my.teamInfo.provinceId
this.cityId = my.teamInfo.cityId
uni.setStorageSync('provinceId', this.provinceId)

@ -1,219 +0,0 @@
<template>
<view>
<view class="filter">
<uni-search-bar class="search" radius="30" placeholder="请输入产品名称" v-model="keyword" clearButton="auto" cancelButton="none" />
<view :class="['sort', sort]" @click="switchSort"></view>
</view>
<ul class="tab">
<li v-for="(tab, i) in tabs" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
</ul>
<ul class="list">
<li v-for="item in list">
<view class="pro-name">
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image>
{{ item.productName }}
</view>
<view class="info">
<view class="line">
<text class="name">产品简介</text>
<view class="val ell-wrap">
<view :class="{ell: !item.toggle}">{{ item.briefIntroduction }}</view>
<view v-if="item.briefIntroduction.length > 14" class="toggle" @click="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view>
</view>
</view>
<view class="line">
<text class="name">产品类型</text>
<text class="val">{{ tabs.find(e => e.id === item.productType).name }}</text>
</view>
<view class="line">
<text class="name">市场单价</text>
<text class="val">{{ item.marketPrice }}/</text>
</view>
<view class="line">
<text class="name">结算方式</text>
<text class="val">{{ item.settlementMethod ? '比例分成' : '结算单价' }} {{ item.settlementPrice }}/</text>
</view>
<view class="line">
<text class="name">供应厂商</text>
<text class="val">{{ item.supplierName }}</text>
</view>
</view>
</li>
</ul>
<uni-load-more :status="status" />
</view>
</template>
<script>
import { AppletsDataProductList, tagsList, listOfGoods } from '@/apis/modules/product.js'
export default {
data() {
return {
curTab: '',
tabs: [
{
name: '全部',
id: ''
},
{
name: '实训课程',
id: 1
},
{
name: '理论课程',
id: 0
},
{
name: '数据产品',
id: 2
}
],
reachBottom: 0, // 0->,1->,-1->
status: 'more', // more|loading|noMore
searchTimer: null,
sort: 'desc',
keyword: '',
list: [],
page: 1,
pageSize: 10
}
},
watch: {
keyword () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initList()
}, 500)
}
},
//
onPullDownRefresh() {
this.initList()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1500)
},
//
onReachBottom() {
if (this.reachBottom >= 0) {
this.reachBottom = 1
this.status = 'loading'
this.getList()
}
},
onShow() {
this.initList()
},
methods: {
getList() {
listOfGoods({
pageNum: this.page,
pageSize: this.pageSize,
sort: 0,
isShelves: 0,
hotTag: 1,
productName: this.keyword,
}).then(({ page }) => {
// list
const list = page.records
list.map(e => {
e.toggle = e.briefIntroduction.length < 14 // 14
})
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list
this.page++ // page+1
const noMore = this.list.length === page.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
//
toggle(item) {
item.toggle = !item.toggle
},
//
switchSort() {
this.sort = this.sort === 'desc' ? 'asc' : 'desc'
this.initList()
},
// tab
tabChange(tab) {
this.curTab = tab.id
this.initList()
}
}
}
</script>
<style scoped lang="scss">
.filter {
display: flex;
align-items: center;
.search {
flex: 1;
}
.sl-filter {
width: 30%;
margin-left: 10%;
}
}
.list {
li {
padding: 0 24rpx;
margin: 16rpx 24rpx;
background-color: #fff;
border-radius: 16rpx;
}
.pro-name {
display: flex;
align-items: center;
padding: 18rpx 0;
font-size: 30rpx;
color: #333;
border-bottom: 1px solid #E6E8ED;
.icon {
width: 52rpx;
height: 52rpx;
margin-right: 20rpx;
}
}
.info {
padding: 12rpx 0;
}
.line {
display: flex;
padding: 12rpx 0;
}
.name {
margin-right: 10rpx;
font-size: 28rpx;
color: #999;
}
.val {
max-width: 70%;
font-size: 28rpx;
color: #333;
}
.ell-wrap {
display: inline-flex;
align-items: center;
}
.ell {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.toggle {
margin-left: 10rpx;
white-space: nowrap;
font-size: 24rpx;
color: #0e92ef;
}
}
</style>

@ -18,16 +18,16 @@
<image class="icon" src="@/static/image/workbench/index3.png" mode="widthFix"></image>
<view class="text">客户</view>
</li>
<li v-if="auth('工作台:方案')" @click="$util.to('../plans/plans')">
<li v-if="auth('工作台:方案')" @click="$util.to('/team/plans/plans')">
<image class="icon" src="@/static/image/workbench/index4.png" mode="widthFix"></image>
<view class="text">方案</view>
</li>
<li v-if="auth('工作台:学习')" @click="$util.to('/team/study/study')">
<image class="icon" src="@/static/image/workbench/index11.png" mode="widthFix" style="width: 64rpx"></image>
<image class="icon info-icon" src="@/static/image/workbench/index11.png" mode="widthFix"></image>
<view class="text">学习</view>
</li>
<li v-if="auth('工作台:资讯')" @click="$util.to('/team/info/info')">
<image class="icon" src="@/static/image/workbench/index12.png" mode="widthFix" style="width: 64rpx"></image>
<image class="icon info-icon" src="@/static/image/workbench/index12.png" mode="widthFix"></image>
<view class="text">资讯</view>
</li>
</ul>
@ -333,6 +333,10 @@
.icon {
width: 78rpx;
}
.info-icon {
width: 64rpx;
max-height: 64rpx;
}
.text {
font-size: 28rpx;
color: #333;

Loading…
Cancel
Save