商品售后余下功能
This commit is contained in:
parent
6661b4dd3d
commit
ac9c2ffa33
File diff suppressed because one or more lines are too long
|
|
@ -914,6 +914,12 @@ button.cuIcon.lg {
|
|||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.cu-avatar.xxl {
|
||||
width: 156upx;
|
||||
height: 156upx;
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.cu-avatar .avatar-text {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
|
@ -1964,10 +1970,26 @@ button.cuIcon.lg {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.nav .cu-item {
|
||||
height: 90upx;
|
||||
.nav .cu-item1 {
|
||||
height: 70upx;
|
||||
display: inline-block;
|
||||
line-height: 90upx;
|
||||
line-height: 70upx;
|
||||
margin: 0 10upx;
|
||||
padding: 0 20upx;
|
||||
border-radius: 30rpx;
|
||||
background-color: #9acafb;
|
||||
}
|
||||
|
||||
.nav .cu-item1.cur {
|
||||
/* border-bottom: 4upx solid; */
|
||||
background-color: #0081ff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav .cu-item {
|
||||
height: 70upx;
|
||||
display: inline-block;
|
||||
line-height: 70upx;
|
||||
margin: 0 10upx;
|
||||
padding: 0 20upx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,26 @@
|
|||
const swiperList = [{
|
||||
id: 0,
|
||||
type: 'image',
|
||||
url: 'http://gqz.opsoul.com/f5cd5d9a378044aea5125ff150433bae'
|
||||
url: 'http://gqz.opsoul.com/77991752027084_.pic.jpg'
|
||||
}, {
|
||||
id: 1,
|
||||
type: 'image',
|
||||
url: 'http://gqz.opsoul.com/e456d5ceabec4a7f98895d74d2c6aeea'
|
||||
}]
|
||||
url: 'http://gqz.opsoul.com/77981752027074_.pic.jpg'
|
||||
}, {
|
||||
id: 2,
|
||||
type: 'image',
|
||||
url: 'http://gqz.opsoul.com/77971752027073_.pic.jpg'
|
||||
}]
|
||||
|
||||
// [{
|
||||
// id: 0,
|
||||
// type: 'image',
|
||||
// url: 'http://gqz.opsoul.com/f5cd5d9a378044aea5125ff150433bae'
|
||||
// }, {
|
||||
// id: 1,
|
||||
// type: 'image',
|
||||
// url: 'http://gqz.opsoul.com/e456d5ceabec4a7f98895d74d2c6aeea'
|
||||
// }]
|
||||
|
||||
const categories = [{
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -27,9 +27,23 @@ export default {
|
|||
}
|
||||
return this.countDownDiffCache;
|
||||
},
|
||||
addDays(dateStr, dayAmount) {
|
||||
let date = new Date(dateStr);
|
||||
// 使用时间戳计算,避免时区问题
|
||||
const timestamp = date.getTime() + (dayAmount * 24 * 60 * 60 * 1000);
|
||||
return new Date(timestamp);
|
||||
},
|
||||
addHours(dateStr, hourAmount) {
|
||||
let date = new Date(dateStr);
|
||||
date.setHours(date.getHours() + hourAmount);
|
||||
// date.setHours(date.getHours() + hourAmount);
|
||||
// return date;
|
||||
// 使用时间戳计算,避免时区问题
|
||||
const timestamp = date.getTime() + (hourAmount * 60 * 60 * 1000);
|
||||
return new Date(timestamp);
|
||||
},
|
||||
addMinutes(dateStr, minAmount) {
|
||||
let date = new Date(dateStr);
|
||||
date.setMinutes(date.getMinutes() + minAmount);
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* 判断坐标是否在中国境外
|
||||
*/
|
||||
function outOfChina(lng, lat) {
|
||||
return (
|
||||
lng < 72.004 || lng > 137.8347 ||
|
||||
lat < 0.8293 || lat > 55.8271
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 纬度转换
|
||||
*/
|
||||
function transformLat(x, y) {
|
||||
const PI = 3.1415926535897932384626;
|
||||
let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
|
||||
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
|
||||
ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0;
|
||||
ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 经度转换
|
||||
*/
|
||||
function transformLng(x, y) {
|
||||
const PI = 3.1415926535897932384626;
|
||||
let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
|
||||
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0;
|
||||
ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0;
|
||||
ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* WGS84 转 GCJ-02(火星坐标系)
|
||||
*/
|
||||
export const wgs84ToGcj02 = function(lng, lat){
|
||||
const PI = 3.1415926535897932384626;
|
||||
const a = 6378245.0; // 长半轴
|
||||
const ee = 0.00669342162296594323; // 扁率
|
||||
|
||||
// 不在中国境内的坐标不转换
|
||||
if (outOfChina(lng, lat)) {
|
||||
return [lng, lat];
|
||||
}
|
||||
|
||||
let dlat = transformLat(lng - 105.0, lat - 35.0);
|
||||
let dlng = transformLng(lng - 105.0, lat - 35.0);
|
||||
const radlat = lat / 180.0 * PI;
|
||||
let magic = Math.sin(radlat);
|
||||
magic = 1 - ee * magic * magic;
|
||||
const sqrtmagic = Math.sqrt(magic);
|
||||
|
||||
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
|
||||
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
|
||||
|
||||
const mglat = lat + dlat;
|
||||
const mglng = lng + dlng;
|
||||
|
||||
return [mglng, mglat];
|
||||
}
|
||||
|
||||
export const getDistance = function(lat1, lng1, lat2, lng2) {
|
||||
const R = 6371000;
|
||||
const dLat = (lat2 - lat1) * Math.PI / 180;
|
||||
const dLng = (lng2 - lng1) * Math.PI / 180;
|
||||
const a =
|
||||
0.5 - Math.cos(dLat)/2 +
|
||||
Math.cos(lat1 * Math.PI / 180) *
|
||||
Math.cos(lat2 * Math.PI / 180) *
|
||||
(1 - Math.cos(dLng))/2;
|
||||
|
||||
return R * 2 * Math.asin(Math.sqrt(a));
|
||||
}
|
||||
|
|
@ -91,6 +91,7 @@ export default {
|
|||
}
|
||||
},
|
||||
async storageLocation(res) {
|
||||
uni.setStorageSync('userLocation', res);
|
||||
let areaRes = await this.baiduGetLoacation(res.latitude, res.longitude);
|
||||
areaRes = areaRes.data;
|
||||
if (areaRes) {
|
||||
|
|
@ -365,6 +366,19 @@ export default {
|
|||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getByCustomerAddressId(customerAddressId) {
|
||||
let res = await uni.request({
|
||||
url: '/customer/address/getByCustomerAddressId',
|
||||
method: 'POST',
|
||||
data: {
|
||||
customerAddressId: customerAddressId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async addAddressList(params = {}) {
|
||||
let res = await uni.request({
|
||||
|
|
@ -707,6 +721,37 @@ export default {
|
|||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async editAfterServiceGoodsRecord(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/worker/record/editGoods',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
header: {
|
||||
pageNum: params.pageNum,
|
||||
pageSize: params.pageSize
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async deleteAttachPrice(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/attach/deleteByDetailId',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async changeOrderPrice(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/detail/app/change/price',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getChangeOrderPrice(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/detail/app/getChangePrice',
|
||||
|
|
@ -747,5 +792,72 @@ export default {
|
|||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
},
|
||||
// 子单延期
|
||||
async orderDelayThreeDay(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/detail/app/delay',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async updateDetailOrder(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/detail/app/edit',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async returnOrder(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/detail/app/return',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
// 操作流程节点
|
||||
async addOrderOperate(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/order/operate/app/add',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getShopsByGoodsId(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/goods/goods/getShopsByGoodsId',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async returnGoods(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/worker/record/returnGoods',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async workerConfirmReceive(params = {}) {
|
||||
let res = await uni.request({
|
||||
url: '/worker/record/workerConfirmReceive',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
return res[1].data;
|
||||
},
|
||||
async getDeliveryFlow(trackingNumber) {
|
||||
// "trackingNumber": "YT8774104632324",
|
||||
let res = await uni.request({
|
||||
url: '/order/logistics/query/'+trackingNumber,
|
||||
method: 'GET',
|
||||
data: {}
|
||||
})
|
||||
return res[1].data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
<view class="flex flex-column-around text-left margin-left-sm text-white"
|
||||
@click="goRouter('/pages/publish/publish-task')">
|
||||
<view class="text-xl">发布任务</view>
|
||||
<view>公司、家居家政雇佣上门服务</view>
|
||||
<!-- <view>公司、家居家政雇佣上门服务</view> -->
|
||||
<view>发布功能现正升级中</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -114,16 +115,14 @@
|
|||
uni.$on('initValid', this.initValid)
|
||||
},
|
||||
mounted() {
|
||||
this.authLogin()
|
||||
// this.authLogin()
|
||||
// this.$refs.vertifyLogin.showModal();
|
||||
},
|
||||
methods: {
|
||||
async initValid(initParam) {
|
||||
this.initParam = initParam
|
||||
if (initParam && initParam.distributor) {
|
||||
const res = await this.authLogin()
|
||||
this.$refs.validRef.loadData(initParam, res)
|
||||
}
|
||||
const res = await this.authLogin()
|
||||
this.$refs.validRef.loadData(initParam, res)
|
||||
},
|
||||
goRouter(path) {
|
||||
uni.navigateTo({
|
||||
|
|
@ -167,6 +166,9 @@
|
|||
// } else {
|
||||
// this.$refs.vertifyPhone.hideModal();
|
||||
// }
|
||||
|
||||
this.$emit('login-success')
|
||||
|
||||
return true;
|
||||
},
|
||||
async reloadForwardPage() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view>
|
||||
<view class="padding-xl text-gray text-center">
|
||||
<view class="big-icon padding-tb" :class="'cuIcon-' + icon"></view>
|
||||
<view class="text-lg">功能开发中,暂无法使用</view>
|
||||
<view class="text-lg">{{msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,55 @@
|
|||
<view v-if="product.goodsImgUrl" class="cu-avatar xxl-view" :style="'background-image:url(' + product.goodsImgUrl + ');'"></view>
|
||||
<view v-else-if="product.goodsLogoUrl" class="cu-avatar xxl-view" :style="'background-image:url(' + product.goodsLogoUrl + ');'"></view>
|
||||
<view class="margin-left-sm product-content">
|
||||
<view>
|
||||
<view class="text-black">{{product.goodsName}}</view>
|
||||
<view>
|
||||
<view class="text-black" style="vertical-align: middle;" v-if="product.goods">
|
||||
<view class='cu-tag round bg-orange light' v-if="product.goods.installService">
|
||||
<text class="text-black">{{getInstallServiceName(product.goods.installService)}}</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.goods.deliveryService">
|
||||
<text class="text-black">{{getDeliveryName(product.goods.deliveryService)}}</text>
|
||||
</view>
|
||||
<template v-if="product.goods.storeService">
|
||||
<view class='cu-tag round bg-orange light' v-if="product.goods.storeService == 1">
|
||||
<text class="text-black">到店服务</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.goods.storeService == 2">
|
||||
<text class="text-black">到店+配送(服务)</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.goods.storeService == 3">
|
||||
<text class="text-black">到店+上门(服务)</text>
|
||||
</view>
|
||||
</template>
|
||||
<view class="margin-lr-sm" style="display: inline-block;" v-if="product.goods.distance && product.goods.storeService">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{product.goods.distance}}</text>
|
||||
</view>
|
||||
{{product.goods.goodsName}}
|
||||
</view>
|
||||
<view class="text-black" style="vertical-align: middle;" v-else>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.installService">
|
||||
<text class="text-black">{{getInstallServiceName(product.installService)}}</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.deliveryService">
|
||||
<text class="text-black">{{getDeliveryName(product.deliveryService)}}</text>
|
||||
</view>
|
||||
<template v-if="product.storeService">
|
||||
<view class='cu-tag round bg-orange light' v-if="product.storeService == 1">
|
||||
<text class="text-black">到店服务</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.storeService == 2">
|
||||
<text class="text-black">到店+配送(服务)</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="product.storeService == 3">
|
||||
<text class="text-black">到店+上门(服务)</text>
|
||||
</view>
|
||||
</template>
|
||||
<view class="margin-lr-sm" style="display: inline-block;" v-if="product.distance && product.storeService">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{product.distance}}</text>
|
||||
</view>
|
||||
{{product.goodsName}}
|
||||
</view>
|
||||
<view class="text-sm" v-if="ifShowComments">{{product.goodsDesc}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center">
|
||||
|
|
@ -47,7 +94,7 @@
|
|||
<text class='cuIcon-locationfill'></text>
|
||||
</view>
|
||||
<view class="cu-tag line-main-color sm">
|
||||
服务区域
|
||||
{{product.orderType == 1 ? '发货区域' : '服务区域'}}
|
||||
</view>
|
||||
</view>
|
||||
<text v-for="(item,index) in product.goodsAreaList">
|
||||
|
|
@ -72,13 +119,35 @@
|
|||
},
|
||||
product: {
|
||||
type: Object,
|
||||
default: {}
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDeliveryName(deliveryService) {
|
||||
if(deliveryService === 1) {
|
||||
return '包邮'
|
||||
} else if(deliveryService === 2) {
|
||||
return '同城包送'
|
||||
} else if(deliveryService === 3) {
|
||||
return '邮费自付/自提'
|
||||
}
|
||||
},
|
||||
getInstallServiceName(installService) {
|
||||
if(installService === 1) {
|
||||
return '包安装'
|
||||
} else if(installService === 2) {
|
||||
return '不包安装'
|
||||
} else if(installService === 3) {
|
||||
return '自费安装'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
## 简介
|
||||
|
||||
|
||||
|
||||
## 更新日志
|
||||
**2019.12.30**
|
||||
优化:
|
||||
定位下拉内容
|
||||
待实现:只同时展示一个下拉内容
|
||||
**2019.12.27**
|
||||
bug修复
|
||||
支持H5、微信小程序
|
||||
**2019.12.20**
|
||||
第一次发布
|
||||
支持H5下拉,暂不支持小程序。
|
||||
原因:一些适配H5的方法是用vue来写的,小程序不支持。
|
||||
`this.$slots.`在小程序中不能用
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<template>
|
||||
<div class="dropdown-item">
|
||||
<!-- selected -->
|
||||
<view class="dropdown-item__selected"
|
||||
@click="changePopup">
|
||||
<slot name="title" v-if="$slots.title"></slot>
|
||||
<block v-else>
|
||||
<view class="selected__name">{{title ? title : selectItem.text}}</view>
|
||||
<view class="selected__icon"
|
||||
:class="showClass === 'show'? 'up' : 'down'"
|
||||
>
|
||||
<!-- <span class="iconfont"></span> -->
|
||||
<text class="cuIcon-triangledownfill"></text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="dropdown-item__content" :style="{top: contentTop + 'px'}" v-if="showList">
|
||||
<!-- dropdown -->
|
||||
<view :class="['list', showClass]">
|
||||
<slot v-if="$slots.default"></slot>
|
||||
<block v-else>
|
||||
<view class="list__option"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="choose(item)">
|
||||
<view>{{item.text}}</view>
|
||||
<icon v-if="item.value === value" type="success_no_circle" size="20"/>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- dropdown-mask -->
|
||||
<view :class="['dropdown-mask', showClass]" v-if="showList" @click="closePopup"></view>
|
||||
</view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
value: [Number, String, Object],
|
||||
list: {
|
||||
type: Array,
|
||||
default: ()=> {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: [Number, String]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showList: "",
|
||||
showClass: '',
|
||||
selectItem: {},
|
||||
contentTop: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
this.showList = this.active;
|
||||
this.selectItem = this.list[this.value];
|
||||
// document.addEventListener('click', e => {
|
||||
// //this.$el 可以获取当前组件的容器节点
|
||||
// if (!this.$el.contains(e.target)) {
|
||||
// console.log('change');
|
||||
// this.close()
|
||||
// }
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
choose(item) {
|
||||
this.selectItem = item
|
||||
this.$emit('input', item.value)
|
||||
this.closePopup()
|
||||
},
|
||||
changePopup() {
|
||||
if(this.showList) {
|
||||
this.closePopup()
|
||||
} else {
|
||||
this.openPopup()
|
||||
}
|
||||
},
|
||||
openPopup() {
|
||||
// this.$parent -> dropdown-menu
|
||||
this.$parent.$emit('close')
|
||||
this.showList = true
|
||||
this.$nextTick(() => {
|
||||
this.getElementData('.dropdown-item__selected', (data)=>{
|
||||
this.contentTop = data[0].bottom
|
||||
this.showClass = 'show'
|
||||
})
|
||||
})
|
||||
},
|
||||
closePopup() {
|
||||
this.showClass = ''
|
||||
setTimeout(() => {
|
||||
this.showList = false
|
||||
}, 300)
|
||||
},
|
||||
close() {
|
||||
this.showClass = ''
|
||||
this.showList = false
|
||||
},
|
||||
getElementData(el, callback){
|
||||
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
||||
callback(data[0]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* project id 1564327 */
|
||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot');
|
||||
src: url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.eot?#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff2') format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.woff') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.ttf') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_1564327_fcszez4n5i.svg#iconfont') format('svg');
|
||||
}
|
||||
.iconfont{
|
||||
font-family:"iconfont" !important;
|
||||
font-size:28rpx;
|
||||
font-style:normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-text-stroke-width: 0.2px;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.dropdown-item {
|
||||
width: 100%;
|
||||
flex:1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-item__selected {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
/* padding: 30rpx; */
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.dropdown-item:not(:last-child):after {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
width: 2rpx;
|
||||
top: 36rpx;
|
||||
bottom: 36rpx;
|
||||
right: 0;
|
||||
background: $uni-border-color;
|
||||
}
|
||||
|
||||
.dropdown-item__selected .selected__name {
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
}
|
||||
.dropdown-item__selected .selected__icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.dropdown-item__selected .selected__icon.down {
|
||||
transition: transform .3s;
|
||||
transform: rotateZ(0);
|
||||
}
|
||||
|
||||
.dropdown-item__selected .selected__icon.up {
|
||||
transition: transform .3s;
|
||||
transform: rotateZ(-180deg);
|
||||
}
|
||||
.dropdown-item__content {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dropdown-item__content .list {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
background: #fff;
|
||||
transform: translateY(-100%);
|
||||
transition: all .3s;
|
||||
}
|
||||
.dropdown-item__content .list.show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
.dropdown-item__content .list__option {
|
||||
font-size:30rpx;
|
||||
padding: 26rpx 28rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.dropdown-item__content .list__option:not(:last-child) {
|
||||
border-bottom: 1rpx solid #DDDDDD;
|
||||
}
|
||||
.dropdown-item__content .dropdown-mask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
transition: all .3s;
|
||||
z-index: 2;
|
||||
}
|
||||
.dropdown-item__content .dropdown-mask.show {
|
||||
background:rgba(0,0,0,0.5);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<div class="dropdown-menu">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$on('close', this.closeDropdown)
|
||||
},
|
||||
methods: {
|
||||
closeDropdown() {
|
||||
this.$children.forEach(item =>{
|
||||
item.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dropdown-menu {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
white-space: nowrap;
|
||||
margin-right: 5px;
|
||||
}
|
||||
dropdown-item {
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -71,9 +71,9 @@
|
|||
chosenCategoryIds: []
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.loadData();
|
||||
},
|
||||
// onReady() {
|
||||
// this.loadData();
|
||||
// },
|
||||
methods: {
|
||||
tabSelect(e) {
|
||||
this.tabCur = e.currentTarget.dataset.index;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@
|
|||
border: 1px solid #EBEEF5;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 3;
|
||||
z-index: 99;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
"subPackages": [{
|
||||
"root": "pages/order/",
|
||||
"pages": [{
|
||||
"path": "choose-shop"
|
||||
}, {
|
||||
"path": "order-detail"
|
||||
}, {
|
||||
"path": "pay-result"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template name="index">
|
||||
<c-tabbar :current="0">
|
||||
<c-tabbar :current="0" @login-success="loginSuccessCallback">
|
||||
<view>
|
||||
<!-- 顶部操作条 -->
|
||||
<!-- <cu-custom class="text-left">
|
||||
|
|
@ -23,7 +23,10 @@
|
|||
<text class="cuIcon-search"></text>
|
||||
<input @confirm="chooseCategory(null)" v-model="searchInfo.inputGoodsName" :adjust-position="true"
|
||||
type="text" placeholder="输入搜索内容" confirm-type="search"></input>
|
||||
</view>
|
||||
</view>
|
||||
<ms-dropdown-menu>
|
||||
<ms-dropdown-item v-model="filterType" :list="filterList"></ms-dropdown-item>
|
||||
</ms-dropdown-menu>
|
||||
<!-- 区域筛选picker -->
|
||||
<view class="action">
|
||||
<picker class="text-black text-bold" :mode="'multiSelector'" @change="regionChange"
|
||||
|
|
@ -43,10 +46,10 @@
|
|||
<text class="cuIcon-apps text-main-color"></text>
|
||||
<text class="cuIcon-triangledownfill"></text>
|
||||
</view>
|
||||
<view class="flex-twice">
|
||||
<view class="flex-1 flex align-center">
|
||||
<scroll-view scroll-x class="nav text-right" :scroll-with-animation="true"
|
||||
:scroll-left="scrollLeft">
|
||||
<view class="cu-item" :class="index==tabCur?'text-main-color cur':''" v-if="index < 2"
|
||||
<view class="cu-item1" :class="index==tabCur?'text-main-color cur':''" v-if="index < 2"
|
||||
v-for="(item,index) in categories" :key="item.goodsCategoryId"
|
||||
@tap="tabSelect($event, item)" :data-index="index">
|
||||
{{item.goodsCategoryName}}
|
||||
|
|
@ -150,6 +153,8 @@
|
|||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||
import flowGoodsCard from '@/components/goods-card/flow-goods-card.vue';
|
||||
import CTabbar from '@/components/CTabbar.vue';
|
||||
import msDropdownMenu from '@/components/ms-dropdown/dropdown-menu.vue'
|
||||
import msDropdownItem from '@/components/ms-dropdown/dropdown-item.vue'
|
||||
|
||||
// import valid from './components/valid.vue';
|
||||
|
||||
|
|
@ -160,6 +165,8 @@
|
|||
loadStatusBar,
|
||||
flowGoodsCard,
|
||||
CTabbar,
|
||||
msDropdownMenu,
|
||||
msDropdownItem
|
||||
// valid
|
||||
},
|
||||
data() {
|
||||
|
|
@ -168,7 +175,15 @@
|
|||
dotStyle: true,
|
||||
swiperList: [],
|
||||
tabCur: 0,
|
||||
categories: [],
|
||||
categories: [{
|
||||
id: 1,
|
||||
name: '服务商城',
|
||||
goodsCategoryName: '服务商城'
|
||||
}, {
|
||||
id: 2,
|
||||
name: '商品商城',
|
||||
goodsCategoryName: '商品商城'
|
||||
}],
|
||||
subCategories: [],
|
||||
hotServCategory: [],
|
||||
hotFittingsCategory: [],
|
||||
|
|
@ -186,7 +201,19 @@
|
|||
isShowPrivSetting: false,
|
||||
initParam: null,
|
||||
goInfo: false,
|
||||
deptGoodsCategoryIds: []
|
||||
deptGoodsCategoryIds: [],
|
||||
filterList: [
|
||||
{
|
||||
text: '综合搜索',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
text: '规格搜索',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
filterType: 0,
|
||||
curUserInfo: null
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
|
@ -225,7 +252,7 @@
|
|||
// await this.$request.authAndGetLocation();
|
||||
// 定位当前城市
|
||||
await this.getCurAreaArr();
|
||||
uni.$emit('initValid', this.initParam)
|
||||
|
||||
},
|
||||
async onShow() {
|
||||
if((this.productList.length || this.otherCityProductList.length) && !this.goInfo) {
|
||||
|
|
@ -233,15 +260,6 @@
|
|||
}
|
||||
this.goInfo = false;
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
// if (this.initParam && this.initParam.distributor) {
|
||||
// let res = await this.$request.updateUser({
|
||||
// customerPlace: this.initParam.distributor,
|
||||
// customerId: this.curUserInfo.customerId
|
||||
// });
|
||||
// if (res && res.code === 0) {
|
||||
// this.initParam = null;
|
||||
// }
|
||||
// }
|
||||
},
|
||||
async onShareAppMessage(e) {
|
||||
let shareInfo = null;
|
||||
|
|
@ -260,18 +278,25 @@
|
|||
}
|
||||
if (!shareInfo) {
|
||||
shareInfo = {
|
||||
title: '家政服务就找工圈子',
|
||||
title: '养车修车,一搜全有',
|
||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
}
|
||||
}
|
||||
return shareInfo;
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.initBasicData();
|
||||
// 加载区域信息
|
||||
await this.loadRegionList();
|
||||
methods: {
|
||||
loginSuccessCallback() {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
this.loadData(true)
|
||||
},
|
||||
async loadData(noLoadAreaAgain = false) {
|
||||
this.initBasicData();
|
||||
// 不再次解析地址
|
||||
if(!noLoadAreaAgain) {
|
||||
// 加载区域信息
|
||||
await this.loadRegionList();
|
||||
}
|
||||
// 加载服务商城热门类目
|
||||
let hotServCategoryRes = await this.$request.getHotCategory({
|
||||
type: 1
|
||||
|
|
@ -282,32 +307,16 @@
|
|||
type: 2
|
||||
});
|
||||
this.hotFittingsCategory = hotFittingsCategoryRes.data;
|
||||
|
||||
const deptGoodsCategoryIds = []
|
||||
if(this.curUserInfo) {
|
||||
const res = await this.$request.getChooseCategories({
|
||||
selectionType: 1,
|
||||
customerId: this.curUserInfo.customerId
|
||||
})
|
||||
deptGoodsCategoryIds.push(...res[1].data.data)
|
||||
}
|
||||
this.deptGoodsCategoryIds = deptGoodsCategoryIds
|
||||
|
||||
// 加载品类
|
||||
this.loadCategoryList();
|
||||
// 加载当前定位城市的服务列表
|
||||
this.loadProductPage();
|
||||
// 加载其他城市的服务列表
|
||||
this.loadOtherCityProductPage();
|
||||
|
||||
this.swiperList = await this.$api.data('swiperList');
|
||||
// this.categories = await this.$api.data('categories');
|
||||
// this.subCategories = await this.$api.data('subCategories');
|
||||
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
||||
// this.hotGoods = await this.$api.data('hotGoods');
|
||||
// this.discountGoods = await this.$api.data('discountGoods');
|
||||
|
||||
|
||||
},
|
||||
// authCallback() {
|
||||
// this.$refs.validRef.loadData(this.initParam)
|
||||
|
|
@ -434,11 +443,14 @@
|
|||
}
|
||||
await this.wxGetLocation();
|
||||
},
|
||||
async loadCategoryList() {
|
||||
let res = await this.$request.getProductCategories();
|
||||
this.categories = res[1].data.data;
|
||||
this.tabSelect(null, this.categories[0]);
|
||||
},
|
||||
// async loadCategoryList() {
|
||||
// let res = await this.$request.getProductCategories({
|
||||
// customerId: this.curUserInfo.customerId,
|
||||
// isSetting: 0
|
||||
// });
|
||||
// this.categories = res[1].data.data;
|
||||
// this.tabSelect(null, this.categories[0]);
|
||||
// },
|
||||
async loadRegionList() {
|
||||
let area = this.searchInfo.area && this.searchInfo.area.length ? this.searchInfo.area : null
|
||||
let regionList = await this.$request.areaListByStep({
|
||||
|
|
@ -527,37 +539,39 @@
|
|||
},
|
||||
async tabSelect(e, item) {
|
||||
this.tabCur = e == null ? 0 : e.currentTarget.dataset.index;
|
||||
this.scrollLeft = (this.tabCur - 1) * 60;
|
||||
this.scrollLeft = (this.tabCur - 1) * 60;
|
||||
|
||||
this.reloadProductPage()
|
||||
|
||||
let subSubTypeList = [];
|
||||
for (let i = 0; i < item.child.length; i++) {
|
||||
let stopFlag = false;
|
||||
let secondList = item.child[i].child;
|
||||
if (secondList && secondList.length) {
|
||||
for (let k = 0; k < secondList.length; k++) {
|
||||
let thirdList = secondList[k].child;
|
||||
if (thirdList && thirdList.length) {
|
||||
for (let j = 0; j < thirdList.length; j++) {
|
||||
subSubTypeList = subSubTypeList.concat(thirdList[j]);
|
||||
if (subSubTypeList.length >= 15) {
|
||||
subSubTypeList = subSubTypeList.slice(0, 15);
|
||||
stopFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stopFlag) break;
|
||||
}
|
||||
}
|
||||
if (stopFlag) break;
|
||||
}
|
||||
// let subSubTypeList = [];
|
||||
// for (let i = 0; i < item.child.length; i++) {
|
||||
// let stopFlag = false;
|
||||
// let secondList = item.child[i].child;
|
||||
// if (secondList && secondList.length) {
|
||||
// for (let k = 0; k < secondList.length; k++) {
|
||||
// let thirdList = secondList[k].child;
|
||||
// if (thirdList && thirdList.length) {
|
||||
// for (let j = 0; j < thirdList.length; j++) {
|
||||
// subSubTypeList = subSubTypeList.concat(thirdList[j]);
|
||||
// if (subSubTypeList.length >= 15) {
|
||||
// subSubTypeList = subSubTypeList.slice(0, 15);
|
||||
// stopFlag = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (stopFlag) break;
|
||||
// }
|
||||
// }
|
||||
// if (stopFlag) break;
|
||||
// }
|
||||
|
||||
let subCategoryOpt = await this.$api.data('subCategories');
|
||||
for (let i = 0; i < subSubTypeList.length; i++) {
|
||||
subSubTypeList[i]['cuIcon'] = subCategoryOpt[i].cuIcon;
|
||||
subSubTypeList[i]['color'] = subCategoryOpt[i].color;
|
||||
}
|
||||
this.subCategories = subSubTypeList;
|
||||
// let subCategoryOpt = await this.$api.data('subCategories');
|
||||
// for (let i = 0; i < subSubTypeList.length; i++) {
|
||||
// subSubTypeList[i]['cuIcon'] = subCategoryOpt[i].cuIcon;
|
||||
// subSubTypeList[i]['color'] = subCategoryOpt[i].color;
|
||||
// }
|
||||
// this.subCategories = subSubTypeList;
|
||||
},
|
||||
chooseCategory(item) {
|
||||
this.searchInfo.category = item;
|
||||
|
|
@ -565,11 +579,17 @@
|
|||
},
|
||||
|
||||
searchGoods() {
|
||||
if(!this.curUserInfo) {
|
||||
uni.$emit('initValid', this.initParam)
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
category: this.searchInfo.category,
|
||||
area: this.searchInfo.area,
|
||||
inputGoodsName: this.searchInfo.category ? '' : this.searchInfo.inputGoodsName,
|
||||
showData: true
|
||||
showData: true,
|
||||
type: this.tabCur === 0 ? 1 : 2,
|
||||
filterType: this.filterType
|
||||
};
|
||||
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||
// params.showData = false
|
||||
|
|
@ -578,10 +598,15 @@
|
|||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||
})
|
||||
},
|
||||
clickHotCategory(item) {
|
||||
clickHotCategory(item) {
|
||||
if(!this.curUserInfo) {
|
||||
uni.$emit('initValid', this.initParam)
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
category: item,
|
||||
showData: true
|
||||
showData: true,
|
||||
type: this.tabCur === 0 ? 1 : 2
|
||||
};
|
||||
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||
// params.showData = false
|
||||
|
|
@ -590,9 +615,13 @@
|
|||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||
})
|
||||
},
|
||||
showProductCategories() {
|
||||
showProductCategories() {
|
||||
if(!this.curUserInfo) {
|
||||
uni.$emit('initValid', this.initParam)
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/product-category'
|
||||
url: '/pages/product/product-category?type=' + (this.tabCur === 0 ? 1 : 2)
|
||||
})
|
||||
},
|
||||
/* 底部当前城市服务列表 start */
|
||||
|
|
@ -604,7 +633,11 @@
|
|||
this.productList = [];
|
||||
this.otherCityProductList = [];
|
||||
},
|
||||
showDetails(productItem) {
|
||||
showDetails(productItem) {
|
||||
if(!this.curUserInfo) {
|
||||
uni.$emit('initValid', this.initParam)
|
||||
return
|
||||
}
|
||||
let params = {
|
||||
goodsId: productItem.goodsId
|
||||
}
|
||||
|
|
@ -629,10 +662,20 @@
|
|||
params.areaId = null;
|
||||
}
|
||||
|
||||
params.deptGoodsCategoryIds = this.deptGoodsCategoryIds;
|
||||
const deptGoodsCategoryIds = []
|
||||
if(this.curUserInfo) {
|
||||
const res = await this.$request.getChooseCategories({
|
||||
selectionType: 1,
|
||||
customerId: this.curUserInfo.customerId
|
||||
})
|
||||
deptGoodsCategoryIds.push(...res[1].data.data)
|
||||
}
|
||||
|
||||
params.deptGoodsCategoryIds = deptGoodsCategoryIds;
|
||||
params.pageNum = this[pageNumName];
|
||||
params.pageSize = this[pageSizeName];
|
||||
params.status = 0;
|
||||
params.status = 0;
|
||||
params.type = this.tabCur === 0 ? 1 : 2;
|
||||
this.$refs[loadStatusBarRefName].showLoading();
|
||||
try {
|
||||
let res = await this.$request.qryProductPage(params);
|
||||
|
|
|
|||
|
|
@ -1,101 +1,101 @@
|
|||
<template>
|
||||
<view>
|
||||
<index v-if="curPageCode === 'indexPage'"></index>
|
||||
<worker-circle v-if="curPageCode === 'workerCirclePage'"></worker-circle>
|
||||
<personal-center v-if="curPageCode === 'myPage'"></personal-center>
|
||||
<!-- <publish-home v-if="curPageCode === 'publishPage'"></publish-home> -->
|
||||
<msg-page v-if="curPageCode === 'msgPage'"></msg-page>
|
||||
<module-bar ref="moduleBar" :moduleBarInfos="moduleBarInfos" @getCurPageInfo="getCurPageInfo"></module-bar>
|
||||
|
||||
<!-- 登录校验弹窗 -->
|
||||
<vertify-login ref="vertifyLogin" @reload="reloadForwardPage"></vertify-login>
|
||||
<template>
|
||||
<view>
|
||||
<index v-if="curPageCode === 'indexPage'"></index>
|
||||
<worker-circle v-if="curPageCode === 'workerCirclePage'"></worker-circle>
|
||||
<personal-center v-if="curPageCode === 'myPage'"></personal-center>
|
||||
<!-- <publish-home v-if="curPageCode === 'publishPage'"></publish-home> -->
|
||||
<msg-page v-if="curPageCode === 'msgPage'"></msg-page>
|
||||
<module-bar ref="moduleBar" :moduleBarInfos="moduleBarInfos" @getCurPageInfo="getCurPageInfo"></module-bar>
|
||||
|
||||
<!-- 登录校验弹窗 -->
|
||||
<vertify-login ref="vertifyLogin" @reload="reloadForwardPage"></vertify-login>
|
||||
<vertify-phone ref="vertifyPhone" @reload="reloadForwardPage"></vertify-phone>
|
||||
<!-- 订阅授权 -->
|
||||
<vertify-subscribe ref="vertifySubscribe"></vertify-subscribe>
|
||||
<vertify-settingSubscribe ref="vertifySettingSubscribe"></vertify-settingSubscribe>
|
||||
|
||||
<!-- 发布 -->
|
||||
<view class="cu-modal content-mask" :class="isShowPublish?'show':''">
|
||||
<view class="cu-dialog bottom-dialog margin-bottom-with-bar">
|
||||
<view class="padding-xl">
|
||||
<view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar first-avatar">
|
||||
<view class="cuIcon-formfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white"
|
||||
@click="showPage('/pages/publish/publish-task')">
|
||||
<view class="text-xl">发布任务</view>
|
||||
<view>公司、家居家政雇佣上门服务</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar second-avatar">
|
||||
<view class="cuIcon-cameraaddfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">发闲置</view>
|
||||
<view class="text-gray">30s发布宝贝</view>
|
||||
<view class="text-sm">手机/家电卖出/非上门类</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar third-avatar">
|
||||
<view class="cuIcon-footprint"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">社区跑腿</view>
|
||||
<view>同楼盘跑腿服务</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar fourth-avatar">
|
||||
<view class="cuIcon-shopfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">品牌厂商发布</view>
|
||||
<view>销售商电商雇佣</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar tabbar margin-bottom-xl fixed-bottom-bar">
|
||||
<view class="action add-action">
|
||||
<button class="cu-btn bg-gray cuIcon-close" @click="hidePublish"></button>
|
||||
<text class="mask-close-text">关闭</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moduleBar from '@/components/custom-bar/module-bar.vue';
|
||||
import index from '@/pages/index/home.vue';
|
||||
import workerCircle from '@/pages/index/worker-home.vue';
|
||||
import personalCenter from '@/pages/index/my-home.vue';
|
||||
import msgPage from '@/pages/index/msg-home.vue';
|
||||
// import publishHome from '@/pages/index/publish-home.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
moduleBar,
|
||||
index,
|
||||
workerCircle,
|
||||
personalCenter,
|
||||
msgPage
|
||||
// publishHome
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
moduleBarInfos: [],
|
||||
curPageCode: 'indexPage',
|
||||
isShowPublish: false,
|
||||
<vertify-settingSubscribe ref="vertifySettingSubscribe"></vertify-settingSubscribe>
|
||||
|
||||
<!-- 发布 -->
|
||||
<view class="cu-modal content-mask" :class="isShowPublish?'show':''">
|
||||
<view class="cu-dialog bottom-dialog margin-bottom-with-bar">
|
||||
<view class="padding-xl">
|
||||
<view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar first-avatar">
|
||||
<view class="cuIcon-formfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white"
|
||||
@click="showPage('/pages/publish/publish-task')">
|
||||
<view class="text-xl">发布任务</view>
|
||||
<view>公司、家居家政雇佣上门服务</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar second-avatar">
|
||||
<view class="cuIcon-cameraaddfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">发闲置</view>
|
||||
<view class="text-gray">30s发布宝贝</view>
|
||||
<view class="text-sm">手机/家电卖出/非上门类</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar third-avatar">
|
||||
<view class="cuIcon-footprint"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">社区跑腿</view>
|
||||
<view>同楼盘跑腿服务</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="flex justify-start margin-tb-xl">
|
||||
<view class="cu-avatar round middle-avatar fourth-avatar">
|
||||
<view class="cuIcon-shopfill"></view>
|
||||
</view>
|
||||
<view class="flex flex-column-around text-left margin-left-sm text-white">
|
||||
<view class="text-xl">品牌厂商发布</view>
|
||||
<view>销售商电商雇佣</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar tabbar margin-bottom-xl fixed-bottom-bar">
|
||||
<view class="action add-action">
|
||||
<button class="cu-btn bg-gray cuIcon-close" @click="hidePublish"></button>
|
||||
<text class="mask-close-text">关闭</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moduleBar from '@/components/custom-bar/module-bar.vue';
|
||||
import index from '@/pages/index/home.vue';
|
||||
import workerCircle from '@/pages/index/worker-home.vue';
|
||||
import personalCenter from '@/pages/index/my-home.vue';
|
||||
import msgPage from '@/pages/index/msg-home.vue';
|
||||
// import publishHome from '@/pages/index/publish-home.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
moduleBar,
|
||||
index,
|
||||
workerCircle,
|
||||
personalCenter,
|
||||
msgPage
|
||||
// publishHome
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
moduleBarInfos: [],
|
||||
curPageCode: 'indexPage',
|
||||
isShowPublish: false,
|
||||
forwardingPageCode: null,
|
||||
curUserInfo: null,
|
||||
inByShare: false,
|
||||
inParam: null
|
||||
}
|
||||
},
|
||||
inParam: null
|
||||
}
|
||||
},
|
||||
async onLoad(option) {
|
||||
this.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
||||
if (option) {
|
||||
|
|
@ -114,8 +114,8 @@
|
|||
}
|
||||
}
|
||||
this.inParam = option;
|
||||
this.loadData(option);
|
||||
},
|
||||
this.loadData(option);
|
||||
},
|
||||
async onShareAppMessage(e) {
|
||||
let shareInfo = null;
|
||||
if (e && e.target && e.target.dataset) {
|
||||
|
|
@ -130,17 +130,17 @@
|
|||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!shareInfo) {
|
||||
shareInfo = {
|
||||
title: '家政服务就找工圈子',
|
||||
path: '/pages/index/index?distributor=' + this.curUserInfo.customerId,
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
}
|
||||
}
|
||||
return shareInfo;
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
if (!shareInfo) {
|
||||
shareInfo = {
|
||||
title: '养车修车,一搜全有',
|
||||
path: '/pages/index/index?distributor=' + this.curUserInfo.customerId,
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
}
|
||||
}
|
||||
return shareInfo;
|
||||
},
|
||||
methods: {
|
||||
async loadData(option) {
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
// 更新分销人信息
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
_this.$refs.vertifySettingSubscribe.showModal();
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
changeCurPageCode(targetPageCode) {
|
||||
// #ifdef MP
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
this.$refs.moduleBar.navChangeByCode(targetPageCode, true);
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
},
|
||||
reloadForwardPage() {
|
||||
if (this.inByShare) {
|
||||
this.loadData(this.inParam);
|
||||
|
|
@ -192,101 +192,101 @@
|
|||
this.getCurPageInfo({
|
||||
curPageCode: this.forwardingPageCode
|
||||
})
|
||||
}
|
||||
},
|
||||
async getCurPageInfo(data) {
|
||||
let pageCode = data.curPageCode;
|
||||
this.forwardingPageCode = pageCode;
|
||||
// 登录校验
|
||||
if (['publishPage', 'myPage'].indexOf(pageCode) >= 0) {
|
||||
let loginRes = await this.authLogin();
|
||||
if (!loginRes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.forwardingPageCode = null;
|
||||
|
||||
if (pageCode === 'publishPage') {
|
||||
this.isShowPublish = true;
|
||||
} else {
|
||||
this.isShowPublish = false;
|
||||
this.curPageCode = pageCode;
|
||||
}
|
||||
},
|
||||
hidePublish() {
|
||||
this.isShowPublish = false;
|
||||
},
|
||||
showPage(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
async authLogin() {
|
||||
// 更新缓存中的userInfo
|
||||
let res = await this.$request.storageExistUser();
|
||||
// 获取缓存中的userInfo
|
||||
let curUserInfo = this.$request.getCurUserInfo();
|
||||
// 校验提示登录
|
||||
if (!curUserInfo || !curUserInfo.openId) {
|
||||
this.$refs.vertifyLogin.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyLogin.hideModal();
|
||||
}
|
||||
// 校验提示获取手机号码
|
||||
if (!curUserInfo.phone) {
|
||||
this.$refs.vertifyPhone.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyPhone.hideModal();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-mask {
|
||||
z-index: 9999;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.mask-close-text {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.middle-avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.middle-avatar [class*="cuIcon-"] {
|
||||
font-size: 53rpx !important;
|
||||
}
|
||||
|
||||
.cu-avatar.first-avatar {
|
||||
background-color: #0081ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.second-avatar {
|
||||
background-color: #fbbd08;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.third-avatar {
|
||||
background-color: #f37b1d;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.fourth-avatar {
|
||||
background-color: #1cbbb4;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-dialog.bottom-dialog {
|
||||
background-color: unset;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
},
|
||||
async getCurPageInfo(data) {
|
||||
let pageCode = data.curPageCode;
|
||||
this.forwardingPageCode = pageCode;
|
||||
// 登录校验
|
||||
if (['publishPage', 'myPage'].indexOf(pageCode) >= 0) {
|
||||
let loginRes = await this.authLogin();
|
||||
if (!loginRes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.forwardingPageCode = null;
|
||||
|
||||
if (pageCode === 'publishPage') {
|
||||
this.isShowPublish = true;
|
||||
} else {
|
||||
this.isShowPublish = false;
|
||||
this.curPageCode = pageCode;
|
||||
}
|
||||
},
|
||||
hidePublish() {
|
||||
this.isShowPublish = false;
|
||||
},
|
||||
showPage(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
async authLogin() {
|
||||
// 更新缓存中的userInfo
|
||||
let res = await this.$request.storageExistUser();
|
||||
// 获取缓存中的userInfo
|
||||
let curUserInfo = this.$request.getCurUserInfo();
|
||||
// 校验提示登录
|
||||
if (!curUserInfo || !curUserInfo.openId) {
|
||||
this.$refs.vertifyLogin.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyLogin.hideModal();
|
||||
}
|
||||
// 校验提示获取手机号码
|
||||
if (!curUserInfo.phone) {
|
||||
this.$refs.vertifyPhone.showModal();
|
||||
return false;
|
||||
} else {
|
||||
this.$refs.vertifyPhone.hideModal();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-mask {
|
||||
z-index: 9999;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
}
|
||||
|
||||
.mask-close-text {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.middle-avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.middle-avatar [class*="cuIcon-"] {
|
||||
font-size: 53rpx !important;
|
||||
}
|
||||
|
||||
.cu-avatar.first-avatar {
|
||||
background-color: #0081ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.second-avatar {
|
||||
background-color: #fbbd08;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.third-avatar {
|
||||
background-color: #f37b1d;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-avatar.fourth-avatar {
|
||||
background-color: #1cbbb4;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.cu-dialog.bottom-dialog {
|
||||
background-color: unset;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
<cu-custom :bgColor="'bg-main-color'">
|
||||
<block slot="content">我的消息</block>
|
||||
</cu-custom>
|
||||
<bg-toast :icon="'repair'" :msg="'开发中'"></bg-toast>
|
||||
<bg-toast :icon="'repair'" :msg="'您没有收到新消息'"></bg-toast>
|
||||
</view>
|
||||
</c-tabbar>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bgToast from '@/components/default-toast/bg-toast.vue';
|
||||
import bgToast from '@/components/default-toast/bg-toast.vue';
|
||||
import CTabbar from '@/components/CTabbar.vue';
|
||||
|
||||
export default {
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
}
|
||||
if (!shareInfo) {
|
||||
shareInfo = {
|
||||
title: '家政服务就找工圈子',
|
||||
title: '养车修车,一搜全有',
|
||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
<template>
|
||||
<template>
|
||||
<!-- 报价/客户支付模态框 -->
|
||||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog bg-white">
|
||||
|
|
@ -20,41 +20,41 @@
|
|||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
nama: 'app-invite-qrcode',
|
||||
data() {
|
||||
return {
|
||||
url: '',
|
||||
show: false,
|
||||
shareTemplate: {
|
||||
title: '家政服务就找工圈子',
|
||||
path: '/pages/index/index?customerPlace=',
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
},
|
||||
shareInfo: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
nama: 'app-invite-qrcode',
|
||||
data() {
|
||||
return {
|
||||
url: '',
|
||||
show: false,
|
||||
shareTemplate: {
|
||||
title: '养车修车,一搜全有',
|
||||
path: '/pages/index/index?customerPlace=',
|
||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||
},
|
||||
shareInfo: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showModal(url) {
|
||||
this.show = true;
|
||||
this.url = url;
|
||||
let curUserInfo = this.$request.getCurUserInfo();
|
||||
if (curUserInfo.customerId && curUserInfo.customerId > 0) {
|
||||
let path = this.shareTemplate.path + curUserInfo.customerId;
|
||||
this.shareInfo = {
|
||||
...this.shareTemplate,
|
||||
path: path
|
||||
}
|
||||
}
|
||||
},
|
||||
hideModal() {
|
||||
this.shareInfo = null;
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.show = true;
|
||||
this.url = url;
|
||||
let curUserInfo = this.$request.getCurUserInfo();
|
||||
if (curUserInfo.customerId && curUserInfo.customerId > 0) {
|
||||
let path = this.shareTemplate.path + curUserInfo.customerId;
|
||||
this.shareInfo = {
|
||||
...this.shareTemplate,
|
||||
path: path
|
||||
}
|
||||
}
|
||||
},
|
||||
hideModal() {
|
||||
this.shareInfo = null;
|
||||
this.show = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,154 @@
|
|||
<template>
|
||||
<!-- popup -->
|
||||
<view>
|
||||
<uni-popup ref="reFinishPopup" type="bottom" @change="changePopup">
|
||||
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="reFinishPopup" @click="closePopup"><text
|
||||
class="cuIcon-close"></text></view>
|
||||
<view class="bg-white padding" style="padding-top: 74rpx;">
|
||||
<view class="text-xxl text-center">售后不同意</view>
|
||||
<view class="text-lg text-left">订单将提交平台,由平台介入处理纠纷!</view>
|
||||
<view>
|
||||
<div class="grid col-3 grid-square">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImage" v-if="imgList.length < 6">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
<view style="margin-bottom: 10rpx;">
|
||||
<textarea style="width: 100%;box-sizing: border-box;" class="custom-input radius-input" placeholder="请输入理由或备注" cols="30" rows="10" v-model="form.redoCompleteRemark"></textarea>
|
||||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="closePopup">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="Submit">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ['confirmFeedback', 'close'],
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
orderAfterId: {
|
||||
type: String | Number,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(newVal) {
|
||||
if(newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.reFinishPopup.open()
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
redoCompleteRemark: '',
|
||||
redoCompleteImages: '',
|
||||
},
|
||||
imgList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
chooseImage(e) {
|
||||
uni.chooseMedia({
|
||||
count: 1, //默认9
|
||||
mediaType: ['image'],
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
res.tempFiles.forEach((fileObj, index) => {
|
||||
this.$request.uploadFile(fileObj.tempFilePath).then((url) => {
|
||||
this.imgList.push(url);
|
||||
if (index === res.tempFiles.length - 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
changePopup(e) {
|
||||
console.log(e);
|
||||
if(!e.show) {
|
||||
this.closePopup()
|
||||
}
|
||||
},
|
||||
closePopup() {
|
||||
this.$emit('close')
|
||||
},
|
||||
changeRadio(e) {
|
||||
this.form.deliveryType = e.target.value
|
||||
},
|
||||
async Submit() {
|
||||
const updateOrderParams = {
|
||||
id: this.orderAfterId,
|
||||
customerDisagreeReason: this.form.redoCompleteRemark,
|
||||
customerDisagreeImages: this.imgList.length ? this.imgList.toString() : '',
|
||||
customerFinalCheck: 0
|
||||
}
|
||||
|
||||
let res = await this.$request.editAfterServiceRecord(updateOrderParams)
|
||||
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '提交成功',
|
||||
duration: 1000
|
||||
})
|
||||
this.$emit('confirmFeedback')
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,321 @@
|
|||
<template>
|
||||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog bg-white">
|
||||
<view class="cu-bar">
|
||||
<view class="content">售后申请</view>
|
||||
<view class="action" @click="hideModal">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding text-left">
|
||||
<view class="flex justify-start align-center">
|
||||
<view class="title">选择子单:</view>
|
||||
<my-uni-combox class="form-val-area inline-input" :candidates="detailList" placeholder="请选择" :showField="'remark'"
|
||||
v-model="detailObj">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="flex justify-start align-center margin-top-sm">
|
||||
<view class="title">售后类型:</view>
|
||||
<my-uni-combox class="form-val-area inline-input" :candidates="afterServiceTypeArr" placeholder="请选择" :showField="'name'"
|
||||
v-model="afterServiceType">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="flex justify-start align-center margin-top-sm">
|
||||
<view class="title">申请原因:</view>
|
||||
<my-uni-combox class="form-val-area inline-input" :candidates="customerReasonTypeArr" placeholder="请选择" :showField="'name'"
|
||||
v-model="customerReasonType">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="operType === 1">
|
||||
<text>最大退款金额:</text>
|
||||
<text class="text-price text-red">{{detailObj ? detailObj.payMoney : 0}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="operType === 1">
|
||||
<view>退款金额:</view>
|
||||
<input type="digit" class="radius-input inline-input" v-model="refund" style="flex-basis: 70%;"></input>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start margin-top-sm">
|
||||
<view>具体原因:</view>
|
||||
<textarea style="height: 200rpx;" class="solid radius text-left padding-sm inline-input"
|
||||
v-model="remark" maxlength="-1"></textarea>
|
||||
</view>
|
||||
<!-- 上传图片 -->
|
||||
<view class="padding-top">
|
||||
<view class="grid col-3 grid-square flex-sub margin-top-sm">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImgList(e, imgList)" v-if="imgList.length < 3">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" @click="hideModal">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="apply">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myUniCombox from '@/components/uni-combox/my-uni-combox.vue';
|
||||
|
||||
export default {
|
||||
name: 'applyAfterSale',
|
||||
components: {
|
||||
myUniCombox
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
operType: 2, // 1为申请退款,2为发起售后
|
||||
afterServiceType: null,
|
||||
afterServiceTypeArr: [
|
||||
{
|
||||
code: 1,
|
||||
name: '未收到货,我要退单退款!'
|
||||
},
|
||||
{
|
||||
code: 2,
|
||||
name: '未收到货(发货在途),我要退款!'
|
||||
},
|
||||
{
|
||||
code: 3,
|
||||
name: '已收到货,我要退款退货!'
|
||||
},
|
||||
],
|
||||
customerReasonTypeArr: [],
|
||||
customerReasonType: null,
|
||||
refund: null,
|
||||
remark: null,
|
||||
imgList: [],
|
||||
detailList: [],
|
||||
detailObj: null,
|
||||
toUpdateStatus: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
afterServiceType() {
|
||||
if(this.afterServiceType) {
|
||||
this.customerReasonType = null
|
||||
if(this.afterServiceType.code == 3) {
|
||||
this.customerReasonTypeArr = [
|
||||
{
|
||||
code: 1,
|
||||
name: '不想要了'
|
||||
},{
|
||||
code: 2,
|
||||
name: '买错型号尺寸了'
|
||||
},{
|
||||
code: 3,
|
||||
name: '材质与商品描述不符'
|
||||
},
|
||||
{
|
||||
code: 4,
|
||||
name: '大小尺寸与商品描述不符'
|
||||
},
|
||||
{
|
||||
code: 5,
|
||||
name: '颜色、款式、型号与描述不符'
|
||||
},
|
||||
{
|
||||
code: 6,
|
||||
name: '出现质量问题'
|
||||
},
|
||||
{
|
||||
code: 7,
|
||||
name: '收到商品少件(少配件)'
|
||||
},
|
||||
{
|
||||
code: 8,
|
||||
name: '商家发错货'
|
||||
},
|
||||
{
|
||||
code: 9,
|
||||
name: '商品破损或污渍'
|
||||
}
|
||||
]
|
||||
} else {
|
||||
this.customerReasonTypeArr = [
|
||||
{
|
||||
code: 1,
|
||||
name: '不想要了'
|
||||
},{
|
||||
code: 10,
|
||||
name: '未按承诺时间发货'
|
||||
},{
|
||||
code: 11,
|
||||
name: '未见快递/物流有信息'
|
||||
},
|
||||
{
|
||||
code: 12,
|
||||
name: '其它原因'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init(curOrder) {
|
||||
let res = await this.$request.getDetailListByMasterId({
|
||||
orderMasterId: curOrder.orderMasterId
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
this.detailList = res.data;
|
||||
}
|
||||
},
|
||||
showModal(curOrder, params) {
|
||||
this.init(curOrder);
|
||||
this.operType = params.afterServiceType
|
||||
// this.afterServiceType = params.afterServiceType;
|
||||
this.toUpdateStatus = params.toUpdateStatus;
|
||||
this.show = true;
|
||||
},
|
||||
hideModal(e) {
|
||||
this.resetData();
|
||||
this.$emit('cancel');
|
||||
this.show = false;
|
||||
},
|
||||
resetData() {
|
||||
this.operType = null
|
||||
this.afterServiceType = null;
|
||||
this.customerReasonType = null;
|
||||
this.data = null;
|
||||
this.refund = null;
|
||||
this.imgList = [];
|
||||
this.remark = null;
|
||||
},
|
||||
chooseImgList(e, imgList) {
|
||||
uni.chooseImage({
|
||||
count: 3 - imgList.length, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
res.tempFilePaths.forEach((tmpUrl, index) => {
|
||||
this.$request.uploadFile(tmpUrl).then((url) => {
|
||||
imgList.push(url);
|
||||
if (index === res.tempFilePaths.length - 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
validData() {
|
||||
let errMsg = null;
|
||||
if (!this.detailObj) {
|
||||
errMsg = "请选择子单";
|
||||
}
|
||||
if(!this.afterServiceType) {
|
||||
errMsg = "请选择售后类型";
|
||||
}
|
||||
if(!this.customerReasonType) {
|
||||
errMsg = "请选择申请原因";
|
||||
}
|
||||
if (errMsg) {
|
||||
uni.showToast({
|
||||
title: errMsg,
|
||||
duration: 1500,
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async apply() {
|
||||
if (!this.validData()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let imgObjList = [];
|
||||
this.imgList.forEach(url => {
|
||||
imgObjList.push({
|
||||
imgUrl: url,
|
||||
imgUploadBy: 1
|
||||
})
|
||||
})
|
||||
let res = await this.$request.addAfterServiceRecord({
|
||||
customerReasonType: this.customerReasonType.code,
|
||||
customerReason: this.remark,
|
||||
orderDetailId: this.detailObj.orderDetailId,
|
||||
afterServiceType: this.afterServiceType.code,
|
||||
refund: this.refund,
|
||||
operType: this.operType,
|
||||
imgsList: imgObjList,
|
||||
createBy: 1,
|
||||
updateBy: 1,
|
||||
afterServiceCategory: 2
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
let updateStatusRes = {
|
||||
code: 0
|
||||
}
|
||||
if (this.toUpdateStatus) {
|
||||
updateStatusRes = await this.$request.updateOrder({
|
||||
id: this.data.orderMasterId,
|
||||
orderStatus: 3
|
||||
});
|
||||
}
|
||||
if (updateStatusRes && updateStatusRes.code === 0) {
|
||||
this.hideModal();
|
||||
this.$emit('confirmFeedback');
|
||||
uni.showToast({
|
||||
title: '已发起售后,进度可在订单详情内查看',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
uni.showToast({
|
||||
title: '无法对同一个订单重复发起售后或退款',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.inline-input {
|
||||
flex-basis: 74%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
<template>
|
||||
<!-- popup -->
|
||||
<view>
|
||||
<uni-popup ref="deliveryOrderPopup" type="bottom" @change="changePopup">
|
||||
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="deliveryOrderPopup" @click="closePopup"><text
|
||||
class="cuIcon-close"></text></view>
|
||||
<view class="bg-white padding" style="padding-top: 74rpx; min-height: 1000rpx;">
|
||||
<view class="text-xxl text-center">发货类型</view>
|
||||
<radio-group class="flex padding-tb-sm flex-direction" style="gap: 10rpx">
|
||||
<label @click="form.deliveryType = 1">
|
||||
<radio class="main-color" :value="1" :checked="form.deliveryType === 1" /><text class="margin-left-sm">发快递/物流</text>
|
||||
</label>
|
||||
<view style="padding-left: 70rpx;">
|
||||
<input type="text" v-model="form.trackingNumber" class="custom-input radius-input" placeholder="请输入快递/物流单号">
|
||||
</view>
|
||||
<label @click="form.deliveryType = 2">
|
||||
<radio class="main-color" :value="2" :checked="form.deliveryType === 2"/><text class="margin-left-sm">送货上门</text>
|
||||
</label>
|
||||
<label @click="form.deliveryType = 3">
|
||||
<radio class="main-color" :value="3" :checked="form.deliveryType === 3"/><text class="margin-left-sm">客户自提</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
<view class="text-lg text-left">出货拍照存档(非必填):</view>
|
||||
<view>
|
||||
<div class="grid col-3 grid-square">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImage" v-if="imgList.length < 6">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</div>
|
||||
</view>
|
||||
<view style="margin-bottom: 10rpx;">
|
||||
<textarea style="width: 100%;box-sizing: border-box;" class="custom-input radius-input" placeholder="发货备注(非必填)" cols="30" rows="10" v-model="form.deliveryRemark"></textarea>
|
||||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" @tap="closePopup">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="Submit">确认发货</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ['confirmFeedback', 'close'],
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(newVal) {
|
||||
if(newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deliveryOrderPopup.open()
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
deliveryType: 1,
|
||||
deliveryRemark: '',
|
||||
deliveryImages: '',
|
||||
trackingNumber: ''
|
||||
},
|
||||
imgList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
chooseImage(e) {
|
||||
uni.chooseMedia({
|
||||
count: 1, //默认9
|
||||
mediaType: ['image'],
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
res.tempFiles.forEach((fileObj, index) => {
|
||||
this.$request.uploadFile(fileObj.tempFilePath).then((url) => {
|
||||
this.imgList.push(url);
|
||||
if (index === res.tempFiles.length - 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
changePopup(e) {
|
||||
console.log(e);
|
||||
if(!e.show) {
|
||||
this.closePopup()
|
||||
}
|
||||
},
|
||||
closePopup() {
|
||||
this.$emit('close')
|
||||
},
|
||||
changeRadio(e) {
|
||||
this.form.deliveryType = e.target.value
|
||||
},
|
||||
async Submit() {
|
||||
if(this.form.deliveryType == 1 && !this.form.trackingNumber) {
|
||||
uni.showToast({
|
||||
title: '请填写物流/快递单号',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let res;
|
||||
const updateGoodsParams = {
|
||||
id: this.data.id,
|
||||
returnType: this.form.deliveryType, // 1-快递/物流
|
||||
returnTrackingNumber: this.form.trackingNumber, // 必填
|
||||
returnRemark: this.form.deliveryRemark,
|
||||
returnImages: this.imgList.length ? this.imgList.toString() : ''
|
||||
}
|
||||
res = await this.$request.returnGoods(updateGoodsParams);
|
||||
if (res.code === 0) {
|
||||
this.$emit('confirmFeedback')
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 模态框 -->
|
||||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog">
|
||||
<view class="padding-xl" style="background-color: #ffffff;">
|
||||
<view class="text-bold text-lg margin-bottom-sm">物流信息</view>
|
||||
|
||||
<view class="cu-timeline" style="max-height: 600upx;overflow-y: auto;">
|
||||
<view class="cu-item text-main-color" v-for="(item, index) in flowArr" :key="index">
|
||||
<view class="content shadow-blur" style="text-align: left;padding: 15upx 20upx;">
|
||||
<view><text style="color: black;">{{item.description}}</text></view>
|
||||
<text style="color: #999999;font-size: 24upx;">{{item.time}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cu-bar bg-white solid-top">
|
||||
<view class="action margin-0 flex-sub text-black solid-left" data-modal="deliveryFlowDetail"
|
||||
@tap="hideModal">关闭</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'deliveryFlowDetail',
|
||||
emits: ['confirmFeedback'],
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
trackingNumber: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(newVal) {
|
||||
if(newVal) {
|
||||
this.$nextTick(() => {
|
||||
this.getFLows()
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flowArr: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getFLows() {
|
||||
const res = await this.$request.getDeliveryFlow(this.trackingNumber)
|
||||
this.flowArr = res.data.traces ? res.data.traces.reverse() : [];
|
||||
},
|
||||
hideModal(e) {
|
||||
this.$emit('close', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
<template>
|
||||
<view class="cu-modal" :class="show?'show':''">
|
||||
<view class="cu-dialog bg-white" style="overflow: initial;">
|
||||
<view class="cu-bar">
|
||||
<view class="content">{{orderType === 1 ? '拒绝收货' : '拒绝验收'}}</view>
|
||||
<view class="action" @click="hideModal">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding text-left">
|
||||
<view class="flex justify-start align-center">
|
||||
<view class="title">选择子单:</view>
|
||||
<my-uni-combox class="form-val-area inline-input" :candidates="detailList" placeholder="请选择" :showField="'remark'"
|
||||
v-model="detailObj">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<!-- <view class="flex justify-start align-center margin-top-sm">
|
||||
<view class="title">申请原因:</view>
|
||||
<my-uni-combox class="form-val-area inline-input" :candidates="customerReasonTypeArr" placeholder="请选择" :showField="'name'"
|
||||
v-model="customerReasonType">
|
||||
</my-uni-combox>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="afterServiceType === 1">
|
||||
<text>最大可退款金额:</text>
|
||||
<text class="text-price text-red">{{detailObj ? detailObj.payMoney : 0}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="afterServiceType === 1">
|
||||
<view>退款金额:</view>
|
||||
<input type="digit" class="radius-input inline-input" v-model="refund" style="flex-basis: 70%;"></input>
|
||||
</view> -->
|
||||
<!-- <view class="margin-top-sm flex justify-start margin-top-sm">
|
||||
<view>具体原因:</view>
|
||||
<textarea style="height: 200rpx;" class="solid radius text-left padding-sm inline-input"
|
||||
v-model="remark" maxlength="-1"></textarea>
|
||||
</view> -->
|
||||
<!-- 上传图片 -->
|
||||
<!-- <view class="padding-top">
|
||||
<view class="grid col-3 grid-square flex-sub margin-top-sm">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImgList(e, imgList)" v-if="imgList.length < 3">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="cu-bar solid-top">
|
||||
<view class="action margin-0 flex-sub text-black" @click="hideModal">取消</view>
|
||||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="apply">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myUniCombox from '@/components/uni-combox/my-uni-combox.vue';
|
||||
|
||||
export default {
|
||||
name: 'OrderReturn',
|
||||
components: {
|
||||
myUniCombox
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
afterServiceType: 2, // 1为申请退款,2为发起售后
|
||||
orderType: 0,
|
||||
customerReasonTypeArr: [
|
||||
{
|
||||
code: 1,
|
||||
name: '上门/服务不守时'
|
||||
},{
|
||||
code: 2,
|
||||
name: '态度不友好,无法继续'
|
||||
},{
|
||||
code: 3,
|
||||
name: '服务效果差,未达到合格'
|
||||
},{
|
||||
code: 4,
|
||||
name: '技能水平问题,未妥善完成'
|
||||
},{
|
||||
code: 5,
|
||||
name: '要求加费用,费用不合理'
|
||||
},{
|
||||
code: 6,
|
||||
name: '订单拖太久了'
|
||||
},{
|
||||
code: 7,
|
||||
name: '超了些服务内容,师傅不接受'
|
||||
},{
|
||||
code: 8,
|
||||
name: '客户/我时间不方便了'
|
||||
},{
|
||||
code: 9,
|
||||
name: '客户/我已让别的师傅服务了'
|
||||
}
|
||||
],
|
||||
customerReasonType: null,
|
||||
refund: null,
|
||||
remark: null,
|
||||
imgList: [],
|
||||
detailList: [],
|
||||
detailObj: null,
|
||||
toUpdateStatus: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init(curOrder) {
|
||||
let res = await this.$request.getDetailListByMasterId({
|
||||
orderMasterId: curOrder.orderMasterId
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
this.detailList = res.data;
|
||||
}
|
||||
},
|
||||
showModal(curOrder, params) {
|
||||
this.init(curOrder);
|
||||
this.orderType = params.orderType;
|
||||
this.toUpdateStatus = params.toUpdateStatus;
|
||||
this.show = true;
|
||||
},
|
||||
hideModal(e) {
|
||||
this.resetData();
|
||||
this.$emit('cancel');
|
||||
this.show = false;
|
||||
},
|
||||
resetData() {
|
||||
this.orderType = 0;
|
||||
this.customerReasonType = null;
|
||||
this.data = null;
|
||||
this.refund = null;
|
||||
this.imgList = [];
|
||||
this.remark = null;
|
||||
},
|
||||
chooseImgList(e, imgList) {
|
||||
uni.chooseImage({
|
||||
count: 3 - imgList.length, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
res.tempFilePaths.forEach((tmpUrl, index) => {
|
||||
this.$request.uploadFile(tmpUrl).then((url) => {
|
||||
imgList.push(url);
|
||||
if (index === res.tempFilePaths.length - 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
validData() {
|
||||
let errMsg = null;
|
||||
if (!this.detailObj) {
|
||||
errMsg = "请选择子单";
|
||||
} else if (this.afterServiceType == 1 && this.refund == null) {
|
||||
errMsg = "退款金额不能为空";
|
||||
} else if (this.afterServiceType == 1 && this.refund > this.detailObj.payMoney) {
|
||||
errMsg = "不可超出最大退款金额";
|
||||
}
|
||||
if (errMsg) {
|
||||
uni.showToast({
|
||||
title: errMsg,
|
||||
duration: 1500,
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
async apply() {
|
||||
// if (!this.validData()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// let imgObjList = [];
|
||||
// this.imgList.forEach(url => {
|
||||
// imgObjList.push({
|
||||
// imgUrl: url,
|
||||
// imgUploadBy: 1
|
||||
// })
|
||||
// })
|
||||
// let res = await this.$request.addAfterServiceRecord({
|
||||
// customerReasonType: this.customerReasonType.code,
|
||||
// customerReason: this.remark,
|
||||
// orderDetailId: this.detailObj.orderDetailId,
|
||||
// operType: this.afterServiceType,
|
||||
// refund: this.refund,
|
||||
// imgsList: imgObjList,
|
||||
// createBy: 1
|
||||
// });
|
||||
// if (res && res.code === 0) {
|
||||
// let updateStatusRes = {
|
||||
// code: 0
|
||||
// }
|
||||
// if (this.toUpdateStatus) {
|
||||
// updateStatusRes = await this.$request.updateOrder({
|
||||
// id: this.data.orderMasterId,
|
||||
// orderStatus: 3
|
||||
// });
|
||||
// }
|
||||
// if (updateStatusRes && updateStatusRes.code === 0) {
|
||||
// this.hideModal();
|
||||
// this.$emit('confirmFeedback');
|
||||
// uni.showToast({
|
||||
// title: '已发起售后,进度可在订单详情内查看',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// uni.showToast({
|
||||
// title: '无法对同一个订单重复发起售后或退款',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
if (!this.detailObj) {
|
||||
uni.showToast({
|
||||
title: "请选择子单",
|
||||
duration: 1500,
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
// let res = await this.$request.updateDetailOrder({
|
||||
// id: this.detailObj.orderDetailId,
|
||||
// orderStatus: this.toUpdateStatus,
|
||||
// });
|
||||
let res = await this.$request.returnOrder({
|
||||
id: this.detailObj.orderDetailId
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
this.hideModal();
|
||||
this.$emit('confirmFeedback');
|
||||
await this.$request.addOrderOperate({
|
||||
orderId: this.detailObj.orderDetailId,
|
||||
orderType: '02',
|
||||
content: this.orderType == 1 ? '拒绝收货' : '拒绝验收'
|
||||
});
|
||||
uni.showToast({
|
||||
icon: 'success'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '操作失败',
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.inline-input {
|
||||
flex-basis: 74%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<text class="cuIcon-close text-bold text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-xl">
|
||||
<view class="padding">
|
||||
<view class="flex align-start margin-bottom-xl padding-lr">
|
||||
<view class="margin-right-sm">选品广场:</view>
|
||||
<view class="margin-right-sm">
|
||||
|
|
@ -94,19 +94,19 @@
|
|||
</checkbox>
|
||||
</view> -->
|
||||
<view class="margin-bottom-sm">
|
||||
<text class="margin-right-xs">正选</text>
|
||||
<text class="margin-right-xs">服务商城</text>
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||
@click="changeAgreeShield(1)">
|
||||
</checkbox>
|
||||
</view>
|
||||
<view>
|
||||
<text class="margin-right-xs">反选</text>
|
||||
<text class="margin-right-xs">配件商城</text>
|
||||
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 2"
|
||||
@click="changeAgreeShield(2)">
|
||||
</checkbox>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-left">
|
||||
<view class="text-left" :style="{marginTop: agreeShield === 2 ? '60rpx' : '0'}">
|
||||
<view>逐条选品</view>
|
||||
<view>
|
||||
<text class="text-main-color" @tap="showModal('categoryModal')">去选品</text>
|
||||
|
|
@ -193,7 +193,11 @@
|
|||
customerId: this.curUserInfo.customerId,
|
||||
isDistributor: true
|
||||
});
|
||||
this.loadCategory();
|
||||
this.loadCategory({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
type: this.agreeShield,
|
||||
isSetting: 1
|
||||
});
|
||||
},
|
||||
async loadMyInfo(params) {
|
||||
let res = await this.$request.qryCustomerList(params);
|
||||
|
|
@ -208,6 +212,7 @@
|
|||
async loadCategory(params) {
|
||||
let res = await this.$request.getProductCategories(params);
|
||||
res = res[1].data.data;
|
||||
this.categoryList = []
|
||||
res.forEach(firstCategory => {
|
||||
if (firstCategory.child && firstCategory.child.length) {
|
||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||
|
|
@ -278,6 +283,13 @@
|
|||
changeAgreeShield(agreeShield) {
|
||||
if(agreeShield === this.agreeShield) return
|
||||
this.agreeShield = agreeShield;
|
||||
|
||||
this.loadCategory({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
type: this.agreeShield,
|
||||
isSetting: 1
|
||||
});
|
||||
|
||||
// this.$refs.multiSelectNav.clearChosenItem();
|
||||
this.goChooseItem()
|
||||
// uni.showToast({
|
||||
|
|
@ -290,12 +302,15 @@
|
|||
},
|
||||
async goChooseItem() {
|
||||
const res = await this.$request.getChooseCategories({
|
||||
selectionType: this.agreeShield,
|
||||
selectionType: 1,
|
||||
type: this.agreeShield,
|
||||
customerId: this.curUserInfo.customerId
|
||||
})
|
||||
console.log(res);
|
||||
if(res[1].data.data.length) {
|
||||
this.$refs.multiSelectNav.setChooseItems([...res[1].data.data])
|
||||
} else {
|
||||
this.$refs.multiSelectNav.setChooseItems([])
|
||||
}
|
||||
// this.showModal('categoryModal')
|
||||
},
|
||||
|
|
@ -318,7 +333,8 @@
|
|||
let res = await this.$request.addCustomerSelection({
|
||||
customerId: this.curUserInfo.customerId,
|
||||
deptCategoryIds: chosenCategoryIds,
|
||||
selectionType: this.agreeShield == 3 ? 1 : this.agreeShield
|
||||
selectionType: 1,
|
||||
type: this.agreeShield
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -50,25 +50,28 @@
|
|||
</view>
|
||||
<view class="margin-right-sm"><text>优惠</text><text class="text-price text-red">{{shopOrder.discountMoney}}</text>
|
||||
</view>
|
||||
<view class="margin-right-sm" v-if="shopOrder.payStatus == 1 && shopOrder.changeMoney"><text>已付款</text><text class="text-price text-red">{{shopOrder.payMoney}}</text>
|
||||
<view class="margin-right-sm" v-if="shopOrder.payStatus == 1 && shopOrder.paymentMoney"><text>已付款</text><text class="text-price text-red">{{shopOrder.paymentMoney}}</text>
|
||||
</view>
|
||||
<view class="text-lg" v-if="shopOrder.payStatus == 1 && shopOrder.changeMoney"><text>需付款</text><text
|
||||
class="text-price text-red text-lg text-bold">{{shopOrder.changeMoney}}</text></view>
|
||||
<view class="text-lg" v-else-if="shopOrder.payStatus == 1"><text>实付款</text><text
|
||||
class="text-price text-red text-lg text-bold">{{shopOrder.payMoney}}</text></view>
|
||||
class="text-price text-red text-lg text-bold">{{shopOrder.paymentMoney}}</text></view>
|
||||
<view class="text-lg" v-else-if="shopOrder.payStatus == 0"><text>需付款</text><text
|
||||
class="text-price text-red text-lg text-bold">{{Math.round((shopOrder.payMoney + shopOrder.changeMoney) * 100) / 100}}</text></view>
|
||||
</view>
|
||||
<view class="padding-bottom-sm flex justify-end align-end text-red text-lg" v-if="shopOrder.payStatus == 1 && shopOrder.changeMoney">您有报价/加价申请待付款中......</view>
|
||||
<view v-if="orderType === 0" class="padding-tb-sm">
|
||||
<view class="padding-bottom-sm flex justify-end align-end text-red text-lg" v-if="shopOrder.changeMoney">您有报价/加价申请待付款中......</view>
|
||||
<view class="padding-tb-sm">
|
||||
<view class="flex justify-end">
|
||||
<button v-if="[0,1].indexOf(shopOrder.orderStatus) >= 0" class="cu-btn bg-gray margin-right-sm shadow-blur" @click="showModalByRef('confirmModal', shopOrder)">取消订单</button>
|
||||
<button v-if="shopOrder.payStatus != 1 || shopOrder.changeMoney" class="cu-btn bg-main-color shadow-blur margin-right-sm" @click="wxpay(shopOrder)">付款</button>
|
||||
<button v-if="shopOrder.orderStatus == 4" class="cu-btn bg-main-color shadow-blur margin-right-sm" @click="showModalByRef('orderReturn', shopOrder, {orderType: orderType, toUpdateStatus: orderType == 1 ? 1 : 3})">{{orderType == 1 ? '拒绝收货' : '拒绝验收'}}</button>
|
||||
<button v-if="shopOrder.orderStatus == 4 && orderType == 1" class="cu-btn bg-main-color shadow-blur margin-right-sm" @click="orderDelay(shopOrder)">延期到货</button>
|
||||
|
||||
<button class="cu-btn bg-main-color shadow-blur" @click="showServDetail(shopOrder)">查看</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderType === 0 && shopOrder.orderStatus === 4"
|
||||
class="padding-tb-sm solid-top">
|
||||
<view v-if="shopOrder.orderStatus === 4"
|
||||
class="padding-tb-sm solid-top flex justify-between align-center">
|
||||
<view>师傅已提交完成,请验收。</view>
|
||||
<!-- <view>服务保障权益期:</view> -->
|
||||
<view class="flex justify-between align-end">
|
||||
|
|
@ -76,7 +79,7 @@
|
|||
<view>
|
||||
<button class="cu-btn sm bg-yellow margin-right-sm"
|
||||
@click="updateFinisheStatus(shopOrder, 5, false)">确认完单</button>
|
||||
<button class="cu-btn sm bg-yellow margin-right-sm" @click="showModalByRef('applyAfterService', shopOrder, {afterServiceType: 2, toUpdateStatus: true})">拒绝完单</button>
|
||||
<button class="cu-btn sm bg-yellow margin-right-sm" @click="showModalByRef(orderType == 1 ? 'applyAfterServiceGoods' : 'applyAfterService', shopOrder, {afterServiceType: 2, toUpdateStatus: true})">拒绝完单</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -110,20 +113,26 @@
|
|||
</view>
|
||||
<load-status-bar ref="loadStatusBar" @loadMore="loadOrderPage"></load-status-bar>
|
||||
<confirm-modal ref="confirmModal" :content="'是否确定取消订单?'" @confirm="cancelOrder" @cancel="blurCurOrder"></confirm-modal>
|
||||
<apply-after-service ref="applyAfterService" :data="curOrder" @confirmFeedback="reloadOrderPage" @cancel="blurCurOrder"></apply-after-service>
|
||||
<apply-after-service ref="applyAfterService" :data="curOrder" @confirmFeedback="reloadOrderPage" @cancel="blurCurOrder"></apply-after-service>
|
||||
<apply-after-service-goods ref="applyAfterServiceGoods" :data="curOrder" @confirmFeedback="reloadOrderPage" @cancel="blurCurOrder"></apply-after-service-goods>
|
||||
<orderReturn ref="orderReturn" data="curOrder" @confirmFeedback="reloadOrderPage" @cancel="blurCurOrder"></orderReturn>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import productPicked from '@/pages/my/components/product-picked.vue';
|
||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||
import applyAfterService from '@/pages/my/components/modal/apply-after-service.vue';
|
||||
import applyAfterService from '@/pages/my/components/modal/apply-after-service.vue';
|
||||
import applyAfterServiceGoods from '@/pages/my/components/modal/apply-after-service-goods.vue';
|
||||
import orderReturn from '@/pages/my/components/modal/order-return.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
productPicked,
|
||||
loadStatusBar,
|
||||
applyAfterService
|
||||
applyAfterService,
|
||||
orderReturn,
|
||||
applyAfterServiceGoods
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -202,6 +211,7 @@
|
|||
let res = null;
|
||||
if (this.tabCur === 3) {
|
||||
res = await this.$request.getAfterList({
|
||||
...params,
|
||||
customerId: params.customerId
|
||||
});
|
||||
} else {
|
||||
|
|
@ -211,11 +221,16 @@
|
|||
if (rowsLength > 0) {
|
||||
this.myOrders = this.myOrders.concat(res.rows);
|
||||
this.pageParams[this.tabCur].pageNum++;
|
||||
if (rowsLength === this.pageSize) {
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
}
|
||||
// if (rowsLength === this.pageSize) {
|
||||
// this.$refs.loadStatusBar.showLoadMore();
|
||||
// }
|
||||
}
|
||||
this.$refs.loadStatusBar.showLoadOver();
|
||||
if(params.pageNum * params.pageSize < res.total) {
|
||||
this.$refs.loadStatusBar.showLoadMore();
|
||||
} else {
|
||||
this.$refs.loadStatusBar.showLoadOver();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
this.$refs.loadStatusBar.showLoadErr();
|
||||
|
|
@ -247,8 +262,9 @@
|
|||
return res;
|
||||
},
|
||||
showServDetail(order) {
|
||||
const copyOrder = {...order, orderType: this.orderType}
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/serv-detail?order=' + encodeURIComponent(JSON.stringify(order))
|
||||
url: '/pages/my/serv-detail?order=' + encodeURIComponent(JSON.stringify(copyOrder))
|
||||
})
|
||||
},
|
||||
showModalByRef(refName, curOrder, params) {
|
||||
|
|
@ -271,7 +287,7 @@
|
|||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '取消失败',
|
||||
title: res.msg,
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
|
|
@ -300,6 +316,26 @@
|
|||
url: '/pages/order/pay-result?payResult=1'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 到货延期
|
||||
async orderDelay(order) {
|
||||
let res = await this.$request.orderDelayThreeDay({
|
||||
id: order.orderMasterId
|
||||
});
|
||||
if (res && res.code === 0) {
|
||||
this.reloadOrderPage();
|
||||
uni.showToast({
|
||||
title: '延期成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '延期失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,162 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 顶部操作条 -->
|
||||
<cu-custom :bgColor="'bg-main-color'" :isBack="true" :isBackHome="true" :homePageUrl="'/pages/index/index'">
|
||||
<block slot="content">选择门店</block>
|
||||
</cu-custom>
|
||||
<!-- 产品列表 -->
|
||||
<view class="padding-lr padding-top bg-white solid-top">
|
||||
<view class="solid-bottom margin-bottom-sm padding-bottom-sm"
|
||||
v-for="(item, index) in productList" :key="item.id">
|
||||
<view class="flex-sub flex margin-top-sm">
|
||||
<view style="height: 150rpx;line-height: 150rpx;margin-right: 10px;">
|
||||
<radio class="main-color" :checked="chooseShopInfo && chooseShopInfo.shopId === item.shopId" @click="chooseShopInfo = item" />
|
||||
</view>
|
||||
<!-- <checkbox style="transform:scale(0.8);" class="main-color" :checked="chooseShopId === item.shopId" @click.stop="chooseShopId = item.shopId"></checkbox> -->
|
||||
<view style="width: 150rpx;height: 150rpx;margin-right:10px;display: flex;flex-direction: row;justify-content: center;">
|
||||
<image style="width: 100%;height: 100%;" :src="item.imageUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex-sub">
|
||||
<view class="text-bold" style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{item.shopName}}</view>
|
||||
<view>
|
||||
<view style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{item.provinceName + item.cityName + item.countryName + item.streetName + item.address}}</view>
|
||||
<view class="margin-lr-sm" style="display: inline-block;" v-if="item.distance">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{item.distance}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="index == 0">
|
||||
<text style="font-size: 24rpx;color: #0081ff;">您购买的商品的店铺所属服务点(距离近可优先选择)</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部新增地址按钮 -->
|
||||
<view class="cu-bar tabbar border shop fixed-bottom-bar bg-back">
|
||||
<button class="cu-btn bg-main-color long-btn margin-lr-sm shadow-blur" @click="selectShop">确定</button>
|
||||
</view>
|
||||
<!-- <view class="margin-bottom-lg">
|
||||
<view v-if="hasMoreData" class="text-center bg-main-color padding-tb text-lg" @click="loadProductData">
|
||||
<text class="margin-right-xs">查看更多</text>
|
||||
<text class="text-bold cuIcon-unfold"></text>
|
||||
</view>
|
||||
<view class="cu-load" :class="loadMoreStatus"></view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
productList: [],
|
||||
loadMoreStatus: '',
|
||||
hasMoreData: false,
|
||||
pageNum: this.$globalData.initPageNum,
|
||||
pageSize: this.$globalData.initPageSize,
|
||||
inputGoodsName: null,
|
||||
goodsId: null,
|
||||
shopId: null,
|
||||
chooseShopInfo: null,
|
||||
addressFull: null,
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
this.goodsId = options.goodsId;
|
||||
this.shopId = options.shopId;
|
||||
this.addressFullObj = JSON.parse(options.addressFullObj)
|
||||
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
this.pageNum = this.$globalData.initPageNum;
|
||||
this.pageSize = this.$globalData.initPageSize;
|
||||
this.loadProductData();
|
||||
},
|
||||
loadCategoryList(type = 1) {},
|
||||
async loadProductData(params = {}) {
|
||||
params.pageNum = this.pageNum;
|
||||
params.pageSize = this.pageSize;
|
||||
// if(this.addressLatitude && this.addressLongitude) {
|
||||
// params.latitude = this.addressLatitude
|
||||
// params.longitude = this.addressLongitude
|
||||
// }
|
||||
params.provinceName = this.addressFullObj.provinceName,
|
||||
params.cityName = this.addressFullObj.cityName,
|
||||
params.countryName = this.addressFullObj.countryName,
|
||||
params.streetName = this.addressFullObj.streetName,
|
||||
params.address = this.addressFullObj.address
|
||||
params.goodsId = this.goodsId
|
||||
// params.goodsId = 2089
|
||||
|
||||
this.loadMoreStatus = 'loading bg-main-color padding-tb text-lg';
|
||||
this.hasMoreData = false;
|
||||
try {
|
||||
await this.loadShopPage(params);
|
||||
this.loadMoreStatus = this.hasMoreData ? '' : 'over bg-grey padding-tb text-lg';
|
||||
} catch (e) {
|
||||
this.loadMoreStatus = 'erro bg-red padding-tb text-lg'
|
||||
}
|
||||
},
|
||||
reloadShopPage() {
|
||||
this.pageNum = this.$globalData.initPageNum;
|
||||
this.pageSize = this.$globalData.initPageSize;
|
||||
this.pageNumOfOtherCityPage = this.$globalData.initPageNum;
|
||||
this.productList = [];
|
||||
this.loadProductData();
|
||||
},
|
||||
async loadShopPage(params) {
|
||||
let res = await this.$request.getShopsByGoodsId(params);
|
||||
// let rowsLength = res[1].data.rows.length;
|
||||
// if (rowsLength === this.pageSize) {
|
||||
// this.hasMoreData = true;
|
||||
// }
|
||||
// if (this.pageNum === this.$globalData.initPageNum) {
|
||||
// this.productList = res[1].data.rows;
|
||||
// } else {
|
||||
// this.productList = this.productList.concat(res[1].data.rows);
|
||||
// }
|
||||
// this.pageNum++;
|
||||
|
||||
this.productList = res.data.serviceShops
|
||||
this.chooseShopInfo = res.data.serviceShops.find(i => i.shopId == this.shopId)
|
||||
},
|
||||
searchGoods() {
|
||||
this.reloadShopPage();
|
||||
},
|
||||
selectShop() {
|
||||
uni.$emit('chooseShop', this.chooseShopInfo);
|
||||
uni.navigateBack({
|
||||
delta: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-nav-item-text {
|
||||
width: 100rpx;
|
||||
}
|
||||
|
||||
.nav .cu-item {
|
||||
height: 90rpx;
|
||||
display: inline-block;
|
||||
line-height: 90rpx;
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 180rpx;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cu-load {
|
||||
display: block;
|
||||
line-height: unset;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 预约时间 -->
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding" v-if="pickedProductList && pickedProductList[0].product[0].type == 1">
|
||||
<view class="flex justify-between">
|
||||
<text class="text-black">预约时间</text>
|
||||
<view class="flex justify-end align-center">
|
||||
|
|
@ -90,14 +90,94 @@
|
|||
<label class="radio">
|
||||
<radio class="main-color" value="0" :checked="formInfo.payWay=='0'" />
|
||||
<text class="margin-left-xs">在线支付</text>
|
||||
</label>
|
||||
<label class="radio margin-left">
|
||||
<radio class="main-color" value="1" :checked="formInfo.payWay=='1'" />
|
||||
<text class="margin-left-xs">上门到付</text>
|
||||
</label>
|
||||
</label>
|
||||
<template v-if="pickedProductList && pickedProductList[0].product[0].type == 1">
|
||||
<label class="radio margin-left">
|
||||
<radio class="main-color" value="1" :checked="formInfo.payWay=='1'" />
|
||||
<text class="margin-left-xs">上门到付</text>
|
||||
</label>
|
||||
</template>
|
||||
<template v-else>
|
||||
<label class="radio margin-left" v-if="pickedProductList && pickedProductList[0].product[0].expectDuration.indexOf('同城') > -1">
|
||||
<radio class="main-color" value="1" :checked="formInfo.payWay=='1'" />
|
||||
<text class="margin-left-xs">上门到付</text>
|
||||
</label>
|
||||
</template>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding" v-if="pickedProductList && (pickedProductList[0].product[0].storeService || pickedProductList[0].product[0].installService) && formInfo.defaultAddress && serviceShop">
|
||||
<view class="text-black text-bold flex justify-between">
|
||||
<text>安装/服务/施工门店</text>
|
||||
<text @click="goChooseShop" v-if="orderType == 2 && hasDefaultServiceShop">更多></text>
|
||||
</view>
|
||||
<view class="flex-sub flex margin-top-sm" @click="openShopLocation(serviceShop)">
|
||||
<view style="width: 150rpx;height: 150rpx;margin-right:10px;">
|
||||
<image style="width: 100%;height: 100%;" :src="serviceShop.imageUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex-sub">
|
||||
<view class="text-bold" style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{serviceShop.shopName}}</view>
|
||||
<view class="padding-tb-xs" style="position: relative;">
|
||||
<view class='cu-tag round bg-orange light'>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 1">到店服务</text>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 2">到店+配送(服务)</text>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 3">到店+上门(服务)</text>
|
||||
</view>
|
||||
<view class="margin-lr-sm" style="display: inline-block;" v-if="serviceShop.distance">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{serviceShop.distance}}</text>
|
||||
</view>
|
||||
<image src="/static/navigation.png" style="width: 50rpx;height: 50rpx;display: inline-block;position: absolute;top: 5px;right: -10px;"></image>
|
||||
</view>
|
||||
<view style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{serviceShop.provinceName + serviceShop.cityName + serviceShop.countryName + serviceShop.streetName + serviceShop.address}}</view>
|
||||
<view v-if="orderType == 2">
|
||||
<checkbox style="transform:scale(0.8);" class="main-color" :checked="formInfo.isDeliveryToStore === '1'" @click.stop="formInfo.isDeliveryToStore = formInfo.isDeliveryToStore == 1 ? '0' : '1';formInfo.payWay='0';"></checkbox>
|
||||
<text style="font-size: 24rpx;color: #0081ff;">发货到服务店<text style="font-size: 20rpx;color: gray;">(支付须选在线支付)</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-orange" style="margin-top: 10px;" v-if="pickedProductList[0].product[0].installService != 2 && orderType == 2">
|
||||
注:如包安装商品与安装服务点距离太远,下单后与商家协商处理方式!
|
||||
未包安装商品可能需您另出服务费。请留意[商品信息]处标注是否包安装!
|
||||
</view>
|
||||
<view class="text-orange" style="margin-top: 10px;" v-else>
|
||||
注:你可点击更多查看或选择附近安装服务点,并可导航前往,安装服务费自行与服务点沟通。或在服务商城内相应店铺下单。
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding" v-if="!serviceShop && goodShop">
|
||||
<view class="text-black text-bold flex justify-between">
|
||||
<text>安装/服务/施工门店</text>
|
||||
</view>
|
||||
<view class="flex-sub flex margin-top-sm" @click="openShopLocation(goodShop)">
|
||||
<view style="width: 150rpx;height: 150rpx;margin-right:10px;">
|
||||
<image style="width: 100%;height: 100%;" :src="goodShop.imageUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex-sub">
|
||||
<view class="text-bold" style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{goodShop.shopName}}</view>
|
||||
<view class="padding-tb-xs" style="position: relative;">
|
||||
<view class='cu-tag round bg-orange light'>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 1">到店服务</text>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 2">到店+配送(服务)</text>
|
||||
<text class="text-black" v-if="pickedProductList[0].product[0].storeService == 3">到店+上门(服务)</text>
|
||||
</view>
|
||||
<view class="margin-lr-sm" style="display: inline-block;" v-if="goodShop.distance">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{goodShop.distance}}</text>
|
||||
</view>
|
||||
<image src="/static/navigation.png" style="width: 50rpx;height: 50rpx;display: inline-block;position: absolute;top: 5px;right: -10px;"></image>
|
||||
</view>
|
||||
<view style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{goodShop.provinceName + goodShop.cityName + goodShop.countryName + goodShop.streetName + goodShop.address}}</view>
|
||||
<view v-if="orderType == 2">
|
||||
<checkbox style="transform:scale(0.8);" class="main-color" :checked="formInfo.isDeliveryToStore === '1'" @click.stop="formInfo.isDeliveryToStore = formInfo.isDeliveryToStore == 1 ? '0' : '1';formInfo.payWay='0';"></checkbox>
|
||||
<text style="font-size: 24rpx;color: #0081ff;">发货到服务店<text style="font-size: 20rpx;color: gray;">(支付须选在线支付)</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-orange" style="margin-top: 10px;" v-if="pickedProductList[0].product[0].installService != 2 && orderType == 2">
|
||||
注:如包安装商品与安装服务点距离太远,下单后与商家协商处理方式!
|
||||
未包安装商品可能需您另出服务费。请留意[商品信息]处标注是否包安装!
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="InsuranceList.length">
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||
<view class="text-black">
|
||||
|
|
@ -140,6 +220,21 @@
|
|||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||
<text class="text-black">订单下单图片说明 (选填)</text>
|
||||
<view class="grid col-3 grid-square flex-sub margin-top-sm">
|
||||
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
|
||||
@tap="viewImage($event, imgList)" :data-url="item">
|
||||
<image :src="item" mode="aspectFill"></image>
|
||||
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
|
||||
<text class='cuIcon-close'></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" @tap="chooseImgList(e, imgList)" v-if="imgList.length < 3">
|
||||
<text class='cuIcon-cameraadd'></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 备注留言 -->
|
||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||
|
|
@ -165,7 +260,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import productPicked from '@/components/goods-card/product-picked.vue';
|
||||
import productPicked from '@/components/goods-card/product-picked.vue';
|
||||
import { wgs84ToGcj02 } from '@/common/js/locationUtils.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -183,13 +279,21 @@
|
|||
defaultAddress: null,
|
||||
expectTimeStart: '',
|
||||
expectTimeEnd: '',
|
||||
orderImages: '',
|
||||
isDeliveryToStore: '0'
|
||||
},
|
||||
totalPrice: 0,
|
||||
timeRangeIndex: 0,
|
||||
timeRange: '',
|
||||
timeRangeList: [],
|
||||
InsuranceList: [],
|
||||
chooseInsurance: {id: null, insuranceAmount: 0}
|
||||
chooseInsurance: {id: null, insuranceAmount: 0},
|
||||
imgList: [],
|
||||
hasDefaultServiceShop: false,
|
||||
serviceShop: null,
|
||||
// 商品上架维护的店铺
|
||||
goodShop: null,
|
||||
orderType: null
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -212,6 +316,8 @@
|
|||
this.chooseInsurance.insuranceAmount = this.InsuranceList[0].insuranceAmount;
|
||||
}
|
||||
|
||||
this.orderType = params.pickedProductList[0].product[0].type
|
||||
|
||||
this.loadTotalPrice();
|
||||
this.timeRangeList = this.$globalData.timeRangeList;
|
||||
this.timeRange = this.timeRangeList[0];
|
||||
|
|
@ -227,6 +333,7 @@
|
|||
if (res && res.data &&res.data.length) {
|
||||
const defaultAdd = res.data.filter(i => i.isDefault === 1)
|
||||
this.formInfo.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
||||
this.getDefaultShop(this.formInfo.defaultAddress)
|
||||
}
|
||||
},
|
||||
loadTotalPrice() {
|
||||
|
|
@ -236,13 +343,21 @@
|
|||
})
|
||||
},
|
||||
bindEvent() {
|
||||
uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress);
|
||||
uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress);
|
||||
uni.$on('chooseShop', this.chooseShop)
|
||||
},
|
||||
offBindEvent() {
|
||||
uni.$off(this.$globalFun.CHOOSE_ADDRESS);
|
||||
uni.$off('chooseShop');
|
||||
},
|
||||
chooseShop(shopInfo) {
|
||||
this.serviceShop = shopInfo;
|
||||
},
|
||||
changePayWay(e) {
|
||||
this.formInfo.payWay = e.detail.value;
|
||||
this.formInfo.payWay = e.detail.value;
|
||||
if(this.formInfo.payWay === '1') {
|
||||
this.formInfo.isDeliveryToStore = '0'
|
||||
}
|
||||
},
|
||||
changeIsNeedBill(e) {
|
||||
this.formInfo.isNeedBill = e.detail.value;
|
||||
|
|
@ -256,6 +371,19 @@
|
|||
this.chooseInsurance.id = null;
|
||||
this.chooseInsurance.insuranceAmount = 0;
|
||||
}
|
||||
},
|
||||
openShopLocation(item) {
|
||||
// const gcj02Coord = wgs84ToGcj02(item.shop.longitude, item.shop.latitude)
|
||||
// const gcj02Coord = wgs84ToGcj02(102.80154676649306, 24.969456922743056)
|
||||
// const gcj02Coord = [102.82868680950929, 24.864792838337802]
|
||||
const gcj02Coord = [item.longitude, item.latitude]
|
||||
wx.openLocation({
|
||||
latitude: gcj02Coord[1],
|
||||
longitude: gcj02Coord[0],
|
||||
scale: 18,
|
||||
name: item.shopName,
|
||||
address: `${item.provinceName}${item.cityName}${item.countryName}${item.streetName}${item.address}`
|
||||
})
|
||||
},
|
||||
inputComments(e) {
|
||||
this.formInfo.comments = e.detail.value
|
||||
|
|
@ -264,9 +392,51 @@
|
|||
uni.navigateTo({
|
||||
url: '/pages/my/my-address?chooseMode=true'
|
||||
})
|
||||
},
|
||||
async goChooseShop() {
|
||||
const addressDetail = await this.$request.getByCustomerAddressId(
|
||||
this.formInfo.defaultAddress.customerAddressId
|
||||
);
|
||||
const addressFullObj = {
|
||||
provinceName: addressDetail.data.provinceName,
|
||||
cityName: addressDetail.data.cityName,
|
||||
countryName: addressDetail.data.countryName,
|
||||
streetName: addressDetail.data.streetName,
|
||||
address: addressDetail.data.address
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/choose-shop?goodsId='+this.pickedProductList[0].product[0].goodsId+'&addressFullObj='+JSON.stringify(addressFullObj)+'&shopId='+this.serviceShop.shopId
|
||||
})
|
||||
},
|
||||
chooseAddress(addressInfo) {
|
||||
this.formInfo.defaultAddress = addressInfo;
|
||||
this.formInfo.defaultAddress = addressInfo;
|
||||
this.getDefaultShop(addressInfo)
|
||||
},
|
||||
async getDefaultShop(addressInfo) {
|
||||
const params = {
|
||||
goodsId: this.pickedProductList[0].product[0].goodsId,
|
||||
}
|
||||
if(addressInfo.latitude && addressInfo.longitude) {
|
||||
params.latitude = addressInfo.latitude
|
||||
params.longitude = addressInfo.longitude
|
||||
} else {
|
||||
params.provinceName = addressInfo.provinceName
|
||||
params.cityName = addressInfo.cityName
|
||||
params.countryName = addressInfo.countryName
|
||||
params.streetName = addressInfo.streetName
|
||||
params.address = addressInfo.address
|
||||
}
|
||||
const productDetail = await this.$request.getGoodsDetail(params);
|
||||
console.log(productDetail);
|
||||
if(productDetail.storeService || productDetail.installService) {
|
||||
this.serviceShop = productDetail.serviceShop;
|
||||
}
|
||||
if(productDetail.serviceShop) {
|
||||
this.hasDefaultServiceShop = true
|
||||
}
|
||||
if(productDetail.shop) {
|
||||
this.goodShop = productDetail.shop
|
||||
}
|
||||
},
|
||||
changeDoorTime(value) {
|
||||
this.formInfo.doorTime = value;
|
||||
|
|
@ -297,6 +467,46 @@
|
|||
})
|
||||
return goodsList;
|
||||
},
|
||||
chooseImgList(e, imgList) {
|
||||
uni.chooseImage({
|
||||
count: 3 - imgList.length, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
});
|
||||
res.tempFilePaths.forEach((tmpUrl, index) => {
|
||||
this.$request.uploadFile(tmpUrl).then((url) => {
|
||||
imgList.push(url);
|
||||
if (index === res.tempFilePaths.length - 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
viewImage(e, imgList) {
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: e.currentTarget.dataset.url
|
||||
});
|
||||
},
|
||||
delImg(e, imgList) {
|
||||
uni.showModal({
|
||||
title: '',
|
||||
content: '确定要删除这张图片吗?',
|
||||
cancelText: '取消',
|
||||
confirmText: '确定',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
imgList.splice(e.currentTarget.dataset.index, 1)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
validForm() {
|
||||
if (!this.formInfo.defaultAddress) {
|
||||
uni.showToast({
|
||||
|
|
@ -305,12 +515,19 @@
|
|||
})
|
||||
return false;
|
||||
}
|
||||
if (!this.formInfo.doorTime || !this.formInfo.expectTimeEnd || !this.formInfo.expectTimeStart) {
|
||||
uni.showToast({
|
||||
title: '请选择上门时间',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
if (this.pickedProductList[0].product[0].type === 1) {
|
||||
if (!this.formInfo.doorTime || !this.formInfo.expectTimeEnd || !this.formInfo.expectTimeStart) {
|
||||
uni.showToast({
|
||||
title: '请选择上门时间',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
const toDay = new Date().toISOString().split('T')[0]
|
||||
this.formInfo.doorTime = toDay
|
||||
this.formInfo.expectTimeStart = toDay + ' 09:00:00'
|
||||
this.formInfo.expectTimeEnd = toDay + ' 09:30:00'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
|
@ -362,12 +579,12 @@
|
|||
goodsList: this.parseGoodsList(),
|
||||
goodsId: this.pickedProductList[0].product[0].goodsId,
|
||||
// 保险id
|
||||
insuranceId: this.chooseInsurance.id
|
||||
// goodsList: [{
|
||||
// goodsId: 2,
|
||||
// num: 1
|
||||
// }]
|
||||
insuranceId: this.chooseInsurance.id,
|
||||
orderImages: this.imgList.length ? this.imgList.join(',') : '',
|
||||
isDeliveryToStore: this.formInfo.isDeliveryToStore,
|
||||
serviceShopId: this.serviceShop ? this.serviceShop.shopId : null
|
||||
}
|
||||
console.log(params);
|
||||
// 调用下单接口
|
||||
let res = await this.$request.placeOrder(params);
|
||||
if (res.code != 0) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@
|
|||
<text class="cuIcon-search"></text>
|
||||
<input @confirm="searchGoods" v-model="inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
||||
confirm-type="search"></input>
|
||||
</view>
|
||||
</view>
|
||||
<ms-dropdown-menu>
|
||||
<ms-dropdown-item v-model="filterType" :list="filterList"></ms-dropdown-item>
|
||||
</ms-dropdown-menu>
|
||||
</view>
|
||||
<!-- 条件筛选栏 -->
|
||||
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true"
|
||||
|
|
@ -29,12 +32,12 @@
|
|||
</view>
|
||||
</picker>
|
||||
<!-- 品类筛选picker -->
|
||||
<picker v-else-if="item.code === 'deptGoodsCategoryId'" :mode="'multiSelector'" @change="categoryChange"
|
||||
<picker v-else-if="item.code === 'deptGoodsCategoryIds'" :mode="'multiSelector'" @change="categoryChange"
|
||||
@columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'"
|
||||
:range="categoryList">
|
||||
<view class="flex justify-start">
|
||||
<view class="text-cut search-nav-item-text">
|
||||
{{chosenCategory && chosenCategory.length ? chosenCategory[2].goodsCategoryName : item.title}}
|
||||
{{currentCategory ? currentCategory.goodsCategoryName : item.title}}
|
||||
</view>
|
||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||
</view>
|
||||
|
|
@ -89,11 +92,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import horizontalGoodsCard from '@/components/goods-card/horizontal-goods-card.vue';
|
||||
import horizontalGoodsCard from '@/components/goods-card/horizontal-goods-card.vue';
|
||||
import msDropdownMenu from '@/components/ms-dropdown/dropdown-menu.vue'
|
||||
import msDropdownItem from '@/components/ms-dropdown/dropdown-item.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
horizontalGoodsCard
|
||||
horizontalGoodsCard,
|
||||
msDropdownMenu,
|
||||
msDropdownItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -115,7 +122,7 @@
|
|||
title: '区域',
|
||||
type: 2
|
||||
}, {
|
||||
code: 'deptGoodsCategoryId',
|
||||
code: 'deptGoodsCategoryIds',
|
||||
title: '品类',
|
||||
type: 2
|
||||
},
|
||||
|
|
@ -141,7 +148,7 @@
|
|||
title: '区域',
|
||||
type: 2
|
||||
}, {
|
||||
code: 'deptGoodsCategoryId',
|
||||
code: 'deptGoodsCategoryIds',
|
||||
title: '品类',
|
||||
type: 2
|
||||
},
|
||||
|
|
@ -169,10 +176,26 @@
|
|||
categoryList: [],
|
||||
categoryMultiIndex: [0, 0, 0],
|
||||
chosenCategory: [],
|
||||
isLoadLocalData: true
|
||||
currentCategory: null,
|
||||
isLoadLocalData: true,
|
||||
deptGoodsCategoryIds: [],
|
||||
curUserInfo: null,
|
||||
type: 1,
|
||||
curLocation: null,
|
||||
filterList: [
|
||||
{
|
||||
text: '综合搜索',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
text: '规格搜索',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
filterType: 0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
async onLoad(options) {
|
||||
let params = JSON.parse(decodeURIComponent(options.params));
|
||||
// if (typeof params.pageNum === 'number' && typeof params.pageSize === 'number') {
|
||||
// this.pageNum = params.pageNum;
|
||||
|
|
@ -180,6 +203,7 @@
|
|||
// }
|
||||
if (params.category) {
|
||||
this.chosenCategory[2] = params.category;
|
||||
this.currentCategory = params.category;
|
||||
this.taskConditions[1].value = this.chosenCategory[2].goodsCategoryId;
|
||||
}
|
||||
if (params.area) {
|
||||
|
|
@ -189,8 +213,14 @@
|
|||
if (params.inputGoodsName) {
|
||||
this.inputGoodsName = params.inputGoodsName;
|
||||
}
|
||||
if (params.type) {
|
||||
this.type = params.type
|
||||
}
|
||||
if(params.filterType !== null || params.filterType !== undefined) {
|
||||
this.filterType = params.filterType == 1 ? 1 : 0;
|
||||
}
|
||||
|
||||
this.isLoadLocalData = params.showData;
|
||||
this.curLocation = uni.getStorageSync('userLocation') || {};
|
||||
|
||||
this.loadData();
|
||||
},
|
||||
|
|
@ -198,14 +228,48 @@
|
|||
async loadData() {
|
||||
this.pageNum = this.$globalData.initPageNum;
|
||||
this.pageSize = this.$globalData.initPageSize;
|
||||
let type;
|
||||
console.log(this.chosenCategory);
|
||||
let currentCategory;
|
||||
if (this.chosenCategory[2]) {
|
||||
type = this.chosenCategory[2].type;
|
||||
currentCategory = this.chosenCategory[2];
|
||||
}
|
||||
this.loadCategoryList(type);
|
||||
this.loadCategoryList(this.type);
|
||||
// 获取当前定位
|
||||
await this.getCurAreaArr();
|
||||
await this.loadRegionList();
|
||||
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
|
||||
const deptGoodsCategoryIds = []
|
||||
if(this.curUserInfo) {
|
||||
const res = await this.$request.getChooseCategories({
|
||||
selectionType: 1,
|
||||
customerId: this.curUserInfo.customerId
|
||||
})
|
||||
deptGoodsCategoryIds.push(...res[1].data.data)
|
||||
}
|
||||
this.deptGoodsCategoryIds = deptGoodsCategoryIds
|
||||
|
||||
console.log(this.deptGoodsCategoryIds);
|
||||
|
||||
let chooseTypes = []
|
||||
if(currentCategory && currentCategory.level === 2) {
|
||||
let typeList = await this.$request.listByStepWithAllNode({
|
||||
goodsCategoryId: currentCategory.goodsCategoryId,
|
||||
type: this.type
|
||||
});
|
||||
chooseTypes = typeList.data.filter(i => this.deptGoodsCategoryIds.includes(i.goodsCategoryId)).map(i => i.goodsCategoryId)
|
||||
console.log(chooseTypes);
|
||||
this.taskConditions[1].value = chooseTypes
|
||||
} else if(currentCategory && currentCategory.level === 3) {
|
||||
if(this.deptGoodsCategoryIds.includes(currentCategory.goodsCategoryId)) {
|
||||
this.taskConditions[1].value = [currentCategory.goodsCategoryId]
|
||||
} else {
|
||||
this.taskConditions[1].value = []
|
||||
}
|
||||
} else {
|
||||
this.taskConditions[1].value = deptGoodsCategoryIds
|
||||
}
|
||||
|
||||
this.loadProductData();
|
||||
this.loadOtherCityProductData();
|
||||
|
|
@ -218,15 +282,6 @@
|
|||
}
|
||||
},
|
||||
async loadProductData(params = {}) {
|
||||
if(!this.isLoadLocalData) {
|
||||
this.loadMoreStatus = 'over bg-grey padding-tb text-lg'
|
||||
this.hasMoreData = false;
|
||||
return;
|
||||
}
|
||||
params.pageNum = this.pageNum;
|
||||
params.pageSize = this.pageSize;
|
||||
params.goodsName = this.inputGoodsName;
|
||||
params.status = 0;
|
||||
this.taskConditions.forEach((condition) => {
|
||||
if (condition.type === 2) {
|
||||
params[condition.code] = condition.value;
|
||||
|
|
@ -235,6 +290,30 @@
|
|||
params.params[condition.code] = condition.value === 1 ? 'desc' : 'asc';
|
||||
}
|
||||
})
|
||||
// if(!this.deptGoodsCategoryIds.includes(params.deptGoodsCategoryId)) {
|
||||
// this.loadMoreStatus = 'over bg-grey padding-tb text-lg'
|
||||
// this.hasMoreData = false;
|
||||
// return;
|
||||
// }
|
||||
if(params.deptGoodsCategoryIds.length === 0) {
|
||||
this.loadMoreStatus = 'over bg-grey padding-tb text-lg'
|
||||
this.hasMoreData = false;
|
||||
return;
|
||||
}
|
||||
params.pageNum = this.pageNum;
|
||||
params.pageSize = this.pageSize;
|
||||
if (this.filterType === 0) {
|
||||
params.goodsName = this.inputGoodsName;
|
||||
} else {
|
||||
params.goodsStandard = this.inputGoodsName;
|
||||
}
|
||||
|
||||
params.status = 0;
|
||||
params.type = this.type;
|
||||
if(this.curLocation) {
|
||||
params.latitude = this.curLocation.latitude
|
||||
params.longitude = this.curLocation.longitude
|
||||
}
|
||||
// params.areaId = null;
|
||||
if (this.chosenArea[this.chosenArea.length - 1].isAll) {
|
||||
params.areaId = null;
|
||||
|
|
@ -264,6 +343,7 @@
|
|||
})
|
||||
params.areaId = null;
|
||||
params.exceptParentAreaId = this.chosenArea[this.chosenArea.length - 1].areaId;
|
||||
params.type = this.type;
|
||||
|
||||
this.loadMoreStatusOfOtherCityPage = 'loading bg-main-color padding-tb text-lg';
|
||||
this.hasMoreOtherCityData = false;
|
||||
|
|
@ -449,35 +529,57 @@
|
|||
// this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0];
|
||||
// }
|
||||
},
|
||||
async categoryChange(e) {
|
||||
async categoryChange(e) {
|
||||
console.log(e.detail.value);
|
||||
this.categoryMultiIndex = e.detail.value;
|
||||
let chosenCategory = [];
|
||||
let chosenCategory = [], lastCategory, level = 2;
|
||||
for (let i = 0; i < this.categoryList.length; i++) {
|
||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||
}
|
||||
let lastCategory = null;
|
||||
for (let i = chosenCategory.length - 1; i >= 0; i--) {
|
||||
if (i === 0) {
|
||||
lastCategory = chosenCategory[i];
|
||||
if (lastCategory && lastCategory.isAllNode) {
|
||||
let res = await this.$request.listByStep({
|
||||
type: 1
|
||||
});
|
||||
lastCategory = res.data[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
lastCategory = chosenCategory[i];
|
||||
if (!lastCategory || lastCategory.isAllNode) {
|
||||
lastCategory = chosenCategory[i - 1];
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
if(chosenCategory[2] === undefined) {
|
||||
lastCategory = chosenCategory[1]
|
||||
} else {
|
||||
lastCategory = chosenCategory[2]
|
||||
level = 3
|
||||
}
|
||||
chosenCategory[chosenCategory.length - 1] = lastCategory;
|
||||
this.chosenCategory = chosenCategory;
|
||||
this.taskConditions[this.tabCur].value = chosenCategory[chosenCategory.length - 1].goodsCategoryId;
|
||||
this.currentCategory = lastCategory;
|
||||
console.log(chosenCategory);
|
||||
console.log(lastCategory);
|
||||
this.chosenCategory = chosenCategory;
|
||||
if(level === 3) {
|
||||
if(lastCategory.isAllNode) {
|
||||
this.taskConditions[this.tabCur].value = this.categoryList[2].filter(i => this.deptGoodsCategoryIds.includes(i.goodsCategoryId)).map(i => i.goodsCategoryId)
|
||||
} else {
|
||||
this.taskConditions[this.tabCur].value = [chosenCategory[chosenCategory.length - 1].goodsCategoryId]
|
||||
}
|
||||
} else if(level === 2){
|
||||
if(lastCategory.isAllNode) {
|
||||
let res = await this.$request.getProductCategories({
|
||||
type: 1,
|
||||
customerId: this.curUserInfo.customerId,
|
||||
isSetting: 1
|
||||
});
|
||||
const allServiceCategory = res[1].data.data[0];
|
||||
const allIds = this.getAllIds(allServiceCategory.child[this.categoryMultiIndex[0]].child)
|
||||
console.log(allIds);
|
||||
this.taskConditions[this.tabCur].value = allIds
|
||||
}
|
||||
}
|
||||
this.searchGoods();
|
||||
},
|
||||
getAllIds(treeArray) {
|
||||
let ids = [];
|
||||
let stack = [...treeArray];
|
||||
|
||||
while (stack.length > 0) {
|
||||
const node = stack.pop();
|
||||
ids.push(node.goodsCategoryId);
|
||||
if (node.child && node.child.length > 0) {
|
||||
stack.push(...node.child.reverse());
|
||||
}
|
||||
}
|
||||
|
||||
return ids;
|
||||
},
|
||||
async categoryColChange(e) {
|
||||
let subTypeList = [];
|
||||
|
|
@ -509,7 +611,7 @@
|
|||
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId,
|
||||
isAllNode: this.categoryList[1][colObj.value].isAllNode
|
||||
});
|
||||
subSubTypeList = subSubTypeList.data;
|
||||
subSubTypeList = [subSubTypeList.data[0], ...subSubTypeList.data.filter(i => this.deptGoodsCategoryIds.includes(i.goodsCategoryId))];
|
||||
this.categoryList.pop();
|
||||
this.categoryList.push(subSubTypeList ? subSubTypeList : []);
|
||||
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
|
||||
|
|
@ -530,7 +632,8 @@
|
|||
line-height: 90rpx;
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 180rpx;
|
||||
width: 180rpx;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cu-load {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<block slot="backText">返回</block>
|
||||
<block slot="content">产品分类</block>
|
||||
</cu-custom>
|
||||
<vertical-nav v-if="categoryList" :containerHeight="containerHeight" :navList="level0CategoryList" :list="categoryList" :isClick2ShowProducts="true"></vertical-nav>
|
||||
<vertical-nav v-if="categoryList.length" :containerHeight="containerHeight" :navList="level0CategoryList" :list="categoryList" :isClick2ShowProducts="true"></vertical-nav>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -21,11 +21,15 @@
|
|||
containerHeight: '100vh - ' + this.CustomBar + 'px - 46px',
|
||||
level0CategoryList: [],
|
||||
categoryList: [],
|
||||
deptGoodsCategoryIds: []
|
||||
deptGoodsCategoryIds: [],
|
||||
type: 1
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadData();
|
||||
onLoad(options) {
|
||||
if(options && options.type) {
|
||||
this.type = options.type
|
||||
}
|
||||
this.loadData({}, this.type);
|
||||
this.bindEvent();
|
||||
},
|
||||
onUnload() {
|
||||
|
|
@ -34,7 +38,8 @@
|
|||
methods: {
|
||||
async loadData(params = {}, type = 1) {
|
||||
let res0 = await this.$request.listByStep({
|
||||
level: 0
|
||||
level: 0,
|
||||
type: this.type
|
||||
});
|
||||
this.level0CategoryList = res0.data;
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
|
|
@ -54,19 +59,20 @@
|
|||
// this.categoryList = await this.$api.data('categoryList');
|
||||
let res = await this.$request.getProductCategories({
|
||||
...params,
|
||||
type: type
|
||||
type: type,
|
||||
customerId: this.curUserInfo.customerId,
|
||||
isSetting: 1
|
||||
});
|
||||
res = res[1].data.data;
|
||||
res.forEach(firstCategory => {
|
||||
if (firstCategory.child && firstCategory.child.length) {
|
||||
if(this.deptGoodsCategoryIds.length === 0) {
|
||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||
} else {
|
||||
this.categoryList = this.filterDataInSelect(firstCategory.child)
|
||||
console.log(this.categoryList);
|
||||
}
|
||||
const firstCategory = res[0]
|
||||
if (firstCategory.child && firstCategory.child.length) {
|
||||
if(this.deptGoodsCategoryIds.length === 0) {
|
||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||
} else {
|
||||
this.categoryList = this.filterDataInSelect(firstCategory.child)
|
||||
console.log(this.categoryList);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
filterDataInSelect(data) {
|
||||
const newData = []
|
||||
|
|
@ -99,7 +105,8 @@
|
|||
},
|
||||
chooseSubType(item) {
|
||||
let params = {
|
||||
category: item
|
||||
category: item,
|
||||
type: this.type
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<page-meta :page-style="'overflow:'+(ifShowPageMeta?'hidden':'visible')"></page-meta>
|
||||
<view>
|
||||
<view class="padding-bottom-lg margin-bottom-lg">
|
||||
<!-- 顶部操作条 -->
|
||||
<cu-custom :bgColor="'bg-white'" :isBack="true" :isBackHome="false" :homePageUrl="'/pages/index/index'">
|
||||
<block slot="backText">返回</block>
|
||||
|
|
@ -66,6 +66,12 @@
|
|||
<view class='cu-tag round bg-orange light' v-if="productDetail.servActivity">
|
||||
<text>{{productDetail.servActivity}}</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="productDetail.installService">
|
||||
<text class="text-black">{{getInstallServiceName()}}</text>
|
||||
</view>
|
||||
<view class='cu-tag round bg-orange light' v-if="productDetail.deliveryService">
|
||||
<text class="text-black">{{getDeliveryName()}}</text>
|
||||
</view>
|
||||
<view class='cu-tag round light bg-blue padding-lr-sm' v-if="productDetail.deptGoodsCategoryName">
|
||||
<text v-if="productDetail.parGoodsCategoryName">
|
||||
{{productDetail.parGoodsCategoryName}}
|
||||
|
|
@ -83,6 +89,29 @@
|
|||
class="cuIcon-friendfamous"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-lr-sm padding-sm margin-top-sm bg-white flex" v-if="productDetail.serviceShop">
|
||||
<view>门店</view>
|
||||
<view class="flex-sub flex" @click="openShopImages">
|
||||
<view style="width: 150rpx;height: 150rpx;margin: 0 10px;">
|
||||
<image style="width: 100%;height: 100%;" :src="productDetail.serviceShop.imageUrl.split(',')[0]" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="flex-sub">
|
||||
<view class="text-bold" style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{productDetail.serviceShop.shopName}}</view>
|
||||
<view class="padding-tb-xs" style="display: flex;flex-direction: row;flex-wrap: wrap;align-items: center;">
|
||||
<view class='cu-tag round bg-orange light' v-if="productDetail.storeService">
|
||||
<text class="text-black" v-if="productDetail.storeService == 1">到店服务</text>
|
||||
<text class="text-black" v-if="productDetail.storeService == 2">到店+配送(服务)</text>
|
||||
<text class="text-black" v-if="productDetail.storeService == 3">到店+上门(服务)</text>
|
||||
</view>
|
||||
<view style="display: inline-block;margin-left: 10rpx;" v-if="productDetail.serviceShop.distance">
|
||||
<view class="cu-tag bg-red" style="padding: 0 2px;height: auto;">距离您</view>
|
||||
<text class="text-gray" style="vertical-align: middle;">{{productDetail.serviceShop.distance}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;">{{productDetail.serviceShop.provinceName + productDetail.serviceShop.cityName + productDetail.serviceShop.countryName + productDetail.serviceShop.streetName + productDetail.serviceShop.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 服务保障和规格 -->
|
||||
<view class="margin-lr-sm padding margin-top-sm bg-white">
|
||||
|
|
@ -92,7 +121,7 @@
|
|||
<text class="cuIcon-repairfill"></text>
|
||||
</view>
|
||||
<view class="cu-tag line-main-color">
|
||||
服务时效
|
||||
{{productDetail.type === 2 ? '发货时效' : '服务时效 '}}
|
||||
</view>
|
||||
</view>
|
||||
<text class="margin-lr-xs text-sm">{{productDetail.expectDuration}}</text>
|
||||
|
|
@ -108,13 +137,13 @@
|
|||
</view>
|
||||
<text class="margin-lr-xs text-sm">质保期{{productDetail.warrantyPeriod}}  不满意重新服务  快速退赔</text>
|
||||
</view>
|
||||
<view>
|
||||
<view v-if="productDetail.goodsAreaList">
|
||||
<view class="cu-capsule margin-tb-xs">
|
||||
<view class='cu-tag bg-main-color'>
|
||||
<text class="cuIcon-deliver_fill"></text>
|
||||
</view>
|
||||
<view class="cu-tag line-main-color">
|
||||
服务区域
|
||||
{{productDetail.type === 2 ? '发货区域' : '服务区域'}}
|
||||
</view>
|
||||
</view>
|
||||
<text v-for="(item,index) in productDetail.goodsAreaList">
|
||||
|
|
@ -138,7 +167,7 @@
|
|||
<text class="cuIcon-noticefill"></text>
|
||||
</view>
|
||||
<view class="cu-tag line-red">
|
||||
请核对下单地址与服务区域相匹配
|
||||
请核对下单地址与{{productDetail.type === 2 ? '发货区域' : '服务区域'}}相匹配
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -196,8 +225,8 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 服务详情 -->
|
||||
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar ">
|
||||
<view class="text-center padding-xl">{{productDetail.remark}}</view>
|
||||
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar">
|
||||
<view class="text-center padding-xl" v-if="productDetail.remark">{{productDetail.remark}}</view>
|
||||
<view class="image">
|
||||
<image v-for="(item,index) in detailPicList" :key="index" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
||||
</view>
|
||||
|
|
@ -228,7 +257,7 @@
|
|||
购物车
|
||||
</view> -->
|
||||
<!-- <view class="bg-main-color light submit" @click="toggleProductPickModal">加入购物车</view> -->
|
||||
<view class="bg-main-color submit" @tap="checkLogin" @click="beforeCheckStatusThenOpen">立即订购</view>
|
||||
<view class="bg-main-color submit" @tap="checkLogin" @click="beforeCheckStatusThenOpen">{{productDetail.type === 2 ? '立即订购' : '立即预约'}}</view>
|
||||
</view>
|
||||
<!-- 底部弹窗 -->
|
||||
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
||||
|
|
@ -279,6 +308,9 @@
|
|||
onLoad(options) {
|
||||
let params = JSON.parse(decodeURIComponent(options.params));
|
||||
this.inParam = params;
|
||||
// this.inParam = {
|
||||
// goodsId: 2089
|
||||
// };
|
||||
this.loadData();
|
||||
this.bindEvent();
|
||||
this.loadDefaultAddress()
|
||||
|
|
@ -320,10 +352,17 @@
|
|||
await this.$request.refreshCurUserCache();
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
if(this.curUserInfo) {
|
||||
const curLocation = uni.getStorageSync('userLocation') || {latitude: '',longitude: ''};
|
||||
let productDetailMock = await this.$api.data('productDetail');
|
||||
this.productDetail = await this.$request.getGoodsDetail({
|
||||
goodsId: this.inParam.goodsId
|
||||
const getProInfo = await this.$request.getGoodsDetail({
|
||||
goodsId: this.inParam.goodsId,
|
||||
latitude: curLocation.latitude,
|
||||
longitude: curLocation.longitude
|
||||
});
|
||||
if(getProInfo.type !== 1) {
|
||||
getProInfo.serviceShop = getProInfo.shop
|
||||
}
|
||||
this.productDetail = getProInfo
|
||||
// 默认规格
|
||||
this.curProductSpecs = this.productDetail.goodsStandardList[0];
|
||||
// 轮播图
|
||||
|
|
@ -432,6 +471,24 @@
|
|||
selector: '#pageAnchor' + index
|
||||
})
|
||||
},
|
||||
getDeliveryName() {
|
||||
if(this.productDetail.deliveryService === 1) {
|
||||
return '包邮'
|
||||
} else if(this.productDetail.deliveryService === 2) {
|
||||
return '同城包送'
|
||||
} else if(this.productDetail.deliveryService === 3) {
|
||||
return '邮费自付/自提'
|
||||
}
|
||||
},
|
||||
getInstallServiceName() {
|
||||
if(this.productDetail.installService === 1) {
|
||||
return '包安装'
|
||||
} else if(this.productDetail.installService === 2) {
|
||||
return '不包安装'
|
||||
} else if(this.productDetail.installService === 3) {
|
||||
return '自费安装'
|
||||
}
|
||||
},
|
||||
async loadDefaultAddress() {
|
||||
let res = await this.$request.getAddressList({
|
||||
customerId: this.$request.getCurUserInfo().customerId,
|
||||
|
|
@ -442,6 +499,22 @@
|
|||
this.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
||||
}
|
||||
},
|
||||
// openShopLocation() {
|
||||
// wx.openLocation({
|
||||
// latitude: this.productDetail.serviceShop.longitude,
|
||||
// longitude: this.productDetail.serviceShop.latitude,
|
||||
// scale: 18,
|
||||
// name: this.productDetail.serviceShop.shopName,
|
||||
// address: `${this.productDetail.serviceShop.provinceName}${this.productDetail.serviceShop.cityName}${this.productDetail.serviceShop.countryName}${this.productDetail.serviceShop.streetName}${this.productDetail.serviceShop.address}`
|
||||
// })
|
||||
// },
|
||||
openShopImages() {
|
||||
const imgList = this.productDetail.serviceShop.imageUrl.split(',')
|
||||
uni.previewImage({
|
||||
urls: imgList,
|
||||
current: imgList[0]
|
||||
});
|
||||
},
|
||||
// 检测当前默认地址是否在服务区域之间
|
||||
checkDefaultAddressIfInclude() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
@ -451,7 +524,7 @@
|
|||
if(!status) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '产品页面的【服务区域】与您默认的地址不匹配,如未选错产品,请提交后改新地址!',
|
||||
content: `产品页面的【${this.productDetail.type === 2 ? '发货区域' : '服务区域'}】与您默认的地址不匹配,如未选错产品,请提交后改新地址!`,
|
||||
cancelText: '返回查看',
|
||||
confirmText: '继续下单',
|
||||
success: res => {
|
||||
|
|
@ -478,7 +551,7 @@
|
|||
if(!allAreaId.includes(curAreaId)) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【服务区域】与【区域备注】!',
|
||||
content: `所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【${this.productDetail.type === 2 ? '发货区域' : '服务区域'}】与【区域备注】!`,
|
||||
cancelText: '返回查看',
|
||||
confirmText: '继续下单',
|
||||
success: res => {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
<view>
|
||||
<view class="padding-lr bg-white main-container">
|
||||
<view class="cu-list menu-avatar margin-bottom-sm">
|
||||
<view class="cu-item padding-bottom-sm">
|
||||
<view class="cu-avatar xl" :style="'background-image:url(' + productInfo.goodsImgUrl + ');'">
|
||||
<view class="cu-item padding-bottom-sm" style="height: 156rpx;">
|
||||
<view class="cu-avatar xxl">
|
||||
<image :src="curSpec.imageUrl || productInfo.goodsImgUrl" mode="aspectFill" style="width: 100%;height: 100%;" @click="previewImg"></image>
|
||||
</view>
|
||||
<view class="content margin-left">
|
||||
<view class="content margin-left" style="left: 180rpx;">
|
||||
<view>
|
||||
<text class="text-price text-red text-xxl">{{curSpec.goodsPrice}}</text>
|
||||
<text class="margin-left-xs">/{{curSpec.goodsUnit}}</text>
|
||||
|
|
@ -88,7 +89,8 @@
|
|||
totalPrice: 0,
|
||||
pickList: [],
|
||||
totalPickCount: 0,
|
||||
defaultAddress: null
|
||||
defaultAddress: null,
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -193,6 +195,13 @@
|
|||
uni.navigateTo({
|
||||
url: '../order/order-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
||||
})
|
||||
},
|
||||
previewImg() {
|
||||
const imgUrl = this.curSpec.imageUrl || this.productInfo.goodsImgUrl
|
||||
wx.previewImage({
|
||||
urls: [imgUrl],
|
||||
current: imgUrl
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,8 @@
|
|||
areaMultiIndex: [0, 0],
|
||||
categoryList: [],
|
||||
stickyTop: this.CustomBar,
|
||||
isShowAllAreaCurCity: false
|
||||
isShowAllAreaCurCity: false,
|
||||
deptGoodsCategoryIds: []
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
|
@ -154,6 +155,16 @@
|
|||
// 获取当前定位
|
||||
await this.getCurAreaArr();
|
||||
await this.loadRegionList();
|
||||
|
||||
this.curUserInfo = this.$request.getCurUserInfo();
|
||||
if(this.curUserInfo) {
|
||||
const res = await this.$request.getChooseCategories({
|
||||
selectionType: 1,
|
||||
customerId: this.curUserInfo.customerId
|
||||
})
|
||||
this.deptGoodsCategoryIds = res[1].data.data
|
||||
}
|
||||
|
||||
this.searchGoods();
|
||||
},
|
||||
async getCurAreaArr() {
|
||||
|
|
@ -165,7 +176,8 @@
|
|||
async loadProductData(params = {}) {
|
||||
params = {
|
||||
status: 0,
|
||||
...params
|
||||
...params,
|
||||
deptGoodsCategoryIds: this.deptGoodsCategoryIds
|
||||
}
|
||||
if (this.searchInfo.area[this.searchInfo.area.length - 1].isAll) {
|
||||
params.areaId = null;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 581 B |
Loading…
Reference in New Issue