Browse Source

零售改版

tags/v1.1.30
张家华 3 years ago
parent
commit
48e260a113
  1. 4
      src/js/api.js
  2. 4
      src/manifest.json
  3. BIN
      src/static/images/icon/retail/addEmpty.png
  4. 256
      src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue
  5. 274
      src/subpackage/retail/pages/index/index.vue
  6. 12
      src/subpackage/retail/pages/search/search.vue

4
src/js/api.js

@ -1,5 +1,5 @@
// export const ORIGIN = `https://testmanager.ouxuanzhineng.cn`; // 测试
export const ORIGIN = `https://minimanage.ouxuanzhineng.cn`; // 正式
export const ORIGIN = `https://testmanager.ouxuanzhineng.cn`; // 测试
// export const ORIGIN = `https://minimanage.ouxuanzhineng.cn`; // 正式
// export const ORIGIN = `http://192.168.1.135:9090`; // 20210927 测试

4
src/manifest.json

@ -55,7 +55,7 @@
/* */
"mp-weixin" : {
/* */
"appid" : "wxf1294b279ad1b845",
"appid" : "wx7106e84614cf0060",
"setting" : {
"urlCheck" : false
},
@ -73,4 +73,4 @@
"mp-qq" : {
"usingComponents" : true
}
}
}

BIN
src/static/images/icon/retail/addEmpty.png

After

Width: 36  |  Height: 36  |  Size: 366 B

256
src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue

@ -1,26 +1,35 @@
<template>
<view v-if="isShowCartList" class="hover-cart-list">
<view @click="maskClick"></view>
<view class="hover-cart-list-dialog" :style="{ height:cartListDialogHeight }">
<view class="hover-cart-list-dialog">
<view class="hover-cart-list-dialog-title">
<view>商品名称</view>
<view>售价</view>
<view>数量</view>
<view @click="clearCart()">清空购物车</view>
<image mode="aspectFit" src="/static/images/icon/retail/historySearchDelete.png" @click="clearCart()"></image>
<image mode="aspectFit" src="/static/images/icon/retail/close.png" @click="maskClick()"></image>
</view>
<scroll-view class="hover-cart-list-dialog-content" :style="{ height:cartListHeight }" :scroll-top="0" :scroll-y="cartListScroll">
<view class="hover-cart-list-dialog-content-for" :style="{ borderBottom:cartListItemBorderBottom }" v-for="item in cartList" :key="item.id">
<view class="hover-cart-list-dialog-content-col1">
<view>{{ item.erp_goods_name }}</view>
<view>{{ item.erp_goods_specs }}</view>
<scroll-view v-if="cartList.length>0?true:false" class="hover-cart-list-dialog-content" :scroll-top="0" :scroll-y="true">
<view class="main-right-list" v-for="item in cartList" :key="item.id">
<view class="item-left">
<image mode="aspectFit" src="/static/images/icon/author_modal.png"></image>
</view>
<view class="hover-cart-list-dialog-content-col2">
<input type="digit" :value="item.erp_goods_price" @confirm="cartInputConfirm($event, item.id)" @blur="cartInputConfirm($event, item.id)" />
<view></view>
</view>
<view class="hover-cart-list-dialog-content-col3">
<image mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="cartCountClick('sub', item.id)"></image>
<view>{{ item.count }}</view>
<image mode="aspectFit" src="/static/images/icon/retail/add.png" @click="cartCountClick('add', item.id)"></image>
<view class="item-right">
<view class="item-right-top">
<view class="item-right-name">{{ item.erp_goods_name }}</view>
<view class="item-right-spec">{{ item.erp_goods_specs }}</view>
<view class="item-right-special">特价</view>
</view>
<view class="item-right-price-count">
<view class="item-right-price-row">
<view><text></text>{{ item.erp_goods_price }}</view>
</view>
<view class="item-right-count-row">
<image mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="cartCountClick('sub', item.id)"></image>
<view>{{ item.count }}</view>
<image mode="aspectFit" src="/static/images/icon/retail/add.png" @click="cartCountClick('add', item.id)"></image>
</view>
</view>
</view>
</view>
</scroll-view>
@ -29,10 +38,11 @@
</template>
<script>
import tools from '../../js/tools';
export default {
props: [
"isShowCartList", "cartList", "cartListScroll",
"cartListHeight", "cartListDialogHeight", "cartListItemBorderBottom"
"isShowCartList", "cartList"
],
data() {
@ -44,6 +54,10 @@
},
methods: {
clearCart() {
this.$emit("update:clearCart");
},
//
maskClick() {
this.$emit("update:maskClick");
@ -110,7 +124,7 @@
bottom: calc( 108rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
bottom: calc( 108rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
width: 100%;
height: 878rpx;
// height: 878rpx;
background-color: rgb(255,255,255);
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
@ -118,123 +132,157 @@
.hover-cart-list-dialog-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
height: 120rpx;
// height: 120rpx;
text-align: center;
padding-left: 34rpx;
padding-right: 36rpx;
padding-left: 38rpx;
margin-top: 40rpx;
margin-bottom: 10rpx;
position: relative;
>view {
font-size: 32rpx;
color: rgb(51,51,51);
&:first-child {
width: 258rpx;
}
font-size: 28rpx;
color: #9A9A9D;
margin-right: 10rpx;
}
>image {
&:nth-child(2) {
width: 166rpx;
width: 36rpx;
height: 36rpx;
}
&:nth-child(3) {
width: 126rpx;
width: 34rpx;
height: 34rpx;
position: absolute;
right: 38rpx;
}
}
}
.hover-cart-list-dialog-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-grow: 1;
height: 758rpx;
padding-left: 34rpx;
padding-right: 36rpx;
padding-left: 38rpx;
height: 500rpx;
.hover-cart-list-dialog-content-for {
.main-right-list {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
flex-grow: 1;
height: 114rpx;
border-bottom: 1rpx solid rgb(216,216,216);
margin-top: 30rpx;
padding-top: 30rpx;
padding-bottom: 30rpx;
.hover-cart-list-dialog-content-col1 {
// display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 258rpx;
.item-left {
width: 172rpx;
height: 172rpx;
margin-right: 20rpx;
position: relative;
border-radius: 10rpx;
>view {
overflow: hidden;
word-break: nowrap;
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1; /** 显示的行数 **/
>image {
max-width: 100%;
max-height: 100%;
}
.item-left-empty {
width: 100%;
height: 100%;
position: absolute;
top: 0rpx;
left: 0rpx;
background-color: rgba(0,0,0,0.5);
border-radius: 10rpx;
&:first-child {
>view {
font-size: 28rpx;
color: rgb(51,51,51);
margin-bottom: 8rpx;
}
&:nth-child(2) {
font-size: 24rpx;
color: rgb(154,154,157);
color: #333333;
background: #FFFFFF;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: flex;
justify-content: center;
align-items: center;
}
}
}
.hover-cart-list-dialog-content-col2 {
.item-right {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: rgb(51,51,51);
font-size: 28rpx;
text-align: center;
width: 166rpx;
flex-direction: column;
justify-content: space-between;
flex-grow: 1;
padding-right: 38rpx;
>input {
width: 132rpx;
height: 48rpx;
border: 2rpx solid rgb(216,216,216);
border-radius: 4rpx;
}
>view {
margin-left: 6rpx;
.item-right-top {
display: flex;
flex-direction: column;
.item-right-name {
font-size: 28rpx;
}
.item-right-spec {
margin-top: 8rpx;
margin-bottom: 14rpx;
font-size: 24rpx;
color: rgb(154,154,157);
}
.item-right-special {
width: 58rpx;
height: 28rpx;
margin-bottom: 10rpx;
font-size: 20rpx;
color: #E60012;
background: rgba(230,0,18,0.13);
border-radius: 6px;
text-align: center;
}
}
}
.hover-cart-list-dialog-content-col3 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 126rpx;
>image {
width: 36rpx;
height: 36rpx;
.item-right-price-count {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
&:first-child {
.item-right-price-row {
color: rgb(255,135,61);
>view {
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
}
}
}
&:nth-child(3) {
.item-right-count-row {
display: flex;
flex-direction: row;
align-items: center;
>image {
&:first-child {
width: 36rpx;
height: 36rpx;
}
&:nth-child(3) {
width: 36rpx;
height: 36rpx;
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
}

274
src/subpackage/retail/pages/index/index.vue

@ -10,8 +10,6 @@
:disabled="storeListDisabled"
>
<view class="header-store-selecter">
<image class="header-store-selecter-left-img" mode="aspectFit" src="/static/images/icon/retail/home.png"></image>
<!-- <input id="cur-store-input-node" placeholder="请选择门店" :value="curStore.name" disabled /> -->
<view class="header-store-selecter-name">{{ curStore.name ? curStore.name : '' }}</view>
<image class="header-store-selecter-right-img" mode="aspectFit" src="/static/images/icon/retail/dropDown.png"></image>
</view>
@ -21,7 +19,7 @@
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称、sku"
placeholder="请输入商品名称"
disabled
/>
</view>
@ -37,18 +35,30 @@
</scroll-view>
<scroll-view class="main-right" scroll-top="0" scroll-y="true" v-if="scrollItem.isShow" v-for="scrollItem in goodsInfo" :key="scrollItem.cate.id">
<view class="main-right-list" v-for="item in scrollItem.goods_list" :key="item.id">
<view>{{ item.erp_goods_name }}</view>
<view>{{ item.erp_goods_specs }}</view>
<view class="main-right-list-price-count">
<view class="main-right-list-price-row">
<view><text></text>{{ item.erp_goods_price }}</view>
<view class="item-left">
<image mode="aspectFit" src="/static/images/icon/author_modal.png"></image>
<view v-if="item.stock_num>0?false:true" class="item-left-empty">
<view>盘罄</view>
</view>
</view>
<view class="item-right">
<view class="item-right-top">
<view class="item-right-name">{{ item.erp_goods_name }}</view>
<view class="item-right-spec">{{ item.erp_goods_specs }}</view>
<view class="item-right-special">特价</view>
</view>
<view class="main-right-list-count-row">
<image v-if="item.count>0?true:false" mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="mainCountClick('sub', scrollItem.cate.id, scrollItem.cate.erp_goods_cate_name, item.id)"></image>
<view v-if="item.count>0?true:false">{{ item.count }}</view>
<image mode="aspectFit" src="/static/images/icon/retail/add.png" @click="mainCountClick('add', scrollItem.cate.id, scrollItem.cate.erp_goods_cate_name, item.id)"></image>
<view class="item-right-price-count">
<view class="item-right-price-row" :style="{color:item.stock_num>0?'rgb(255,135,61)':'#9A9A9D'}">
<view><text></text>{{ item.erp_goods_price }}</view>
</view>
<view class="item-right-count-row">
<image v-if="item.count>0?true:false" mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="mainCountClick('sub', scrollItem.cate.id, scrollItem.cate.erp_goods_cate_name, item.id, item.stock_num)"></image>
<view v-if="item.count>0?true:false">{{ item.count }}</view>
<image v-if="item.stock_num>0?true:false" mode="aspectFit" src="/static/images/icon/retail/add.png" @click="mainCountClick('add', scrollItem.cate.id, scrollItem.cate.erp_goods_cate_name, item.id, item.stock_num)"></image>
<image v-else mode="aspectFit" src="/static/images/icon/retail/addEmpty.png" @click="mainCountClick('add', scrollItem.cate.id, scrollItem.cate.erp_goods_cate_name, item.id, item.stock_num)"></image>
</view>
</view>
</view>
</view>
@ -56,8 +66,7 @@
</view>
<hoverCartList
:isShowCartList="isShowCartList" :cartList="cartList" :cartListScroll="cartListScroll"
:cartListHeight="cartListHeight" :cartListDialogHeight="cartListDialogHeight" :cartListItemBorderBottom="cartListItemBorderBottom"
:isShowCartList="isShowCartList" :cartList="cartList" @update:clearCart="clearCart"
@update:cartInputConfirm="cartInputConfirm" @update:cartCountClick="cartCountClick" @update:maskClick="cartClick"
>
</hoverCartList>
@ -75,7 +84,7 @@
<view v-if="isShowCartList"><text></text>{{ cartTotalPrice }}</view>
</view>
<view class="footer-confirm">
<button hover-class="hover-active" @click="cartConfirm">确认</button>
<button hover-class="hover-active" @click="cartConfirm" :style="{opacity:cartConfirmOpacity}">去结算</button>
</view>
</view>
</view>
@ -119,10 +128,7 @@ export default {
cartList: [], //
cartListFinal: [], //
isShowCartList: false, //
cartListScroll: true, //
cartListHeight: "0rpx", //
cartListDialogHeight: "0rpx", //
cartListItemBorderBottom: "1rpx solid rgb(216,216,216)", // 1border
cartConfirmOpacity: 0.3 //
}
},
onLoad() {
@ -280,6 +286,11 @@ export default {
this.cartTotalCount = count;
},
//
clearCart() {
},
//
cartCountClick(type, i) {
//
@ -327,7 +338,7 @@ export default {
this.calcCartTotalPriceAndCount(); //
this.calcTotalPriceAndCount(); //
this.cartListStatusChange(); //
this.setCartConfirmStyle();
},
//
@ -345,6 +356,9 @@ export default {
//
cartConfirm() {
if (this.cartList.length <= 0) {
return;
}
this.cartListFinal = this.getCartListFinalData();
//
@ -382,28 +396,12 @@ export default {
for (let i = 0; i < tempData.length; ++i) {
this.cartList.push(tools.getNewObj(tempData[i]));
}
this.setCartConfirmStyle();
},
//
cartListStatusChange() {
//
let num = this.cartList.length;
this.cartListScroll = false;
if (this.cartList.length > 5) {
num = 5;
this.cartListScroll = true;
}
// border
if (this.cartList.length <= 1) {
this.cartListItemBorderBottom = "0rpx solid rgb(216,216,216)";
}
else {
this.cartListItemBorderBottom = "1rpx solid rgb(216,216,216)";
}
this.cartListHeight = `${151.6 * num}rpx`;
this.cartListDialogHeight = `${(878 - 758) + 151.6 * num}rpx`;
setCartConfirmStyle() {
this.cartConfirmOpacity = this.cartList.length > 0 ? 1 : 0.3;
},
//
@ -413,7 +411,6 @@ export default {
}
else {
this.addToCartList(); //
this.cartListStatusChange(); //
this.cartTotalPrice = this.totalPrice;
this.cartTotalCount = this.totalCount;
@ -507,7 +504,9 @@ export default {
},
//
mainCountClick(type, id, cateName, goodsId) {
mainCountClick(type, id, cateName, goodsId, stockNum) {
if (stockNum <= 0) return;
//
let item = null;
for (let i = 0; i < this.goodsInfo.length; ++i) {
@ -708,7 +707,7 @@ export default {
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.header {
height: 230rpx;
// height: 230rpx;
// border: 1rpx solid red;
display: flex;
flex-direction: column;
@ -731,9 +730,8 @@ export default {
height: 78rpx;
line-height: 78rpx;
fotn-size: 16rpx;
margin-left: 12rpx;
margin-right: 14rpx;
color: rgb(51,51,51);
color: #333333;
}
.header-store-selecter-left-img {
width: 36rpx;
@ -749,10 +747,8 @@ export default {
display: flex;
align-items: center;
justify-content: center;
height: 152rpx;
background-color: rgb(255,255,255);
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
height: 92rpx;
margin-top: 17rpx;
>view {
display: flex;
@ -761,7 +757,7 @@ export default {
flex-grow: 1;
height: 92rpx;
border-radius: 10rpx;
background-color: rgb(242,242,247);
background-color: #FFFFFF;
margin-left: 24rpx;
padding-left: 20rpx;
padding-right: 20rpx;
@ -782,12 +778,12 @@ export default {
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
width: 100rpx;
height: 62rpx;
line-height: 62rpx;
width: 142rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: rgb(255,255,255);
background-color: rgb(6,147,137);
color: #FFFFFF;
background-color: #009874;
border-radius: 10rpx;
white-space: nowrap;
padding: 0 0;
@ -833,79 +829,138 @@ export default {
.main-right {
width: 558rpx;
background-color: rgb(255,255,255);
border-top-left-radius: 30rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
padding-left: 36rpx;
// padding-right: 48rpx;
padding-left: 20rpx;
// padding-right: 20rpx;
.main-right-list {
border-bottom: 1rpx solid rgb(237,237,245);
// border-bottom: 1rpx solid rgb(237,237,245);
display: flex;
flex-direction: column;
padding-top: 24rpx;
padding-bottom: 24rpx;
flex-direction: row;
padding-top: 20rpx;
padding-bottom: 20rpx;
// border: 1px solid red;
>view {
padding-right: 24rpx;
.item-left {
width: 172rpx;
height: 172rpx;
margin-right: 20rpx;
// border: 1px solid red;
position: relative;
border-radius: 10rpx;
&:first-child {
font-size: 28rpx;
>image {
max-width: 100%;
max-height: 100%;
}
&:nth-child(2) {
margin-top: 8rpx;
margin-bottom: 14rpx;
font-size: 24rpx;
color: rgb(154,154,157);
.item-left-empty {
width: 100%;
height: 100%;
position: absolute;
top: 0rpx;
left: 0rpx;
background-color: rgba(0,0,0,0.5);
border-radius: 10rpx;
>view {
font-size: 28rpx;
color: #333333;
background: #FFFFFF;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: flex;
justify-content: center;
align-items: center;
}
}
}
.main-right-list-price-count {
.item-right {
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: space-between;
align-items: center;
// border: 1rpx solid green;
// border: 1px solid red;
flex-grow: 1;
padding-right: 20rpx;
.main-right-list-price-row {
.item-right-top {
display: flex;
flex-direction: row;
align-items: center;
color: rgb(255,135,61);
flex-direction: column;
// border: 1px solid black;
>view {
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
}
.item-right-name {
font-size: 28rpx;
}
.item-right-spec {
margin-top: 8rpx;
margin-bottom: 14rpx;
font-size: 24rpx;
color: rgb(154,154,157);
}
.item-right-special {
width: 58rpx;
height: 28rpx;
margin-bottom: 10rpx;
font-size: 20rpx;
color: #E60012;
background: rgba(230,0,18,0.13);
border-radius: 6px;
text-align: center;
}
}
.main-right-list-count-row {
.item-right-price-count {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding-right: 48rpx;
// border: 1rpx solid green;
>image {
&:first-child {
width: 36rpx;
height: 36rpx;
}
&:nth-child(3) {
width: 36rpx;
height: 36rpx;
.item-right-price-row {
// display: flex;
// flex-direction: row;
// align-items: center;
color: rgb(255,135,61);
>view {
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
}
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
.item-right-count-row {
display: flex;
flex-direction: row;
align-items: center;
>image {
&:first-child {
width: 36rpx;
height: 36rpx;
}
&:nth-child(3) {
width: 36rpx;
height: 36rpx;
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
}
@ -1011,13 +1066,14 @@ export default {
width: 240rpx;
height: 88rpx;
line-height: 88rpx;
color: rgb(255,255,255);
color: #FFFFFF;
font-size: 32rpx;
border: 0rpx;
border-radius: 44rpx;
background-color: rgb(0,152,116);
border-radius: 10rpx;
background-color: #009874;
white-space: nowrap;
padding: 0 0;
opacity: 0.3;
}
}
}

12
src/subpackage/retail/pages/search/search.vue

@ -5,7 +5,7 @@
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称、sku"
placeholder="请输入商品名称"
v-model="searchText"
focus="true"
/>
@ -224,12 +224,12 @@
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
width: 100rpx;
height: 62rpx;
line-height: 62rpx;
width: 142rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: rgb(255,255,255);
background-color: rgb(6,147,137);
color: #FFFFFF;
background-color: #009874;
border-radius: 10rpx;
white-space: nowrap;
padding: 0 0;

Loading…
Cancel
Save