前端小程序

这个提交包含在:
可乐加冰
2026-09-14 17:24:53 +08:00
父节点 bb69a43a0f
当前提交 019630f12c
共有 2629 个文件被更改,包括 403657 次插入 和 0 次删除

查看文件

@@ -0,0 +1,411 @@
<!-- 自提配送详情,自动发货详情 -->
<template>
<view class="page_box">
<view class="content_box">
<view class="card-wrap" :style="expressType !== 'selfetch' ? 'border-bottom-left-radius:0;border-bottom-right-radius:0;' : ''">
<!-- 商品卡片 -->
<view class="order-card-box">
<shopro-mini-card :title="itemDetail.goods_title" :image="itemDetail.goods_image">
<template #describe>
<view class="order-sku u-ellipsis-1">
<text class="order-num">数量:{{ itemDetail.goods_num || 0 }};</text>
{{ itemDetail.goods_sku_text ? itemDetail.goods_sku_text : '' }}
</view>
</template>
<template #cardBottom>
<view class="card-price-box u-flex">
<text class="order-price font-OPPOSANS">¥{{ itemDetail.goods_price || 0 }}</text>
<button class="u-reset-button status-btn" v-if="itemDetail.status_name">{{ itemDetail.status_name }}</button>
</view>
</template>
</shopro-mini-card>
</view>
<!-- 到店自提 -->
<view class="u-flex-col u-col-center u-m-b-20 u-p-y-20" v-if="expressType == 'selfetch' && itemDetail.status_code !== 'refund_finish' && qrcodeList.length">
<image class="qr-code--img u-m-y-20" :src="allqrcodepath" mode=""></image>
<view class="all-qrcode-title u-m-b-20">总核销码</view>
<view class="detail-item">
<view class="item-title u-flex">核销码</view>
<view class="u-flex u-row-between u-m-y-20" v-for="code in qrcodeList" :key="code.code">
<view>
<text :style="code.status_code !== 'nouse' ? 'color:#999' : ''" class="item-content">{{ code.code }}</text>
<text :style="code.status_code !== 'nouse' ? 'color:#999' : ''" class="item-status u-m-x-30">{{ code.status_name }}</text>
</view>
<button class="u-reset-button check-code" v-if="code.status_code == 'nouse'" @tap="checkCode(code.code)">查看</button>
</view>
<view class="item-tip">为保障您的权益,未到店消费前请不要将提货码提供给商家</view>
</view>
</view>
</view>
<!-- 自提 -->
<view class="detail-item u-p-20 " v-if="expressType == 'selfetch'">
<view class="item-title">{{ storeInfo.name }}</view>
<view class="u-flex u-row-between">
<view class="u-m-r-20" style="flex: 3;">
<view class="item-content">
{{ storeInfo.province_name || '' }}{{ storeInfo.city_name || '' }}{{ storeInfo.area_name || '' }}{{ storeInfo.address || '' }}
</view>
<view class="item-content">营业时间:{{ storeInfo.openhours || '' }}</view>
</view>
<view class="u-flex-col u-col-center location-box" style="flex: 1;" @tap="openStoreMap">
<text class="u-iconfont uicon-map-fill" style="color: #4fbbff;font-size: 34rpx;"></text>
<text class="location-text u-m-t-10">到这去</text>
</view>
</view>
</view>
<!-- 配送 -->
<view
class="detail-item u-p-20"
:style="expressType !== 'selfetch' ? 'border-top-left-radius:0;border-top-right-radius:0;' : ''"
v-if="expressType == 'store' && itemDetail.order"
>
<view class="item-title">配送信息</view>
<view class="item-content">配送地址:{{ itemDetail.order.city_name || '' }}{{ itemDetail.order.area_name || '' }}{{ itemDetail.order.address || '' }}</view>
<view class="item-content">配送时间:{{ itemDetail.ext_arr.dispatch_date || '' }}</view>
</view>
<!-- 自动 -->
<view class="detail-item u-p-20" :style="expressType !== 'selfetch' ? 'border-top-left-radius:0;border-top-right-radius:0;' : ''" v-if="expressType == 'autosend'">
<view class="item-title">发货信息</view>
<view v-if="itemDetail.ext_arr && itemDetail.ext_arr.autosend_type == 'params'" v-for="item in autosendList" :key="item.value" class="item-content">
{{ item.name }}:{{ item.value }}
</view>
<view v-if="itemDetail.ext_arr && itemDetail.ext_arr.autosend_type == 'text'" class="item-content">{{ itemDetail.ext_arr.autosend_content }}</view>
<view v-if="!(itemDetail.ext_arr && itemDetail.ext_arr.autosend_type)" style="color: #999;" class="item-content">暂未发货~</view>
</view>
</view>
<view class="foot_box u-flex u-row-center u-col-center u-p-b-20" v-if="expressType == 'selfetch' || expressType == 'store'">
<button class="service-btn u-reset-button u-flex u-col-center u-row-center" @tap="onService">
<text class="u-iconfont uicon-phone-fill u-m-r-10" style="color: #fff;font-size: 40rpx;"></text>
联系商家
</button>
</view>
<!-- 二维码弹窗 -->
<u-popup v-model="showQrcode" border-radius="20" mode="center">
<view class="qr-code-modal u-flex-col u-row-center u-col-center">
<image class="qr-code-img" :src="qrcodepath" mode=""></image>
<view class="qr-code-text">核销码:{{ qrcode }}</view>
<button class="u-reset-button hide-qrcode" @tap="showQrcode = false">关闭</button>
</view>
</u-popup>
<!-- 二维码绘制 -->
<view class="hideCanvasView">
<canvas class="hideCanvas" canvas-id="qrcode_img" :style="{ width: (poster.width || 1) + 'px', height: (poster.height || 1) + 'px' }"></canvas>
</view>
</view>
</template>
<script>
import _app from '@/shopro/poster/QS-SharePoster/app.js';
import { getSharePoster } from '@/shopro/poster/QS-SharePoster/QS-SharePoster.js';
export default {
components: {},
data() {
return {
poster: {},
canvasId: 'qrcode_img',
qrcode: '', //核销总码
qrcodeList: [], //核销码列表
storeInfo: {}, //自提点信息
qrcodepath: '', //单核销码
allqrcodepath: '', //总核销码
autosendList: [], //自动发货列表。
itemDetail: {}, //订单商品详情
expressType: 'express',
barTitle: {
express: '物流快递',
selfetch: '到店/自提',
store: '商家配送',
autosend: '自动发货'
},
showQrcode: false //二维码弹窗
};
},
computed: {},
onLoad() {
this.expressType = this.$Route.query.expressType;
uni.setNavigationBarTitle({
title: this.barTitle[this.expressType]
});
this.getItemGoodsDetail();
},
onPullDownRefresh() {
this.getItemGoodsDetail();
},
methods: {
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
},
// 自提打开地图
openStoreMap() {
uni.openLocation({
latitude: +this.storeInfo.latitude,
longitude: +this.storeInfo.longitude,
success: function() {
console.log('success');
},
fail: err => {
console.log(err);
}
});
},
// 跳转客服
onService() {
this.$tools.callPhone(this.itemDetail.store.phone);
},
// 查看核销码
checkCode(code) {
this.qrcode = code;
this.shareFc('qrcode').then(res => {
this.showQrcode = true;
});
},
// 订单详情
getItemGoodsDetail() {
let that = this;
that.$http('order.itemDetail', {
id: that.$Route.query.orderId,
order_item_id: that.$Route.query.orderItemId,
type: 'dispatch'
}).then(res => {
uni.stopPullDownRefresh();
if (res.code === 1) {
that.itemDetail = res.data;
that.qrcodeList = res.data.verify;
that.storeInfo = res.data.store;
if (res.data.ext_arr.autosend_content && res.data.ext_arr.autosend_type == 'params') {
that.autosendList = JSON.parse(res.data.ext_arr.autosend_content);
}
if (that.expressType == 'selfetch') {
let _arr = [];
that.qrcodeList.forEach(code => {
_arr.push(code.code);
});
that.qrcode = _arr.join(',');
if (that.qrcodeList.length) {
that.shareFc();
}
}
}
});
},
// 绘制二维码
async shareFc(type) {
let that = this;
try {
console.log('准备生成:' + new Date());
const d = await getSharePoster({
_this: this, //若在组件中使用 必传
posterCanvasId: this.canvasId, //canvasId
delayTimeScale: 20, //延时系数
drawDelayTime: 500, //draw延时时间
background: {
width: 100,
height: 100,
backgroundColor: '#fff'
},
drawArray: ({ bgObj, type, bgScale }) => {
return new Promise((rs, rj) => {
rs([
{
type: 'qrcode',
text: this.qrcode,
size: bgObj.width,
dx: 0,
dy: 0,
correctLevel: 1
}
]);
});
},
setCanvasWH: ({ bgObj, type, bgScale }) => {
// 为动态设置画布宽高的方法,
this.poster = bgObj;
}
});
if (type == 'qrcode') {
this.qrcodepath = d.poster.tempFilePath;
} else {
this.allqrcodepath = d.poster.tempFilePath;
}
} catch (e) {
_app.hideLoading();
_app.showToast(JSON.stringify(e));
}
}
}
};
</script>
<style lang="scss">
// 二维码
.hideCanvasView {
position: relative;
.hideCanvas {
position: fixed;
top: -99999upx;
left: -99999upx;
z-index: -99999;
}
}
// 二维码弹窗
.qr-code-modal {
width: 610rpx;
border-radius: 20rpx;
background-color: #fff;
margin: 0 auto;
.qr-code-img {
margin: 100rpx;
width: 400rpx;
height: 400rpx;
}
.qr-code-text {
color: #999;
font-size: 28rpx;
}
.hide-qrcode {
width: 492rpx;
line-height: 70rpx;
background: linear-gradient(90deg, #1677FF, #4096FF);
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
border-radius: 35rpx;
font-size: 28rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
margin: 30rpx;
}
}
.content_box {
padding: 20rpx;
}
.no-radius {
border-radius: 0 !important;
}
.card-wrap {
background-color: #fff;
padding: 20rpx 20rpx 0;
border-radius: 20rpx;
}
.order-card-box {
height: 200rpx;
border-bottom: 2rpx solid rgba(238, 238, 238, 0.6);
.order-sku {
font-size: 24rpx;
font-weight: 400;
color: rgba(153, 153, 153, 1);
width: 450rpx;
margin-bottom: 20rpx;
.order-num {
margin-right: 10rpx;
}
}
.card-price-box {
.status-btn {
height: 32rpx;
border: 1rpx solid rgba(207, 169, 114, 1);
border-radius: 15rpx;
font-size: 20rpx;
font-weight: 400;
color: rgba(168, 112, 13, 1);
padding: 0 10rpx;
margin-left: 20rpx;
background: rgba(233, 183, 102, 0.16);
}
.order-price {
font-size: 26rpx;
font-weight: 600;
color: rgba(51, 51, 51, 1);
}
}
}
.qr-code--img {
width: 200rpx;
height: 200rpx;
}
.detail-item {
background: rgba(255, 255, 255, 1);
border-radius: 20rpx;
width: 100%;
.item-title {
font-size: 28rpx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
height: 60rpx;
}
.item-content {
font-size: 26rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 50rpx;
}
.item-status {
font-size: 26rpx;
font-weight: 400;
color: rgba(179, 132, 54, 1);
}
.item-tip {
font-size: 24rpx;
font-weight: 400;
color: rgba(196, 196, 196, 1);
}
.check-code {
background: none;
border-radius: 25rpx;
border: 1rpx solid rgba(179, 132, 54, 1);
padding: 0;
width: 100rpx;
line-height: 50rpx;
font-size: 28rpx;
color: rgba(179, 132, 54, 1);
}
.location-box {
height: 100%;
justify-content: center;
position: relative;
&::before {
content: '';
width: 2rpx;
height: 94rpx;
background: #eeeeee;
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
}
.location-icon {
color: #4fbbff;
margin-bottom: 20rpx;
}
.location-text {
color: #999;
font-size: 26rpx;
}
}
}
.service-btn {
padding: 0;
width: 710rpx;
line-height: 80rpx;
background: linear-gradient(90deg, #1677FF, #4096FF);
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
border-radius: 40rpx;
font-size: 30rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
</style>

查看文件

@@ -0,0 +1,231 @@
<!-- 物流信息 -->
<template>
<view class="map-box">
<!-- 商品卡片 -->
<view class="oilStation-top">
<view class="u-flex u-row-between express-card__head">
<view class="u-flex">
<view class="img-box">
<image class="goods-image" :src="firstGoods.goods_image" mode="aspectFill"></image>
<view class="shop-tag">{{ goodsList.length || 0 }}件商品</view>
</view>
<view class="u-flex u-flex-col">
<text class="express-status">{{ expressStatus || firstGoods.status_name || '' }}</text>
<text v-if="expressCompanyName" class="express-company">{{ expressCompanyName }}</text>
</view>
</view>
</view>
<view class="express-sn u-flex u-col-center ">
<text class="u-m-r-30">{{ expressDetail.express_name || '' }}
{{ expressDetail.express_no || '' }}</text>
<text class="u-iconfont uicon-file-text" style="color: #666;font-size: 32rpx;"
@tap="copyCode(expressDetail.express_no)"></text>
</view>
</view>
<!-- 物流时间轴 -->
<view class="oilStation-bottom">
<view class="u-p-y-30">
<view v-if="trackList.length" class="express-item u-flex u-col-center"
v-for="(log, index) in trackList" :key="log.id">
<view class="item-left">
<view class="day">{{ log.AcceptTime.split(' ')[0] }}</view>
<view class="time">{{ log.AcceptTime.split(' ')[1] }}</view>
</view>
<view class="item-right">
<image class="express-tag"
:src="$IMG_URL + `/imgs/order/ex_${log.Action}.png?a=2`"
mode="aspectFill"></image>
<view class="express-title">{{ log.Location }}</view>
<view class="express-detail">{{ log.AcceptStation }}</view>
</view>
</view>
<view v-if="!trackList.length" class="no-log u-flex u-row-center u-col-center">暂无物流信息~</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
expressDetail: {}, // 物流信息
exrpessLog: [], // 包裹轨迹
firstGoods: {}, // 商品列表
goodsList: [],
trackList: [], // 快递轨迹
expressStatus: '',
expressCompanyName: '',
};
},
computed: {},
onLoad() {
this.getExpressDetail();
},
methods: {
// 复制物流码
copyCode(code) {
let that = this;
uni.setClipboardData({
data: code,
success: () => {
that.$u.toast('已复制到剪切板');
}
});
},
// 获取物流信息
getExpressDetail() {
let that = this;
that.$http('order.expressDetail', {
id: that.$Route.query.expressId,
order_id: that.$Route.query.orderId
}).then(res => {
if (res.code === 1) {
that.expressDetail = res.data;
that.goodsList = res.data.item;
that.exrpessLog = res.data.log;
that.trackList = res.data.trackList || [];
that.expressStatus = res.data.expressStatus || '';
that.expressCompanyName = res.data.expressCompanyName || '';
that.firstGoods = res.data.item[0];
}
});
}
}
};
</script>
<style lang="scss">
/* 物流卡片 */
.oilStation-top {
justify-content: center;
align-items: center;
flex-direction: column;
background: #fff;
margin: 20rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0 1rpx 18rpx 0 rgba(184, 184, 184, 0.55);
border-radius: 20rpx;
.express-card__head {
padding: 20rpx;
}
.img-box {
position: relative;
width: 129rpx;
height: 129rpx;
border-radius: 20rpx;
overflow: hidden;
background: #ccc;
.goods-image {
width: 129rpx;
height: 129rpx;
}
}
.shop-tag {
position: absolute;
width: 129rpx;
height: 30rpx;
background: rgba(0, 0, 0, 0.6);
font-size: 18rpx;
font-weight: 400;
color: rgba(255, 255, 255, 1);
text-align: center;
bottom: 0;
z-index: 5;
}
.express-status {
font-size: 30rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
margin-left: 20rpx;
}
.express-company {
font-size: 22rpx;
color: rgba(102, 102, 102, 1);
margin-left: 20rpx;
margin-top: 8rpx;
}
.express-sn {
width: 100%;
// height: 65rpx;
background: rgba(250, 251, 255, 1);
border-radius: 0 0 20rpx 20rpx;
font-size: 24rpx;
font-weight: 500;
color: rgba(102, 102, 102, 1);
padding: 30rpx;
}
}
.oilStation-bottom {
justify-content: space-between;
align-items: center;
flex-direction: row;
background: #fff;
width: 710rpx;
margin: 0 20rpx 20rpx;
border-radius: 20rpx;
box-shadow: 0 1rpx 18rpx 0 rgba(184, 184, 184, 0.55);
padding: 0 30rpx;
}
// 物流步骤条
.no-log {
width: 100%;
height: 100rpx;
color: #999;
}
.express-item {
align-items: flex-start;
.item-left {
.day {
font-size: 26rpx;
white-space: nowrap;
}
.time {
font-size: 20rpx;
white-space: nowrap;
}
}
.item-right {
position: relative;
padding-left: 54rpx;
margin-left: 54rpx;
border-left: 1rpx solid #e7e7e7;
padding-bottom: 40rpx;
.express-tag {
width: 54rpx;
height: 54rpx;
position: absolute;
left: -27rpx;
top: 0;
}
.express-title {
font-size: 28rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
margin-bottom: 10rpx;
}
.express-detail {
width: 400rpx;
font-size: 24rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
}
}
</style>

查看文件

@@ -0,0 +1,114 @@
<!-- 物流分包 -->
<template>
<view class="express-list-wrap u-p-b-30">
<view class="tip-box u-flex u-col-center u-p-x-20">{{ expressList.length }}个包裹已发出</view>
<view class="express-list u-m-b-20" v-for="express in expressList" :key="express.id" @tap="toExpressDetail(express.id)">
<view class="u-flex u-row-between list-head u-p-x-20">
<text class="list-status" v-if="express.log.length">{{ express.log[0].status_name }}</text>
<view class="express-name">{{ express.express_name }}:{{ express.express_no }}</view>
</view>
<view class="list-content u-p-20">
<view class="express-detail u-m-b-20" v-if="express.log.length">{{ express.log[0].content }}</view>
<view class="goods-box u-flex u-col-center">
<view class="goods-img-box" v-for="img in express.item" :key="img.id"><image class="goods-img" :src="img.goods_image" mode="aspectFill"></image></view>
</view>
<view class="all-goods">共{{ express.item.length }}件商品</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
expressList: []
};
},
computed: {},
onLoad() {
this.getExpressList();
},
methods: {
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
},
// 物流详情
toExpressDetail(id) {
this.jump('/pages/order/express/express-detail', { orderId: this.$Route.query.orderId, expressId: id });
},
// 包裹列表
getExpressList() {
let that = this;
that.$http('order.expressList', {
order_id: that.$Route.query.orderId
}).then(res => {
if (res.code === 1) {
that.expressList = res.data;
}
});
}
}
};
</script>
<style lang="scss">
.tip-box {
width: 750rpx;
height: 84rpx;
font-size: 30rpx;
font-weight: 500;
color: rgba(168, 112, 13, 1);
background: rgba(255, 226, 182, 1);
}
// 物流包裹
.express-list {
background-color: #fff;
.list-head {
height: 76rpx;
border-bottom: 1rpx solid rgba(223, 223, 223, 0.5);
.list-status {
font-size: 26rpx;
font-weight: 500;
color: rgba(168, 112, 13, 1);
}
.express-name {
font-size: 26rpx;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
}
.list-content {
.express-detail {
font-size: 28rpx;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.goods-box {
flex-wrap: wrap;
.goods-img-box {
width: 160rpx;
height: 160rpx;
overflow: hidden;
margin-right: 22rpx;
margin-bottom: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
.goods-img {
width: 100%;
height: 100%;
}
}
}
}
}
</style>

查看文件

@@ -0,0 +1,351 @@
<!-- 自提点 -->
<template>
<view class="map-box">
<!-- 标题栏 -->
<shopro-navbar>
<view class="search-wrap u-flex" slot="content">
<u-search
class="u-m-r-20"
placeholder="输入自提点名称"
@change="onSearch"
@search="onSearch"
@clear="clearSearch"
v-model="searchVal"
:showAction="false"
height="60"
></u-search>
</view>
</shopro-navbar>
<map id="map" :style="{ width: '750rpx', height: mapHeight + 'px' }" :latitude="latitude" :longitude="longitude" show-location @tap="onMap"></map>
<view class="dragLayer safe-area-inset-bottom" :class="moveCard">
<view class="oilStation">
<!-- 上下箭头 -->
<view class="oilStation-top">
<view class="touch-guide u-flex u-row-center u-col-center" @tap="onShowCard">
<image class="touch-jintou" :src="$IMG_URL + (showCard ? '/imgs/order/arrows2.png' : '/imgs/order/arrows1.png')" mode=""></image>
</view>
</view>
<!-- 自提点列表 -->
<scroll-view class="oilStation-bottom" enable-back-to-top scroll-y @scrolltolower="loadMore">
<view class=" list-content">
<u-radio-group style="width: 100%;" v-model="storeId" active-color="#e9b561">
<view style="width: 100%;" @tap="selStoreAddress(address.id, index)" v-for="(address, index) in addressList" :key="address.id">
<view class="address-item u-flex u-col-center u-row-between">
<view class="address-left">
<!-- 门店 -->
<view class="address-name">{{ address.name }}</view>
<!-- 时间 -->
<view class="time-box ">
<view class=" u-flex u-col-center">
<text class="u-iconfont uicon-clock u-m-r-20" style="color: #999;"></text>
{{ address.openhours }}
</view>
<view class="u-flex u-col-center u-p-l-30 u-m-t-20">
<text v-for="week in address.openweeks_arr" :key="week">{{ weekMap[week] }}、</text>
</view>
</view>
<!-- 地址 -->
<view class="address-detail u-flex u-col-center">
<text class="u-iconfont uicon-map u-m-r-20" style="color: #999;"></text>
{{ address.province_name }}{{ address.city_name }}{{ address.area_name }}{{ address.address }}
</view>
<!-- 电话 -->
<view class="address-phone u-flex u-col-center">
<text class="u-iconfont uicon-phone u-m-r-20" style="color: #999;"></text>
{{ address.phone }}
</view>
</view>
<view class="address-right u-flex-col u-row-center u-col-center">
<u-radio :name="address.id"></u-radio>
<text class="address-distance u-m-t-10">{{ address.distance_text || 0 }}</text>
</view>
</view>
</view>
</u-radio-group>
<!-- 更多 -->
<u-loadmore v-if="addressList.length" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
</view>
</scroll-view>
<view class="foot_box u-flex u-row-center u-col-center"><button class="u-reset-button save-btn" @tap="onSave">确认</button></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
longitude: 0,
latitude: 0,
mapHeight: 0,
showCard: false,
moveCard: 'dragLayer-bottom',
distance: 0,
storeId: 0, //默认门店ID
addressList: [], //门店列表
storeInfo: [], //当前门店信息
weekMap: {
1: '周一',
2: '周二',
3: '周三',
4: '周四',
5: '周五',
6: '周六',
7: '周日'
},
loadStatus: 'loadmore',
currentPage: 1,
lastPage: 1,
searchVal: ''
};
},
computed: {},
onLoad(options) {
this.latitude = this.$Route.query.lat;
this.longitude = this.$Route.query.lng;
this.storeId = this.$Route.query.storeId;
this.getStoreAddress();
},
onReady() {
this.editHeight();
},
methods: {
// 选中门店
onSave() {
if (this.storeId) {
uni.$emit('SELECT_STORE', { storeInfo: JSON.stringify(this.storeInfo) });
this.$Router.back();
} else {
this.$u.toast('请选择门店');
}
},
// 搜索
onSearch() {
this.addressList = [];
this.$u.debounce(this.getStoreAddress());
},
// 清除搜索框
clearSearch() {
this.searchVal = '';
this.onSearch();
},
// 设置地图,卡片高度。
editHeight() {
let that = this;
uni.getSystemInfo({
success: res => {
let view = uni
.createSelectorQuery()
.in(this)
.select('.dragLayer');
view.fields(
{
size: true,
scrollOffset: true
},
data => {
that.mapHeight = res.windowHeight - data.height;
//#ifdef APP-PLUS
that.mapHeight = res.windowHeight - data.height - 40;
//#endif
}
).exec();
}
});
},
// 点击地图
onMap() {
this.showCard = false;
this.moveCard = 'dragLayer-bottom';
},
// 选择门店
selStoreAddress(id, index) {
this.storeId = id;
this.latitude = this.addressList[index].latitude;
this.longitude = this.addressList[index].longitude;
this.storeInfo = this.addressList[index];
},
loadMore() {
if (this.currentPage < this.lastPage) {
this.currentPage += 1;
this.getStoreAddress();
}
},
// 获取商品支持的自提点。
getStoreAddress() {
let that = this;
that.loadStatus = 'loading';
that.$http('goods.storeAddress', {
id: that.$Route.query.goodsId,
latitude: that.$Route.query.lat,
longitude: that.$Route.query.lng,
keyword: that.searchVal,
page: that.currentPage,
per_page: 3
}).then(res => {
if (res.code == 1) {
that.addressList = [...that.addressList, ...res.data.data];
that.lastPage = res.data.last_page;
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
if (this.currentPage === 1) {
this.storeId = res.data.data[0].id;
this.storeInfo = res.data.data[0];
}
}
});
},
// 点击显隐
onShowCard() {
this.showCard = !this.showCard;
this.moveCard = this.showCard ? 'dragLayer-top' : 'dragLayer-bottom';
}
}
};
</script>
<style lang="scss">
.search-wrap {
/* #ifdef MP-WEIXIN */
width: 460rpx;
/* #endif */
/* #ifndef MP-WEIXIN */
width: 100%;
/* #endif */
}
/* 浮层 */
.dragLayer {
width: 750rpx;
position: fixed;
z-index: 996;
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
bottom: 0;
box-shadow: 0px 1rpx 18rpx 0px rgba(83, 83, 83, 0.35);
display: flex;
height: 100%;
}
// 点击上下
.dragLayer-bottom {
height: 450rpx !important;
/*#ifdef APP-PLUS */
height: 800rpx !important;
/*#endif*/
transition: all ease-in-out 0.2s;
}
.dragLayer-top {
height: 800rpx !important;
transition: all ease-in-out 0.2s;
}
.oilStation {
width: 690rpx;
margin: 0 30rpx;
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
.oilStation-top {
justify-content: center;
align-items: center;
flex-direction: column;
}
.touch-guide {
justify-content: center;
align-items: center;
height: 100rpx;
}
.touch-jintou {
width: 60rpx;
height: 8rpx;
}
// 确认门店
.foot_box {
height: 100rpx;
background-color: #fff;
.save-btn {
color: #fff;
width: 690rpx;
line-height: 80rpx;
background: linear-gradient(90deg, rgba(233, 181, 97, 1), rgba(238, 204, 138, 1));
box-shadow: 1rpx 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
border-radius: 40rpx;
font-size: 28rpx;
}
}
// 自提点列表
.oilStation-bottom {
justify-content: space-between;
align-items: center;
flex-direction: row;
flex: 1;
height: 100%;
overflow: hidden;
}
.list-content {
background-color: #fff;
overflow-x: hidden;
}
.address-item {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #eef1f4;
padding: 15rpx 0 15rpx;
width: 100%;
justify-content: space-between;
align-items: center;
flex-direction: row;
}
.address-name {
font-size: 30rpx;
font-weight: 600;
color: rgba(51, 51, 51, 1);
margin-bottom: 30rpx;
}
.time-box,
.address-detail,
.address-phone {
flex-direction: row;
align-items: center;
font-size: 24rpx;
font-weight: 400;
color: #666;
margin-bottom: 20rpx;
}
.address-icon {
color: #bdbdbd;
margin-right: 10rpx;
font-size: 30rpx;
}
.address-left {
flex: 1;
}
.address-right {
align-items: center;
color: #a8700e;
font-size: 24rpx;
margin-bottom: 20rpx;
white-space: nowrap;
}
.more {
width: 750rpx;
height: 90rpx;
justify-content: center;
align-items: center;
}
.more-text {
font-size: 24rpx;
color: #ccc;
}
</style>