4/27规格失效,地区回显bug,

master
游梦婷 2 years ago
parent fd129037e3
commit e68187c41e
  1. 3
      Utils/physicalObject.js
  2. 69
      components/cart-choose/cart-choose.vue
  3. 21
      components/goods-list/goods-list.vue
  4. 44
      components/pick-regions/pick-regions.vue
  5. 13
      pages/tabBar/classify/classify.vue
  6. 7
      pages/user/order_list/order_list.vue
  7. 14
      physical-merchants/address/addNewAddress/addNewAddress.vue
  8. 14
      physical-merchants/classify/cart/cart.vue
  9. 26
      physical-merchants/classify/goods-search/goods-search.vue
  10. 2
      physical-merchants/classify/goodsDetail/goodsDetail.vue
  11. 12
      physical-merchants/classify/order/orderDetail.vue
  12. 5
      physical-merchants/classify/order/pay.vue
  13. 12
      physical-merchants/classify/order/wuliuPupup/wuliuPupup.vue
  14. 12
      physical-merchants/settleAccounts/settleAccounts.vue

@ -4,9 +4,10 @@ import {
let app = getApp();
let base = app.globalData.url;
// let base = "http://192.168.1.16:9301/crest/";
// let orderbase = "http://192.168.1.16:9304/order"
let orderbase = app.globalData.orderurl;
// let userbase = app.globalData.userurl;

@ -44,10 +44,11 @@
</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" @click="perImage(0,[imageUrl+item.showImg])" class="img "></image>
<image v-if="item.showImg" :src="imageUrl+item.showImg" @click.stop="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>
<view v-if="item.stock==0" class="qh failureColor" style="">缺货</view>
</view>
@ -61,8 +62,14 @@
</view>
<view class="choose-cart">
<view class="choose-cart" v-if="specificationList[chooseIndex].stock==0">
<view class="choose-way" >
<view class="fcorfff way1 bgcolor-qh" @click="noStock">
暂无库存
</view>
</view>
</view>
<view class="choose-cart" v-else>
<view class="choose-way" v-if="status == 1">
<view class="fcorfff way bgcolor-left" @click="toCart">
@ -84,13 +91,13 @@
</view>
</view>
</view>
</template>
<script>
import uniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue'
// let listData=require("./data.json")
import {insertShoppingCart,getShoppingCartList} from '@/Utils/physicalObject.js'
const app = getApp();
export default {
@ -123,8 +130,22 @@
specificationList:{
handler(n,o){
this.chooseNumber = 1;
this.isAllFailure = false;
this.chooseIndex = 0;
for(let i=0;i<n.length;i++){
if(n[i].stock>0){
this.chooseIndex = i;
return
}
// if(i == n.length-1){
// this.isAllFailure = true;
// this.chooseIndex = 0
// }
}
},
deep:true
deep:true,
}
},
components:{
@ -156,7 +177,13 @@
urls: imgList //
})
},
/* 暂无库存 */
noStock(){
uni.showToast({
title:'暂无库存哟,看看别的吧!',
icon: 'none'
})
},
changeNumValue(v){
this.chooseNumber = v;
@ -164,7 +191,7 @@
noMoreLess(){
uni.showToast({
icon: 'none',
title: "低于最少买件数",
title: "低于最少买件数",
duration: 1000
});
},
@ -228,6 +255,9 @@
//
select(index){
this.chooseIndex = index;
if(this.chooseNumber>this.specificationList[this.chooseIndex].stock){
this.chooseNumber = this.specificationList[this.chooseIndex].stock
}
},
//
@ -245,6 +275,24 @@
<style lang="scss" scoped>
//
.failureColor{
color: #c5c5c5;
}
/* 缺货 */
.qh{
position: absolute;
top: -15rpx;
right: -30rpx;
background-color: #ffffff;
border-radius: 10rpx;
width: 60rpx;
height:30rpx;
line-height:30rpx ;
font-size: 20rpx;
}
// //
.select-address{
display: flex;
@ -308,17 +356,19 @@
}
.choose-select {
.choose-item{
position: relative;
display: flex;
align-items: center;
height: 60rpx;
border-radius: 20rpx;
overflow: hidden;
// overflow: hidden;
background-color:#F6F6F6;
border:1px solid transparent;
width: fit-content;
.img{
width: 60rpx;
height: 60rpx;
border-radius: 20rpx;
}
}
.choose-active{
@ -393,6 +443,9 @@
.bgcolor-left{
background-color: #FF8E01;
}
.bgcolor-qh{
background-color: #c5c5c5;
}
}
}

@ -1,7 +1,7 @@
<template>
<view style="height: 100%;">
<!-- perspective: 1000; -->
<scroll-view v-if="typeList=='classify'" class="scroll-view goods-list" :scroll-top="scrollTop" :scroll-y="true"
<scroll-view v-if="typeList=='classify'" class="scroll-view goods-list" :scroll-top="scrollTop" @scroll="handleScroll" :scroll-y="true"
:lower-threshold="lowerThreshold" @scrolltolower="handleScrolltolower" @touchstart="handleTouchStart"
@touchmove.stop.prevent="handleTouchMove" @touchend="handleTouchEnd" @touch.stop>
<!-- @touchmove.stop.prevent -->
@ -76,7 +76,7 @@
<!--search-List -->
<scroll-view v-if="typeList=='goodsSearch'" :scroll-y="true" class="ht-auto goods-list"
@scrolltolower="scroll_lower" lower-threshold="30">
@scroll="handleScroll" :scroll-top="scrollTop" @scrolltolower="scroll_lower" lower-threshold="30">
<!-- <view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;'"> -->
<view v-if="(propData || null) != null && propData.length > 0" >
@ -120,7 +120,7 @@
<!-- 购物车 -->
<view class="gouwuche " @click.prevent="goCart">
<view :class="' gouwuche '+(typeList=='goodsSearch'?' searchCart ':' ') " @click.prevent="goCart">
<!-- cartNum -->
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum+''" type="warning"
size="small" />
@ -155,6 +155,8 @@
imageUrl: app.globalData.imgUrl, //
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'goods_default_pages.png',
scrollTop:0,
currentScrollTop:0,
// start
refresherThreshold: 50,
lowerThreshold: 50,
@ -285,6 +287,7 @@
},
//
refreshCartNum() {
this.scrollTop = this.currentScrollTop;
getShoppingCartList().then(res => {
if (res.return_code == '000000') {
this.cartNum = res.return_data.length;
@ -377,12 +380,7 @@
//
handleScroll(e) {
this.currentScrollTop = e.detail.scrollTop;
// if(this.currentScrollTop<5){
// this.isTop=true;
// }
this.$emit('scroll', e);
// this.$emit('scroll', e);
},
//
handleTouchStart(e) {
@ -495,6 +493,11 @@
}
.searchCart{
bottom: 27px !important;
right: 30px !important;
}
.badgeClass {
position: absolute;
top: -5px;

@ -42,23 +42,38 @@
}
},
created(){
getRegional().then(res=>{
this.CHINA_REGIONS = res.return_data;
// getRegional().then(res=>{
// this.CHINA_REGIONS = res.return_data;
this.CHINA_REGIONS.map(item=>{
if(!item.childs){
item.childs = [];
}
})
// this.CHINA_REGIONS.map(item=>{
// if(!item.childs){
// item.childs = [];
// }
// })
this.cityArr =this.CHINA_REGIONS[0].childs;
this.districtArr = this.CHINA_REGIONS[0].childs[0].childs;
// console.log(res.return_data,11)
})
// this.cityArr =this.CHINA_REGIONS[0].childs;
// this.districtArr = this.CHINA_REGIONS[0].childs[0].childs;
// // console.log(res.return_data,11)
// })
},
watch:{
defaultRegion:{
handler(region,oldRegion){
async handler(region,oldRegion){
await getRegional().then(res=>{
this.CHINA_REGIONS = res.return_data;
this.CHINA_REGIONS.map(item=>{
if(!item.childs){
item.childs = [];
}
})
this.cityArr =this.CHINA_REGIONS[0].childs;
this.districtArr = this.CHINA_REGIONS[0].childs[0].childs;
// console.log(res.return_data,11)
})
if(Array.isArray(region)){
//
oldRegion = oldRegion || []
@ -135,8 +150,9 @@
let children = this.CHINA_REGIONS
for(let i=0;i<3;i++){
for(let j=0;j<children.length;j++){
let condition = isCode?children[j].code==region.slice(0,(i+1)*2):children[j].name.includes(region[i]);
if(condition){
let condition = isCode?String(children[j].code).slice(0,(i+1)*2)==region.slice(0,(i+1)*2):children[j].name.includes(region[i]);
// console.log(String(children[j].code).slice(0,(i+1)*2),region.slice(0,(i+1)*2))
if(condition){
//
// console.log(i,j,children.length-1);
children = children[j].childs;

@ -258,7 +258,7 @@
price = 2;
}
}
//120
//120,
let _this = this;
let params={
goodsType:key,
@ -267,13 +267,19 @@
price:price,
}
// uni.showLoading({
// title: '',
// mask:true,
// });
// console.log(params,"params")
getListGoodsDetail(params).then(res=>{
setTimeout(()=>{
this.isLoading = false;
},200)
// uni.hideLoading();
if (res.return_code == '000000') {
if(res.return_data.list.length > 0){
// if(res.return_data.list.length > 0){
_this.goodsListData =_this.goodsListData.concat(res.return_data.list);
_this.pageData.pageStart = res.return_data.pageNum;
_this.pageData.pageNum = res.return_data.pageSize;
@ -281,10 +287,11 @@
_this.pageData.navigateLastPage = res.return_data.navigateLastPage;
// console.log(_this.pageData)
}
// }
}else{
_this.goodsListData=[]
uni.showToast({
title: res.return_msg,
icon: 'none',

@ -76,7 +76,7 @@
</view>
<!--实物start -->
<view v-if="row.productType ==12" class="width96 mart10">
<view v-if ="row.ext6.length>1" class="">
<view v-if ="row.ext6&&row.ext6.length>1" class="">
<view class=" fotlt ">
<view class="font16 fontwig6 fcor333 alijusstart">
<image mode="widthFix" :src="imageUrl+'orderLogo/goods.png'" v-if="row.productType == 12"
@ -105,7 +105,7 @@
</view>
</view>
<view v-if ="row.ext6.length<=1" class="mart10 fotlt dis-flex flex-sp">
<view v-if ="row.ext6&&row.ext6.length<=1" class="mart10 fotlt dis-flex flex-sp">
<view class="font16 fontwig6 fcor333 alijusstart">
<image mode="widthFix" :src="imageUrl+'orderLogo/goods.png'" v-if="row.productType == 12"
class="marglerig" style="width: 50rpx;height: 50rpx;"></image>
@ -307,13 +307,12 @@
if(res.return_data.list.length>0){
res.return_data.list.map(item=>{
if(item.ext6){
if(item.ext6&&item.productType==12){
item.ext6 = item.ext6.split(',')
}
})
}
this.orderList = this.orderList.concat(res.return_data.list);
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {

@ -100,7 +100,7 @@
regionId:'',
//
defaultRegion: ['北京市', '市辖区', '东城区'],
defaultRegionCode: '120101',
defaultRegionCode: '110101',
};
@ -167,10 +167,16 @@
//
handleGetRegion(region) {
// let region = JSON.parse(JSON.stringify(reg))
this.region = region;
this.userAddress.region = this.region.map(item => item.name).join(',');
this.regionId = this.region[2].code;
console.log(this.userAddress.region,"获取选择的地区")
if(region[0].code == region[1].code&&region[0].code == region[2].code){
this.userAddress.region = this.region[0].name
}else{
this.userAddress.region = this.region.map(item => item.name).join(',');
}
console.log(this.userAddress.region,"获取选择的地区",this.regionId,this.region)
},
//
init() {
@ -303,7 +309,7 @@
}
if(validation[i]["vali"]){
console.log(validation[i]["vali"].test(this.userAddress.tel),this.userAddress.tel)
// console.log(validation[i]["vali"].test(this.userAddress.tel),this.userAddress.tel)
if(!(validation[i]["vali"].test(this.userAddress.tel))){
uni.showToast({
title: "请输入正确格式的手机号码",

@ -5,7 +5,7 @@
<uni-swipe-action>
<!-- 从这里开始遍历-->
<view v-for="(item,index) in cartList"
:class="(item.loseEfficacy?' loseEfficacy ':' ')+'marb10 border-8r backcolorfff paading10'"
:class="(item.loseEfficacy?' loseEfficacy ':' ')+'marb10 border-8r backcolorfff pdtlb'"
:key="item.id" @click="goGoodsDetail(item.goodsId)">
<!-- :disabled="item.loseEfficacy" -->
@ -14,7 +14,7 @@
<view class="cart-container2">
<checkbox-group @change="checkClick(item)">
<checkbox @click.stop class="mycheck" :disabled="!isEdit&&item.loseEfficacy" color="#FFC71E"
<checkbox @click.stop class="mycheck checkContainer" :disabled="!isEdit&&item.loseEfficacy" color="#FFC71E"
:value="item.id" :checked="item.whetherCheck" />
</checkbox-group>
<view class="cart-detail">
@ -518,6 +518,10 @@
<style lang="scss" scoped>
.pdtlb{
padding: 10px 10px 10px 0;
}
.empy-cart{
display: flex;
flex-direction: column;
@ -558,6 +562,12 @@
// margin:0 20rpx;
}
.checkContainer{
height: 200rpx;
line-height: 200rpx;
padding-left: 10px;
}
.cart-detail {
flex: 1;
display: flex;

@ -10,7 +10,8 @@
</block>
<!-- 搜索列表 -->
<view class="search-list">
<goodsList ref="goodsList" typeList="goodsSearch" @loadData="loadData" :propData="data_list" :paddBottom="0">
<goodsList ref="goodsList" typeList="goodsSearch" @loadData="loadData" :propData="data_list"
:paddBottom="0">
</goodsList>
</view>
@ -45,12 +46,12 @@
componentSearch,
goodsList
},
onShow(){
this.$nextTick(()=>{
if(this.$refs.goodsList){
this.$refs.goodsList.refreshCartNum()
}
})
onShow() {
this.$nextTick(() => {
if (this.$refs.goodsList) {
this.$refs.goodsList.refreshCartNum()
}
})
},
methods: {
//
@ -93,8 +94,17 @@
price: 0
}
// params = JSON.stringify(params)
console.log(params)
// console.log(params)
uni.showLoading({
title: '加载中',
mask: true,
});
getListGoodsDetail(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (res.return_data.list.length > 0) {

@ -63,7 +63,7 @@
<view class="goods-desc-img br tc marb10 colorccc">
商品详情
</view>
<view style="font-size: 0;">
<view style="font-size: 0;" >
<image mode="widthFix" class="width100" v-for="(item,index) in goodsDetail.detailImg" :key="key"
:src="item" @click="perImage(index,goodsDetail.detailImg)">
</image>

@ -46,8 +46,8 @@
</view>
<view class="flex-1 flex-center-sp">
<view class="width60 paddleft10">
<view class="marb10 font18 fontwig6">{{item.goodsName}}</view>
<view class="marb5 font12 fcor666">规格: {{item.goodsSpecName}}</view>
<view class="marb10 font16 fontwig6">{{item.goodsName}}</view>
<view class="marb5 font13 fcor666">规格: {{item.goodsSpecName}}</view>
<view class="fcor666 font12">数量: {{item.saleCount}}</view>
</view>
<view class="font16 tr align-fs">
@ -69,8 +69,8 @@
</view>
<view class="flex-1 flex-center-sp">
<view class="width60 paddleft10">
<view class="marb10 font18 fontwig6">{{item.goodsName}}</view>
<view class="marb5 font12 fcor666">规格: {{item.goodsSpecName}}</view>
<view class="marb10 font16 fontwig6">{{item.goodsName}}</view>
<view class="marb5 font13 fcor666">规格: {{item.goodsSpecName}}</view>
<view class="fcor666 font12">数量: {{item.saleCount}}</view>
</view>
<view class="font16 tr align-fs">
@ -153,7 +153,7 @@
<view v-if="recinfo.orderStatus != 1 && recinfo.orderStatus != 5" class="pd-lr backcolorfff border-8r">
<!-- 收货信息 -->
<view class="flex-center-sp pd-tb10 bordert">
<view v-if="recinfo.goodsDeliveryAddress" class="flex-center-sp pd-tb10 bordert">
<view class="fcor666 align-fs width80px">收货信息</view>
<view class="flex-1 tr">
<view class=" ">
@ -207,7 +207,7 @@
<view v-if="recinfo.orderStatus == 1 || recinfo.orderStatus == 5" class="pd-lr backcolorfff border-8r">
<!-- 收货信息 -->
<view class="flex-center-sp pd-tb10 bordert">
<view v-if="recinfo.goodsDeliveryAddress" class="flex-center-sp pd-tb10 bordert">
<view class="fcor666 align-fs width80px">收货信息</view>
<view class="flex-1 tr">
<view class=" ">

@ -2,7 +2,7 @@
<view class="backcor9 pay-syt pd-main">
<view class="fotct ">
<view class="dis-flex flex-center">
¥<text class=" font28 fontwig6">{{payPrice}}</text>
¥<text class=" font28 fontwig6">{{payPrice | numFormat}}</text>
</view>
<view class="fcor666 font14 paddtop10 paddbotm10">
支付剩余时间<text class="paddleft10">{{countdownm}}:{{countdowns}}</text>
@ -110,6 +110,9 @@
components: {
ssPaymentPassword
},
onUnload() {
clearInterval(this.timers);
},
onShow() {
//
// if(this.status == 0){

@ -1,5 +1,5 @@
<template>
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="0" :showCloseIcon="true">
<wybPopup ref="popup" type="bottom" width="500" height="500" scrollY="true" radius="0" :showCloseIcon="true">
<view class="pd-main wuliupop backcor9">
<view class="pop-title fontwig6"><text>物流信息</text></view>
<view class="pd-main backcolorfff border-8r font14">
@ -149,7 +149,8 @@
},
methods:{
show(logisticsNo){
console.log(logisticsNo)
// console.log(logisticsNo)
this.tracesData={};
this.$refs.popup.show();
this.getLogisticsMsg(logisticsNo)
},
@ -158,7 +159,12 @@
let params ={
num:num
}
uni.showLoading({
title: '加载中',
mask:true,
});
getLogisticsMsg(params).then(res=>{
uni.hideLoading();
if (res.return_code == '000000') {
this.tracesData=res.return_data;
@ -209,7 +215,7 @@
//
callPhone(){
uni.showModal({
title: '客服',
title: '',
content: '4006780738',
success: function(res) {
if (res.confirm) {

@ -63,11 +63,11 @@
</view>
<view class="settle-msg">
<view class="settle-title marb5">
<text>{{goodsList[0].title}}</text>
<text class="font14 fcor666">{{getNumberAll}}</text>
<text class="flex-1">{{goodsList[0].title}}</text>
<view class="font14 fcor666">{{getNumberAll}}</view>
</view>
<view v-if="yhqId == 0" class="settle-title">
<text>¥{{goodsList[0].price}}</text>
<text >¥{{goodsList[0].price}}</text>
<text class="font14 fcor666">×{{goodsList[0].num}}</text>
</view>
<view v-else class="settle-title">
@ -412,14 +412,14 @@
this.getAddrPrice() //
if(this.addressDetail&&!this.isFirstSearchAddress){
console.log(this.addressDetail,"123456")
// console.log(this.addressDetail,"123456")
let params = {
id:this.addressDetail.id
}
findDeliveryAddressById(params).then(res=>{
// console.log(res)
if (res.return_code == '000000') {
this.addressDetail = res.return_data
}else{ //
this.isFirstSearchAddress=true;
this.haveAddress = false;
@ -442,6 +442,7 @@
let params = {
regionId: addressDetail.regionId
}
this.postPrice = 0;
getRegionFreight(params).then(res => {
if (res.return_code == '000000') {
this.postPrice = res.return_data
@ -466,6 +467,7 @@
title: '加载中',
mask: true,
});
this.postPrice = 0;
getAddressPrice().then(res => {
uni.hideLoading();
this.isFirstSearchAddress = false;

Loading…
Cancel
Save