| | |
| | | .m-t-15 {
|
| | | margin-top: 30rpx;
|
| | | }
|
| | |
|
| | | .p-t-12{ |
| | | padding-top: 30rpx; |
| | | }
|
| | | .m-t-icon {
|
| | | margin-top: 8rpx;
|
| | | }
|
| | |
| | |
|
| | | .curnums {
|
| | | line-height: 60rpx; |
| | | margin-left: 12rpx; |
| | | margin-right: 12rpx;
|
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | <template> |
| | | <view class="home-category"> |
| | | <view class="flex"> |
| | | <view class="t1">{{today}}(今日)第一场交易中</view> |
| | | <view class="t2">当前在售123435扎</view> |
| | | </view> |
| | | <view class="m-t-12 flex"> |
| | | <view class="item" v-for="(item,index) of list" :key="index" @click.stop="toList(item)"> |
| | | <image class="icon img100" :src="item.url"></image> |
| | | <view>{{ item.name || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="home-category"> |
| | | <view class="flex"> |
| | | <view class="t1">{{today}}(今日)第一场交易中</view> |
| | | <view class="t2">当前在售123435扎</view> |
| | | </view> |
| | | <view class="m-t-12 flex"> |
| | | <view class="item" v-for="(item,index) of list" :key="index" @click.stop="toList(item)"> |
| | | <image class="icon img100" :src="item.url"></image> |
| | | <view>{{ item.name || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | beforeMount() { |
| | | this.today = this.$util.toDate(new Date()) |
| | | this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => { |
| | | var data = res.data |
| | | this.list = [] |
| | | var arr = data || [] |
| | | for (let i = 0; i < arr.length && i < 10; i++) { |
| | | this.list.push({ |
| | | id: arr[i].id, |
| | | name: arr[i].name, |
| | | url: arr[i].imageUrl |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | toList(item){ |
| | | uni.navigateTo({ |
| | | url:'/sub_pages/customer/trade/list?categoryId='+item.id |
| | | }) |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | list: [], |
| | | today:'', |
| | | export default { |
| | | beforeMount() { |
| | | this.today = this.$util.toDate(new Date()) |
| | | this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => { |
| | | var data = res.data |
| | | this.list = [] |
| | | var arr = data || [] |
| | | for (let i = 0; i < arr.length && i < 10; i++) { |
| | | this.list.push({ |
| | | id: arr[i].id, |
| | | name: arr[i].name, |
| | | url: arr[i].imageUrl |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | toList(item) { |
| | | // uni.navigateTo({ |
| | | // url:'/sub_pages/customer/trade/list?categoryId='+item.id |
| | | // }) |
| | | uni.navigateTo({ |
| | | url: '/sub_pages/customer/trade/trade?categoryId=' + item.id |
| | | }) |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | list: [], |
| | | today: '', |
| | | |
| | | }; |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .home-category { |
| | | .item { |
| | | text-align: center; |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #000000; |
| | | line-height: 40rpx; |
| | | min-width: 20%; |
| | | margin-bottom: 28rpx; |
| | | .home-category { |
| | | .item { |
| | | text-align: center; |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #000000; |
| | | line-height: 40rpx; |
| | | min-width: 20%; |
| | | margin-bottom: 28rpx; |
| | | |
| | | .icon { |
| | | width: 94rpx; |
| | | height: 94rpx; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | .icon { |
| | | width: 94rpx; |
| | | height: 94rpx; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | |
| | | .t1 { |
| | | font-size: 28rpx; |
| | | color: #333333; |
| | | line-height: 50rpx; |
| | | font-weight: 600; |
| | | } |
| | | .t1 { |
| | | font-size: 28rpx; |
| | | color: #333333; |
| | | line-height: 50rpx; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .t2 { |
| | | margin-left: auto; |
| | | padding: 8rpx; |
| | | font-size: 24rpx; |
| | | color: #5B8C71; |
| | | line-height: 34rpx; |
| | | background: #E1F0E7; |
| | | border-radius: 4rpx; |
| | | } |
| | | } |
| | | .t2 { |
| | | margin-left: auto; |
| | | padding: 8rpx; |
| | | font-size: 24rpx; |
| | | color: #5B8C71; |
| | | line-height: 34rpx; |
| | | background: #E1F0E7; |
| | | border-radius: 4rpx; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </view> |
| | | <view class="flex user-info" v-if="currentInfo&&(currentInfo.id)"> |
| | | <!-- 头像 --> |
| | | <image class="user-icon" v-if="!currentInfo.picture" src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png' |
| | | <image class="user-icon" v-if="!currentInfo.picture" |
| | | src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png' |
| | | mode="aspectFit"></image> |
| | | <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image> |
| | | |
| | |
| | | </view> |
| | | <view class="order-desc syst">售后理赔</view> |
| | | </view> |
| | | <!-- <view class="nav row margin-tb" @click="goto('/sub_pages/supplier/order-records/order-records',true)"> |
| | | <!-- <view class="nav row margin-tb" @click="printDeliveryOrder"> |
| | | <view class="img-c"> |
| | | <image class="icon margin-bottom order-icon kkjl" |
| | | src="/static/images/supplier/user/user-icon-kkjl.png" mode="scaleToFill" /> |
| | | </view> |
| | | <view class="order-desc wbsp">扣款记录</view> |
| | | <view class="order-desc wbsp">测试蓝牙</view> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | }, |
| | | scrollable: false, |
| | | cacheUserId:'', |
| | | tj:{} |
| | | cacheUserId: '', |
| | | tj: {} |
| | | |
| | | }; |
| | | }, |
| | |
| | | const url = options.q ? decodeURIComponent(options.q) : ''; |
| | | const urlcode = options.url && decodeURIComponent(options.url) || '' |
| | | }, |
| | | onShow(){ |
| | | onShow() { |
| | | this.getTj() |
| | | }, |
| | | created() { |
| | | //公告 |
| | | this.$http.request('get', '/api/announcement/page', { |
| | | this.$http.request('get', '/api/pub/announcement/list', { |
| | | params: { |
| | | size: 5, |
| | | status: 'A' |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | printDeliveryOrder(item) { |
| | | //蓝牙打印 |
| | | var that = this; |
| | | wx.getBluetoothAdapterState({ |
| | | success: (result) => { |
| | | console.log('b s', result) |
| | | console.log("蓝牙状态:\n" + result.errMsg) |
| | | if (result.adapterState.available) { |
| | | if (result.adapterState.discovering) { |
| | | that.blueSearchDeviceCheck() |
| | | } else { |
| | | that.blueSearchDevice() |
| | | } |
| | | } else { |
| | | //打开蓝牙 |
| | | wx.openBluetoothAdapter({ |
| | | success: function(res) { |
| | | console.log("蓝牙已打开") |
| | | that.blueSearchDevice() |
| | | |
| | | }, |
| | | fail: function(res) { |
| | | console.log('res', res) |
| | | that.$message.showToast('蓝牙未打开') |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log("蓝牙状态",res) |
| | | that.$message.showToast('获取蓝牙状态失败') |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | blueSearchDevice() { |
| | | var that = this; |
| | | |
| | | wx.startBluetoothDevicesDiscovery({ |
| | | success: (res) => { |
| | | //打印调试日志 |
| | | console.log("搜索设备返回" + JSON.stringify(res)) |
| | | that.blueSearchDeviceCheck() |
| | | |
| | | }, |
| | | fail: (res) => { |
| | | console.log('error search', res) |
| | | that.$message.showToast('打开蓝牙搜索设备失败') |
| | | |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | blueSearchDeviceCheck() { |
| | | let that = this |
| | | wx.getBluetoothDevices({ |
| | | success: (res) => { |
| | | var printDevice = undefined |
| | | for (var device of res.devices) { |
| | | if (device.name.indexOf('GP-M') >= 0) { |
| | | printDevice = device |
| | | // RSSI: -57 |
| | | // advertisServiceUUIDs: Array(2) |
| | | // 0: "000018f0-0000-1000-8000-00805f9b34fb" |
| | | // 1: "e7810a71-73ae-499d-8c15-faa9aef0c3f2" |
| | | // length: 2 |
| | | // nv_length: (...) |
| | | // __proto__: Array(0) |
| | | // deviceId: "89:E2:AF:33:46:2B" |
| | | // name: "GP-M322-5565_BLE" |
| | | break |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | if (!printDevice) { |
| | | that.$message.showToast('未找到可用打印机,请联系客服') |
| | | that.stopBluetoothDevicesDiscovery() |
| | | |
| | | } else { |
| | | wx.createBLEConnection({ |
| | | deviceId: printDevice.deviceId, |
| | | success: function(res) { |
| | | // https: //blog.csdn.net/weixin_51375107/article/details/116009436 |
| | | console.log('连接设备返回:' + res.errMsg); |
| | | that.$message.showToast('连接设备返回:' + res.errMsg) |
| | | // escpos怎么来 →点击查看智谱清言的回答https://chatglm.cn/share/FEXaC |
| | | |
| | | }, |
| | | fail: function(res) { |
| | | console.log('createBLEConnection fail',res) |
| | | that.$message.showToast('连接打印机失败') |
| | | }, |
| | | complete() { |
| | | that.stopBluetoothDevicesDiscovery() |
| | | |
| | | } |
| | | }) |
| | | } |
| | | // res.devices.forEach((device, i) => { |
| | | // console.log('device', |
| | | // device) |
| | | // // if (device.deviceId == that.data |
| | | // // .deviceId) { |
| | | // // console.log("物联网设备已找到") |
| | | // // that.$message.showToast( |
| | | // // '打印设备已找到') |
| | | // // return; |
| | | // // } |
| | | // }) |
| | | }, |
| | | fail: (res) => { |
| | | console.log('getBluetoothDevices', |
| | | res) |
| | | that.$message.showToast('获取蓝牙设备失败') |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | stopBluetoothDevicesDiscovery() { |
| | | var that = this; |
| | | wx.stopBluetoothDevicesDiscovery({ |
| | | success: (res) => { |
| | | console.log("停止扫描设备") |
| | | }, |
| | | }) |
| | | }, |
| | | getTj() { |
| | | // /api/supplier/delivery |
| | | |
| | | |
| | | if (this.currentInfo.id && this.currentInfo.id !== this.cacheUserId) { |
| | | this.cacheUserId = this.currentInfo.id |
| | | let that = this |
| | |
| | | } |
| | | }) |
| | | // #endif |
| | | |
| | | |
| | | }, 200) |
| | | } |
| | | |
| | | |
| | | }, |
| | | async toFlowManage() { |
| | | |
| | |
| | | uni.navigateBack() |
| | | } |
| | | }, |
| | | printDeliveryOrder(item) { |
| | | this.$message.showToast('敬请期待') |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="line"></view> |
| | | <view class="delivery-form"> |
| | | <view class="form-item"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="line"></view> |
| | | <view class="buttons"> |
| | | <view class="button button-1 m-r-0" @click="printDeliveryOrder(item)">打印</view> |
| | | </view> |
| | | |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | |
| | | border-radius: 4rpx; |
| | | border: 2rpx dashed #CECECE; |
| | | } |
| | | |
| | | .order-sale-list { |
| | | .order-sale-item { |
| | | background-color: #fff; |
| | |
| | | color: #CF0000; |
| | | } |
| | | } |
| | | .form{ |
| | | .form-item{ |
| | | |
| | | .form { |
| | | .form-item { |
| | | height: unset; |
| | | // min-height: ; |
| | | } |
| | | } |
| | | |
| | | .delivery-form { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | |
| | | |
| | | <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> |
| | |
| | | this.query.status = options.status || '' |
| | | } |
| | | this.listApi = '/api/supplier/delivery/list/today' |
| | | this.listApi = '/api/supplier/delivery/list' |
| | | |
| | | this.getList() |
| | | |
| | | }, |
| | |
| | | uni.navigateTo({ |
| | | url: `/pages/order/order-delivery-detail?id=${item.id}&status=${status}` |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="flex m-t-12"> |
| | | <radio :checked="submitForm.orderItems.indexOf(item.id)>=0" @click="changeSalesOrderItem(item)"></radio> |
| | | <radio v-if="showSales" :checked="submitForm.orderItems.indexOf(item.id)>=0" @click="changeSalesOrderItem(item)"></radio> |
| | | |
| | | <image class="flower-img img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | <image class="flower-img img100 br-4 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | | <view class=" flex"> |
| | |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="flex m-t-12 flex-wrap-normal"> |
| | | <image class="flower-img img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | <image class="flower-img img100 br-4 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | | <view class=" flex"> |
| | |
| | | </view> |
| | | </view> |
| | | <no-data v-if="!list||list.length===0" style="width: 100%;" class="m-t-12"></no-data> |
| | | <view v-for="(item,index) in list" :key="index" class="m-t-12"> |
| | | <view v-for="(dto,index) in list" :key="index" class="m-t-12"> |
| | | <view class="order-item list-item"> |
| | | <view class="title flex"> |
| | | <view> |
| | | 订单:{{ item.orderNo }} |
| | | 订单:{{ dto.orderNo }} |
| | | </view> |
| | | <view class="status t-red m-l-a m-r-0">¥{{ item.paymentAmount || item.totalAmount || '0'}}</view> |
| | | <view class="status t-red m-l-a m-r-0">¥{{ dto.paymentAmount || dto.totalAmount || '0'}}</view> |
| | | </view> |
| | | <view class="desc flex" v-if="!query.status"> |
| | | <view class="label"> |
| | | 订单状态: |
| | | </view> |
| | | <view class="value">{{ item.statusBackendStr }}</view> |
| | | <view class="value">{{ dto.statusBackendStr }}</view> |
| | | </view> |
| | | <view class="desc flex"> |
| | | <view class="label"> |
| | | 收货人: |
| | | </view> |
| | | <view class="value">{{ item.customer }}</view> |
| | | <view class="value">{{ dto.customer }}</view> |
| | | </view> |
| | | <view class="desc flex"> |
| | | <view class="label"> |
| | | 收货人手机号码: |
| | | </view> |
| | | <view class="value">{{ item.customerTel }}</view> |
| | | <view class="value">{{ dto.customerTel }}</view> |
| | | </view> |
| | | <view class="desc flex"> |
| | | <view class="label"> |
| | | 收货地址: |
| | | </view> |
| | | <view class="value">{{ item.customerAddress }}</view> |
| | | <view class="value">{{ dto.customerAddress }}</view> |
| | | </view> |
| | | <view class="desc flex" v-if="item.statusBackend!=='PENDING'"> |
| | | <view class="desc flex" v-if="dto.statusBackend!=='PENDING'"> |
| | | <view class="label"> |
| | | 支付时间: |
| | | </view> |
| | | <view class="value">{{ item.paymentTime }}</view> |
| | | <view class="value">{{ dto.paymentTime }}</view> |
| | | </view> |
| | | <view class="flower-info m-b-5 m-t-12 br-4" v-for="(item,index) of dto.items" :key="index"> |
| | | <view class="line-gray"></view> |
| | | |
| | | <view class="supplier-name "> |
| | | <image class="icon-dp br-4" src="/static/common/icon-dp.png"></image> |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="flex m-t-12 flex-wrap-normal"> |
| | | <image class="flower-img img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | | <view class=" flex"> |
| | | <view class="title"><span class="level">{{ item.flowerCategory }}</span><span |
| | | class="level">{{ item.flowerLevelStr }}</span>{{ item.flowerName }} |
| | | </view> |
| | | </view> |
| | | <view class="each-list"> |
| | | <view class="each-item"> |
| | | <view class="label">颜色</view> |
| | | <view class="value">{{ item.flowerColor || '-' }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="label">规格</view> |
| | | <view class="value">{{ item.flowerUnit || '-' }}</view> |
| | | </view> |
| | | |
| | | <view class="each-item"> |
| | | <view class="label">数量</view> |
| | | <view class="value">{{ item.num || 0 }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="label">售价</view> |
| | | <view class="value">¥{{ item.price || 0 }}</view> |
| | | |
| | | </view> |
| | | <view class="each-item"> |
| | | <view class="label">商品总金额</view> |
| | | <view class="value">¥{{ item.total || 0 }}</view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="line-gray"></view> |
| | | |
| | | <view class="flex buttons"> |
| | | <view class="button button-0 m-l-a m-r-15" v-if="item.statusBackend==='PENDING'" |
| | | @click="buttonClick(item,'cancelOrder')">取消订单</view> |
| | | <view class="button button-1 m-l-15 m-r-15" v-if="item.statusBackend==='PENDING'" |
| | | @click="buttonClick(item,'payAgain')">重新支付</view> |
| | | <view class="button button-0 m-l-a m-r-15" v-if="dto.statusBackend==='PENDING'" |
| | | @click="buttonClick(dto,'cancelOrder')">取消订单</view> |
| | | <view class="button button-1 m-l-15 m-r-15" v-if="dto.statusBackend==='PENDING'" |
| | | @click="buttonClick(dto,'payAgain')">重新支付</view> |
| | | |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick('refund')" v-if="item.couldRefund"> |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick(dto,'refund')" v-if="dto.couldRefund"> |
| | | 申请退款 |
| | | </view> |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick('confirm')" |
| | | v-if="item.statusBackend ==='RECEIVE'"> 确认收货 |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick(dto,'confirm')" |
| | | v-if="dto.statusBackend ==='RECEIVE'"> 确认收货 |
| | | </view> |
| | | |
| | | <view class="button button-1 m-l-a m-r-15" @click="toDetailSale(item)" |
| | | v-if=" item.statusBackend === 'EVALUATE'||item.statusBackend=='COMPLETED'"> 申请售后 |
| | | <view class="button button-1 m-l-a m-r-15" @click="toDetailSale(dto)" |
| | | v-if="dto.statusBackend === 'EVALUATE'||item.statusBackend=='COMPLETED'"> 申请售后 |
| | | </view> |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick(item,'evaluate')" |
| | | v-if=" item.statusBackend === 'EVALUATE'"> 评价 |
| | | <view class="button button-0 m-l-a m-r-15" @click="buttonClick(dto,'evaluate')" |
| | | v-if="dto.statusBackend === 'EVALUATE'"> 评价 |
| | | </view> |
| | | |
| | | |
| | | |
| | | <view class="button button-1 m-l-15 m-r-0" @click="toDetail(item)">查看详情</view> |
| | | <view class="button button-1 m-l-a m-r-0" @click="toDetail(dto)">查看详情</view> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | background: #20613D; |
| | | text-align: center; |
| | | border-radius: 30rpx; |
| | | min-width: 80rpx; |
| | | |
| | | } |
| | | |
| | |
| | | border: 2rpx solid #20613D; |
| | | } |
| | | } |
| | | .flower-info { |
| | | padding: 0rpx; |
| | | |
| | | background: #FFFFFF; |
| | | border-radius: 8rpx; |
| | | |
| | | .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; |
| | | } |
| | | } |
| | | |
| | | .title { |
| | | font-weight: 600; |
| | | font-size: 28rpx; |
| | | color: #000000; |
| | | line-height: 40rpx; |
| | | |
| | | .level { |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #20613D; |
| | | line-height: 40rpx; |
| | | margin-right: 20rpx; |
| | | } |
| | | } |
| | | |
| | | .flower-img { |
| | | width: 128rpx; |
| | | height: 118rpx; |
| | | min-width: 128rpx; |
| | | min-height: 118rpx; |
| | | } |
| | | |
| | | .each-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-top: 6rpx; |
| | | |
| | | .each-item { |
| | | min-width: 40%; |
| | | max-width: 50%; |
| | | text-align: center; |
| | | margin-left: 0rpx; |
| | | margin-right: auto; |
| | | display: flex; |
| | | |
| | | .label { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | text-align: left; |
| | | padding-right: 10rpx; |
| | | } |
| | | |
| | | .label::after { |
| | | content: ": " |
| | | } |
| | | |
| | | .value { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | // import qqmapwx from '@/plugins/qqmap-wx-jssdk.min.js'; |
| | | // const lockey = 'VUHBZ-2AMLP-B7AD7-VUQZ7-D4TW5-MFFVN'; //使用在腾讯位置服务申请的key |
| | | // const chooseLocation = requirePlugin('chooseLocation'); |
| | | |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | export default { |
| | | async onPullDownRefresh() { |
| | | this.page.current = 0 |
| | |
| | | this.submitForm.province = '' |
| | | this.submitForm.city = '' |
| | | this.submitForm.region = '' |
| | | if (e.detail.value.length <= 3) { |
| | | if (e.detail.value.length == 2) { |
| | | if (!!e.detail.value[0]) |
| | | this.submitForm.province = e.detail.value[0].value |
| | | if (!!e.detail.value[0]) |
| | | this.submitForm.city = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.submitForm.region = e.detail.value[1].value |
| | | } else if (e.detail.value.length <= 3) { |
| | | if (!!e.detail.value[0]) |
| | | this.submitForm.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | |
| | | } |
| | | }, |
| | | async init_area() { |
| | | const res = await this.$http.request('get', '/api/pub/china/area/json') |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', |
| | | 'text')) || [] |
| | | if (this.regionDataPlus && this.regionDataPlus.length > 0) { |
| | | const res = await this.$http.request('get', '/api/pub/china/area/json') |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll( |
| | | 'name', |
| | | 'text')) || [] |
| | | } |
| | | |
| | | }, |
| | | chooseLocation() { |
| | | //前往接口挑选位置 |
| | |
| | | this.$message.hideLoading() |
| | | } else { |
| | | this.submitForm = { |
| | | name: this.currentInfo && this.currentInfo.nickName || '', |
| | | tel: this.currentInfo && this.currentInfo.tel || '', |
| | | // name: this.currentInfo && this.currentInfo.nickName || '', |
| | | // tel: this.currentInfo && this.currentInfo.tel || '', |
| | | name: '', |
| | | tel: '', |
| | | address: '', |
| | | isDefault: false, |
| | | province: '', |
| | |
| | | dispatch, |
| | | state |
| | | }, data) { |
| | | if(!state.currentInfo.id){ |
| | | if (!state.currentInfo.id) { |
| | | message.showToast('请先登录') |
| | | return |
| | | } |
| | |
| | | }) |
| | | if (res.content && res.confirm) { |
| | | var t = res.content |
| | | if (!isNaN(parseInt(t)) && t > 0) { |
| | | message.showLoading() |
| | | const resp = await http.request('post', '/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: data.id, |
| | | num: parseInt(t) |
| | | if (!isNaN(parseInt(t)) && t >= 0) { |
| | | if ((t) === 0) { |
| | | message.showLoading() |
| | | const resp = await http.request('get', '/api/customer/flower/cart/delete', { |
| | | params: { |
| | | id: data.id, |
| | | } |
| | | }) |
| | | message.hideLoading() |
| | | if (resp && resp.code === 0) { |
| | | message.showToast('操作成功') |
| | | dispatch('sign_add', 'shopping') |
| | | return { |
| | | code: 0, |
| | | data: 0 |
| | | } |
| | | } |
| | | }) |
| | | message.hideLoading() |
| | | |
| | | if (resp && resp.code === 0) { |
| | | message.showToast('添加购物车成功') |
| | | dispatch('sign_add', 'shopping') |
| | | return resp |
| | | } else { |
| | | if (parseInt(t) <= 0) { |
| | | |
| | | } else { |
| | | //提示没有库存 |
| | | if (!data.stock) { |
| | | message.showToast('没有库存了,更新失败') |
| | | |
| | | return { |
| | | code: 1, |
| | | data: parseInt(t) |
| | | } |
| | | } else { |
| | | if (data.stock == 0) { |
| | | message.showToast('库存为0,更新失败') |
| | | |
| | | return { |
| | | code: 1, |
| | | data: parseInt(t) |
| | | } |
| | | } else if (data.stock > 0 && data.stock < ( |
| | | parseInt(t))) { |
| | | message.showToast('超过库存,更新失败') |
| | | |
| | | return { |
| | | code: 1, |
| | | data: parseInt(t) |
| | | } |
| | | } |
| | | } |
| | | // console.log('data',) |
| | | } |
| | | message.showLoading() |
| | | |
| | | const resp = await http.request('post', '/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: data.id, |
| | | num: parseInt(t) |
| | | } |
| | | }) |
| | | message.hideLoading() |
| | | |
| | | if (resp && resp.code === 0) { |
| | | message.showToast('添加购物车成功') |
| | | dispatch('sign_add', 'shopping') |
| | | return { |
| | | code: 0, |
| | | data: parseInt(t) |
| | | } |
| | | } |
| | | } |
| | | return resp |
| | | |
| | | // return { |
| | | // code: 1, |
| | | // data: 0 |
| | | // } |
| | | } else { |
| | | console.log('res.content', res.content) |
| | | message.showToast('输入数目需要大于0') |
| | | } |
| | | } |
| | | |
| | | return { |
| | | code: 1, |
| | | data: {} |
| | | data: 0 |
| | | } |
| | | }, |
| | | countShopping: async function({ |
| | |
| | | <template> |
| | | <view class="container-page" style="padding: 0rpx;"> |
| | | <view v-if="source==='step'" class="" style="padding-top:40rpx"> |
| | | <u-steps current="0"> |
| | | <u-steps-item title="信息填写" class="u-steps-item" style="font-size: 28rpx;"> |
| | | </u-steps-item> |
| | | <u-steps-item title="提交申请" class="u-steps-item"></u-steps-item> |
| | | </u-steps> |
| | | </view> |
| | | <view class="p20"> |
| | | <view class="form-item before-line"> |
| | | <view class="label required">店铺名称</view> |
| | | <view class="m-l-a m-r-0 flex"> |
| | | <input v-model="dto.name" placeholder="请输入联系人姓名" |
| | | style="margin-top: 16px;text-align: right;"></input> |
| | | <view class="container-page" style="padding: 0rpx;"> |
| | | <view v-if="source==='step'" class="" style="padding-top:40rpx"> |
| | | <u-steps current="0"> |
| | | <u-steps-item title="信息填写" class="u-steps-item" style="font-size: 28rpx;"> |
| | | </u-steps-item> |
| | | <u-steps-item title="提交申请" class="u-steps-item"></u-steps-item> |
| | | </u-steps> |
| | | </view> |
| | | <view class="p20"> |
| | | <view class="form-item before-line"> |
| | | <view class="label required">店铺名称</view> |
| | | <view class="m-l-a m-r-0 flex"> |
| | | <input v-model="dto.name" placeholder="请输入联系人姓名" |
| | | style="margin-top: 16px;text-align: right;"></input> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="form-item before-line"> |
| | | <view class="label ">地区</view> |
| | | <view class="form-item before-line"> |
| | | <view class="label ">地区</view> |
| | | |
| | | <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> |
| | | <uni-data-picker :area="true" @change="(e)=>{PickArea(dto,e)}" placeholder="" |
| | | :localdata="regionDataPlus"> |
| | | {{ dto['province'] || '请选择' }}{{ dto['city'] && ('/' + dto['city']) || '' }}{{ |
| | | <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> |
| | | <uni-data-picker :area="true" @change="(e)=>{PickArea(dto,e)}" placeholder="" |
| | | :localdata="regionDataPlus"> |
| | | {{ dto['province'] || '请选择' }}{{ dto['city'] && ('/' + dto['city']) || '' }}{{ |
| | | dto['region'] && ('/' + dto['region']) || '' |
| | | }} |
| | | </uni-data-picker> |
| | | <u-icon class="m-l-a" name="arrow-right"></u-icon> |
| | | </view> |
| | | </uni-data-picker> |
| | | <u-icon class="m-l-a" name="arrow-right"></u-icon> |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="form-item before-line"> |
| | | <view class="label ">地址</view> |
| | | <view class="m-l-a m-r-0 flex"> |
| | | <input v-model="dto.address" placeholder="请输入地址" |
| | | style="margin-top: 16px;text-align: right;"></input> |
| | | </view> |
| | | <view class="form-item before-line"> |
| | | <view class="label ">地址</view> |
| | | <view class="m-l-a m-r-0 flex"> |
| | | <input v-model="dto.address" placeholder="请输入地址" |
| | | style="margin-top: 16px;text-align: right;"></input> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="form-item before-line"> |
| | | <view class="label ">店铺简介</view> |
| | | <view class="m-l-a m-r-0 flex1"> |
| | | <view class="m-t-12 m-b-12"> |
| | | <u-textarea v-model="dto.description" placeholder="请输入店铺简介"> |
| | | </view> |
| | | </view> |
| | | <view class="form-item before-line"> |
| | | <view class="label ">店铺简介</view> |
| | | <view class="m-l-a m-r-0 flex1"> |
| | | <view class="m-t-12 m-b-12"> |
| | | <u-textarea v-model="dto.description" placeholder="请输入店铺简介"> |
| | | |
| | | </u-textarea> |
| | | </view> |
| | | <!-- <input v-model="dto.description" placeholder="请输入地址"--> |
| | | <!-- style="margin-top: 16px;text-align: right;"></input>--> |
| | | </u-textarea> |
| | | </view> |
| | | <!-- <input v-model="dto.description" placeholder="请输入地址"--> |
| | | <!-- style="margin-top: 16px;text-align: right;"></input>--> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="form-item before-line m-t-20" @click="uploadIcon"> |
| | | <view class="label ">上传店铺封面</view> |
| | | <view class="m-l-a m-r-0 flex m-b-12"> |
| | | <view class="component-button-upload"> |
| | | <view class="form-item before-line m-t-20" @click="uploadIcon"> |
| | | <view class="label ">上传店铺封面</view> |
| | | <view class="m-l-a m-r-0 flex m-b-12"> |
| | | <view class="component-button-upload"> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx" |
| | | v-if="dto.cover"> |
| | | <view class="m-t-12 m-r-10"> |
| | | <image class="banner-img" :src="dto.cover" @click.stop="previewImg(dto.cover)"> |
| | | <view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx" v-if="dto.cover"> |
| | | <view class="m-t-12 m-r-10"> |
| | | <image class="banner-img" :src="dto.cover" @click.stop="previewImg(dto.cover)"> |
| | | |
| | | </image> |
| | | <view class="t-red text-center" @click.stop="dto.cover=''">删除</view> |
| | | </view> |
| | | </view> |
| | | </image> |
| | | <view class="t-red text-center" @click.stop="dto.cover=''">删除</view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit"> |
| | | {{ source === 'step' ? '下一步' : '更新' }} |
| | | <view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit"> |
| | | {{ source === 'step' ? '下一步' : '更新' }} |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <view style="min-height: 200rpx;"> |
| | | |
| | | </view> |
| | | <view style="min-height: 200rpx;"> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import environments from '@/environments' |
| | | import environments from '@/environments' |
| | | |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | |
| | | export default { |
| | | export default { |
| | | |
| | | data() { |
| | | return { |
| | | id: '', |
| | | source: '', |
| | | data() { |
| | | return { |
| | | id: '', |
| | | source: '', |
| | | |
| | | refresh: false, |
| | | api: '', |
| | | dto: { |
| | | cover: '', |
| | | address: '', |
| | | id: '', |
| | | userId: '', |
| | | name: '', |
| | | description: '', |
| | | province: '', |
| | | city: '', |
| | | region: '', |
| | | }, |
| | | requireFields: [ |
| | | refresh: false, |
| | | api: '', |
| | | dto: { |
| | | cover: '', |
| | | address: '', |
| | | id: '', |
| | | userId: '', |
| | | name: '', |
| | | description: '', |
| | | province: '', |
| | | city: '', |
| | | region: '', |
| | | }, |
| | | requireFields: [ |
| | | |
| | | { |
| | | name: '店铺名称', |
| | | key: 'name' |
| | | } |
| | | ], |
| | | regionDataPlus: [], |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | //判断是不是来自登录步骤,是等话需要从缓存里面拿信息 |
| | | this.source = options.source || '' |
| | | { |
| | | name: '店铺名称', |
| | | key: 'name' |
| | | } |
| | | ], |
| | | regionDataPlus: [], |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | //判断是不是来自登录步骤,是等话需要从缓存里面拿信息 |
| | | this.source = options.source || '' |
| | | |
| | | if (this.source === 'step') { |
| | | var tjson = this.$storage.getItem('cache_customer_info') |
| | | if (tjson) { |
| | | this.dto = { |
| | | ...this.dto, |
| | | ...JSON.parse(tjson) |
| | | } |
| | | } |
| | | } else { |
| | | this.getCurrentInfo() |
| | | } |
| | | if (this.source === 'step') { |
| | | var tjson = this.$storage.getItem('cache_customer_info') |
| | | if (tjson) { |
| | | this.dto = { |
| | | ...this.dto, |
| | | ...JSON.parse(tjson) |
| | | } |
| | | } |
| | | } else { |
| | | this.getCurrentInfo() |
| | | } |
| | | |
| | | this.init_area() |
| | | // www.hmyxianhua.com/wx-jump |
| | | this.init_area() |
| | | // www.hmyxianhua.com/wx-jump |
| | | |
| | | }, |
| | | }, |
| | | |
| | | methods: { |
| | | PickArea(item, e) { |
| | | console.log('PickArea', item, e) |
| | | if (e.detail.value) { |
| | | this.dto.province = '' |
| | | this.dto.city = '' |
| | | this.dto.region = '' |
| | | if (e.detail.value.length <= 3) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.city = e.detail.value[1].value |
| | | if (!!e.detail.value[2]) |
| | | this.dto.region = e.detail.value[2].value |
| | | } else { |
| | | //说明有重复的 |
| | | var plusnum = e.detail.value.length - 3 |
| | | if (!!e.detail.value[plusnum + 0]) |
| | | this.dto.province = e.detail.value[plusnum + 0].value |
| | | if (!!e.detail.value[plusnum + 1]) |
| | | this.dto.city = e.detail.value[plusnum + 1].value |
| | | if (!!e.detail.value[plusnum + 2]) |
| | | this.dto.region = e.detail.value[plusnum + 2].value |
| | | } |
| | | methods: { |
| | | PickArea(item, e) { |
| | | console.log('PickArea', item, e) |
| | | if (e.detail.value) { |
| | | this.dto.province = '' |
| | | this.dto.city = '' |
| | | this.dto.region = '' |
| | | if (e.detail.value.length == 2) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[0]) |
| | | this.dto.city = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.region = e.detail.value[1].value |
| | | } else if (e.detail.value.length <= 3) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.city = e.detail.value[1].value |
| | | if (!!e.detail.value[2]) |
| | | this.dto.region = e.detail.value[2].value |
| | | } else { |
| | | //说明有重复的 |
| | | var plusnum = e.detail.value.length - 3 |
| | | if (!!e.detail.value[plusnum + 0]) |
| | | this.dto.province = e.detail.value[plusnum + 0].value |
| | | if (!!e.detail.value[plusnum + 1]) |
| | | this.dto.city = e.detail.value[plusnum + 1].value |
| | | if (!!e.detail.value[plusnum + 2]) |
| | | this.dto.region = e.detail.value[plusnum + 2].value |
| | | } |
| | | |
| | | this.$forceUpdate() |
| | | this.$forceUpdate() |
| | | |
| | | } |
| | | }, |
| | | async init_area() { |
| | | const res = await this.$http.request('get', '/api/pub/china/area/json') |
| | | // console.log('area', JSON.parse(res.data)) |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', |
| | | 'text')) || [] |
| | | }, |
| | | } |
| | | }, |
| | | async init_area() { |
| | | const res = await this.$http.request('get', '/api/pub/china/area/json') |
| | | // console.log('area', JSON.parse(res.data)) |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', |
| | | 'text')) || [] |
| | | }, |
| | | |
| | | |
| | | async getCurrentInfo() { |
| | | this.$message.showLoading() |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('get', "/api/current/customer", {}) |
| | | if (code === 0) { |
| | | this.dto = { |
| | | ...data, |
| | | async getCurrentInfo() { |
| | | this.$message.showLoading() |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('get', "/api/current/customer", {}) |
| | | if (code === 0) { |
| | | this.dto = { |
| | | ...data, |
| | | |
| | | } |
| | | this.dto.userId = this.currentInfo.id |
| | | } |
| | | this.dto.userId = this.currentInfo.id |
| | | |
| | | } |
| | | } |
| | | |
| | | this.$message.hideLoading() |
| | | }, |
| | | async submit() { |
| | | for (var field of this.requireFields) { |
| | | if (!this.dto[field.key]) { |
| | | this.$message.showToast(`${field.name}信息未填写`) |
| | | return |
| | | } |
| | | } |
| | | await this.$message.confirm(`是否确定提交更新信息`) |
| | | if (this.source === 'step') { |
| | | //先保存下来,进入下一步,然后注册成功后再保存 |
| | | this.$storage.setItem("cache_customer_info", JSON.stringify({ |
| | | ...this.dto |
| | | })) |
| | | this.$message.hideLoading() |
| | | }, |
| | | async submit() { |
| | | for (var field of this.requireFields) { |
| | | if (!this.dto[field.key]) { |
| | | this.$message.showToast(`${field.name}信息未填写`) |
| | | return |
| | | } |
| | | } |
| | | await this.$message.confirm(`是否确定提交更新信息`) |
| | | if (this.source === 'step') { |
| | | //先保存下来,进入下一步,然后注册成功后再保存 |
| | | this.$storage.setItem("cache_customer_info", JSON.stringify({ |
| | | ...this.dto |
| | | })) |
| | | |
| | | uni.navigateTo({ |
| | | url: '/pages/login/supplier-reg?source=step' |
| | | }) |
| | | uni.navigateTo({ |
| | | url: '/pages/login/supplier-reg?source=step' |
| | | }) |
| | | |
| | | } else { |
| | | var dto = { |
| | | ...this.dto, |
| | | } |
| | | this.$message.showLoading() |
| | | const re = await this.$http.request('post', '/api/customer/addOrUpdate', { |
| | | data: dto |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (re.code == 2000 || re.code == 0) { |
| | | this.$message.showToast('操作成功') |
| | | this.$store.dispatch('getCurrentInfo') |
| | | this.backpage() |
| | | } else { |
| | | console.log('error re', re) |
| | | if (re.code === 30000 && Array.isArray(re.msg)) { |
| | | this.$message.showToast('字段未填写完整') |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | var dto = { |
| | | ...this.dto, |
| | | } |
| | | this.$message.showLoading() |
| | | const re = await this.$http.request('post', '/api/customer/addOrUpdate', { |
| | | data: dto |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (re.code == 2000 || re.code == 0) { |
| | | this.$message.showToast('操作成功') |
| | | this.$store.dispatch('getCurrentInfo') |
| | | this.backpage() |
| | | } else { |
| | | console.log('error re', re) |
| | | if (re.code === 30000 && Array.isArray(re.msg)) { |
| | | this.$message.showToast('字段未填写完整') |
| | | } |
| | | } |
| | | } |
| | | |
| | | }, |
| | | }, |
| | | |
| | | |
| | | uploadIcon() { |
| | | const that = this |
| | | uni.chooseImage({ |
| | | count: 1, // 最多可以选择的图片张数,默认9 |
| | | sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有 |
| | | sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 |
| | | success: function ({ |
| | | errMsg, |
| | | tempFiles |
| | | }) { |
| | | if (errMsg === 'chooseImage:ok') { |
| | | if (tempFiles[0].size > 1024 * 1024 * 5) { |
| | | that.$message.confirm('图片最多支持5M大小,超出大小限制') |
| | | return |
| | | } |
| | | that.$message.showLoading() |
| | | that.$http.upload(tempFiles[0].path).then(async res => { |
| | | var pic = res.data && res.data.length > 0 && res.data[ |
| | | 0] || {} |
| | | that.$message.hideLoading() |
| | | that.dto.cover = (pic || {}).url || '' |
| | | console.log('pic', that.dto) |
| | | uploadIcon() { |
| | | const that = this |
| | | uni.chooseImage({ |
| | | count: 1, // 最多可以选择的图片张数,默认9 |
| | | sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有 |
| | | sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 |
| | | success: function({ |
| | | errMsg, |
| | | tempFiles |
| | | }) { |
| | | if (errMsg === 'chooseImage:ok') { |
| | | if (tempFiles[0].size > 1024 * 1024 * 5) { |
| | | that.$message.confirm('图片最多支持5M大小,超出大小限制') |
| | | return |
| | | } |
| | | that.$message.showLoading() |
| | | that.$http.upload(tempFiles[0].path).then(async res => { |
| | | var pic = res.data && res.data.length > 0 && res.data[ |
| | | 0] || {} |
| | | that.$message.hideLoading() |
| | | that.dto.cover = (pic || {}).url || '' |
| | | console.log('pic', that.dto) |
| | | |
| | | that.$forceUpdate() |
| | | }).catch(res => { |
| | | that.$message.hideLoading() |
| | | that.$forceUpdate() |
| | | }).catch(res => { |
| | | that.$message.hideLoading() |
| | | |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapState(['currentInfo']) |
| | | }, |
| | | components: {} |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState(['currentInfo']) |
| | | }, |
| | | components: {} |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .banner-img { |
| | | width: 96rpx; |
| | | height: 96rpx; |
| | | border-radius: 4rpx; |
| | | border: 2rpx dashed #CECECE; |
| | | } |
| | | .banner-img { |
| | | width: 96rpx; |
| | | height: 96rpx; |
| | | border-radius: 4rpx; |
| | | border: 2rpx dashed #CECECE; |
| | | } |
| | | |
| | | .form-item { |
| | | // padding: 40rpx; |
| | | border-bottom: 2rpx solid #F3F3F3; |
| | | display: flex; |
| | | // height: 100px; |
| | | .form-item { |
| | | // padding: 40rpx; |
| | | border-bottom: 2rpx solid #F3F3F3; |
| | | display: flex; |
| | | // height: 100px; |
| | | |
| | | .label { |
| | | width: 300rpx; |
| | | line-height: 60px; |
| | | .label { |
| | | width: 300rpx; |
| | | line-height: 60px; |
| | | |
| | | } |
| | | } |
| | | |
| | | .flex { |
| | | line-height: 60px; |
| | | .flex { |
| | | line-height: 60px; |
| | | |
| | | .flex1 { |
| | | flex: 1; |
| | | text-align: center; |
| | | color: var(--selfblue) |
| | | } |
| | | .flex1 { |
| | | flex: 1; |
| | | text-align: center; |
| | | color: var(--selfblue) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .form-item.bottom-border-no { |
| | | border-bottom: none; |
| | | } |
| | | .form-item.bottom-border-no { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .container-page { |
| | | padding: 40rpx; |
| | | background-color: #FFFFFF; |
| | | // min-height: calc(100vh - 80rpx); |
| | | min-height: 100vh; |
| | | } |
| | | .container-page { |
| | | padding: 40rpx; |
| | | background-color: #FFFFFF; |
| | | // min-height: calc(100vh - 80rpx); |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .style { |
| | | width: fit-content; |
| | | margin: 0 auto; |
| | | line-height: 64rpx; |
| | | border-radius: 8rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | // padding-top: 5rpx; |
| | | // padding-bottom: 5rpx; |
| | | border: 2rpx solid var(--selfblue); |
| | | background-color: var(--selfbluebg); |
| | | min-width: 100rpx; |
| | | } |
| | | .style { |
| | | width: fit-content; |
| | | margin: 0 auto; |
| | | line-height: 64rpx; |
| | | border-radius: 8rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | // padding-top: 5rpx; |
| | | // padding-bottom: 5rpx; |
| | | border: 2rpx solid var(--selfblue); |
| | | background-color: var(--selfbluebg); |
| | | min-width: 100rpx; |
| | | } |
| | | |
| | | |
| | | .style-1 { |
| | | border: 1px solid rgb(122, 187, 255); |
| | | border: 1px solid #409EFF; |
| | | color: #409EFF; |
| | | background-color: rgb(240, 247, 255); |
| | | } |
| | | .style-1 { |
| | | border: 1px solid rgb(122, 187, 255); |
| | | border: 1px solid #409EFF; |
| | | color: #409EFF; |
| | | background-color: rgb(240, 247, 255); |
| | | } |
| | | |
| | | .style-2 { |
| | | border: 1px solid rgb(255, 184, 78); |
| | | border: 1px solid #FE9044; |
| | | color: #FE9044; |
| | | background-color: rgb(255, 247, 235); |
| | | } |
| | | .style-2 { |
| | | border: 1px solid rgb(255, 184, 78); |
| | | border: 1px solid #FE9044; |
| | | color: #FE9044; |
| | | background-color: rgb(255, 247, 235); |
| | | } |
| | | |
| | | .style-3 { |
| | | border: 1px solid #19be6b; |
| | | color: #19be6b; |
| | | background-color: rgb(231, 244, 238); |
| | | } |
| | | .style-3 { |
| | | border: 1px solid #19be6b; |
| | | color: #19be6b; |
| | | background-color: rgb(231, 244, 238); |
| | | } |
| | | |
| | | .style-4 { |
| | | border: 1px solid #F56c6c; |
| | | color: #F56c6c; |
| | | background-color: rgb(254, 243, 243); |
| | | } |
| | | .style-4 { |
| | | border: 1px solid #F56c6c; |
| | | color: #F56c6c; |
| | | background-color: rgb(254, 243, 243); |
| | | } |
| | | </style> |
| | |
| | | async submitShopping(dto) { |
| | | //提交到购物车中 |
| | | // this.$message.showLoading() |
| | | await this.$store.dispatch('submitShopping', dto); |
| | | // this.$message.hideLoading() |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$store.dispatch('submitShopping', dto); |
| | | if (code == 0) { |
| | | dto.shopnum = data || 0 |
| | | this.$forceUpdate() |
| | | } |
| | | }, |
| | | select_level(e) { |
| | | this.level_show = false |
| | |
| | | this.query.column = e.value[0].value |
| | | this.refreshList() |
| | | |
| | | }, |
| | | async updateItemNum(item) { |
| | | const res = await this.$message.confirm('', { |
| | | editable: true, |
| | | title: '请输入想要购买的数量' |
| | | }) |
| | | if (res.content && res.confirm) { |
| | | // 发送请求 |
| | | 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.shopnum)) |
| | | |
| | | } |
| | | } else { |
| | | |
| | | } |
| | | }, |
| | | async addnum(item, addnum) { |
| | | if (!this.currentInfo.id) { |
| | | await this.$message.confirm('请前往登录') |
| | | uni.navigateTo({ |
| | | url: '/pages/user/supplier-user' |
| | | }) |
| | | return |
| | | } |
| | | if (!item.shopnum) { |
| | | item.shopnum = 0 |
| | | } |
| | | if (!item.stock) { |
| | | item.stock = 0 |
| | | } |
| | | if (item.shopnum + addnum > item.stock) { |
| | | this.$message.showToast('库存不足,无法修改') |
| | | return |
| | | } |
| | | if (item.shopnum + addnum >= 0) { |
| | | |
| | | } else { |
| | | return |
| | | } |
| | | this.$message.showLoading() |
| | | const { |
| | | code |
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: item.id, |
| | | num: addnum |
| | | } |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | item.shopnum += addnum |
| | | this.$forceUpdate() |
| | | } |
| | | }, |
| | | } |
| | | } |
| | |
| | | @cancel="order_show=false"></u-picker> |
| | | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container flex" v-for="(dto,index) of list" :key="index" |
| | | @click.stop="toDetail(dto)"> |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover"></image> |
| | | <view class="trade-info-container flex" 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> |
| | | <view class="flex1"> |
| | | <view class="flex"> |
| | | <view class="flex" @click.stop="toDetail(dto)"> |
| | | <view class="title"> |
| | | <span class="m-r-5" style="display: inline-block;" |
| | | v-if="dto.categoryStr">{{dto.categoryStr||''}}</span> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="desc m-t-12 flex"> |
| | | <view class="desc p-t-12 flex" @click.stop="toDetail(dto)"> |
| | | <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view> |
| | | <view class="m-r-15">颜色:{{ dto.color || '-' }}</view> |
| | | </view> |
| | | <view class="button-icons flex m-l-a m-r-0 m-t-20" v-if="dto.status=='UP'"> |
| | | <view class="m-r-0 gwc" @click.stop="submitShopping(dto)"> |
| | | <view class="m-r-0 gwc" @click.stop="submitShopping(dto)" v-if="!dto.shopnum"> |
| | | + 购物车 |
| | | </view> |
| | | <view class="m-r-0 flex" v-if="dto.shopnum"> |
| | | <uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32" |
| | | @click.stop="addnum(dto,-1)"></uni-icons> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" |
| | | v-if="dto.shopnum&&dto.shopnum>=1"> |
| | | {{ dto.shopnum }} |
| | | </view> |
| | | <uni-icons v-if="!dto.shopnum||dto.shopnum<=99" type="plus-filled" size="32" |
| | | @click.stop="addnum(dto,1)"></uni-icons> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | line-height: 40rpx; |
| | | |
| | | .curnums { |
| | | margin-left: 10rpx; |
| | | margin-right: 10rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | } |
| | | } |
| | | |
| | |
| | | async submitShopping(dto) { |
| | | //提交到购物车中 |
| | | // this.$message.showLoading() |
| | | await this.$store.dispatch('submitShopping', dto); |
| | | const res = await this.$store.dispatch('submitShopping', dto); |
| | | console.log('res',res) |
| | | if (res&&res.code == 0){ |
| | | dto.shopnum = res.data || 0 |
| | | this.$forceUpdate() |
| | | } |
| | | // this.$message.hideLoading() |
| | | }, |
| | | select_level(e) { |
| | |
| | | this.query.column = e.value[0].value |
| | | this.refreshList() |
| | | |
| | | }, |
| | | async updateItemNum(item) { |
| | | const res = await this.$message.confirm('', { |
| | | editable: true, |
| | | title: '请输入想要购买的数量' |
| | | }) |
| | | if (res.content && res.confirm) { |
| | | // 发送请求 |
| | | 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.shopnum)) |
| | | |
| | | } |
| | | } else { |
| | | |
| | | } |
| | | }, |
| | | async addnum(item, addnum) { |
| | | if (!this.currentInfo.id) { |
| | | await this.$message.confirm('请前往登录') |
| | | uni.navigateTo({ |
| | | url: '/pages/user/supplier-user' |
| | | }) |
| | | return |
| | | } |
| | | if (!item.shopnum) { |
| | | item.shopnum = 0 |
| | | } |
| | | if (!item.stock) { |
| | | item.stock = 0 |
| | | } |
| | | if (item.shopnum + addnum > item.stock) { |
| | | this.$message.showToast('库存不足,无法修改') |
| | | return |
| | | } |
| | | if (item.shopnum + addnum >= 0) { |
| | | |
| | | } else { |
| | | return |
| | | } |
| | | this.$message.showLoading() |
| | | const { |
| | | code |
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: item.id, |
| | | num: addnum |
| | | } |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | item.shopnum += addnum |
| | | this.$forceUpdate() |
| | | } |
| | | }, |
| | | } |
| | | } |
| | |
| | | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container flex" v-for="(dto,index) of list" :key="index" |
| | | @click.stop="toDetail(dto)"> |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover"></image> |
| | | <view class="flex1"> |
| | | <view class="flex"> |
| | | > |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <view class="flex1" > |
| | | <view class="flex" @click.stop="toDetail(dto)"> |
| | | <view class="title"> |
| | | <span class="m-r-5" style="display: inline-block;" |
| | | v-if="dto.categoryStr">{{dto.categoryStr||''}}</span> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="desc m-t-12 flex"> |
| | | <view class="desc p-t-12 flex" @click.stop="toDetail(dto)"> |
| | | <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view> |
| | | <view class="m-r-15">颜色:{{ dto.color || '-' }}</view> |
| | | </view> |
| | | <view class="button-icons flex m-l-a m-r-0 m-t-20" v-if="dto.status=='UP'"> |
| | | <view class="m-r-0 gwc" @click.stop="submitShopping(dto)"> |
| | | <view class="m-r-0 gwc" @click.stop="submitShopping(dto)" v-if="!dto.shopnum"> |
| | | + 购物车 |
| | | </view> |
| | | <view class="m-r-0 flex" v-if="dto.shopnum"> |
| | | <uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32" |
| | | @click.stop="addnum(dto,-1)"></uni-icons> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.shopnum&&dto.shopnum>=1"> |
| | | {{ dto.shopnum }} |
| | | </view> |
| | | <uni-icons v-if="!dto.shopnum||dto.shopnum<=999" type="plus-filled" size="32" |
| | | @click.stop="addnum(dto,1)"></uni-icons> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <style lang="scss" scoped> |
| | | .page-collect { |
| | | min-height: 99vh; |
| | | |
| | | |
| | | .search-container { |
| | | display: flex; |
| | | margin: 12rpx 0rpx 20rpx 0rpx; |
| | |
| | | line-height: 70rpx !important; |
| | | } |
| | | } |
| | | |
| | | .trade-list-container { |
| | | min-height: calc(100vh - 300rpx); |
| | | overflow-y: scroll; |
| | | border-top-right-radius: 40rpx; |
| | | border-top-left-radius: 40rpx; |
| | | padding: 20rpx; |
| | | |
| | | |
| | | } |
| | | |
| | | .trade-info-container { |
| | | background-color: #fff; |
| | | border-radius: 20rpx; |
| | | margin-bottom: 20rpx; |
| | | padding: 20rpx; |
| | | overflow: hidden; |
| | | |
| | | |
| | | overflow-y: scroll; |
| | | |
| | | .img { |
| | |
| | | line-height: 40rpx; |
| | | |
| | | .curnums { |
| | | margin-left: 10rpx; |
| | | margin-right: 10rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | } |
| | | } |
| | | |
| | |
| | | <view class="component-shop-item flex" v-for="(item,index) of list" :key="index"
|
| | | @click.stop="toDetail(item)">
|
| | | <view class="img">
|
| | | <image class="img img100"
|
| | | :src="item.cover" lazy-load>
|
| | | <image class="img img100" :src="item.cover" lazy-load>
|
| | | </image>
|
| | | <view class="level">
|
| | | {{item.levelStr||''}}
|
| | |
| | | <view class="icons flex">
|
| | | <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32"
|
| | | @click.stop="addnum(item,-1)"></uni-icons>
|
| | | <view class="curnums" v-if="item.shopnum&&item.shopnum>=1">{{ item.shopnum }}</view>
|
| | | <view class="curnums" @click="updateItemNum(item)" v-if="item.shopnum&&item.shopnum>=1">
|
| | | {{ item.shopnum }}
|
| | | </view>
|
| | | <uni-icons v-if="!item.shopnum||item.shopnum<=99" type="plus-filled" size="32"
|
| | | @click.stop="addnum(item,1)"></uni-icons>
|
| | | </view>
|
| | |
| | | <trade :hidefooter="true" :catgoryTree="catgoryTree" v-if="catgoryTree" ref="trade"></trade>
|
| | | <!-- // 构建一个分类树 -->
|
| | | <!-- catgoryTree -->
|
| | | |
| | |
|
| | | </view>
|
| | | <view v-if="flg==='2'" class="brand-info-3">
|
| | | <view class="title">
|
| | |
| | | dto: {},
|
| | | list: [],
|
| | | id: '',
|
| | | catgoryTree:undefined,
|
| | | catgoryTree: undefined,
|
| | | }
|
| | | },
|
| | | onLoad(options) {
|
| | |
| | | if (this.id) {
|
| | | this.getDetail()
|
| | | }
|
| | | this.listApi = `/api/customer/flower/list`
|
| | | this.query.supplierId = this.id |
| | | this.listApi = `/api/customer/flower/list`
|
| | | this.query.supplierId = this.id
|
| | | this.getList('post')
|
| | | },
|
| | | onReachBottom(){
|
| | | if(this.flg==='0'){
|
| | | onReachBottom() {
|
| | | if (this.flg === '0') {
|
| | | this.getMore('post')
|
| | | }
|
| | | },
|
| | | methods: {
|
| | |
|
| | | async getDetail() {
|
| | | {
|
| | | this.$message.showLoading()
|
| | |
| | |
|
| | | },
|
| | | //update 关注
|
| | | async updateGz(type) { |
| | | if(!this.currentInfo.id){ |
| | | this.$message.showToast('请先登录') |
| | | return |
| | | async updateGz(type) {
|
| | | if (!this.currentInfo.id) {
|
| | | this.$message.showToast('请先登录')
|
| | | return
|
| | | }
|
| | | this.$message.showLoading()
|
| | | const {
|
| | |
| | | },
|
| | | async changeTab(flg) {
|
| | | console.log('changeTab', flg)
|
| | | if('1'===(''+flg)){
|
| | | if(!this.catgoryTree){
|
| | | if ('1' === ('' + flg)) {
|
| | | if (!this.catgoryTree) {
|
| | | this.$message.showLoading()
|
| | | const {
|
| | | code,data
|
| | | code,
|
| | | data
|
| | | } = await this.$http.request('get', `/api/customer/flower/category/tree`, {
|
| | | data: {
|
| | | supplierId: this.dto.supplierId || this.dto.id
|
| | |
| | | // data 分类树
|
| | | this.catgoryTree = data || []
|
| | | let tmp = this
|
| | | this.$nextTick(()=>{
|
| | | this.$nextTick(() => {
|
| | | tmp.$refs.trade.refInit(tmp.catgoryTree)
|
| | | })
|
| | | }
|
| | |
| | | }
|
| | | this.flg = '' + flg
|
| | | //如果没有加载数据,需要加载一下
|
| | | |
| | |
|
| | |
|
| | | },
|
| | | buttonSearchFlow() {
|
| | |
|
| | | },
|
| | | async updateItemNum(item) {
|
| | | const res = await this.$message.confirm('', {
|
| | | editable: true,
|
| | | title: '请输入想要购买的数量'
|
| | | })
|
| | | if (res.content && res.confirm) {
|
| | | // 发送请求
|
| | | 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.shopnum))
|
| | |
|
| | | }
|
| | | } else {
|
| | |
|
| | | }
|
| | | },
|
| | | async addnum(item, addnum) {
|
| | | if (!this.currentInfo.id) {
|
| | | await this.$message.confirm('请前往登录')
|
| | |
| | | }
|
| | | if (!item.shopnum) {
|
| | | item.shopnum = 0
|
| | | } |
| | | if (!item.stock) { |
| | | item.stock = 0 |
| | | } |
| | | if (item.shopnum + addnum > item.stock) { |
| | | this.$message.showToast('库存不足,无法添加') |
| | | return |
| | | }
|
| | | if (!item.stock) {
|
| | | item.stock = 0
|
| | | }
|
| | | if (item.shopnum + addnum > item.stock) {
|
| | | this.$message.showToast('库存不足,无法修改')
|
| | | return
|
| | | }
|
| | | if (item.shopnum + addnum >= 0) {
|
| | |
|
| | |
| | | this.$message.showLoading()
|
| | | const {
|
| | | code
|
| | | } = await http.request('post', '/api/customer/flower/cart/change-num', {
|
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', {
|
| | | data: {
|
| | | id: item.id,
|
| | | num: addnum
|
| | |
| | | })
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum |
| | | item.shopnum += addnum
|
| | | this.$forceUpdate()
|
| | | }
|
| | | },
|
| | |
| | | padding-left: 20rpx;
|
| | | }
|
| | | }
|
| | | .brand-info-1{
|
| | |
|
| | | .brand-info-1 {
|
| | | // padding: 40rpx 30rpx;
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | .brand-info-3 {
|
| | | padding: 40rpx 30rpx;
|
| | |
|
| | |
| | | } |
| | | |
| | | if (!this.address.id) { |
| | | this.$message.showToast('请选择收货地址') |
| | | this.$message.showToast('请选择收货地址',{ |
| | | duration: 2000 |
| | | }) |
| | | return |
| | | } |
| | | this.dto.addressId = this.address.id |
| | |
| | | await tmp.$store.dispatch('sign_add', 'shopping') |
| | | uni.navigateBack() |
| | | }, |
| | | fail(err) { |
| | | async fail(err) { |
| | | console.error('pay fail', err) |
| | | tmp.$message.showToast('支付失败') |
| | | await tmp.$store.dispatch('sign_add', 'shopping') |
| | | uni.navigateBack() |
| | | } |
| | | }) |
| | | |
| | |
| | | background-color: #ffffff; |
| | | left: 0rpx; |
| | | padding: 20rpx; |
| | | z-index: 99; |
| | | z-index: 11; |
| | | right: 0rpx; |
| | | bottom: 0rpx; |
| | | } |
| | |
| | | margin-right: auto; |
| | | max-width: 32%; |
| | | width: 130rpx; |
| | | min-width: 130rpx; |
| | | |
| | | .title { |
| | | font-weight: 400; |
| | |
| | | <view v-for="(dto,j) of item.flowerList" :key="j"> |
| | | <u-divider v-if="j>0"></u-divider> |
| | | <u-swipe-action> |
| | | <u-swipe-action-item :options="options1" @click="(e)=>{clickSwipeButton(dto)}"> |
| | | <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> |
| | |
| | | <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" 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> |
| | |
| | | mounted() { |
| | | this.init() |
| | | }, |
| | | async onPullDownRefresh(){ |
| | | await this.init() |
| | | uni.stopPullDownRefresh() |
| | | }, |
| | | computed: { |
| | | totalprice() { |
| | | |
| | |
| | | const { |
| | | code, |
| | | data |
| | | } = await http.request('post', '/api/customer/flower/order/confirm/info', { |
| | | } = await this.$http.request('post', '/api/customer/flower/order/confirm/info', { |
| | | data: { |
| | | flowers: arr, |
| | | } |
| | |
| | | }) |
| | | } |
| | | }, |
| | | async clickSwipeButton(item) { |
| | | async clickSwipeButton(item,check) { |
| | | //删除商品,重新加载数据? |
| | | if(check){ |
| | | this.$message.confirm('是否删除商品') |
| | | return |
| | | |
| | | } |
| | | |
| | | this.$message.showLoading() |
| | | const { |
| | | code |
| | | } = await http.request('get', '/api/customer/flower/cart/delete', { |
| | | } = await this.$http.request('get', '/api/customer/flower/cart/delete', { |
| | | params: { |
| | | id: item.id, |
| | | } |
| | |
| | | |
| | | } |
| | | }, |
| | | async updateItemNum(item) { |
| | | const res = await this.$message.confirm('', { |
| | | editable: true, |
| | | title: '请输入想要购买的数量' |
| | | }) |
| | | if (res.content && res.confirm) { |
| | | // 发送请求 |
| | | 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) |
| | | return |
| | | } |
| | | if (!dto.stock) { |
| | | dto.stock = 0 |
| | | } |
| | | if (dto.num + addnum > dto.stock) { |
| | | this.$message.showToast('库存不足,无法添加') |
| | | this.$message.showToast('库存不足,无法修改') |
| | | return |
| | | } |
| | | this.$message.showLoading() |
| | | const { |
| | | code |
| | | } = await http.request('post', '/api/customer/flower/cart/change-num', { |
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: dto.id, |
| | | num: addnum |
| | |
| | | dto.num += addnum |
| | | if (dto.num < 1) { |
| | | //id删除清空,并且 |
| | | await this.clickSwipeButton(dto) |
| | | 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 |
| | |
| | | padding: 20rpx; |
| | | right: 0rpx; |
| | | bottom: 160rpx; |
| | | z-index: 11; |
| | | } |
| | | |
| | | .shopping-item { |
| | |
| | | line-height: 40rpx; |
| | | |
| | | .curnums { |
| | | margin-left: 10rpx; |
| | | margin-right: 10rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | } |
| | | } |
| | | } |
| | |
| | | <image src="../../../static/common/icon-kf.png" class="icon-kf m-l-15 img100"></image>
|
| | |
|
| | | </view>
|
| | | <view class="m-r-0 gwc" @click="submitShopping(dto)">
|
| | | <view class="m-r-0 gwc" @click="submitShopping(dto)" v-if="!dto.shopnum">
|
| | | + 购物车
|
| | | </view>
|
| | | <view class="m-r-0 button-icons flex" v-if="dto.shopnum">
|
| | | <uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32"
|
| | | @click.stop="addnum(dto,-1)"></uni-icons>
|
| | | <view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.shopnum&&dto.shopnum>=1">
|
| | | {{ dto.shopnum }}
|
| | | </view>
|
| | | <uni-icons v-if="!dto.shopnum||dto.shopnum<=99" type="plus-filled" size="32"
|
| | | @click.stop="addnum(dto,1)"></uni-icons>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | | <view class="line">
|
| | |
| | | shopnum: 0,
|
| | | }
|
| | | },
|
| | | onShow() {
|
| | | this.refreshShopNum()
|
| | | },
|
| | | onLoad(options) {
|
| | | this.id = options.id || ''
|
| | | if (this.id) {
|
| | |
| | | this.refreshShopNum()
|
| | | },
|
| | | methods: {
|
| | | async updateItemNum(item) {
|
| | | const res = await this.$message.confirm('', {
|
| | | editable: true,
|
| | | title: '请输入想要购买的数量'
|
| | | })
|
| | | if (res.content && res.confirm) {
|
| | | // 发送请求
|
| | | 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.shopnum))
|
| | |
|
| | | }
|
| | | } else {
|
| | |
|
| | | }
|
| | | },
|
| | | async addnum(item, addnum) {
|
| | | if (!this.currentInfo.id) {
|
| | | await this.$message.confirm('请前往登录')
|
| | | uni.navigateTo({
|
| | | url: '/pages/user/supplier-user'
|
| | | })
|
| | | return
|
| | | }
|
| | | if (!item.shopnum) {
|
| | | item.shopnum = 0
|
| | | }
|
| | | if (!item.stock) {
|
| | | item.stock = 0
|
| | | }
|
| | | if (item.shopnum + addnum > item.stock) {
|
| | | this.$message.showToast('库存不足,无法修改')
|
| | | return
|
| | | }
|
| | | if (item.shopnum + addnum >= 0) {
|
| | |
|
| | | } else {
|
| | | return
|
| | | }
|
| | | this.$message.showLoading()
|
| | | const {
|
| | | code
|
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', {
|
| | | data: {
|
| | | id: item.id,
|
| | | num: addnum
|
| | | }
|
| | | })
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum |
| | | this.refreshShopNum()
|
| | | this.$forceUpdate()
|
| | | }
|
| | | },
|
| | |
|
| | | async refreshShopNum() {
|
| | | this.shopnum = await this.$store.dispatch('countShopping');
|
| | | },
|
| | |
| | | //提交到购物车中
|
| | | // this.$message.showLoading()
|
| | | const {
|
| | | code
|
| | | code,
|
| | | data
|
| | | } = await this.$store.dispatch('submitShopping', dto);
|
| | | // this.$message.hideLoading()
|
| | | if (code == 0) {
|
| | | dto.shopnum = data || 0
|
| | | this.refreshShopNum()
|
| | | this.$forceUpdate()
|
| | |
|
| | | }
|
| | | },
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | .button-icons {
|
| | | line-height: 40rpx;
|
| | |
|
| | | .curnums {
|
| | | padding-left: 20rpx;
|
| | | padding-right: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .desc {
|
| | | font-weight: 400;
|
| | | font-size: 28rpx;
|
| | |
| | | this.page.current = 1
|
| | | await this.getList('post')
|
| | | uni.stopPullDownRefresh()
|
| | | }, |
| | | onShow(){ |
| | | this.refreshShopNum() |
| | | },
|
| | | methods: { |
| | | async refreshShopNum() { |
| | |
| | | item.shopnum = 0 |
| | | }
|
| | | if (item.shopnum + addnum > item.stock) {
|
| | | this.$message.showToast('库存不足,无法添加')
|
| | | this.$message.showToast('库存不足,无法修改')
|
| | | return
|
| | | }
|
| | |
|
| | |
| | | this.$message.showLoading()
|
| | | const {
|
| | | code
|
| | | } = await http.request('post', '/api/customer/flower/cart/change-num', {
|
| | | } = await this.$http.request('post', '/api/customer/flower/cart/change-num', {
|
| | | data: {
|
| | | id: item.id,
|
| | | num: addnum
|
| | |
| | | uni.stopPullDownRefresh()
|
| | | })
|
| | | },
|
| | | async onLoad() {
|
| | |
|
| | | async onLoad(options) {
|
| | | let selectId = options.categoryId || ''
|
| | | //加载分类
|
| | | this.$message.showLoading()
|
| | | this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => {
|
| | |
| | | var data = res.data
|
| | | this.list = data || []
|
| | | if (this.list.length > 0) {
|
| | | this.query.categoryId = this.list[0].id || ''
|
| | | this.currentCategory = this.list[0] || {}
|
| | | if (selectId) {
|
| | | for (var item of this.list) {
|
| | | if (item.id == selectId) {
|
| | | this.query.categoryId = item.id || ''
|
| | | this.currentCategory = item
|
| | | break
|
| | | }
|
| | | }
|
| | | } else {
|
| | | this.query.categoryId = this.list[0].id || ''
|
| | | this.currentCategory = this.list[0] || {}
|
| | | }
|
| | |
|
| | | }
|
| | | })
|
| | | },
|
| | |
| | | font-weight: 500;
|
| | | font-size: 28rpx;
|
| | | color: #000000;
|
| | | line-height: 40rpx; |
| | | min-height: 80rpx; |
| | | text-align:center;
|
| | | line-height: 40rpx;
|
| | | min-height: 80rpx;
|
| | | text-align: center;
|
| | | }
|
| | |
|
| | | .desc {
|
| | |
| | | <u-steps current="0"> |
| | | <u-steps-item title="信息填写" class="u-steps-item" style="font-size: 28rpx;"> |
| | | </u-steps-item> |
| | | <u-steps-item title="提交申请" class="u-steps-item"></u-steps-item> |
| | | <u-steps-item title="提交申请" class="u-steps-item"></u-steps-item> |
| | | </u-steps> |
| | | </view> |
| | | <view class="p20"> |
| | |
| | | <view class="m-l-a m-r-0 flex"> |
| | | <input v-model="dto.cityWarehouse" placeholder="请输入城市仓名称" |
| | | style="margin-top: 16px;text-align: right;"></input> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | |
| | | |
| | | <view class="form-item before-line"> |
| | | <view class="label required">地区</view> |
| | | |
| | |
| | | this.dto.province = '' |
| | | this.dto.city = '' |
| | | this.dto.region = '' |
| | | if (e.detail.value.length <= 3) { |
| | | if (e.detail.value.length == 2) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[0]) |
| | | this.dto.city = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.region = e.detail.value[1].value |
| | | } |
| | | else if(e.detail.value.length <= 3) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | |
| | | <view v-for="(item,i) in dto.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>
|
| | |
| | |
|
| | | methods: {
|
| | | updateValue(item, value) {
|
| | | item.value = value
|
| | | this.$set(item, 'value', value)
|
| | | if (item.value.indexOf(value) >= 0) {
|
| | | item.value.splice(item.value.indexOf(value), 1)
|
| | | } else {
|
| | | item.value.push(value)
|
| | | }
|
| | | // item.value = value
|
| | | // this.$set(item, 'value', value)
|
| | | this.$forceUpdate()
|
| | | console.log('updateValue')
|
| | | // console.log('updateValue')
|
| | | },
|
| | | async updateSearch(search) {
|
| | | this.columns_categorys_search = search || ''
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | mapCategoryTree(node, arr,parentCheckTrue=false) {
|
| | | mapCategoryTree(node, arr, parentCheckTrue = false) {
|
| | | var has = true
|
| | | if (arr) {
|
| | | var hasTrue = false
|
| | |
| | | has = true
|
| | | if (this.columns_categorys_search) {
|
| | | has = false
|
| | | } |
| | | if(parentCheckTrue){ |
| | | has = true |
| | | }
|
| | | if (parentCheckTrue) {
|
| | | has = true
|
| | | }
|
| | | var tmp = {
|
| | | ...item,
|
| | |
| | | this.columns_categorys_dict['@' + item.id] = item
|
| | | if (item.children && item.children.length > 0) {
|
| | | //如果上级已经有了,下级都包含
|
| | | tmp.children = [] |
| | | var childrenhas = this.mapCategoryTree(tmp.children, item.children,has) |
| | | if (childrenhas) { |
| | | has = true |
| | | hasTrue = true |
| | | tmp.children = []
|
| | | var childrenhas = this.mapCategoryTree(tmp.children, item.children, has)
|
| | | if (childrenhas) {
|
| | | has = true
|
| | | hasTrue = true
|
| | | }
|
| | |
|
| | | } else {
|
| | |
| | | if (res.code == 0) {
|
| | | // this.columns_params = res.data || []
|
| | | this.dto.params = res.data || []
|
| | | for (var k of this.dto.params) {
|
| | | if (!k.value) {
|
| | | k.value = []
|
| | | } else {
|
| | | k.value = k.value.split(',') || []
|
| | | }
|
| | | } |
| | | // console.log('init params',this.dto.params)
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | // // console.log('this.dto', this.dto)
|
| | | if (!this.dto.bannerList) {
|
| | | this.dto.bannerList = []
|
| | | }
|
| | | } |
| | | if(this.dto.params){ |
| | | for (var k of this.dto.params) { |
| | | if (!k.value) { |
| | | k.value = [] |
| | | } else { |
| | | k.value = k.value.split(',') || [] |
| | | } |
| | | } |
| | | } |
| | | |
| | | // if (this.dto.category) {
|
| | | // await this.refresh_category()
|
| | | // }
|
| | |
| | | this.$message.showToast('商品价格不能小于等于0')
|
| | | return
|
| | | }
|
| | | tmp = parseFloat(this.dto.stock)
|
| | | if (isNaN(tmp) || ('' + tmp.toFixed(0)) !== ('' + this.dto.stock) || tmp < 0) {
|
| | | this.$message.showToast('商品库存格式错误,需要大于等于0')
|
| | | tmp = parseInt(this.dto.stock)
|
| | | if (isNaN(tmp) || ('' + tmp.toFixed(0)) !== ('' + this.dto.stock) || tmp <= 0) {
|
| | | this.$message.showToast('商品库存格式错误,需要大于0')
|
| | | return
|
| | | }
|
| | |
|
| | |
| | | this.$message.showToast(`${field.name}信息未填写`)
|
| | | return
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | if (this.dto.params.length < 1) {
|
| | | this.$message.showToast('商品参数详情未设置')
|
| | | return
|
| | | } else {
|
| | | for (var item of this.dto.params) {
|
| | | if (!item.value) {
|
| | | if (item.value.length < 1) {
|
| | | this.$message.showToast('存在商品参数详情未设置')
|
| | | return
|
| | | }
|
| | |
| | |
|
| | | // this.$message.showToast('1')
|
| | | // return
|
| | | var dto = {
|
| | | ...this.dto,
|
| | | // applicationDate: this.$util.toDate(new Date()),
|
| | | // applicantId: this.currentInfo.id
|
| | | var dto = JSON.parse(JSON.stringify(this.dto)) |
| | | if(dto.params){ |
| | | for(var k of dto.params){ |
| | | k.value = k.value.join(",") |
| | | } |
| | | }
|
| | | this.$message.showLoading()
|
| | | const re = await this.$http.request('post', `/api/supplier/flower/list/${this.id?'edit':'new'}`, {
|
| | |
| | | var strs = []
|
| | | for (var i of this.dto.params) {
|
| | | if (i.value) {
|
| | | strs.push(i.value)
|
| | | strs.push(i.value.join(","))
|
| | | }
|
| | | }
|
| | | return strs.join(',')
|
| | |
| | |
|
| | | .label {
|
| | | width: 240rpx;
|
| | | line-height: 60px; |
| | | line-height: 60px;
|
| | | min-width: 240rpx;
|
| | |
|
| | | }
|
| | |
| | | this.dto.province = ''
|
| | | this.dto.city = ''
|
| | | this.dto.region = ''
|
| | | if (e.detail.value.length <= 3) {
|
| | | if (e.detail.value.length == 2) {
|
| | | if (!!e.detail.value[0])
|
| | | this.dto.province = e.detail.value[0].value
|
| | | if (!!e.detail.value[0])
|
| | | this.dto.city = e.detail.value[0].value
|
| | | if (!!e.detail.value[1])
|
| | | this.dto.region = e.detail.value[1].value
|
| | | }else if(e.detail.value.length <= 3) {
|
| | | if (!!e.detail.value[0])
|
| | | this.dto.province = e.detail.value[0].value
|
| | | if (!!e.detail.value[1])
|