1、新增签约宝

2、调整自营
3、新增购物车(未完善)
This commit is contained in:
2023-12-04 19:25:58 +08:00
parent a92aec2c29
commit aa1df73a53
23 changed files with 857 additions and 323 deletions
+1
View File
@@ -127,6 +127,7 @@
<!-- 现货市场 end -->
<gap height="100"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template>
+39 -30
View File
@@ -8,21 +8,31 @@
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex" class="mb-20 ">
<el-checkbox @change="changeCheck(index, content, contentIndex)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<text class="ml-35">
业务编号:{{ content.code }}
<el-checkbox @change="changeCheck(index)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<text class="ml-35">服务服务项目: {{ content.title }}</text>
<text class="ml-35"> {{ content.amount }}元/次</text>
</view>
<view>备注: {{ item.remark }}</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
</el-checkbox>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in companyList" :key="index">
@@ -80,18 +90,24 @@
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" :disabled="contentList.length === 0 || companyList.length === 0 || !companyList[0].name">立即支付
<el-button type="primary"
:disabled="contentList.length === 0 || companyList.length === 0 || !companyList[0].name">
立即支付
</el-button>
</view>
</view>
</view>
<gap></gap>
<common-footer></common-footer>
</view>
</template>
<script>
import Gap from "../../../components/gap/gap.vue";
export default {
name: "companyQuote",
components: {Gap},
data() {
return {
list: [
@@ -104,6 +120,7 @@ export default {
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
companyList: [
{
name: '',
@@ -127,24 +144,18 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.selected = false
})
item.contentIndex = null
return item
})
}
},
changeCheck(itemIndex, content, contentIndex) {
const index = this.contentList.indexOf(content._index)
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(content._index)
this.contentNameList.push(content.title)
}
else {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
}
this.configList[itemIndex].contents[contentIndex].selected = index === -1
},
addCompany() {
this.companyList.push({
@@ -169,12 +180,10 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.selected) {
tmpAmount += parseFloat(content.amount)
}
})
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
})
return tmpAmount
},
+31 -29
View File
@@ -8,21 +8,31 @@
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex" class="mb-20 ">
<el-checkbox @change="changeCheck(index, content, contentIndex)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<text class="ml-35">
业务编号:{{ content.code }}
<el-checkbox @change="changeCheck(index)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<text class="ml-35">服务服务项目: {{ content.title }}</text>
<text class="ml-35"> {{ content.amount }}元/次</text>
</view>
<view>备注: {{ item.remark }}</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
</el-checkbox>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in productList" :key="index">
@@ -128,24 +138,18 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.selected = false
})
item.contentIndex = null
return item
})
}
},
changeCheck(itemIndex, content, contentIndex) {
const index = this.contentList.indexOf(content._index)
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(content._index)
this.contentNameList.push(content.title)
}
else {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
}
this.configList[itemIndex].contents[contentIndex].selected = index === -1
},
addCompany() {
this.productList.push({
@@ -170,12 +174,10 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.selected) {
tmpAmount += parseFloat(content.amount)
}
})
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
})
return tmpAmount
},
@@ -38,6 +38,7 @@
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
+52
View File
@@ -0,0 +1,52 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<view class="mt-20 bg-white rounded p-20">
<view class="flex justify-between">
<text class="font-bold text-40">
购物车(全部{{ list.length }})
</text>
<view class="flex justify-end items-center">
<text>已选商品(不含运费)</text>
<text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>
<el-button type="primary" round>结算</el-button>
</view>
</view>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "cart",
data() {
return {
list: [],
selectedList: [],
}
},
methods: {
async getList() {
const {rows} = await vk.callFunction({
url: "client/cart/kh/getList"
})
this.list = rows
}
},
onShow() {
this.getList()
},
computed: {
amount() {
return 0
}
}
}
</script>
+17 -1
View File
@@ -31,7 +31,7 @@
<text class="font-bold text-main">¥{{ info.amount }}</text>
</view>
<view class="flex justify-end is-center">
<el-button type="danger" round class="add-to-cart-btn">加入购物车</el-button>
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button>
<el-button type="primary" round class="ml-35">立即购买</el-button>
</view>
</view>
@@ -55,6 +55,7 @@ export default {
components: {UGap},
data() {
return {
id: null,
info: {
name: ''
}
@@ -62,6 +63,7 @@ export default {
},
onLoad(options) {
if (options && options.id) {
this.id = options.id;
this.getInfo(options.id)
}
},
@@ -74,6 +76,20 @@ export default {
url: 'client/goods/list/pub/getDetail',
data: {id}
})
},
addToCart(){
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
},
success: (res) => {
this.$message({
type:'success',
message: '添加成功'
})
}
})
}
}
}
+1
View File
@@ -46,6 +46,7 @@
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>