34 Commits

Author SHA1 Message Date
张家华 257d5c31cf v 1.1.26 formal 3 years ago
张家华 657b909b3d Merge branch 'dev' 3 years ago
张家华 e6fc485bcb Merge branch 'feat-retail' into dev 3 years ago
张家华 5754485806 retail fix 3 years ago
张家华 e8a04e7dae Merge branch 'feat-retail' into dev 3 years ago
张家华 da6a236f5c 零售订单退款字段修改 3 years ago
张家华 8b14a5c839 Merge branch 'feat-retail' into dev 3 years ago
张家华 ebfb80f1c2 update 3 years ago
张家华 ccbc46c223 Merge branch 'feat-retail' into dev 3 years ago
张家华 47150868dc retail style 3 years ago
张家华 3e2190a0a0 Merge branch 'feat-retail' into dev 3 years ago
张家华 b5c641caaa 零售途径 3 years ago
张家华 0de22d4c5b Merge branch 'feat-retail' into dev 3 years ago
张家华 2c88a568ff 零售列表borderTop 3 years ago
张家华 4f5d0595d3 Merge branch 'feat-retail' into dev 3 years ago
张家华 e565fd87d3 零售fix 3 years ago
张家华 1c8bb2deef Merge branch 'feat-retail' into dev 3 years ago
张家华 20c353895a 零售订单详情 3 years ago
张家华 193bb49101 Merge branch 'feat-retail' into dev 3 years ago
张家华 e825bd72ff 零售订单详情单价修改 3 years ago
张家华 16536795cd Merge branch 'feat-retail' into dev 3 years ago
张家华 0a19f5770e retail-fix 3 years ago
张家华 29c04d5d99 Merge branch 'feat-retail' into dev 3 years ago
张家华 24b6d23cb7 retail-update 3 years ago
张家华 2bb6815988 update 3 years ago
张家华 c461ce8154 retail update 3 years ago
张家华 914cb3ab8f 零售订单调整 3 years ago
张家华 5cf49633a5 零售商品页修整 3 years ago
刘嘉炜 26ad63669a change curriclum order end time 3 years ago
张家华 4cdf2a1955 零售订单样式调整 3 years ago
张家华 d2ac2f407e 零售样式调整 3 years ago
张家华 2fbfecf88c 零售订单管理修改 3 years ago
张家华 fb2b9f7b50 零售完善 3 years ago
张家华 48e260a113 零售改版 3 years ago
  1. 43
      src/components/order_list/retail/retail.vue
  2. 14
      src/pages.json
  3. 2
      src/pages/order_list/order_list.vue
  4. BIN
      src/static/images/icon/retail/addEmpty.png
  5. BIN
      src/static/images/icon/retail/paySuccess.png
  6. BIN
      src/static/images/icon/retail/storeIcon.png
  7. 1
      src/subpackage/order/js/api.js
  8. 2
      src/subpackage/order/pages/curriculum/detail/detail.vue
  9. 256
      src/subpackage/order/pages/retail/detail/detail.vue
  10. 221
      src/subpackage/retail/components/hover_cart_list/hover_cart_list.vue
  11. 498
      src/subpackage/retail/components/retail_pay_way/retail_pay_way.vue
  12. 275
      src/subpackage/retail/components/store_card_select/store_card_select.vue
  13. 2
      src/subpackage/retail/js/retail_api.js
  14. 488
      src/subpackage/retail/pages/confirm_goods/confirm_goods.vue
  15. 471
      src/subpackage/retail/pages/confirm_order/confirm_order.vue
  16. 847
      src/subpackage/retail/pages/index/index.vue
  17. 56
      src/subpackage/retail/pages/pay_success/pay_success.vue
  18. 158
      src/subpackage/retail/pages/search/search.vue

43
src/components/order_list/retail/retail.vue

@ -1,6 +1,11 @@
<template>
<view class="retail-order" @click="toInfo">
<a-header :source="orderInfo.source || '-'" :status="getStatus(orderInfo.pay_status)"></a-header>
<view class="ro-header">
<view class="rh-view">{{orderInfo.stadium_name || '-'}}</view>
<text
:class="[ 'rh-text', orderInfo.pay_status == 1?'rh-active':'', orderInfo.pay_status == 4?'rh-red':'' ]"
>{{getStatus(orderInfo.pay_status)}}</text>
</view>
<!-- 商品名称: 操作人 购买时间: -->
<view class="ro-info">
<a-line :value="orderInfo.order_no || '-'">
@ -9,8 +14,8 @@
<a-line :value="getGoodsName || '-'">
<block slot="name">商品名称</block>
</a-line>
<a-line :value="orderInfo.sys_optuname || '-'">
<block slot="name">操作</block>
<a-line :value="orderInfo.retail_source || '-'">
<block slot="name">操作途径</block>
</a-line>
<a-line :value="orderInfo.pay_time || '-'">
<block slot="name">购买时间</block>
@ -22,20 +27,18 @@
<script>
import util from '../../../utils/util';
import a_header from '../a_header/a_header.vue';
import a_line from '../a_line/a_line.vue';
export default {
computed: {
getGoodsName(){
let { orderInfo } = this;
let _ls = orderInfo&&orderInfo.retail_order_goods || [];
let _str = _ls.map(e=>e.name).join(';');
let _str = _ls.map(e=>`${e.erp_retail_goods ? e.erp_retail_goods.goods_name : e.name}${e.spec}】x${e.nums}`).join(';');
if(_ls.length)_str += ';'
return _str
}
},
components: {
'a-header': a_header,
'a-line': a_line,
},
props: {
@ -47,7 +50,8 @@ export default {
methods: {
getStatus(status){
let _obj = {
1: '交易成功'
1: '交易成功',
4: '已退款'
}
return _obj[status] || '-'
},
@ -66,6 +70,31 @@ export default {
padding: 0 20upx 20upx;
border-radius: 10upx;
}
.ro-header{
margin-bottom: 18upx;
height: 98upx;
line-height: 96upx;
border-bottom: 2upx solid #D8D8D8;
@include centerFlex(space-between);
.rh-view{
flex-grow: 1;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
.rh-text{
margin-left: 20upx;
flex-shrink: 0;
font-size: 28upx;
color: #9A9A9D;
}
.rh-active{
color: #9A9A9D;
}
.rh-red{
color: #EA5061;
}
}
.ro-info{
}

14
src/pages.json

@ -435,7 +435,19 @@
{
"path": "pages/confirm_goods/confirm_goods",
"style" : {
"navigationBarTitleText": "确定商品"
"navigationBarTitleText": "确认订单"
}
},
{
"path": "pages/confirm_order/confirm_order",
"style" : {
"navigationBarTitleText": "确认订单"
}
},
{
"path": "pages/pay_success/pay_success",
"style" : {
"navigationBarTitleText": "支付订单"
}
},
{

2
src/pages/order_list/order_list.vue

@ -587,7 +587,7 @@
case 8: // status 1,2,4 1 2 退4 5
return [ {id: '1,2,4', name: '全部'}, {id: 1, name: '租用中'}, {id: 2, name: '已完成'}, {id: 4, name: '已退款'},{id: 5, name: '已购买'}];
case 19: // status status = 1
return [ {id: 1, name: '交易成功'} ];
return [ {id: 1, name: '交易成功'}, {id: 4, name: '已退款'} ];
case 20: // status 0,1,2,3 0 使 1 2 退 3
return [ {id: '', name: '全部'}, {id: 0, name: '待激活'}, {id: 1, name: '使用中'}, {id: 2, name: '已失效'},{id: 3, name: '已退卡'}];
default:

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

After

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

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

After

Width: 132  |  Height: 132  |  Size: 1.4 KiB

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

After

Width: 32  |  Height: 30  |  Size: 1.1 KiB

1
src/subpackage/order/js/api.js

@ -24,6 +24,7 @@ export const ORDER_API = {
rentballOrderEnd:`${ORIGIN}/admin/assistant/rentball/order/end`, // 租球机-结束计费
leaseOrderEnd:`${ORIGIN}/admin/stadium/leaseOrder/endBill`, // 租售柜-结束计费
retailOrderInfo:`${ORIGIN}/admin/erp/retailOrder/info`, // 订单管理-零售订单详情
retailOrderInfoRefundList: `${ORIGIN}/admin/stadium/order/refundList`, // 订单管理-零售订单详情退款列表
userMonthlyCardInfo:`${ORIGIN}/admin/userMonthlyCard/get`, // 详情用户年月卡-后台
ymCardInfoFace:`${ORIGIN}/upload/file/ym_card_face`, // 年月卡用户头像上传
ymCardInfoFaceSave:`${ORIGIN}/admin/userMonthlyCard/updateFace`, // 年月卡用户头像保存

2
src/subpackage/order/pages/curriculum/detail/detail.vue

@ -30,7 +30,7 @@
{{ orderInfo.course_period_nums_give >= 0 ? '赠送课时:':'扣减课时:'}}
</block>
</a-line>
<a-line :value="orderInfo.expired_at || '-'">
<a-line :value="orderInfo.end_time || '-'">
<block slot="name">有效期至</block>
</a-line>
<a-line :value="orderInfo.course_period">

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

@ -1,38 +1,110 @@
<template>
<view class="retail-container">
<view class="rc-header">
<a-header :source="orderInfo.source || '-'" :status="getStatus(orderInfo.pay_status)"></a-header>
<view class="ra-header">
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<text>{{ orderInfo.stadium_name || '-' }}</text>
<view></view>
</view>
<view class="rh-name">
<a-line :value="orderInfo.sys_optuname || '-'">
<block slot="name">操作人</block>
</a-line>
<view class="rh-name-line">
<view>
<view>微信昵称</view>
<text>{{ orderInfo.nickname || '-' }}</text>
</view>
<view :style="{color:getStatus(orderInfo.pay_status)==='已退款'?'#EA5061':'#9C9C9F'}">{{ getStatus(orderInfo.pay_status) }}</view>
</view>
<view class="rh-name-line">
<view>
<view>手机号码</view>
<text>{{ orderInfo.mobile || '-' }}</text>
</view>
</view>
<!-- <view class="rh-name-line">
<view>
<view>身份</view>
<text>{{ orderInfo.sys_optuname || '-' }}</text>
</view>
</view> -->
<view class="rh-name-line">
<view>
<view>下单途径</view>
<text>{{ orderInfo.retail_source || '-' }}</text>
</view>
</view>
</view>
</view>
<view class="rc-goods-info" v-if="orderInfo.retail_order_goods&&orderInfo.retail_order_goods.length">
<view class="rgi-tit">商品详情</view>
<view class="rgi-goods-ls">
<view class="rgl-item" v-for="(e, i) in orderInfo.retail_order_goods" :key="i">
<!-- 商品名称 咖啡 数量1 价格3 -->
<a-line :value="e.name || '-'">
<block slot="name">商品名称</block>
</a-line>
<a-line :value="e.nums || '0'">
<block slot="name">数量</block>
</a-line>
<a-line :value="'¥' + (e.price || '0')">
<block slot="name">价格</block>
</a-line>
<view class="rgl-item-desc">
<view>{{ e.erp_retail_goods ? (e.erp_retail_goods.goods_name || '-') : (e.name || '-') }}</view>
<view>{{ e.price || 0 }}</view>
</view>
<view class="rgl-item-sku">sku{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_sku : '-') : '-' }}</view>
<view class="rgl-item-type-spec">
<view>型号{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_type : '-') : '-' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格{{ e.spec || '-' }}</view>
<text>x{{ e.nums || 0 }}</text>
</view>
<view v-if="orderInfo.retail_order_goods.length - 1 == i ? false : true" class="rgl-item-bottom-line"></view>
</view>
</view>
</view>
<view class="rc-total-amount-info">
<view class="rc-total-amount-line">
<view>金额小计</view>
<text>{{ orderInfo.amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>积分抵扣</view>
<text>{{ orderInfo.deduction_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>折扣金额</view>
<text>-{{ orderInfo.discount_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>优惠券优惠</view>
<text>-{{ orderInfo.coupons_amount || 0 }}</text>
</view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
</view>
<view class="rc-pay-info">
<!-- 订单编号 -->
<view class="rpi-tit">支付详情</view>
<p-line :keyname="'订单编号'" :value="orderInfo.order_no || '-'" isbtn></p-line>
<p-line :keyname="'支付方式'" :value="payTypeTxt(orderInfo.pay_type)"></p-line>
<!-- <p-line :keyname="'支付方式'" :value="payTypeTxt(orderInfo.pay_type, orderInfo.card_no)"></p-line> -->
<p-line :keyname="'支付方式'" :value="orderInfo.extension ? orderInfo.extension.pay_type_text || '-' : '-'"></p-line>
<p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line>
</view>
<!-- <view v-if="orderInfo.refunds&&orderInfo.refunds.length">
<view class="rc-refund-info" v-for="(item, index) in orderInfo.refunds" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="item.refund_amount ? '¥' + item.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.refund_reason || '-'"></p-line>
</view>
</view> -->
<!-- <view v-if="orderInfo.refund_no">
<view class="rc-refund-info">
<view class="rpi-tit">退款信息</view>
<p-line :keyname="'退款金额:'" :value="orderInfo.refund_amount ? '¥' + orderInfo.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="orderInfo.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="orderInfo.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="orderInfo.refund_reason || '商家主动退款'"></p-line>
</view>
</view> -->
<view v-if="refundList.length">
<view class="rc-refund-info" v-for="(item, index) in refundList" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="`¥${item.amount}`"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.reason || '商家主动退款'"></p-line>
</view>
</view>
</view>
</template>
@ -40,30 +112,42 @@
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
import a_header from '../../../../../components/order_list/a_header/a_header.vue';
import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue';
import { mapState } from 'vuex';
export default {
components: {
'a-line': a_line,
'a-header': a_header,
's-line': s_line,
'p-line': p_line,
},
data(){
return {
orderInfo: {}
orderInfo: {},
refundList: []
}
},
computed:{
...mapState([ 'brandInfo',])
},
onLoad(options){
this.getOrderInfo(options.order_no);
},
methods: {
payTypeTxt: util.order_pay_type_txt,
// payTypeTxt: util.order_pay_type_txt,
payTypeTxt(payType, cardNo) {
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: `储值卡支付 ${cardNo ? '(' + cardNo + ')' : ''}`,
3: '现金支付',
4: '其他'
};
return _obj[payType] || '-'
},
getStatus(status){
let _obj = {
1: '交易成功'
1: '交易成功',
4: '已退款'
}
return _obj[status] || '-'
},
@ -71,13 +155,25 @@ export default {
util.showLoad();
server.get({
url: ORDER_API.retailOrderInfo,
data: { order_no },
data: { order_no, brand_id: this.brandInfo.brand.id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
// this.orderInfo.refunds = [
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason },
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason }
// ];
server.get({
url: ORDER_API.retailOrderInfoRefundList,
data: { order_no, brand_id: this.brandInfo.brand.id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.refundList = res.list;
});
});
},
}
@ -93,23 +189,114 @@ export default {
margin-bottom: 26upx;
padding: 0 24upx;
background-color: #fff;
.rh-name{
.ra-header {
position: relative;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
height: 30upx;
margin-right: 14upx;
}
>text {
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
}
>view {
position: absolute;
bottom: 0%;
width: 100%;
height: 2upx;
background-color: #D8D8D8;
}
}
.rh-name{
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
font-weight: 400;
margin-bottom: 10upx;
>view {
&:first-child {
color: #9C9C9F;
@include centerFlex(flex-start);
flex-grow: 1;
>view {
width: 152upx;
flex-shrink: 0;
}
>text {
color: #333;
@include textHide(1);
}
}
&:nth-child(2) {
flex-shrink: 0;
}
}
}
}
}
.rc-goods-info{
margin-bottom: 24upx;
padding: 0 24upx;
padding: 30upx 24upx 46upx 24upx;
background-color: #fff;
font-weight: 500;
.rgi-tit{
padding-top: 20upx;
font-size: 32upx;
font-weight: 500;
color: #1a1a1a;
}
.rgi-goods-ls{
.rgl-item{
padding: 30upx 0;
border-bottom: 2upx solid #D8D8D8;
padding-top: 30upx;
// border-bottom: 2upx solid #D8D8D8;
color: #9C9C9F;
font-size: 28upx;
.rgl-item-desc {
display: flex;
justify-content: space-between;
margin-bottom: 20upx;
color: #333;
}
.rgl-item-sku {
margin-bottom: 10upx;
}
.rgl-item-type-spec {
display: flex;
justify-content: space-between;
align-items: flex-end;
>text {
color: #333;
}
}
.rgl-item-bottom-line {
width: 100%;
height: 2upx;
background-color: #D8D8D8;
margin-top: 18upx;
}
}
}
}
.rc-total-amount-info{
margin-bottom: 24upx;
padding: 0 24upx;
padding-top: 1upx;
background-color: #fff;
font-size: 28upx;
.rc-total-amount-line {
margin-top: 26upx;
@include centerFlex(space-between);
>text {
font-size: 24upx;
}
}
.rgi-total{
@ -137,4 +324,15 @@ export default {
color: #333;
}
}
.rc-refund-info{
padding: 30upx;
margin-top: 24upx;
background-color: #fff;
.rpi-tit{
margin-bottom: 16upx;
line-height: 44upx;
font-size: 28upx;
color: #9C9C9F;
}
}
</style>

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

@ -1,38 +1,47 @@
<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 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="item.goods_img"></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 class="item-right">
<view class="item-right-top">
<view class="item-right-name">{{ item.goods_name }}</view>
<view class="item-right-spec">{{ `${item.erp_goods.erp_goods_specs}/${item.erp_goods.erp_goods_type}/${item.erp_goods.erp_goods_sku}` }}</view>
</view>
<view class="hover-cart-list-dialog-content-col3">
<view class="item-right-price-count">
<view class="item-right-price-row">
<view><text></text>{{ item.assistant_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>
</view>
</view>
</template>
<script>
import tools from '../../js/tools';
export default {
props: [
"isShowCartList", "cartList", "cartListScroll",
"cartListHeight", "cartListDialogHeight", "cartListItemBorderBottom"
"isShowCartList", "cartList"
],
data() {
@ -44,31 +53,19 @@
},
methods: {
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;
}
@ -79,160 +76,144 @@
</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;
justify-content: space-between;
align-items: center;
@include centerFlex(flex-start);
width: 100%;
height: 120rpx;
text-align: center;
padding-left: 34rpx;
padding-right: 36rpx;
padding-left: 38rpx;
margin: 40rpx 0 10rpx 0;
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;
padding: 30rpx 0;
.item-left {
width: 180rpx;
height: 180rpx;
position: relative;
margin-right: 20rpx;
border-radius: 10rpx;
@include centerFlex(center);
flex-shrink: 0;
>image {
max-width: 100%;
max-height: 100%;
}
}
.item-right {
display: flex;
flex-direction: column;
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-right: 38rpx;
.hover-cart-list-dialog-content-col1 {
// display: flex;
.item-right-top {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 258rpx;
>view {
overflow: hidden;
word-break: nowrap;
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1; /** 显示的行数 **/
&:first-child {
.item-right-name {
font-size: 28rpx;
color: rgb(51,51,51);
margin-bottom: 8rpx;
word-break: break-all;
}
&:nth-child(2) {
.item-right-spec {
margin: 8rpx 0 14rpx 0;
font-size: 24rpx;
color: rgb(154,154,157);
}
color: #9A9A9D;
word-break: break-all;
}
}
.item-right-price-count {
@include centerFlex(space-between);
.hover-cart-list-dialog-content-col2 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: rgb(51,51,51);
font-size: 28rpx;
text-align: center;
width: 166rpx;
.item-right-price-row {
color: $orange;
word-break: break-all;
>input {
width: 132rpx;
height: 48rpx;
border: 2rpx solid rgb(216,216,216);
border-radius: 4rpx;
}
>view {
margin-left: 6rpx;
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
}
.hover-cart-list-dialog-content-col3 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 126rpx;
}
}
.item-right-count-row {
@include centerFlex(flex-start);
>image {
&:first-child {
width: 36rpx;
height: 36rpx;
&:first-child {
}
&:nth-child(3) {
width: 36rpx;
height: 36rpx;
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
margin: 0 12rpx;
font-size: 28rpx;
}
}
@ -240,4 +221,6 @@
}
}
}
}
}
</style>

498
src/subpackage/retail/components/retail_pay_way/retail_pay_way.vue

@ -1,498 +0,0 @@
<template>
<view class="content" v-if="show">
<view class="win-mask"></view>
<view class="win-operate">
<image mode="aspectFit" src="/static/images/icon/retail/close.png" @click="onClose"></image>
<text class="win-title">{{ curChoose.name == "储值卡支付" ? "请选择储值卡" : "请选择支付方式" }}</text>
<view class="win-way" v-if="curChoose.name!='储值卡支付'?true:false">
<view class="win-way-item" v-for="(item, index) in payWayList" :key="index" @click="onPayWayClick(item, index)">
<image :class="[item.iconClassA, item.iconClassB]" mode="aspectFit" :src="item.icon"></image>
<text>{{ item.name }}</text>
<input v-if="item.inputShow" v-model="item.inputValue" :placeholder="item.placeholderLabel" placeholder-style="win-way-item-input-placeholder">
<image :class="[item.markClassA, item.markClassB]" mode="aspectFit" :src="item.mark"></image>
<view></view>
</view>
</view>
<view class="win-card" v-if="curChoose.name=='储值卡支付'?true:false">
<view class="win-card-search">
<image v-if="searchCardValue?false:true" mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input v-model="searchCardValue" @confirm="searchCardList" placeholder="请输入微信昵称/手机号码/储值卡号搜索" placeholder-style="win-card-search-input-placeholder">
</view>
<view class="win-card-list">
<view class="win-card-list-item" v-for="(item, index) in cardList" :key="index" @click="onCardClick(item)">
<view>储值卡卡号<text :style="{color:item.color.card_no}">{{ item.card_no }}</text></view>
<view>微信昵称<text :style="{color:item.color.nickname}">{{ item.nickname }}</text></view>
<view>手机号码<text :style="{color:item.color.mobile}">{{ item.mobile }}</text></view>
<view>卡名称<text :style="{color:item.color.card_name}">{{ item.card_name }}</text></view>
<view>卡余额<text :style="{color:item.color.balance}">{{ item.balance }}</text></view>
<image mode="aspectFit" :src="item.mark"></image>
</view>
</view>
</view>
<view class="win-way-confirm"><button hover-class="hover-active" @click="onConfirm">确定</button></view>
<view class="win-iphonex-block"></view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util.js';
import tools from '../../js/tools.js';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
export default {
props: [
"show", "price", "storeId"
],
data() {
return {
cardList: [], //
payWayList: [], //
choosePath: "/static/images/icon/retail/choose.png",
noChoosePath: "/static/images/icon/retail/noChoose.png",
curChoose: {},
curCardChoose: null,
searchCardValue: "",
}
},
created() {
this.createPayWayList(); //
},
methods: {
//
onCardClick(item) {
this.curCardChoose = item;
for (let i = 0; i < this.cardList.length; ++i) {
this.cardList[i].mark = this.noChoosePath;
}
this.curCardChoose.mark = this.choosePath;
},
//
searchCardList() {
if (!this.searchCardValue) {
util.showNone("请输入微信昵称/手机号码/储值卡号搜索");
return;
}
let _this = this;
this.cardList = [];
util.showLoad();
retailServer.get({
url: retailApi.assistantGetValueCardList,
data: {
stadium_id: this.storeId,
key: this.searchCardValue,
total_amount: this.price
},
isDefaultGet: false,
failMsg: '搜索失败!'
}).then(res => {
util.hideLoad();
if (res.data.code == 0) {
let color = "rgba(51, 51, 51, 1)";
for (let i = 0; i < res.data.data.length; ++i) {
_this.cardList.push(res.data.data[i]);
_this.cardList[i].mark = this.noChoosePath;
_this.cardList[i].color = {
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)";
}
}
if (_this.cardList.length) {
_this.cardList[0].mark = _this.choosePath;
this.curCardChoose = _this.cardList[0];
}
else {
util.showNone("查询不到该储值卡信息,请检查重新输入");
}
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
resetData() {
for (let i = 0; i < this.payWayList.length; ++i) {
this.payWayList[i].inputValue = "";
if (this.payWayList[i].name != "储值卡支付") {
this.payWayList[i].mark = this.noChoosePath;
}
}
this.payWayList[0].mark = this.choosePath;
this.curChoose = this.payWayList[0];
this.curCardChoose = null;
this.cardList = [];
this.searchCardValue = "";
},
//
onClose() {
this.resetData(); //
this.$emit("update:onClose", false);
},
//
onConfirm() {
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 "其他": {
if (!this.curChoose.inputValue) {
util.showNone("请输入其他支付方式!");
return;
}
info.type = 4;
info.inputValue = this.curChoose.inputValue;
} break;
case "储值卡支付": {
if (!this.curCardChoose) {
util.showNone("请搜索选择储值卡!");
return;
}
info.type = 2;
info.cardNo = this.curCardChoose.card_no;
} break;
}
this.onClose();
this.$emit("update:onConfirm", info);
},
//
onPayWayClick(item, index) {
this.curChoose = item;
if (item.name != "储值卡支付") {
for (let i = 0; i < this.payWayList.length; ++i) {
if (this.payWayList[i].name != "储值卡支付") {
this.payWayList[i].mark = this.noChoosePath;
}
}
this.payWayList[index].mark = this.choosePath;
}
else {
}
},
//
createPayWayList() {
this.payWayList = [
{
type: 0, name: "微信支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/wechat.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.choosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 1, name: "支付宝支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/alipay.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 3, name: "现金支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/cash.png",
iconClassA: "win-way-item-icon", iconClassB: "win-way-item-icon-dif",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 2, name: "储值卡支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/card.png",
iconClassA: "win-way-item-icon", iconClassB: "win-way-item-icon-dif",
placeholderLabel: "请输入其他支付方式",
mark: "/static/images/icon/retail/turn.png",
markClassA: "win-way-item-mark", markClassB: "win-way-item-mark-dif",
},
{
type: 4, name: "其他", inputShow: true, inputValue: "",
icon: "/static/images/icon/retail/other.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
];
this.curChoose = this.payWayList[0];
},
}
}
</script>
<style lang="scss">
.content {
width: 100vw;
height: 100vh;
position: fixed;
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;
flex-direction: column;
align-items: center;
background-color: white;
padding-top: 46rpx;
> image {
width: 34rpx;
height: 34rpx;
position: absolute;
top: 32rpx;
right: 28rpx;
}
> text {
width: 100%;
color: rgba(51, 51, 51, 1);
font-size: 32rpx;
text-align: center;
margin-bottom: 54rpx;
}
.win-way {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.win-way-item {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
padding-left: 40rpx;
padding-right: 36rpx;
padding-top: 28rpx;
padding-bottom: 28rpx;
position: relative;
.win-way-item-icon {
width: 54rpx;
height: 54rpx;
flex-shrink: 0;
}
.win-way-item-mark {
width: 36rpx;
height: 36rpx;
flex-shrink: 0;
}
.win-way-item-icon-dif {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
}
.win-way-item-mark-dif {
width: 34rpx;
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;
}
> view {
width: 90%;
height: 1rpx;
background-color: rgba(216, 216, 216, 1);
position: absolute;
bottom: 0%;
right: 0%;
}
> input {
margin-left: 24rpx;
margin-right: 132rpx;
width: 340rpx;
border-radius: 10rpx;
border: 2rpx solid rgba(216, 216, 216, 1);
background-color: white;
padding-left: 16rpx;
padding-right: 16rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
font-size: 28rpx;
}
.win-way-item-input-placeholder {
color: rgba(154, 154, 157, 1);
font-size: 28rpx;
}
}
}
.win-way-confirm {
width: 100%;
padding-left: 20rpx;
padding-right: 20rpx;
position: absolute;
bottom: 0%;
bottom: calc( 0% + constant(safe-area-inset-bottom));
bottom: calc( 0% + env(safe-area-inset-bottom));
> button {
width: 100%;
height: 112rpx;
line-height: 112rpx;
border-radius: 10rpx;
padding: 0 0;
color: rgb(255,255,255);
background-color: rgb(0,152,116);
}
}
.win-iphonex-block {
background-color: white;
width: 100%;
height: constant(safe-area-inset-bottom);
height: env(safe-area-inset-bottom);
poisition: absolute;
bottom: 0%;
}
.win-card {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding-left: 20rpx;
padding-right: 20rpx;
.win-card-search {
width: 100%;
border-radius: 10rpx;
background-color: rgba(242, 242, 247, 1);
margin-bottom: 30rpx;
display: flex;
flex-direction: row;
align-items: center;
> image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
margin-left: 20rpx;
}
> input {
font-size: 32rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-top: 24rpx;
padding-bottom: 24rpx;
flex-grow: 1;
}
.win-card-search-input-placeholder {
font-size: 32rpx;
color: rgba(156, 156, 159, 1);
}
}
.win-card-list {
width: 100%;
height: 100rpx;
overflow: scroll;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
flex-grow: 1;
margin-bottom: 112rpx;
.win-card-list-item {
display: flex;
flex-direction: column;
width: 100%;
border: 1rpx solid rgba(151, 151, 151, 1);
border-radius: 10rpx;
padding: 20rpx;
margin-bottom: 24rpx;
position: relative;
flex-shrink: 0;
> view {
color: rgba(156, 156, 159, 1);
font-size: 28rpx;
margin-bottom: 5rpx;
> text {
color: rgba(51, 51, 51, 1);
font-size: 28rpx;
}
}
> image {
width: 36rpx;
height: 36rpx;
position: absolute;
top: 50%;
right: 20rpx;
transform: translate(0%, -50%);
}
}
}
}
}
</style>

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

@ -0,0 +1,275 @@
<template>
<view class="content" v-if="show">
<view class="win-mask"></view>
<view class="win-operate">
<image mode="aspectFit" src="/static/images/icon/retail/close.png" @click="onClose"></image>
<text class="win-title">请选择储值卡</text>
<view class="win-card">
<view class="win-card-search">
<image v-if="searchCardValue?false:true" mode="aspectFit" src="/static/images/icon/retail/search.png"></image>
<input v-model="searchCardValue" @confirm="searchCardList" placeholder="请输入微信昵称/手机号码/储值卡号搜索" placeholder-style="win-card-search-input-placeholder">
</view>
<view class="win-card-list">
<view class="win-card-list-item" v-for="(item, index) in cardList" :key="index" @click="onCardClick(item)" :style="{borderColor:item.mark===choosePath?'#009874':'#979797'}">
<view>储值卡卡号<text :style="{color:item.color.card_no}">{{ item.card_no }}</text></view>
<view>微信昵称<text :style="{color:item.color.nickname}">{{ item.nickname }}</text></view>
<view>手机号码<text :style="{color:item.color.mobile}">{{ item.mobile }}</text></view>
<view>卡名称<text :style="{color:item.color.card_name}">{{ item.card_name }}</text></view>
<view>卡余额<text :style="{color:item.color.balance}">{{ item.balance }}</text></view>
<image mode="aspectFit" :src="item.mark"></image>
</view>
</view>
</view>
<view class="win-way-confirm"><button hover-class="hover-active" @click="onConfirm">确定</button></view>
<view class="win-iphonex-block"></view>
</view>
</view>
</template>
<script>
import util from '../../../../utils/util.js';
import tools from '../../js/tools.js';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
export default {
props: [
"show", "price", "storeId", "brandId"
],
data() {
return {
cardList: [], //
choosePath: "/static/images/icon/retail/choose.png",
noChoosePath: "/static/images/icon/retail/noChoose.png",
curCardChoose: null,
searchCardValue: "",
}
},
created() {
},
methods: {
//
onCardClick(item) {
this.curCardChoose = item;
for (let i = 0; i < this.cardList.length; ++i) this.cardList[i].mark = this.noChoosePath;
this.curCardChoose.mark = this.choosePath;
},
//
searchCardList() {
if (!this.searchCardValue) {
util.showNone("请输入微信昵称/手机号码/储值卡号搜索");
return;
}
let _this = this;
this.cardList = [];
util.showLoad();
retailServer.get({
url: retailApi.assistantGetValueCardList,
data: {
brand_id: this.brandId,
stadium_id: this.storeId,
key: this.searchCardValue,
total_amount: this.price
},
isDefaultGet: false,
failMsg: '搜索失败!'
}).then(res => {
util.hideLoad();
if (res.data.code == 0) {
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;
_this.cardList[i].color = {
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]] = "#009874";
}
if (_this.cardList.length) {
_this.cardList[0].mark = _this.choosePath;
this.curCardChoose = _this.cardList[0];
}
else {
util.showNone("查询不到该储值卡信息,请检查重新输入");
}
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
resetData() {
this.curCardChoose = null;
this.cardList = [];
this.searchCardValue = "";
},
//
onClose() {
this.$emit("update:onClose", false);
},
//
onConfirm() {
if (!this.curCardChoose) {
util.showNone("请搜索选择储值卡!");
return;
}
this.$emit("update:onConfirm", this.curCardChoose);
this.onClose();
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.content {
width: 100vw;
height: 100vh;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
}
.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%;
@include centerFlex(flex-start);
flex-direction: column;
background-color: white;
padding-top: 46rpx;
> image {
width: 34rpx;
height: 34rpx;
position: absolute;
top: 32rpx;
right: 28rpx;
}
> text {
width: 100%;
color: #333;
font-size: 32rpx;
text-align: center;
margin-bottom: 54rpx;
}
.win-way-confirm {
width: 100%;
padding: 0 20rpx;
position: absolute;
bottom: 0%;
bottom: calc( 0% + constant(safe-area-inset-bottom));
bottom: calc( 0% + env(safe-area-inset-bottom));
> button {
width: 100%;
height: 112rpx;
line-height: 112rpx;
border-radius: 10rpx;
padding: 0 0;
color: white;
background-color: $themeColor;
}
}
.win-iphonex-block {
background-color: white;
width: 100%;
height: constant(safe-area-inset-bottom);
height: env(safe-area-inset-bottom);
poisition: absolute;
bottom: 0%;
}
.win-card {
width: 100%;
height: 100%;
position: relative;
@include centerFlex(flex-start);
flex-direction: column;
padding: 0 20rpx;
.win-card-search {
width: 100%;
border-radius: 10rpx;
background-color: #f2f2f7;
margin-bottom: 30rpx;
@include centerFlex(flex-start);
> image {
width: 40rpx;
height: 40rpx;
flex-shrink: 0;
margin-left: 20rpx;
}
> input {
font-size: 32rpx;
padding: 24rpx 20rpx;
flex-grow: 1;
}
.win-card-search-input-placeholder {
font-size: 32rpx;
color: #9c9c9f;
}
}
.win-card-list {
width: 100%;
height: 100rpx;
overflow: scroll;
@include centerFlex(flex-start);
flex-direction: column;
flex-grow: 1;
position: relative;
margin-bottom: 112rpx;
.win-card-list-item {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 100%;
border: 2rpx solid #979797;
border-color: #979797;
border-radius: 10rpx;
padding: 20rpx 0;
margin-bottom: 24rpx;
position: relative;
> view {
color: #9c9c9f;
font-size: 28rpx;
margin-bottom: 5rpx;
> text {
color: #333;
font-size: 28rpx;
}
}
> image {
width: 36rpx;
height: 36rpx;
position: absolute;
top: 50%;
right: 20rpx;
transform: translate(0%, -50%);
}
}
}
}
}
</style>

2
src/subpackage/retail/js/retail_api.js

@ -7,6 +7,8 @@ export const RETAIL_API = {
assistantGetAssistantStadiums:`${ORIGIN}/admin/assistant/getAssistantStadiums`, // 店铺列表
assistantListErpGoodsCateAndGoods:`${ORIGIN}/admin/assistant/listErpGoodsCateAndGoods`, // 分类物品列表
assistantGetValueCardList:`${ORIGIN}/admin/assistant/getValueCardList`, // 搜索储蓄卡
getCategoryList:`${ORIGIN}/classifyer/all`, // 分类列表
getGoodsList:`${ORIGIN}/admin/erpRetailGoods/list`, // 商品列表
}
export default RETAIL_API;

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

@ -1,26 +1,31 @@
<template>
<view class="cg-container">
<view class="final-cart-list">
<view class="final-cart-list-dialog-title">
<view>商品名称</view>
<view>售价</view>
<view>数量</view>
<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>
<scroll-view class="final-cart-list-dialog-content" :scroll-top="0" :scroll-y="cartListScroll" :style="{ height:cartListFinalHeight, paddingBottom:cartListFinalPaddingBottom }">
<view class="final-cart-list-dialog-content-for" :style="{ borderBottom:item.borderBottom }" v-for="item in cartListFinal" :key="item.id">
<view class="final-cart-list-dialog-content-col1">
<view>{{ item.erp_goods_name }}</view>
<view>{{ item.erp_goods_specs }}</view>
</view>
<view class="final-cart-list-dialog-content-col2">
<input v-if="isEdited" type="digit" :value="item.erp_goods_price" @confirm="cartInputConfirm($event, item.id)" @blur="cartInputConfirm($event, item.id)" />
<view v-if="!isEdited">{{item.erp_goods_price}}</view>
<view></view>
<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="item.goods_img"></image>
</view>
<view class="item-right">
<view class="item-right-top">
<view class="item-right-name">{{ item.goods_name }}</view>
<view class="item-right-spec">
<view>{{ `${item.erp_goods.erp_goods_specs}/${item.erp_goods.erp_goods_type}/${item.erp_goods.erp_goods_sku}` }}</view>
<view>x{{ item.count }}</view>
</view>
</view>
<view class="item-right-price-count">
<view class="item-right-price-row">
<view><text></text>{{ item.assistant_price }}</view>
</view>
</view>
<view class="final-cart-list-dialog-content-col3">
<image v-if="isEdited" mode="aspectFit" src="/static/images/icon/retail/sub.png" @click="cartCountClick('sub', item.id)"></image>
<view>{{ item.count }}</view>
<image v-if="isEdited" mode="aspectFit" src="/static/images/icon/retail/add.png" @click="cartCountClick('add', item.id)"></image>
</view>
</view>
</scroll-view>
@ -29,22 +34,15 @@
<view class="cg-footer">
<view>
<view class="cg-footer-price">
<view>合计</view>
<view>实付款</view>
<view><text></text>{{ totalPrice }}</view>
</view>
<view class="cg-footer-btn">
<view class="cg-footer-btn-reedit" v-if="!isEdited" @click="cartReedit"><button hover-class="hover-active">重新编辑</button></view>
<view class="cg-footer-btn-confirm" @click="cartConfirm"><button hover-class="hover-active">{{cartConfirmText}}</button></view>
<view class="cg-footer-btn-confirm" @click="cartConfirm"><button hover-class="hover-active">提交订单</button></view>
</view>
</view>
</view>
<retailPayWay
:show="retailPayWayWin.show" :price="totalPrice" :storeId="curStore.id"
@update:onClose="showOrHidePayWay" @update:onConfirm="goodsRetail"
>
</retailPayWay>
</view>
</template>
@ -52,207 +50,37 @@
import util from '../../../../utils/util.js';
import tools from '../../js/tools';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
import retailPayWay from '../../components/retail_pay_way/retail_pay_way.vue';
export default {
components: {
'retailPayWay': retailPayWay
},
components: {},
data() {
return {
isEdited: false, //
curStore: {}, //
cartListFinal: [], //
totalPrice: 0, //
cartConfirmText: "收款出库", // ||
cartListScroll: false, //
cartListFinalHeight: "0rpx", //
cartListFinalPaddingBottom: "0rpx", //
retailPayWayWin: {
show: false,
},
}
},
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.cartListFinal = [];
for (let i = 0; i < data.cartListFinal.length; ++i) {
this.cartListFinal.push(tools.getNewObj(data.cartListFinal[i]));
this.cartListFinal[i]["borderBottom"] = "1rpx solid rgb(216,216,216)";
}
this.cartListFinal = data.cartListFinal;
this.totalPrice = data.totalPrice;
//
this.cartListFinal[this.cartListFinal.length - 1]["borderBottom"] = "0rpx solid rgb(216,216,216)";
this.fixMainHeight(); //
this.calcTotalPrice(); //
util.showLoad();
setTimeout(util.hideLoad, 1000);
setTimeout(util.hideLoad, 500);
},
methods: {
//
showOrHidePayWay(status) {
this.retailPayWayWin.show = status;
},
//
cartReedit() {
this.isEdited = true;
this.cartConfirmText = "确认";
},
//
goodsRetail(info) {
let _this = this;
let data = [];
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].count) {
data.push({
id: this.cartListFinal[i].id,
name: this.cartListFinal[i].erp_goods_name,
price: this.cartListFinal[i].erp_goods_price,
nums: this.cartListFinal[i].count,
unit: this.cartListFinal[i].erp_goods_unit,
});
}
}
if (!data.length) {
util.showNone("暂无商品数量!");
return;
}
let newData = {
store_id: _this.curStore.id,
goods_data: data,
pay_type: info.type,
};
if (info.inputValue) {
newData["other_pay_type"] = info.inputValue;
}
if (info.cardNo) {
newData["card_no"] = info.cardNo;
}
util.showLoad();
retailServer.post({
url: retailApi.assistantRetail,
data: newData,
isDefaultGet: false,
failMsg: '出库失败!'
}).then(res => {
if (res.data.code == 0) {
uni.setStorage({
key: "retailStatus",
data: "true",
success: function() {
util.hideLoad();
uni.navigateBack({
delta: 1
});;
},
fail: function(err) {
util.hideLoad();
uni.navigateBack({
delta: 1
});
},
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
// ||
//
cartConfirm() {
if (this.cartConfirmText == "确认") {
this.isEdited = false;
this.cartConfirmText = "收款出库";
return;
}
let mark = false;
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].count) {
mark = true;
break;
}
}
if (!mark) {
util.showNone("暂无商品数量!");
return;
}
this.showOrHidePayWay(true); //
// this.goodsRetail(); //
},
//
cartInputConfirm(event, id) {
//
let value = parseFloat(event.detail.value ? event.detail.value : 0).toFixed(2);
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].id == id) {
this.cartListFinal[i].erp_goods_price = value;
}
}
this.calcTotalPrice(); //
},
//
cartCountClick(type, id) {
//
let item = null;
for (let i = 0; i < this.cartListFinal.length; ++i) {
if (this.cartListFinal[i].id == id) {
item = this.cartListFinal[i];
break;
}
}
if (item) {
switch (type) {
case "add": {
//
if (item.count + 1 > item.stock_num) {
util.showNone("库存就这么多了!");
return;
}
item.count += 1;
} break;
case "sub": {
if (item.count <= 0) {
return;
}
item.count -= 1;
} break;
}
this.calcTotalPrice(); //
}
},
//
calcTotalPrice() {
let price = 0.0;
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);
let data = { cartListFinal: this.cartListFinal, curStore: this.curStore, totalPrice: this.totalPrice };
uni.navigateTo({
url: `/subpackage/retail/pages/confirm_order/confirm_order?data=${encodeURIComponent(JSON.stringify(data))}`
});
},
//
fixMainHeight() {
let _this = this;
@ -261,17 +89,16 @@
console.log(res);
let sumHeight = res.windowHeight; //
// //
//
let query = uni.createSelectorQuery().select(".cg-footer");
query.boundingClientRect(data => {
sumHeight = sumHeight - data.height - uni.upx2px(90); // footer
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`;
@ -290,9 +117,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 {
@ -303,244 +131,160 @@
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 {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.cg-header-title {
width: 100%;
height: 90rpx;
text-align: center;
padding-left: 34rpx;
padding-right: 36rpx;
background-color: rgb(255,255,255);
height: 100rpx;
background-color: white;
padding: 0 24rpx;
>view {
font-size: 32rpx;
color: rgb(51,51,51);
&:first-child {
width: 258rpx;
.icon-line {
@include centerFlex(flex-start);
width: 100%;
height: 100%;
font-weight: 500;
border-bottom: 1rpx solid rgba(216, 216, 216, 0.3);
}
&:nth-child(2) {
width: 166rpx;
}
&:nth-child(3) {
width: 126rpx;
>image {
width: 32rpx;
height: 30rpx;
margin-right: 12rpx;
}
}
}
.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: 34rpx;
padding-right: 36rpx;
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;
.final-cart-list-dialog-content-for {
.main-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);
background-color: rgb(255,255,255);
margin-top: 30rpx;
padding: 23rpx 0;
.item-left {
width: 140rpx;
height: 140rpx;
margin-right: 20rpx;
position: relative;
border-radius: 10rpx;
@include centerFlex(center);
flex-shrink: 0;
.final-cart-list-dialog-content-col1 {
// display: flex;
>image {
max-width: 100%;
max-height: 100%;
}
}
.item-right {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 258rpx;
justify-content: space-between;
flex-grow: 1;
>view {
overflow: hidden;
word-break: nowrap;
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1; /** 显示的行数 **/
.item-right-top {
display: flex;
flex-direction: column;
&:first-child {
.item-right-name {
font-size: 28rpx;
color: rgb(51,51,51);
margin-bottom: 8rpx;
word-break: break-all;
}
&:nth-child(2) {
.item-right-spec {
margin: 8rpx 0 14rpx 0;
font-size: 24rpx;
color: rgb(154,154,157);
}
color: #9A9A9D;
word-break: break-all;
@include centerFlex(space-between);
}
}
.item-right-price-count {
@include centerFlex(space-between);
.final-cart-list-dialog-content-col2 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: rgb(51,51,51);
font-size: 28rpx;
text-align: center;
width: 166rpx;
.item-right-price-row {
color: $orange;
word-break: break-all;
>input {
width: 132rpx;
height: 48rpx;
border: 2rpx solid rgb(216,216,216);
border-radius: 4rpx;
}
>view {
&:first-child {
font-size: 32rpx;
line-height: 32rpx;
>text {
font-size: 24rpx;
line-height: 24rpx;
}
&:nth-child(2) {
margin-left: 6rpx;
}
}
}
.final-cart-list-dialog-content-col3 {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 126rpx;
>image {
width: 36rpx;
height: 36rpx;
&:first-child {
}
&:nth-child(3) {
}
}
>view {
margin-left: 12rpx;
margin-right: 12rpx;
color: rgb(51,51,51);
font-size: 28rpx;
}
}
}
}
}
.cg-footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
// flex-grow: 1;
// opacity: 0.3;
flex-direction: row;
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;
// border: 1rpx solid blue;
background-color: rgb(255,255,255);
height: 108rpx;
background-color: white;
>view {
display: flex;
flex-direction: column;
// justify-content: flex-end;
align-items: flex-start;
@include centerFlex(space-between);
width: 100%;
height: 100%;
.cg-footer-price {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
@include centerFlex(flex-start);
height: 88rpx;
width: 100%;
padding-right: 40rpx;
padding-left: 28rpx;
>view {
&:first-child {
font-size: 24rpx;
font-size: 28rpx;
}
&:nth-child(2) {
color: rgb(255,135,61);
font-size: 32rpx;
color: $orange;
font-size: 36rpx;
>text {
font-size: 24rpx;
font-size: 28rpx;
}
}
}
}
.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-reedit {
>button {
width: 242rpx;
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
padding: 0 0;
color: rgb(0,152,116);
background-color: rgb(255,255,255);
border: 2rpx solid rgb(0,152,116);
margin-right: 20rpx;
}
}
.cg-footer-btn-confirm {
>button {
width: 242rpx;
width: 240rpx;
height: 88rpx;
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;
}
}
}

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

@ -0,0 +1,471 @@
<template>
<view class="cg-container">
<view class="final-cart-list">
<view class="final-cart-list-dialog-title">
<view class="icon-line">
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<view>{{ curStore.name ? curStore.name : '' }}</view>
</view>
<view class="amount-line">
<text>零售支付金额</text>
<view><text></text>{{ totalPrice }}</view>
</view>
</view>
<scroll-view class="pay-way-content" :scroll-top="0" :scroll-y="true" :style="{ height:cartListFinalHeight, paddingBottom:cartListFinalPaddingBottom }">
<view class="win-way">
<view class="win-way-item" v-for="(item, index) in payWayList" :key="index" @click="onPayWayClick(item, index)">
<view class="row1">
<image :class="[item.iconClassA, item.iconClassB]" mode="aspectFit" :src="item.icon"></image>
<text>{{ item.name }}</text>
<input v-if="item.inputShow&&!storeCardSelectShow" v-model="item.inputValue" :placeholder="item.placeholderLabel" placeholder-style="win-way-item-input-placeholder">
<image :class="[item.markClassA, item.markClassB]" mode="aspectFit" :src="item.mark"></image>
</view>
<view class="row2">
<view v-if="item.name==='储值卡支付'&&curChoose.name==='储值卡支付'&&curStoreInfo.card_no" class="store-card-info">
<view>储值卡卡号<text>{{ curStoreInfo.card_no }}</text></view>
<view>微信昵称<text>{{ curStoreInfo.nickname }}</text></view>
<view>手机号码<text>{{ curStoreInfo.mobile }}</text></view>
<view>卡名称<text>{{ curStoreInfo.card_name }}</text></view>
<view>卡余额<text>{{ curStoreInfo.balance }}</text></view>
</view>
</view>
<view class="row3">
<view class="bottom-line"></view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="cg-footer">
<view class="cg-footer-btn-confirm" @click="confirmPay"><button hover-class="hover-active">立即支付</button></view>
</view>
<storeCardSelect
:show="storeCardSelectShow" :price="totalPrice" :storeId="curStore.id" :brandId="brandInfo.brand.id"
@update:onClose="showOrHideStoreCardSelect" @update:onConfirm="storeCardConfirm"
>
</storeCardSelect>
</view>
</template>
<script>
import util from '../../../../utils/util.js';
import tools from '../../js/tools';
import retailServer from '../../js/retail_server';
import retailApi from '../../js/retail_api';
import { mapState } from 'vuex'
import storeCardSelect from '../../components/store_card_select/store_card_select';
export default {
components: {
'storeCardSelect': storeCardSelect
},
data() {
return {
curStore: {}, //
cartListFinal: [], //
totalPrice: 0, //
cartListScroll: false, //
cartListFinalHeight: "0rpx", //
cartListFinalPaddingBottom: "0rpx", //
payWayList: [], //
choosePath: "/static/images/icon/retail/choose.png",
noChoosePath: "/static/images/icon/retail/noChoose.png",
curChoose: {},
storeCardSelectShow: false,
curStoreInfo: {}
}
},
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.cartListFinal = data.cartListFinal;
this.totalPrice = data.totalPrice;
this.fixMainHeight(); //
this.createPayWayList(); //
util.showLoad();
setTimeout(util.hideLoad, 500);
},
onShow() {
this.getPaySuccess(); //
},
computed:{
...mapState([ 'brandInfo',])
},
methods: {
getPaySuccess() {
uni.getStorage({
key: 'paySuccess',
success: (res) => {
uni.removeStorage({
key: 'paySuccess',
success: (res) => { uni.navigateBack({ delta: 2 }); }
});
},
fail: (err) => {},
});
},
//
goodsRetail(info) {
let _this = this;
let goods_data = [];
for (let i = 0; i < this.cartListFinal.length; ++i) {
goods_data.push({
// id: this.cartListFinal[i].erp_goods.erp_goods_cid,
id: this.cartListFinal[i].id,
// name: this.cartListFinal[i].erp_goods.erp_goods_name,
name: this.cartListFinal[i].goods_name,
price: this.cartListFinal[i].assistant_price,
nums: this.cartListFinal[i].count,
unit: this.cartListFinal[i].erp_goods.erp_goods_unit,
});
}
util.showLoad();
retailServer.post({
url: retailApi.assistantRetail,
data: {
goods_data,
brand_id: _this.brandInfo.brand.id, store_id: _this.curStore.id,
amount: parseFloat(_this.totalPrice), pay_type: info.type,
other_pay_type: info.inputValue,
card_no: info.cardNo,
mark: ''
},
isDefaultGet: false,
failMsg: '出库失败!'
}).then(res => {
if (res.data.code == 0) {
uni.setStorage({
key: "retailStatus",
data: "true",
success: () => {
util.hideLoad();
uni.navigateTo({ url: `/subpackage/retail/pages/pay_success/pay_success` });
},
fail: (err) => {
util.hideLoad();
uni.navigateTo({ url: `/subpackage/retail/pages/pay_success/pay_success` });
},
});
}
else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
confirmPay() {
let info = { type: 0, inputValue: "", cardNo: "" };
switch (this.curChoose.name) {
case "微信支付": info.type = 0; break;
case "支付宝支付": info.type = 1; break;
case "现金支付": info.type = 3; break;
case "其他": {
if (!this.curChoose.inputValue) {
util.showNone("请输入其他支付方式!");
return;
}
info.type = 4;
info.inputValue = this.curChoose.inputValue;
} break;
case "储值卡支付": {
if (!this.curStoreInfo.card_no) {
util.showNone("请搜索选择储值卡!");
return;
}
info.type = 2;
info.cardNo = this.curStoreInfo.card_no;
} break;
}
this.goodsRetail(info);
},
storeCardConfirm(info) {
this.curStoreInfo = info;
},
//
onPayWayClick(item, index) {
this.curChoose = item;
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);
},
//
createPayWayList() {
this.payWayList = [
{
type: 0, name: "微信支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/wechat.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.choosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 1, name: "支付宝支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/alipay.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 3, name: "现金支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/cash.png",
iconClassA: "win-way-item-icon", iconClassB: "win-way-item-icon-dif",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
{
type: 2, name: "储值卡支付", inputShow: false, inputValue: "",
icon: "/static/images/icon/retail/card.png",
iconClassA: "win-way-item-icon", iconClassB: "win-way-item-icon-dif",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "win-way-item-mark-dif",
},
{
type: 4, name: "其他", inputShow: true, inputValue: "",
icon: "/static/images/icon/retail/other.png",
iconClassA: "win-way-item-icon", iconClassB: "",
placeholderLabel: "请输入其他支付方式",
mark: this.noChoosePath,
markClassA: "win-way-item-mark", markClassB: "",
},
];
this.curChoose = this.payWayList[0];
},
//
showOrHideStoreCardSelect(status) {
this.storeCardSelectShow= status;
},
//
fixMainHeight() {
let _this = this;
uni.getSystemInfo({
success: res => {
console.log(res);
let sumHeight = res.windowHeight; //
// //
let query = uni.createSelectorQuery().select(".cg-footer");
query.boundingClientRect(data => {
sumHeight = sumHeight - data.height - uni.upx2px(480 + 24); // footer +bottom
let contentHeight = sumHeight;
_this.cartListFinalHeight = `${tools.px2rpx(contentHeight)}rpx`;
_this.cartListScroll = true;
_this.cartListFinalPaddingBottom = `${res.safeArea.top >= 44 ? tools.px2rpx(res.safeArea.top) : 0}rpx`;
}).exec();
}
});
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
$orange: #FF873D;
page {
background-color: white;
}
.cg-container {
display: flex;
flex-direction: column;
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 */
.final-cart-list {
display: flex;
flex-direction: column;
flex-grow: 1;
background-color: #ededf5;
.final-cart-list-dialog-title {
width: 100%;
height: 480rpx;
background-color: white;
padding: 0 24rpx;
margin-bottom: 24rpx;
.icon-line {
@include centerFlex(flex-start);
width: 100%;
height: 100rpx;
border-bottom: 1rpx solid rgba(216, 216, 216, 0.3);
font-weight: 500;
>image {
width: 32rpx;
height: 30rpx;
margin-right: 12rpx;
}
}
.amount-line {
@include centerFlex(center);
flex-direction: column;
height: 380rpx;
>text {
margin-bottom: 26rpx;
font-size: 28rpx;
}
>view {
font-size: 80rpx;
font-weight: 500;
>text {
font-size: 60rpx;
}
}
}
}
.pay-way-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
background-color: white;
.win-way {
width: 100%;
@include centerFlex(flex-start);
flex-direction: column;
position: relative;
.win-way-item {
width: 100%;
@include centerFlex(flex-start);
flex-direction: column;
padding: 28rpx 36rpx 0 40rpx;
position: relative;
.row1 {
@include centerFlex(flex-start);
width: 100%;
.win-way-item-icon {
width: 54rpx;
height: 54rpx;
flex-shrink: 0;
}
.win-way-item-mark {
width: 36rpx;
height: 36rpx;
flex-shrink: 0;
}
.win-way-item-icon-dif {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
}
.win-way-item-mark-dif {
width: 34rpx;
height: 34rpx;
flex-shrink: 0;
}
> text {
font-size: 28rpx;
flex-grow: 1;
flex-shrink: 0;
margin: 0 16rpx;
}
> input {
margin: 0 132rpx 0 24rpx;
width: 340rpx;
border-radius: 10rpx;
border: 2rpx solid #d8d8d8;
background-color: white;
padding: 10rpx 16rpx;
font-size: 28rpx;
}
.win-way-item-input-placeholder {
color: rgba(154, 154, 157, 1);
font-size: 28rpx;
}
}
.row2 {
width: 100%;
@include centerFlex(flex-end);
.store-card-info {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 612rpx;
position: relative;
padding-top: 26rpx;
> view {
color: #9c9c9f;
font-size: 28rpx;
margin-bottom: 5rpx;
> text {
font-size: 28rpx;
}
}
}
}
.row3 {
@include centerFlex(flex-end);
width: 100%;
.bottom-line {
width: 612rpx;
height: 1rpx;
background-color: #d8d8d8;
margin-top: 26rpx;
}
}
}
}
}
}
.cg-footer {
display: flex;
flex-direction: row;
position: fixed;
bottom: calc( 0rpx + constant(safe-area-inset-bottom));
bottom: calc( 0rpx + env(safe-area-inset-bottom));
width: 100%;
height: 112rpx;
background-color: white;
.cg-footer-btn-confirm {
width: 100%;
height: 100%;
padding: 0 20rpx;
display: flex;
>button {
@include centerFlex(center);
width: 100%;
height: 100%;
border-radius: 10rpx;
padding: 0 0;
color: white;
background-color: $orange;
border: transparent;
font-size: 32rpx;
font-weight: 500;
}
}
}
}
</style>

847
src/subpackage/retail/pages/index/index.vue
File diff suppressed because it is too large
View File

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

@ -0,0 +1,56 @@
<template>
<view class="success-container">
<image mode="aspectFit" src="/static/images/icon/retail/paySuccess.png"></image>
<view>支付成功</view>
<button hover-class="hover-active" @click="review()">查看订单详情</button>
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad() {
uni.setStorage({ key: "paySuccess", data: "true", success: () => {}, fail: () => {} });
},
methods: {
review() {
//
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 {
@include centerFlex(flex-start);
flex-direction: column;
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;
>image {
width: 132rpx;
height: 132rpx;
margin-top: 60rpx;
}
>view {
font-weight: 500;
margin-top: 30rpx;
margin-bottom: 102rpx;
}
> button {
color: #009874;
border: 2rpx solid #009874;
border-radius: 44rpx;
}
}
</style>

158
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="请输入商品名称、sku"
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>
@ -37,13 +32,14 @@
searchText: "", //
historyList: [], //
curStore: {}, //
brandInfo: {}, //
}
},
onLoad(option) {
this.getSearchHistory(); //
let data = JSON.parse(decodeURIComponent(option.data));
this.curStore = data.curStore;
this.brandInfo = data.brandInfo;
},
methods: {
//
@ -56,34 +52,26 @@
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) {
async searchTrigger(text, type) {
if (!text) {
util.showNone("请输入商品名称、sku");
util.showNone("请输入商品名称");
return;
}
@ -94,77 +82,57 @@
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,
let res = await retailServer.get({
url: retailApi.getGoodsList,
data: {
assistant_key: text,
brand_id: _this.brandInfo.brand.id,
stadium_id: _this.curStore.id,
type_key: '',
key: text,
page: 1,
page_size: 10
},
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) {
mark = true;
}
}
//
if (!mark) {
}).catch(() => {});
if (res && res.data && res.data.data && res.data.data.list) {
if (!res.data.data.list.length) {
util.showNone("暂无数据");
return;
}
for (let j = 0; j < res.data.data.list.length; ++j) {
res.data.data.list[j].count = 0; //
res.data.data.list[j].erp_goods = res.data.data.list[j].erp_goods || {};
}
uni.setStorage({
key: "searchData",
data: res.data.data.list,
success: function() {
data: { searchText: text, list: res.data.data.list },
success: () => {
util.hideLoad();
//
uni.navigateBack({
delta: 1
});
},
fail: function(err) {
util.showNone("搜索失败");
uni.navigateBack({ delta: 1 }); //
},
fail: (err) => { util.showNone("搜索失败"); },
});
}
else {
} else {
util.showNone(res.data.message || '操作失败!');
}
});
},
//
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 +140,7 @@
</script>
<style lang="scss">
@import '~style/public.scss';
.search-container {
display: flex;
flex-direction: column;
@ -182,23 +151,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 +186,30 @@
}
>button {
flex-shrink: 0;
margin-left: 20rpx;
margin-right: 20rpx;
width: 100rpx;
height: 62rpx;
line-height: 62rpx;
padding: 0 0;
margin: 0 20rpx;
width: 142rpx;
height: 88rpx;
line-height: 88rpx;
font-size: 32rpx;
color: rgb(255,255,255);
background-color: rgb(6,147,137);
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 +223,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