소스 검색

commit -m 供应商版本优化

zhengjinyi 5 년 전
부모
커밋
62d1a81565

+ 13 - 1
common/css/iconfont.scss

@@ -4,7 +4,7 @@
 	font-family: iconfont;
 	font-weight: normal;
 	font-style: normal;
-	src: url('https://at.alicdn.com/t/font_1519039_1ayob1mwcnv.ttf') format('truetype');
+	src: url('https://at.alicdn.com/t/font_1519039_9hkybv95c8k.ttf') format('truetype');
 }
 .iconfont {
 	font-family: "iconfont" !important;
@@ -13,6 +13,18 @@
 	-webkit-font-smoothing: antialiased;
 	-moz-osx-font-smoothing: grayscale;
 }
+.icon-icon-cross-squre:before {
+  content: "\e668";
+}
+
+.icon-saomafukuan-:before {
+  content: "\e645";
+}
+
+.icon-icon-test:before {
+  content: "\e604";
+}
+
 .icon-xiangxia1:before {
   content: "\e771";
 }

+ 1 - 0
main.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import store from './store'
 import App from './App'
+import './services/index.js'
 import * as Api from '@/common/config/caimeiApi.js'
 import * as Regs from '@/common/config/common.js'
 import { msg, modal,json,prePage } from'./utils/util'

+ 1 - 1
pages.json

@@ -437,7 +437,7 @@
 				},{
 					"path": "pages/deliver/add-logistics",
 					"style": {
-						"navigationBarTitleText": "添加物流"
+						"navigationBarTitleText": "录入物流信息"
 					}
 				},{
 					"path": "pages/deliver/deliver-goods",

+ 13 - 0
services/ajax.env.js

@@ -0,0 +1,13 @@
+let URL_CONFIG = ""
+if(process.env.NODE_ENV === 'development'){
+    // 开发环境
+	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
+	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.26:8008'	 //超超联调地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+	// URL_CONFIG = 'https://spi.caimei365.com'
+}else{
+    // 生产环境
+    URL_CONFIG = 'https://spi.caimei365.com'
+}
+export default URL_CONFIG

+ 82 - 0
services/ajax.service.js

@@ -0,0 +1,82 @@
+/**
+ * ajax请求相关的服务
+ */
+import baseUrl from './ajax.env'
+import { msg } from '@/utils/util'
+
+class AjaxService {
+	constructor() {
+		this.name = 'AjaxService'
+	}
+	getBaseUrl (url = '') {
+		return url.indexOf('://') > -1 ? url : baseUrl + url
+	}
+	getStorageUser(){
+		let userInfo =''
+		uni.getStorage({
+			key: 'userInfo',
+			success: function (res){
+				userInfo = res.data
+			}
+		})
+		return userInfo
+	}
+	getHeaders({ header = {} }) {
+		const GET_LOGIN_STAUS = this.getStorageUser();
+		console.log(GET_LOGIN_STAUS)
+		let REV_TOKEN_ENV='';
+		if (GET_LOGIN_STAUS != null) {
+			REV_TOKEN_ENV = GET_LOGIN_STAUS.token
+		}else{
+			REV_TOKEN_ENV = 'X-token'
+		}
+		header['authorization'] = REV_TOKEN_ENV
+		return header
+	}
+	request(options = {}) {
+		let header = this.getHeaders(options)
+		if (options.header) {
+			header = Object.assign(header, options.header)
+		}
+		let url = this.getBaseUrl(options.url)
+		let {
+			isLoading = true
+		} = options
+		if (isLoading) {
+			wx.showLoading({
+				title: '加载中'
+			})
+		}
+		const requestPromise = new Promise((resolve, reject) => {
+			uni.request({
+				url: url,
+				method: options.method || 'POST',
+				data: options.data || {},
+				header,
+				success: res => {
+					if (isLoading) wx.hideLoading();
+					if (res.data.code === 1) {
+						resolve(res.data)
+					} else {
+						reject(res.data)
+					}
+				},
+				fail: error => {
+					reject(error)
+					msg(error)
+					wx.hideLoading()
+				}
+			})
+		})
+		return requestPromise
+	}
+	get(options) {
+		options.method = 'GET'
+		return this.request(options)
+	}
+	post(options) {
+		return this.request(options)
+	}
+
+}
+export default new AjaxService()

+ 17 - 0
services/common.service.js

@@ -0,0 +1,17 @@
+/**
+ * 这是所有模块公用业务逻辑的服务
+ */
+export default class CommonService {
+	constructor(AjaxService) {
+		Object.assign(this, { AjaxService })
+		this.name = 'CommonService'
+	}
+	/* api公用定义 */
+	getQueryCategory (data = {}) {
+		return this.AjaxService.get({ url:'/product/classify', data, isLoading: true })
+	}
+	/* 首页banner */
+	getExpressInformation (data = {}) {
+		return this.AjaxService.get({ url:'https://www.kuaidi100.com/autonumber/autoComNum', data, isLoading: false })
+	}
+}

+ 18 - 0
services/index.js

@@ -0,0 +1,18 @@
+import ajaxService from './ajax.service.js'
+import CommonService from './common.service'
+import LocateService from './locate.service'
+import UserService from './user.service'
+import ShopService from './shop.service'
+import PhotoService from './photo.service'
+import Vue from 'vue'
+let commonService = new CommonService(ajaxService)
+let locateService = new LocateService(ajaxService)
+let userService = new UserService(ajaxService)
+let shopService = new ShopService(ajaxService)
+let photoService = new PhotoService(ajaxService)
+Vue.prototype.AjaxService = ajaxService
+Vue.prototype.CommonService = commonService
+Vue.prototype.LocateService = locateService
+Vue.prototype.UserService = userService
+Vue.prototype.ShopService = shopService
+Vue.prototype.PhotoService = photoService

+ 75 - 0
services/locate.service.js

@@ -0,0 +1,75 @@
+/**
+ * 定位相关的业务服务
+ */
+// import { qqMapKey } from '@/utils/config.js'
+// const QQMapWX = require('@/static/base/js/qqmap-wx-jssdk.min.js')
+// const qqmapsdk = new QQMapWX({
+//   coord_type: 5,
+//   key: qqMapKey
+// })
+
+export default class LocateService {
+	constructor(AjaxService) {
+		Object.assign(this, { AjaxService })
+		this.name = 'LocateService'
+	}
+	/* 获取当前的地理位置 */
+	getGeoLocation() {
+		return new Promise(function(reslove, reject) {
+			wx.getLocation({
+				type: 'gcj02',
+				success: function(res) {
+					reslove(res)
+				},
+				fail: function(err) {
+					reject(err)
+				},
+				complete: function(res) {}
+			})
+		})
+	}
+
+	/* 获取城市名 */
+	getCityName(lat, lon) {
+		return new Promise(function(reslove, reject) {
+			qqmapsdk.reverseGeocoder({
+				location: {
+					latitude: lat,
+					longitude: lon
+				},
+				success: function(res) {
+					const {
+						ad_info: addressInfo,
+						location,
+						formatted_addresses: formattedAddress = {},
+						address
+					} = res.result || {}
+
+					let locationInfo = {
+						cityName: addressInfo.city,
+						location: location,
+						address: formattedAddress.recommend || address
+					}
+					console.log("locationInfo: " + locationInfo);
+					reslove(locationInfo)
+				},
+				fail: function(err) {
+					reject(err)
+				}
+			})
+		})
+	}
+
+	/* 获取当前定位 */
+	async getLocationByLocate () {
+		// 获取地理位置
+		let locationInfo = await this.getGeoLocation()
+		const { latitude, longitude } = locationInfo || {}
+		// 获取城市名
+		let cityInfo = await this.getCityName(latitude, longitude)
+		const { location = {}, cityName, address } = cityInfo
+		console.log(location);
+		console.log(cityName);
+		console.log(address);
+	}
+}

+ 16 - 0
services/photo.service.js

@@ -0,0 +1,16 @@
+/**
+ * 随手拍模块公用业务逻辑的服务
+ */
+export default class PhotoService {
+	constructor(AjaxService) {
+		Object.assign(this, { AjaxService })
+		this.name = 'PhotoService'
+	}
+	/* api公用定义 */
+	riskAdd (data = {}, isLoading = false) {
+		return this.AjaxService.post({ url: `weixin/api/risk/add`, data, isLoading })
+	}
+	riskEdit (data = {}, isLoading = false) {
+		return this.AjaxService.post({ url: `weixin/api/risk/edit`, data, isLoading })
+	}
+}

+ 9 - 0
services/shop.service.js

@@ -0,0 +1,9 @@
+/**
+ * 这是与购物有关的业务逻辑的服务
+ */
+export default class ShopService {
+	constructor(AjaxService) {
+		Object.assign(this, { AjaxService })
+		this.name = 'ShopService'
+	}
+}

+ 36 - 0
services/upload.service.js

@@ -0,0 +1,36 @@
+/**
+ *上传图片
+ */
+import requestUrl from './ajax.env.js'
+
+export function uploadFileImage(url) {
+	return new Promise(function(resolve,reject) {
+		uni.chooseImage({
+			count: 1, //默认1
+			sizeType: ['original','compressed'], //可以指定是原图还是压缩图,默认二者都有
+			sourceType: ['album'], //从相册选择
+			success: (res) => {
+				const tempFilePaths = res.tempFilePaths;
+				console.log(tempFilePaths)
+				const uploadTask = uni.uploadFile({
+					url : requestUrl+url,
+					filePath: tempFilePaths[0],
+					name: 'file',
+					header: {
+					    "Content-Type": "multipart/form-data",
+					},
+					formData: {
+						'user': 'test'
+					},
+					success: function (res) {
+						console.log(res)
+						resolve(res);
+					},
+					error : function(e){
+						reject(res)
+					}
+				})
+			}
+		});
+	});
+}

+ 17 - 0
services/user.service.js

@@ -0,0 +1,17 @@
+/**
+ * 这是用户业务逻辑的服务
+ */
+export default class UserService {
+	constructor(AjaxService) {
+		Object.assign(this, { AjaxService })
+		this.name = 'UserService'
+	}
+	/* 初始化查询用户是否为正常用户 */ 
+	appSelectLoginUser (data = {}) {
+		return this.AjaxService.post({ url:'', data, isLoading: true })
+	}
+	/*  微信获取用户手机号登录 */
+	LoginUsers (data = {}) {
+		return this.AjaxService.post({ url:'', data, isLoading: true })
+	}
+}

+ 395 - 1
supplier/pages/deliver/add-logistics.vue

@@ -1,8 +1,402 @@
 <template>
+	<view class="container logistics" :style="{paddingBottom :isIphoneX ? (236+68)+'rpx' : '236rpx'}">
+		<view class="logistics-list" v-for="(item,index) in logisticsList" :key="index">
+			<view class="item-title">
+				<view class="title-left">物流{{index+1}}</view>
+				<view class="title-right" v-if="(index+1) > 1" @click="deleteLogistItemFn(item,index)">
+					<text class="iconfont icon-shanchu" ></text>删除
+				</view>
+			</view>
+			<view class="item-main">
+				<view class="item-main-cell" @click.stop="pageNavigateTo">
+					<input class="input" type="text" v-model="item.name" placeholder="物流公司" disabled="true">
+					<text class="iconfont icon-xiayibu"></text>
+				</view>
+				<view class="item-main-cell">
+					<input class="input" type="text" v-model="item.number" placeholder="物流单号">
+				</view>
+				<view class="item-main-cell none" @click.stop="AddScanCode" >
+					<text class="iconfont icon-icon-test" ></text><text>扫码录入</text>
+				</view>
+			</view>
+		</view>
+		<view class="logistics-btn">
+			<view class="btn add-btn" @click="addListFn">添加物流</view>
+		</view>
+		<view class="logistics-btn-fiexd" :style="{paddingBottom :isIphoneX ? '68rpx' : '0'}">
+			<view class="btn-tips" @click.stop="showShowRemarksFn">
+				<text class="iconfont icon-xiangxiajiantou" v-if="isShowRemarks"></text>
+				<text class="iconfont icon-xiangshangjiantou" v-else></text>
+				添加备注
+			</view>
+			<view class="logistics-remarks" :class="specClass" v-show="isShowRemarks">
+				<view class="label">拍照备注</view>
+				<view class="remarks-photo clearfix">
+					<view class="photo-item" v-for="(item, index) in photoLists" :key="index">
+						<image :src="item" mode="aspectFill" @click="previewImg(index)"></image>
+						<text class="iconfont icon-iconfontguanbi" @click.stop="deletePhotoFn(index)"></text>
+					</view>
+					<view class="photo-item add" @click.stop="uploadPhotoFn" v-if="photoLists.length<10">
+						<text class="iconfont icon-jiahao"></text>
+					</view>
+				</view>
+				<view class="label">文字备注</view>
+				<view class="remarks-textarea">
+					<textarea class="textarea" v-model="contentText" value="" placeholder="文字备注,200字以内" maxlength="200" @input="conInput"/>
+					<text class="limit-text"><text class="red">{{min}}</text>/{{max}}</text>
+				</view>
+				<view class="remarks-tips">请备注快递单、发货现场和货物的照片,最多10张</view>
+			</view>
+			<view class="btn confim-btn" @click="confirmDeliverFn">确认发货</view>
+		</view>
+	</view>
 </template>
 
 <script>
+	import { mapState,mapMutations } from 'vuex'
+	import authorize from '@/common/config/authorize.js' 
+	import { uploadFileImage } from "@/api/utils.js"
+	var isPreviewImg;
+	export default{
+		data() {
+			return{
+				userID:'',
+				isIphoneX:this.$store.state.isIphoneX,
+				isShowRemarks:false,
+				specClass:'',
+				photoLists:[],
+				logisticsList:[{
+					name:'',
+					number:''
+				}],
+				contentText:'',
+				min:0,
+				max:200
+			}
+		},
+		onLoad(option) {
+			
+		},
+		methods:{
+			...mapMutations(['login']),
+			AddScanCode(item){
+				let self = this;
+				uni.scanCode({
+				    onlyFromCamera: true,
+				    success: function (res) {
+				        console.log(res);
+						item.name=res.scanType
+						item.number=res.result
+						self.CommonService.getExpressInformation({resultv2:2,text:res.result}).then(response =>{
+							console.log(response)
+						})
+				        console.log('条码类型:' + res.scanType);
+				        console.log('条码内容:' + res.result);
+				    }
+				});
+			},
+			addListFn(){
+				this.isShowRemarks = false
+				let obj ={name:'',number:''};
+				this.logisticsList.push(obj)
+			},
+			deleteLogistItemFn(item,index){
+				this.$util.modal('提示','确认删除物流信息吗?','确定','取消',true,() =>{
+					this.logisticsList.splice(index, 1);
+				})
+			},
+			pageNavigateTo(){
+				this.$api.navigateTo('/supplier/pages/deliver/logistics-list')
+			},
+			showShowRemarksFn(){
+				this.isShowRemarks = !this.isShowRemarks 
+				if(this.isShowRemarks){
+					this.specClass = 'show';
+				}else{
+					this.specClass = 'hide';
+				}
+			},
+			uploadPhotoFn(){
+				uploadFileImage().then(res =>{
+					this.photoLists.push(JSON.parse(res.data).data)
+				})
+			},
+			deletePhotoFn(index){
+				this.photoLists.splice(index, 1);
+			},
+			previewImg (index) {//顶部商品图片预览
+				isPreviewImg = true
+				let previewUrls = this.photoLists
+				uni.previewImage({
+					current: index, 	//图片索引
+					urls: previewUrls, //必须是http图片,本地图片无效
+					longPressActions:''
+				})
+			},
+			conInput(e){
+				let value = e.detail.value;
+				let len = parseInt(value.length);
+				if (len > this.max) return;
+				this.min = len;
+				if(this.min == 200){
+					this.$util.msg('您输入的次数已达上限',2000);
+				}
+             
+			}
+		},
+		onShow() {
+			this.$api.getStorage().then((resolve) => {
+				this.userID = resolve.userID
+				this.bindMobile = resolve.bindMobile
+			})
+		}
+	}
 </script>
 
-<style>
+<style lang="scss">
+	page {
+		height: auto;
+		background:#F7F7F7;
+	}
+	@keyframes showRemarks {
+		0% {opacity: 0;}
+		20% {opacity: 0.2;}
+		40% {opacity: 0.4;}
+		60% {opacity: 0.6;}
+		80% {opacity: 0.8;}
+		100% {opacity: 1;}
+	}
+	@keyframes hideRemarks {
+		0% {opacity: 1;}
+		20% {opacity: 0.8;}
+		40% {opacity: 0.6;}
+		60% {opacity: 0.4;}
+		80% {opacity: 0.2;}
+		100% {opacity: 0;}
+	}
+	.logistics{
+		border-top: 1px solid #EBEBEB;
+	}
+	.logistics-list{
+		width: 100%;
+		height: auto;
+		padding: 10rpx 0;
+		background-color: #FFFFFF;
+		margin-bottom: 24rpx;
+		.item-title{
+			width: 702rpx;
+			height: 80rpx;
+			padding: 0 24rpx;
+			line-height: 80rpx;
+			text-align: left;
+			font-size: $font-size-28;
+			color: $text-color;
+			border-bottom: 1px solid #EBEBEB;
+			.title-left{
+				float: left;
+			}
+			.title-right{
+				float: right;
+				.icon-shanchu{
+					font-size: $font-size-30;
+					color: #FF2A2A;
+				}
+			}
+		}
+		.item-main{
+			width: 702rpx;
+			padding: 0 24rpx;
+			.item-main-cell{
+				width: 100%;
+				height: 80rpx;
+				line-height: 80rpx;
+				border-bottom: 1px solid #EBEBEB;
+				position: relative;
+				&.none{
+					border-bottom: none;
+					text-align: center;
+					font-size: $font-size-28;
+					color: $color-system;
+				}
+				.icon-xiayibu{
+					width: 40rpx;
+					height: 80rpx;
+					display: block;
+					position: absolute;
+					right: 0;
+					top: 0;
+					font-size: $font-size-32;
+					color: $text-color;
+					text-align: center;
+				}
+				.icon-icon-test{
+					color: $color-system;
+					font-size: $font-size-28;
+					margin-right: 10rpx;
+				}
+				.input{
+					width: 100%;
+					height: 44rpx;
+					line-height: 44rpx;
+					padding: 18rpx 0;
+					font-size: $font-size-28;
+					color: $text-color;
+				}
+			}
+		}
+	}
+	.logistics-btn{
+		width: 702rpx;
+		height: 88rpx;
+		margin: 0 auto;
+		.btn{
+			width: 100%;
+			height: 100%;
+			background-color: #FFF;
+			border-radius: 14rpx;
+			border: 1px solid $color-system;
+			line-height: 88rpx;
+			text-align: center;
+			color: $color-system;
+		}
+	}
+	.logistics-btn-fiexd{
+		width: 702rpx;
+		padding: 0 24rpx;
+		height:auto;
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		background-color: #FFF;
+		border-radius: 20rpx 20rpx 0 0;
+		box-shadow:0px 3px 10px rgba(51, 51, 51,0.5);
+		z-index: 999;
+		.btn-tips{
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			font-size: $font-size-28;
+			color: #999999;
+		}
+		.confim-btn{
+			width: 702rpx;
+			height: 88rpx;
+			background: $btn-confirm;
+			line-height: 88rpx;
+			text-align: center;
+			color: #FFF;
+			font-size: $font-size-28;
+			border-radius: 14rpx;
+		}
+		.logistics-remarks{
+			width: 100%;
+			height: auto;
+			&.show {
+				animation: showRemarks 0.2s linear both;
+			}
+			&.hide {
+				animation: hideRemarks 0.2s linear both;
+			}
+			.label{
+				height: 44rpx;
+				line-height: 44rpx;
+				font-size: $font-size-28;
+				color: $text-color;
+			}
+			.remarks-photo{
+				width: 100%;
+				height: auto;	
+				padding: 10rpx 0;
+				.photo-item{
+					display: inline-block;
+					width: 112rpx;
+					height: 112rpx;
+					margin: 10rpx 0;
+					margin-right: 25rpx;
+					border-radius: 10rpx;
+					border:1px solid #F5F5F5;
+					position: relative;
+					float: left;
+					&.add{
+						width: 112rpx;
+						height: 112rpx;
+						border-color: #FFC684;
+						text-align: center;
+						line-height: 112rpx;
+						margin-right: 0rpx;
+						.icon-jiahao{
+							font-size: $font-size-44;
+							color:#FFC684 ;
+							font-weight: bold;
+						}
+					}
+					.icon-iconfontguanbi{
+						width: 24rpx;
+						height: 24rpx;
+						border-radius: 0 10rpx 0 0;
+						display: block;
+						position: absolute;
+						right: 0;
+						top: 0;
+						background: rgba(51, 51, 51, 0.7);
+						text-align: center;
+						line-height: 24rpx;
+						color: #FFF;
+						font-size: $font-size-22;
+					}
+					image{
+						width: 112rpx;
+						height: 112rpx;
+						border-radius: 10rpx;
+					}
+				}	
+				.photo-list{
+					width: 100%;
+					height: 116rpx;
+					overflow: hidden;
+					white-space: nowrap;
+					display: flex;
+					align-items: flex-start;
+				}
+				.scoll-wrapper{
+					display:flex;
+					align-items: flex-start;
+				}
+			}
+			.remarks-textarea{
+				width: 652rpx;
+				height: 124rpx;
+				padding:10rpx 24rpx 24rpx 24rpx;
+				margin-top: 20rpx;
+				background-color: #F5F5F5;
+				border-radius: 10rpx;
+				position: relative;
+				.textarea{
+					width: 100%;
+					height: 100%;
+					line-height: 36rpx;
+					font-size: $font-size-24;
+					color: $text-color;
+					z-index: 1;
+				}
+				.limit-text{
+					position: absolute;
+					right: 20rpx;
+					bottom: 0;
+					line-height: 44rpx;
+					font-size: $font-size-24;
+					color: #D0D0D0;
+					.red{
+						color: $color-system;
+					}
+				}
+			}
+			.remarks-tips{
+				width: 100%;
+				line-height: 70rpx;
+				font-size: $font-size-24;
+				color: #999999;
+			}
+		}
+	}
 </style>

+ 28 - 64
supplier/pages/deliver/deliver-goods.vue

@@ -1,11 +1,12 @@
 <template>
-	<view class="container cart clearfix"> 	
+	<view class="container cart clearfix"> 
 		<view class="container-cart-main">
 			<view class="container-cart">
 				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
+					<view class="goods-title">请选择合适的商品数量进行发货</view>
 					<view class="goods-list">
-						<view 	class="goods-pros" v-for="(pros,idx) in productsList" :key="idx"  @click.stop="ischeck(pros)" >
-							<view class="goods-pros-t">
+						<view 	class="goods-pros" v-for="(pros,idx) in productsList" :key="idx" >
+							<view class="goods-pros-t"  @click.stop="ischeck(pros)">
 								<!--选择商品-->
 								<view class="checkbox-box">
 									<button class="checkbox iconfont" :class="[pros.checked ?'icon-gouxuanl':'icon-weigouxuan']"></button>
@@ -32,9 +33,9 @@
 									<view class="text">本次发货</view>
 									<view class="count">
 										<view class="number-box">
-											<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
-											<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)">
-											<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
+											<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(pros)"></view>
+											<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,pros)">
+											<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(pros)"></view>
 										</view>
 									</view>
 								</view>
@@ -51,7 +52,7 @@
 						</view>
 					</view>
 					<view class="footer-ri" >
-						<view class="btn" @tap="toConfirmation">去发货</view>
+						<view class="btn" @tap="toConfirmDeliver">去发货</view>
 					</view>
 				</view>
 			</view>
@@ -81,6 +82,7 @@
 						taxRate:5,
 						discount:5,
 						discountPrice:3,
+						productCount:6,
 						price:'200.00',
 						checked:false
 					},{
@@ -91,6 +93,7 @@
 						num:20,
 						taxRate:5,
 						discount:5,
+						productCount:6,
 						discountPrice:3,
 						price:'200.00',
 						checked:false
@@ -142,11 +145,9 @@
 				let goodsCheckedLength = 0,
 					productsList = this.productsList;
 				productsList.forEach(item => {
-					if(item.checked) {
-						goodsCheckedLength++;
-					}
+					if(item.checked) { goodsCheckedLength++; }
 				})
-				this.isCheckAll = goodsCheckedLength === productsList.lengt;
+				this.isCheckAll = goodsCheckedLength === productsList.length;
 			},
 			updateBothCheckBtn() {
 				this.productsList.forEach((item)=>{
@@ -158,7 +159,7 @@
 				this.updateBothCheckBtn();     
 			},
 			changeCountAdd(item,pros){//商品数量加加
-				if(pros.productCount>=pros.stock){
+				if(pros.productCount == pros.stock){
 					pros.productCount= pros.stock
 					this.isStock =true
 					return
@@ -180,7 +181,7 @@
 				this.updateShoppogNum(pros)
 				this.totalShopPeice();
 			},
-			changeNnmber(e,item,pros){//输入商品数量更新
+			changeNnmber(e,pros){//输入商品数量更新
 				let _value = e.detail.value;
 				if(!this.$api.isNumber(_value)){
 					pros.productCount = pros.minBuyNumber
@@ -202,7 +203,9 @@
 					this.$util.msg(error.msg,2000);
 				})
 			 },
-			toConfirmation(){//跳转确认订单页面
+			toConfirmDeliver(){//添加物流页面
+				this.$api.navigateTo(`/supplier/pages/deliver/add-logistics`)
+				return
 				let setGoodsList=[];
 				this.goodsList.forEach(res=>{
 					let products = res.productsList
@@ -266,7 +269,16 @@
 	}
 	.cart-content{
 		position: relative;
-		margin-top: 24rpx;
+	}
+	.goods-title{
+		width: 702rpx;
+		padding: 0 24rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		text-align: left;
+		font-size: $font-size-28;
+		color: $color-system;
+		background-color: rgba(225, 86, 22, 0.17);
 	}
 	.checkbox-box{
 		display: flex;
@@ -302,7 +314,7 @@
 		width: 100%;
 		height: auto;
 		background-color: #F7F7F7;
-		border-top: 1px solid #F7F7F7;
+		margin-top: 24rpx;
 		.goods-item{
 			width: 702rpx;
 			padding: 0 24rpx;
@@ -313,7 +325,6 @@
 			display: flex;
 			align-items: center;
 			height: 80rpx;
-			// border-bottom: 1px solid #EBEBEB;
 			line-height: 80rpx;
 			.checkbox-box{
 				padding: 10rpx;
@@ -550,52 +561,5 @@
 				align-items: center;
 			}
 		}
-		.footer-del{
-			width: 400rpx;
-			height: 110rpx;
-			position: absolute;
-			padding-left: 200rpx;
-			background: #FFFFFF;
-			right: 0;
-			top: 0;
-			z-index: 1000;
-			&.show{
-				animation: showDelbtn 0s linear both;
-			}
-			&.none{
-				animation: hideDelbtn 0s linear both;
-			}
-			.btn{
-				width: 50%;
-				height: 100%;
-				line-height: 110rpx;
-				font-size: $font-size-28;
-				color: #FFFFFF;
-				text-align: center;
-				float: left;
-			}
-			.btn.btn-cancel{
-				background:#EEC1AB;
-			}
-			.btn.btn-confirm{
-				background:#FF2A2A;
-			}
-			@keyframes showDelbtn {
-				0% {
-					transform: translateX(0);
-				}
-				100% {
-					transform: translateX(-100%);
-				}
-			}
-			@keyframes hideDelbtn {
-				0% {
-					transform: translateX(-100%);
-				}
-				100% {
-					transform: translateX(0);
-				}
-			}
-		}
 	}
 </style>

+ 560 - 3
supplier/pages/deliver/deliver-record.vue

@@ -1,8 +1,565 @@
 <template>
+	<view class="container cart clearfix"> 
+		<view class="container-cart-main">
+			<view class="container-cart">
+				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
+					<view class="goods-title">请选择合适的商品数量进行发货</view>
+					<view class="goods-list">
+						<view 	class="goods-pros" v-for="(pros,idx) in productsList" :key="idx" >
+							<view class="goods-pros-t"  @click.stop="ischeck(pros)">
+								<!--选择商品-->
+								<view class="checkbox-box">
+									<button class="checkbox iconfont" :class="[pros.checked ?'icon-gouxuanl':'icon-weigouxuan']"></button>
+								</view>
+								<view class="pros-img"><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
+								<view class="pros-product">
+									<view class="producttitle">{{pros.name}}</view>
+									<view class="productspec">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
+									<view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
+									<view class="product-view">
+										<view class="view-num">数量:{{pros.num}}</view>
+									</view>
+									<view class="product-view">
+										<view class="view-num">已发货:{{pros.taxRate}}</view>
+										<view class="view-num">未发货:{{pros.discount == null ? '0' : pros.discount}}</view>
+									</view>
+									<view class="product-view">
+										<view class="view-num">已退货:{{pros.discountPrice}}</view>
+									</view>
+								</view>	
+							</view>
+							<view class="goods-pros-b">
+								<view class="productprice">
+									<view class="text">本次发货</view>
+									<view class="count">
+										<view class="number-box">
+											<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(pros)"></view>
+											<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,pros)">
+											<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(pros)"></view>
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>	
+				</view>
+				<!-- 脚部菜单 -->
+				<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
+					<view class="footer-le">
+						<view class="foot-check checkbox-box" @tap.stop="checkAll()">
+							<button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button> 
+							<view class="text">全选</view>
+						</view>
+					</view>
+					<view class="footer-ri" >
+						<view class="btn" @tap="toConfirmDeliver">去发货</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
-
 <script>
+	import authorize from '@/common/config/authorize.js'
+	import { mapState,mapMutations } from 'vuex';
+	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
+	
+	export default{
+		data(){
+			return{
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				isIphoneX:this.$store.state.isIphoneX,
+				userID:'',
+				alertType:'',
+				isStock:'',
+				productsList:[
+					{
+						mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
+						name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
+						productUnit:'盒',
+						productCode:'FXSW2131231231',
+						num:20,
+						taxRate:5,
+						discount:5,
+						discountPrice:3,
+						productCount:6,
+						price:'200.00',
+						checked:false
+					},{
+						mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
+						name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
+						productUnit:'盒',
+						productCode:'FXSW2131231231',
+						num:20,
+						taxRate:5,
+						discount:5,
+						productCount:6,
+						discountPrice:3,
+						price:'200.00',
+						checked:false
+					}
+				],	//购物车的商品
+				setGoodData:'', //确认订单的商品
+				isCheckAll:false,//是否全选
+				isModallayer:false,
+				isDisabled: false, // 供应商/店铺全选是否禁用状态
+				isNoConfim:false,
+			}
+		},
+		onLoad(option){
+			console.log(option)
+			// this.initGetCartGoodsList();
+		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
+		methods:{
+			initGetCartGoodsList(){//初始化购物车 index:1
+				let params = {userID:this.userID}
+				queryShoppingCartList(params).then(response =>{
+					this.$store.commit('updateAllNum',response.data.cartQuantity)
+					const responseData = response.data
+					if(responseData.pageDate && responseData.pageDate.length > 0 ){
+						this.productsList = responseData.pageDate;
+						this.productsList.forEach((item,index) => {
+							let productsListLength = item.productsList.length,
+								invalidLength = 0;
+							item.productsList.forEach(pros => {
+								pros.shopID = item.shopID;
+								if(pros.validFlag == '3' ) {invalidLength++;}
+							})
+							item.isDisabled = invalidLength === productsListLength;
+						})
+					} else {
+						this.productsList = [];
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},		
+			ischeck(pro){//为未选中的时候改变为true,反之为true
+				pro.checked = !pro.checked;
+				this.updateCheckAllBtn();
+			},
+			updateCheckAllBtn() {// 全选勾选判断
+				let goodsCheckedLength = 0,
+					productsList = this.productsList;
+				productsList.forEach(item => {
+					if(item.checked) { goodsCheckedLength++; }
+				})
+				this.isCheckAll = goodsCheckedLength === productsList.length;
+			},
+			updateBothCheckBtn() {
+				this.productsList.forEach((item)=>{
+					item.checked = this.isCheckAll ;
+				})
+			},
+			checkAll(){//全选方法内调用方法
+			    this.isCheckAll = !this.isCheckAll;
+				this.updateBothCheckBtn();     
+			},
+			changeCountAdd(item,pros){//商品数量加加
+				if(pros.productCount == pros.stock){
+					pros.productCount= pros.stock
+					this.isStock =true
+					return
+				}else{
+					pros.productCount++
+					this.isStock =false
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeCountSub(item,pros){//商品数量减减
+				if(pros.productCount<=pros.minBuyNumber){
+					pros.productCount= pros.minBuyNumber
+					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
+					return
+				}else{
+					pros.productCount--
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeNnmber(e,pros){//输入商品数量更新
+				let _value = e.detail.value;
+				if(!this.$api.isNumber(_value)){
+					pros.productCount = pros.minBuyNumber
+				}else if(_value < pros.minBuyNumber){	
+					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
+					pros.productCount = pros.minBuyNumber
+				}else{
+					pros.productCount = e.detail.value
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			updateShoppogNum(pros){//加减购物车商品更新到后台
+				let params ={userID:this.userID,productID:pros.productID,productCount:pros.productCount}
+				shoppingCartUpdate(params).then(response =>{
+					this.isshowDelbtn = false;
+					this.initGetCartGoodsList();
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			 },
+			toConfirmDeliver(){//添加物流页面
+				this.$api.navigateTo(`/supplier/pages/deliver/add-logistics`)
+				return
+				let setGoodsList=[];
+				this.goodsList.forEach(res=>{
+					let products = res.productsList
+					products.forEach(pros=>{
+						if(pros.productsChecked){
+						    setGoodsList.push(pros.productID)
+						}
+					})
+				})
+				if(setGoodsList == ''){
+					this.$util.msg("请先选择结算商品~",2000);
+					return
+				}else{
+					this.isNoConfim = false
+					this.goodsList.forEach(el=>{
+						el.productsList.forEach(pros=>{
+							if(pros.productsChecked){
+							   if(pros.productCount<pros.minBuyNumber){
+								   this.isNoConfim = true
+							   }
+							}
+						})
+					})
+					if(this.isNoConfim){
+						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
+						return;
+					}else{
+						let productID = '';
+						this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
+							el.productsList.forEach(pros=>{
+								if(pros.productsChecked){
+								   productID += pros.productID+','
+								}
+							})
+						})
+						let cartPramsData={
+								allPrice:this.allPrice,
+								allCount:this.allCount,
+								productID:productID.substring(0,productID.lastIndexOf(',')),
+								productCount:''
+						    }
+						this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
+					}
+				}
+			},
+		},
+		onPullDownRefresh() {//下拉刷新
+			// this.initGetCartGoodsList()
+			// uni.stopPullDownRefresh()
+		},
+		onShow(){
+			
+		},
+	}
 </script>
 
-<style>
-</style>
+<style lang="scss">
+	page{
+		background: #f7f7f7;
+		height: auto;
+	}
+	.cart-content{
+		position: relative;
+	}
+	.goods-title{
+		width: 702rpx;
+		padding: 0 24rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		text-align: left;
+		font-size: $font-size-28;
+		color: $color-system;
+		background-color: rgba(225, 86, 22, 0.17);
+	}
+	.checkbox-box{
+		display: flex;
+		align-items: center;
+		.checkbox{
+			display: flex;
+			margin: 0;
+			padding: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			box-sizing: border-box;
+			text-align: center;
+			text-decoration: none;
+			border-radius: 0;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			background-color:#FFFFFF;
+			font-size: 36rpx;
+			color:$color-system;
+		}
+		&.disabled{
+			.checkbox{
+				color:#999999
+			}
+		}
+		.text{
+			font-size: $font-size-24;
+			margin-left: 10rpx;
+		}
+	}
+	.goods-list{
+		width: 100%;
+		height: auto;
+		background-color: #F7F7F7;
+		margin-top: 24rpx;
+		.goods-item{
+			width: 702rpx;
+			padding: 0 24rpx;
+			background: #FFFFFF;
+			margin-bottom: 24rpx;
+		}
+		.shoptitle{
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			line-height: 80rpx;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.text{
+				margin-left: 37rpx;
+				font-size: $font-size-28;
+				color: $text-color;
+				text-align: left;
+				font-weight: bold;
+			}
+		}
+		.goods-pros{
+			width: 702rpx;
+			padding: 0 24rpx;
+			background: #FFFFFF;
+			margin-bottom: 24rpx;
+		}	
+		.goods-pros-t{
+			display: flex;
+			width: 100%;
+			height: auto;
+			padding:20rpx 0;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.pros-img{
+				width: 210rpx;
+				height: 210rpx;
+				border-radius: 10rpx;
+				margin:0 20rpx;
+				border:1px solid #f3f3f3;
+				image{
+					width: 100%;
+					height: 100%;
+					border-radius: 10rpx;
+				}
+			}
+		}
+		.goods-pros-b{
+			width:622rpx;
+			height: 80rpx;
+			margin-left: 84rpx;
+			border-top: 1px solid #F7F7F7;
+			position: relative;
+			.productprice{
+				height: 48rpx;
+				width: 100%;
+				margin-top: 15rpx;
+				.text{
+					line-height: 48rpx;
+					float: left;
+					color: $text-color;
+					font-size: $font-size-28;
+				}
+				.count{
+					height: 100%;
+					float: right;
+					position: relative;
+					&.show{
+						display: block;
+					}
+					&.none{
+						display: none;
+					}
+					.number-box{
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						.iconfont{
+							font-size: $font-size-24;
+							padding:0 20rpx;
+							color: $text-color;
+							text-align: center;
+							line-height: 48rpx;
+							font-weight: bold;
+						}
+						.btn-input{
+							width: 62rpx;
+							height: 48rpx;
+							line-height: 48rpx;
+							background: #F8F8F8;
+							border-radius: 4rpx;
+							text-align: center;
+							font-size: $font-size-24;
+						}
+					}
+					.uni-numbox{
+						position: absolute;
+						left: 45rpx;
+						bottom: 0;
+						.uni-numbox-minus, .uni-numbox-plus{
+							width: 50rpx;
+							line-height: 40rpx;
+						}
+						.uni-numbox-value {
+							font-size: $font-size-28;
+							width: 60rpx;
+						}
+					}
+				}
+			}
+		}
+		.pros-product{
+			width: 402rpx;
+			height: 100%;
+			line-height: 36rpx;
+			font-size: $font-size-28;	
+			position: relative;
+			.producttitle{
+				width: 100%;
+				display: inline-block;
+				height: auto;							
+				text-overflow:ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 2;
+				overflow: hidden;
+				margin-bottom: 8rpx;
+			}
+			.productspec{
+				height: 44rpx;
+				color: #999999;
+				line-height: 44rpx;
+				font-size: $font-size-26;
+			}
+			.product-view{
+				width: 100%;
+				height: auto;
+				display: flex;
+				.view-num{
+					flex: 1;
+					text-align: left;
+					font-size: $font-size-26;
+					color: #666666;
+					line-height: 44rpx;
+				}
+			}
+		}
+	}
+	.footer{
+		width: 100%;
+		background-color: #FFFFFF;
+		height: 110rpx;
+		position: fixed;
+		bottom: 0rpx;
+		z-index: 100;
+		.footer-le{
+			width: 490rpx;
+			height: 100%;
+			padding:0 30rpx;
+			float: left;
+			.text{
+				font-weight: bold;
+			}
+			.foot-check{
+				width: 100rpx;
+				float: left;
+				line-height: 110rpx;
+				font-size: $font-size-24;
+				.checkbox{
+					width: 40rpx;
+					text-align: center;
+				}
+				.text{
+					width: 60rpx;
+					float: right;
+				}
+			}
+			.foot-check-delbtn{
+				float: left;
+				.delBtn{
+					margin: 0;
+					padding: 0;
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					box-sizing: border-box;
+					font-size: $font-size-24;
+					text-align: center;
+					text-decoration: none;
+					border-radius: 0;
+					-webkit-tap-highlight-color: transparent;
+					overflow: hidden;
+					background-color:#FFFFFF;
+					color: #FF2A2A;
+					padding: 0 24rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					line-height: 110rpx;
+					font-weight: bold;
+					&.none{
+						display: none;	
+					}
+				}
+			}
+			.sum{
+				font-size: $font-size-28;
+				line-height: 110rpx;
+				color: $text-color;
+				display: flex;
+				justify-content: flex-end;
+				.money{
+					color: #FF2A2A;
+				}
+				.money-sign{
+					font-size: $font-size-24;
+					color: #FF2A2A;
+				}
+			}
+		}
+		.footer-ri{
+			width: 200rpx;
+			height: 100%;
+			background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
+			float: right;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			z-index: 999;
+			&.none{
+				display: none;
+			}
+			.btn{
+				width: 200rpx;
+				height: 100%;
+				font-size: $font-size-28;
+				line-height: 110rpx;
+				color: #FFFFFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+		}
+	}
+</style>

+ 108 - 3
supplier/pages/deliver/logistics-list.vue

@@ -1,8 +1,113 @@
 <template>
+	<view class="container logistics clearfix"> 
+		<view class="list-cell-item" :class="isACtive ? 'active' : ''" v-for="(item,index) in companyList" :key="index" >
+			<view class="item-name">{{item.name}}</view>
+			<view class="item-icon"><text class="iconfont icon-gou"></text></view>
+		</view>
+	</view>
 </template>
-
 <script>
+	import authorize from '@/common/config/authorize.js'
+	import { mapState,mapMutations } from 'vuex';
+	import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js" 
+	
+	export default{
+		data(){
+			return{
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				isIphoneX:this.$store.state.isIphoneX,
+				isACtive:true,
+				companyList:[
+					{name:'顺丰快递'},
+					{name:'申通快递'},
+					{name:'韵达快递'},
+					{name:'圆通快递'},
+					{name:'中通快递'},
+					{name:'德邦物流'},
+					{name:'菜鸟裹裹'}
+				]
+			}
+		},
+		onLoad(option){
+			console.log(option)
+			// this.initGetCartGoodsList();
+		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
+		methods:{
+			initGetCartGoodsList(){//初始化购物车 index:1
+				let params = {userID:this.userID}
+				queryShoppingCartList(params).then(response =>{
+					this.$store.commit('updateAllNum',response.data.cartQuantity)
+					const responseData = response.data
+					if(responseData.pageDate && responseData.pageDate.length > 0 ){
+						this.productsList = responseData.pageDate;
+						this.productsList.forEach((item,index) => {
+							let productsListLength = item.productsList.length,
+								invalidLength = 0;
+							item.productsList.forEach(pros => {
+								pros.shopID = item.shopID;
+								if(pros.validFlag == '3' ) {invalidLength++;}
+							})
+							item.isDisabled = invalidLength === productsListLength;
+						})
+					} else {
+						this.productsList = [];
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},		
+		},
+		onPullDownRefresh() {//下拉刷新
+			// this.initGetCartGoodsList()
+			// uni.stopPullDownRefresh()
+		},
+		onShow(){
+			
+		},
+	}
 </script>
 
-<style>
-</style>
+<style lang="scss">
+	page{
+		background: #f7f7f7;
+		height: auto;
+	}
+	.logistics{
+		width: 702rpx;
+		padding: 0 24rpx;
+		border-top: 1px solid #F7F7F7;
+		background-color: #FFFFFF;
+		.list-cell-item{
+			width: 702rpx;
+			height: 88rpx;
+			line-height: 88rpx;
+			border-bottom: 1px solid #F7F7F7;
+			&.active{
+				.item-name{
+					color: $color-system;
+				}
+				.item-icon{
+					color: $color-system;
+				}
+			}
+			.item-name{
+				float: left;
+				font-size: $font-size-28;
+				color: $text-color;
+			}
+			.item-icon{
+				width:88rpx;
+				height: 88rpx;
+				float: right;
+				line-height: 88rpx;
+				text-align: center;
+				.icon-gou{
+					font-size: $font-size-44;
+				}
+			}
+		}
+	}
+</style>