lilei 3 роки тому
батько
коміт
092b4ac2a3

+ 0 - 49
js_sdk/dc-clipboard/clipboard.js

@@ -1,49 +0,0 @@
-
-/**
- * 设置粘贴板数据
- * @param {String} text 要设置的字符串
- * 如果未设置参数,则清空数据
- */
-function setClipboardText(text){
-	try{
-	var os = plus.os.name;
-	text = text||'';
-	if('iOS' == os){
-		// var UIPasteboard  = plus.ios.importClass('UIPasteboard');  
-		// var pasteboard = UIPasteboard.generalPasteboard();  
-		// pasteboard.setValueforPasteboardType(text, 'public.utf8-plain-text');
-		var pasteboard = plus.ios.invoke('UIPasteboard', 'generalPasteboard');
-		plus.ios.invoke(pasteboard, 'setValue:forPasteboardType:', text, 'public.utf8-plain-text');
-	}else{
-		var main = plus.android.runtimeMainActivity();
-		// var Context = plus.android.importClass('android.content.Context');
-		// var clip = main.getSystemService(Context.CLIPBOARD_SERVICE);
-		var clip = main.getSystemService('clipboard');
-		plus.android.invoke(clip, 'setText', text);
-	}
-	}catch(e){
-		console.error('error @setClipboardText!!');
-	}
-}
-
-function getClipboardText(){
-	try{
-	var os = plus.os.name;
-	if('iOS' == os){
-		var pasteboard = plus.ios.invoke('UIPasteboard', 'generalPasteboard');
-		return plus.ios.invoke(pasteboard, 'valueForPasteboardType:', 'public.utf8-plain-text')
-	}else{
-		var main = plus.android.runtimeMainActivity();
-		var clip = main.getSystemService('clipboard');
-		return plus.android.invoke(clip, 'getText');
-	}
-	}catch(e){
-		console.error('error @getClipboardText!!');
-	}
-}
-
-
-module.exports = {
-	setText: setClipboardText,
-	getText: getClipboardText
-}

+ 1 - 15
pages.json

@@ -109,21 +109,7 @@
 		    "style" :                                                                                    
 		    {
 		        "navigationBarTitleText": "选择配件",
-		        "enablePullDownRefresh": false,
-				"app-plus":{
-					"titleNView": {
-						"titleAlign": "left",
-						"buttons": [ //原生标题栏按钮配置,
-							{
-								"text": "\ue6b5 联系汽配商" ,//原生标题栏增加分享按钮,点击事件可通过页面的 onNavigationBarButtonTap 函数进行监听
-								"fontSrc": "/static/iconfont/iconfont.ttf",
-								"fontSize": "14",
-								"width":"130px",
-								"color":"#00aaff"
-							}
-						]
-					}
-				}
+		        "enablePullDownRefresh": false
 		    }
 		}
 		,{

+ 27 - 26
pages/digitalShelf/choosePart.vue

@@ -14,6 +14,10 @@
 					<div class="copyText" @click="copyVin"><span>复制</span></div>
 				</div>
 			</div>
+			<div v-if="dealerPhone" style="text-align: center;width: 5em;" @click="callPhone()">
+				<u-icon size="18" name="phone" color="dodgerblue"></u-icon>
+				<view style="font-size: 0.6em;color: dodgerblue;"><text>联系汽配商</text></view>
+			</div>
 		</div>
 		<!-- 配件列表 -->
 		<div class="cpb_middle flex">
@@ -80,8 +84,11 @@
 						 </view>
 					</view>
 					<!-- 其它配件 -->
-					<view class="nav-right-title" style="margin-top: 20rpx;">其它配件</view>
-					<view class="nav-right-item flex" v-for="(item, index) in partList" :key="item.productSn">
+					<view class="nav-right-title flex align_center justify_between" @click="showOther=!showOther" style="margin-top: 20rpx;">
+						其它配件
+						<text>{{showOther?'隐藏':'展开'}}</text>
+					</view>
+					<view class="nav-right-item flex" v-if="showOther" v-for="(item, index) in partList" :key="item.productSn">
 						<view class="uni-col-2">
 							<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" @click="viewImg(item)" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image>
 						</view>
@@ -182,10 +189,10 @@
 
 <script>
 	import { getShelfProductList, getShelfProductType, queryPartCodeByVin, getShelfQueryList, saveShelfOrder } from '@/api/shelf'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	export default {
 		data() {
 			return {
+				showOther: false,
 				theme: '',
 				vinNumber: '',
 				leve2Data: [],  //  二级菜单数据
@@ -204,7 +211,6 @@
 				partListData: [], // 已选配件
 				vinPartList: [],
 				isIphoneXup: false,
-				dealerPhone: '',
 				saveLoading: false
 			}
 		},
@@ -218,6 +224,10 @@
 					ret = ret + item.qty
 				})
 				return ret
+			},
+			dealerPhone(){
+				const shelfInfo = this.$store.state.vuex_storeShelf
+				return shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
 			}
 		},
 		onLoad(opts) {
@@ -227,28 +237,17 @@
 			// 获取vin 对应code
 			this.getCarCodeByVin()
 		},
-		onReady() {
-			const shelfInfo = this.$store.state.vuex_storeShelf
-			this.dealerPhone = shelfInfo&&shelfInfo.contactMobile ? shelfInfo.contactMobile : ''
-			// #ifdef APP-PLUS
-			var webView = this.$mp.page.$getAppWebview();
-			if(this.dealerPhone==''){
-				webView.setTitleNViewButtonStyle(0,{text:"",color:"#FFFFFF"}); 
-			}
-			// #endif
-		},
-		// 点击导航栏按钮
-		onNavigationBarButtonTap() {
-			if(this.dealerPhone!=''){
-				uni.makePhoneCall({
-					phoneNumber: this.dealerPhone
-				})
-			}
-		},
 		onShow() {
 			this.$store.state.vuex_shelfChoosePart = []
 		},
 		methods: {
+			callPhone() {
+				if(this.dealerPhone!=''){
+					uni.makePhoneCall({
+						phoneNumber: this.dealerPhone
+					})
+				}
+			},
 			viewImg(item){
 				uni.previewImage({
 					urls: [item.images]
@@ -256,10 +255,8 @@
 			},
 			// 复制
 			copyVin(){
-				clipboard.setText(this.vinNumber);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: this.vinNumber||'',
 				})
 			},
 			// 格式化标签数据和配件分类数据一样
@@ -610,6 +607,10 @@
 				.nav-right-title{
 					font-weight: bold;
 					padding: 5upx 25upx;
+					> text{
+						color: #9E9E9E;
+						font-weight: normal;
+					}
 				}
 				.nav-right-item{
 					padding: 15upx 25upx;

+ 2 - 2
pages/digitalShelf/choosePartResult.vue

@@ -32,7 +32,7 @@
 					</view>
 					<view v-for="item in partList" :key="item.id" class="flex align-center item-list">
 						<view>
-							<u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
+							<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view>
 							<view class="item-name">
@@ -60,7 +60,7 @@
 					</view>
 					<view v-for="item in tempPartList" :key="item.id" class="flex align-center item-list">
 						<view>
-							<u-image border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
+							<u-image :src="item.images+'?x-oss-process=image/resize,m_fixed,h_120,w_120,color_ffffff'" border-radius="16" width="130" height="130" bg-color="#EBEBEB" ></u-image>
 						</view>
 						<view>
 							<view class="item-name">

+ 3 - 7
pages/digitalShelf/orderDetail.vue

@@ -106,7 +106,6 @@
 	import uniIcons from "@/components/uni-icons/uni-icons.vue"
 	import moment from 'moment'
 	import { findBySnShelfOrder, cancelShelfOrder, takeGoods } from '@/api/shelf.js'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	export default {
 	   name: 'orderDetail-digitalShel',
 	   components: {
@@ -144,10 +143,8 @@
 	   methods: {
 		   // 复制
 		   copyVin(){
-			clipboard.setText(this.info.vin);
-			uni.showToast({
-				icon: 'none',
-				title: 'vin码已复制成功'
+			uni.setClipboardData({
+				data: this.info.vin||'',
 			})
 		   },
 		 message(title){
@@ -221,7 +218,7 @@
 		  		title: '提示',
 		  		content: '确认取消取货单吗?',
 		  		success: (ret) => {
-		  		  if(ret.confirm||ret.index==0){
+		  		  if(ret.confirm){
 		  			  _this.delOrder()
 		  		  }
 		  		}
@@ -431,7 +428,6 @@
 				color: #585858;
 				font-size: 32rpx;
 				margin: 0 20rpx;
-				width: 320rpx;
 			}
 		}
 	}

+ 3 - 6
pages/digitalShelf/orderList.vue

@@ -61,7 +61,6 @@
 <script>
 	import carNo from '@/components/carNo.vue'
 	import { getShelfOrderList, cancelShelfOrder, shelfGetTotalWaitQty, takeGoods } from '@/api/shelf.js'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	import moment from 'moment'
 	export default {
 		components: {carNo},
@@ -110,10 +109,8 @@
 		methods:{
 			// 复制
 			copyVin(vin){
-				clipboard.setText(vin);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: vin||'',
 				})
 			},
 			message(title){
@@ -231,7 +228,7 @@
 					title: '提示',
 					content: '确认取消订单吗?',
 					success: (ret) => {
-					  if(ret.confirm||ret.index==0){
+					  if(ret.confirm){
 						  _this.delOrder(params.shelfOrderSn,index)
 					  }
 					}

+ 2 - 2
pages/digitalShelf/scanBarcode/scanBarcode.vue

@@ -107,7 +107,7 @@ export default {
 					  	title: '扫码成功',
 					  	content: '此单已全部扫码,是否确认取货?',
 					  	success: (ret) => {
-					  	  if(ret.confirm||ret.index==0){
+					  	  if(ret.confirm){
 					  		  this.outShelfOrder()
 					  	  }
 					  	}
@@ -141,7 +141,7 @@ export default {
 				content: msg,
 				confirmText:'继续扫码',
 				success: (ret) => {
-					if(ret.index == 0){
+					if(ret.confirm){
 						_this.scanCode()
 					}
 				}

+ 2 - 5
pages/digitalShelf/settlementRecord/orderPartDetail.vue

@@ -82,7 +82,6 @@
 
 <script>
 	import carNo from '@/components/carNo.vue'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	import {findBySnShelfOrder} from '@/api/shelf.js'
 	export default {
 		components: {carNo},
@@ -108,10 +107,8 @@
 		methods: {
 			// 复制
 			copyVin(vin){
-				clipboard.setText(vin);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: vin||'',
 				})
 			},
 			// 获取详情

+ 2 - 5
pages/digitalShelf/settlementRecord/settlementDetail.vue

@@ -63,7 +63,6 @@
 <script>
 	import carNo from '@/components/carNo.vue'
 	import uniIcons from '@/components/uni-icons/uni-icons.vue';
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	import { getShelfOrderList } from "@/api/shelf.js"
 	export default {
 		components: {
@@ -91,10 +90,8 @@
 		methods: {
 			// 复制
 			copyVin(vin){
-				clipboard.setText(vin);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: vin||'',
 				})
 			},
 			getUseRecord(pageNo){

+ 2 - 5
pages/digitalShelf/stockPut.vue

@@ -51,7 +51,6 @@
 
 <script>
 	import { getShelfReplenishBilllList } from '@/api/shelf'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	import moment from 'moment'
 	export default {
 		components: {},
@@ -93,10 +92,8 @@
 		methods:{
 			// 复制
 			copyVin(){
-				clipboard.setText(this.vinNumber);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: this.vinNumber||'',
 				})
 			},
 			message(title){

+ 2 - 5
pages/digitalShelf/stockPutDetail.vue

@@ -63,7 +63,6 @@
 	import uniIcons from "@/components/uni-icons/uni-icons.vue"
 	import moment from 'moment'
 	import { findShelfReplenishBill } from '@/api/shelf.js'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	export default {
 	   name: 'orderDetail-digitalShel',
 	   components: {
@@ -91,10 +90,8 @@
 	   methods: {
 		   // 复制
 		   copyVin(){
-			clipboard.setText(this.vinNumber);
-			uni.showToast({
-				icon: 'none',
-				title: 'vin码已复制成功'
+			uni.setClipboardData({
+				data: this.vinNumber||'',
 			})
 		   },
 		 message(title){

+ 2 - 5
pages/digitalShelf/tempOrderList/orderDetail.vue

@@ -83,7 +83,6 @@
 	import uniIcons from "@/components/uni-icons/uni-icons.vue"
 	import moment from 'moment'
 	import { getShelfTempBillDetail } from '@/api/shelf.js'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	export default {
 	   name: 'orderDetail-digitalShel',
 	   components: {
@@ -120,10 +119,8 @@
 	   methods: {
 		   // 复制
 		   copyVin(){
-			clipboard.setText(this.info.vin);
-			uni.showToast({
-				icon: 'none',
-				title: 'vin码已复制成功'
+			uni.setClipboardData({
+				data: this.info.vin||'',
 			})
 		   },
 		 message(title){

+ 9 - 9
pages/digitalShelf/tempOrderList/tempOrderList.vue

@@ -62,7 +62,6 @@
 <script>
 	import carNo from '@/components/carNo.vue'
 	import { getShelfTempBillList, shelfGetTotalWaitQty } from '@/api/shelf.js'
-	import clipboard from "@/js_sdk/dc-clipboard/clipboard.js"
 	import moment from 'moment'
 	export default {
 		components: {carNo},
@@ -110,10 +109,8 @@
 		methods:{
 			// 复制
 			copyVin(vin){
-				clipboard.setText(vin);
-				uni.showToast({
-					icon: 'none',
-					title: 'vin码已复制成功'
+				uni.setClipboardData({
+					data: vin||'',
 				})
 			},
 			message(title){
@@ -175,16 +172,19 @@
 			  if (pageNo) {
 			    this.pageNo = pageNo
 			  }
-			  // 状态条件
-			  const state = ['','WAIT','FINISH']
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
-				billState: state[this.swiperCurrent]
+			  }
+			  // 状态条件
+			  if(this.swiperCurrent == 1){
+				  params.billStateList = ['WAIT_AUDIT','AUDIT_REJECT','WAIT_OUT_WAREHOUSE']
+			  }
+			  if(this.swiperCurrent == 2){
+				  params.billStateList = ['FINISH']
 			  }
 			  this.status = "loading"
 			  getShelfTempBillList(params).then(res => {
-				  console.log(res,'++++++++++')
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				  if(_this.pageNo>1){
 					  _this.list = _this.list.concat(res.data.list || [])

+ 5 - 4
pages/index/index.vue

@@ -14,7 +14,7 @@
 				<view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有一笔保证金待支付 ¥{{bondRecord.bondAmount}}</view> <text>立即支付>></text>
 			</view>
 			<!-- 待取货提醒 -->
-			<view class="notices flex align_center" v-if="orderTodo" @click="toOrder">
+			<view class="notices flex align_center" v-if="!bondRecord&&orderTodo" @click="toOrder">
 				<view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有待取货的货架订单哦!</view> <text>立即处理>></text>
 			</view>
 			<!-- 名片 -->
@@ -26,7 +26,7 @@
 					</view>
 					<view>
 						<view v-if="!hasLogin" style="font-size: 40rpx;">
-							请点击登录/注册
+							请点击登录
 						</view>
 						<view v-else>
 							<view>{{userInfo.userNameCN}}</view>
@@ -44,7 +44,7 @@
 			</view>
 			<!-- 扫描记录 -->
 			<u-cell-group :border="false">
-				<u-cell-item title="扫描记录" @click="toAllRecord" :title-style="{fontSize:'1.1em'}" :value="hasLogin?'查看全部':''">
+				<u-cell-item title="VIN查询历史" @click="toAllRecord" :title-style="{fontSize:'1.1em'}" :value="hasLogin?'查看全部':''">
 					<u-icon slot="icon" size="38" v-if="hasLogin" color="#00aaff" style="margin-right: 0.3em;" name="order"></u-icon>
 				</u-cell-item>
 			</u-cell-group>
@@ -61,7 +61,7 @@
 				</view>
 			</u-cell-group>
 			<view class="des" v-if="vinList.length&&hasLogin">仅展示最近10条记录,点击“全部”查看更多</view>
-			<view class="des" v-if="!hasLogin">请登录后,查看扫描记录</view>
+			<view class="des" v-if="!hasLogin">请登录后查看历史记录</view>
 		</view>
 	</view>
 </template>
@@ -162,6 +162,7 @@
 				})
 			},
 			getVinLog(){
+				this.vinList  = []
 				this.status = "loading"
 				getScanVinLogList({pageNo:1,pageSize:10}).then(res => {
 					this.vinList = res.data.list || []

+ 14 - 0
pages/scan-frame/scan-frame.vue

@@ -37,6 +37,20 @@ export default {
   	const sysinfo = uni.getSystemInfoSync()
 	this.sysinfo = sysinfo
   },
+  onLoad() {
+  	uni.getSetting({
+  	   success(res) {
+  	      console.log(res.authSetting['scope.camera'])
+  		  if(!res.authSetting['scope.camera']){
+  			  uni.openSetting({
+  			    success(res) {
+  			      console.log(res.authSetting)
+  			    }
+  			  })
+  		  }
+  	   }
+  	})
+  },
   methods: {
 	// 手动输入
 	inputs(){