Browse Source

零售样式调整

tags/v1.1.30
张家华 3 years ago
parent
commit
d2ac2f407e
  1. 3
      src/components/order_list/retail/retail.vue
  2. 8
      src/subpackage/order/pages/retail/detail/detail.vue
  3. 73
      src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue
  4. 79
      src/subpackage/retail/components/store_card_select/store_card_select.vue
  5. 146
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  6. 187
      src/subpackage/retail/pages/confirm_order/confirm_order.vue
  7. 436
      src/subpackage/retail/pages/index/index.vue
  8. 37
      src/subpackage/retail/pages/pay_success/pay_success.vue
  9. 119
      src/subpackage/retail/pages/search/search.vue

3
src/components/order_list/retail/retail.vue

@ -47,7 +47,8 @@ export default {
methods: {
getStatus(status){
let _obj = {
1: '交易成功'
1: '交易成功',
4: '已退款'
}
return _obj[status] || '-'
},

8
src/subpackage/order/pages/retail/detail/detail.vue

@ -159,8 +159,7 @@ export default {
background-color: #fff;
.ra-header {
position: relative;
padding-top: 30upx;
padding-bottom: 30upx;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
@ -181,8 +180,7 @@ export default {
}
}
.rh-name{
padding-top: 18upx;
padding-bottom: 18upx;
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
@ -200,7 +198,7 @@ export default {
flex-shrink: 0;
}
>text {
color: #333333;
color: #333;
@include textHide(1);
}
}

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

@ -7,7 +7,7 @@
<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 v-if="cartList.length>0?true:false" class="hover-cart-list-dialog-content" :scroll-top="0" :scroll-y="true">
<scroll-view 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>
@ -56,32 +56,16 @@
clearCart() {
this.$emit("update:clearCart");
},
//
maskClick() {
this.$emit("update:maskClick");
},
//
cartInputConfirm(event, id) {
//
// console.log(event.detail.value.match(/(([0-9]+\.[0-9]+)|([0-9]+))/g)); //
let value = parseFloat(event.detail.value ? event.detail.value : 0).toFixed(2);
for (let i = 0; i < this.cartList.length; ++i) {
if (this.cartList[i].id == id) {
this.$emit("update:cartInputConfirm", value, i);
}
}
},
//
cartCountClick(type, id) {
//
let item = null;
for (let i = 0; i < this.cartList.length; ++i) {
if (this.cartList[i].id == id) {
// item = this.cartList[i];
this.$emit("update:cartCountClick", type, i);
break;
}
@ -92,52 +76,45 @@
</script>
<style lang="scss">
@import '~style/public.scss';
$orange: #FF873D;
.hover-cart-list {
width: 100vw;
height: 100vh;
position: absolute;
left: 0rpx;
top: 0rpx;
left: 0;
top: 0;
>view {
&:first-child {
width: 100%;
height: 100%;
position: absolute;
left: 0rpx;
bottom: 0rpx;
left: 0;
bottom: 0;
bottom: calc( 108rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
bottom: calc( 108rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
background-color: rgba(0,0,0,0.5);
}
}
.hover-cart-list-dialog {
display: flex;
@include centerFlex(center);
flex-direction: column;
justify-content: center;
align-items: center;
position: fixed;
bottom: 0rpx;
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;
background-color: rgb(255,255,255);
background-color: white;
border-top-left-radius: 30rpx;
border-top-right-radius: 30rpx;
.hover-cart-list-dialog-title {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
width: 100%;
// height: 120rpx;
text-align: center;
padding-left: 38rpx;
margin-top: 40rpx;
margin-bottom: 10rpx;
margin: 40rpx 0 10rpx 0;
position: relative;
>view {
@ -158,7 +135,6 @@
}
}
}
.hover-cart-list-dialog-content {
padding-left: 38rpx;
height: 500rpx;
@ -166,15 +142,13 @@
.main-right-list {
display: flex;
flex-direction: row;
padding-top: 30rpx;
padding-bottom: 30rpx;
// border: 1px solid red;
padding: 30rpx 0;
.item-left {
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
position: relative;
margin-right: 20rpx;
border-radius: 10rpx;
>image {
@ -197,21 +171,16 @@
font-size: 28rpx;
}
.item-right-spec {
margin-top: 8rpx;
margin-bottom: 14rpx;
margin: 8rpx 0 14rpx 0;
font-size: 24rpx;
color: rgb(154,154,157);
color: #9A9A9D;
}
}
.item-right-price-count {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
@include centerFlex(space-between);
.item-right-price-row {
color: rgb(255,135,61);
color: $orange;
>view {
&:first-child {
@ -226,9 +195,7 @@
}
}
.item-right-count-row {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
>image {
&:first-child {
@ -241,9 +208,7 @@
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
margin: 0 12rpx;
font-size: 28rpx;
}
}

79
src/subpackage/retail/components/store_card_select/store_card_select.vue

@ -55,14 +55,9 @@
//
onCardClick(item) {
this.curCardChoose = item;
for (let i = 0; i < this.cardList.length; ++i) {
this.cardList[i].mark = this.noChoosePath;
}
for (let i = 0; i < this.cardList.length; ++i) this.cardList[i].mark = this.noChoosePath;
this.curCardChoose.mark = this.choosePath;
},
//
searchCardList() {
if (!this.searchCardValue) {
@ -86,7 +81,7 @@
}).then(res => {
util.hideLoad();
if (res.data.code == 0) {
let color = "rgba(51, 51, 51, 1)";
let color = "#333";
for (let i = 0; i < res.data.data.length; ++i) {
_this.cardList.push(res.data.data[i]);
_this.cardList[i].mark = this.noChoosePath;
@ -94,9 +89,8 @@
card_no: color, nickname: color, mobile: color, card_name: color, balance: color
};
for (let j = 0; j < res.data.data[i].match_key_fields.length; ++j) {
_this.cardList[i].color[res.data.data[i].match_key_fields[j]] = "rgba(0, 152, 118, 1)";
}
for (let j = 0; j < res.data.data[i].match_key_fields.length; ++j)
_this.cardList[i].color[res.data.data[i].match_key_fields[j]] = "#009874";
}
if (_this.cardList.length) {
@ -112,27 +106,22 @@
}
});
},
//
resetData() {
this.curCardChoose = null;
this.cardList = [];
this.searchCardValue = "";
},
//
onClose() {
// this.resetData(); //
this.$emit("update:onClose", false);
},
//
onConfirm() {
if (!this.curCardChoose) {
util.showNone("请搜索选择储值卡!");
return;
}
this.$emit("update:onConfirm", this.curCardChoose);
this.onClose();
}
@ -141,30 +130,28 @@
</script>
<style lang="scss">
@import '~style/public.scss';
.content {
width: 100vw;
height: 100vh;
overflow: hidden;
position: fixed;
top: 0%;
top: 0;
left: 0;
overflow: hidden;
}
.win-mask {
width: 100%;
height: 100%;
position: absolute;
background-color: rgba(0, 0, 0, 0.5);
}
.win-operate {
width: 100%;
height: 964rpx;
position: fixed;
bottom: 0%;
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
align-items: center;
background-color: white;
padding-top: 46rpx;
@ -175,19 +162,16 @@
top: 32rpx;
right: 28rpx;
}
> text {
width: 100%;
color: rgba(51, 51, 51, 1);
color: #333;
font-size: 32rpx;
text-align: center;
margin-bottom: 54rpx;
}
.win-way-confirm {
width: 100%;
padding-left: 20rpx;
padding-right: 20rpx;
padding: 0 20rpx;
position: absolute;
bottom: 0%;
bottom: calc( 0% + constant(safe-area-inset-bottom));
@ -199,11 +183,10 @@
line-height: 112rpx;
border-radius: 10rpx;
padding: 0 0;
color: rgb(255,255,255);
background-color: rgb(0,152,116);
color: white;
background-color: $themeColor;
}
}
.win-iphonex-block {
background-color: white;
width: 100%;
@ -212,25 +195,20 @@
poisition: absolute;
bottom: 0%;
}
.win-card {
width: 100%;
height: 100%;
position: relative;
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
align-items: center;
padding-left: 20rpx;
padding-right: 20rpx;
padding: 0 20rpx;
.win-card-search {
width: 100%;
border-radius: 10rpx;
background-color: rgba(242, 242, 247, 1);
background-color: #f2f2f7;
margin-bottom: 30rpx;
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
> image {
width: 40rpx;
@ -238,52 +216,45 @@
flex-shrink: 0;
margin-left: 20rpx;
}
> input {
font-size: 32rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-top: 24rpx;
padding-bottom: 24rpx;
padding: 24rpx 20rpx;
flex-grow: 1;
}
.win-card-search-input-placeholder {
font-size: 32rpx;
color: rgba(156, 156, 159, 1);
color: #9c9c9f;
}
}
.win-card-list {
width: 100%;
height: 100rpx;
overflow: scroll;
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
align-items: center;
position: relative;
flex-grow: 1;
position: relative;
margin-bottom: 112rpx;
.win-card-list-item {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 100%;
border: 1rpx solid #979797;
border: 2rpx solid #979797;
border-color: #979797;
border-radius: 10rpx;
padding: 20rpx;
padding: 20rpx 0;
margin-bottom: 24rpx;
position: relative;
flex-shrink: 0;
> view {
color: rgba(156, 156, 159, 1);
color: #9c9c9f;
font-size: 28rpx;
margin-bottom: 5rpx;
> text {
color: rgba(51, 51, 51, 1);
color: #333;
font-size: 28rpx;
}
}

146
src/subpackage/retail/pages/confirm_goods/confirm_goods.vue

@ -1,14 +1,14 @@
<template>
<view class="cg-container">
<view class="final-cart-list">
<view class="final-cart-list-dialog-title">
<view class="cg-header">
<view class="cg-header-title">
<view class="icon-line">
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<view>{{ curStore.name ? curStore.name : '' }}</view>
</view>
</view>
<scroll-view class="final-cart-list-dialog-content" :scroll-top="0" :scroll-y="true" :style="{ height:cartListFinalHeight, paddingBottom:cartListFinalPaddingBottom }">
<view class="main-right-list final-cart-list-dialog-content-for" v-for="item in cartListFinal" :key="item.id">
<scroll-view class="cg-header-content" :scroll-top="0" :scroll-y="true" :style="{ height:cartListFinalHeight, paddingBottom:cartListFinalPaddingBottom }">
<view class="main-list" v-for="item in cartListFinal" :key="item.id">
<view class="item-left">
<image mode="aspectFit" src="/static/images/icon/author_modal.png"></image>
</view>
@ -52,9 +52,7 @@
import retailServer from '../../js/retail_server';
export default {
components: {
},
components: {},
data() {
return {
curStore: {}, //
@ -67,45 +65,32 @@
},
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.cartListFinal = [];
for (let i = 0; i < data.cartListFinal.length; ++i) {
for (let i = 0; i < data.cartListFinal.length; ++i)
this.cartListFinal.push(tools.getNewObj(data.cartListFinal[i]));
}
//
this.fixMainHeight(); //
this.calcTotalPrice(); //
util.showLoad();
setTimeout(util.hideLoad, 1000);
setTimeout(util.hideLoad, 500);
},
methods: {
//
cartConfirm() {
let data = {
cartListFinal: this.cartListFinal,
curStore: this.curStore
};
let data = { cartListFinal: this.cartListFinal, curStore: this.curStore };
uni.navigateTo({
url: `/subpackage/retail/pages/confirm_order/confirm_order?data=${encodeURIComponent(JSON.stringify(data))}`
});
// this.showOrHidePayWay(true); //
// this.goodsRetail(); //
},
//
calcTotalPrice() {
let price = 0.0;
for (let i = 0; i < this.cartListFinal.length; ++i) {
for (let i = 0; i < this.cartListFinal.length; ++i)
price += (this.cartListFinal[i].count * this.cartListFinal[i].erp_goods_price);
}
this.totalPrice = price.toFixed(2);
},
//
fixMainHeight() {
let _this = this;
@ -114,18 +99,16 @@
console.log(res);
let sumHeight = res.windowHeight; //
// //
//
let query = uni.createSelectorQuery().select(".cg-footer");
query.boundingClientRect(data => {
sumHeight = sumHeight - data.height - uni.upx2px(100); // footer
let contentHeight = sumHeight;
query = uni.createSelectorQuery().select(".final-cart-list-dialog-content-for");
query = uni.createSelectorQuery().select(".main-list");
query.boundingClientRect(data => {
// let itemSize = (data.height + uni.upx2px(30)); // 30margin
let itemSize = data.height;
let limitCount = Math.floor(contentHeight / itemSize);
let height = _this.cartListFinal.length >= limitCount ? contentHeight : _this.cartListFinal.length * itemSize;
_this.cartListFinalHeight = `${tools.px2rpx(height)}rpx`;
@ -144,9 +127,10 @@
</script>
<style lang="scss">
@import '~style/public.scss';
$orange: #FF873D;
page {
// background-color: rgb(237,237,245);
background-color: rgb(255,255,255);
background-color: white;
}
.cg-container {
@ -157,32 +141,25 @@
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
// border: 1px solid red;
.final-cart-list {
.cg-header {
display: flex;
flex-direction: column;
// width: 100%;
// height: 100%;
flex-grow: 1;
background-color: rgb(237,237,245);
background-color: #F2F2F7;
.final-cart-list-dialog-title {
.cg-header-title {
width: 100%;
height: 100rpx;
background-color: rgb(255,255,255);
padding-left: 24rpx;
padding-right: 24rpx;
color: rgba(51, 51, 51, 1);
background-color: white;
padding: 0 24rpx;
.icon-line {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
width: 100%;
height: 100%;
font-weight: 500;
border-bottom: 1rpx solid rgba(216, 216, 216, 0.3);
font-weight: bold;
>image {
width: 32rpx;
@ -191,27 +168,18 @@
}
}
}
.final-cart-list-dialog-content {
.cg-header-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// flex-grow: 1;
// height: 428rpx;
padding-left: 24rpx;
padding-right: 24rpx;
background-color: rgb(255,255,255);
// padding-bottom: 0rpx;
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
padding: 0 24rpx;
background-color: white;
.main-right-list {
.main-list {
display: flex;
flex-direction: row;
padding-top: 23rpx;
padding-bottom: 23rpx;
// border: 1px solid red;
padding: 23rpx 0;
.item-left {
width: 140rpx;
@ -239,25 +207,17 @@
font-size: 28rpx;
}
.item-right-spec {
margin-top: 8rpx;
margin-bottom: 14rpx;
margin: 8rpx 0 14rpx 0;
font-size: 24rpx;
color: rgb(154,154,157);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
color: #9A9A9D;
@include centerFlex(space-between);
}
}
.item-right-price-count {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
@include centerFlex(space-between);
.item-right-price-row {
color: rgb(255,135,61);
color: $orange;
>view {
&:first-child {
@ -276,37 +236,23 @@
}
}
}
.cg-footer {
display: flex;
flex-direction: row;
// flex-grow: 1;
// opacity: 0.3;
position: fixed;
// bottom: 0rpx;
bottom: calc( 0rpx + constant(safe-area-inset-bottom));
bottom: calc( 0rpx + env(safe-area-inset-bottom));
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
width: 100%;
// height: 188rpx;
height: 108rpx;
// border: 1rpx solid blue;
background-color: rgb(255,255,255);
background-color: white;
>view {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
@include centerFlex(space-between);
width: 100%;
height: 100%;
.cg-footer-price {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
height: 88rpx;
width: 100%;
padding-left: 28rpx;
@ -314,10 +260,9 @@
>view {
&:first-child {
font-size: 28rpx;
color: rgba(51, 51, 51, 1);
}
&:nth-child(2) {
color: rgb(255,135,61);
color: $orange;
font-size: 36rpx;
>text {
@ -326,24 +271,15 @@
}
}
}
.cg-footer-btn {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
@include centerFlex(flex-end);
height: 88rpx;
// width: 100%;
padding-right: 24rpx;
font-size: 32rpx;
> view {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
@include centerFlex(center);
}
.cg-footer-btn-confirm {
>button {
width: 240rpx;
@ -351,9 +287,9 @@
line-height: 88rpx;
border-radius: 44rpx;
padding: 0 0;
color: rgb(255,255,255);
background-color: rgb(0,152,116);
border: 2rpx solid rgb(0,152,116);
color: white;
background-color: $themeColor;
border: 2rpx solid $themeColor;
}
}
}

187
src/subpackage/retail/pages/confirm_order/confirm_order.vue

@ -81,19 +81,16 @@
},
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.cartListFinal = [];
for (let i = 0; i < data.cartListFinal.length; ++i) {
for (let i = 0; i < data.cartListFinal.length; ++i)
this.cartListFinal.push(tools.getNewObj(data.cartListFinal[i]));
}
this.fixMainHeight(); //
this.calcTotalPrice(); //
this.createPayWayList(); //
util.showLoad();
setTimeout(util.hideLoad, 1000);
setTimeout(util.hideLoad, 500);
},
onShow() {
this.getPaySuccess(); //
@ -102,17 +99,13 @@
getPaySuccess() {
uni.getStorage({
key: 'paySuccess',
success: function (res) {
success: (res) => {
uni.removeStorage({
key: 'paySuccess',
success: function (res) {
uni.navigateBack({
delta: 2
});
}
success: (res) => { uni.navigateBack({ delta: 2 }); }
});
},
fail: function(err) {},
fail: (err) => {},
});
},
//
@ -136,12 +129,8 @@
goods_data: data,
pay_type: info.type,
};
if (info.inputValue) {
newData["other_pay_type"] = info.inputValue;
}
if (info.cardNo) {
newData["card_no"] = info.cardNo;
}
if (info.inputValue) newData["other_pay_type"] = info.inputValue;
if (info.cardNo) newData["card_no"] = info.cardNo;
util.showLoad();
retailServer.post({
@ -154,17 +143,13 @@
uni.setStorage({
key: "retailStatus",
data: "true",
success: function() {
success: () => {
util.hideLoad();
uni.navigateTo({
url: `/subpackage/retail/pages/pay_success/pay_success`
});
uni.navigateTo({ url: `/subpackage/retail/pages/pay_success/pay_success` });
},
fail: function(err) {
fail: (err) => {
util.hideLoad();
uni.navigateTo({
url: `/subpackage/retail/pages/pay_success/pay_success`
});
uni.navigateTo({ url: `/subpackage/retail/pages/pay_success/pay_success` });
},
});
}
@ -175,22 +160,12 @@
},
//
confirmPay() {
let info = {
type: 0,
inputValue: "default",
cardNo: "default"
};
let info = { type: 0, inputValue: "default", cardNo: "default" };
switch (this.curChoose.name) {
case "微信支付": {
info.type = 0;
} break;
case "支付宝支付": {
info.type = 1;
} break;
case "现金支付": {
info.type = 3;
} break;
case "微信支付": info.type = 0; break;
case "支付宝支付": info.type = 1; break;
case "现金支付": info.type = 3; break;
case "其他": {
if (!this.curChoose.inputValue) {
util.showNone("请输入其他支付方式!");
@ -219,16 +194,10 @@
//
onPayWayClick(item, index) {
this.curChoose = item;
for (let i = 0; i < this.payWayList.length; ++i) {
this.payWayList[i].mark = this.noChoosePath;
}
for (let i = 0; i < this.payWayList.length; ++i) this.payWayList[i].mark = this.noChoosePath;
this.payWayList[index].mark = this.choosePath;
if (item.name === '储值卡支付') {
this.showOrHideStoreCardSelect(true);
}
if (item.name === '储值卡支付') this.showOrHideStoreCardSelect(true);
},
//
createPayWayList() {
this.payWayList = [
@ -276,23 +245,18 @@
this.curChoose = this.payWayList[0];
},
//
showOrHideStoreCardSelect(status) {
this.storeCardSelectShow= status;
},
//
calcTotalPrice() {
let price = 0.0;
for (let i = 0; i < this.cartListFinal.length; ++i) {
for (let i = 0; i < this.cartListFinal.length; ++i)
price += (this.cartListFinal[i].count * this.cartListFinal[i].erp_goods_price);
}
this.totalPrice = price.toFixed(2);
},
//
fixMainHeight() {
let _this = this;
@ -318,9 +282,10 @@
</script>
<style lang="scss">
@import '~style/public.scss';
$orange: #FF873D;
page {
// background-color: rgb(237,237,245);
background-color: rgb(255,255,255);
background-color: white;
}
.cg-container {
@ -331,33 +296,26 @@
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
// border: 1px solid red;
.final-cart-list {
display: flex;
flex-direction: column;
// width: 100%;
// height: 100%;
flex-grow: 1;
background-color: rgb(237,237,245);
background-color: #ededf5;
.final-cart-list-dialog-title {
width: 100%;
height: 480rpx;
background-color: rgb(255,255,255);
padding-left: 24rpx;
padding-right: 24rpx;
color: rgba(51, 51, 51, 1);
background-color: white;
padding: 0 24rpx;
margin-bottom: 24rpx;
.icon-line {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
width: 100%;
height: 100rpx;
border-bottom: 1rpx solid rgba(216, 216, 216, 0.3);
font-weight: bold;
font-weight: 500;
>image {
width: 32rpx;
@ -366,11 +324,8 @@
}
}
.amount-line {
display: flex;
@include centerFlex(center);
flex-direction: column;
justify-content: center;
align-items: center;
color: #333333;
height: 380rpx;
>text {
@ -379,7 +334,7 @@
}
>view {
font-size: 80rpx;
font-weight: bold;
font-weight: 500;
>text {
font-size: 60rpx;
@ -387,43 +342,28 @@
}
}
}
.pay-way-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// flex-grow: 1;
// height: 428rpx;
// padding-left: 24rpx;
// padding-right: 24rpx;
background-color: rgb(255,255,255);
// padding-bottom: 0rpx;
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
background-color: white;
.win-way {
width: 100%;
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
align-items: center;
position: relative;
.win-way-item {
width: 100%;
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
align-items: center;
padding-left: 40rpx;
padding-right: 36rpx;
padding-top: 28rpx;
// padding-bottom: 28rpx;
padding: 28rpx 36rpx 0 40rpx;
position: relative;
.row1 {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
width: 100%;
.win-way-item-icon {
@ -446,30 +386,21 @@
height: 34rpx;
flex-shrink: 0;
}
> text {
color: rgba(24, 24, 24, 1);
font-size: 28rpx;
flex-grow: 1;
flex-shrink: 0;
margin-left: 16rpx;
margin-right: 16rpx;
margin: 0 16rpx;
}
> input {
margin-left: 24rpx;
margin-right: 132rpx;
margin: 0 132rpx 0 24rpx;
width: 340rpx;
border-radius: 10rpx;
border: 2rpx solid rgba(216, 216, 216, 1);
border: 2rpx solid #d8d8d8;
background-color: white;
padding-left: 16rpx;
padding-right: 16rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
padding: 10rpx 16rpx;
font-size: 28rpx;
}
.win-way-item-input-placeholder {
color: rgba(154, 154, 157, 1);
font-size: 28rpx;
@ -477,45 +408,35 @@
}
.row2 {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
@include centerFlex(flex-end);
.store-card-info {
display: flex;
flex-direction: column;
// width: 100%;
flex-shrink: 0;
width: 612rpx;
position: relative;
flex-shrink: 0;
padding-top: 26rpx;
> view {
color: rgba(156, 156, 159, 1);
color: #9c9c9f;
font-size: 28rpx;
margin-bottom: 5rpx;
> text {
color: rgba(51, 51, 51, 1);
font-size: 28rpx;
}
}
}
}
.row3 {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
@include centerFlex(flex-end);
width: 100%;
.bottom-line {
// width: 80.5%;
width: 612rpx;
height: 1rpx;
background-color: rgba(216, 216, 216, 1);
background-color: #d8d8d8;
margin-top: 26rpx;
}
}
@ -523,45 +444,33 @@
}
}
}
.cg-footer {
display: flex;
flex-direction: row;
// flex-grow: 1;
// opacity: 0.3;
position: fixed;
// bottom: 0rpx;
bottom: calc( 0rpx + constant(safe-area-inset-bottom));
bottom: calc( 0rpx + env(safe-area-inset-bottom));
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
width: 100%;
// height: 188rpx;
height: 112rpx;
// border: 1rpx solid blue;
background-color: rgb(255,255,255);
background-color: white;
.cg-footer-btn-confirm {
width: 100%;
height: 100%;
padding-left: 20rpx;
padding-right: 20rpx;
padding: 0 20rpx;
display: flex;
>button {
display: flex;
justify-content: center;
align-items: center;
@include centerFlex(center);
width: 100%;
height: 100%;
border-radius: 10rpx;
padding: 0 0;
color: rgb(255,255,255);
background-color: #FF873D;
color: white;
background-color: $orange;
border: transparent;
font-size: 32rpx;
font-weight: bold;
font-weight: 500;
}
}
}

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

@ -17,11 +17,7 @@
<view class="header-search-row">
<view @click="searchTrigger">
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称"
disabled
/>
<input type="text" placeholder="请输入商品名称" disabled />
</view>
<button hover-class="hover-active" @click="searchTrigger">搜索</button>
</view>
@ -30,14 +26,14 @@
<view class="main" :style="{ height:mainHeight }">
<scroll-view class="main-left" :scroll-top="categoryScrollTop" scroll-y="true" @scroll="categoryOnScroll">
<view class="main-left-list" v-if="item.isCateShow" v-for="item in goodsInfo" :key="item.cate.id">
<button plain=true @click="mainCategoryClick(item.cate.id)" :style="{ color:item.style.color, backgroundColor:item.style.backgroundColor }">{{ item.cate.erp_goods_cate_name }}</button>
<button plain=true @click="mainCategoryClick(item.cate.id)" :style="{ fontWeight: item.style.fontWeight, color:item.style.color, backgroundColor:item.style.backgroundColor }">{{ item.cate.erp_goods_cate_name }}</button>
</view>
</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 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 v-if="item.stock_num?false:true" class="item-left-empty">
<view>盘罄</view>
</view>
</view>
@ -49,14 +45,14 @@
</view>
<view class="item-right-price-count">
<view class="item-right-price-row" :style="{color:item.stock_num>0?'rgb(255,135,61)':'#9A9A9D'}">
<view class="item-right-price-row" :style="{color:item.stock_num?'#FF873D':'#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-if="item.count?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?true:false">{{ item.count }}</view>
<image v-if="item.stock_num?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>
@ -66,8 +62,11 @@
</view>
<hoverCartList
:isShowCartList="isShowCartList" :cartList="cartList" @update:clearCart="clearCart"
@update:cartInputConfirm="cartInputConfirm" @update:cartCountClick="cartCountClick" @update:maskClick="cartClick"
:isShowCartList="isShowCartList"
:cartList="cartList"
@update:clearCart="clearCart"
@update:cartCountClick="cartCountClick"
@update:maskClick="cartClick"
>
</hoverCartList>
@ -76,8 +75,8 @@
<view class="footer-price">
<view @click="cartClick">
<image mode="aspectFit" src="/static/images/icon/retail/cart.png"></image>
<view v-if="(totalCount>0 && !isShowCartList) ? true:false">{{ totalCount }}</view>
<view v-if="(cartTotalCount>0 && isShowCartList) ? true:false">{{ cartTotalCount }}</view>
<view v-if="(totalCount && !isShowCartList) ? true:false">{{ totalCount }}</view>
<view v-if="(cartTotalCount && isShowCartList) ? true:false">{{ cartTotalCount }}</view>
</view>
<view>合计</view>
<view v-if="!isShowCartList"><text></text>{{ totalPrice }}</view>
@ -99,14 +98,14 @@ import retailApi from '../../js/retail_api';
import hoverCartList from '../../components/hover_cart_list/hover_cart_list';
export default {
components: {
'hoverCartList': hoverCartList
},
components: {
'hoverCartList': hoverCartList ,
},
data(){
return {
categoryBtnStyle: { //
default: { "color":"rgb(154,154,157)", "backgroundColor":"rgba(0,0,0,0)" },
click: { "color":"rgb(0,152,116)", "backgroundColor":"rgb(205,235,228)" },
default: { fontWeight:"normal", color:"#9A9A9D", backgroundColor:"rgba(0,0,0,0)" },
click: { fontWeight:"600", color:"#009874", backgroundColor:"rgba(0,152,116,0.2)" },
},
categoryScrollTop: 0, //
categoryOldScrollTop: 0, //
@ -141,8 +140,8 @@ export default {
this.getRetailStatus(); //
},
watch: {
cartList() {
this.setCartConfirmStyle();
cartList() {
this.setCartConfirmStyle();
},
},
methods: {
@ -152,29 +151,18 @@ export default {
uni.getStorage({
key: 'retailStatus',
success: function (res) {
success: (res) => {
_this.getGoodsInfo(); //
_this.deleteRetailLocal(); //
},
fail: function(err) {
console.log(err);
_this.deleteRetailLocal(); //
},
fail: (err) => { _this.deleteRetailLocal();},
});
},
//
deleteRetailLocal() {
this.searchData = null;
uni.removeStorage({
key: 'retailStatus',
success: function (res) {
console.log('success');
}
});
uni.removeStorage({ key: 'retailStatus', success: (res) => {} });
},
//
categoryOnScroll(e) {
this.categoryOldScrollTop = e.detail.scrollTop;
@ -183,16 +171,12 @@ export default {
categoryGoTop(e) {
let _this = this;
_this.categoryScrollTop = _this.categoryOldScrollTop;
_this.$nextTick(function() {
_this.categoryScrollTop = 0;
});
_this.$nextTick(() => { _this.categoryScrollTop = 0; });
},
//
setSearchData(data) {
util.showLoad();
setTimeout(util.hideLoad, 1000);
setTimeout(util.hideLoad, 500);
this.goodsInfo[0].goods_list = [];
//
@ -206,77 +190,55 @@ export default {
}
}
for (let key in tempData) {
this.goodsInfo[0].goods_list.push(tempData[key]);
}
for (let key in tempData) this.goodsInfo[0].goods_list.push(tempData[key]);
//
let otherData = [];
for (let i = this.categoryIndex; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j)
otherData.push(this.goodsInfo[i].goods_list[j]);
}
}
for (let i = 0; i < this.goodsInfo[0].goods_list.length; ++i) {
for (let j = 0; j < otherData.length; ++j) {
if (this.goodsInfo[0].goods_list[i].id == otherData[j].id) {
if (this.goodsInfo[0].goods_list[i].id == otherData[j].id)
this.goodsInfo[0].goods_list[i].count = otherData[j].count;
}
}
}
// end
this.categoryGoTop(); //
this.goodsInfo[0].isCateShow = true;
this.mainCategoryClick(this.goodsInfo[0].cate.id);
},
//
getSearchLocal() {
let _this = this;
uni.getStorage({
key: 'searchData',
success: function (res) {
success: (res) => {
_this.setSearchData(res.data); //
_this.deleteSearchLocal(); //
},
fail: function(err) {
console.log(err);
_this.deleteSearchLocal(); //
},
fail: (err) => { _this.deleteSearchLocal(); },
});
},
//
deleteSearchLocal() {
this.searchData = null;
uni.removeStorage({
key: 'searchData',
success: function (res) {
console.log('success');
}
});
uni.removeStorage({ key: 'searchData', success: (res) => {} });
},
//
searchTrigger() {
let data = {
curStore: this.curStore,
};
let data = { curStore: this.curStore };
uni.navigateTo({
url: `/subpackage/retail/pages/search/search?data=${encodeURIComponent(JSON.stringify(data))}`
});
},
//
cartInputConfirm(value, i) {
this.cartList[i].erp_goods_price = value;
this.calcCartTotalPriceAndCount(); //
},
//
calcCartTotalPriceAndCount() {
let price = 0.0;
@ -286,24 +248,20 @@ export default {
price += (this.cartList[i].count * this.cartList[i].erp_goods_price);
count += this.cartList[i].count;
}
this.cartTotalPrice = price.toFixed(2);
this.cartTotalCount = count;
},
//
clearCart() {
this.cartList = [];
for (let i = 0; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j)
this.goodsInfo[i].goods_list[j].count = 0;
}
}
this.isShowCartList = false;
this.calcCartTotalPriceAndCount(); //
this.calcTotalPriceAndCount(); //
},
//
cartCountClick(type, i) {
//
@ -311,80 +269,52 @@ export default {
let mainItems = []; //
for (let i = 0; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
if (curId == this.goodsInfo[i].goods_list[j].id) {
if (curId == this.goodsInfo[i].goods_list[j].id)
mainItems.push(this.goodsInfo[i].goods_list[j]);
}
}
}
switch (type) {
case "add": {
//
if (this.cartList[i].count + 1 > this.cartList[i].stock_num) {
util.showNone("库存就这么多了!");
return;
}
this.cartList[i].count += 1;
for (let i = 0; i < mainItems.length; ++i) {
mainItems[i].count += 1;
}
for (let i = 0; i < mainItems.length; ++i) mainItems[i].count += 1;
} break;
case "sub": {
if (this.cartList[i].count > 0) {
this.cartList[i].count -= 1;
}
if (this.cartList[i].count > 0) this.cartList[i].count -= 1;
for (let i = 0; i < mainItems.length; ++i) {
if (mainItems[i].count > 0) {
mainItems[i].count -= 1;
}
if (mainItems[i].count > 0) mainItems[i].count -= 1;
}
} break;
}
//
if (this.cartList[i].count <= 0) {
this.cartList.splice(i, 1);
}
//
if (!this.cartList.length) {
this.isShowCartList = false;
}
if (this.cartList[i].count <= 0) this.cartList.splice(i, 1); //
if (!this.cartList.length) this.isShowCartList = false; //
this.calcCartTotalPriceAndCount(); //
this.calcTotalPriceAndCount(); //
},
//
getCartListFinalData() {
let arr = [];
for (let i = 0; i < this.cartList.length; ++i) {
if (this.cartList[i].count) {
arr.push(tools.getNewObj(this.cartList[i]));
}
if (this.cartList[i].count) arr.push(tools.getNewObj(this.cartList[i]));
}
return arr;
},
//
cartConfirm() {
if (this.cartList.length <= 0) {
return;
}
if (this.cartList.length <= 0) return;
this.cartListFinal = this.getCartListFinalData();
//
if (this.cartListFinal.length) {
this.isShowCartList = false;
let data = {
cartListFinal: this.cartListFinal,
curStore: this.curStore,
};
let data = { cartListFinal: this.cartListFinal, curStore: this.curStore };
uni.navigateTo({
url: `/subpackage/retail/pages/confirm_goods/confirm_goods?data=${encodeURIComponent(JSON.stringify(data))}`
});
@ -393,7 +323,6 @@ export default {
util.showNone("购物车无数据!");
}
},
//
addToCartList() {
this.cartList = [];
@ -401,42 +330,33 @@ export default {
//
for (let i = this.categoryIndex; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
if (this.goodsInfo[i].goods_list[j].count) {
if (this.goodsInfo[i].goods_list[j].count)
this.cartList.push(tools.getNewObj(this.goodsInfo[i].goods_list[j]));
}
}
}
//
let tempData = this.findDifferentData(); //
for (let i = 0; i < tempData.length; ++i) {
this.cartList.push(tools.getNewObj(tempData[i]));
}
for (let i = 0; i < tempData.length; ++i) this.cartList.push(tools.getNewObj(tempData[i]));
},
setCartConfirmStyle() {
this.cartConfirmOpacity = this.cartList.length > 0 ? 1 : 0.3;
},
//
cartClick() {
if (!this.cartList.length) {
return;
}
if (!this.cartList.length) return;
if (this.isShowCartList) {
this.isShowCartList = false;
}
else {
this.addToCartList(); //
this.cartTotalPrice = this.totalPrice;
this.cartTotalCount = this.totalCount;
this.isShowCartList = true;
this.calcCartTotalPriceAndCount(); //
}
},
//
fixMainHeight() {
let _this = this;
@ -458,43 +378,33 @@ export default {
}
});
},
//
findDifferentData() {
let searchAndHotData = [];
for (let i = 0; i < this.categoryIndex; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j)
searchAndHotData.push(this.goodsInfo[i].goods_list[j]);
}
}
let otherData = [];
for (let i = this.categoryIndex; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j)
otherData.push(this.goodsInfo[i].goods_list[j]);
}
}
let mark = false;
let tempData = [];
for (let i = 0; i < searchAndHotData.length; ++i) {
mark = false; //
for (let j = 0; j < otherData .length; ++j) {
if (searchAndHotData[i].id == otherData [j].id) {
mark = true;
}
if (searchAndHotData[i].id == otherData [j].id) mark = true;
}
//
if (!mark && searchAndHotData[i].count) {
tempData.push(searchAndHotData[i]);
}
if (!mark && searchAndHotData[i].count) tempData.push(searchAndHotData[i]);
}
return tempData;
},
//
calcTotalPriceAndCount() {
let price = 0.0;
@ -516,11 +426,9 @@ export default {
count += tempData[i].count;
}
}
this.totalPrice = price.toFixed(2);
this.totalCount = count;
},
//
mainCountClick(type, id, cateName, goodsId, stockNum) {
if (stockNum <= 0) return;
@ -548,7 +456,6 @@ export default {
if (goodsItem) {
switch (type) {
case "add": {
//
if (goodsItem.count + 1 > goodsItem.stock_num) {
util.showNone("库存就这么多了!");
return;
@ -556,10 +463,7 @@ export default {
goodsItem.count += 1;
} break;
case "sub": {
if (goodsItem.count <= 0) {
return;
}
if (goodsItem.count <= 0) return;
goodsItem.count -= 1;
} break;
}
@ -568,16 +472,13 @@ export default {
//
for (let i = 0; i < this.goodsInfo.length; ++i) {
for (let j = 0; j < this.goodsInfo[i].goods_list.length; ++j) {
if (this.goodsInfo[i].goods_list[j].id == goodsItem.id) {
if (this.goodsInfo[i].goods_list[j].id == goodsItem.id)
this.goodsInfo[i].goods_list[j].count = goodsItem.count;
}
}
}
this.calcTotalPriceAndCount(); //
this.addToCartList(); //
},
//
mainCategoryClick(id) {
//
@ -586,9 +487,7 @@ export default {
this.goodsInfo[i].style = this.categoryBtnStyle.default;
this.goodsInfo[i].isShow = false;
if (this.goodsInfo[i].cate.id == id) {
item = this.goodsInfo[i];
}
if (this.goodsInfo[i].cate.id == id) item = this.goodsInfo[i];
}
if (item) {
@ -596,7 +495,6 @@ export default {
item.isShow = true;
}
},
//
getGoodsInfo() {
let _this = this;
@ -628,18 +526,13 @@ export default {
for (let i = 0; i < res.data.data.list.length; ++i) {
//
if (!res.data.data.list[i].goods_list || !res.data.data.list[i].goods_list.length) {
// res.data.data.list[i].goods_list = [];
continue;
}
if (!res.data.data.list[i].goods_list || !res.data.data.list[i].goods_list.length) continue;
if (res.data.data.list[i].cate.erp_goods_cate_name == "热销") {
_this.categoryIndex = 2; // 2
}
// 2
if (res.data.data.list[i].cate.erp_goods_cate_name == "热销") _this.categoryIndex = 2;
for (let j = 0; j < res.data.data.list[i].goods_list.length; ++j) {
for (let j = 0; j < res.data.data.list[i].goods_list.length; ++j)
res.data.data.list[i].goods_list[j].count = 0; //
}
res.data.data.list[i].isCateShow = true;
res.data.data.list[i].isShow = false;
@ -655,7 +548,6 @@ export default {
_this.goodsInfo[1].isShow = true;
}
_this.categoryGoTop(); //
util.hideLoad();
}
else {
@ -664,7 +556,6 @@ export default {
}
});
},
//
getStoreList() {
util.showLoad();
@ -691,7 +582,6 @@ export default {
}
});
},
//
curStoreChange(e) {
let _this = this;
@ -707,12 +597,10 @@ export default {
</script>
<style lang="scss">
@function toDouble($value) {
@return $value * 2;
}
@import '~style/public.scss';
$orange: #FF873D;
page {
background-color: rgb(255,255,255);
background-color: white;
}
.container {
@ -725,65 +613,48 @@ export default {
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.header {
// height: 230rpx;
// border: 1rpx solid red;
display: flex;
flex-direction: column;
background-color: rgb(237,237,245);
background-color: #F2F2F7;
z-index: 0;
.header-store-selecter {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
padding-left: 38rpx;
fotn-size: 32rpx;
& {
position: relative;
height: 78rpx;
line-height: 78rpx;
}
.header-store-selecter-name {
height: 78rpx;
height: 100%;
line-height: 78rpx;
fotn-size: 16rpx;
margin-right: 14rpx;
color: #333333;
}
.header-store-selecter-left-img {
width: 36rpx;
height: 36rpx;
}
.header-store-selecter-right-img {
width: 18rpx;
height: 18rpx;
}
}
.header-search-row {
display: flex;
align-items: center;
justify-content: center;
@include centerFlex(center);
height: 92rpx;
margin-top: 17rpx;
>view {
display: flex;
align-items: center;
justify-content: space-between;
@include centerFlex(space-between);
flex-grow: 1;
height: 92rpx;
height: 100%;
border-radius: 10rpx;
background-color: #FFFFFF;
background-color: white;
margin-left: 24rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding: 0 20rpx;
>input {
flex-grow: 1;
height: 100%;
font-size: 32rpx;
}
>image{
flex-shrink: 0;
@ -794,37 +665,32 @@ export default {
}
>button {
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
margin: 0 20rpx;
padding: 0 0;
width: 142rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: #FFFFFF;
background-color: #009874;
color: white;
background-color: $themeColor;
border-radius: 10rpx;
white-space: nowrap;
padding: 0 0;
font-size: 32rpx;
}
}
}
.main {
display: flex;
flex-direction: row;
justify-content: space-between;
// border: 1rpx solid green;
position: relative;
background-color: rgb(237,237,245);
background-color: #F2F2F7;
padding-top: 24rpx;
// padding-bottom: 18rpx;
padding-bottom: calc( 18rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 18rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.main-left {
width: 180rpx;
margin-right: 12rpx;
background-color: rgb(255,255,255);
background-color: white;
border-top-right-radius: 30rpx;
.main-left-list {
@ -838,35 +704,28 @@ export default {
border-radius: 0rpx;
border-top-right-radius: 30rpx;
border: 0rpx;
color: rgb(154,154,157);
background-color: rgba(0,0,0,0);
font-size: 25rpx;
font-size: 28rpx;
}
}
}
.main-right {
width: 558rpx;
background-color: rgb(255,255,255);
border-radius: 10rpx;
display: flex;
flex-direction: column;
width: 558rpx;
background-color: white;
border-radius: 10rpx;
padding-left: 20rpx;
// padding-right: 20rpx;
.main-right-list {
// border-bottom: 1rpx solid rgb(237,237,245);
display: flex;
flex-direction: row;
padding-top: 20rpx;
padding-bottom: 20rpx;
// border: 1px solid red;
padding: 20rpx 0;
.item-left {
position: relative;
width: 172rpx;
height: 172rpx;
margin-right: 20rpx;
// border: 1px solid red;
position: relative;
border-radius: 10rpx;
>image {
@ -877,15 +736,14 @@ export default {
width: 100%;
height: 100%;
position: absolute;
top: 0rpx;
left: 0rpx;
top: 0;
left: 0;
background-color: rgba(0,0,0,0.5);
border-radius: 10rpx;
>view {
font-size: 28rpx;
color: #333333;
background: #FFFFFF;
background: white;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
@ -893,9 +751,7 @@ export default {
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: flex;
justify-content: center;
align-items: center;
@include centerFlex(center);
}
}
}
@ -903,23 +759,20 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-between;
// border: 1px solid red;
flex-grow: 1;
padding-right: 20rpx;
.item-right-top {
display: flex;
flex-direction: column;
// border: 1px solid black;
.item-right-name {
font-size: 28rpx;
}
.item-right-spec {
margin-top: 8rpx;
margin-bottom: 14rpx;
margin: 8rpx 0 14rpx 0;
font-size: 24rpx;
color: rgb(154,154,157);
color: #9A9A9D;
}
.item-right-special {
width: 58rpx;
@ -934,34 +787,25 @@ export default {
}
.item-right-price-count {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
// border: 1rpx solid green;
@include centerFlex(space-between);
.item-right-price-row {
// display: flex;
// flex-direction: row;
// align-items: center;
color: rgb(255,135,61);
color: $orange;
>view {
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
font-size: 36rpx;
line-height: 32rpx;
font-weight: 500;
>text {
font-size: 28rpx;
line-height: 28rpx;
font-weight: 400;
}
}
}
.item-right-count-row {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
>image {
&:first-child {
@ -974,9 +818,7 @@ export default {
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
margin: 0 12rpx;
font-size: 28rpx;
}
}
@ -985,110 +827,90 @@ export default {
}
}
}
.footer {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
@include centerFlex(center);
position: fixed;
// bottom: 0rpx;
bottom: calc( 0rpx + constant(safe-area-inset-bottom));
bottom: calc( 0rpx + env(safe-area-inset-bottom));
// padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* iOS < 11.2 */
// padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* iOS >= 11.2 */
width: 100%;
height: 108rpx;
// border: 1rpx solid blue;
background-color: rgb(255,255,255);
background-color: white;
>view {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
@include centerFlex(space-between);
flex-grow: 1;
// border: 1px solid red;
// margin-top: 24rpx;
.footer-price {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
margin-left: 36rpx;
>view {
&:first-child {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
// border: 1rpx solid green;
@include centerFlex(flex-start);
>image {
width: 84rpx;
height: 84rpx;
}
>view {
position: absolute;
top: 0rpx;
right: 0rpx;
color: rgb(255,255,255);
background-color: rgb(230,0,18);
top: 0;
right: 0;
color: white;
background-color: #E60012;
font-size: 20rpx;
line-height: 40rpx;
border-radius: 100%;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
}
}
&:nth-child(2) {
flex-shrink: 0;
margin-left: 10rpx;
font-size: 24rpx;
line-height: 24rpx;
font-size: 28rpx;
line-height: 28rpx;
}
&:nth-child(3) {
font-size: 32rpx;
line-height: 32rpx;
color: rgb(255,135,61);
font-size: 40rpx;
line-height: 40rpx;
color: $orange;
>text {
font-size: 24rpx;
line-height: 24rpx;
font-size: 28rpx;
line-height: 28rpx;
}
}
&:nth-child(4) {
font-size: 32rpx;
line-height: 32rpx;
color: rgb(255,135,61);
font-size: 40rpx;
line-height: 40rpx;
color: $orange;
>text {
font-size: 24rpx;
line-height: 24rpx;
font-size: 28rpx;
line-height: 28rpx;
}
}
}
}
.footer-confirm {
display: flex;
flex-direction: row;
align-items: center;
@include centerFlex(flex-start);
margin-right: 24rpx;
>button {
flex-shrink: 0;
width: 240rpx;
height: 88rpx;
line-height: 88rpx;
color: #FFFFFF;
font-weight: 500;
font-size: 32rpx;
line-height: 88rpx;
border: 0rpx;
border-radius: 10rpx;
background-color: #009874;
color: white;
background-color: $themeColor;
white-space: nowrap;
padding: 0 0;
opacity: 0.3;

37
src/subpackage/retail/pages/pay_success/pay_success.vue

@ -9,54 +9,33 @@
<script>
export default {
data() {
return {
}
return {}
},
onLoad() {
uni.setStorage({
key: "paySuccess",
data: "true",
success: function() {},
fail: function(err) {},
});
uni.setStorage({ key: "paySuccess", data: "true", success: () => {}, fail: () => {} });
},
methods: {
review() {
//
uni.removeStorage({
key: 'retailStatus',
success: function (res) {}
});
uni.removeStorage({
key: 'paySuccess',
success: function (res) {}
});
uni.reLaunch({
url: `/pages/order_list/order_list?order_type=19`,
complete: function(res) {
console.log(res);
}
});
uni.removeStorage({ key: 'retailStatus', success: () => {} });
uni.removeStorage({ key: 'paySuccess', success: () => {} });
uni.reLaunch({ url: `/pages/order_list/order_list?order_type=19` });
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.success-container {
display: flex;
@include centerFlex(flex-start);
flex-direction: column;
// justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
padding-bottom: 0rpx;
padding-bottom: calc( 0rpx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
font-size: 32rpx;
color: #333333;
>image {
width: 132rpx;
@ -64,7 +43,7 @@
margin-top: 60rpx;
}
>view {
font-weight: bold;
font-weight: 500;
margin-top: 30rpx;
margin-bottom: 102rpx;
}

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

@ -3,12 +3,7 @@
<view class="search-row">
<view>
<image mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input
type="text"
placeholder="请输入商品名称"
v-model="searchText"
focus="true"
/>
<input type="text" placeholder="请输入商品名称" v-model="searchText" focus="true" />
<image @click="searchClear" mode="aspectFit" src="/static/images/icon/retail/searchClear.png"></image>
</view>
<button hover-class="hover-active" @click="searchTrigger(searchText, 'search')">搜索</button>
@ -41,7 +36,6 @@
},
onLoad(option) {
this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
},
@ -56,30 +50,22 @@
let _this = this;
uni.showModal({
content: '确人删除全部历史记录?',
success: function (res) {
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
_this.historyList = [];
uni.removeStorage({
key: 'searchHistoryData',
success: function (res) {
console.log('success');
}
success: (res) => {}
});
}
else if (res.cancel) {
console.log('用户点击取消');
}
else if (res.cancel) {}
}
});
},
//
searchClear() {
this.searchText = "";
},
//
searchTrigger(text, type) {
if (!text) {
@ -94,31 +80,23 @@
uni.setStorage({
key: 'searchHistoryData',
data: _this.historyList,
success: function() {
console.log('success');
},
fail: function(err) {
console.log(err);
},
success: () => {},
fail: () => {},
});
}
util.showLoad();
retailServer.get({
url: retailApi.assistantListErpGoodsCateAndGoods,
data: {
assistant_key: text,
stadium_id: _this.curStore.id,
},
data: { assistant_key: text, stadium_id: _this.curStore.id },
isDefaultGet: false,
failMsg: '搜索失败!'
}).then(res => {
if (res.data.code == 0) {
let mark = false;
for (let i = 0; i < res.data.data.list.length; ++i) {
if (res.data.data.list[i].goods_list && res.data.data.list[i].goods_list.length) {
if (res.data.data.list[i].goods_list && res.data.data.list[i].goods_list.length)
mark = true;
}
}
//
@ -130,17 +108,11 @@
uni.setStorage({
key: "searchData",
data: res.data.data.list,
success: function() {
success: () => {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
util.showNone("搜索失败");
uni.navigateBack({ delta: 1 }); //
},
fail: (err) => { util.showNone("搜索失败"); },
});
}
else {
@ -148,23 +120,16 @@
}
});
},
//
getSearchHistory() {
let _this = this;
uni.getStorage({
key: 'searchHistoryData',
success: function (res) {
success: (res) => {
console.log(res.data);
for (let i = 0; i < res.data.length; ++i) {
_this.historyList.push(res.data[i]);
}
},
fail: function(err) {
console.log(err);
_this.historyList = [];
for (let i = 0; i < res.data.length; ++i) _this.historyList.push(res.data[i]);
},
fail: (err) => { _this.historyList = []; },
});
},
}
@ -172,6 +137,7 @@
</script>
<style lang="scss">
@import '~style/public.scss';
.search-container {
display: flex;
flex-direction: column;
@ -182,23 +148,18 @@
padding-bottom: calc( 0rpx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.search-row {
display: flex;
align-items: center;
justify-content: center;
@include centerFlex(center);
height: 152rpx;
background-color: rgb(255,255,255);
background-color: white;
>view {
display: flex;
align-items: center;
justify-content: space-between;
@include centerFlex(space-between);
flex-grow: 1;
height: 92rpx;
border-radius: 10rpx;
background-color: rgb(242,242,247);
margin-left: 24rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding: 0 20rpx;
>input {
flex-grow: 1;
@ -222,38 +183,30 @@
}
>button {
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
padding: 0 0;
margin: 0 20rpx;
width: 142rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: #FFFFFF;
background-color: #009874;
color: white;
background-color: $themeColor;
border-radius: 10rpx;
white-space: nowrap;
padding: 0 0;
}
}
.history-search {
display: flex;
@include centerFlex(center);
flex-direction: column;
justify-content: center;
align-items: center;
background-color: white;
padding-top: 26rpx;
padding-left: 26rpx;
padding: 26rpx 0 0 26rpx;
>view {
width: 100%;
&:first-child {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 26rpx;
@include centerFlex(space-between);
>view {
font-size: 32rpx;
@ -267,26 +220,18 @@
}
}
&:nth-child(2) {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
@include centerFlex(flex-start);
>view {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
@include centerFlex(center);
height: 66rpx;
font-size: 28rpx;
color: rgb(193,193,199);
background-color: rgb(242,242,247);
color: #c1c1c7;
background-color: #f2f2f7;
border-radius: 32rpx;
padding-left: 30rpx;
padding-right: 30rpx;
margin-right: 26rpx;
margin-bottom: 26rpx;
padding: 0 30rpx;
margin: 0 26rpx 26rpx 0;
}
}
}

Loading…
Cancel
Save