Commit b03b51ac authored by 石盼盼's avatar 石盼盼

Merge branch 'spp' into 'master'

Spp

See merge request !14
parents f0eca7d5 08988b58
......@@ -10,7 +10,7 @@ const baseUrl = '/api'
// todo: url
const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const h5Url ='http://localhost:8080' // 测试h5线上地址
// const h5Url = 'http://repair.h5.zeruiedu.com/' // 测试h5线上地址
// const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
window.localStorage.setItem('httpUrl', httpUrl)
window.localStorage.setItem('h5Url', h5Url)
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
......
......@@ -8,7 +8,25 @@ $bg-color-light: #F5F7FE;
$border-color: #e7e7e7;
$text-gray: #989794;
/* 一行 */
.text-line-one {
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
-moz-text-overflow: ellipsis;
white-space: nowrap;
}
/* 两行 */
.text-line-two {
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
height: 85rpx;
}
// 弹出框
.self-dialog .van-goods-action-button--first {
border-radius: .5rem !important;
......
......@@ -109,7 +109,7 @@
}
.ma-item {
// margin-top: 0.3rem;
height: 0.4rem;
// height: 0.4rem;
margin-top: 0.2rem;
}
.item_line{
......@@ -124,7 +124,24 @@
}
.one {
color: #727272;
margin-bottom: 0.3rem;
// width: 17%;
// margin-bottom: 0.3rem;
}
.one1{
width: 30%;
}
.one2 {
width: 40%;
text-align: center;
}
.one3 {
width: 20%;
}
._one{
width: 50%
}
._two {
width: 25%
}
.one_title{
width: 40%;
......
......@@ -6,7 +6,7 @@
<div class="title">{{order.repair_type.type_name}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{order.description}}</div>
<div class="item-desc que-desc">{{order.repair_type.type_name}}-{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
......@@ -17,7 +17,7 @@
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone">{{order.telephone}}</div>
<div class="item-desc phone" @click="callPhone(order)">{{order.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
......@@ -25,15 +25,8 @@
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img flex-h"
v-for="(child, index) in order.image"
:key="index"
>
<img
:src="child.url"
alt
/>
<div class="img flex-h" v-for="(child, index) in order.image" :key="index" @click="preview(order.image,index)">
<img :src="child.url" alt />
</div>
</div>
</div>
......@@ -62,11 +55,11 @@
</div>
<div class="item flex-h flex-vc">
<div class="title_left">耗材个数</div>
<input type="number" :min="1" maxlength="3" placeholder="请输入" v-model="item.number" @input="changeInput($event,index)" />
<!-- <van-field class="hc_field" v-model="item.number" type="number" placeholder="请输入" maxlength="3" @input="changeInput($event,index)" /> -->
<input type="tel" :min="1" maxlength="3" placeholder="请输入" v-model="item.number" @input="changeInput($event,index)" />
<!-- <van-field class="hc_field" v-model="item.number" type="number" placeholder="请输入" maxlength="3" @input="changeInput(item,index)" /> -->
</div>
<div class="item flex-h flex-vc">
<div class="title_left">耗材价格</div>
<div class="title_left">耗材单价</div>
<div class="title_r">{{item.single_price}}</div>
</div>
<div v-if="addList.length>1" class="delete-btn" @click="delMeth(index)">
......@@ -105,6 +98,7 @@
<div class="left">
<span>{{goods_number}}</span>件,总金额:
<!-- <span v-if="isNaN(total_price)">¥暂无</span> -->
<span>{{total_price}}</span>
</div>
<div class="skBtn" @click="launch(repair_order_id)">发起收款</div>
......@@ -113,6 +107,7 @@
</template>
<script>
import { ImagePreview } from 'vant';
export default {
name: 'charge',
data () {
......@@ -145,12 +140,38 @@ export default {
}
},
created () {
// console.log('change页面')
this.repair_order_id = this.$route.query.id
// console.log(this.$route.query.id,'接收的id');
this.getDetail()
},
watch:{
addList:{
handler(newValue,oldValue){
let filterValue = newValue.filter(item=>{
return (item.zl && item.mc && item.number)
})
if(filterValue.length){
this.getMonery(filterValue)
}else{
this.total_price = 0
}
},
deep:true
},
},
methods: {
callPhone(order){
let phoneNumber = order.telephone
window.location.href = 'tel://' + phoneNumber
},
preview(img, index){
let temp = img.map(item=>{
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
},
getDetail () {
const curParams = {
repair_order_id: this.repair_order_id
......@@ -195,7 +216,10 @@ export default {
single_price: value.son[i].price
})
}
this.hcName = childArr
this.hcName = childArr
// this.getMonery()
},
typeCancel(index) {
this.addList[index].zlSelect = false
......@@ -209,33 +233,22 @@ export default {
this.addList[index].mcSelect = false
this.addList[index].goods_id = value.id
this.hc_price = this.addList[index].single_price
this.getMonery()
let bool = this.addList.every(item=>{
return item.number && item.mc && item.zl
})
// this.getMonery()
},
changeInput(e,index){
this.hc_number = e.target.value
this.totalCount()
if( this.addList[index].mc){
this.getMonery()
}
},
getMonery(){
getMonery(filterList){
let total_price = 0
// console.log('aaaa',this.hc_number,this.hc_price);
// if(this.hc_number == '' || this.hc_price == ''){
// this.total_price = 0
// }
for(let i=0; i<this.addList.length;i++){
if(this.addList[i].number == '' || this.addList[i].single_price=='暂无'){
this.total_price = 0
return
}
total_price += this.addList[i].single_price * this.addList[i].number
console.log('数量',this.addList[i].number,'单价',this.addList[i].single_price)
}
filterList.map(item=>{
total_price += Number(item.number) * Number(item.single_price)
})
this.total_price = Number(total_price)
console.log('总价钱',total_price);
// console.log('总价钱',total_price);
},
totalCount(){
let count = 0
......@@ -263,7 +276,7 @@ export default {
message: '确认删除吗?'
}).then(()=>{
this.addList.splice(index,1)
this.getMonery()
// this.getMonery()
this.totalCount()
})
.catch(() => {})
......@@ -277,6 +290,12 @@ export default {
if(!bool){
this.$toast.fail('请输入完整')
return
}
for(let i = 0; i<this.addList.length;i++){
if(this.addList[i].number == 0){
this.$toast('耗材个数不能为0')
return
}
}
const curParams = {
repair_order_id: this.repair_order_id,
......
......@@ -83,9 +83,13 @@
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one">{{child.parent_detail.goods_name}}</div>
<div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div>
<div class="one">{{child.price}}</div>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
......@@ -98,9 +102,13 @@
v-for="(child, index) in item.free_material_order.goods"
:key="index"
>
<div class="one">免费</div>
<div class="one">{{child.goods_name}}*{{child.number}}</div>
<div class="one">¥0</div>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
......@@ -199,17 +207,12 @@
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div class="one one_title">{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div>
<div class="one_items flex-h flex-vc flex-hb" v-if="item.is_free == 2">
<div class="one">{{item.good_detail.goods_name}}*{{item.number}}</div>
<div class="one">{{item.price}}</div>
</div>
<div class="one_items flex-h flex-vc flex-hb" v-if="item.is_free == 1">
<div class="one">{{item.goods_name}}*{{item.number}}</div>
<div class="one">免费</div>
<div class="one one1 one_title text-line-one">{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div>
<div class="_two text-line-one">*{{item.number}}</div>
</div>
<!-- <div class="one">{{item.goods_name}}*{{item.number}}</div>
<div class="one">{{item.is_free ? '免费' : '' + item.price}}</div> -->
<div class="one one3">{{item.price}}</div>
</div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment