| | |
| | |
|
| | | .msg-tip {
|
| | | font-size: 24rpx;
|
| | | font-family: PingFangSC, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | line-height: 34rpx;
|
| | |
| | | border-radius: 62rpx;
|
| | |
|
| | | font-size: 32rpx;
|
| | | font-family: PingFangSC, PingFang SC;
|
| | | font-weight: 600;
|
| | | color: #FFFFFF;
|
| | | line-height: 80rpx;
|
| | |
| | | border-radius: 62rpx;
|
| | | border: 2rpx solid #666666;
|
| | | font-size: 32rpx;
|
| | | font-family: PingFangSC, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #666666;
|
| | | line-height: 92rpx;
|
| | |
| | | .close-parent {
|
| | | position: relative;
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC, PingFang SC;
|
| | | font-weight: 600;
|
| | | color: #000000;
|
| | | line-height: 40rpx;
|
| | |
| | | line-height: 78rpx; |
| | | } |
| | | } |
| | | .component-stock-zero::after{ |
| | | position: absolute; |
| | | line-height: 100%; |
| | | // font-size: ; |
| | | left: 0rpx; |
| | | right: 0rpx; |
| | | // top: 0rpx; |
| | | bottom: 0rpx; |
| | | font-size: 600; |
| | | content: '已售罄'; |
| | | color: #fff; |
| | | text-align: center; |
| | | top: calc(50% - 20rpx); |
| | | } |
| | | .component-stock-zero{ |
| | | position: relative; |
| | | } |
| | | .component-popup_input{ |
| | | margin: 0 auto; |
| | | margin-top: 160rpx; |
| | |
| | | $u-primary: #20613D; |
| | | body { |
| | | --tcolor: #3140A2; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | // font-family: , PingFang SC; |
| | | font-family: PingFangSC, PingFang SC,PingFangSC-Regular; |
| | | } |
| | |
| | | $u-primary: #20613D; |
| | | body { |
| | | --tcolor: #3140A2; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-family: PingFangSC, PingFang SC,PingFangSC-Regular; |
| | | } |
| | |
| | | |
| | | .item { |
| | | |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | // color: #A1A6B3; |
| | | color: var(--topicgray); |
| | |
| | | |
| | | .item { |
| | | |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #A1A6B3; |
| | | |
| | |
| | | // border-bottom: 8rpx solid #000; |
| | | // 底部的线条 |
| | | |
| | | font-family: PingFangSC, PingFang SC; |
| | | font-weight: 600; |
| | | font-size: 36rpx; |
| | | color: #ffffff; |
| | |
| | | "quickapp" : {}, |
| | | /* 快应用特有相关 */ |
| | | "mp-weixin" : { |
| | | "appid" : "wx1441324401626290", |
| | | "appid" : "wx3203fd935a6ffe09", |
| | | "setting" : { |
| | | "urlCheck" : false, |
| | | "es6" : true, |
| | |
| | | } else { |
| | | //根据id去重正常 |
| | | var ids = [] |
| | | var idsMap = {} |
| | | for (var item of this.list) { |
| | | ids.push(item.id) |
| | | if (item.id) { |
| | | idsMap[item.id] = item |
| | | } |
| | | } |
| | | for (var item of data.records) { |
| | | if (ids.indexOf(item.id) < 0) { |
| | | this.list.push(item) |
| | | } else { |
| | | //最好更新一下 |
| | | idsMap[item.id] = { |
| | | ...idsMap[item.id], |
| | | ...item,//覆盖了 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | "navigationBarTitleText": "收货地址"
|
| | | }
|
| | | },
|
| | | // #endif |
| | | { |
| | | "path": "pages/login/supplier-login", |
| | | "style": { |
| | | "navigationBarTitleText": "登录", |
| | | "enablePullDownRefresh": false, |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/home/supplier-home", |
| | | "style": { |
| | | "navigationBarTitleText": "首页", |
| | | "enablePullDownRefresh": true, |
| | | "navigationStyle": "custom" |
| | | } |
| | | },
|
| | | // #endif
|
| | | {
|
| | | "path": "pages/login/supplier-login",
|
| | | "style": {
|
| | | "navigationBarTitleText": "登录",
|
| | | "enablePullDownRefresh": false,
|
| | | "navigationStyle": "custom"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "pages/home/supplier-home",
|
| | | "style": {
|
| | | "navigationBarTitleText": "首页",
|
| | | "enablePullDownRefresh": true,
|
| | | "navigationStyle": "custom"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "pages/login/supplier-reg",
|
| | | "style": {
|
| | |
| | | ],
|
| | | "subPackages": [{
|
| | | "root": "sub_pages/supplier",
|
| | | "pages": [
|
| | | "pages": [{
|
| | | "path": "protocol",
|
| | | "style": {
|
| | | "navigationBarTitleText": "协议",
|
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | }
|
| | | // #ifdef PUB_SUPPLIER
|
| | | {
|
| | | ,{
|
| | | "path": "supplier-info/supplier-info",
|
| | | "style": {
|
| | | "navigationBarTitleText": "信息维护",
|
| | |
| | | "navigationBarBackgroundColor": "#E6F2EB"
|
| | | }
|
| | | },
|
| | |
|
| | | {
|
| | | "path": "protocol",
|
| | | "path": "print/print-list",
|
| | | "style": {
|
| | | "navigationBarTitleText": "协议",
|
| | | "navigationBarTitleText": "打印",
|
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | }, |
| | | { |
| | | "path": "print/print-list", |
| | | "style": { |
| | | "navigationBarTitleText": "打印", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | |
| | |
|
| | | }, {
|
| | | "path": "order-settlement/order-settlement",
|
| | | "style": {
|
| | | "navigationBarTitleText": "账单结算",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "order-settlement/order-settlement-detail",
|
| | | "style": {
|
| | | "navigationBarTitleText": "结算单详情"
|
| | | }
|
| | | }
|
| | | // #endif
|
| | | // #ifdef PUB_PARTNER || PUB_SUPPLIER
|
| | | // #ifdef PUB_PARTNER
|
| | | ,{
|
| | | "path": "order-settlement/order-settlement",
|
| | | "style": {
|
| | |
| | | "navigationBarTitleText": "信息维护",
|
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | }, |
| | | { |
| | | "path": "partner-info/partner-code", |
| | | "style": { |
| | | "navigationBarTitleText": "二维码", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | }, |
| | | |
| | | },
|
| | | {
|
| | | "path": "partner-info/partner-code",
|
| | | "style": {
|
| | | "navigationBarTitleText": "二维码",
|
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | },
|
| | |
|
| | | {
|
| | | "path": "order-manage/order-manage",
|
| | | "style": {
|
| | |
| | | "navigationBarTitleText": "我的关注",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | }, |
| | | { |
| | | "path": "self/history", |
| | | "style": { |
| | | "navigationBarTitleText": "浏览记录", |
| | | "enablePullDownRefresh": true |
| | | } |
| | | },
|
| | | {
|
| | | "path": "self/history",
|
| | | "style": {
|
| | | "navigationBarTitleText": "浏览记录",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "self/collect",
|
| | |
| | | <view class="home-top-flow"> |
| | | <view class="item flex" v-for="(item,index) of list" :key="index" @click="toDetail(item)"> |
| | | <view class="img"> |
| | | <image class="img img100" :src="item.cover"> |
| | | <image class="img img100" :class="[!item.stock?'component-stock-zero':'']" :src="item.cover"> |
| | | </image> |
| | | <view class="level"> |
| | | {{ item.levelStr}} |
| | |
| | | line-height: 28px; |
| | | } |
| | | .title-2{ |
| | | font-family: PingFangSC, PingFang SC; |
| | | font-weight: 600; |
| | | font-size: 24px; |
| | | color: #000000; |
| | |
| | | } |
| | | }, |
| | | printDeliveryOrder(item) { |
| | | this.$message.showToast('敬请期待') |
| | | // this.$storage.setItem('cache_delivery_order_print',JSON.stringify(item)) |
| | | // uni.navigateTo({ |
| | | // url:'/sub_pages/supplier/print/print-list' |
| | | // }) |
| | | // this.$message.showToast('敬请期待') |
| | | this.$storage.setItem('cache_delivery_order_print',JSON.stringify(item)) |
| | | uni.navigateTo({ |
| | | url:'/sub_pages/supplier/print/print-list' |
| | | }) |
| | | } |
| | | |
| | | } |
| | |
| | | <view class="list-container order-delivery supplier"> |
| | | <view class="p15"> |
| | | <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> |
| | | <view v-for="(item,index) in list" :key="index" @click="toDetail(item)" |
| | | <view v-for="(item,index) in list" :key="index" |
| | | class="m-b-24 order-sale-list list-container"> |
| | | <view class="order-sale-item list-item"> |
| | | <view class="title flex"> |
| | |
| | | <view class="title">{{item.flowerName }} |
| | | </view> |
| | | </view> |
| | | <view class="each-list flex"> |
| | | <view class="each-item"> |
| | | <view class="each-list "> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">颜色</view> |
| | | <view class="value">{{ item.flowerColor || '-' }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">规格</view> |
| | | <view class="value">{{ item.flowerUnit || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="each-list price"> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1"> |
| | | <view class="value">¥{{ item.price || '-' }}</view> |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1"> |
| | | <view class="value">x {{ item.num || 0 }}</view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="line"></view> |
| | | <view class="delivery-form"> |
| | | <view class="form-item"> |
| | | <view class="form-item flex1"> |
| | | <view class="label">仓库名称</view> |
| | | <view class="value red">{{item.warehouseName}}</view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item flex1"> |
| | | <view class="label">库位名称</view> |
| | | <view class="value red">{{item.warehouseLocationCode}}</view> |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- #ifdef PUB_CUSTOMER --> |
| | | <!-- #ifdef PUB_SUPPLIER --> |
| | | <view class="line"></view> |
| | | <view class="buttons"> |
| | | <view class="button button-1 m-r-0" @click="printDeliveryOrder(item)">打印</view> |
| | |
| | | background-color: #fff; |
| | | margin-bottom: 20rpx; |
| | | padding: 22rpx; |
| | | .each-item{ |
| | | .label{ |
| | | min-width: 120rpx; |
| | | |
| | | } |
| | | .label:after{ |
| | | content: ":"; |
| | | margin-right: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .buttons { |
| | | display: flex; |
| | |
| | | </view> |
| | | <view class="p15" style="min-height: calc(100vh - 160rpx);"> |
| | | <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data> |
| | | <view v-for="(item,index) in list" :key="index" class="m-b-24 order-sale-list list-container"> |
| | | <view v-for="(dto,index) in list" :key="index" class="m-b-24 order-sale-list list-container"> |
| | | <view class="order-sale-item list-item"> |
| | | <view class="title flex"> |
| | | <view>订单单号:{{item.orderNo}}</view> |
| | | <view class="m-l-a m-r-0 status">{{item.statusStr}}</view> |
| | | <view>订单单号:{{dto.orderNo}}</view> |
| | | <view class="m-l-a m-r-0 status">{{dto.statusStr}}</view> |
| | | </view> |
| | | <view class="line" v-if="false"></view> |
| | | <view class="flower flex" v-if="false"> |
| | | <image class="image img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | | <view class=" flex"> |
| | | <view class="title">{{item.flowerName }} |
| | | </view> |
| | | <view v-if="dto.items"> |
| | | <view v-for="(item,k) of dto.items" :key="k"> |
| | | <view class="line" v-if="true"></view> |
| | | <view class="supplier-name "> |
| | | <image class="icon-dp" src="/static/common/icon-dp.png"></image> |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="each-list flex"> |
| | | <view class="each-item"> |
| | | <view class="label">颜色</view> |
| | | <view class="value">{{ item.flowerColor || '-' }}</view> |
| | | <view class="flower flex m-t-12" v-if="true"> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="label">规格</view> |
| | | <view class="value">{{ item.flowerUnit || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="each-list price"> |
| | | <view class="each-item"> |
| | | <view class="value">¥{{ item.price || '-' }}</view> |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="value">x {{ item.num || 0 }}</view> |
| | | </view> |
| | | </view> |
| | | <image class="image img100 m-r-6" :src="item.flowerCover" |
| | | @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | | <view class=" flex"> |
| | | <view class="title">{{item.flowerName }} |
| | | </view> |
| | | </view> |
| | | <view class="each-list"> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">颜色</view> |
| | | <view class="value">{{ item.flowerColor || '-' }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">规格</view> |
| | | <view class="value">{{ item.flowerUnit || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="each-list price"> |
| | | <view class="each-item flex1"> |
| | | <view class="value">¥{{ item.price || '-' }}</view> |
| | | </view> |
| | | <view class="each-item flex1"> |
| | | <view class="value">x {{ item.num || 0 }}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="line"></view> |
| | | <view class="delivery-form"> |
| | | <view class="form-item" style="max-width: 100%;"> |
| | | <view class="label">下单时间</view> |
| | | <view class="value">{{item.paymentTime}}</view> |
| | | <view class="value">{{dto.paymentTime}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="delivery-form"> |
| | | <view class="form-item"> |
| | | <view class="label">仓库名称</view> |
| | | <view class="value red">{{item.warehouseName || '待分配'}}</view> |
| | | <view class="value red">{{dto.warehouseName || '待分配'}}</view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="label">库位名称</view> |
| | | <view class="value red">{{item.warehouseLocationCode || '待分配'}}</view> |
| | | <view class="value red">{{dto.warehouseLocationCode || '待分配'}}</view> |
| | | </view> |
| | | |
| | | </view> |
| | |
| | | <view class="line"></view> |
| | | <view class="buttons"> |
| | | |
| | | <view class="button button-1 m-r-10" v-if="item.status==='PENDING'" |
| | | @click="toDetail(item,'PENDING')">确认入位</view> |
| | | <view class="button button-0" @click="toDetail(item,'')">查看详情</view> |
| | | <view class="button button-1 m-r-10" v-if="dto.status==='PENDING'" |
| | | @click="toDetail(dto,'PENDING')">确认入位</view> |
| | | <view class="button button-0" @click="toDetail(dto,'')">查看详情</view> |
| | | </view> |
| | | |
| | | |
| | |
| | | } |
| | | this.listApi = '/api/supplier/delivery/list/today' |
| | | this.listApi = '/api/supplier/delivery/list' |
| | | |
| | | |
| | | this.getList() |
| | | |
| | | }, |
| | |
| | | url: `/pages/order/order-delivery-detail?id=${item.id}&status=${status}` |
| | | }) |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | background-color: #fff; |
| | | margin-bottom: 20rpx; |
| | | padding: 22rpx; |
| | | .each-item{ |
| | | .label{ |
| | | min-width: 120rpx; |
| | | |
| | | } |
| | | .label:after{ |
| | | content: ":"; |
| | | margin-right: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .supplier-name { |
| | | border-bottom: 2rpx solid #EEEEEE; |
| | | font-weight: 600; |
| | | font-size: 28rpx; |
| | | color: #000000; |
| | | padding-bottom: 10rpx; |
| | | line-height: 40rpx; |
| | | |
| | | .icon-dp { |
| | | width: 27rpx; |
| | | height: 27rpx; |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | } |
| | | } |
| | | |
| | | .buttons { |
| | | display: flex; |
| | |
| | | console.log('sign_add', key) |
| | | state.sign[key] = 1 |
| | | }, |
| | | // sign_add_value: async function({ |
| | | // commit, |
| | | // state |
| | | // }, { |
| | | // key, |
| | | // value |
| | | // }) { |
| | | // console.log('sign_add', key) |
| | | // state.sign[key] = value || 0 |
| | | // }, |
| | | sign_clear: async function({ |
| | | commit, |
| | | state |
| | |
| | | state |
| | | }, data) { |
| | | if (state.currentInfo.id) { |
| | | const resp = await http.request('get', '/api/customer/flower/cart/flower/count', {}) |
| | | const resp = await http.request('get', '/api/customer/flower/cart/flower/count', { |
| | | params: { |
| | | // flowerId: data || null |
| | | } |
| | | }) |
| | | if (resp && resp.code === 0) { |
| | | return resp.data || 0 |
| | | } else { |
| | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container flex" :class="[dto.status!=='UP'?'OFF':'']" v-for="(dto,index) of list" |
| | | :key="index"> |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <image class="img img100 br-4 m-r-10" :class="[!dto.stock?'component-stock-zero':'']" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <view class="flex1"> |
| | | <view class="flex" @click.stop="toDetail(dto)"> |
| | | <view class="title"> |
| | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container flex" :class="[dto.status!=='UP'?'OFF':'']" |
| | | v-for="(dto,index) of list" :key="index"> |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <image class="img img100 br-4 m-r-10" :class="[!dto.stock?'component-stock-zero':'']" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <view class="flex1"> |
| | | <view class="flex" @click.stop="toDetail(dto)"> |
| | | <view class="title"> |
| | |
| | | <u-swipe-action-item :options="options1" @click="(e)=>{clickSwipeButton(dto,true)}"> |
| | | <view class="item-each flex"> |
| | | <radio :checked="ids.indexOf(dto.id)>=0" @click="changeItem(dto,'flower')"></radio> |
| | | <image class="img img100 m-r-6 br-4" :src="dto.url||dto.cover"></image> |
| | | <image class="img img100 m-r-6 br-4" :class="[!dto.stock?'component-stock-zero':'']" :src="dto.url||dto.cover"></image> |
| | | <view class="flex1"> |
| | | <view class="title" @click.stop="toDetail(dto)"><span class="m-r-5" |
| | | style="display: inline-block;">{{dto.categoryStr||''}}</span><span |
| | |
| | | <view class="button-icons flex m-l-a m-r-0"> |
| | | <uni-icons v-if="dto.num&&dto.num>=1" type="minus" size="32" |
| | | @click.stop="addnum(dto,-1)"></uni-icons> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.num&&dto.num>=1">{{ dto.num }}</view> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" |
| | | v-if="dto.num&&dto.num>=1">{{ dto.num }}</view> |
| | | <uni-icons type="plus-filled" size="32" |
| | | @click.stop="addnum(dto,1)"></uni-icons> |
| | | </view> |
| | |
| | | } |
| | | }, |
| | | onShow() { |
| | | if (this.sign['shopping']) { |
| | | this.init() |
| | | } |
| | | }, |
| | | mounted() { |
| | | // if (this.sign['shopping']) { |
| | | |
| | | // } |
| | | this.init() |
| | | }, |
| | | async onPullDownRefresh(){ |
| | | mounted() { |
| | | // this.init() |
| | | }, |
| | | async onPullDownRefresh() { |
| | | await this.init() |
| | | uni.stopPullDownRefresh() |
| | | }, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | async clickSwipeButton(item,check) { |
| | | async clickSwipeButton(item, check) { |
| | | //删除商品,重新加载数据? |
| | | if(check){ |
| | | if (check) { |
| | | this.$message.confirm('是否删除商品') |
| | | return |
| | | |
| | | |
| | | } |
| | | |
| | | this.$message.showLoading() |
| | |
| | | var t = parseInt(res.content) |
| | | if (isNaN(t) || t < 0) { |
| | | this.$message.showToast('数目需要大于等于0') |
| | | |
| | | |
| | | } else { |
| | | if (!item.stock || t > item.stock) { |
| | | this.$message.showToast('库存不足无法修改') |
| | | return |
| | | } |
| | | this.addnum(item, (t - item.num)) |
| | | |
| | | |
| | | } |
| | | } else { |
| | | |
| | | |
| | | } |
| | | }, |
| | | async addnum(dto, addnum) { |
| | | if (dto.num + addnum >= 0) { |
| | | |
| | | } else { |
| | | console.log('addnum',dto,addnum) |
| | | console.log('addnum', dto, addnum) |
| | | return |
| | | } |
| | | if (!dto.stock) { |
| | | dto.stock = 0 |
| | | } |
| | | if (dto.num + addnum > dto.stock) { |
| | | if (addnum > 0 && dto.num + addnum > dto.stock) { |
| | | this.$message.showToast('库存不足,无法修改') |
| | | return |
| | | } |
| | |
| | | dto.num += addnum |
| | | if (dto.num < 1) { |
| | | //id删除清空,并且 |
| | | await this.clickSwipeButton(dto,false) |
| | | await this.clickSwipeButton(dto, false) |
| | | // await this.init() |
| | | } |
| | | this.$forceUpdate() |
| | | } |
| | | }, |
| | | async init() { |
| | | |
| | | |
| | | this.ids = [] |
| | | this.checkall = false |
| | | |
| | | |
| | | if (!this.currentInfo.id) { |
| | | this.$message.showToast('请先登录') |
| | | return |
| | |
| | |
|
| | | } else {
|
| | | if (!item.stock || t > item.stock) {
|
| | | this.$message.showToast('库存不足无法修改')
|
| | | this.$message.showToast('库存不足无法修改') |
| | | return
|
| | | }
|
| | | this.addnum(item, (t - item.shopnum))
|
| | |
| | | },
|
| | |
|
| | | async refreshShopNum() {
|
| | | this.shopnum = await this.$store.dispatch('countShopping');
|
| | | this.shopnum = await this.$store.dispatch('countShopping'); |
| | | this.$store.dispatch('sign_add','shopnum') |
| | | |
| | | },
|
| | | async collectItem(dto) {
|
| | | if (!this.currentInfo.id) {
|
| | |
| | | <!-- 查询条件 -->
|
| | | <view class="component-filter-container">
|
| | | <view class="flex1" @click.stop="order_show=true">
|
| | | {{ query.columnStr || '排序' }}
|
| | | 排序{{ query.columnStr&&('-'+query.columnStr) || '' }}
|
| | | <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
|
| | | </view>
|
| | | <view class="flex1" @click.stop="level_show=true">
|
| | |
| | |
|
| | | <view class="component-shop-item flex" v-for="(item,index) of list" :key="index">
|
| | | <view class="img" @click.stop="toDetail(item)">
|
| | | <image class="img img100" :src="item.cover">
|
| | | <image class="img img100" :class="[!item.stock?'component-stock-zero':'']" :src="item.cover">
|
| | | </image>
|
| | | <view class="level">
|
| | | {{item.levelStr||''}}
|
| | |
| | | <view v-for="(item,i) in params" :key="i" class="m-t-20">
|
| | | <view class="title topic-font" style="font-size: 40rpx;font-weight: 600;">{{ item.name }}</view>
|
| | | <view class="m-t-12 flex value-items">
|
| | | <view class="value-item" @click="updateValue(item,each)" :class="[item.value===each?'cur':'']"
|
| | | v-for="(each, j) in item.values" :key="j">
|
| | | <view class="value-item" @click="updateValue(item,each)"
|
| | | :class="[item.value.indexOf(each)>=0?'cur':'']" v-for="(each, j) in item.values" :key="j">
|
| | | {{ each || '-' }}
|
| | | </view>
|
| | | </view>
|
| | |
| | | <view class="button-space"></view>
|
| | | <view>
|
| | | <view class="button-green"
|
| | | style="background-color: #fff;border: 2rpx solid #666; color: #666;width: 200rpx;left: 40rpx;right: unset;"
|
| | | @click="closeParamPopAndQuery">
|
| | | 查询
|
| | | style="background-color: #fff;border: 2rpx solid #666; color: #666;min-width: 240rpx;left: 40rpx;right: unset;"
|
| | | @click="closeParamPop">
|
| | | 关闭
|
| | | </view>
|
| | |
|
| | | <view class="button-green" style="width: 200rpx;right: 40rpx;left: unset;" @click="closeParamPop">关闭
|
| | | <view class="button-green" style="min-width: 240rpx;right: 40rpx;left: unset;"
|
| | | @click="closeParamPopAndQuery">查询
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | this.page.current = 1
|
| | | await this.getList('post')
|
| | | uni.stopPullDownRefresh()
|
| | | }, |
| | | onShow(){ |
| | | this.refreshShopNum() |
| | | },
|
| | | methods: { |
| | | async refreshShopNum() { |
| | | this.shoptotal = await this.$store.dispatch('countShopping'); |
| | | async onShow() {
|
| | | if (this.sign['shopnum']) {
|
| | | await this.$store.dispatch('sign_clear', 'shopnum');
|
| | | //重新获取商品数目
|
| | | //只需要刷新列表的部分信息即可
|
| | | this.getList('post')
|
| | | }
|
| | | this.refreshShopNum()
|
| | | },
|
| | | methods: {
|
| | | async refreshShopNum() {
|
| | | this.shoptotal = await this.$store.dispatch('countShopping');
|
| | | },
|
| | | async getDetail() {
|
| | | this.$message.showLoading()
|
| | |
| | | }
|
| | | },
|
| | | updateValue(item, value) {
|
| | | item.value = value
|
| | | this.$set(item, 'value', value)
|
| | | // item.value = value
|
| | | // this.$set(item, 'value', value)
|
| | | if (item.value.indexOf(value) < 0) {
|
| | | item.value.push(value)
|
| | | } else {
|
| | | item.value.splice(item.value.indexOf(value), 1)
|
| | | }
|
| | | this.$forceUpdate()
|
| | | },
|
| | | closeParamPop() {
|
| | |
| | | //设置参数
|
| | | this.query.params = []
|
| | | for (var param of this.params) {
|
| | | if (param.value) {
|
| | | if (param.value && param.value.length > 0) {
|
| | | this.query.params.push({
|
| | | id: param.id,
|
| | | value: param.value
|
| | | value: param.value.join(',')
|
| | | })
|
| | | }
|
| | | }
|
| | |
| | | async showSelectParams() {
|
| | | //得有分类才有参数
|
| | | this.$message.showLoading()
|
| | | const res = await this.$http.request('get', '/api/supplier/flower/params', {
|
| | | const res = await this.$http.request('get', '/api/customer/flower/params', {
|
| | | params: {
|
| | | categoryId: this.query.category
|
| | | }
|
| | |
| | | if (res.code === 0) {
|
| | | // this.columns_params = res.data || []
|
| | | this.params = res.data || []
|
| | | for (var k of this.params) {
|
| | | if (!k.value) {
|
| | | k.value = []
|
| | | } else {
|
| | | k.value = k.value.split(',') || []
|
| | | }
|
| | | }
|
| | | this.$refs.popup_param.open()
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | if (!item.stock) {
|
| | | item.stock = 0
|
| | | } |
| | | if (!item.shopnum) { |
| | | item.shopnum = 0 |
| | | }
|
| | | if (!item.shopnum) {
|
| | | item.shopnum = 0
|
| | | }
|
| | | if (addnum > 0 & item.shopnum + addnum > item.stock) {
|
| | | this.$message.showToast('库存不足,无法修改')
|
| | | return
|
| | | }
|
| | | |
| | |
|
| | | if (item.shopnum + addnum >= 0) {
|
| | |
|
| | | } else {
|
| | |
| | | })
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum |
| | | this.$forceUpdate() |
| | | |
| | | this.refreshShopNum() |
| | | |
| | | item.shopnum += addnum
|
| | | this.$forceUpdate()
|
| | |
|
| | | this.refreshShopNum()
|
| | |
|
| | | }
|
| | | },
|
| | | }
|
| | |
| | | @click.stop="toDetailList(item)">
|
| | | <view class="m-r-10">
|
| | | <!-- @click.stop="previewImg(item.imageUrl)" -->
|
| | | <image :src="item.imageUrl" mode="scaleToFill" class="cover" :lazy-load="true">
|
| | | <image :src="item.imageUrl" :class="[!item.stock?'component-stock-zero':'']" |
| | | mode="scaleToFill" class="cover" :lazy-load="true">
|
| | | </image>
|
| | | </view>
|
| | | <view class="cateen_infos list">
|
| | | <view class="title">{{item.name}}</view>
|
| | | <view class="price">¥{{minWeightPrice(item)}}-{{maxWeightPrice(item)}}</view>
|
| | | <view class="desc">在售 {{item.stock||'-'}} 扎</view>
|
| | | <view class="price">¥{{item.priceLow || 0}}-{{item.priceHigh||0}}</view>
|
| | | <view class="desc">在售 {{item.stock||'0'}} 扎</view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
| | | type: 'DELIVERY_ORDER_STATUS' |
| | | } |
| | | }).then(res => { |
| | | var data = res.data |
| | | var data = res.data||[] |
| | | this.status_columns = [data || []] |
| | | this.status_columns[0].unshift({ |
| | | label: '全部', |
| | | value: '' |
| | | }) |
| | | console.log('status_columns',this.status_columns) |
| | | }) |
| | | |
| | | }, |
| | |
| | | }, |
| | | select_status(e) { |
| | | this.show_select_status = false |
| | | this.query.statusStr = e.value[0].name |
| | | this.query.status = e.value[0].id |
| | | this.query.statusStr = e.value[0].label |
| | | this.query.status = e.value[0].value |
| | | this.refreshList() |
| | | }, |
| | | toDetail(item) { |
| | |
| | | <footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg> |
| | | <u-picker @confirm="select_station" keyName="name" @cancel="show_select_station=false" |
| | | :show="show_select_station" :columns="columns_station"></u-picker> |
| | | <u-picker @confirm="select_status" keyName="name" @cancel="show_select_status=false" :show="show_select_status" |
| | | <u-picker @confirm="select_status" keyName="label" @cancel="show_select_status=false" :show="show_select_status" |
| | | :columns="status_columns"></u-picker> |
| | | |
| | | |
| | |
| | | <view class="title">{{item.flowerName }} |
| | | </view> |
| | | </view> |
| | | <view class="each-list flex"> |
| | | <view class="each-item"> |
| | | <view class="each-list "> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">颜色</view> |
| | | <view class="value">{{ item.flowerColor || '-' }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1 flex"> |
| | | <view class="label">规格</view> |
| | | <view class="value">{{ item.flowerUnit || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="each-list price"> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1"> |
| | | <view class="value">¥{{ item.price || '-' }}</view> |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="each-item flex1"> |
| | | <view class="value">x {{ item.num || 0 }}</view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- 罗列详细参数 --> |
| | | <view class="line" v-if="item.params"></view> |
| | | <view class="delivery-form" v-if="item.params"> |
| | | <view class="form-item" v-for="(p,k) of item.params" :key="k"> |
| | | <view class="label">{{p.name||'-'}}:</view> |
| | | <view class="value red">{{p.value}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | <script> |
| | | var tsc = require("@/plugins/tsc.js"); |
| | | // var app = uni.getApp() |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | readCharacter: false, |
| | | notifyCharacter: false, |
| | | isScanning: false, |
| | | deviceId: '', |
| | | //打印的 |
| | | sendContent: "", |
| | | looptime: 0, |
| | |
| | | printerNum: 1, |
| | | currentPrint: 1, |
| | | isReceiptSend: false, |
| | | isLabelSend: false |
| | | isLabelSend: false, |
| | | //写入的 |
| | | writeServiceId: '', |
| | | writeCharaterId: '', |
| | | notifyCharaterId: {}, |
| | | notifyServiceId: '', |
| | | BserviceId: '', |
| | | } |
| | | }, |
| | | onLoad() { |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady: function() { |
| | | var list = [] |
| | | var numList = [] |
| | | var j = 0 |
| | | for (var i = 20; i < 200; i += 10) { |
| | | list[j] = i; |
| | | j++ |
| | | } |
| | | for (var i = 1; i < 10; i++) { |
| | | numList[i - 1] = i |
| | | } |
| | | let that = this |
| | | that.buffSize = list |
| | | that.oneTimeData = list[0] |
| | | that.printNum = numList |
| | | that.printerNum = numList[0] |
| | | }, |
| | | async onLoad() { |
| | | var t = this.$storage.getItem('cache_delivery_order_print') || '' |
| | | if (t) |
| | | if (t) { |
| | | this.item = JSON.parse(t) |
| | | //获取详情接口 |
| | | this.$message.showLoading() |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('get', '/api/supplier/delivery/list/items/view', { |
| | | params: { |
| | | id: this.item.id |
| | | } |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (code == 0 && data) { |
| | | this.item = { |
| | | ...this.item, |
| | | ...data |
| | | } |
| | | } |
| | | } else { |
| | | this.$message.showToast('获取详情失败') |
| | | } |
| | | }, |
| | | onUnload() { |
| | | try { |
| | | wx.closeBLEConnection({ |
| | | deviceId: that.deviceId, |
| | | success: function(res) { |
| | | console.log("关闭蓝牙成功") |
| | | }, |
| | | }) |
| | | } catch (e) { |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | /** |
| | |
| | | */ |
| | | checkPemission: function() { //android 6.0以上需授权地理位置权限 |
| | | var that = this |
| | | var platform = app.BLEInformation.platform |
| | | var platform = uni.getDeviceInfo().platform |
| | | if (platform == "ios") { |
| | | app.globalData.platform = "ios" |
| | | // uni.getDeviceInfo().platform = "ios" |
| | | that.getBluetoothDevices() |
| | | } else if (platform == "android") { |
| | | app.globalData.platform = "android" |
| | | console.log(app.getSystem()) //这里是拿到安卓的系统版本名 如:Android 9 |
| | | console.log('输出系统版本号', app.getSystem().substring(app.getSystem().length - (app.getSystem().length - |
| | | 8), app.getSystem().length - (app.getSystem().length - 8) + 1)) //这里为了获取到系统的版本号,如 9 |
| | | var systemVersion = app.getSystem().substring(app.getSystem().length - (app.getSystem().length - |
| | | 8), app.getSystem().length - (app.getSystem().length - 8) + 1) |
| | | // uni.getDeviceInfo().platform = "android" |
| | | console.log(uni.getDeviceInfo()) //这里是拿到安卓的系统版本名 如:Android 9 |
| | | console.log('输出系统版本号', uni.getDeviceInfo().system.substring(uni.getDeviceInfo().system.length - ( |
| | | uni.getDeviceInfo().system.length - |
| | | 8), uni.getDeviceInfo().system.length - (uni.getDeviceInfo().system.length - 8) + |
| | | 1)) //这里为了获取到系统的版本号,如 9 |
| | | var systemVersion = uni.getDeviceInfo().system.substring(uni.getDeviceInfo().system.length - (uni |
| | | .getDeviceInfo().system.length - |
| | | 8), uni.getDeviceInfo().system.length - (uni.getDeviceInfo().system.length - 8) + 1) |
| | | if (systemVersion > 5) { |
| | | wx.getSetting({ |
| | | success: function(res) { |
| | |
| | | wx.showLoading({ |
| | | title: '获取蓝牙设备中', |
| | | }) |
| | | that.setData({ |
| | | isScanning: true |
| | | }) |
| | | that.isScanning = true |
| | | wx.startBluetoothDevicesDiscovery({ |
| | | success: function(res) { |
| | | console.log(res) //输出蓝牙设备列表查找的结果,是否成功 |
| | |
| | | num++ |
| | | } |
| | | } |
| | | that.setData({ |
| | | list: devices, |
| | | isScanning: false |
| | | }) // 数据赋值 关闭刷新 |
| | | // 数据赋值 关闭刷新 |
| | | that.list = devices |
| | | that.isScanning = false |
| | | |
| | | wx.hideLoading() |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | |
| | | console.log(res) |
| | | }, |
| | | }) |
| | | that.setData({ |
| | | serviceId: 0, |
| | | writeCharacter: false, |
| | | readCharacter: false, |
| | | notifyCharacter: false |
| | | }) |
| | | console.log("e", e) |
| | | |
| | | that.serviceId = 0 |
| | | that.writeCharacter = false |
| | | that.readCharacter = false |
| | | that.notifyCharacter = false |
| | | |
| | | console.log("e", device) |
| | | // console.log(e.currentTarget.dataset.title) |
| | | wx.showLoading({ |
| | | title: '正在建立连接', |
| | | }) |
| | | // 与蓝牙设备建立链接 |
| | | wx.createBLEConnection({ |
| | | deviceId: e.deviceId, |
| | | deviceId: device.deviceId, |
| | | success: function(res) { |
| | | console.log('连接蓝牙设备成功', res) |
| | | app.BLEInformation.deviceId = e.deviceId |
| | | that.deviceId = device.deviceId |
| | | that.getSeviceId() //获取服务ID |
| | | }, |
| | | fail: function(e) { |
| | |
| | | |
| | | getSeviceId: function() { |
| | | var that = this |
| | | var platform = app.BLEInformation.platform //获取平台信息 |
| | | console.log(app.BLEInformation.deviceId) // 获取设备ID |
| | | var platform = uni.getDeviceInfo().platform //获取平台信息 |
| | | console.log(that.deviceId) // 获取设备ID |
| | | console.log('info getSeviceId', uni.getDeviceInfo()) |
| | | wx.getBLEDeviceServices({ |
| | | deviceId: app.BLEInformation.deviceId, |
| | | deviceId: that.deviceId, |
| | | success: function(res) { |
| | | console.log(res) |
| | | // 注释内容为方便调试特意直接赋值的一些信息,可以跳过 |
| | |
| | | // } |
| | | // } |
| | | } |
| | | app.BLEInformation.serviceId = realId |
| | | that.setData({ |
| | | services: res.services |
| | | }) //将服务信息赋值到公共数据缓存 |
| | | that.BserviceId = realId |
| | | that.services = res.services |
| | | |
| | | that.getCharacteristics() //获取特征 |
| | | }, |
| | | fail: function(e) { |
| | |
| | | */ |
| | | getCharacteristics: function() { |
| | | var that = this |
| | | var list = that.data.services |
| | | var num = that.data.serviceId |
| | | var write = that.data.writeCharacter |
| | | var read = that.data.readCharacter |
| | | var notify = that.data.notifyCharacter |
| | | var list = that.services |
| | | var num = that.serviceId |
| | | var write = that.writeCharacter |
| | | var read = that.readCharacter |
| | | var notify = that.notifyCharacter |
| | | wx.getBLEDeviceCharacteristics({ //获取蓝牙设备的特征信息 |
| | | deviceId: app.BLEInformation.deviceId, |
| | | deviceId: that.deviceId, |
| | | serviceId: list[num].uuid, |
| | | success: function(res) { |
| | | console.log('获取特征成功的结果', res) |
| | |
| | | var item = res.characteristics[i].uuid |
| | | if (!notify) { |
| | | if (properties.notify) { |
| | | app.BLEInformation.notifyCharaterId = item |
| | | app.BLEInformation.notifyServiceId = list[num].uuid |
| | | that.notifyCharaterId = item |
| | | that.notifyServiceId = list[num].uuid |
| | | notify = true |
| | | } |
| | | } |
| | | if (!write) { |
| | | if (properties.write) { |
| | | app.BLEInformation.writeCharaterId = item |
| | | app.BLEInformation.writeServiceId = list[num].uuid |
| | | that.writeCharaterId = item |
| | | that.writeServiceId = list[num].uuid |
| | | write = true |
| | | } |
| | | } |
| | | if (!read) { |
| | | if (properties.read) { |
| | | app.BLEInformation.readCharaterId = item |
| | | app.BLEInformation.readServiceId = list[num].uuid |
| | | that.readCharaterId = item |
| | | that.readServiceId = list[num].uuid |
| | | read = true |
| | | } |
| | | } |
| | | } |
| | | if (!write || !notify || !read) { |
| | | num++ |
| | | that.setData({ |
| | | writeCharacter: write, |
| | | readCharacter: read, |
| | | notifyCharacter: notify, |
| | | serviceId: num |
| | | }) |
| | | |
| | | that.writeCharacter = write |
| | | that.readCharacter = read |
| | | that.notifyCharacter = notify |
| | | that.serviceId = num |
| | | |
| | | |
| | | if (num == list.length) { |
| | | wx.showModal({ |
| | | title: '提示', |
| | |
| | | console.log(e) |
| | | }, |
| | | complete: function(e) { |
| | | console.log("write:" + app.BLEInformation.writeCharaterId) |
| | | console.log("read:" + app.BLEInformation.readCharaterId) |
| | | console.log("notify:" + app.BLEInformation.notifyCharaterId) |
| | | console.log("write:" + that.writeCharaterId) |
| | | console.log("read:" + that.readCharaterId) |
| | | console.log("notify:" + that.notifyCharaterId) |
| | | } |
| | | }) |
| | | }, |
| | | openControl() { |
| | | //打印 |
| | | var that = this; |
| | | // var canvasWidth = that.data.canvasWidth |
| | | // var canvasHeight = that.data.canvasHeight |
| | | |
| | | var command = tsc.jpPrinter.createNew() |
| | | command.setSize(48, 40) |
| | | command.setSize(48, 96) |
| | | command.setGap(0) |
| | | command.setCls() |
| | | command.setText(0, 30, "TSS24.BF2", 1, 1, "图片") |
| | | command.setQR(40, 120, "L", 5, "A", "www.smarnet.cc佳博智汇") |
| | | command.setText(60, 90, "TSS24.BF2", 1, 1, "佳博智汇") |
| | | command.setText(170, 50, "TSS24.BF2", 1, 1, "小程序测试") |
| | | command.setText(170, 90, "TSS24.BF2", 1, 1, "测试数字12345678") |
| | | command.setText(170, 120, "TSS24.BF2", 1, 1, "测试英文abcdefg") |
| | | command.setText(170, 150, "TSS24.BF2", 1, 1, "测试符号/*-+!@#$") |
| | | command.setBar(170, 180, "EAN8", 64, 1, 3, 3, "1234567") |
| | | // command.setText(0, 30, "TSS24.BF2", 1, 1, "图片") |
| | | // command.setQR(40, 120, "L", 5, "A", "www.smarnet.cc佳博智汇") |
| | | command.setText(60, 20, "TSS24.BF2", 1, 1, "单号:" + (that.item.orderNo || '-')) |
| | | if (that.item.warehouseName) |
| | | command.setText(20, 60, "TSS24.BF2", 1, 1, "仓库: " + that.item.warehouseName) |
| | | if (that.item.warehouseLocationCode) |
| | | command.setText(200, 60, "TSS24.BF2", 1, 1, "库位: " + that.item.warehouseLocationCode) |
| | | |
| | | // command.setText(170, 50, "TSS24.BF2", 1, 1, "小程序测试") |
| | | // command.setText(170, 90, "TSS24.BF2", 1, 1, "测试数字12345678") |
| | | // command.setText(170, 120, "TSS24.BF2", 1, 1, "测试英文abcdefg") |
| | | // command.setText(170, 150, "TSS24.BF2", 1, 1, "测试符号/*-+!@#$") |
| | | command.setText(20, 100, "TSS24.BF2", 1, 1, "供应商: " + (that.item.supplierName || '-')) |
| | | command.setText(20, 140, "TSS24.BF2", 1, 1, "商品名称: " + (that.item.flowerName || '-')) |
| | | command.setText(20, 180, "TSS24.BF2", 1, 1, "等级: " + (that.item.flowerLevelStr || '-')) |
| | | command.setText(200, 180, "TSS24.BF2", 1, 1, "颜色: " + (that.item.flowerColor || '-')) |
| | | command.setText(20, 220, "TSS24.BF2", 1, 1, "价格: ¥ " + (that.item.price || '-')) |
| | | command.setText(200, 220, "TSS24.BF2", 1, 1, "数目: x " + (that.item.num || '0')) |
| | | command.setText(20, 260, "TSS24.BF2", 1, 1, "规格: " + (that.item.flowerUnit || '-')) |
| | | command.setText(20, 300, "TSS24.BF2", 1, 1, "花满芫") |
| | | command.setText(170, 300, "TSS24.BF2", 1, 1, that.$util.toDateMin(new Date())) |
| | | if (that.item.params) { |
| | | var addnum = 0 |
| | | var hlen = 300 |
| | | for (var p of that.item.params) { |
| | | if (p.value) { |
| | | var lef = 20 |
| | | if (addnum % 2 == 1) { |
| | | lef = 200 |
| | | } else { |
| | | lef = 20 |
| | | hlen += 40 |
| | | } |
| | | command.setText(lef, hlen, "TSS24.BF2", 1, 1, "" + (p.name || '') + p.value) |
| | | addnum += 1 |
| | | } |
| | | } |
| | | } |
| | | // <view class="delivery-form" v-if="item.params"> |
| | | // <view class="form-item" v-for="(p,k) of item.params" :key="k"> |
| | | // <view class="label">{{p.name||'-'}}:</view> |
| | | // <view class="value red">{{p.value}}</view> |
| | | // </view> |
| | | // </view> |
| | | // command.setBar(170, 180, "EAN8", 64, 1, 3, 3, "1234567") |
| | | |
| | | command.setPagePrint() |
| | | that.setData({ |
| | | isLabelSend: true |
| | | }) |
| | | |
| | | that.isLabelSend = true |
| | | that.prepareSend(command.getData()) |
| | | |
| | | // wx.canvasGetImageData({ |
| | |
| | | prepareSend: function(buff) { //准备发送,根据每次发送字节数来处理分包数量 |
| | | console.log(buff) |
| | | var that = this |
| | | var time = that.data.oneTimeData |
| | | var time = that.oneTimeData |
| | | var looptime = parseInt(buff.length / time); |
| | | var lastData = parseInt(buff.length % time); |
| | | console.log(looptime + "---" + lastData) |
| | | that.setData({ |
| | | looptime: looptime + 1, |
| | | lastData: lastData, |
| | | currentTime: 1, |
| | | }) |
| | | |
| | | that.looptime = looptime + 1 |
| | | that.lastData = lastData |
| | | that.currentTime = 1 |
| | | that.Send(buff) |
| | | }, |
| | | Send: function(buff) { //分包发送 |
| | | var that = this |
| | | var currentTime = that.data.currentTime |
| | | var loopTime = that.data.looptime |
| | | var lastData = that.data.lastData |
| | | var onTimeData = that.data.oneTimeData |
| | | var printNum = that.data.printerNum |
| | | var currentPrint = that.data.currentPrint |
| | | var currentTime = that.currentTime |
| | | var loopTime = that.looptime |
| | | var lastData = that.lastData |
| | | var onTimeData = that.oneTimeData |
| | | var printNum = that.printerNum |
| | | var currentPrint = that.currentPrint |
| | | var buf |
| | | var dataView |
| | | if (currentTime < loopTime) { |
| | |
| | | } |
| | | console.log("第" + currentTime + "次发送数据大小为:" + buf.byteLength) |
| | | wx.writeBLECharacteristicValue({ |
| | | deviceId: app.BLEInformation.deviceId, |
| | | serviceId: app.BLEInformation.writeServiceId, |
| | | characteristicId: app.BLEInformation.writeCharaterId, |
| | | deviceId: that.deviceId, |
| | | serviceId: that.writeServiceId, |
| | | characteristicId: that.writeCharaterId, |
| | | value: buf, |
| | | success: function(res) { |
| | | console.log(res) |
| | |
| | | complete: function() { |
| | | currentTime++ |
| | | if (currentTime <= loopTime) { |
| | | that.setData({ |
| | | currentTime: currentTime |
| | | }) |
| | | that.currentTime = currentTime |
| | | |
| | | that.Send(buff) |
| | | } else { |
| | | wx.showToast({ |
| | | title: '已打印第' + currentPrint + '张', |
| | | }) |
| | | if (currentPrint == printNum) { |
| | | that.setData({ |
| | | looptime: 0, |
| | | lastData: 0, |
| | | currentTime: 1, |
| | | isReceiptSend: false, |
| | | isLabelSend: false, |
| | | currentPrint: 1 |
| | | }) |
| | | that.looptime = 0 |
| | | that.lastData = 0 |
| | | that.currentTime = 1 |
| | | that.isReceiptSend = false |
| | | that.isLabelSend = false |
| | | that.currentPrint = 1 |
| | | |
| | | } else { |
| | | currentPrint++ |
| | | that.setData({ |
| | | currentPrint: currentPrint, |
| | | currentTime: 1, |
| | | }) |
| | | |
| | | that.currentPrint = currentPrint |
| | | that.currentTime = 1 |
| | | |
| | | that.Send(buff) |
| | | } |
| | | } |
| | |
| | | margin-bottom: 20rpx; |
| | | padding: 22rpx; |
| | | |
| | | .each-item { |
| | | .label { |
| | | min-width: 120rpx; |
| | | |
| | | } |
| | | |
| | | .label:after { |
| | | content: ":"; |
| | | margin-right: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .buttons { |
| | | display: flex; |
| | | margin-left: auto; |