first commit

This commit is contained in:
wangxiaowei
2025-10-22 22:56:36 +08:00
commit 90c54df48b
302 changed files with 54312 additions and 0 deletions

View File

@ -0,0 +1,241 @@
<template>
<view class="pop_bg" v-if="Visible" @click="closepop" :data-theme='theme()' :class="theme() || ''">
<view :class="Visible ? 'address-distr_open' : 'address-distr_close'">
<view class="address-list bg-white">
<scroll-view scroll-y="true" class="specs mt20" style="max-height: 850rpx;">
<view class="p20 address-item" v-for="(item,index) in storeList" :key="index">
<view class="address d-s-c" :class="item.store_id == selectedId?'active':''">
<view class="info flex-1" @click="onSelectedStore(item)">
<view class="user f34">
<text>{{item.store_name}}</text>
</view>
<view class="pt10 user f30 gray6">
<text>{{item.phone}}</text>
</view>
<view class="pt10 f24 gray6">
<text> {{item.region.province}}{{item.region.city}}{{item.region.region}}{{item.address}}</text>
</view>
<view>
<text class="iconfont icon-dingwei"></text>
<text>{{item.distance_unit}}</text>
</view>
<!-- 选中状态 -->
</view>
</view>
</view>
</scroll-view>
<!-- 无数据提供的页面 -->
<view v-if="!isLoading && !storeList.length">
<view class="yoshop-notcont">
<text class="iconfont icon-wushuju"></text>
<text class="cont">暂无自提门店哦</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
/*数据*/
listData: [],
isLoading: true, // 是否正在加载中
storeList: [], // 门店列表,
longitude: '',
latitude: '',
selectedId: -1,
Visible:false,
url: '',
}
},
props: ['isAddress','store_id'],
watch:{
isAddress(val){
this.Visible=val;
if(val){
//#ifdef H5
if(this.isWeixin()){
this.url = window.location.href;
}
//#endif
// 记录已选中的id
this.selectedId = this.$props.store_id;
/*获取地址列表*/
this.getData(true);
// #ifndef H5
this.getLocation();
// #endif
// #ifdef H5
if(!this.isWeixin()){
this.getLocation();
}
// #endif
}
}
},
methods: {
/**
* 授权启用定位权限
*/
onAuthorize() {
let self = this;
uni.openSetting({
success(res) {
if (res.authSetting["scope.userLocation"]) {
console.log('授权成功');
self.isAuthor = true;
setTimeout(() => {
// 获取用户坐标
self.getLocation((res) => {
});
}, 1000);
}
}
})
},
/**
* 获取用户坐标
*/
getLocation(callback) {
let self = this;
uni.getLocation({
type: 'wgs84',
success(res) {
self.longitude = res.longitude;
self.latitude = res.latitude;
self.getData(false);
},
fail() {
uni.showToast({
title: '获取定位失败,请点击右下角按钮打开定位权限',
duration: 2000,
icon:"none"
});
self.isAuthor=false;
},
})
},
/**
* 公众号获取位置
*/
getWxLocation(signPackage, callback){
let self = this;
var jweixin = require('jweixin-module');
jweixin.config(JSON.parse(signPackage));
jweixin.ready(function(res) {
jweixin.getLocation({
type: 'wgs84',
success: function (res) {
self.longitude = res.longitude;
self.latitude = res.latitude;
self.getData(false);
}
});
});
jweixin.error(function(res){
console.log(res);
});
},
/*获取数据*/
getData(isFirst) {
let self = this;
self.isLoading = true;
self._get('store.store/lists', {
longitude: self.longitude,
latitude: self.latitude,
url: self.url
}, function(res) {
self.isLoading = false;
self.storeList = res.data.list;
// 第一次如果是公众号则初始化微信sdk配置
if(isFirst){
// #ifdef H5
if(self.isWeixin()){
self.getWxLocation(res.data.signPackage);
}
// #endif
}
});
},
closepop(){
this.$emit('close');
},
/* 选择门店 */
onSelectedStore(e) {
let self = this;
self.selectedId = e;
// 设置上级页面的门店id
self.$fire.fire('selectStoreId',e);
this.$emit('close');
}
}
}
</script>
<style lang="scss">
.pop_bg{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: #66666666;
z-index: 100;
}
.address-list {
padding-bottom: 90rpx;
}
.address-item{
border-bottom: 1rpx solid #eeeeee;
}
.address-item:last-child{
border-bottom: none;
}
.foot-btns {
padding: 0;
}
.address {
padding: 24rpx;
}
.address.active {
@include background_color("bg-tips");
}
.closeicon{
position: absolute;
right: 20rpx;
top: 60rpx;
}
.foot-btns .btn-red {
width: 100%;
height: 90rpx;
line-height: 90rpx;
border-radius: 0;
}
.address-distr_open{
/* position: absolute; */
/* bottom: env(safe-area-inset-bottom); */
/* left: 0; */
width: 100%;
position: fixed;
bottom: 0;
display: block;
}
.address-distr_close{
position: absolute;
bottom: env(safe-area-inset-bottom);
left: 0;
width: 100%;
display: none;
}
</style>

View File

@ -0,0 +1,177 @@
<template>
<view :class="Visible ? 'usable-coupon open' : 'usable-coupon close'">
<view class="popup-bg" @click="closePopup(null)"></view>
<view class="main pt30" v-on:click.stop>
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'">
<view class="p-0-30">
<view @click="selectCoupon(item.user_coupon_id)" style="margin-bottom: 15rpx;"
:class="'coupon-item coupon-item-'+item.color.text" v-for="(item, index) in datalist"
:key="index">
<!--装饰用的小圆-->
<view class="circles"><text v-for="(circle, num) in 6" :key="num"></text></view>
<view class="info w100">
<view class="d-c-c d-c">
<text class="f40 fb w-s-n">{{ item.coupon_type.text }}</text>
</view>
</view>
<view class="operation d-b-c w-b pr">
<view class="flex-1 o-h">
<view class="f34">
<template v-if="item.coupon_type.value == 10">
<text class="f40">{{ item.reduce_price*1 }}</text>
</template>
<template v-if="item.coupon_type.value == 20">
<text class="f40">{{ item.discount }}</text>
<text class="f24"></text>
</template>
</view>
<view class=" f24">{{item.min_price>0?'满'+item.min_price*1+'元可用':'无门槛'}}</view>
<view class="mt30 f24 white">{{ item.start_time.text }}~{{ item.end_time.text }}</view>
</view>
<view class="f30 mr20 b-radio" style="position: absolute;right: 0;">
立即使用
</view>
</view>
</view>
</view>
</scroll-view>
<view class="coupon-btns"><button type="default" @click="closePopup(0)" class="btn-cancel">不使用优惠券</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
/*手机高度*/
phoneHeight: 0,
/*可滚动视图区域高度*/
scrollviewHigh: 0,
/*是否可见*/
Visible: false,
/*优惠券列表*/
datalist: {},
/*尺寸比例*/
ratio: 1
};
},
props: ['isCoupon', 'couponList'],
onLoad() {},
mounted() {
this.init();
},
watch: {
isCoupon: function(n, o) {
if (n != o) {
this.Visible = n;
this.datalist = this.couponList;
this.getHeight();
}
}
},
methods: {
/*初始化*/
init() {
let self = this;
uni.getSystemInfo({
success(res) {
self.phoneHeight = res.windowHeight;
self.ratio = res.windowWidth / 750;
self.getHeight();
}
});
},
/*获取高度*/
getHeight() {
let count = Object.keys(this.couponList).length;
if (count > 2) {
this.scrollviewHigh = this.phoneHeight * 0.6;
} else {
if (count == 1) {
this.scrollviewHigh = 230 * this.ratio;
} else if (count == 2) {
this.scrollviewHigh = 460 * this.ratio;
}
}
},
/*选择优惠券*/
selectCoupon(e) {
this.closePopup(e);
},
/*关闭弹窗*/
closePopup(e) {
this.$emit('close', e);
}
}
};
</script>
<style lang="scss" scoped>
.usable-coupon .popup-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
}
.usable-coupon .main {
position: fixed;
width: 100%;
min-height: 200rpx;
background-color: #fff;
transform: translate3d(0, 980rpx, 0);
transition: transform 0.2s cubic-bezier(0, 0, 0.25, 1);
bottom: env(safe-area-inset-bottom);
z-index: 99;
}
.usable-coupon .main {
position: fixed;
width: 100%;
min-height: 200rpx;
background-color: #fff;
transform: translate3d(0, 980rpx, 0);
transition: transform 0.2s cubic-bezier(0, 0, 0.25, 1);
bottom: env(safe-area-inset-bottom);
z-index: 99;
}
.usable-coupon.open .main {
transform: translate3d(0, 0, 0);
}
.usable-coupon.close .popup-bg {
display: none;
}
.coupon-item-red .operation {
/* background: #fdf1df; */
}
.coupon-btns .btn-cancel {
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
background: #999999;
color: #ffffff;
border-radius: 0;
}
.coupon-item .w100 {
padding: 0 75rpx;
}
.b-radio {
border: 1rpx solid #FFFFFF;
border-radius: 30rpx;
padding: 6rpx 20rpx;
}
</style>

View File

@ -0,0 +1,110 @@
<template>
<view class="my_info br6">
<!--地址-->
<view class="add-address d-s-c" @click="addAddress()" v-if="Address==null">
<view class="icon-box mr10">
<text class="icon iconfont icon-dizhi1"></text>
</view>
<text>请添加收货地址</text>
</view>
<view class="address-defalut-wrap" @click="addAddress()" v-else>
<view class="d-b-c">
<view class="add-addr flex-1">
<view class="icon-box mr10 f-s-0">
<text class="icon iconfont icon-dizhi1"></text>
</view>
<view class="flex-1">
<view class="info mb10">
<text class="province-c-a f28 fb text-ellipsis-2">{{Address.region.province}}{{Address.region.city}} {{Address.region.region}}{{Address.detail}}</text>
</view>
<view class="gray9 f22">
<text>{{Address.name}}{{Address.phone}}</text>
</view>
</view>
</view>
<view class="icon iconfont icon-jiantou ml80 f-s-0">
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
props: ['Address', 'exist_address','dis'],
onLoad() {
},
mounted() {
},
methods: {
/*添加地址*/
addAddress() {
if(this.dis){
return
}
let url = '/pages/user/address/address?source=order';
if (!this.exist_address) {
url = '/pages/user/address/add/add?delta=1';
}
this.gotoPage(url);
}
}
}
</script>
<style lang="scss">
.info {
font-size: 33rpx;
line-height: 43rpx;
}
.add-addr {
display: flex;
align-items: center;
}
.tel {
font-size: 27rpx;
color: #999999;
}
.choose-address {
width: 88rpx;
height: 88rpx;
margin-right: 35rpx;
}
.icon-dizhi {
margin-right: 25rpx;
color: #ff6633;
font-size: 60rpx;
}
.addree_icon {
width: 42rpx;
height: 42rpx;
}
.my_info {
background-color: #FFFFFF;
margin-top: 16rpx;
}
.icon-box .icon.icon-dizhi1 {
@include font_color('font_color');
font-size: 44rpx;
}
.my_info .icon.icon-jiantou {
color: #333333;
font-size: 24rpx;
}
</style>

View File

@ -0,0 +1,170 @@
<template>
<view style="flex: 1;" class="br6 mt16">
<view class="bg-white">
<view class="d-b-c m-0-20 border-b-d9 p-20-0" @click="isRevise=true">
<view class="d-s-c" v-if="last_extract.linkman==''&&last_extract.phone==''">
<view class="icon-box mr10 linkmen_add">
<text class="icon iconfont icon-jia"></text>
</view>
<view>添加提货人信息</view>
</view>
<view class="flex-1 d-b-c ww100" v-else>
<view class="flex-1">提货人{{last_extract.linkman}} <text class="ml10">{{last_extract.phone}}</text></view>
<view class="icon-box">
<view class="d-c-c">
<view class="gray9 f26">修改</view>
<view class="icon iconfont icon-jiantou"></view>
</view>
</view>
</view>
</view>
</view>
<!--地址-->
<template v-if="!extract_store.store_id">
<view class="d-b-c pr20 bg-white" @click="addAddress()">
<view class="add-address d-s-c">
<view class="icon-box mr10">
<text class="icon iconfont icon-dizhi1"></text>
</view>
<text>请选择自提点</text>
</view>
</view>
</template>
<template v-if='extract_store.store_id'>
<view class="d-b-c pr20 bg-white" @click="addAddress()">
<view class="address-defalut-wrap">
<view class="info d-s-s">
<text class="state">当前自提点</text>
<view class="province-c-a d-s-s flex-1">
<text>{{ extract_store.region.province }}</text>
<text>{{ extract_store.region.city }}</text>
<text>{{ extract_store.region.region }}</text>
</view>
</view>
<view class="address">
<text class="fb gray3">{{ extract_store.store_name }}</text>
<view class="icon-box"></view>
</view>
<view class="user">
<text class="name">{{ extract_store.address }}</text>
<text class="tel">{{ extract_store.phone }}</text>
</view>
</view>
<view>
<i class='iconfont icon-jiantou'></i>
</view>
</view>
</template>
<Adress :isAddress='isAddress' :store_id='store_id' @close="closeAdress"></Adress>
<uniPopup :show="isRevise" type="middle" @hidePopup="hidePopupFunc">
<view class="ww100">
<view class="t-c f36 pb20">添加提货人</view>
<view class="d-s-c p-30-0 border-b-d9 border-t-d9 f32">提货人 :<input type="text" placeholder="提货人姓名" v-model="last_extract.linkman" /></view>
<view class="d-s-c p-30-0 border-b-d9 f32">手机号:<input type='number' placeholder="提货人手机号" v-model="last_extract.phone" /></view>
<button class="revise_btn" @click="revise">保存</button>
</view>
</uniPopup>
</view>
</template>
<script>
import Adress from './address/address';
import uniPopup from '@/components/uni-popup.vue';
export default {
data() {
return {
isAddress: false,
store_id: 0,
isRevise:false,
linkman:'',
phone:'',
};
},
components: {
Adress,
uniPopup
},
props: ['extract_store', 'last_extract'],
onLoad() {
},
mounted() {
},
methods: {
/*添加地址*/
addAddress() {
let store_id = -1;
if (this.extract_store.store_id) {
store_id = this.extract_store.store_id;
}
this.store_id = store_id
this.isAddress = true;
},
closeAdress() {
this.isAddress = false;
},
revise(){
let params = {
linkman:this.last_extract.linkman,
phone:this.last_extract.phone
}
uni.setStorageSync('extract',params)
this.$fire.fire('extract',params)
this.isRevise=false;
},
hidePopupFunc(){
this.isRevise=false;
}
}
};
</script>
<style scoped lang="scss">
.mt16{
margin-top: 16rpx;
}
.buy-checkout.vender .item .key {
width: 200rpx;
}
.pr20 {
padding-right: 20rpx;
/* padding-bottom: 40rpx; */
}
.icon-box.linkmen_add{
@include background_color('background_color')
width: 38rpx;
height: 38rpx;
border-radius: 8rpx;
display: flex;
justify-content: center;
align-items: center;
}
.icon-box.linkmen_add .icon-jia{
color: #FFFFFF;
font-size: 22rpx;
}
.revise_btn{
@include background_color('background_color')
border: none;
margin-top: 30rpx;
color: #FFFFFF;
}
.t-c{
text-align: center;
}
.m-30-0{
margin: 30rpx 0;
}
.icon.icon-jiantou{
color: #999999;
font-size: 26rpx;
}
.icon-box .icon.icon-dizhi1{
@include font_color('font_color');
font-size: 44rpx;
}
</style>