123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807 |
- <template>
- <view class="container">
- <view class="vheigh"></view>
- <scroll-view class="content-box" scroll-y="true">
- <view class="user-section">
- <view class="user-info-box ">
- <view class="detail flex" @click="navTo('/pages/set/userinfo')">
- <view class="portrait-box">
- <image class="portrait" :src="shopAction.image || '/static/error/shopErroe.png'"></image>
- </view>
- <view class="info-box">
- <view class="username">{{ shopAction.name?shopAction.name:'载入中'}}</view>
- <view class="authentication success">已认证</view>
- </view>
- </view>
- </view>
- </view>
- <view class="cover-container">
- <view class="tj-sction" v-if="type==1">
- <view class="tj-item" @click="navTo('./money/wallet')">
- <text>支付金额</text>
- <text class="num">{{ orderNum.todayPrice || '0' }}</text>
- <text>昨日:{{orderNum.proPrice}}</text>
- </view>
- <!-- <view class="tj-item" @click="navTo('/pages/user/award/award')">
- <text>会员数</text>
- <text class="num">{{ orderNum.proPrice || '0' }}</text>
- <text>昨日:{{orderNum.proPrice}}</text>
- </view> -->
- <view class="tj-item" @click="navTo('/pages/user/scoreAccumulate')">
- <text>支付订单数</text>
- <text class="num">{{ orderNum.todayCount || '0' }}</text>
- <text>昨日:{{orderNum.proCount}}</text>
- </view>
- </view>
- <!-- 订单 -->
- <view class="item-box">
- <view class="box-title flex">
- <view class="title"><text>店铺订单</text></view>
- <!-- <view class="link" @click="navTo('/pages/shop/shopOrder?state=0')" hover-class="common-hover">
- <text>全部</text>
- <text class="iconfont iconenter"></text>
- </view> -->
- </view>
- <view class="order-section">
- <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=0')"
- hover-class="common-hover" :hover-stay-time="50">
- <view class=" icon position-relative">
- <view class="numOrderItem font-color-gray">
- {{orderNum.unpaid_count}}
- </view>
- </view>
- <text>待付款</text>
- </view>
- <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=1')"
- hover-class="common-hover" :hover-stay-time="50">
- <view class=" icon position-relative">
- <view class="numOrderItem font-color-red">
- {{orderNum.unshipped_count}}
- </view>
- </view>
- <text>待发货</text>
- </view>
- <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=2')"
- hover-class="common-hover" :hover-stay-time="50">
- <view class="icon position-relative">
- <view class="numOrderItem font-color-gray">
- {{orderNum.received_count}}
- </view>
- </view>
- <text>已发货</text>
- </view>
- <!-- <view class="order-item" @click="navTo('/pages/shop/shopOrderAfter?state=3')"
- hover-class="common-hover" :hover-stay-time="50">
- <view class="icon position-relative">
- <view class="numOrderItem font-color-yellow">
- {{orderNum.refund_count}}
- </view>
- </view>
- <text>待售后</text>
- </view> -->
- </view>
- </view>
- <view class="listBox">
- <view class="list">
- <view class="flex listItem" @click="smsh">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/mySet.png" mode="widthFix"></image>
- <text class="title">核销</text>
- </view>
- <view class="right flex">
- <text></text>
- <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
- </view>
- </view>
- <!-- <view class="flex listItem" @click="navTo('/pages/shop/repair/clientRepair')" v-if="type==1">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
- <text class="title">客户报修</text>
- </view>
- <view class="right flex" v-if="question>0">
- <text class="numbox">{{question}}</text>
- </view>
- </view> -->
- <!-- <view class="flex listItem" @click="navTo('/pages/shop/repair/repairHistory')">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
- <text class="title">维修历史</text>
- </view>
- </view> -->
- <!-- <view class="flex listItem" @click="navTo('/pages/set/set')">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/shopMoney.png" mode="widthFix">
- </image>
- <text class="title">店铺钱包</text>
- </view>
- <view class="right flex">
- <text></text>
- </view>
- </view> -->
- <!-- <view class="flex listItem" @click="navTo('/pages/shop/repair/taskClientRepair')">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
- <text class="title">维修任务</text>
- </view>
- <view class="right flex" v-if="tesk>0">
- <text class="numbox">{{tesk}}</text>
- </view>
- </view> -->
- <!-- <view class="flex listItem" @click="navTo('/pages/set/set')">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/myServer.png" mode="widthFix"></image>
- <text class="title">联系平台</text>
- </view>
- <view class="right flex">
- <text></text>
- </view>
- </view> -->
- <view class="flex listItem" @click="navTo('/pages/set/set')">
- <view class="flex titleBox">
- <image class="listIconImg" src="../../static/icon/mySet.png" mode="widthFix"></image>
- <text class="title">设置</text>
- </view>
- <view class="right flex">
- <text></text>
- <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
- </view>
- </view>
- </view>
- </view>
- <view class="tapBottom" @click="changeTab">
- 前往用户界面
- </view>
- </view>
- </scroll-view>
- <!-- 核销弹窗 -->
- <uni-popup ref="popuphx" class="agree-wrapper">
- <view class="hx-wrapper">
- <view class="hx-img">
- <image src="../../static/img/hxbg.png" mode=""></image>
- </view>
- <view class="hx-body">
- <view class="nav-hx">
- <view class="action" style="text-align: center;">
- {{hxtype == 0?'商品核销':(hxtype == 1 ? '电池核销': '升压器核销') }}</view>
- </view>
- <!-- <view class="hx-title">
- 核销码
- </view> -->
- <input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
- <view class="flex dcm" v-if="hxtype == 1 || hxtype == 2">
- <input type="text" v-model="dcode" :placeholder="hxtype == 1? '请输入电池编号': '请输入升压器编号'"
- placeholder-class="hx-placeholder" style="margin-bottom: 0;" />
- <image src="../../static/icon/scend.png" mode="widthFix" style="width: 50rpx;" @click="smdc">
- </image>
- </view>
- <view class="hx-btn" @click="qhx">
- 立即核销
- </view>
- </view>
- <view class="hx-close" @click="close">
- <image src="../../static/icon/close.png" mode=""></image>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- // #ifdef H5
- import weixinObj from "@/plugin/jweixin-module/index.js";
- // #endif
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- statistics,
- funds,
- question,
- adminStore,
- task
- } from '@/api/shop.js';
- import {rentVerific,orderVerific} from '@/api/index.js'
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- export default {
- data() {
- return {
- hxtype: 0,
- code: '',
- dcode: '',
- type: 0, //0为数据未加载,1为门店2为店员
- orderNum: {
- unpaid_count: 0, //待支付
- unshipped_count: 0, //待发货
- received_count: 0, //待收获
- refund_count: 0, //待售后
- todayPrice: 0, //今日成交额
- todayCount: 0, //今日订单数
- proPrice: 0, //昨日成交额
- proCount: 0, //昨日订单数
- },
- question: 0, //维修数量
- tesk: 0, //维修任务数量
- };
- },
- computed: {
- ...mapState('user', ['hasLogin']),
- ...mapState('shop', ['shopAction'])
- },
- created() {
- this.type = this.shopAction.type
- },
- methods: {
- ...mapMutations('shop', ['setShopAction']),
- smdc() {
- let that = this
- // #ifndef H5
- uni.scanCode({
- autoDecodeCharset: true,
- success: (res) => {
- if (that.hxtype == 1) {
- console.log(res);
- let str = res.result.split('编号:')
- this.dcode = str[1]
- } else {
- this.dcode = res.result
- }
- }
- })
- // #endif
- },
- qhx() {
- let that = this
- if (that.hxLoading) {
- return
- }
- if (that.code == '') {
- return that.$api.msg('请输入核销码')
- }
- if (that.hxtype == 0) {
- that.hxLoading = true
- orderVerific({
- verify_code: that.code,
- is_confirm: 1
- }).then(res => {
- uni.showToast({
- title: '核销成功',
- mask: true,
- duration: 1500
- });
- that.close()
- that.hxLoading = false
- }).catch(err => [
- that.hxLoading = false
- ])
- } else {
- if (that.dcode == '') {
- return that.$api.msg('请输入编号')
- }
- that.hxLoading = false
- let qdata = {
- verify_code: that.code,
-
- is_confirm: 1
- }
- if(that.hxtype == 1) {
- qdata.battery_number = that.dcode
- }else {
- qdata.booster_number = that.dcode
- }
- rentVerific(qdata).then(res => {
- uni.showToast({
- title: '核销成功',
- mask: true,
- duration: 1500
- });
- that.close()
- that.hxLoading = false
- })
- }
- },
- openHx() {
- this.$refs.popuphx.open()
- },
- close() {
- this.code = ''
- this.dcode = ''
- this.$refs.popuphx.close()
- },
- // 扫码
- smsh() {
- let that = this
- uni.showActionSheet({
- itemList: ['商品核销', '电池核销', '升压器核销'],
- success: function(res) {
- console.log(res, '上传')
- that.hxtype = res.tapIndex
- console.log();
- that.openHx();
- // #ifdef H5
- try {
- weixinObj.scanQRCode({
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
- scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
- success: function(res) {
- var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
- let arr = result.split('&');
- if (that.hxtype == 0) {
- that.code = arr[0];
- } else {
- that.code = arr[1]
- that.dcode = arr[2]
- }
- that.openHx();
- },
- false(err) {
- console.log('shib');
- that.openHx();
- }
- });
- } catch (err) {
- that.openHx();
- }
- // #endif
- // #ifndef H5
- uni.scanCode({
- success: (res) => {
- let result = res.result
- let arr = result.split('&')
- if (that.hxtype == 0) {
- that.code = arr[0];
- } else {
- that.code = arr[1]
- that.dcode = arr[2]
- }
- that.openHx();
- }
- })
- // #endif
- },
- fail: function(res) {
- // erro(res)
- console.log(res.errMsg);
- }
- });
- },
- // 重新加载数据
- getInit() {
- const that = this;
- // 订单数
- statistics().then((e) => {
- that.orderNum = e.data
- })
- // 门店资金
- funds().then((e) => {
- that.name = e.data.name;
- that.logo = e.data.image;
- // 保存商店数据
- if (e.data.address) {
- e.data.type = 1;
- that.setShopAction(e.data);
- } else {
- e.data.type = 2;
- adminStore().then((ar) => {
- that.setShopAction(ar.data);
- }).catch((e) => {
- console.log(e);
- })
- }
- that.type = e.data.type;
- })
- // 查询店长客户报修数量
- question().then((e) => {
- that.question = e.data.count
- })
- // 查询维修任务数量
- task().then((e) => {
- that.tesk = e.data.count;
- }).catch((e) => {
- console.log(e);
- })
- },
- // 界面切换
- changeTab() {
- this.$emit('tab', false)
- },
- navTo(url) {
- if (!this.hasLogin) {
- // 保存地址
- saveUrl();
- // 登录拦截
- interceptor();
- } else {
- uni.navigateTo({
- url
- });
- }
- },
- }
- };
- </script>
- <style lang="scss">
- page {
- height: 100%;
- }
- .tapBottom {
- margin: 0 50rpx;
- text-align: center;
- color: #FFFFFF;
- border: 1px solid $color-green;
- background-color: $color-green ;
- line-height: 1;
- padding: 25rpx;
- border-radius: 100rpx;
- margin-top: 50rpx;
- }
- .listBox {
- margin-top: 20rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
- overflow: hidden;
- }
- .list {
- .listItem {
- padding: 35rpx 40rpx;
- border-bottom: 1px solid $page-color-light;
- }
- .listIconImg {
- width: 36rpx;
- height: 36rpx;
- }
- .right {
- .img {
- width: 26rpx;
- }
- .numbox {
- background-color: $color-red;
- color: #FFFFFF;
- font-size: 22rpx;
- border-radius: 100rpx;
- min-width: 36rpx;
- height: 36rpx;
- line-height: 36rpx;
- text-align: center;
- padding: 0 5rpx;
- }
- }
- .titleBox {
- .title {
- padding-left: 20rpx;
- color: $font-color-base;
- font-size: $font-base;
- }
- }
- }
- %flex-center {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- %section {
- display: flex;
- justify-content: space-around;
- align-content: center;
- border-radius: 10rpx;
- }
- .container {
- height: 100%;
- background-color: $page-color-base;
- }
- .content-box {
- height: 100%;
- }
- .vheigh {
- height: var(--status-bar-height);
- }
- .user-section {
- padding: 15rpx 30rpx 0;
- position: relative;
- }
- .user-info-box {
- height: 180rpx;
- color: white;
- display: flex;
- align-items: center;
- justify-content: space-between;
- position: relative;
- z-index: 1;
- .detail {
- height: 130rpx;
- .portrait-box {
- height: 100%;
- .portrait {
- width: 130rpx;
- height: 100%;
- border: 5rpx solid #fff;
- border-radius: 50%;
- }
- }
- .info-box {
- margin-left: 20rpx;
- line-height: 1.5;
- .username {
- font-size: 40rpx;
- color: $font-color-dark;
- font-weight: bold;
- height: 100%;
- }
- .authentication {
- border: 2rpx solid #FF4241;
- border-radius: 20px;
- padding: 0 25rpx;
- font-size: 24rpx;
- color: #FF4241;
- float: left;
- &.success {
- border: 2rpx solid $color-green;
- color: $color-green;
- }
- }
- }
- }
- }
- .cover-container {
- padding: 0 30rpx;
- position: relative;
- padding-bottom: 20rpx;
- }
- .tj-sction {
- @extend %section;
- .tj-item {
- @extend %flex-center;
- flex-direction: column;
- height: 100rpx;
- font-size: $font-sm;
- color: $font-color-light;
- }
- .num {
- font-size: $font-base;
- color: $font-color-dark;
- margin-bottom: 8rpx;
- font-weight: bold;
- }
- }
- .item-box {
- border-radius: 20rpx;
- background-color: white;
- margin-top: 20rpx;
- .box-title {
- line-height: 1;
- padding: 30rpx;
- .title {
- font-size: $font-lg;
- font-weight: bold;
- }
- .link {
- font-size: $font-base - 2rpx;
- color: $font-color-light;
- }
- }
- .order-section {
- @extend %section;
- padding: 28rpx 0;
- padding-top: 0;
- .order-item {
- @extend %flex-center;
- width: 120rpx;
- height: 120rpx;
- border-radius: 10rpx;
- font-size: $font-sm;
- color: $font-color-dark;
- .numOrderItem {
- font-size: 36rpx;
- font-weight: bold;
- text-align: center;
- }
- }
- .iconfont {
- font-size: 48rpx;
- margin-bottom: 18rpx;
- color: #fa436a;
- }
- .icon-shouhoutuikuan {
- font-size: 44rpx;
- }
- .icon {
- height: 50rpx;
- width: 48rpx;
- margin-bottom: 18rpx;
- background-size: 100%;
- background-repeat: no-repeat;
- background-position: center;
- .icon-img {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .history-section {
- // padding: 30rpx 0 0;
- margin-top: 20rpx;
- background: #fff;
- border-radius: 10rpx;
- .h-list {
- white-space: nowrap;
- padding: 30rpx 30rpx 0;
- .h-list-image {
- display: inline-block;
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- border-radius: 10rpx;
- }
- }
- }
- .hx-wrapper {
- width: 536rpx;
- // height: 630rpx;
- position: relative;
- padding-bottom: 40rpx;
- background-color: #fff;
- border-radius: 20rpx;
- .hx-img {
- width: 536rpx;
- height: 281rpx;
- image {
- width: 536rpx;
- height: 281rpx;
- }
- }
- .hx-close {
- position: absolute;
- left: 243rpx;
- bottom: -80rpx;
- width: 52rpx;
- height: 52rpx;
- image {
- width: 52rpx;
- height: 52rpx;
- }
- }
- .hx-body {
- width: 536rpx;
- // min-height: 349rpx;
- background-color: #fff;
- border-radius: 0 0 10rpx 10rpx;
- padding-top: 40rpx;
- .hx-title {
- width: 536rpx;
- font-size: 36rpx;
- font-weight: 500;
- color: #333333;
- line-height: 1;
- padding-top: 42rpx;
- text-align: center;
- padding-bottom: 10rpx;
- }
- input {
- width: 439rpx;
- height: 68rpx;
- background: #f1faf6;
- border-radius: 10rpx;
- margin: 0 auto 40rpx;
- padding-left: 26rpx;
- .hx-placeholder {
- font-size: 26rpx;
- font-weight: 500;
- color: $base-color;
- }
- }
- .hx-btn {
- margin: 44rpx auto 0;
- width: 353rpx;
- height: 71rpx;
- background: $base-color;
- border-radius: 34rpx;
- font-size: 36rpx;
- font-weight: 500;
- color: #F8F9F9;
- line-height: 71rpx;
- text-align: center;
- }
- }
- }
- .dcm {
- width: 439rpx;
- margin: 0 auto;
- align-items: center;
- height: 68rpx;
- input {
- flex-grow: 1;
- height: 68rpx;
- background: #f1faf6;
- border-radius: 10rpx;
- margin: auto 10rpx auto 0;
- padding-left: 26rpx;
- }
- image {
- flex-shrink: 0;
- }
- }
- .nav-hx {
- display: flex;
- justify-content: center;
- margin-bottom: 20rpx;
- text {
- font-size:28rpx;
- padding: 10rpx;
- }
- .action {
- color: $base-color;
- font-weight: bold;
-
- }
- }
- </style>
|