|
|
@ -10,7 +10,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<ul class="list"> |
|
|
|
<ul class="list"> |
|
|
|
<li v-for="(item, i) in list"> |
|
|
|
<li v-for="(item, i) in list"> |
|
|
|
<uni-data-checkbox class="check" multiple v-model="item.check" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox> |
|
|
|
<uni-data-checkbox v-if="item.check" class="check" multiple :value="[1]" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox> |
|
|
|
|
|
|
|
<uni-data-checkbox v-else class="check" multiple v-model="item.check" :localdata="item.checkData" @change="e => checkChange(e, i)"></uni-data-checkbox> |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
<image class="icon" :src="$util.getIcon(item)" mode="widthFix"></image> |
|
|
|
{{ item.productName }} |
|
|
|
{{ item.productName }} |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -30,7 +31,7 @@ |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
orderType: 0, |
|
|
|
orderType: 1, |
|
|
|
customerId: '', |
|
|
|
customerId: '', |
|
|
|
curTab: '', |
|
|
|
curTab: '', |
|
|
|
tabs: [ |
|
|
|
tabs: [ |
|
|
@ -61,6 +62,8 @@ |
|
|
|
listAll: [], |
|
|
|
listAll: [], |
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
check: [1], |
|
|
|
|
|
|
|
noCheck: [], |
|
|
|
checkData: [{ |
|
|
|
checkData: [{ |
|
|
|
text: '', |
|
|
|
text: '', |
|
|
|
value: 1 |
|
|
|
value: 1 |
|
|
@ -108,7 +111,7 @@ |
|
|
|
// 获取课程列表 |
|
|
|
// 获取课程列表 |
|
|
|
getList() { |
|
|
|
getList() { |
|
|
|
AppletsDataProductList({ |
|
|
|
AppletsDataProductList({ |
|
|
|
sort: '', |
|
|
|
sort: 'desc', |
|
|
|
keywords: this.keyword, |
|
|
|
keywords: this.keyword, |
|
|
|
productType: this.curTab, |
|
|
|
productType: this.curTab, |
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
@ -125,12 +128,12 @@ |
|
|
|
text: '', |
|
|
|
text: '', |
|
|
|
value: 1 |
|
|
|
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)) { |
|
|
|
if (list.find(n => n.dataOrCourseId == e.id && n.productType == e.productType)) { |
|
|
|
// 已经选择了的则禁止选择,并且直接选中 |
|
|
|
// 已经选择了的则禁止选择,并且直接选中 |
|
|
|
checkData.disable = true |
|
|
|
checkData.disable = true |
|
|
|
e.check = [1] |
|
|
|
e.check = 1 |
|
|
|
} |
|
|
|
} |
|
|
|
e.checkData = [checkData] |
|
|
|
e.checkData = [checkData] |
|
|
|
}) |
|
|
|
}) |
|
|
@ -159,6 +162,7 @@ |
|
|
|
const item = this.list[i] |
|
|
|
const item = this.list[i] |
|
|
|
const { id, productType } = item |
|
|
|
const { id, productType } = item |
|
|
|
const include = checked.findIndex(e => e.id === id && e.productType === productType) |
|
|
|
const include = checked.findIndex(e => e.id === id && e.productType === productType) |
|
|
|
|
|
|
|
console.log(11, this.list, e, i) |
|
|
|
// 选中的情况下,该产品如果没有push到已选数组里,则push |
|
|
|
// 选中的情况下,该产品如果没有push到已选数组里,则push |
|
|
|
if (e.detail.value.length) { |
|
|
|
if (e.detail.value.length) { |
|
|
|
include === -1 && checked.push(item) |
|
|
|
include === -1 && checked.push(item) |
|
|
@ -249,7 +253,7 @@ |
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
uni.setStorageSync('courses', result) // 把选中的产品添加至缓存 |
|
|
|
uni.setStorageSync('courses', result) // 把选中的产品添加至缓存 |
|
|
|
uni.redirectTo({ |
|
|
|
uni.redirectTo({ |
|
|
|
url: `../editCourse/editCourse?customerId=${customerId}` |
|
|
|
url: `../editCourse/editCourse?customerId=${customerId}&orderType=${this.orderType}` |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|