瀏覽代碼

接口调试

lilei 4 年之前
父節點
當前提交
be69ed1705

+ 1 - 1
api/taskItem.js

@@ -3,7 +3,7 @@ import axios from '@/libs/axios.js'
 export const getTaskItem = params => {
 export const getTaskItem = params => {
   return axios.request({
   return axios.request({
     url: `taskItem/${params.id}`,
     url: `taskItem/${params.id}`,
-    method: 'post'
+    method: 'get'
   })
   })
 }
 }
 // 删除任务项目
 // 删除任务项目

+ 2 - 2
api/taskTarget.js

@@ -1,6 +1,6 @@
 import axios from '@/libs/axios.js'
 import axios from '@/libs/axios.js'
 // 指标评论更新、拍照保存
 // 指标评论更新、拍照保存
-export const taskTargetSave = params => {
+export const taskCommentsSave = params => {
   return axios.request({
   return axios.request({
     url: `taskTarget/comments/save`,
     url: `taskTarget/comments/save`,
     method: 'post'
     method: 'post'
@@ -14,7 +14,7 @@ export const getTaskTargetById = params => {
   })
   })
 }
 }
 // 指标评分保存
 // 指标评分保存
-export const getTaskItem = params => {
+export const taskTargetSave = params => {
   return axios.request({
   return axios.request({
     url: `taskTarget/save`,
     url: `taskTarget/save`,
     method: 'post'
     method: 'post'

文件差異過大導致無法顯示
+ 1 - 0
hybrid/html/js/axios.min.js


+ 10 - 0
hybrid/html/video.html

@@ -6,6 +6,7 @@
 <title>远程巡店</title>
 <title>远程巡店</title>
 <script src="js/vue@2.6.11"></script>
 <script src="js/vue@2.6.11"></script>
 <script src="js/uni.webview.1.5.2.js"></script>
 <script src="js/uni.webview.1.5.2.js"></script>
+<script src="js/axios.min.js"></script>
 <!-- antd ui -->
 <!-- antd ui -->
 <script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
@@ -251,6 +252,15 @@
 			  console.log(type)
 			  console.log(type)
 			  this.xdType = type
 			  this.xdType = type
 		  },
 		  },
+		  // 获取任务详情
+		  getTaskDetail(data){
+			  alert(data)
+			  console.log(data,'111')
+		  },
+		  // 获取任务考评项
+		  getTaskItem(data){
+			  console.log(data,'222')
+		  },
 		  // 初始化播放器
 		  // 初始化播放器
 		  videoInit(){
 		  videoInit(){
 			  const _this = this
 			  const _this = this

+ 56 - 3
pages/shopTour/shopTour.vue

@@ -5,7 +5,11 @@
 </template>
 </template>
 
 
 <script>
 <script>
-	import { clzConfirm,saveBase64ToAliOss } from '@/libs/tools.js'
+	import { clzConfirm,saveBase64ToAliOss } from '@/libs/tools'
+	import {taskStart,submitTask,updateTaskItem,getTaskDetail} from '@/api/task'
+	import {getTaskItem,delTaskItem} from '@/api/taskItem.js'
+	import {taskTargetSave,getTaskTargetById,taskCommentsSave} from '@/api/taskTarget'
+	
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -13,7 +17,10 @@
 				isClose: false, // 是否关闭当前窗口
 				isClose: false, // 是否关闭当前窗口
 				isEditImg: false, // 是否正在编辑图片
 				isEditImg: false, // 是否正在编辑图片
 				showPz: false, // 是否正在拍照
 				showPz: false, // 是否正在拍照
-				types: 'scene', // 巡店类型,默认视频
+				types: 'video', // 巡店类型,video,scene
+				restart: '', // 是否重新巡店
+				taskId: '', // 任务id
+				storeId: '', // 门店id
 			};
 			};
 		},
 		},
 		methods: {
 		methods: {
@@ -58,10 +65,47 @@
 					// 更新编辑后的图片
 					// 更新编辑后的图片
 					_this.wv.evalJS("vm.updateItemImg('"+res.data+"')")
 					_this.wv.evalJS("vm.updateItemImg('"+res.data+"')")
 				})
 				})
+			},
+			// 开始巡店(重新开始),isNew 0 新建,1 重新开始
+			creatTask(isNew){
+				// 新建任务,只传门店id
+				let parms = {
+					storeId:this.storeId
+				}
+				// 重新开始,要传任务id
+				if(isNew){
+					parms.taskId = this.taskId
+				}
+				taskStart(parms).then(res => {
+					if(res.status == 200){
+						// 创建成功,查询任务明细
+						this.getTaskDetail()
+					}else{
+						uni.showToast({
+							icon:'none',
+							title: res.message
+						})
+					}
+				})
+			},
+			// 查询任务明细
+			getTaskDetail(){
+				// 任务详细内容
+				getTaskDetail({id:this.taskId}).then(res => {
+					this.wv.evalJS("vm.getTaskDetail('"+JSON.stringify(res.data)+"')")
+				})
+				// 任务考评项目明细
+				getTaskItem({id:this.taskId}).then(res => {
+					this.wv.evalJS("vm.getTaskItem('"+JSON.stringify(res.data)+"')")
+				})
 			}
 			}
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
-			// this.types = options.types
+			// 巡店类型,视频还时现场
+			this.types = options.types
+			this.taskId = options.taskId
+			this.storeId = options.storeId
+			this.restart = options.restart
 		},
 		},
 		onReady() {
 		onReady() {
 			let _this = this
 			let _this = this
@@ -72,6 +116,15 @@
 			 setTimeout(function() {
 			 setTimeout(function() {
 				_this.wv = currentWebview.children()[0]
 				_this.wv = currentWebview.children()[0]
 				_this.wv.evalJS("vm.setTyps('"+_this.types+"')")
 				_this.wv.evalJS("vm.setTyps('"+_this.types+"')")
+				if(_this.restart == 1){ // 重新开始
+					_this.creatTask(1)
+				}else if(_this.restart == 0){ // 继续上次巡店
+					//查询任务明细
+					_this.getTaskDetail()
+				}else{
+					// 首次新建
+					_this.creatTask(0)
+				}
 			 }, 500);
 			 }, 500);
 			// #endif
 			// #endif
 		},
 		},

+ 4 - 3
pages/videoShopTour/videoShopTour.vue

@@ -90,21 +90,22 @@
 							    content: '有进行中的巡店任务,是否继续?',
 							    content: '有进行中的巡店任务,是否继续?',
 								confirmText: '继续巡店',
 								confirmText: '继续巡店',
 								cancelText: '重新开始',
 								cancelText: '重新开始',
+								buttons: ['继续巡店','重新开始'],
 							    success: function (result) {
 							    success: function (result) {
 							        if (result.confirm || result.index==0) {  //  继续巡店
 							        if (result.confirm || result.index==0) {  //  继续巡店
 										uni.navigateTo({
 										uni.navigateTo({
-											url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&type=0'
+											url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&taskId='+ res.data.taskId + '&restart=0&types=video'
 										})
 										})
 							        }else{  //  重新开始
 							        }else{  //  重新开始
 										uni.navigateTo({
 										uni.navigateTo({
-											url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&type=1'
+											url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&taskId='+ res.data.taskId + '&restart=1&types=video'
 										})
 										})
 							        }
 							        }
 							    }
 							    }
 							})
 							})
 						}else{
 						}else{
 							uni.navigateTo({
 							uni.navigateTo({
-								url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&type=1'
+								url: '/pages/shopTour/shopTour?storeId=' + item.tenantId + '&types=video'
 							})
 							})
 						}
 						}
 					}else{
 					}else{

文件差異過大導致無法顯示
+ 0 - 0
unpackage/dist/dev/app-plus/app-config-service.js


+ 2 - 1
unpackage/dist/dev/app-plus/app-config.js

@@ -10,7 +10,7 @@
 /******/ 		var moduleId, chunkId, i = 0, resolves = [];
 /******/ 		var moduleId, chunkId, i = 0, resolves = [];
 /******/ 		for(;i < chunkIds.length; i++) {
 /******/ 		for(;i < chunkIds.length; i++) {
 /******/ 			chunkId = chunkIds[i];
 /******/ 			chunkId = chunkIds[i];
-/******/ 			if(installedChunks[chunkId]) {
+/******/ 			if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
 /******/ 				resolves.push(installedChunks[chunkId][0]);
 /******/ 				resolves.push(installedChunks[chunkId][0]);
 /******/ 			}
 /******/ 			}
 /******/ 			installedChunks[chunkId] = 0;
 /******/ 			installedChunks[chunkId] = 0;
@@ -46,6 +46,7 @@
 /******/ 				result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
 /******/ 				result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
 /******/ 			}
 /******/ 			}
 /******/ 		}
 /******/ 		}
+/******/
 /******/ 		return result;
 /******/ 		return result;
 /******/ 	}
 /******/ 	}
 /******/
 /******/

文件差異過大導致無法顯示
+ 3 - 3
unpackage/dist/dev/app-plus/app-service.js


文件差異過大導致無法顯示
+ 46 - 46
unpackage/dist/dev/app-plus/app-view.js


+ 10 - 0
unpackage/dist/dev/app-plus/hybrid/html/video.html

@@ -6,6 +6,7 @@
 <title>远程巡店</title>
 <title>远程巡店</title>
 <script src="js/vue@2.6.11"></script>
 <script src="js/vue@2.6.11"></script>
 <script src="js/uni.webview.1.5.2.js"></script>
 <script src="js/uni.webview.1.5.2.js"></script>
+<script src="js/axios.min.js"></script>
 <!-- antd ui -->
 <!-- antd ui -->
 <script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
 <script type="text/javascript" charset="utf-8" src="js/moment-with-locales.min.js"></script>
@@ -251,6 +252,15 @@
 			  console.log(type)
 			  console.log(type)
 			  this.xdType = type
 			  this.xdType = type
 		  },
 		  },
+		  // 获取任务详情
+		  getTaskDetail(data){
+			  alert(data)
+			  console.log(data,'111')
+		  },
+		  // 获取任务考评项
+		  getTaskItem(data){
+			  console.log(data,'222')
+		  },
 		  // 初始化播放器
 		  // 初始化播放器
 		  videoInit(){
 		  videoInit(){
 			  const _this = this
 			  const _this = this

文件差異過大導致無法顯示
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


文件差異過大導致無法顯示
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


部分文件因文件數量過多而無法顯示