第一次提交

This commit is contained in:
wangxiaowei
2025-06-11 10:21:51 +08:00
commit 52932d54b1
2341 changed files with 185283 additions and 0 deletions

View File

@ -0,0 +1,239 @@
<template>
<view :class="theme() || ''" :data-theme='theme()'>
<view v-if="Visible" class="pop_bg" @click="closeFunc"></view>
<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: 600rpx;">
<view class="p20 address-item" v-for="(item,index) in storeList" :key="index">
<view :class="item.store_id == selectedId?'active':''" class="address d-s-c">
<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>{{item.distance_unit}}</view>
</view>
</view>
</view>
<!-- 无数据提供的页面 -->
<view v-if="!isLoading && !storeList.length">
<view class="yoshop-notcont">
<text class="iconfont icon-wushuju"></text>
<text class="cont">暂无自提门店哦</text>
</view>
</view>
</scroll-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','chooseSotr'],
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;
console.log(this.selectedId)
/*获取地址列表*/
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,
shop_supplier_id:self.$props.chooseSotr,
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
}
});
},
closeFunc(){
this.$emit('close',null);
},
/* 选择门店 */
onSelectedStore(e) {
let self = this;
self.selectedId = e;
// 设置上级页面的门店id
self.$fire.fire('selectStoreId',e);
this.$emit('close',e);
}
}
}
</script>
<style lang="scss">
.pop_bg{
width: 100%;
height: 100%;
position: fixed;
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%;
display: block;
z-index: 101;
}
.address-distr_close{
position: absolute;
bottom: env(safe-area-inset-bottom);
left: 0;
width: 100%;
display: none;
}
.yoshop-notcont{
padding: 0 25rpx;
padding-bottom: 20rpx;
}
</style>

View File

@ -0,0 +1,179 @@
<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*1 }}</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>
.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%;
bottom: 0;
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%;
bottom: 0;
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: 10rpx 30rpx;
}
</style>

View File

@ -0,0 +1,137 @@
<template>
<view :class="Visible ? 'usable-distr open' : 'usable-distr close'">
<view class="popup-bg" @click="closePopup"></view>
<view class="main pt30" v-on:click.stop>
<view class="distr-tit">配送方式</view>
<view v-if="hasType('10')" class="distr-list bor_botm" @click="radioChange(10)">
<view>普通配送</view>
<view class="radio">
<radio :value="'1'" :checked="checked_id==10" /><text></text>
</view>
</view>
<view v-if="hasType('20')" @click="radioChange(20)">
<view class="distr-list">
<view>自提门店</view>
<view class="radio">
<radio :value="'2'" :checked="checked_id==20" /><text></text>
</view>
</view>
<Storeinfo ref="getShopinfoData" :extract_store="extract_store" :chooseSotr="chooseSotr" :last_extract="last_extract" style="flex: 1;"></Storeinfo>
</view>
<view class="distr_btn">
<button class="theme-btn" @click="closePopup">完成</button>
</view>
</view>
</view>
</template>
<script>
import Storeinfo from './store-info';
export default {
data() {
return {
/*是否可见*/
Visible: false,
checked_id: 10,
choose_store_id: 0
}
},
components: {
Storeinfo,
},
props: ['isDist', 'extract_store', 'last_extract', 'deliverySetting','chooseSotr'],
watch: {
isDist(val) {
this.Visible = val;
}
},
onLoad(options) {
let self = this;
self.options = options;
},
methods: {
closePopup(e) {
if (this.checked_id == 20 && this.$props.extract_store.store_id == null) {
uni.showToast({
icon: 'none',
title: '请选择自提点'
})
} else {
this.$emit('close', this.checked_id);
}
},
radioChange(n) {
let self = this;
self.checked_id = n;
self.$fire.fire('checkedfir', n);
},
hasType(n){
return this.deliverySetting.indexOf(n)!= -1;
}
}
}
</script>
<style>
.usable-distr .popup-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
}
.usable-distr .main {
position: fixed;
width: 100%;
bottom: 0;
min-height: 400rpx;
max-height: 1400rpx;
background-color: #fff;
transform: translate3d(0, 980rpx, 0);
transition: transform 0.2s cubic-bezier(0, 0, 0.25, 1);
padding-bottom: env(safe-area-inset-bottom);
z-index: 99;
}
.usable-distr.open .main {
transform: translate3d(0, 0, 0);
}
.usable-distr.close .popup-bg {
display: none;
}
.distr-tit {
text-align: center;
font-size: 39rpx;
margin-top: 23rpx;
margin-bottom: 70rpx;
}
.distr-list {
padding: 25rpx;
margin-bottom: 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.bor_botm {
border-bottom: 1rpx solid #cacaca;
}
.distr_btn button {
width: 90%;
margin: 0 auto;
margin-bottom: 30rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 30rpx;
}
</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,97 @@
<template>
<view style="flex: 1;">
<!--地址-->
<template v-if="!extract_store.store_id">
<view class="d-b-c pr20" @click="addAddress()">
<view class="add-address d-s-c">
<view class="icon-box mr10">
<span class="icon iconfont icon-dizhi1"></span>
</view>
<text>请选择自提点</text>
</view>
<view>
<i class='iconfont icon-jiantou'></i>
</view>
</view>
</template>
<template v-else>
<view class="d-b-c pr20" @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' :chooseSotr='chooseSotr' :store_id='store_id' @close="closeAdress"></Adress>
<!-- <view class="addree-bottom">
<view class="stripe" v-for="(item, index) in 10" :key="index">
<text :class="index % 2 == 0 ? 'red' : 'blue'"></text>
<text class="white"></text>
</view>
</view> -->
</view>
</template>
<script>
import Adress from './address/address';
export default {
data() {
return {
isAddress: false,
store_id: 0
};
},
components: {
Adress,
},
props: ['extract_store', 'last_extract','chooseSotr'],
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;
}
}
};
</script>
<style scoped>
.buy-checkout.vender .item .key {
width: 200rpx;
}
.pr20 {
padding-right: 20rpx;
padding-bottom: 60rpx;
}
</style>