Browse Source

1.0测试、修改内容

qianduan 9 months ago
parent
commit
28d2223533

+ 3 - 3
common/downApp.js

@@ -1,11 +1,11 @@
 export function checkUpdateApp() {
 	plus.runtime.getProperty(plus.runtime.appid, function(widgetinfo) {
-		if (widgetinfo.name == '冷链物流') {
+		if (widgetinfo.name == '冷链送药') {
 			uni.request({
 				url: 'https://www.pgyer.com/apiv2/app/check',
 				data: {
 					_api_key: '202eadee73f2051186b26106cc8bfed1',
-					appKey: '970036fad7e2118d83dcdc5ac36eabc5'
+					appKey: '3ddb1c783d37ac3d2f979dfa2aa6bc9e '
 				},
 				success: check => {
 					if (check.statusCode == 200 && check.data.code == 0 && check.data.data) {
@@ -14,7 +14,7 @@ export function checkUpdateApp() {
 							appVersion = data.buildVersion,
 							appName = widgetinfo.name,
 							appurl = data.downloadURL,
-							intro = '发现新的《冷链物流》APP,需要更新APP';
+							intro = '发现新的《冷链送药》APP,需要更新APP';
 
 						if (data && version < appVersion) {
 							uni.showModal({

+ 15 - 0
components/waybill.js

@@ -0,0 +1,15 @@
+export const formRules = () => {
+	return [{
+		field: 'tamperProofLabel',
+		label: '防拆标签码',
+		placeholder: '请输入防拆标签码',
+		type: 'input',
+		required: true,
+	}, {
+		field: 'tamperProofLabelImg',
+		label: '防拆标签图片',
+		placeholder: '请上传防拆标签图片',
+		type: 'upload',
+		required: true,
+	}]
+}

+ 42 - 0
components/x-form.vue

@@ -8,6 +8,10 @@
 					<view class="card_form_item">
 						<u-input v-model="model[`${item.field}`]" :disabled="item.disabled ? true : false"
 							:placeholder="item.placeholder"></u-input>
+						<view class="card_sweep" v-if="item.field == 'tamperProofLabel'" @click="sweep(item.field)">
+							<u-icon name="scan" size="18px"></u-icon>
+							<span>扫一扫</span>
+						</view>
 					</view>
 				</u-form-item>
 				<u-form-item :required="item.required ? true : false" :label="item.label" :prop="item.field"
@@ -180,6 +184,26 @@
 					});
 				})
 			},
+			// 扫一扫
+			sweep(field) {
+				// 允许从相机和相册扫码
+				uni.scanCode({
+					scanType: ['barCode', 'qrCode'],
+					autoZoom: false,
+					success: (res) => {
+						if (res.result) {
+							let url = res.result;
+							this.model[field] = url
+						} else {
+							console.log('请重新扫描');
+							return false;
+						}
+					},
+					fail: (res) => {
+						console.log('未识别到二维码1');
+					}
+				})
+			},
 			//子组件校验,传递到父组件
 			async validateForm() {
 				let flag = null
@@ -196,6 +220,24 @@
 
 <style lang="scss">
 	.card_form_item {
+		display: flex;
 		width: 100%;
 	}
+
+	.card_sweep {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		height: 70rpx;
+		border: 1rpx solid #e5e5e5;
+		border-radius: 8rpx;
+		margin-left: 10rpx;
+
+		span {
+			margin: 0rpx 10rpx;
+			display: flex;
+			font-size: 22rpx;
+		}
+	}
 </style>

+ 4 - 2
components/x-humiture.vue

@@ -98,7 +98,9 @@
 			},
 			// 滚动加载更多
 			loadMore() {
-				this.getList(this.tIds[0]);
+				if (this.loadingMore) {
+					this.getList(this.tIds[0]);
+				}
 			}
 		}
 	}
@@ -145,7 +147,7 @@
 	}
 
 	.scroll-view {
-		max-height: 500rpx;
+		max-height: 600rpx;
 		overflow: hidden;
 	}
 </style>

+ 105 - 5
components/x-orderManagement.vue

@@ -8,14 +8,15 @@
 			<view class="title_ordermang"><span>收货地址:</span>{{item.consigneeAddressDetails}}</view>
 			<view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
 			<view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
-			<view style="display: flex;" v-if="item.status == 1">
+
+			<view style="display: flex;margin-top: 15rpx;" v-if="item.status == 1">
 				<view class="btn_printil markd10" v-if="item.status == 1 || item.status == 2 || item.status == 3"
 					@click.stop="modifyOrder(item)">
 					<u-button size="small" type="warning" text="修改订单"></u-button>
 				</view>
-				<!-- <view class="btn_printil markd10" @click.stop="printBarCode(item)">
-					<u-button size="small" type="primary" text="打印条码"></u-button>
-				</view> -->
+				<view class="btn_printil markd10" @click.stop="antiDismantle(item)">
+					<u-button size="small" type="primary" text="防拆标签"></u-button>
+				</view>
 				<view class="btn_printil markd10" @click.stop="sendOrders(item)">
 					<u-button size="small" type="success" text="派单"></u-button>
 				</view>
@@ -45,11 +46,22 @@
 				<u-button size="small" type="primary" text="确定" @click="confirm()"></u-button>
 			</view>
 		</u-popup>
+		<u-popup :show="antiShow" mode="center" closeable :closeOnClickOverlay="false" round="6" @close="close">
+			<view class="card_dismantle">
+				<view class="headline_anti">防拆标签</view>
+				<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules"></x-form>
+				<u-button style="margin-top: 10rpx;" size="small" type="primary" text="确定"
+					@click="modifiedTamper()"></u-button>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
 	const ENV = require('@/.env.js')
+	import {
+		formRules,
+	} from "./waybill.js";
 	export default {
 		name: 'xOrderManagement',
 		props: {
@@ -72,6 +84,25 @@
 				signRejection: '',
 				orderNumber: '',
 				imageUrl: '',
+				antiShow: false,
+				goodsList: formRules(),
+				goodsModel: {
+					tamperProofLabel: '',
+					tamperProofLabelImg: '',
+				},
+				goodsRules: {
+					tamperProofLabel: {
+						required: true,
+						message: '请输入防拆标签码',
+						trigger: ['blur', 'change']
+					},
+					tamperProofLabelImg: {
+						required: true,
+						message: '请上传防拆标签图片',
+						trigger: ['blur', 'change']
+					},
+				},
+				antiList: {},
 			}
 		},
 		mounted() {
@@ -89,6 +120,27 @@
 			sendOrders(value) {
 				this.$emit('sendOrders', value)
 			},
+			// 防拆标签
+			antiDismantle(value) {
+				this.antiList = value
+				this.antiShow = true
+				this.goodsModel.tamperProofLabel = value.tamperProofLabel
+				this.goodsModel.tamperProofLabelImg = value.tamperProofLabelImg
+				this.goodsModel.id = value.id
+				if (value.tamperProofLabelImg) {
+					let arrImg = value.tamperProofLabelImg.split(',')
+					let arrImgList = []
+					arrImg.forEach((item) => {
+						const arr = {
+							url: item,
+						}
+						arrImgList.push(arr)
+					})
+					this.$nextTick(() => {
+						this.$refs.goods.fileList1 = arrImgList
+					})
+				}
+			},
 			// 拒收
 			rejection(value) {
 				this.orderNumber = value.waybillNo
@@ -117,7 +169,6 @@
 					params.status = 3
 				}
 				this.$api.post('/api/waybill/receipt', params).then(res => {
-					console.log(res, 266)
 					if (res.code == 200) {
 						uni.$u.toast(res.msg)
 						this.signForShow = false
@@ -127,6 +178,35 @@
 					}
 				})
 			},
+			// 修改防拆标签
+			async modifiedTamper() {
+				let flag2 = await this.$refs['goods'].validateForm();
+				if (flag2) {
+					let params = {
+						senderAddressName: this.antiList.senderAddressName,
+						senderAddressPhone: this.antiList.senderAddressPhone,
+						senderAddressDetails: this.antiList.senderAddressDetails,
+						consigneeAddressName: this.antiList.consigneeAddressName,
+						consigneeAddressPhone: this.antiList.consigneeAddressPhone,
+						consigneeAddressDetails: this.antiList.consigneeAddressDetails,
+						...this.goodsModel,
+					}
+					uni.showLoading();
+					// 修改订单
+					this.$api.put('/api/waybill', params).then(res => {
+						if (res.code == 200) {
+							this.antiShow = false
+							uni.$u.toast(res.msg)
+							this.$emit('proofRenewal')
+						} else {
+							uni.$u.toast('修改失败')
+						}
+						uni.hideLoading();
+					}).catch(() => {
+						uni.hideLoading();
+					})
+				}
+			},
 			// 打印温湿度记录
 			humidityRecording(value) {
 				this.$cache.setCache('commodity', JSON.stringify(value))
@@ -237,6 +317,7 @@
 			close() {
 				console.log(22)
 				this.signForShow = false
+				this.antiShow = false
 			},
 		}
 	}
@@ -301,6 +382,10 @@
 		margin: 10rpx 0rpx 0rpx 10rpx;
 	}
 
+	.markd10:nth-child(3) {
+		margin: 10rpx 0rpx 0rpx 20rpx;
+	}
+
 	.title_sign {
 		padding: 10rpx 0rpx;
 		height: 60rpx;
@@ -325,4 +410,19 @@
 		font-size: 30rpx;
 		margin-bottom: 10rpx;
 	}
+
+	.card_dismantle {
+		padding: 30rpx;
+	}
+
+	.headline_anti {
+		font-size: 38rpx;
+		font-weight: 600;
+		display: flex;
+		justify-content: center;
+		border-bottom: 1rpx solid #e7e6e4;
+		padding-bottom: 15rpx;
+		margin-bottom: 15rpx;
+		align-items: center;
+	}
 </style>

+ 6 - 1
components/x-statistics.vue

@@ -67,10 +67,15 @@
 		},
 		created() {
 			this.list = this.list1
+			var token = this.$cache.getToken()
 			for (let key in this.orderStatistics) {
 				this.list.forEach((item, index) => {
 					if (key == item.sign) {
-						item.value = this.orderStatistics[key]
+						if (token) {
+							item.value = this.orderStatistics[key]
+						} else {
+							item.value = 0
+						}
 					}
 				})
 			}

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "冷链送药",
     "appid" : "__UNI__49186F9",
     "description" : "",
-    "versionName" : "1.0.2",
+    "versionName" : "1.0.1",
     "versionCode" : 101,
     "transformPx" : false,
     /* 5+App特有相关 */

+ 2 - 2
pages/codeLogin.vue

@@ -5,7 +5,7 @@
 		<view class="card_login">
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
-				<view class="welcome_title">欢迎登录宝智达冷链运输</view>
+				<view class="welcome_title">欢迎登录宝智达冷链送药</view>
 			</view>
 			<u-form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="手机号" prop="phone" labelWidth="80" borderBottom ref="item1">
@@ -34,7 +34,7 @@
 				</view>
 				<view class="agreement_title">我已阅读并同意<span class="protocol_title">《用户协议》</span>、<span
 						class="protocol_title">《隐私政策》</span>,
-					并授权宝智达气瓶使用该宝智达气瓶账号信息(如昵称、头像、收货地址)进行统一管理
+					并授权宝智达冷链送药使用该宝智达冷链送药账号信息(如昵称、头像、收货地址)进行统一管理
 				</view>
 			</view>
 			<view class="card_btn">

+ 1 - 0
pages/indexRouter.vue

@@ -48,6 +48,7 @@
 							this.getHomeList()
 						}
 					} else {
+						this.orderStatistics = {}
 						this.$cache.removeToken()
 						this.$cache.removeCache('userInfo')
 						uni.showToast({

+ 3 - 3
pages/login.vue

@@ -5,7 +5,7 @@
 		<view class="card_login">
 			<view class="card_head_logo">
 				<image class="mine_image" src="../static/logo.png" mode=""></image>
-				<view class="welcome_title">欢迎登录宝智达冷链运输</view>
+				<view class="welcome_title">欢迎登录宝智达冷链送药</view>
 			</view>
 			<u--form labelPosition="left" :model="formList" :rules="rules" ref="uForm">
 				<u-form-item label="账号" prop="username" labelWidth="50" borderBottom ref="item1">
@@ -41,7 +41,7 @@
 				</view>
 				<view class="agreement_title">我已阅读并同意<span class="protocol_title">《用户协议》</span>、<span
 						class="protocol_title">《隐私政策》</span>,
-					并授权宝智达气瓶使用该宝智达气瓶账号信息(如昵称、头像、收货地址)进行统一管理
+					并授权宝智达冷链送药使用该宝智达冷链送药账号信息(如昵称、头像、收货地址)进行统一管理
 				</view>
 			</view>
 			<view class="card_btn">
@@ -69,7 +69,7 @@
 					username: {
 						type: 'string',
 						required: true,
-						message: '请填写手机号',
+						message: '请填写号',
 						trigger: ['blur']
 					},
 					password: {

+ 13 - 12
pages/order/addWaybill.vue

@@ -90,17 +90,19 @@
 				this.goodsModel.tamperProofLabelImg = orderList.tamperProofLabelImg
 				this.goodsModel.remark = orderList.remark
 				this.goodsModel.id = orderList.id
-				let arrImg = orderList.tamperProofLabelImg.split(',')
-				let arrImgList = []
-				arrImg.forEach((item) => {
-					const arr = {
-						url: item,
-					}
-					arrImgList.push(arr)
-				})
-				this.$nextTick(() => {
-					this.$refs.goods.fileList1 = arrImgList
-				})
+				if (orderList.tamperProofLabelImg) {
+					let arrImg = orderList.tamperProofLabelImg.split(',')
+					let arrImgList = []
+					arrImg.forEach((item) => {
+						const arr = {
+							url: item,
+						}
+						arrImgList.push(arr)
+					})
+					this.$nextTick(() => {
+						this.$refs.goods.fileList1 = arrImgList
+					})
+				}
 			}
 		},
 		mounted() {
@@ -123,7 +125,6 @@
 						consigneeAddressDetails: this.recipientsModel.address,
 						...this.goodsModel,
 					}
-					console.log(params, 222)
 					uni.showLoading();
 					if (this.type == 1) {
 						// 添加订单

+ 4 - 4
pages/order/humiture.vue

@@ -18,8 +18,7 @@
 				</view>
 				<view v-show="item.collapseil">
 					<x-humiture ref="humiture" :taskId="item.id" :waybillNo="orderList.waybillNo"
-						:current="item.presentNum" :probeList="item.deviceSensorList"
-						@sectionChange="sectionChange"></x-humiture>
+						:current="item.presentNum" :probeList="item.deviceSensorList"></x-humiture>
 				</view>
 			</view>
 		</view>
@@ -61,9 +60,10 @@
 							if (item.coolerBox.id) {
 								item.title = item.coolerBox.name
 							}
-							if(item.deviceSensorList){
+							if (item.deviceSensorList) {
 								this.$nextTick(() => {
-									this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
+									this.$refs.humiture[index].getlist(item.deviceSensorList[0]
+										.T_id)
 								})
 							}
 						})

+ 9 - 1
pages/order/index.vue

@@ -8,7 +8,8 @@
 		</view>
 		<view class="card_order_mangement" v-if="orderList.length > 0">
 			<x-orderManagement :orderList="orderList" :userInfo="userInfo" @sendOrders="sendOrders"
-				@operateSuccessfully="operateSuccessfully"></x-orderManagement>
+				@operateSuccessfully="operateSuccessfully" @proofRenewal="proofRenewal"
+				:key="Math.random()"></x-orderManagement>
 			<view v-if="loadingMore" style="width: 50%;"><u-divider :text="loading"></u-divider></view>
 		</view>
 		<u-empty mode="order" marginTop="50" v-else></u-empty>
@@ -122,6 +123,12 @@
 					}
 				})
 			},
+			// 防拆更新
+			proofRenewal() {
+				this.currentPage = 1
+				this.orderList = []
+				this.getList()
+			},
 			// 派单
 			sendOrders(value) {
 				// console.log(value, 3333)
@@ -131,6 +138,7 @@
 			},
 			// 重新获取列表
 			operateSuccessfully() {
+				this.currentPage = 1
 				this.orderList = []
 				this.getList()
 			},

+ 17 - 22
pages/order/logisticsDetails.vue

@@ -2,19 +2,14 @@
 	<!-- 物流详情 -->
 	<view class="card_logist">
 		<u-navbar title="物流详情" autoBack placeholder></u-navbar>
-		<view style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
-			<map style="width: 100%;height: 100%;" id="container" :latitude="latitude" :longitude="longitude"
-				:scale="scale" :polyline="polylineList" :markers="markersList">
-				<view slot="loading">
-					<view class="loading-icon">加载中...</view>
-				</view>
-			</map>
-		</view>
+		<map style="width: 100%;height: 500rpx;z-index: 2" id="container" :latitude="latitude" :longitude="longitude"
+			:scale="scale" :polyline="polylineList" :markers="markersList">
+		</map>
 		<view class="card_logistics">
-			<view class="center_in img_head" @click="clickImg">
+			<!-- <view class="center_in img_head" @click="clickImg">
 				<u-image :class="logisticsFlag ? '' : 'overturn'" src="../../static/unfold.png" width="80rpx"
 					height="50rpx"></u-image>
-			</view>
+			</view> -->
 			<view v-if="logisticsFlag">
 				<view class="title_logistics">物流详情</view>
 				<view class="card_steps" :key="Math.random()" v-if="activitiesList.length > 0">
@@ -108,12 +103,14 @@
 						let arrList = []
 						if (arr.length > 0) {
 							arr.forEach(item => {
-								const arr1 = item.T_site.split(',')
-								const list = {
-									latitude: arr1[1],
-									longitude: arr1[0],
+								if (item.T_site != '0,0' && item.T_site) {
+									const arr1 = item.T_site.split(',')
+									const list = {
+										latitude: arr1[1],
+										longitude: arr1[0],
+									}
+									arrList.push(list)
 								}
-								arrList.push(list)
 							})
 
 							let polyline = [{
@@ -177,15 +174,13 @@
 	}
 
 	.card_logist ::v-deep .u-navbar__content {
-		z-index: 2024;
+		z-index: 2004;
 	}
 
 	.card_logistics {
-		position: absolute;
-		bottom: 0;
-		z-index: 2004;
-		width: calc(100% - 40rpx);
-		margin: 20rpx 20rpx 0rpx 20rpx;
+		// width: calc(100% - 40rpx);
+		// margin: 20rpx 20rpx 0rpx 20rpx;
+		width: 100%;
 		height: auto;
 		background-color: #fff;
 		border-top-right-radius: 10rpx;
@@ -198,7 +193,7 @@
 
 	.title_logistics {
 		font-weight: 600;
-		padding: 0rpx 20rpx 0rpx 20rpx;
+		padding: 30rpx 20rpx 0rpx 20rpx;
 	}
 
 	.card_steps {

+ 2 - 2
pages/order/orderDetails.vue

@@ -21,7 +21,7 @@
 						<u-tag :text="orderList.coolerBox.name" plain size="mini" type="success"></u-tag>
 					</view>
 				</view>
-				<view class="card_anti_dismantle">
+				<view class="card_anti_dismantle" v-if="orderList.tamperProofLabelImg">
 					<span>防拆标签图片:</span>
 					<view style="display: flex;">
 						<view style="margin-right: 20rpx;" v-for="(item,index) in getimagetamper(orderList)" :key="index">
@@ -29,7 +29,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="title_claim">
+				<view class="title_claim" v-if="orderList.tamperProofLabel">
 					<span>防拆标签码:</span>
 					<view style="width: auto;font-size: 28rpx;">
 						{{orderList.tamperProofLabel}}

BIN
static/logo.png