商品售后余下功能
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;
|
font-size: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cu-avatar.xxl {
|
||||||
|
width: 156upx;
|
||||||
|
height: 156upx;
|
||||||
|
font-size: 2.5em;
|
||||||
|
}
|
||||||
|
|
||||||
.cu-avatar .avatar-text {
|
.cu-avatar .avatar-text {
|
||||||
font-size: 0.4em;
|
font-size: 0.4em;
|
||||||
}
|
}
|
||||||
|
|
@ -1964,10 +1970,26 @@ button.cuIcon.lg {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav .cu-item {
|
.nav .cu-item1 {
|
||||||
height: 90upx;
|
height: 70upx;
|
||||||
display: inline-block;
|
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;
|
margin: 0 10upx;
|
||||||
padding: 0 20upx;
|
padding: 0 20upx;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,27 @@
|
||||||
const swiperList = [{
|
const swiperList = [{
|
||||||
id: 0,
|
id: 0,
|
||||||
type: 'image',
|
type: 'image',
|
||||||
url: 'http://gqz.opsoul.com/f5cd5d9a378044aea5125ff150433bae'
|
url: 'http://gqz.opsoul.com/77991752027084_.pic.jpg'
|
||||||
}, {
|
}, {
|
||||||
id: 1,
|
id: 1,
|
||||||
type: 'image',
|
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 = [{
|
const categories = [{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '服务商城'
|
name: '服务商城'
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,23 @@ export default {
|
||||||
}
|
}
|
||||||
return this.countDownDiffCache;
|
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) {
|
addHours(dateStr, hourAmount) {
|
||||||
let date = new Date(dateStr);
|
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;
|
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) {
|
async storageLocation(res) {
|
||||||
|
uni.setStorageSync('userLocation', res);
|
||||||
let areaRes = await this.baiduGetLoacation(res.latitude, res.longitude);
|
let areaRes = await this.baiduGetLoacation(res.latitude, res.longitude);
|
||||||
areaRes = areaRes.data;
|
areaRes = areaRes.data;
|
||||||
if (areaRes) {
|
if (areaRes) {
|
||||||
|
|
@ -366,6 +367,19 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
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 = {}) {
|
async addAddressList(params = {}) {
|
||||||
let res = await uni.request({
|
let res = await uni.request({
|
||||||
url: '/customer/address/insert',
|
url: '/customer/address/insert',
|
||||||
|
|
@ -707,6 +721,37 @@ export default {
|
||||||
})
|
})
|
||||||
return res[1].data;
|
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 = {}) {
|
async getChangeOrderPrice(params = {}) {
|
||||||
let res = await uni.request({
|
let res = await uni.request({
|
||||||
url: '/order/detail/app/getChangePrice',
|
url: '/order/detail/app/getChangePrice',
|
||||||
|
|
@ -747,5 +792,72 @@ export default {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
return res[1].data;
|
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"
|
<view class="flex flex-column-around text-left margin-left-sm text-white"
|
||||||
@click="goRouter('/pages/publish/publish-task')">
|
@click="goRouter('/pages/publish/publish-task')">
|
||||||
<view class="text-xl">发布任务</view>
|
<view class="text-xl">发布任务</view>
|
||||||
<view>公司、家居家政雇佣上门服务</view>
|
<!-- <view>公司、家居家政雇佣上门服务</view> -->
|
||||||
|
<view>发布功能现正升级中</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -114,16 +115,14 @@
|
||||||
uni.$on('initValid', this.initValid)
|
uni.$on('initValid', this.initValid)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.authLogin()
|
// this.authLogin()
|
||||||
// this.$refs.vertifyLogin.showModal();
|
// this.$refs.vertifyLogin.showModal();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async initValid(initParam) {
|
async initValid(initParam) {
|
||||||
this.initParam = initParam
|
this.initParam = initParam
|
||||||
if (initParam && initParam.distributor) {
|
const res = await this.authLogin()
|
||||||
const res = await this.authLogin()
|
this.$refs.validRef.loadData(initParam, res)
|
||||||
this.$refs.validRef.loadData(initParam, res)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
goRouter(path) {
|
goRouter(path) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -167,6 +166,9 @@
|
||||||
// } else {
|
// } else {
|
||||||
// this.$refs.vertifyPhone.hideModal();
|
// this.$refs.vertifyPhone.hideModal();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
this.$emit('login-success')
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async reloadForwardPage() {
|
async reloadForwardPage() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="padding-xl text-gray text-center">
|
<view class="padding-xl text-gray text-center">
|
||||||
<view class="big-icon padding-tb" :class="'cuIcon-' + icon"></view>
|
<view class="big-icon padding-tb" :class="'cuIcon-' + icon"></view>
|
||||||
<view class="text-lg">功能开发中,暂无法使用</view>
|
<view class="text-lg">{{msg}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,54 @@
|
||||||
<view v-else-if="product.goodsLogoUrl" class="cu-avatar xxl-view" :style="'background-image:url(' + product.goodsLogoUrl + ');'"></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 class="margin-left-sm product-content">
|
||||||
<view>
|
<view>
|
||||||
<view class="text-black">{{product.goodsName}}</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 class="text-sm" v-if="ifShowComments">{{product.goodsDesc}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-between align-center">
|
<view class="flex justify-between align-center">
|
||||||
|
|
@ -47,7 +94,7 @@
|
||||||
<text class='cuIcon-locationfill'></text>
|
<text class='cuIcon-locationfill'></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-main-color sm">
|
<view class="cu-tag line-main-color sm">
|
||||||
服务区域
|
{{product.orderType == 1 ? '发货区域' : '服务区域'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text v-for="(item,index) in product.goodsAreaList">
|
<text v-for="(item,index) in product.goodsAreaList">
|
||||||
|
|
@ -72,13 +119,35 @@
|
||||||
},
|
},
|
||||||
product: {
|
product: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
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>
|
</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: []
|
chosenCategoryIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
// onReady() {
|
||||||
this.loadData();
|
// this.loadData();
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
tabSelect(e) {
|
tabSelect(e) {
|
||||||
this.tabCur = e.currentTarget.dataset.index;
|
this.tabCur = e.currentTarget.dataset.index;
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
border: 1px solid #EBEEF5;
|
border: 1px solid #EBEEF5;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
z-index: 3;
|
z-index: 99;
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "pages/order/",
|
"root": "pages/order/",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
|
"path": "choose-shop"
|
||||||
|
}, {
|
||||||
"path": "order-detail"
|
"path": "order-detail"
|
||||||
}, {
|
}, {
|
||||||
"path": "pay-result"
|
"path": "pay-result"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template name="index">
|
<template name="index">
|
||||||
<c-tabbar :current="0">
|
<c-tabbar :current="0" @login-success="loginSuccessCallback">
|
||||||
<view>
|
<view>
|
||||||
<!-- 顶部操作条 -->
|
<!-- 顶部操作条 -->
|
||||||
<!-- <cu-custom class="text-left">
|
<!-- <cu-custom class="text-left">
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
<input @confirm="chooseCategory(null)" v-model="searchInfo.inputGoodsName" :adjust-position="true"
|
<input @confirm="chooseCategory(null)" v-model="searchInfo.inputGoodsName" :adjust-position="true"
|
||||||
type="text" placeholder="输入搜索内容" confirm-type="search"></input>
|
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 -->
|
<!-- 区域筛选picker -->
|
||||||
<view class="action">
|
<view class="action">
|
||||||
<picker class="text-black text-bold" :mode="'multiSelector'" @change="regionChange"
|
<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-apps text-main-color"></text>
|
||||||
<text class="cuIcon-triangledownfill"></text>
|
<text class="cuIcon-triangledownfill"></text>
|
||||||
</view>
|
</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-view scroll-x class="nav text-right" :scroll-with-animation="true"
|
||||||
:scroll-left="scrollLeft">
|
: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"
|
v-for="(item,index) in categories" :key="item.goodsCategoryId"
|
||||||
@tap="tabSelect($event, item)" :data-index="index">
|
@tap="tabSelect($event, item)" :data-index="index">
|
||||||
{{item.goodsCategoryName}}
|
{{item.goodsCategoryName}}
|
||||||
|
|
@ -150,6 +153,8 @@
|
||||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
|
||||||
import flowGoodsCard from '@/components/goods-card/flow-goods-card.vue';
|
import flowGoodsCard from '@/components/goods-card/flow-goods-card.vue';
|
||||||
import CTabbar from '@/components/CTabbar.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';
|
// import valid from './components/valid.vue';
|
||||||
|
|
||||||
|
|
@ -160,6 +165,8 @@
|
||||||
loadStatusBar,
|
loadStatusBar,
|
||||||
flowGoodsCard,
|
flowGoodsCard,
|
||||||
CTabbar,
|
CTabbar,
|
||||||
|
msDropdownMenu,
|
||||||
|
msDropdownItem
|
||||||
// valid
|
// valid
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -168,7 +175,15 @@
|
||||||
dotStyle: true,
|
dotStyle: true,
|
||||||
swiperList: [],
|
swiperList: [],
|
||||||
tabCur: 0,
|
tabCur: 0,
|
||||||
categories: [],
|
categories: [{
|
||||||
|
id: 1,
|
||||||
|
name: '服务商城',
|
||||||
|
goodsCategoryName: '服务商城'
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
name: '商品商城',
|
||||||
|
goodsCategoryName: '商品商城'
|
||||||
|
}],
|
||||||
subCategories: [],
|
subCategories: [],
|
||||||
hotServCategory: [],
|
hotServCategory: [],
|
||||||
hotFittingsCategory: [],
|
hotFittingsCategory: [],
|
||||||
|
|
@ -186,7 +201,19 @@
|
||||||
isShowPrivSetting: false,
|
isShowPrivSetting: false,
|
||||||
initParam: null,
|
initParam: null,
|
||||||
goInfo: false,
|
goInfo: false,
|
||||||
deptGoodsCategoryIds: []
|
deptGoodsCategoryIds: [],
|
||||||
|
filterList: [
|
||||||
|
{
|
||||||
|
text: '综合搜索',
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '规格搜索',
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
filterType: 0,
|
||||||
|
curUserInfo: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
|
@ -225,7 +252,7 @@
|
||||||
// await this.$request.authAndGetLocation();
|
// await this.$request.authAndGetLocation();
|
||||||
// 定位当前城市
|
// 定位当前城市
|
||||||
await this.getCurAreaArr();
|
await this.getCurAreaArr();
|
||||||
uni.$emit('initValid', this.initParam)
|
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
if((this.productList.length || this.otherCityProductList.length) && !this.goInfo) {
|
if((this.productList.length || this.otherCityProductList.length) && !this.goInfo) {
|
||||||
|
|
@ -233,15 +260,6 @@
|
||||||
}
|
}
|
||||||
this.goInfo = false;
|
this.goInfo = false;
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
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) {
|
async onShareAppMessage(e) {
|
||||||
let shareInfo = null;
|
let shareInfo = null;
|
||||||
|
|
@ -260,7 +278,7 @@
|
||||||
}
|
}
|
||||||
if (!shareInfo) {
|
if (!shareInfo) {
|
||||||
shareInfo = {
|
shareInfo = {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
}
|
}
|
||||||
|
|
@ -268,10 +286,17 @@
|
||||||
return shareInfo;
|
return shareInfo;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
loginSuccessCallback() {
|
||||||
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
this.loadData(true)
|
||||||
|
},
|
||||||
|
async loadData(noLoadAreaAgain = false) {
|
||||||
this.initBasicData();
|
this.initBasicData();
|
||||||
// 加载区域信息
|
// 不再次解析地址
|
||||||
await this.loadRegionList();
|
if(!noLoadAreaAgain) {
|
||||||
|
// 加载区域信息
|
||||||
|
await this.loadRegionList();
|
||||||
|
}
|
||||||
// 加载服务商城热门类目
|
// 加载服务商城热门类目
|
||||||
let hotServCategoryRes = await this.$request.getHotCategory({
|
let hotServCategoryRes = await this.$request.getHotCategory({
|
||||||
type: 1
|
type: 1
|
||||||
|
|
@ -283,31 +308,15 @@
|
||||||
});
|
});
|
||||||
this.hotFittingsCategory = hotFittingsCategoryRes.data;
|
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.loadProductPage();
|
||||||
// 加载其他城市的服务列表
|
// 加载其他城市的服务列表
|
||||||
this.loadOtherCityProductPage();
|
this.loadOtherCityProductPage();
|
||||||
|
|
||||||
this.swiperList = await this.$api.data('swiperList');
|
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.moduleBarInfos = await this.$api.data('moduleBarInfos');
|
||||||
// this.hotGoods = await this.$api.data('hotGoods');
|
// this.hotGoods = await this.$api.data('hotGoods');
|
||||||
// this.discountGoods = await this.$api.data('discountGoods');
|
// this.discountGoods = await this.$api.data('discountGoods');
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// authCallback() {
|
// authCallback() {
|
||||||
// this.$refs.validRef.loadData(this.initParam)
|
// this.$refs.validRef.loadData(this.initParam)
|
||||||
|
|
@ -434,11 +443,14 @@
|
||||||
}
|
}
|
||||||
await this.wxGetLocation();
|
await this.wxGetLocation();
|
||||||
},
|
},
|
||||||
async loadCategoryList() {
|
// async loadCategoryList() {
|
||||||
let res = await this.$request.getProductCategories();
|
// let res = await this.$request.getProductCategories({
|
||||||
this.categories = res[1].data.data;
|
// customerId: this.curUserInfo.customerId,
|
||||||
this.tabSelect(null, this.categories[0]);
|
// isSetting: 0
|
||||||
},
|
// });
|
||||||
|
// this.categories = res[1].data.data;
|
||||||
|
// this.tabSelect(null, this.categories[0]);
|
||||||
|
// },
|
||||||
async loadRegionList() {
|
async loadRegionList() {
|
||||||
let area = this.searchInfo.area && this.searchInfo.area.length ? this.searchInfo.area : null
|
let area = this.searchInfo.area && this.searchInfo.area.length ? this.searchInfo.area : null
|
||||||
let regionList = await this.$request.areaListByStep({
|
let regionList = await this.$request.areaListByStep({
|
||||||
|
|
@ -529,35 +541,37 @@
|
||||||
this.tabCur = e == null ? 0 : e.currentTarget.dataset.index;
|
this.tabCur = e == null ? 0 : e.currentTarget.dataset.index;
|
||||||
this.scrollLeft = (this.tabCur - 1) * 60;
|
this.scrollLeft = (this.tabCur - 1) * 60;
|
||||||
|
|
||||||
let subSubTypeList = [];
|
this.reloadProductPage()
|
||||||
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');
|
// let subSubTypeList = [];
|
||||||
for (let i = 0; i < subSubTypeList.length; i++) {
|
// for (let i = 0; i < item.child.length; i++) {
|
||||||
subSubTypeList[i]['cuIcon'] = subCategoryOpt[i].cuIcon;
|
// let stopFlag = false;
|
||||||
subSubTypeList[i]['color'] = subCategoryOpt[i].color;
|
// let secondList = item.child[i].child;
|
||||||
}
|
// if (secondList && secondList.length) {
|
||||||
this.subCategories = subSubTypeList;
|
// 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;
|
||||||
},
|
},
|
||||||
chooseCategory(item) {
|
chooseCategory(item) {
|
||||||
this.searchInfo.category = item;
|
this.searchInfo.category = item;
|
||||||
|
|
@ -565,11 +579,17 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
searchGoods() {
|
searchGoods() {
|
||||||
|
if(!this.curUserInfo) {
|
||||||
|
uni.$emit('initValid', this.initParam)
|
||||||
|
return
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
category: this.searchInfo.category,
|
category: this.searchInfo.category,
|
||||||
area: this.searchInfo.area,
|
area: this.searchInfo.area,
|
||||||
inputGoodsName: this.searchInfo.category ? '' : this.searchInfo.inputGoodsName,
|
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)) {
|
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||||
// params.showData = false
|
// params.showData = false
|
||||||
|
|
@ -579,9 +599,14 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clickHotCategory(item) {
|
clickHotCategory(item) {
|
||||||
|
if(!this.curUserInfo) {
|
||||||
|
uni.$emit('initValid', this.initParam)
|
||||||
|
return
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
category: item,
|
category: item,
|
||||||
showData: true
|
showData: true,
|
||||||
|
type: this.tabCur === 0 ? 1 : 2
|
||||||
};
|
};
|
||||||
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
// if(!this.deptGoodsCategoryIds.includes(this.searchInfo.category)) {
|
||||||
// params.showData = false
|
// params.showData = false
|
||||||
|
|
@ -591,8 +616,12 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showProductCategories() {
|
showProductCategories() {
|
||||||
|
if(!this.curUserInfo) {
|
||||||
|
uni.$emit('initValid', this.initParam)
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/product-category'
|
url: '/pages/product/product-category?type=' + (this.tabCur === 0 ? 1 : 2)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/* 底部当前城市服务列表 start */
|
/* 底部当前城市服务列表 start */
|
||||||
|
|
@ -605,6 +634,10 @@
|
||||||
this.otherCityProductList = [];
|
this.otherCityProductList = [];
|
||||||
},
|
},
|
||||||
showDetails(productItem) {
|
showDetails(productItem) {
|
||||||
|
if(!this.curUserInfo) {
|
||||||
|
uni.$emit('initValid', this.initParam)
|
||||||
|
return
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
goodsId: productItem.goodsId
|
goodsId: productItem.goodsId
|
||||||
}
|
}
|
||||||
|
|
@ -629,10 +662,20 @@
|
||||||
params.areaId = null;
|
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.pageNum = this[pageNumName];
|
||||||
params.pageSize = this[pageSizeName];
|
params.pageSize = this[pageSizeName];
|
||||||
params.status = 0;
|
params.status = 0;
|
||||||
|
params.type = this.tabCur === 0 ? 1 : 2;
|
||||||
this.$refs[loadStatusBarRefName].showLoading();
|
this.$refs[loadStatusBarRefName].showLoading();
|
||||||
try {
|
try {
|
||||||
let res = await this.$request.qryProductPage(params);
|
let res = await this.$request.qryProductPage(params);
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
}
|
}
|
||||||
if (!shareInfo) {
|
if (!shareInfo) {
|
||||||
shareInfo = {
|
shareInfo = {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/index?distributor=' + this.curUserInfo.customerId,
|
path: '/pages/index/index?distributor=' + this.curUserInfo.customerId,
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<cu-custom :bgColor="'bg-main-color'">
|
<cu-custom :bgColor="'bg-main-color'">
|
||||||
<block slot="content">我的消息</block>
|
<block slot="content">我的消息</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<bg-toast :icon="'repair'" :msg="'开发中'"></bg-toast>
|
<bg-toast :icon="'repair'" :msg="'您没有收到新消息'"></bg-toast>
|
||||||
</view>
|
</view>
|
||||||
</c-tabbar>
|
</c-tabbar>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
}
|
}
|
||||||
if (!shareInfo) {
|
if (!shareInfo) {
|
||||||
shareInfo = {
|
shareInfo = {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,8 @@
|
||||||
<view class="cu-list grid no-border col-5">
|
<view class="cu-list grid no-border col-5">
|
||||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 0, servOrderType)">
|
<view class="cu-item" @click="showMyOrders(servOrderTabList, 0, servOrderType)">
|
||||||
<view class="cuIcon-news">
|
<view class="cuIcon-news">
|
||||||
<view class="cu-tag badge" v-if="waitForPayOrderCount > 0">
|
<view class="cu-tag badge" v-if="waitForPayOrderCount0 > 0">
|
||||||
<block>{{waitForPayOrderCount}}</block>
|
<block>{{waitForPayOrderCount0}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>待付款</text>
|
<text>待付款</text>
|
||||||
|
|
@ -110,16 +110,16 @@
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 1, servOrderType)">
|
<view class="cu-item" @click="showMyOrders(servOrderTabList, 1, servOrderType)">
|
||||||
<view class="cuIcon-repair">
|
<view class="cuIcon-repair">
|
||||||
<view class="cu-tag badge" v-if="waitForServOrderCount > 0">
|
<view class="cu-tag badge" v-if="waitForServOrderCount0 > 0">
|
||||||
<block>{{waitForServOrderCount}}</block>
|
<block>{{waitForServOrderCount0}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>待服务</text>
|
<text>待服务</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 2, servOrderType)">
|
<view class="cu-item" @click="showMyOrders(servOrderTabList, 2, servOrderType)">
|
||||||
<view class="cuIcon-comment">
|
<view class="cuIcon-comment">
|
||||||
<view class="cu-tag badge" v-if="servingOrderCount > 0">
|
<view class="cu-tag badge" v-if="servingOrderCount0 > 0">
|
||||||
<block>{{servingOrderCount}}</block>
|
<block>{{servingOrderCount0}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>进行中</text>
|
<text>进行中</text>
|
||||||
|
|
@ -134,23 +134,23 @@
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 3, servOrderType)">
|
<view class="cu-item" @click="showMyOrders(servOrderTabList, 3, servOrderType)">
|
||||||
<view class="cuIcon-service">
|
<view class="cuIcon-service">
|
||||||
<view class="cu-tag badge" v-if="afterOrderCount > 0">
|
<view class="cu-tag badge" v-if="afterOrderCount0 > 0">
|
||||||
<block>{{afterOrderCount}}</block>
|
<block>{{afterOrderCount0}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>售后中</text>
|
<text>售后中</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(servOrderTabList, 4, servOrderType)">
|
<view class="cu-item" @click="showMyOrders(servOrderTabList, 4, servOrderType)">
|
||||||
<view class="cuIcon-forward">
|
<view class="cuIcon-forward">
|
||||||
<view class="cu-tag badge" v-if="finishedOrderCount > 0">
|
<view class="cu-tag badge" v-if="finishedOrderCount0 > 0">
|
||||||
<block>{{finishedOrderCount}}</block>
|
<block>{{finishedOrderCount0}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>已完成</text>
|
<text>已完成</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 商品订单 -->
|
<!-- 商品订单 -->
|
||||||
<!-- <view class="cu-bar solid-bottom">
|
<view class="cu-bar solid-bottom">
|
||||||
<view class="action bar-first-action">
|
<view class="action bar-first-action">
|
||||||
<text class="cuIcon-titles text-main-color"></text> 商品订单
|
<text class="cuIcon-titles text-main-color"></text> 商品订单
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -162,46 +162,63 @@
|
||||||
<view class="cu-list grid no-border col-5">
|
<view class="cu-list grid no-border col-5">
|
||||||
<view class="cu-item" @click="showMyOrders(productOrderTabList, 0, productOrderType)">
|
<view class="cu-item" @click="showMyOrders(productOrderTabList, 0, productOrderType)">
|
||||||
<view class="cuIcon-news">
|
<view class="cuIcon-news">
|
||||||
<view class="cu-tag badge" v-if="myInfo.serOrderNum.wait2Pay > 0">
|
<!-- <view class="cu-tag badge" v-if="myInfo.serOrderNum.wait2Pay > 0">
|
||||||
<block>{{myInfo.serOrderNum.wait2Pay}}</block>
|
<block>{{myInfo.serOrderNum.wait2Pay}}</block>
|
||||||
|
</view> -->
|
||||||
|
<view class="cu-tag badge" v-if="waitForPayOrderCount1 > 0">
|
||||||
|
<block>{{waitForPayOrderCount1}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>待付款</text>
|
<text>待付款</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(productOrderTabList, 1, productOrderType)">
|
<view class="cu-item" @click="showMyOrders(productOrderTabList, 1, productOrderType)">
|
||||||
<view class="cuIcon-goodsfavor">
|
<view class="cuIcon-goodsfavor">
|
||||||
<view class="cu-tag badge" v-if="myInfo.serOrderNum.buy> 0">
|
<!-- <view class="cu-tag badge" v-if="myInfo.serOrderNum.buy> 0">
|
||||||
<block>{{myInfo.serOrderNum.buy}}</block>
|
<block>{{myInfo.serOrderNum.buy}}</block>
|
||||||
|
</view> -->
|
||||||
|
<view class="cu-tag badge" v-if="waitForServOrderCount1 > 0">
|
||||||
|
<block>{{waitForServOrderCount1}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>买到的</text>
|
<text>待服务</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(productOrderTabList, 2, productOrderType)">
|
<view class="cu-item" @click="showMyOrders(productOrderTabList, 2, productOrderType)">
|
||||||
<view class="cuIcon-goodsnew">
|
<view class="cuIcon-goodsnew">
|
||||||
<view class="cu-tag badge" v-if="myInfo.serOrderNum.sale > 0">
|
<!-- <view class="cu-tag badge" v-if="myInfo.serOrderNum.sale > 0">
|
||||||
<block>{{myInfo.serOrderNum.sale}}</block>
|
<block>{{myInfo.serOrderNum.sale}}</block>
|
||||||
|
</view> -->
|
||||||
|
<view class="cu-tag badge" v-if="servingOrderCount1 > 0">
|
||||||
|
<block>{{servingOrderCount1}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>卖出的</text>
|
<text>进行中</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(productOrderTabList, 3, productOrderType)">
|
<view class="cu-item" @click="showMyOrders(productOrderTabList, 3, productOrderType)">
|
||||||
<view class="cuIcon-comment">
|
<view class="cuIcon-comment">
|
||||||
<view class="cu-tag badge" v-if="myInfo.serOrderNum.afterServ > 0">
|
<!-- <view class="cu-tag badge" v-if="myInfo.serOrderNum.afterServ > 0">
|
||||||
<block>{{myInfo.serOrderNum.afterServ}}</block>
|
<block>{{myInfo.serOrderNum.afterServ}}</block>
|
||||||
|
</view> -->
|
||||||
|
<view class="cu-tag badge" v-if="afterOrderCount1 > 0">
|
||||||
|
<block>{{afterOrderCount1}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>售后中</text>
|
<text>售后中</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-item" @click="showMyOrders(productOrderTabList, 4, productOrderType)">
|
<view class="cu-item" @click="showMyOrders(productOrderTabList, 4, productOrderType)">
|
||||||
<view class="cuIcon-forward">
|
<view class="cuIcon-forward">
|
||||||
<view class="cu-tag badge" v-if="myInfo.serOrderNum.wait2Forward > 0">
|
<!-- <view class="cu-tag badge" v-if="myInfo.serOrderNum.wait2Forward > 0">
|
||||||
<block>{{myInfo.serOrderNum.wait2Forward}}</block>
|
<block>{{myInfo.serOrderNum.wait2Forward}}</block>
|
||||||
|
</view> -->
|
||||||
|
<view class="cu-tag badge" v-if="finishedOrderCount1 > 0">
|
||||||
|
<block>{{finishedOrderCount1}}</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text>待转发</text>
|
<text>已完成</text>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 所有功能 -->
|
<!-- 所有功能 -->
|
||||||
<view class="bg-white padding-lr padding-bottom">
|
<view class="bg-white padding-lr padding-bottom">
|
||||||
<view class="cu-bar margin-top-sm solid-bottom">
|
<view class="cu-bar margin-top-sm solid-bottom">
|
||||||
|
|
@ -359,25 +376,29 @@
|
||||||
// type: -1,
|
// type: -1,
|
||||||
name: '待付款'
|
name: '待付款'
|
||||||
}, {
|
}, {
|
||||||
type: -1,
|
type: '0,1,2',
|
||||||
name: '买到的'
|
name: '待发货'
|
||||||
}, {
|
}, {
|
||||||
type: -1,
|
type: '3,4',
|
||||||
name: '卖出的'
|
name: '待收货'
|
||||||
}, {
|
}, {
|
||||||
type: -1,
|
|
||||||
name: '售后中'
|
name: '售后中'
|
||||||
}, {
|
}, {
|
||||||
type: -1,
|
type: 5,
|
||||||
name: '已完成'
|
name: '已完成'
|
||||||
}],
|
}],
|
||||||
productOrderType: 1,
|
productOrderType: 1,
|
||||||
|
|
||||||
waitForPayOrderCount: 0,
|
waitForPayOrderCount0: 0,
|
||||||
waitForServOrderCount: 0,
|
waitForServOrderCount0: 0,
|
||||||
servingOrderCount: 0,
|
servingOrderCount0: 0,
|
||||||
afterOrderCount: 0,
|
afterOrderCount0: 0,
|
||||||
finishedOrderCount: 0,
|
finishedOrderCount0: 0,
|
||||||
|
waitForPayOrderCount1: 0,
|
||||||
|
waitForServOrderCount1: 0,
|
||||||
|
servingOrderCount1: 0,
|
||||||
|
afterOrderCount1: 0,
|
||||||
|
finishedOrderCount1: 0,
|
||||||
|
|
||||||
appQrcode: '',
|
appQrcode: '',
|
||||||
appShareQrcodeModal: false
|
appShareQrcodeModal: false
|
||||||
|
|
@ -406,7 +427,7 @@
|
||||||
}
|
}
|
||||||
if (!shareInfo) {
|
if (!shareInfo) {
|
||||||
shareInfo = {
|
shareInfo = {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
}
|
}
|
||||||
|
|
@ -418,12 +439,13 @@
|
||||||
await this.$request.refreshCurUserCache();
|
await this.$request.refreshCurUserCache();
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
this.myInfo = await this.$api.data('myInfo');
|
this.myInfo = await this.$api.data('myInfo');
|
||||||
this.myOrderCount();
|
this.myOrderCount(0);
|
||||||
|
this.myOrderCount(1);
|
||||||
},
|
},
|
||||||
async myOrderCount() {
|
async myOrderCount(orderType) {
|
||||||
let params = {
|
let params = {
|
||||||
customerId: this.curUserInfo.customerId,
|
customerId: this.curUserInfo.customerId,
|
||||||
orderType: 0
|
orderType: orderType
|
||||||
}
|
}
|
||||||
|
|
||||||
// 待付款服务订单数量
|
// 待付款服务订单数量
|
||||||
|
|
@ -432,34 +454,35 @@
|
||||||
payStatusList: '0,4',
|
payStatusList: '0,4',
|
||||||
exceptOrderStatus: 6
|
exceptOrderStatus: 6
|
||||||
});
|
});
|
||||||
this.waitForPayOrderCount = waitForPayOrderCountRes.data;
|
this['waitForPayOrderCount'+orderType] = waitForPayOrderCountRes.data;
|
||||||
|
|
||||||
// 待服务服务订单数量
|
// 待服务服务订单数量
|
||||||
let waitForServOrderCountRes = await this.$request.countOrderList({
|
let waitForServOrderCountRes = await this.$request.countOrderList({
|
||||||
...params,
|
...params,
|
||||||
orderStatuses: '0,1,2'
|
orderStatuses: '0,1,2'
|
||||||
});
|
});
|
||||||
this.waitForServOrderCount = waitForServOrderCountRes.data;
|
this['waitForServOrderCount'+orderType] = waitForServOrderCountRes.data;
|
||||||
|
|
||||||
// 服务中服务订单数量
|
// 服务中服务订单数量
|
||||||
let servingOrderCountRes = await this.$request.countOrderList({
|
let servingOrderCountRes = await this.$request.countOrderList({
|
||||||
...params,
|
...params,
|
||||||
orderStatuses: '3,4'
|
orderStatuses: '3,4'
|
||||||
});
|
});
|
||||||
this.servingOrderCount = servingOrderCountRes.data;
|
this['servingOrderCount'+orderType] = servingOrderCountRes.data;
|
||||||
|
|
||||||
// 售后中服务订单数量
|
// 售后中服务订单数量
|
||||||
let afterOrderCountRes = await this.$request.countAfterList({
|
let afterOrderCountRes = await this.$request.countAfterList({
|
||||||
|
...params,
|
||||||
customerId: params.customerId
|
customerId: params.customerId
|
||||||
});
|
});
|
||||||
this.afterOrderCount = afterOrderCountRes.data;
|
this['afterOrderCount'+orderType] = afterOrderCountRes.data;
|
||||||
|
|
||||||
// 已完成服务订单数量
|
// 已完成服务订单数量
|
||||||
let finishedOrderCountRes = await this.$request.countOrderList({
|
let finishedOrderCountRes = await this.$request.countOrderList({
|
||||||
...params,
|
...params,
|
||||||
orderStatus: 5
|
orderStatus: 5
|
||||||
});
|
});
|
||||||
this.finishedOrderCount = finishedOrderCountRes.data;
|
this['finishedOrderCount'+orderType] = finishedOrderCountRes.data;
|
||||||
},
|
},
|
||||||
getWxUserBasicInfo() {
|
getWxUserBasicInfo() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@
|
||||||
}
|
}
|
||||||
if (!shareInfo) {
|
if (!shareInfo) {
|
||||||
shareInfo = {
|
shareInfo = {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
path: '/pages/index/home?distributor=' + this.curUserInfo.customerId,
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
url: '',
|
url: '',
|
||||||
show: false,
|
show: false,
|
||||||
shareTemplate: {
|
shareTemplate: {
|
||||||
title: '家政服务就找工圈子',
|
title: '养车修车,一搜全有',
|
||||||
path: '/pages/index/index?customerPlace=',
|
path: '/pages/index/index?customerPlace=',
|
||||||
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
imageUrl: 'http://gqz.opsoul.com/sys/group-selfie.png'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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>
|
<text class="cuIcon-close text-bold text-red"></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-xl">
|
<view class="padding">
|
||||||
<view class="flex align-start margin-bottom-xl padding-lr">
|
<view class="flex align-start margin-bottom-xl padding-lr">
|
||||||
<view class="margin-right-sm">选品广场:</view>
|
<view class="margin-right-sm">选品广场:</view>
|
||||||
<view class="margin-right-sm">
|
<view class="margin-right-sm">
|
||||||
|
|
@ -94,19 +94,19 @@
|
||||||
</checkbox>
|
</checkbox>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="margin-bottom-sm">
|
<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"
|
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
|
||||||
@click="changeAgreeShield(1)">
|
@click="changeAgreeShield(1)">
|
||||||
</checkbox>
|
</checkbox>
|
||||||
</view>
|
</view>
|
||||||
<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"
|
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 2"
|
||||||
@click="changeAgreeShield(2)">
|
@click="changeAgreeShield(2)">
|
||||||
</checkbox>
|
</checkbox>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-left">
|
<view class="text-left" :style="{marginTop: agreeShield === 2 ? '60rpx' : '0'}">
|
||||||
<view>逐条选品</view>
|
<view>逐条选品</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="text-main-color" @tap="showModal('categoryModal')">去选品</text>
|
<text class="text-main-color" @tap="showModal('categoryModal')">去选品</text>
|
||||||
|
|
@ -193,7 +193,11 @@
|
||||||
customerId: this.curUserInfo.customerId,
|
customerId: this.curUserInfo.customerId,
|
||||||
isDistributor: true
|
isDistributor: true
|
||||||
});
|
});
|
||||||
this.loadCategory();
|
this.loadCategory({
|
||||||
|
customerId: this.curUserInfo.customerId,
|
||||||
|
type: this.agreeShield,
|
||||||
|
isSetting: 1
|
||||||
|
});
|
||||||
},
|
},
|
||||||
async loadMyInfo(params) {
|
async loadMyInfo(params) {
|
||||||
let res = await this.$request.qryCustomerList(params);
|
let res = await this.$request.qryCustomerList(params);
|
||||||
|
|
@ -208,6 +212,7 @@
|
||||||
async loadCategory(params) {
|
async loadCategory(params) {
|
||||||
let res = await this.$request.getProductCategories(params);
|
let res = await this.$request.getProductCategories(params);
|
||||||
res = res[1].data.data;
|
res = res[1].data.data;
|
||||||
|
this.categoryList = []
|
||||||
res.forEach(firstCategory => {
|
res.forEach(firstCategory => {
|
||||||
if (firstCategory.child && firstCategory.child.length) {
|
if (firstCategory.child && firstCategory.child.length) {
|
||||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||||
|
|
@ -278,6 +283,13 @@
|
||||||
changeAgreeShield(agreeShield) {
|
changeAgreeShield(agreeShield) {
|
||||||
if(agreeShield === this.agreeShield) return
|
if(agreeShield === this.agreeShield) return
|
||||||
this.agreeShield = agreeShield;
|
this.agreeShield = agreeShield;
|
||||||
|
|
||||||
|
this.loadCategory({
|
||||||
|
customerId: this.curUserInfo.customerId,
|
||||||
|
type: this.agreeShield,
|
||||||
|
isSetting: 1
|
||||||
|
});
|
||||||
|
|
||||||
// this.$refs.multiSelectNav.clearChosenItem();
|
// this.$refs.multiSelectNav.clearChosenItem();
|
||||||
this.goChooseItem()
|
this.goChooseItem()
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
|
|
@ -290,12 +302,15 @@
|
||||||
},
|
},
|
||||||
async goChooseItem() {
|
async goChooseItem() {
|
||||||
const res = await this.$request.getChooseCategories({
|
const res = await this.$request.getChooseCategories({
|
||||||
selectionType: this.agreeShield,
|
selectionType: 1,
|
||||||
|
type: this.agreeShield,
|
||||||
customerId: this.curUserInfo.customerId
|
customerId: this.curUserInfo.customerId
|
||||||
})
|
})
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res[1].data.data.length) {
|
if(res[1].data.data.length) {
|
||||||
this.$refs.multiSelectNav.setChooseItems([...res[1].data.data])
|
this.$refs.multiSelectNav.setChooseItems([...res[1].data.data])
|
||||||
|
} else {
|
||||||
|
this.$refs.multiSelectNav.setChooseItems([])
|
||||||
}
|
}
|
||||||
// this.showModal('categoryModal')
|
// this.showModal('categoryModal')
|
||||||
},
|
},
|
||||||
|
|
@ -318,7 +333,8 @@
|
||||||
let res = await this.$request.addCustomerSelection({
|
let res = await this.$request.addCustomerSelection({
|
||||||
customerId: this.curUserInfo.customerId,
|
customerId: this.curUserInfo.customerId,
|
||||||
deptCategoryIds: chosenCategoryIds,
|
deptCategoryIds: chosenCategoryIds,
|
||||||
selectionType: this.agreeShield == 3 ? 1 : this.agreeShield
|
selectionType: 1,
|
||||||
|
type: this.agreeShield
|
||||||
});
|
});
|
||||||
if (res && res.code === 0) {
|
if (res && res.code === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
|
|
@ -50,25 +50,28 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-right-sm"><text>优惠</text><text class="text-price text-red">{{shopOrder.discountMoney}}</text>
|
<view class="margin-right-sm"><text>优惠</text><text class="text-price text-red">{{shopOrder.discountMoney}}</text>
|
||||||
</view>
|
</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>
|
||||||
<view class="text-lg" v-if="shopOrder.payStatus == 1 && shopOrder.changeMoney"><text>需付款</text><text
|
<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>
|
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
|
<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
|
<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>
|
class="text-price text-red text-lg text-bold">{{Math.round((shopOrder.payMoney + shopOrder.changeMoney) * 100) / 100}}</text></view>
|
||||||
</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 class="padding-bottom-sm flex justify-end align-end text-red text-lg" v-if="shopOrder.changeMoney">您有报价/加价申请待付款中......</view>
|
||||||
<view v-if="orderType === 0" class="padding-tb-sm">
|
<view class="padding-tb-sm">
|
||||||
<view class="flex justify-end">
|
<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="[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.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>
|
<button class="cu-btn bg-main-color shadow-blur" @click="showServDetail(shopOrder)">查看</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderType === 0 && shopOrder.orderStatus === 4"
|
<view v-if="shopOrder.orderStatus === 4"
|
||||||
class="padding-tb-sm solid-top">
|
class="padding-tb-sm solid-top flex justify-between align-center">
|
||||||
<view>师傅已提交完成,请验收。</view>
|
<view>师傅已提交完成,请验收。</view>
|
||||||
<!-- <view>服务保障权益期:</view> -->
|
<!-- <view>服务保障权益期:</view> -->
|
||||||
<view class="flex justify-between align-end">
|
<view class="flex justify-between align-end">
|
||||||
|
|
@ -76,7 +79,7 @@
|
||||||
<view>
|
<view>
|
||||||
<button class="cu-btn sm bg-yellow margin-right-sm"
|
<button class="cu-btn sm bg-yellow margin-right-sm"
|
||||||
@click="updateFinisheStatus(shopOrder, 5, false)">确认完单</button>
|
@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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -111,6 +114,8 @@
|
||||||
<load-status-bar ref="loadStatusBar" @loadMore="loadOrderPage"></load-status-bar>
|
<load-status-bar ref="loadStatusBar" @loadMore="loadOrderPage"></load-status-bar>
|
||||||
<confirm-modal ref="confirmModal" :content="'是否确定取消订单?'" @confirm="cancelOrder" @cancel="blurCurOrder"></confirm-modal>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -118,12 +123,16 @@
|
||||||
import productPicked from '@/pages/my/components/product-picked.vue';
|
import productPicked from '@/pages/my/components/product-picked.vue';
|
||||||
import loadStatusBar from '@/components/custom-bar/load-status-bar.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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
productPicked,
|
productPicked,
|
||||||
loadStatusBar,
|
loadStatusBar,
|
||||||
applyAfterService
|
applyAfterService,
|
||||||
|
orderReturn,
|
||||||
|
applyAfterServiceGoods
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -202,6 +211,7 @@
|
||||||
let res = null;
|
let res = null;
|
||||||
if (this.tabCur === 3) {
|
if (this.tabCur === 3) {
|
||||||
res = await this.$request.getAfterList({
|
res = await this.$request.getAfterList({
|
||||||
|
...params,
|
||||||
customerId: params.customerId
|
customerId: params.customerId
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -211,11 +221,16 @@
|
||||||
if (rowsLength > 0) {
|
if (rowsLength > 0) {
|
||||||
this.myOrders = this.myOrders.concat(res.rows);
|
this.myOrders = this.myOrders.concat(res.rows);
|
||||||
this.pageParams[this.tabCur].pageNum++;
|
this.pageParams[this.tabCur].pageNum++;
|
||||||
if (rowsLength === this.pageSize) {
|
// if (rowsLength === this.pageSize) {
|
||||||
this.$refs.loadStatusBar.showLoadMore();
|
// 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) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
this.$refs.loadStatusBar.showLoadErr();
|
this.$refs.loadStatusBar.showLoadErr();
|
||||||
|
|
@ -247,8 +262,9 @@
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
showServDetail(order) {
|
showServDetail(order) {
|
||||||
|
const copyOrder = {...order, orderType: this.orderType}
|
||||||
uni.navigateTo({
|
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) {
|
showModalByRef(refName, curOrder, params) {
|
||||||
|
|
@ -271,7 +287,7 @@
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '取消失败',
|
title: res.msg,
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -300,6 +316,26 @@
|
||||||
url: '/pages/order/pay-result?payResult=1'
|
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>
|
</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">
|
<view class="flex justify-between">
|
||||||
<text class="text-black">预约时间</text>
|
<text class="text-black">预约时间</text>
|
||||||
<view class="flex justify-end align-center">
|
<view class="flex justify-end align-center">
|
||||||
|
|
@ -91,13 +91,93 @@
|
||||||
<radio class="main-color" value="0" :checked="formInfo.payWay=='0'" />
|
<radio class="main-color" value="0" :checked="formInfo.payWay=='0'" />
|
||||||
<text class="margin-left-xs">在线支付</text>
|
<text class="margin-left-xs">在线支付</text>
|
||||||
</label>
|
</label>
|
||||||
<label class="radio margin-left">
|
<template v-if="pickedProductList && pickedProductList[0].product[0].type == 1">
|
||||||
<radio class="main-color" value="1" :checked="formInfo.payWay=='1'" />
|
<label class="radio margin-left">
|
||||||
<text class="margin-left-xs">上门到付</text>
|
<radio class="main-color" value="1" :checked="formInfo.payWay=='1'" />
|
||||||
</label>
|
<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>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<template v-if="InsuranceList.length">
|
||||||
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||||
<view class="text-black">
|
<view class="text-black">
|
||||||
|
|
@ -141,6 +221,21 @@
|
||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<view class="margin-lr-sm margin-top-sm bg-white padding">
|
||||||
<text class="text-black">备注留言</text>
|
<text class="text-black">备注留言</text>
|
||||||
|
|
@ -166,6 +261,7 @@
|
||||||
|
|
||||||
<script>
|
<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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -183,13 +279,21 @@
|
||||||
defaultAddress: null,
|
defaultAddress: null,
|
||||||
expectTimeStart: '',
|
expectTimeStart: '',
|
||||||
expectTimeEnd: '',
|
expectTimeEnd: '',
|
||||||
|
orderImages: '',
|
||||||
|
isDeliveryToStore: '0'
|
||||||
},
|
},
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
timeRangeIndex: 0,
|
timeRangeIndex: 0,
|
||||||
timeRange: '',
|
timeRange: '',
|
||||||
timeRangeList: [],
|
timeRangeList: [],
|
||||||
InsuranceList: [],
|
InsuranceList: [],
|
||||||
chooseInsurance: {id: null, insuranceAmount: 0}
|
chooseInsurance: {id: null, insuranceAmount: 0},
|
||||||
|
imgList: [],
|
||||||
|
hasDefaultServiceShop: false,
|
||||||
|
serviceShop: null,
|
||||||
|
// 商品上架维护的店铺
|
||||||
|
goodShop: null,
|
||||||
|
orderType: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
@ -212,6 +316,8 @@
|
||||||
this.chooseInsurance.insuranceAmount = this.InsuranceList[0].insuranceAmount;
|
this.chooseInsurance.insuranceAmount = this.InsuranceList[0].insuranceAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.orderType = params.pickedProductList[0].product[0].type
|
||||||
|
|
||||||
this.loadTotalPrice();
|
this.loadTotalPrice();
|
||||||
this.timeRangeList = this.$globalData.timeRangeList;
|
this.timeRangeList = this.$globalData.timeRangeList;
|
||||||
this.timeRange = this.timeRangeList[0];
|
this.timeRange = this.timeRangeList[0];
|
||||||
|
|
@ -227,6 +333,7 @@
|
||||||
if (res && res.data &&res.data.length) {
|
if (res && res.data &&res.data.length) {
|
||||||
const defaultAdd = res.data.filter(i => i.isDefault === 1)
|
const defaultAdd = res.data.filter(i => i.isDefault === 1)
|
||||||
this.formInfo.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
this.formInfo.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
||||||
|
this.getDefaultShop(this.formInfo.defaultAddress)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadTotalPrice() {
|
loadTotalPrice() {
|
||||||
|
|
@ -237,12 +344,20 @@
|
||||||
},
|
},
|
||||||
bindEvent() {
|
bindEvent() {
|
||||||
uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress);
|
uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress);
|
||||||
|
uni.$on('chooseShop', this.chooseShop)
|
||||||
},
|
},
|
||||||
offBindEvent() {
|
offBindEvent() {
|
||||||
uni.$off(this.$globalFun.CHOOSE_ADDRESS);
|
uni.$off(this.$globalFun.CHOOSE_ADDRESS);
|
||||||
|
uni.$off('chooseShop');
|
||||||
|
},
|
||||||
|
chooseShop(shopInfo) {
|
||||||
|
this.serviceShop = shopInfo;
|
||||||
},
|
},
|
||||||
changePayWay(e) {
|
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) {
|
changeIsNeedBill(e) {
|
||||||
this.formInfo.isNeedBill = e.detail.value;
|
this.formInfo.isNeedBill = e.detail.value;
|
||||||
|
|
@ -257,6 +372,19 @@
|
||||||
this.chooseInsurance.insuranceAmount = 0;
|
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) {
|
inputComments(e) {
|
||||||
this.formInfo.comments = e.detail.value
|
this.formInfo.comments = e.detail.value
|
||||||
},
|
},
|
||||||
|
|
@ -265,8 +393,50 @@
|
||||||
url: '/pages/my/my-address?chooseMode=true'
|
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) {
|
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) {
|
changeDoorTime(value) {
|
||||||
this.formInfo.doorTime = value;
|
this.formInfo.doorTime = value;
|
||||||
|
|
@ -297,6 +467,46 @@
|
||||||
})
|
})
|
||||||
return goodsList;
|
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() {
|
validForm() {
|
||||||
if (!this.formInfo.defaultAddress) {
|
if (!this.formInfo.defaultAddress) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -305,12 +515,19 @@
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.formInfo.doorTime || !this.formInfo.expectTimeEnd || !this.formInfo.expectTimeStart) {
|
if (this.pickedProductList[0].product[0].type === 1) {
|
||||||
uni.showToast({
|
if (!this.formInfo.doorTime || !this.formInfo.expectTimeEnd || !this.formInfo.expectTimeStart) {
|
||||||
title: '请选择上门时间',
|
uni.showToast({
|
||||||
icon: 'none'
|
title: '请选择上门时间',
|
||||||
})
|
icon: 'none'
|
||||||
return false;
|
})
|
||||||
|
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;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
@ -362,12 +579,12 @@
|
||||||
goodsList: this.parseGoodsList(),
|
goodsList: this.parseGoodsList(),
|
||||||
goodsId: this.pickedProductList[0].product[0].goodsId,
|
goodsId: this.pickedProductList[0].product[0].goodsId,
|
||||||
// 保险id
|
// 保险id
|
||||||
insuranceId: this.chooseInsurance.id
|
insuranceId: this.chooseInsurance.id,
|
||||||
// goodsList: [{
|
orderImages: this.imgList.length ? this.imgList.join(',') : '',
|
||||||
// goodsId: 2,
|
isDeliveryToStore: this.formInfo.isDeliveryToStore,
|
||||||
// num: 1
|
serviceShopId: this.serviceShop ? this.serviceShop.shopId : null
|
||||||
// }]
|
|
||||||
}
|
}
|
||||||
|
console.log(params);
|
||||||
// 调用下单接口
|
// 调用下单接口
|
||||||
let res = await this.$request.placeOrder(params);
|
let res = await this.$request.placeOrder(params);
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
<input @confirm="searchGoods" v-model="inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
<input @confirm="searchGoods" v-model="inputGoodsName" :adjust-position="true" type="text" placeholder="输入搜索内容"
|
||||||
confirm-type="search"></input>
|
confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
|
<ms-dropdown-menu>
|
||||||
|
<ms-dropdown-item v-model="filterType" :list="filterList"></ms-dropdown-item>
|
||||||
|
</ms-dropdown-menu>
|
||||||
</view>
|
</view>
|
||||||
<!-- 条件筛选栏 -->
|
<!-- 条件筛选栏 -->
|
||||||
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true"
|
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true"
|
||||||
|
|
@ -29,12 +32,12 @@
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
<!-- 品类筛选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'"
|
@columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'"
|
||||||
:range="categoryList">
|
:range="categoryList">
|
||||||
<view class="flex justify-start">
|
<view class="flex justify-start">
|
||||||
<view class="text-cut search-nav-item-text">
|
<view class="text-cut search-nav-item-text">
|
||||||
{{chosenCategory && chosenCategory.length ? chosenCategory[2].goodsCategoryName : item.title}}
|
{{currentCategory ? currentCategory.goodsCategoryName : item.title}}
|
||||||
</view>
|
</view>
|
||||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -90,10 +93,14 @@
|
||||||
|
|
||||||
<script>
|
<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 {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
horizontalGoodsCard
|
horizontalGoodsCard,
|
||||||
|
msDropdownMenu,
|
||||||
|
msDropdownItem
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -115,7 +122,7 @@
|
||||||
title: '区域',
|
title: '区域',
|
||||||
type: 2
|
type: 2
|
||||||
}, {
|
}, {
|
||||||
code: 'deptGoodsCategoryId',
|
code: 'deptGoodsCategoryIds',
|
||||||
title: '品类',
|
title: '品类',
|
||||||
type: 2
|
type: 2
|
||||||
},
|
},
|
||||||
|
|
@ -141,7 +148,7 @@
|
||||||
title: '区域',
|
title: '区域',
|
||||||
type: 2
|
type: 2
|
||||||
}, {
|
}, {
|
||||||
code: 'deptGoodsCategoryId',
|
code: 'deptGoodsCategoryIds',
|
||||||
title: '品类',
|
title: '品类',
|
||||||
type: 2
|
type: 2
|
||||||
},
|
},
|
||||||
|
|
@ -169,10 +176,26 @@
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryMultiIndex: [0, 0, 0],
|
categoryMultiIndex: [0, 0, 0],
|
||||||
chosenCategory: [],
|
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));
|
let params = JSON.parse(decodeURIComponent(options.params));
|
||||||
// if (typeof params.pageNum === 'number' && typeof params.pageSize === 'number') {
|
// if (typeof params.pageNum === 'number' && typeof params.pageSize === 'number') {
|
||||||
// this.pageNum = params.pageNum;
|
// this.pageNum = params.pageNum;
|
||||||
|
|
@ -180,6 +203,7 @@
|
||||||
// }
|
// }
|
||||||
if (params.category) {
|
if (params.category) {
|
||||||
this.chosenCategory[2] = params.category;
|
this.chosenCategory[2] = params.category;
|
||||||
|
this.currentCategory = params.category;
|
||||||
this.taskConditions[1].value = this.chosenCategory[2].goodsCategoryId;
|
this.taskConditions[1].value = this.chosenCategory[2].goodsCategoryId;
|
||||||
}
|
}
|
||||||
if (params.area) {
|
if (params.area) {
|
||||||
|
|
@ -189,8 +213,14 @@
|
||||||
if (params.inputGoodsName) {
|
if (params.inputGoodsName) {
|
||||||
this.inputGoodsName = 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();
|
this.loadData();
|
||||||
},
|
},
|
||||||
|
|
@ -198,15 +228,49 @@
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.pageNum = this.$globalData.initPageNum;
|
this.pageNum = this.$globalData.initPageNum;
|
||||||
this.pageSize = this.$globalData.initPageSize;
|
this.pageSize = this.$globalData.initPageSize;
|
||||||
let type;
|
console.log(this.chosenCategory);
|
||||||
|
let currentCategory;
|
||||||
if (this.chosenCategory[2]) {
|
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.getCurAreaArr();
|
||||||
await this.loadRegionList();
|
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.loadProductData();
|
||||||
this.loadOtherCityProductData();
|
this.loadOtherCityProductData();
|
||||||
},
|
},
|
||||||
|
|
@ -218,15 +282,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async loadProductData(params = {}) {
|
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) => {
|
this.taskConditions.forEach((condition) => {
|
||||||
if (condition.type === 2) {
|
if (condition.type === 2) {
|
||||||
params[condition.code] = condition.value;
|
params[condition.code] = condition.value;
|
||||||
|
|
@ -235,6 +290,30 @@
|
||||||
params.params[condition.code] = condition.value === 1 ? 'desc' : 'asc';
|
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;
|
// params.areaId = null;
|
||||||
if (this.chosenArea[this.chosenArea.length - 1].isAll) {
|
if (this.chosenArea[this.chosenArea.length - 1].isAll) {
|
||||||
params.areaId = null;
|
params.areaId = null;
|
||||||
|
|
@ -264,6 +343,7 @@
|
||||||
})
|
})
|
||||||
params.areaId = null;
|
params.areaId = null;
|
||||||
params.exceptParentAreaId = this.chosenArea[this.chosenArea.length - 1].areaId;
|
params.exceptParentAreaId = this.chosenArea[this.chosenArea.length - 1].areaId;
|
||||||
|
params.type = this.type;
|
||||||
|
|
||||||
this.loadMoreStatusOfOtherCityPage = 'loading bg-main-color padding-tb text-lg';
|
this.loadMoreStatusOfOtherCityPage = 'loading bg-main-color padding-tb text-lg';
|
||||||
this.hasMoreOtherCityData = false;
|
this.hasMoreOtherCityData = false;
|
||||||
|
|
@ -450,35 +530,57 @@
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
async categoryChange(e) {
|
async categoryChange(e) {
|
||||||
|
console.log(e.detail.value);
|
||||||
this.categoryMultiIndex = e.detail.value;
|
this.categoryMultiIndex = e.detail.value;
|
||||||
let chosenCategory = [];
|
let chosenCategory = [], lastCategory, level = 2;
|
||||||
for (let i = 0; i < this.categoryList.length; i++) {
|
for (let i = 0; i < this.categoryList.length; i++) {
|
||||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
let lastCategory = null;
|
if(chosenCategory[2] === undefined) {
|
||||||
for (let i = chosenCategory.length - 1; i >= 0; i--) {
|
lastCategory = chosenCategory[1]
|
||||||
if (i === 0) {
|
} else {
|
||||||
lastCategory = chosenCategory[i];
|
lastCategory = chosenCategory[2]
|
||||||
if (lastCategory && lastCategory.isAllNode) {
|
level = 3
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
chosenCategory[chosenCategory.length - 1] = lastCategory;
|
this.currentCategory = lastCategory;
|
||||||
|
console.log(chosenCategory);
|
||||||
|
console.log(lastCategory);
|
||||||
this.chosenCategory = chosenCategory;
|
this.chosenCategory = chosenCategory;
|
||||||
this.taskConditions[this.tabCur].value = chosenCategory[chosenCategory.length - 1].goodsCategoryId;
|
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();
|
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) {
|
async categoryColChange(e) {
|
||||||
let subTypeList = [];
|
let subTypeList = [];
|
||||||
let subSubTypeList = [];
|
let subSubTypeList = [];
|
||||||
|
|
@ -509,7 +611,7 @@
|
||||||
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId,
|
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId,
|
||||||
isAllNode: this.categoryList[1][colObj.value].isAllNode
|
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.pop();
|
||||||
this.categoryList.push(subSubTypeList ? subSubTypeList : []);
|
this.categoryList.push(subSubTypeList ? subSubTypeList : []);
|
||||||
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
|
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
|
||||||
|
|
@ -531,6 +633,7 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-load {
|
.cu-load {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
<block slot="content">产品分类</block>
|
<block slot="content">产品分类</block>
|
||||||
</cu-custom>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -21,11 +21,15 @@
|
||||||
containerHeight: '100vh - ' + this.CustomBar + 'px - 46px',
|
containerHeight: '100vh - ' + this.CustomBar + 'px - 46px',
|
||||||
level0CategoryList: [],
|
level0CategoryList: [],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
deptGoodsCategoryIds: []
|
deptGoodsCategoryIds: [],
|
||||||
|
type: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.loadData();
|
if(options && options.type) {
|
||||||
|
this.type = options.type
|
||||||
|
}
|
||||||
|
this.loadData({}, this.type);
|
||||||
this.bindEvent();
|
this.bindEvent();
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
|
|
@ -34,7 +38,8 @@
|
||||||
methods: {
|
methods: {
|
||||||
async loadData(params = {}, type = 1) {
|
async loadData(params = {}, type = 1) {
|
||||||
let res0 = await this.$request.listByStep({
|
let res0 = await this.$request.listByStep({
|
||||||
level: 0
|
level: 0,
|
||||||
|
type: this.type
|
||||||
});
|
});
|
||||||
this.level0CategoryList = res0.data;
|
this.level0CategoryList = res0.data;
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
|
|
@ -54,19 +59,20 @@
|
||||||
// this.categoryList = await this.$api.data('categoryList');
|
// this.categoryList = await this.$api.data('categoryList');
|
||||||
let res = await this.$request.getProductCategories({
|
let res = await this.$request.getProductCategories({
|
||||||
...params,
|
...params,
|
||||||
type: type
|
type: type,
|
||||||
|
customerId: this.curUserInfo.customerId,
|
||||||
|
isSetting: 1
|
||||||
});
|
});
|
||||||
res = res[1].data.data;
|
res = res[1].data.data;
|
||||||
res.forEach(firstCategory => {
|
const firstCategory = res[0]
|
||||||
if (firstCategory.child && firstCategory.child.length) {
|
if (firstCategory.child && firstCategory.child.length) {
|
||||||
if(this.deptGoodsCategoryIds.length === 0) {
|
if(this.deptGoodsCategoryIds.length === 0) {
|
||||||
this.categoryList = this.categoryList.concat(firstCategory.child)
|
this.categoryList = this.categoryList.concat(firstCategory.child)
|
||||||
} else {
|
} else {
|
||||||
this.categoryList = this.filterDataInSelect(firstCategory.child)
|
this.categoryList = this.filterDataInSelect(firstCategory.child)
|
||||||
console.log(this.categoryList);
|
console.log(this.categoryList);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
},
|
},
|
||||||
filterDataInSelect(data) {
|
filterDataInSelect(data) {
|
||||||
const newData = []
|
const newData = []
|
||||||
|
|
@ -99,7 +105,8 @@
|
||||||
},
|
},
|
||||||
chooseSubType(item) {
|
chooseSubType(item) {
|
||||||
let params = {
|
let params = {
|
||||||
category: item
|
category: item,
|
||||||
|
type: this.type
|
||||||
};
|
};
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
url: '/pages/product/filtered-products?params=' + encodeURIComponent(JSON.stringify(params))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<page-meta :page-style="'overflow:'+(ifShowPageMeta?'hidden':'visible')"></page-meta>
|
<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'">
|
<cu-custom :bgColor="'bg-white'" :isBack="true" :isBackHome="false" :homePageUrl="'/pages/index/index'">
|
||||||
<block slot="backText">返回</block>
|
<block slot="backText">返回</block>
|
||||||
|
|
@ -66,6 +66,12 @@
|
||||||
<view class='cu-tag round bg-orange light' v-if="productDetail.servActivity">
|
<view class='cu-tag round bg-orange light' v-if="productDetail.servActivity">
|
||||||
<text>{{productDetail.servActivity}}</text>
|
<text>{{productDetail.servActivity}}</text>
|
||||||
</view>
|
</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">
|
<view class='cu-tag round light bg-blue padding-lr-sm' v-if="productDetail.deptGoodsCategoryName">
|
||||||
<text v-if="productDetail.parGoodsCategoryName">
|
<text v-if="productDetail.parGoodsCategoryName">
|
||||||
{{productDetail.parGoodsCategoryName}}
|
{{productDetail.parGoodsCategoryName}}
|
||||||
|
|
@ -84,6 +90,29 @@
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<view class="margin-lr-sm padding margin-top-sm bg-white">
|
||||||
<view v-if="productDetail.expectDuration">
|
<view v-if="productDetail.expectDuration">
|
||||||
|
|
@ -92,7 +121,7 @@
|
||||||
<text class="cuIcon-repairfill"></text>
|
<text class="cuIcon-repairfill"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-main-color">
|
<view class="cu-tag line-main-color">
|
||||||
服务时效
|
{{productDetail.type === 2 ? '发货时效' : '服务时效 '}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="margin-lr-xs text-sm">{{productDetail.expectDuration}}</text>
|
<text class="margin-lr-xs text-sm">{{productDetail.expectDuration}}</text>
|
||||||
|
|
@ -108,13 +137,13 @@
|
||||||
</view>
|
</view>
|
||||||
<text class="margin-lr-xs text-sm">质保期{{productDetail.warrantyPeriod}}  不满意重新服务  快速退赔</text>
|
<text class="margin-lr-xs text-sm">质保期{{productDetail.warrantyPeriod}}  不满意重新服务  快速退赔</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view v-if="productDetail.goodsAreaList">
|
||||||
<view class="cu-capsule margin-tb-xs">
|
<view class="cu-capsule margin-tb-xs">
|
||||||
<view class='cu-tag bg-main-color'>
|
<view class='cu-tag bg-main-color'>
|
||||||
<text class="cuIcon-deliver_fill"></text>
|
<text class="cuIcon-deliver_fill"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-main-color">
|
<view class="cu-tag line-main-color">
|
||||||
服务区域
|
{{productDetail.type === 2 ? '发货区域' : '服务区域'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text v-for="(item,index) in productDetail.goodsAreaList">
|
<text v-for="(item,index) in productDetail.goodsAreaList">
|
||||||
|
|
@ -138,7 +167,7 @@
|
||||||
<text class="cuIcon-noticefill"></text>
|
<text class="cuIcon-noticefill"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-tag line-red">
|
<view class="cu-tag line-red">
|
||||||
请核对下单地址与服务区域相匹配
|
请核对下单地址与{{productDetail.type === 2 ? '发货区域' : '服务区域'}}相匹配
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -196,8 +225,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 服务详情 -->
|
<!-- 服务详情 -->
|
||||||
<view id="pageAnchor2" class="margin-lr-sm margin-top-sm bg-white margin-bottom-with-bar ">
|
<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 class="text-center padding-xl" v-if="productDetail.remark">{{productDetail.remark}}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image v-for="(item,index) in detailPicList" :key="index" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
<image v-for="(item,index) in detailPicList" :key="index" :src="item.imgUrl" mode="widthFix" style="width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -228,7 +257,7 @@
|
||||||
购物车
|
购物车
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- <view class="bg-main-color light submit" @click="toggleProductPickModal">加入购物车</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>
|
</view>
|
||||||
<!-- 底部弹窗 -->
|
<!-- 底部弹窗 -->
|
||||||
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
<uni-popup ref="productPickPopup" type="bottom" @change="changePopupState">
|
||||||
|
|
@ -279,6 +308,9 @@
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let params = JSON.parse(decodeURIComponent(options.params));
|
let params = JSON.parse(decodeURIComponent(options.params));
|
||||||
this.inParam = params;
|
this.inParam = params;
|
||||||
|
// this.inParam = {
|
||||||
|
// goodsId: 2089
|
||||||
|
// };
|
||||||
this.loadData();
|
this.loadData();
|
||||||
this.bindEvent();
|
this.bindEvent();
|
||||||
this.loadDefaultAddress()
|
this.loadDefaultAddress()
|
||||||
|
|
@ -320,10 +352,17 @@
|
||||||
await this.$request.refreshCurUserCache();
|
await this.$request.refreshCurUserCache();
|
||||||
this.curUserInfo = this.$request.getCurUserInfo();
|
this.curUserInfo = this.$request.getCurUserInfo();
|
||||||
if(this.curUserInfo) {
|
if(this.curUserInfo) {
|
||||||
|
const curLocation = uni.getStorageSync('userLocation') || {latitude: '',longitude: ''};
|
||||||
let productDetailMock = await this.$api.data('productDetail');
|
let productDetailMock = await this.$api.data('productDetail');
|
||||||
this.productDetail = await this.$request.getGoodsDetail({
|
const getProInfo = await this.$request.getGoodsDetail({
|
||||||
goodsId: this.inParam.goodsId
|
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];
|
this.curProductSpecs = this.productDetail.goodsStandardList[0];
|
||||||
// 轮播图
|
// 轮播图
|
||||||
|
|
@ -432,6 +471,24 @@
|
||||||
selector: '#pageAnchor' + index
|
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() {
|
async loadDefaultAddress() {
|
||||||
let res = await this.$request.getAddressList({
|
let res = await this.$request.getAddressList({
|
||||||
customerId: this.$request.getCurUserInfo().customerId,
|
customerId: this.$request.getCurUserInfo().customerId,
|
||||||
|
|
@ -442,6 +499,22 @@
|
||||||
this.defaultAddress = defaultAdd.length ? defaultAdd[0] : res.data[0];
|
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() {
|
checkDefaultAddressIfInclude() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -451,7 +524,7 @@
|
||||||
if(!status) {
|
if(!status) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '产品页面的【服务区域】与您默认的地址不匹配,如未选错产品,请提交后改新地址!',
|
content: `产品页面的【${this.productDetail.type === 2 ? '发货区域' : '服务区域'}】与您默认的地址不匹配,如未选错产品,请提交后改新地址!`,
|
||||||
cancelText: '返回查看',
|
cancelText: '返回查看',
|
||||||
confirmText: '继续下单',
|
confirmText: '继续下单',
|
||||||
success: res => {
|
success: res => {
|
||||||
|
|
@ -478,7 +551,7 @@
|
||||||
if(!allAreaId.includes(curAreaId)) {
|
if(!allAreaId.includes(curAreaId)) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【服务区域】与【区域备注】!',
|
content: `所选产品与您目前所在位置定位不是同一个区/县,请查看产品页面的【${this.productDetail.type === 2 ? '发货区域' : '服务区域'}】与【区域备注】!`,
|
||||||
cancelText: '返回查看',
|
cancelText: '返回查看',
|
||||||
confirmText: '继续下单',
|
confirmText: '继续下单',
|
||||||
success: res => {
|
success: res => {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="padding-lr bg-white main-container">
|
<view class="padding-lr bg-white main-container">
|
||||||
<view class="cu-list menu-avatar margin-bottom-sm">
|
<view class="cu-list menu-avatar margin-bottom-sm">
|
||||||
<view class="cu-item padding-bottom-sm">
|
<view class="cu-item padding-bottom-sm" style="height: 156rpx;">
|
||||||
<view class="cu-avatar xl" :style="'background-image:url(' + productInfo.goodsImgUrl + ');'">
|
<view class="cu-avatar xxl">
|
||||||
|
<image :src="curSpec.imageUrl || productInfo.goodsImgUrl" mode="aspectFill" style="width: 100%;height: 100%;" @click="previewImg"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="content margin-left">
|
<view class="content margin-left" style="left: 180rpx;">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-price text-red text-xxl">{{curSpec.goodsPrice}}</text>
|
<text class="text-price text-red text-xxl">{{curSpec.goodsPrice}}</text>
|
||||||
<text class="margin-left-xs">/{{curSpec.goodsUnit}}</text>
|
<text class="margin-left-xs">/{{curSpec.goodsUnit}}</text>
|
||||||
|
|
@ -88,7 +89,8 @@
|
||||||
totalPrice: 0,
|
totalPrice: 0,
|
||||||
pickList: [],
|
pickList: [],
|
||||||
totalPickCount: 0,
|
totalPickCount: 0,
|
||||||
defaultAddress: null
|
defaultAddress: null,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -193,6 +195,13 @@
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../order/order-detail?params=' + encodeURIComponent(JSON.stringify(params))
|
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],
|
areaMultiIndex: [0, 0],
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
stickyTop: this.CustomBar,
|
stickyTop: this.CustomBar,
|
||||||
isShowAllAreaCurCity: false
|
isShowAllAreaCurCity: false,
|
||||||
|
deptGoodsCategoryIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
|
@ -154,6 +155,16 @@
|
||||||
// 获取当前定位
|
// 获取当前定位
|
||||||
await this.getCurAreaArr();
|
await this.getCurAreaArr();
|
||||||
await this.loadRegionList();
|
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();
|
this.searchGoods();
|
||||||
},
|
},
|
||||||
async getCurAreaArr() {
|
async getCurAreaArr() {
|
||||||
|
|
@ -165,7 +176,8 @@
|
||||||
async loadProductData(params = {}) {
|
async loadProductData(params = {}) {
|
||||||
params = {
|
params = {
|
||||||
status: 0,
|
status: 0,
|
||||||
...params
|
...params,
|
||||||
|
deptGoodsCategoryIds: this.deptGoodsCategoryIds
|
||||||
}
|
}
|
||||||
if (this.searchInfo.area[this.searchInfo.area.length - 1].isAll) {
|
if (this.searchInfo.area[this.searchInfo.area.length - 1].isAll) {
|
||||||
params.areaId = null;
|
params.areaId = null;
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 581 B |
Loading…
Reference in New Issue