调整地址bug,cartChoose,样式

master
游梦婷 2 years ago
parent 923e854bd0
commit fd129037e3
  1. 18
      components/cart-choose/cart-choose.vue
  2. 34
      components/goods-list/goods-list.vue
  3. 27
      pages/tabBar/classify/classify.vue
  4. 9
      physical-merchants/address/addNewAddress/addNewAddress.vue
  5. 28
      physical-merchants/address/address.vue
  6. 17
      physical-merchants/classify/cart/cart.vue
  7. 13
      physical-merchants/classify/goods-search/goods-search.vue
  8. 14
      physical-merchants/classify/goodsDetail/goodsDetail.vue
  9. 58
      physical-merchants/settleAccounts/settleAccounts.vue

@ -3,9 +3,9 @@
<!-- v-if="specificationList.length>0" -->
<view class="choose-detail" >
<view class="choose-top">
<view class="choose-top" >
<view class="marRight10">
<image v-if="specificationList[chooseIndex].showImg" :src="imageUrl+specificationList[chooseIndex].showImg" @click="perImage(chooseIndex,imgList)" class="img choose-img " mode="aspectFill"></image>
<image v-if="specificationList[chooseIndex].showImg" :src="imageUrl+specificationList[chooseIndex].showImg" @click="perImage(chooseIndex,[imageUrl+specificationList[chooseIndex].showImg])" class="img choose-img " mode="aspectFill"></image>
</view>
<view class="choose-price marRight10">
<text class="" style="text-decoration: line-through;">原价¥{{specificationList[chooseIndex].originalPrice}}</text>
@ -44,7 +44,7 @@
</view>
<view class="choose-select">
<view v-for="(item,index) in specificationList" :key="index" :data-index="index" :class="'choose-item padleft10 mart10 '+ (chooseIndex == index ? 'choose-active':'')" @click="select(index)">
<image v-if="item.showImg" :src="imageUrl+item.showImg" class="img "></image>
<image v-if="item.showImg" :src="imageUrl+item.showImg" @click="perImage(0,[imageUrl+item.showImg])" class="img "></image>
<view class="padleft15 paddtright15 font13"> {{item.name}}</view>
<view class="padleft15 paddtright5 fontwig6 font13 fcor999">{{item.price}}</view>
<view class="padleft15 paddtright5 font13 ">库存{{item.stock}}</view>
@ -365,9 +365,9 @@
width: calc(100% - 40rpx);
padding-bottom: 20rpx;
.choose-way{
height: 70rpx;
height: 80rpx;
width: 100%;
border-radius: 35rpx;
border-radius: 40rpx;
overflow: hidden;
display: flex;
align-items: center;
@ -375,15 +375,15 @@
.way{
width: 50%;
height:70rpx;
line-height:70rpx;
height:80rpx;
line-height:80rpx;
text-align: center;
}
.way1{
width: 100% ;
height: 70rpx;
line-height: 70rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
}

@ -1,6 +1,7 @@
<template>
<view style="height: 100%;">
<scroll-view v-if="typeList=='classify'" style="perspective: 1000;" class="scroll-view goods-list" :scroll-top="scrollTop" :scroll-y="true"
<!-- perspective: 1000; -->
<scroll-view v-if="typeList=='classify'" class="scroll-view goods-list" :scroll-top="scrollTop" :scroll-y="true"
:lower-threshold="lowerThreshold" @scrolltolower="handleScrolltolower" @touchstart="handleTouchStart"
@touchmove.stop.prevent="handleTouchMove" @touchend="handleTouchEnd" @touch.stop>
<!-- @touchmove.stop.prevent -->
@ -76,8 +77,8 @@
<scroll-view v-if="typeList=='goodsSearch'" :scroll-y="true" class="ht-auto goods-list"
@scrolltolower="scroll_lower" lower-threshold="30">
<view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;height:100%'">
<view v-if="(propData || null) != null && propData.length > 0" class="oh">
<!-- <view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;'"> -->
<view v-if="(propData || null) != null && propData.length > 0" >
<view v-for="(item, index) in propData" :key="index">
<view @click="goGoodsDetail(item.id)" class="goods-item bs">
@ -102,6 +103,7 @@
</view>
</view>
</view>
<noMore :bgColor="'#ffffff'"></noMore>
</view>
<!-- -->
@ -110,7 +112,7 @@
<!-- <text class="empty-text">{{ emptyText }}</text> -->
</view>
</view>
<!-- </view> -->
@ -122,7 +124,7 @@
<!-- cartNum -->
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum+''" type="warning"
size="small" />
<view class="icon cart font30px">
<view class="icon cart font40">
</view>
</view>
@ -197,9 +199,6 @@
},
mounted() {
this.handleInit();
},
props: {
propData: {
@ -228,10 +227,10 @@
typeList: {
type: String,
default: "classify"
}
},
},
watch: {
selectObject: {
handler(n, o) {
if (n.selectIndex == n.length - 1) {
@ -486,9 +485,13 @@
position: absolute;
bottom: 10px;
right: 25px;
width: 30px;
height: 30px;
width: 35px;
height: 35px;
color: #3DA7E7 !important;
.font40{
font-size: 35px !important;
color: #F0AD4E;
}
}
@ -498,10 +501,6 @@
right: -10px;
}
.font30px {
font-size: 30px !important;
color: #F0AD4E;
}
//
.br {
@ -602,7 +601,7 @@
line-height: 80rpx;
color: #3DA7E7;
text-align: center;
font-size: 40rpx;
font-size: 50rpx;
}
@ -633,6 +632,7 @@
.scroll-content1 {
width: 100%;
padding-bottom: 40px;
// position: relative;
// height: inherit;
.empty-view {

@ -45,7 +45,7 @@
<block v-if="(data_content || null) != null && (data_content.children || null) != null && data_content.children.length > 0">
<block v-for="(item, index) in data_content.children" :key="index">
<view :class="'dis-flex flex-center item ' + (nav_active_item_two_index == index ? 'active-class active-border nav-active' : '')" :data-index="nav_active_index" :data-itemtwoindex="index" @click="nav_event">
<image v-if="item.img" style="height: 20px;width: 20px;" :src="imageUrl+item.img" mode="aspectFit"></image> <text class="">{{item.title || ''}}</text>
<image v-if="item.img" class="item-img" :src="imageUrl+item.img" mode="aspectFit"></image> <text class="">{{item.title || ''}}</text>
</view>
</block>
</block>
@ -78,7 +78,7 @@
:key="index"
>
</skeleton>
<goodsList v-if="hackReset&&!isLoading" :propData="goodsListData" :pageData="pageData" :selectObject="selectObject" @loadData="loadData" @switchCategory="switchCategory" :paddBottom="0" ></goodsList>
<goodsList v-if="!isLoading" ref="goodsList" :hackReset="true" :propData="goodsListData" :pageData="pageData" :selectObject="selectObject" @loadData="loadData" @switchCategory="switchCategory" :paddBottom="0" ></goodsList>
<!-- <view class="spinner">
<view class="dot"></view>
<view class="dot"></view>
@ -145,7 +145,7 @@
sortOrder:0,//12
// cartNum:app.globalData.cartNum,
hackReset:false,//
isLoading:false,
skeletonNum:[1,2,3,4],
@ -160,10 +160,15 @@
},
onShow(){
this.hackReset = false;
this.$nextTick(() => {
this.hackReset = true;
})
this.$nextTick(()=>{
if(this.$refs.goodsList){
this.$refs.goodsList.refreshCartNum()
}
})
},
methods:{
//
@ -275,7 +280,7 @@
_this.pageData.allData = res.return_data.total;
_this.pageData.navigateLastPage = res.return_data.navigateLastPage;
console.log(_this.pageData)
// console.log(_this.pageData)
}
@ -381,7 +386,11 @@
/*
*/
.item-img{
height: 40rpx;
width:40rpx;
margin-right: 12rpx;
}
.spinner {
width: 60px;

@ -251,14 +251,7 @@
})
},
backPageRefresh() {
let pages = getCurrentPages(); //
let beforePage = pages[pages.length - 2]; //
uni.navigateBack({
success:function(){
beforePage.$vm.initData();
// console.log("!");
}
})
uni.navigateBack({})
},
addAddress(){
let _this = this;

@ -60,9 +60,7 @@
},
data() {
return {
addressId: [
111, 222, 333, 444
],
selectId: 0,
addressList: [],
status: 0, //
@ -84,6 +82,7 @@
title: '加载中',
mask:true,
});
this.addressList=[];
getDeliveryAddressList().then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
@ -218,17 +217,20 @@
},
chooseAddress(addressItem) {
console.log(addressItem, "addressItem")
if (this.status == 1) {
let pages = getCurrentPages(); //
let beforePage = pages[pages.length - 2]; //
uni.navigateBack({
success: function() {
beforePage.$vm.getRegiFreight(addressItem);
console.log("返回成功!");
}
})
// let pages = getCurrentPages(); //
// let beforePage = pages[pages.length - 2]; //
// uni.navigateBack({
// success: function() {
// beforePage.$vm.getRegiFreight(addressItem);
// }
// })
uni.$emit('address',addressItem);
uni.navigateBack({})
}

@ -60,7 +60,7 @@
</scroll-view>
<view v-if="cartList.length==0" class="empy-cart fcor666 fotct cart-list backcor9">
<view v-else class="empy-cart fcor666 fotct cart-list backcor9">
<view class="icon cart fcor666 font48"></view>
<view class=" mart30">
购物车内暂无商品快去逛逛吧
@ -217,13 +217,14 @@
uni.showLoading({
title: '加载中',
mask:true,
duration:2000
});
getShoppingCartList().then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
console.log(res.return_data)
this.allCheck.whetherCheck = false;
this.cartList = res.return_data;
this.allCheckInit();
// this.allCheckInit();
} else {
uni.showToast({
@ -314,10 +315,8 @@
//
const goods = this.cartList.every(item => {
if (!this.isEdit) { //
if (item.loseEfficacy) {
if (!this.isEdit&&item.loseEfficacy) { //
return true;
}
}
return item.whetherCheck === true
})
@ -376,7 +375,7 @@
let selestArr = this.cartList.filter(item => item.whetherCheck == true)
selestArr = JSON.stringify(selestArr)
// console.log(selestArr)
// console.log(selestArr,"")
uni.navigateTo({
url: '/physical-merchants/settleAccounts/settleAccounts?goodsList=' + selestArr
})
@ -391,7 +390,7 @@
},
//
swipe_opt_event(e, id) {
console.log(e, "dianji")
// console.log(e, "dianji")
if (e.index == 1) { //
@ -415,7 +414,7 @@
},
//
swipe_change(e, id) {
console.log(e, id)
// console.log(e, id)
// this.swipe_item_index= (e == 'none') ? null : v
},

@ -10,7 +10,7 @@
</block>
<!-- 搜索列表 -->
<view class="search-list">
<goodsList v-if="hackReset" typeList="goodsSearch" @loadData="loadData" :propData="data_list" :paddBottom="0">
<goodsList ref="goodsList" typeList="goodsSearch" @loadData="loadData" :propData="data_list" :paddBottom="0">
</goodsList>
</view>
@ -38,7 +38,7 @@
navigateLastPage: 1, //
allData: 0 //
},
hackReset:false,
}
},
components: {
@ -46,9 +46,10 @@
goodsList
},
onShow(){
this.hackReset = false;
this.$nextTick(() => {
this.hackReset = true;
this.$nextTick(()=>{
if(this.$refs.goodsList){
this.$refs.goodsList.refreshCartNum()
}
})
},
methods: {
@ -125,7 +126,7 @@
.search-list {
height: calc(100vh - 50px);
height: calc(100vh - 80px);
// padding: 20rpx;
}
}

@ -4,7 +4,7 @@
<view class="swiper-box">
<swiper circular="true" :autoplay="false" style="height: 288px;" @change="swiperChange">
<swiper-item class="fotct" v-for="(swiper,index) in goodsDetail.bannerImg" :key="index">
<image mode="heightFix" :src="swiper" @click="perImage(index,goodsDetail.bannerImg)"></image>
<image mode="heightFix" style="height: 100%;" :src="swiper" @click="perImage(index,goodsDetail.bannerImg)"></image>
</swiper-item>
</swiper>
<view class="indicator">{{currentSwiper+1}}/{{goodsDetail.bannerImg.length}}</view>
@ -591,13 +591,13 @@
//popUp
.choose-detail {
position: relative;
padding: 20rpx;
//
&.baozhang-detail {
padding-top: 30px;
padding:30px 10px 10px;
box-sizing: border-box;
height: 100%;
height:calc(100% - 100rpx);
.baozhangTitle {}
@ -609,9 +609,9 @@
position: fixed;
bottom: 20rpx;
width: calc(100% - 40rpx);
height: 60rpx;
line-height: 60rpx;
border-radius: 30rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
text-align: center;
background: linear-gradient(to right, #FF8E01, #FD5100);

@ -209,7 +209,8 @@
getAddressPrice,
getUserExclusiveDiscount,
createOrder,
findUser
findUser,
findDeliveryAddressById
} from '@/Utils/physicalObject.js'
import {
getThirdPartyByDetail
@ -225,6 +226,7 @@
isMoreThanOne: false, //
goodsList: [], //
haveAddress: false, //
isFirstSearchAddress:true,
addressDetail: null, //
postPrice: null, //
@ -390,18 +392,53 @@
if (this.goodsList.length > 1) {
this.isMoreThanOne = true;
}
//
uni.$on('address',(addressDetail)=>{
this.addressDetail = addressDetail;
this.getRegiFreight(addressDetail);
console.log(addressDetail,"监听")
})
},
onShow() {
this.getAddrPrice() //
onUnload() {
//
uni.$off('address');
},
onShow() {
this.getUserDiscount() //
this.findUser() //
this.getAddrPrice() //
if(this.addressDetail&&!this.isFirstSearchAddress){
console.log(this.addressDetail,"123456")
let params = {
id:this.addressDetail.id
}
findDeliveryAddressById(params).then(res=>{
// console.log(res)
if (res.return_code == '000000') {
}else{ //
this.isFirstSearchAddress=true;
this.haveAddress = false;
this.addressDetail = null;
this.getAddrPrice();
}
})
}
},
methods: {
//
getRegiFreight(addressDetail) {
this.haveAddress = true;
async getRegiFreight(addressDetail) {
// console.log(addressDetail,"addressDetail")
this.addressDetail = addressDetail;
this.haveAddress = true;
let params = {
regionId: addressDetail.regionId
}
@ -420,7 +457,8 @@
},
//
getAddrPrice() {
if(this.haveAddress){
if(!this.isFirstSearchAddress&&this.addressDetail){
return
}
@ -428,15 +466,15 @@
title: '加载中',
mask: true,
});
getAddressPrice().then(res => {
uni.hideLoading();
this.isFirstSearchAddress = false;
if (res.return_code == '000000') {
if (res.return_data) {
this.getRegiFreight(res.return_data.deliveryAddress)
}
} else {
this.haveAddress = false;
// uni.showToast({
// title: res.return_msg,
// icon: 'none',
@ -572,7 +610,7 @@
let yhqID = this.yhqId
this.$refs.detailPopup.show(str, this.goodsList,yhqID);
} else if (str == 'freight') {
if (!this.postPrice) {
if (!this.addressDetail&&!this.haveAddress) {
uni.showToast({
title: '请先选择地址',
duration: 1000,
@ -595,7 +633,7 @@
},
// ,
settleAccount() {
if (!this.addressDetail) {
if (!this.addressDetail&&!this.haveAddress) {
uni.showToast({
title: '请选择地址',
duration: 1000,

Loading…
Cancel
Save