master
yujialong 3 years ago
parent bd81608900
commit 10d6c0331f
  1. 4
      apis/modules/course.js
  2. 32
      apis/modules/order.js
  3. 2
      apis/request.js
  4. 1
      components/sl-filter/sl-filter.vue
  5. 8
      pages.json
  6. 55
      pages/addCourse/addCourse.vue
  7. 2
      pages/addStaff/addStaff.vue
  8. 94
      pages/editCourse/editCourse.vue
  9. 141
      pages/orderDetail/orderDetail.vue
  10. 6
      pages/orders/orders.vue
  11. 216
      pages/products/products.vue
  12. 0
      static/image/qrcode.png
  13. 6
      styles/common.scss

@ -3,4 +3,8 @@ const { get, post } = request
export const curriculumList = (data) => { export const curriculumList = (data) => {
return post('nakadai/nakadai/curriculum/curriculumList', data) return post('nakadai/nakadai/curriculum/curriculumList', data)
}
export const AppletsDataProductList = (data) => {
return post('nakadai/nakadai/dataProduct/AppletsDataProductList', data)
} }

@ -1,34 +1,22 @@
import request from '@/apis/request.js' import request from '@/apis/request.js'
const { get, post } = request const { get, post } = request
export const queryCustomer = (data) => { export const getOrderOtherTime = (data) => {
return post('nakadai/nakadai/customer/queryCustomer', data) return post('nakadai/nakadai/orderOther/getOrderOtherTime', data)
} }
export const queryCustomerDetails = (data) => { export const add = (data) => {
return get('nakadai/nakadai/customer/queryCustomerDetails', data) return post('nakadai/nakadai/order/add', data)
} }
export const querySchool = (data) => { export const update = (data) => {
return get('nakadai/nakadai/school/querySchool', data) return post('nakadai/nakadai/order/update', data)
} }
export const queryIndustryClass = (data) => { export const getDetail = (data) => {
return get('nakadai/nakadai/hrIndustryClass/queryIndustryClass', data) return get('nakadai/nakadai/order/get', data)
} }
export const queryIndustry = (data) => { export const renew = (data) => {
return get('nakadai/nakadai/hrIndustry/queryIndustry', data) return post('nakadai/nakadai/orderOther/renew', data)
}
export const queryCustomerIsExists = (data) => {
return get('nakadai/nakadai/customer/queryCustomerIsExists', data)
}
export const addCustomer = (data) => {
return post('nakadai/nakadai/customer/addCustomer', data)
}
export const updateCustomer = (data) => {
return post('nakadai/nakadai/customer/updateCustomer', data)
} }

@ -12,7 +12,7 @@ const request = options => {
}) })
} }
const header = Object.assign({}, config.headers, { const header = Object.assign({}, config.headers, {
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzNTMwODYyLCJleHAiOjE2NTM1NzQwNjIsImFjY291bnRJZCI6IjEifQ.ZFU5-NtjHBxKLcKUo6OuIrM8Na9HYQB6SqQSd4ZkXbo' token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjUzNjE3NjI4LCJleHAiOjE2NTM2NjA4MjgsImFjY291bnRJZCI6IjEifQ.AmvmMxWkRD4f8J4oWHoRvm1CCrzBm7TH2QDG4E175_s'
}) })
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
uni.request({ uni.request({

@ -263,7 +263,6 @@
@import 'iconfont/iconfont.css'; @import 'iconfont/iconfont.css';
.select-tab { .select-tab {
border-bottom: #F7F7F7 1px solid;
background-color: #FFFFFF; background-color: #FFFFFF;
display: flex; display: flex;
width: 100%; width: 100%;

@ -7,6 +7,14 @@
"navigationBarTitleText": "订单列表", "navigationBarTitleText": "订单列表",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/products/products",
"style" :
{
"navigationBarTitleText": "产品",
"enablePullDownRefresh": true
}
}, },
{ {
"path" : "pages/clients/clients", "path" : "pages/clients/clients",

@ -10,7 +10,7 @@
<ul class="list"> <ul class="list">
<li v-for="item in list"> <li v-for="item in list">
<uni-data-checkbox class="check" multiple v-model="item.check" :localdata="checkData"></uni-data-checkbox> <uni-data-checkbox class="check" multiple v-model="item.check" :localdata="item.checkData"></uni-data-checkbox>
<image class="icon" src="../../static/image/course1.png" mode="widthFix"></image> <image class="icon" src="../../static/image/course1.png" mode="widthFix"></image>
{{ item.curriculumName }} {{ item.curriculumName }}
</li> </li>
@ -25,10 +25,12 @@
<script> <script>
import { curriculumList } from '@/apis/modules/course.js' import { curriculumList } from '@/apis/modules/course.js'
import { renew } from '@/apis/modules/order.js'
export default { export default {
data() { data() {
return { return {
orderType: 0, orderType: 0,
customerId: '',
curTab: '', curTab: '',
tabs: [ tabs: [
{ {
@ -65,6 +67,7 @@
text: '全部', text: '全部',
value: 1 value: 1
}], }],
courses: uni.getStorageSync('courses') || []
} }
}, },
watch: { watch: {
@ -84,10 +87,13 @@
}, },
onShow() { onShow() {
const pages = getCurrentPages() const pages = getCurrentPages()
this.orderType = pages[pages.length - 1].options.orderType const { options } = pages[pages.length - 1]
this.orderType = options.orderType
this.customerId = options.customerId
this.getList() this.getList()
}, },
methods: { methods: {
//
getList() { getList() {
curriculumList({ curriculumList({
curriculumName: this.keyword, curriculumName: this.keyword,
@ -96,8 +102,20 @@
pageSize: 10000 pageSize: 10000
}).then(({ page }) => { }).then(({ page }) => {
const { records } = page const { records } = page
const list = this.courses
//
records.map(e => { records.map(e => {
const checkData = {
text: '',
value: 1
}
e.check = [] e.check = []
//
if (list.find(n => n.dataOrCourseId == e.cid)) {
checkData.disable = true //
e.check = [1]
}
e.checkData = [checkData]
}) })
this.list = records this.list = records
}).catch(e => {}) }).catch(e => {})
@ -140,14 +158,35 @@
submit() { submit() {
const list = this.list.filter(e => e.check.length) // const list = this.list.filter(e => e.check.length) //
if (list.length) { if (list.length) {
const result = [] const result = this.courses
const courseIds = []
const dataIds = []
const { customerId } = this
list.map(e => { list.map(e => {
result.push(this.createParam(e)) // e.authority ? courseIds.push(e.cid) : dataIds.push(e.cid)
}) courseIds.push(e.cid)
uni.setStorageSync('courses', result) // result.find(n => n.dataOrCourseId == e.cid) || result.push(this.createParam(e))
uni.redirectTo({
url: `../editCourse/editCourse`
}) })
//
renew({
authority: 1,
customerId,
productId: courseIds
}).then(({ orderOthers }) => {
result.map(e => {
// const item = orderOthers.map(n => dataOrCourseId == e.dataOrCourseId && n.authority && e.authority)
const item = orderOthers.find(n => n.dataOrCourseId == e.dataOrCourseId)
if (item) {
let date = new Date(item.endTime)
date = new Date(date.setDate(date.getDate() + 1))
e.startTime = this.$util.formatDate(date, 'yyyy-MM-dd')
}
})
uni.setStorageSync('courses', result) //
uni.redirectTo({
url: `../editCourse/editCourse?customerId=${this.customerId}`
})
}).catch(e => {})
} else { } else {
this.$util.errMsg('请选择产品!') this.$util.errMsg('请选择产品!')
} }

@ -5,7 +5,7 @@
<uni-list-item thumb-size="sm" showArrow title="二维码邀请" clickable> <uni-list-item thumb-size="sm" showArrow title="二维码邀请" clickable>
<template v-slot:header> <template v-slot:header>
<view class="slot-box"> <view class="slot-box">
<image class="icon" src="../../static/qrcode2.png" mode="widthFix"></image> <image class="icon" src="../../static/image/qrcode.png" mode="widthFix"></image>
</view> </view>
</template> </template>
<template v-slot:body> <template v-slot:body>

@ -16,9 +16,9 @@
<view class="name">产品类型</view> <view class="name">产品类型</view>
<view class="val">{{ item.provinceName }}</view> <view class="val">{{ item.provinceName }}</view>
</view> </view>
<view class="line"> <view class="line req">
<view class="name">使用期限</view> <view class="name">使用期限</view>
<input type="text" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item)"> <input type="text" v-model="item.periodOfUse" placeholder="请输入" @change="calcDate(item, !item.authority)">
</view> </view>
<view class="line"> <view class="line">
<view class="name">使用期限单位</view> <view class="name">使用期限单位</view>
@ -26,7 +26,7 @@
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">起止日期</view> <view class="name">起止日期</view>
<uni-datetime-picker type="date" v-model="item.startTime" :border="false"> <uni-datetime-picker type="date" v-model="item.startTime" :border="false" @change="calcDate(item)">
<view :class="['ph', {val: item.startTime}]"> <view :class="['ph', {val: item.startTime}]">
{{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}} {{ item.endTime ? item.startTime + ' - ' + item.endTime : item.startTime}}
</view> </view>
@ -51,7 +51,7 @@
</view> </view>
<view class="line"> <view class="line">
<view class="name">平台服务费</view> <view class="name">平台服务费</view>
<view class="val"></view> <view class="val">{{ item.serviceFee }}</view>
</view> </view>
<view class="line req"> <view class="line req">
<view class="name">成交价</view> <view class="name">成交价</view>
@ -70,9 +70,11 @@
</template> </template>
<script> <script>
import { getOrderOtherTime } from '@/apis/modules/order.js'
export default { export default {
data() { data() {
return { return {
customerId: '',
units: [{ units: [{
text: '日', text: '日',
value: 0 value: 0
@ -83,11 +85,15 @@
text: '年', text: '年',
value: 2 value: 2
}], }],
courses: uni.getStorageSync('courses') // courses: uni.getStorageSync('courses'), //
orderRepeat: [],
repeatMsg: ''
} }
}, },
onLoad(option) { onShow() {
const pages = getCurrentPages()
const { options } = pages[pages.length - 1]
this.customerId = options.customerId
}, },
methods: { methods: {
// //
@ -102,7 +108,7 @@
}) })
}, },
// 使 // 使
calcDate(row) { calcDate(row, fromData) {
const { periodOfUse, options } = row const { periodOfUse, options } = row
let optionsData = 0 let optionsData = 0
if (periodOfUse) { if (periodOfUse) {
@ -133,27 +139,27 @@
} }
this.dealSettlePrice(row) this.dealSettlePrice(row)
// +1 // +1
// if (isDate) { if (!fromData) {
// const cId = row.dataOrCourseId const cId = row.dataOrCourseId
// const date = new Date(row.startTime) const date = new Date(row.startTime)
// const orderRepeat = this.orderRepeat const orderRepeat = this.orderRepeat
// this.$post(this.api.getOrderOtherTime, { getOrderOtherTime({
// customerId: this.form.customerId, customerId: this.customerId,
// id: row.dataOrCourseId, id: cId,
// startTime: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(), startTime: this.$util.formatDate(date, 'yyyy-MM-dd'),
// endTime: row.endTime endTime: row.endTime
// }).then(res => { }).then(res => {
// orderRepeat.includes(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1) orderRepeat.includes(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1)
// if (res.endTime) { if (res.endTime) {
// let time = new Date(res.endTime) let time = new Date(res.endTime)
// time = new Date(time.setDate(time.getDate() + 1)) time = new Date(time.setDate(time.getDate() + 1))
// row.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` row.startTime = this.$util.formatDate(time, 'yyyy-MM-dd')
// } }
// }).catch(res => { }).catch(res => {
// this.repeatMsg = res.message this.repeatMsg = res.message
// orderRepeat.includes(cId) || orderRepeat.push(cId) orderRepeat.includes(cId) || orderRepeat.push(cId)
// }) })
// } }
// //
this.calcDiscount(row) this.calcDiscount(row)
}, },
@ -171,15 +177,15 @@
priceUnit / 12 * useUnit : priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ? priceUnit * useUnit) * (row.authority ?
1 : 1 :
row.accountNum)).toFixed(2) row.accountNum)).toFixed((2))
} else { } else {
// * // *
sPrice = row.finalPrice * row.businessProportion / 100 sPrice = (row.finalPrice * row.businessProportion / 100).toFixed((2))
} }
row.settlementPrice = this.$util.handleNaN(sPrice) row.settlementPrice = this.$util.handleNaN(sPrice)
// *10% // *10%
if (row.settlementPrice) { if (row.settlementPrice) {
// row. row.serviceFee = (row.settlementPrice * 0.1).toFixed(2)
} }
}, },
// //
@ -215,6 +221,30 @@
}, },
// //
submit() { submit() {
const list = this.courses
let msg = ''
//
for (const i in list) {
const e = list[i]
if (e.periodOfUse === '') {
msg = '请输入使用期限!'
break
}
if (!e.startTime) {
msg = '请选择起止日期!'
break
}
if (e.accountNum === '') {
// msg = ''
// break
}
if (e.finalPrice === '') {
msg = '请输入成交价!'
break
}
}
if (msg) return this.$util.errMsg(msg)
if (this.orderRepeat.length) return this.$util.errMsg(this.repeatMsg) //
uni.setStorageSync('courses', this.courses) uni.setStorageSync('courses', this.courses)
uni.navigateBack() uni.navigateBack()
}, },

@ -83,7 +83,7 @@
</view> </view>
<view class="line"> <view class="line">
<view class="label">平台服务费</view> <view class="label">平台服务费</view>
<view class="val">2123</view> <view class="val">{{ item.serviceFee }}</view>
</view> </view>
<view class="line done"> <view class="line done">
<view class="val">成交价格</view> <view class="val">成交价格</view>
@ -95,7 +95,7 @@
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="add-btn" @click="toAdd"> <view v-if="!orderId" class="add-btn" @click="toAdd">
<uni-icons class="icon" type="plus" color="#007FFF"></uni-icons> <uni-icons class="icon" type="plus" color="#007FFF"></uni-icons>
添加产品 添加产品
</view> </view>
@ -104,20 +104,20 @@
<view class="text"> <view class="text">
<view class="total"> <view class="total">
已选 已选
<text class="num">10</text> <text class="num">{{ courses.length }}</text>
个产品&emsp; 个产品&emsp;
总成交价合计 总成交价合计
<text class="num">2125523</text> <text class="num">{{ form.orderAmount }}</text>
</view> </view>
<view class="info"> <view class="info">
总采购成本: 总采购成本:
<text class="num num1">341232</text> <text class="num num1">{{ purchase }}</text>
总产品利润: 总产品利润:
<text class="num">564123</text> <text class="num">{{ profit }}</text>
</view> </view>
</view> </view>
<view class="btn">提交</view> <view class="btn" @click="submit">提交</view>
</view> </view>
</view> </view>
@ -135,6 +135,7 @@
<script> <script>
import { queryCustomer, queryCustomerDetails } from '@/apis/modules/client.js' import { queryCustomer, queryCustomerDetails } from '@/apis/modules/client.js'
import { add, update, getDetail } from '@/apis/modules/order.js'
export default { export default {
data() { data() {
return { return {
@ -142,10 +143,10 @@
orderId: '', orderId: '',
orderTypes: [{ orderTypes: [{
text: '正式', text: '正式',
value: 0 value: 1
}, { }, {
text: '试用', text: '试用',
value: 1 value: 2
}], }],
form: { form: {
// orderNumber: '', // // orderNumber: '', //
@ -162,6 +163,16 @@
businessManager: '' businessManager: ''
}, },
courses: [], // courses: [], //
purchase: 0,
profit: 0,
contract: { //
contractName: '', //
contractFile: '', //
contractMoney: '', //
contractNumber: '',//
startTime: '', // -
endTime: '' // -
},
customerVisible: false, customerVisible: false,
keyword: '', keyword: '',
@ -172,14 +183,19 @@
}, },
onShow() { onShow() {
const pages = getCurrentPages() const pages = getCurrentPages()
this.orderId = pages[pages.length - 1].options.orderId const { options } = pages[pages.length - 1]
this.isDetail = !!pages[pages.length - 1].options.show this.orderId = options.orderId
this.isDetail = !!options.show
const store = uni.getStorageSync('courses') const store = uni.getStorageSync('courses')
if (this.orderId) { if (this.orderId) {
this.getInfo() this.getInfo()
} else if (store) { } else if (store) {
//
this.courses = store this.courses = store
uni.removeStorageSync('courses') try {
uni.removeStorageSync('courses')
} catch (e) {}
this.calcTotal()
} }
// //
if (!this.isDetail) { if (!this.isDetail) {
@ -197,10 +213,14 @@
methods: { methods: {
// //
getInfo() { getInfo() {
queryCustomerDetails({ getDetail({
orderId: this.orderId // orderId: this.orderId
}).then(({ result }) => { orderId: 121
}).then(({ orderDetails }) => {
const order = orderDetails
this.contract = order.contractInformation
this.form = order.order
this.courses = order.orderOther
}).catch(e => {}) }).catch(e => {})
}, },
// //
@ -247,7 +267,11 @@
}, },
// //
toAdd() { toAdd() {
this.$util.to(`../addCourse/addCourse?orderType=${this.form.orderType}`) uni.setStorageSync('courses', this.courses)
const { customerId, orderType } = this.form
customerId ?
this.$util.to(`../addCourse/addCourse?orderType=${orderType}&customerId=${customerId}`) :
this.$util.errMsg('请先选择客户!')
}, },
// //
delCourse(i) { delCourse(i) {
@ -261,44 +285,59 @@
}) })
}, },
// //
calcTotal(row) { calcTotal() {
this.dealSettlePrice(row)
let total = 0 let total = 0
const list = [...this.coursePermissions, ...this.dataPlatformPermissions] const list = this.courses
list.map(e => total += +e.finalPrice) let purchase = 0 //
this.form.orderAmount = total * 10000 let profit = 0 //
/**
* 1总采购成本+总产品利润=总成交价格
2单个产品采购成本 =结算价+平台服务费
3平台服务费=结算价*10%
4单个产品的利润=成交价-采购成本
总成本和总利润为单个产品的采购成本价和利润的和
*/
list.map(e => {
const curPurchase = +e.settlementPrice + +e.serviceFee
purchase += curPurchase
profit += +e.finalPrice - curPurchase
})
this.purchase = Math.round(purchase)
this.profit = Math.round(profit)
this.form.orderAmount = +this.purchase + +this.profit
}, },
// //
submit() { submit() {
const refs = this.$refs const { form, courses } = this
const { form } = this if (!courses.length) return this.$util.errMsg('请选择课程权限或数据权限后再确认订单!')
// inputv-modelbuginputref courses.map(e => {
form.name = refs.nameInput.val e.startTime = this.$util.formatDate(new Date(e.startTime), 'yyyy-MM-dd')
form.account = refs.accountInput.val
form.position = refs.positionInput.val
form.phone = refs.phoneInput.val
form.email = refs.emailInput.val
this.$nextTick(() => {
this.$refs.form.validate().then(res => {
if (this.nameRepeat) return this.$util.errMsg('客户已存在!')
if (this.customerId) {
updateCustomer(form).then(res => {
this.$util.sucMsg('编辑成功')
setTimeout(() => {
this.$util.to('../clients/clients')
}, 1500)
}).catch(res => {})
} else {
addCustomer(form).then(res => {
this.$util.sucMsg('添加成功')
setTimeout(() => {
uni.navigateBack()
}, 1500)
}).catch(res => {})
}
}).catch(err => {})
}) })
}, const data = {
contractInformation: this.contract, //
order: this.form, //
orderOther: courses //
}
if (this.orderId) {
update(data).then(res => {
this.$util.sucMsg('编辑成功')
setTimeout(() => {
this.$util.to('../orders/orders')
}, 1500)
}).catch(res => {})
} else {
add(data).then(res => {
this.$util.sucMsg('添加成功')
setTimeout(() => {
this.$util.to('../orders/orders')
}, 1500)
}).catch(res => {})
}
}
} }
} }
</script> </script>
@ -373,6 +412,7 @@
.bottom { .bottom {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%;
} }
/deep/.add-btn { /deep/.add-btn {
display: flex; display: flex;
@ -395,6 +435,7 @@
.product { .product {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center;
padding: 24rpx; padding: 24rpx;
margin-top: 40rpx; margin-top: 40rpx;
background-color: #fff; background-color: #fff;

@ -130,7 +130,11 @@
this.getList() this.getList()
} }
}, },
onLoad() { onShow() {
//
try {
uni.removeStorageSync('courses')
} catch (e) {}
// this.getList() // this.getList()
}, },
methods: { methods: {

@ -0,0 +1,216 @@
<template>
<view>
<uni-card :is-shadow="false" :border="false" padding="0" is-full>
<view class="filter">
<uni-search-bar class="search" radius="5" placeholder="请输入产品名称" v-model="keyword" clearButton="auto" cancelButton="none" />
<sl-filter class="sl-filter" :independence="true" :menuList="menuList" @result="result"></sl-filter>
</view>
</uni-card>
<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="../../static/image/course1.png" mode="widthFix"></image>
{{ item.productName }}
</view>
<view class="info">
<view class="line">
<text class="name">产品简介</text>
<text class="val">{{ item.briefIntroduction }}</text>
</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 ? '比例分成' : '结算单价' }}</text>
</view>
<view class="line">
<text class="name">供应厂商</text>
<text class="val">{{ item.supplier }}</text>
</view>
</view>
</li>
</ul>
<uni-load-more :status="status" />
</view>
</template>
<script>
import { AppletsDataProductList } from '@/apis/modules/course.js'
import slFilter from '@/components/sl-filter/sl-filter.vue'
export default {
data() {
return {
menuList: [
{
'title': '排序',
'detailTitle': '请选择排序(按上架时间)',
'key': 'sort',
'isSort': true,
'isMutiple': false,
'detailList': [
{
'title': '顺序',
'value': 'asc'
},
{
'title': '倒序',
'value': 'desc'
}
]
}
],
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: '',
keyword: '',
list: [],
page: 1,
pageSize: 10
}
},
components: {
slFilter
},
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() {
AppletsDataProductList({
sort: this.sort,
keywords: this.keyword,
productType: this.curTab,
pageNum: this.page,
pageSize: this.pageSize
}).then(({ data }) => {
// list
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records
this.page++ // page+1
const noMore = this.list.length === data.total //
this.status = noMore ? 'noMore' : 'more' // noMore
this.reachBottom = noMore ? -1 : 0 // -1
}).catch(e => {})
},
initList() {
this.page = 1
this.reachBottom = 0
this.getList()
},
//
result(val) {
this.sort = val.sort
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;
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;
}
}
</style>

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 666 B

@ -4,6 +4,12 @@ button[type=primary] {
page { page {
height: 100%; height: 100%;
} }
ul {
padding-left: 0;
li {
list-style: none;
}
}
.block { .block {
padding: 0 24rpx; padding: 0 24rpx;
margin: 20rpx 24rpx; margin: 20rpx 24rpx;

Loading…
Cancel
Save