调整地址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. 25
      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. 56
      physical-merchants/settleAccounts/settleAccounts.vue

@ -3,9 +3,9 @@
<!-- v-if="specificationList.length>0" --> <!-- v-if="specificationList.length>0" -->
<view class="choose-detail" > <view class="choose-detail" >
<view class="choose-top"> <view class="choose-top" >
<view class="marRight10"> <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>
<view class="choose-price marRight10"> <view class="choose-price marRight10">
<text class="" style="text-decoration: line-through;">原价¥{{specificationList[chooseIndex].originalPrice}}</text> <text class="" style="text-decoration: line-through;">原价¥{{specificationList[chooseIndex].originalPrice}}</text>
@ -44,7 +44,7 @@
</view> </view>
<view class="choose-select"> <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)"> <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 paddtright15 font13"> {{item.name}}</view>
<view class="padleft15 paddtright5 fontwig6 font13 fcor999">{{item.price}}</view> <view class="padleft15 paddtright5 fontwig6 font13 fcor999">{{item.price}}</view>
<view class="padleft15 paddtright5 font13 ">库存{{item.stock}}</view> <view class="padleft15 paddtright5 font13 ">库存{{item.stock}}</view>
@ -365,9 +365,9 @@
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
padding-bottom: 20rpx; padding-bottom: 20rpx;
.choose-way{ .choose-way{
height: 70rpx; height: 80rpx;
width: 100%; width: 100%;
border-radius: 35rpx; border-radius: 40rpx;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
@ -375,15 +375,15 @@
.way{ .way{
width: 50%; width: 50%;
height:70rpx; height:80rpx;
line-height:70rpx; line-height:80rpx;
text-align: center; text-align: center;
} }
.way1{ .way1{
width: 100% ; width: 100% ;
height: 70rpx; height: 80rpx;
line-height: 70rpx; line-height: 80rpx;
text-align: center; text-align: center;
} }

@ -1,6 +1,7 @@
<template> <template>
<view style="height: 100%;"> <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" :lower-threshold="lowerThreshold" @scrolltolower="handleScrolltolower" @touchstart="handleTouchStart"
@touchmove.stop.prevent="handleTouchMove" @touchend="handleTouchEnd" @touch.stop> @touchmove.stop.prevent="handleTouchMove" @touchend="handleTouchEnd" @touch.stop>
<!-- @touchmove.stop.prevent --> <!-- @touchmove.stop.prevent -->
@ -76,8 +77,8 @@
<scroll-view v-if="typeList=='goodsSearch'" :scroll-y="true" class="ht-auto goods-list" <scroll-view v-if="typeList=='goodsSearch'" :scroll-y="true" class="ht-auto goods-list"
@scrolltolower="scroll_lower" lower-threshold="30"> @scrolltolower="scroll_lower" lower-threshold="30">
<view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;height:100%'"> <!-- <view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;'"> -->
<view v-if="(propData || null) != null && propData.length > 0" class="oh"> <view v-if="(propData || null) != null && propData.length > 0" >
<view v-for="(item, index) in propData" :key="index"> <view v-for="(item, index) in propData" :key="index">
<view @click="goGoodsDetail(item.id)" class="goods-item bs"> <view @click="goGoodsDetail(item.id)" class="goods-item bs">
@ -102,6 +103,7 @@
</view> </view>
</view> </view>
</view> </view>
<noMore :bgColor="'#ffffff'"></noMore> <noMore :bgColor="'#ffffff'"></noMore>
</view> </view>
<!-- --> <!-- -->
@ -110,7 +112,7 @@
<!-- <text class="empty-text">{{ emptyText }}</text> --> <!-- <text class="empty-text">{{ emptyText }}</text> -->
</view> </view>
</view> <!-- </view> -->
@ -122,7 +124,7 @@
<!-- cartNum --> <!-- cartNum -->
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum+''" type="warning" <uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum+''" type="warning"
size="small" /> size="small" />
<view class="icon cart font30px"> <view class="icon cart font40">
</view> </view>
</view> </view>
@ -197,9 +199,6 @@
}, },
mounted() { mounted() {
this.handleInit(); this.handleInit();
}, },
props: { props: {
propData: { propData: {
@ -228,10 +227,10 @@
typeList: { typeList: {
type: String, type: String,
default: "classify" default: "classify"
} },
}, },
watch: { watch: {
selectObject: { selectObject: {
handler(n, o) { handler(n, o) {
if (n.selectIndex == n.length - 1) { if (n.selectIndex == n.length - 1) {
@ -486,9 +485,13 @@
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
right: 25px; right: 25px;
width: 30px; width: 35px;
height: 30px; height: 35px;
color: #3DA7E7 !important; color: #3DA7E7 !important;
.font40{
font-size: 35px !important;
color: #F0AD4E;
}
} }
@ -498,10 +501,6 @@
right: -10px; right: -10px;
} }
.font30px {
font-size: 30px !important;
color: #F0AD4E;
}
// //
.br { .br {
@ -602,7 +601,7 @@
line-height: 80rpx; line-height: 80rpx;
color: #3DA7E7; color: #3DA7E7;
text-align: center; text-align: center;
font-size: 40rpx; font-size: 50rpx;
} }
@ -633,6 +632,7 @@
.scroll-content1 { .scroll-content1 {
width: 100%; width: 100%;
padding-bottom: 40px;
// position: relative; // position: relative;
// height: inherit; // height: inherit;
.empty-view { .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-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"> <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"> <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> </view>
</block> </block>
</block> </block>
@ -78,7 +78,7 @@
:key="index" :key="index"
> >
</skeleton> </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="spinner">
<view class="dot"></view> <view class="dot"></view>
<view class="dot"></view> <view class="dot"></view>
@ -145,7 +145,7 @@
sortOrder:0,//12 sortOrder:0,//12
// cartNum:app.globalData.cartNum, // cartNum:app.globalData.cartNum,
hackReset:false,//
isLoading:false, isLoading:false,
skeletonNum:[1,2,3,4], skeletonNum:[1,2,3,4],
@ -160,10 +160,15 @@
}, },
onShow(){ onShow(){
this.hackReset = false; this.$nextTick(()=>{
this.$nextTick(() => { if(this.$refs.goodsList){
this.hackReset = true; this.$refs.goodsList.refreshCartNum()
}
}) })
}, },
methods:{ methods:{
// //
@ -275,7 +280,7 @@
_this.pageData.allData = res.return_data.total; _this.pageData.allData = res.return_data.total;
_this.pageData.navigateLastPage = res.return_data.navigateLastPage; _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 { .spinner {
width: 60px; width: 60px;

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

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

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

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

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

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

Loading…
Cancel
Save