xunCha.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="巡查" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view>
  5. <view class="xxxc_box">
  6. <view style="display: flex; align-items: center; font-size: 30rpx; font-weight: 600; color: #b75830; margin-bottom: 10rpx">
  7. <uni-icons type="sound" size="22" color="#b75830"></uni-icons>
  8. <view>任务公告</view>
  9. </view>
  10. <view>
  11. <view style="color: #90592a">
  12. <view class="">
  13. <text>{{ taskDetails.type_text || '暂无任务' }}:</text>
  14. <text>{{ taskDetails.desc }}</text>
  15. </view>
  16. <view v-if="taskDetails.progress != 0">巡查时间:{{ taskDetails.submit_time }}</view>
  17. </view>
  18. <view style="margin-top: 10rpx; font-size: 28rpx; color: #c0a991">请按任务要求填写巡查报告</view>
  19. </view>
  20. </view>
  21. <!-- <view class="map_tit">
  22. <image style="width: 186rpx; height: 40rpx" src="/static/img/right_img.png"></image>
  23. <view class="">文物监控</view>
  24. <image style="width: 186rpx; height: 40rpx" src="/static/img/left_img.png"></image>
  25. </view> -->
  26. <!-- 监控 -->
  27. <!-- <view class="jk_box">
  28. <view @click="openVideo('3e8744121f434332b057391d4ae682d8')" class="jk_item">
  29. <image :src="videoSrc + '3e8744121f434332b057391d4ae682d8' + '.jpg'" class="img"></image>
  30. </view>
  31. <view @click="openVideo('7c078920874f4bd9812224f44a2c8d02')" class="jk_item">
  32. <image :src="videoSrc + '7c078920874f4bd9812224f44a2c8d02' + '.jpg'" class="img"></image>
  33. </view>
  34. </view> -->
  35. <!-- <view class="gui-card-list gui-margin gui-margin-top gui-flex gui-rows gui-wrap gui-space-between">
  36. <view class="gui-card-item" hover-class="gui-tap" v-for="(item, index) in item.device_list" :key="index">
  37. <view class="gui-card-img" @click="openVideo(item.camera_index_code)">
  38. <gui-image :width="330" :height="180" :src="videoSrc + item.camera_index_code + '.jpg'" mode="aspectFit"></gui-image>
  39. </view>
  40. <text class="gui-card-title gui-block-text gui-text gui-primary-color">{{ item.name }}</text>
  41. </view>
  42. </view> -->
  43. </view>
  44. <!-- 线下巡查 -->
  45. <view class="map_tit">
  46. <image style="width: 186rpx; height: 40rpx" src="/static/img/right_img.png"></image>
  47. <view class="">巡查报告</view>
  48. <image style="width: 186rpx; height: 40rpx" src="/static/img/left_img.png"></image>
  49. </view>
  50. <view class="" style="width: 90%; margin: auto">
  51. <view class="" style="display: flex; align-items: center">
  52. <view class="dw" @click="dwBtn">
  53. <uni-icons type="location" size="18" color="#ffffff"></uni-icons>
  54. <view style="margin-left: 10rpx">签到</view>
  55. </view>
  56. <view v-if="longitude != ''" :style="{ color: dwShow ? '#07c160' : 'red' }" style="width: 340rpx; margin-left: 20rpx; font-size: 24rpx">
  57. 当前经纬度{{ longitude }},{{ latitude }}
  58. </view>
  59. <view v-else style="margin-left: 20rpx; color: rgba(68, 68, 68, 0.6)">请点击左侧签到按钮获取当前经纬度</view>
  60. </view>
  61. </view>
  62. <view class="zk_box">
  63. <view @click="AssetBtn(item)" class="zk_item" v-for="(item, index) in assetList" :key="item.id">
  64. <!-- 调整 -->
  65. <view class="top_box" style="">
  66. <view>
  67. <view v-if="item.image != ''">
  68. <image :src="item.image" style="width: 280rpx; height: 200rpx"></image>
  69. </view>
  70. <view v-else style="width: 280rpx; height: 200rpx">
  71. <image
  72. v-if="item.title == '文保牌'"
  73. src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/wbp2.png"
  74. style="width: 280rpx; height: 200rpx"
  75. ></image>
  76. <image v-else src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zwtp.png" style="width: 280rpx; height: 200rpx"></image>
  77. </view>
  78. </view>
  79. <view @click="AssetShow = true" class="" style="display: flex; align-items: center">
  80. <view style="margin-left: 20rpx">
  81. <view style="font-size: 32rpx; color: #444444; font-weight: 600">文物{{ item.type_text }}状况</view>
  82. <view style="height: 150rpx; overflow: scroll; margin-top: 20rpx; font-size: 28rpx; font-weight: 400; color: rgba(68, 68, 68, 0.6)">
  83. {{ item.type == 1 ? '文物本体' : item.title }}:{{ item.desc }}
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 调整 -->
  89. <view class="" style="margin-top: 30rpx; display: flex; justify-content: space-between">
  90. <view style="width: 100%; margin: auto">
  91. <!-- <Segmented activeColor="#EDA98E" :current="item.status" :target="item" :values="displayedItems" @clickItem="onClickItem" styleType="button"></Segmented> -->
  92. <!-- 默认选中未知 -->
  93. <Segmented activeColor="#c87d5a" :target="item" :values="displayedItems" @clickItem="onClickItem" styleType="button"></Segmented>
  94. <!-- 每项上传的照片 -->
  95. <view class="" style="display: flex; flex-wrap: wrap; justify-content: start; margin-top: 20rpx">
  96. <image
  97. @click="clickImg(item.extraImages, index2)"
  98. v-for="(item2, index2) in item.extraImages"
  99. :src="item2.url"
  100. :key="item2.index2"
  101. style="width: 210rpx; height: 120rpx; margin-left: 10rpx; margin-top: 10rpx"
  102. ></image>
  103. </view>
  104. <!-- 每项的描述 -->
  105. <!-- :style="{ height: item.describeVal != undefined ? '80rpx' : '0rpx' }" -->
  106. <view style="font-weight: normal; font-size: 30rpx; margin-top: 10rpx; line-height: 40rpx; color: rgba(68, 68, 68, 0.6)">
  107. {{ item.describeVal || '' }}
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <u-popup :show="show" @close="close" mode="center" :closeable="true" bgColor="#f9dbbf" round="5">
  114. <view class="pop_box">
  115. <view v-if="normal">
  116. <view style="display: flex; align-items: center">
  117. <view style="margin-top: 20rpx">事件类型</view>
  118. <view class="lx" @click="showType = true" :style="{ color: Evtsituation ? '#000000' : '' }">
  119. {{ Evtsituation ? Evtsituation : '点击选择类型' }}
  120. <u-icon name="arrow-down" color="#d67b54" size="20"></u-icon>
  121. </view>
  122. </view>
  123. <view style="display: flex; align-items: center">
  124. <view style="margin-top: 20rpx">事件等级</view>
  125. <view class="lx" @click="showPicker = true" :style="{ color: Evtsituation ? '#000000' : '' }">
  126. {{ situation ? situation : '点击选择等级' }}
  127. <u-icon name="arrow-down" color="#d67b54" size="20"></u-icon>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="tit_box">
  132. <view class="title" style="margin-top: -120rpx; margin-right: 70rpx" :class="{ miaoshu: !normal }">描述</view>
  133. <u--textarea v-model.trim="describeVal" count></u--textarea>
  134. </view>
  135. <!-- 图片 -->
  136. <view style="height: 400rpx; overflow: scroll">
  137. <!-- 上传照片 -->
  138. <view>
  139. <SCimage :fileList="fileList" @childEvent="handleChildEvent"></SCimage>
  140. </view>
  141. </view>
  142. <view class="zque" @click="isOk">确认</view>
  143. </view>
  144. </u-popup>
  145. <!-- 事件类型 -->
  146. <u-picker :show="showType" keyName="title" @cancel="showType = false" :columns="Evtcolumns" @close="close" :closeOnClickOverlay="true" @confirm="evtConfirm"></u-picker>
  147. <!-- 事件等级 -->
  148. <u-picker :show="showPicker" keyName="title" @cancel="showPicker = false" :columns="columns" @close="close" :closeOnClickOverlay="true" @confirm="confirm"></u-picker>
  149. <!-- 文物资产详情 -->
  150. <u-popup :show="AssetShow" @close="close" mode="center" :closeable="true" bgColor="#f9dbbf" round="5">
  151. <view class="pop_box">
  152. <view style="text-align: center; margin-right: 20rpx; margin-bottom: 20rpx; font-size: 32rpx">{{ assetDetails.title }}</view>
  153. <view>状况:{{ assetDetails.status_text }}</view>
  154. <view>位置:{{ assetDetails.position ? assetDetails.position : '暂未显示' }}</view>
  155. <view>
  156. <image style="width: 180rpx; height: 140rpx" :src="assetDetails.image"></image>
  157. </view>
  158. </view>
  159. </u-popup>
  160. <view class="tjxc" @click="submitTo">提交巡查</view>
  161. </view>
  162. </template>
  163. <script>
  164. var md5 = require('@/common/md5.js');
  165. let that;
  166. export default {
  167. data() {
  168. return {
  169. dwShow: true,
  170. position: '',
  171. longitude: '',
  172. latitude: '',
  173. showType: false,
  174. distance: null /* 判断用户距离 */,
  175. cr_id: '' /* 文物id */,
  176. cr_code: '' /* 文物编号 */,
  177. videoSrc: 'https://huli-app.wenlvti.net/map_source/static/images/video/',
  178. taskDetails: {} /* 任务详情 */,
  179. taskId: '' /* 任务id */,
  180. submitStatuso: '' /* 任务状态*/,
  181. eventTypeId: '' /* 异常事件类型id */,
  182. stateId: '' /* 状态id */,
  183. items: [{ title: '未知' }, { title: '正常', status: 1 }, { title: '异常', status: 2 }],
  184. displayedItems: [],
  185. current: 0,
  186. assetList: [] /* 资产列表 */,
  187. postList: [],
  188. assetDetails: {} /* 资产详情 */,
  189. AssetShow: false,
  190. normal: false,
  191. describeVal: '',
  192. show: false,
  193. showPicker: false,
  194. situation: '',
  195. Evtsituation: '',
  196. // 弹层Tab
  197. popTab: [],
  198. columns: [
  199. [
  200. {
  201. title: '一般',
  202. id: 1
  203. },
  204. {
  205. title: '较大',
  206. id: 2
  207. },
  208. {
  209. title: '重大',
  210. id: 3
  211. },
  212. {
  213. title: '非常重大',
  214. id: 4
  215. }
  216. ]
  217. ],
  218. Evtcolumns: [],
  219. // 上传的图片
  220. fileList: []
  221. };
  222. },
  223. onLoad(o) {
  224. console.log(o, 'ooo');
  225. that = this;
  226. this.taskId = o.id; /* 任务id */
  227. this.cr_id = o.cr_id; /* 文物id */
  228. this.cr_code = o.cr_code;
  229. this.submitStatuso = o.submit_statuso; /* 提交的任务状态 */
  230. // 处理状态
  231. this.displayedItems = this.items.map((item) => item.title);
  232. this.getPatrolTaskDetails(o.id);
  233. this.loadGlobalFont();
  234. },
  235. methods: {
  236. // 监控
  237. // openVideo(camera_index_code) {
  238. // console.log(camera_index_code);
  239. // var t = Date.parse(new Date()) / 1000;
  240. // var key = md5.md5(t + '@feichenghuli');
  241. // this.webViedoUrl = encodeURIComponent('https://wenwu.16fw.cn/hik_monitor/mobile_monitor.html?t=' + t.toString() + '&key=' + key + '&index_code=' + camera_index_code);
  242. // console.log(this.webViedoUrl);
  243. // this.$common.navigateTo('/shouhu_fenbao/shouHu/webview?url=' + this.webViedoUrl);
  244. // return;
  245. // },
  246. // 打卡
  247. dwBtn() {
  248. uni.getLocation({
  249. type: 'gcj02',
  250. success: function (data) {
  251. that.$api.distanceCheck({ cr_id: that.cr_id, longitude: data.longitude, latitude: data.latitude }, function (res) {
  252. if (res.data === false && res.code == 0) {
  253. that.dwShow = false;
  254. that.longitude = data.longitude;
  255. that.latitude = data.latitude;
  256. that.$common.errorToShow(res.msg);
  257. console.log(res, '不是特殊文物距离过远');
  258. } else {
  259. that.longitude = data.longitude;
  260. that.latitude = data.latitude;
  261. that.$common.successToShow('签到成功');
  262. // console.log('当前位置的经度:' + res.longitude);
  263. // console.log('当前位置的纬度:' + res.latitude);
  264. }
  265. });
  266. },
  267. fail: function (res) {
  268. //1.2 拒绝授权
  269. uni.showModal({
  270. content: '检测到您没打开获取位置权限,是否去设置打开?',
  271. confirmText: '确认',
  272. cancelText: '取消',
  273. success: (res) => {
  274. if (res.confirm) {
  275. uni.openSetting({
  276. success: (res) => {
  277. console.log(res);
  278. uni.getLocation();
  279. }
  280. });
  281. } else {
  282. // console.log('取消');
  283. return false;
  284. }
  285. }
  286. });
  287. }
  288. });
  289. },
  290. // 接受子组件上传的图片
  291. handleChildEvent(data) {
  292. // console.log('Received data from child component:', data);
  293. this.fileList = data;
  294. },
  295. // 任务详情
  296. getPatrolTaskDetails(id) {
  297. this.$api.getPatrolTaskDetails({ main_body_id: 1, task_id: id, cr_id: this.cr_id }, function (res) {
  298. // console.log(res, '任务详情');
  299. that.taskDetails = res.data;
  300. that.cr_id = that.taskDetails.cr_id;
  301. that.cr_code = that.taskDetails.cr_code;
  302. that.taskId = that.taskDetails.id;
  303. that.getCrProperty();
  304. });
  305. },
  306. // 文物资产列表
  307. getCrProperty() {
  308. this.$api.getCrProperty({ main_body_id: 1, cr_id: this.cr_id }, function (res) {
  309. // console.log(res, 'resres');
  310. if (res.code === 1) {
  311. // that.assetList = res.data;
  312. let alist = res.data;
  313. that.taskDetails.patrolTaskAnnexList.forEach((requestItem, index) => {
  314. // console.log(alist, '999999');
  315. alist.forEach((item, i) => {
  316. if (item.id == requestItem.property_id) {
  317. // console.log(item, '3333333333');
  318. // console.log(alist[i], '1111111111');
  319. alist[i].describeVal = requestItem.desc;
  320. alist[i].extraImages = [];
  321. requestItem.images.forEach((img, imgidx) => {
  322. alist[i].extraImages.push({ url: img });
  323. });
  324. alist[i].status_text = requestItem.status_text;
  325. }
  326. });
  327. });
  328. that.assetList = alist;
  329. that.postList = { main_body_id: 1, task_id: that.taskId, submit_status: that.submitStatuso, property_list: [] };
  330. } else {
  331. console.log(res.msg);
  332. }
  333. });
  334. },
  335. // 状态事件
  336. onClickItem(e) {
  337. // console.log(e, '修改w');
  338. this.assetDetails = e.target;
  339. // console.log(this.assetDetails, 'item');
  340. this.stateId = e.currentIndex;
  341. var tarIndex = -1;
  342. for (var i = 0; i < this.postList.property_list.length; i++) {
  343. if (this.postList.property_list[i].id == this.assetDetails.id) {
  344. tarIndex = i;
  345. // console.log(this.postList.property_list[i], '11111111');
  346. }
  347. }
  348. if (tarIndex >= 0) {
  349. console.log(this.postList.property_list[tarIndex]);
  350. this.fileList = this.postList.property_list[tarIndex].images;
  351. } else {
  352. // 关闭弹层将相关内容清空
  353. if (typeof this.assetDetails.extraImages != 'undefined') {
  354. this.fileList = [...this.assetDetails.extraImages];
  355. } else {
  356. this.fileList = [];
  357. }
  358. this.describeVal = '';
  359. this.situation = '';
  360. this.situationId = '';
  361. this.eventTypeId = '';
  362. this.Evtsituation = '';
  363. }
  364. if (this.items[e.currentIndex].title === '异常') {
  365. // 文物分类列表
  366. this.describeVal = '';
  367. this.$api.getCulturalRelicCategory({ main_body_id: 1, type: 42 }, function (res) {
  368. // console.log(res, '事件类型');
  369. that.Evtcolumns = [res.data];
  370. });
  371. // 弹层
  372. this.show = true;
  373. // 异常弹层布局
  374. this.normal = true;
  375. } else if (this.items[e.currentIndex].title === '正常') {
  376. this.show = true;
  377. // this.describeVal = '未发现异常';
  378. }
  379. },
  380. // 文物资产项
  381. AssetBtn(item) {
  382. this.assetDetails = item;
  383. this.describeVal = item.describeVal;
  384. // console.log(this.assetDetails, 'this.assetDetails');
  385. },
  386. // 弹层确认
  387. isOk() {
  388. this.describeVal = this.describeVal;
  389. // console.log(this.items[this.stateId].status, '状态');
  390. // 文物本体
  391. var tarIndex = -1;
  392. for (var i = 0; i < this.postList.property_list.length; i++) {
  393. if (this.postList.property_list[i].id == this.assetDetails.id) {
  394. tarIndex = i;
  395. }
  396. }
  397. if (tarIndex < 0) {
  398. this.postList.property_list.push({
  399. id: this.assetDetails.id,
  400. images: [],
  401. desc: '',
  402. event_level: '',
  403. event_type: '',
  404. status: this.normal ? 2 : 1
  405. });
  406. tarIndex = this.postList.property_list.length - 1;
  407. }
  408. this.postList.property_list[tarIndex].images = this.fileList;
  409. this.postList.property_list[tarIndex].desc = this.describeVal;
  410. this.postList.property_list[tarIndex].event_level = this.situationId;
  411. this.postList.property_list[tarIndex].event_type = this.eventTypeId;
  412. // 检查描述和图片是否已填写
  413. for (var i = 0; i < this.postList.property_list.length; i++) {
  414. let property = this.postList.property_list[i];
  415. // 检查描述是否已填写
  416. if (!property.desc || property.desc.trim() === '') {
  417. // 新加
  418. if (this.normal) {
  419. this.$common.errorToShow('请填写问题描述');
  420. } else {
  421. this.describeVal = '未发现异常';
  422. }
  423. // this.$common.errorToShow('请填写问题描述');
  424. return;
  425. }
  426. // 检查是否有至少一张图片
  427. if (property.images.length === 0) {
  428. this.$common.errorToShow('请上传图片');
  429. return;
  430. }
  431. }
  432. // 检查描述和图片是否已填写end
  433. this.show = false;
  434. this.normal = false;
  435. // console.log('kkk', this.postList); /* 参数 */
  436. // console.log('上传的照片66', this.fileList); /* 照片 */
  437. let arr = [];
  438. //显示每项上传的图片, 遍历this.fileList,为每个项创建包含url属性的对象,并推送到新数组
  439. this.assetList.forEach((obj) => {
  440. if (!obj.extraImages) {
  441. obj.extraImages = [];
  442. }
  443. const uniqueUrls = new Set();
  444. const deduplicatedExtraImages = [];
  445. obj.extraImages.forEach((imageObj) => {
  446. const url = imageObj.url;
  447. if (!uniqueUrls.has(url)) {
  448. uniqueUrls.add(url);
  449. deduplicatedExtraImages.push(imageObj);
  450. }
  451. });
  452. obj.extraImages = deduplicatedExtraImages;
  453. });
  454. this.assetList.forEach((obj) => {
  455. if (obj.id === this.assetDetails.id) {
  456. this.postList.property_list.forEach((item) => {
  457. obj.describeVal = item.desc;
  458. });
  459. // 遍历this.fileList,为每个项创建包含url属性的对象,检查其是否已存在于obj.extraImages中,
  460. // 若不存在则推送到obj.extraImages
  461. this.fileList.forEach((fileItem) => {
  462. const url = fileItem.url;
  463. const isDuplicate = obj.extraImages.some((imageObj) => imageObj.url === url);
  464. if (!isDuplicate) {
  465. obj.extraImages.push({ url });
  466. }
  467. });
  468. }
  469. });
  470. // console.log(this.assetList, '每项添加照片和描述');
  471. },
  472. // 提交巡查
  473. submitTo() {
  474. // 判断图片和描述有没有填写
  475. let allItemsValid = true;
  476. let incompleteItems = []; // 用于存储需要完善信息的文物类型
  477. this.assetList.forEach((item) => {
  478. const hasExtraImages = item.hasOwnProperty('extraImages') && item.extraImages !== null && item.extraImages !== undefined;
  479. const hasDescribeVal = item.hasOwnProperty('describeVal') && item.describeVal !== null && item.describeVal !== undefined;
  480. if (!hasExtraImages || !hasDescribeVal) {
  481. incompleteItems.push(item.type_text); // 将需要完善信息的文物类型添加到数组中
  482. allItemsValid = false; // 遇到不符合条件的对象时,标记为不通过
  483. }
  484. });
  485. if (allItemsValid) {
  486. // 需要移除的域名
  487. const domainToRemove = 'https://meng.wenlvti.net';
  488. if (this.postList && Array.isArray(this.postList.property_list)) {
  489. for (const property of this.postList.property_list) {
  490. if (property.images && Array.isArray(property.images)) {
  491. for (const imageObj of property.images) {
  492. if (imageObj.url && imageObj.url.startsWith(domainToRemove)) {
  493. imageObj.url = imageObj.url.substring(domainToRemove.length);
  494. }
  495. }
  496. }
  497. }
  498. }
  499. // 需要移除的域名end
  500. let mypost = JSON.parse(JSON.stringify(this.postList));
  501. for (var i = 0; i < this.postList.property_list.length; i++) {
  502. let images = '';
  503. for (var j = 0; j < this.postList.property_list[i].images.length; j++) {
  504. if (images == '') images += this.postList.property_list[i].images[j].url;
  505. else images += ',' + this.postList.property_list[i].images[j].url;
  506. }
  507. mypost.property_list[i].images = images;
  508. }
  509. mypost.property_list = JSON.stringify(mypost.property_list);
  510. console.log(mypost, '提交参数');
  511. // 获取位置判断距离文物多远,不是特殊文物需判断距离
  512. if (that.assetList[0].is_special === 0) {
  513. uni.getLocation({
  514. type: 'gcj02',
  515. success: function (res) {
  516. that.position = res.longitude + ',' + res.latitude;
  517. mypost.position = that.position;
  518. // console.log(mypost, '提交参数22222222');
  519. // console.log(that.position, '提交位置');
  520. that.$api.distanceCheck({ cr_id: that.cr_id, longitude: res.longitude, latitude: res.latitude }, function (res) {
  521. if (res.data === false && res.code == 0) {
  522. that.$common.errorToShow(res.msg);
  523. console.log(res, '不是特殊文物距离过远');
  524. } else {
  525. console.log(res, '不是特殊文物距离ok');
  526. that.$api.submitTask(mypost, function (res) {
  527. if (res.code == 1) {
  528. // console.log(res, '提交成功');
  529. that.$common.successToShow('提交成功');
  530. setTimeout(() => {
  531. uni.switchTab({
  532. url: '/pages/shouhu/shouhu'
  533. });
  534. }, 1000);
  535. } else {
  536. that.$common.errorToShow('请稍后再试');
  537. }
  538. });
  539. }
  540. });
  541. },
  542. fail: function (err) {
  543. console.log(err, '定位失败');
  544. }
  545. });
  546. } else {
  547. // 特殊文物不用判断距离
  548. console.log('特殊文物不用判断距离');
  549. that.$api.submitTask(mypost, function (res) {
  550. if (res.code == 1) {
  551. // console.log(res, '提交成功');
  552. that.$common.successToShow('提交成功');
  553. setTimeout(() => {
  554. uni.switchTab({
  555. url: '/pages/shouhu/shouhu'
  556. });
  557. }, 1000);
  558. } else {
  559. that.$common.errorToShow('请稍后再试');
  560. }
  561. });
  562. }
  563. } else {
  564. const message = `请完善文物${incompleteItems.join(', ')}巡查信息`;
  565. that.$common.errorToShow(message);
  566. }
  567. },
  568. confirm(e) {
  569. // console.log('confirm', e);
  570. this.situation = e.value[0].title;
  571. this.situationId = e.value[0].id;
  572. this.showPicker = false;
  573. },
  574. evtConfirm(e) {
  575. console.log('confirm', e);
  576. this.Evtsituation = e.value[0].title;
  577. this.eventTypeId = e.value[0].id;
  578. this.showType = false;
  579. },
  580. // 历史记录
  581. jiluBtn() {
  582. uni.navigateTo({
  583. url: '/shouhu_fenbao/xunCha/jiLu'
  584. });
  585. },
  586. // 图片预览
  587. clickImg(item, i) {
  588. let img = [];
  589. item.forEach((item) => {
  590. img.push(item.url);
  591. });
  592. uni.previewImage({
  593. urls: img, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  594. current: img[i] // 当前显示图片的http链接,默认是第一个
  595. });
  596. },
  597. close() {
  598. this.show = false;
  599. this.showPicker = false;
  600. this.normal = false;
  601. this.AssetShow = false;
  602. this.showType = false;
  603. },
  604. // 加载字体
  605. loadGlobalFont() {
  606. try {
  607. uni.loadFontFace({
  608. family: 'MyGlobalFont', // 自定义字体名
  609. source: 'url("https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/songTi.ttf")',
  610. success() {
  611. console.log('全局字体加载成功');
  612. }
  613. });
  614. } catch (error) {
  615. console.error('全局字体加载异常', error);
  616. }
  617. }
  618. }
  619. };
  620. </script>
  621. <style>
  622. .box {
  623. min-height: 100%;
  624. height: auto;
  625. width: 100%;
  626. padding-bottom: 50rpx;
  627. /* background-color: #fff9e9; */
  628. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xy_bgt.png');
  629. background-repeat: repeat-y;
  630. background-size: 100% 100%;
  631. font-family: 'MyGlobalFont';
  632. }
  633. .u-textarea__field.data-v-09988a29 {
  634. color: #000000 !important;
  635. }
  636. .u-textarea.data-v-09988a29 {
  637. background-color: #f1bd8e !important;
  638. }
  639. .active {
  640. color: #fae5bb !important;
  641. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit1.png') !important;
  642. }
  643. /deep/.u-textarea.data-v-09988a29 {
  644. background-color: #f1bd8e !important;
  645. border-radius: 0;
  646. }
  647. /deep/.u-textarea.data-v-09988a29 {
  648. background-color: #f1bd8e !important;
  649. }
  650. .tab_active {
  651. background-color: #b75830 !important;
  652. }
  653. .u-textarea__count.data-v-09988a29 {
  654. background-color: transparent !important;
  655. }
  656. .u-upload__button.data-v-69e2a36e {
  657. background-color: #f1bd8e !important;
  658. }
  659. .dw {
  660. display: flex;
  661. align-items: center;
  662. width: 160rpx;
  663. height: 80rpx;
  664. color: #ffffff;
  665. line-height: 80rpx;
  666. font-size: 28rpx;
  667. border-radius: 10rpx;
  668. justify-content: center;
  669. background-color: #c87d5a;
  670. }
  671. .filter-box {
  672. padding: 30upx 50upx 0 50upx;
  673. margin-bottom: 30upx;
  674. display: flex;
  675. align-items: center;
  676. justify-content: space-between;
  677. }
  678. .miaoshu {
  679. margin-top: -260rpx !important;
  680. margin-right: 0 !important;
  681. }
  682. .filter-box .b-item {
  683. width: 278rpx;
  684. height: 80rpx;
  685. font-size: 30rpx;
  686. color: #ffefc4;
  687. font-weight: 600;
  688. text-align: center;
  689. line-height: 80rpx;
  690. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit2.png');
  691. background-size: 100% 100%;
  692. }
  693. .map_tit {
  694. display: flex;
  695. align-items: center;
  696. margin-left: 125rpx;
  697. margin-top: 50rpx;
  698. margin-bottom: 20rpx;
  699. font-size: 36rpx;
  700. font-weight: 900;
  701. line-height: 52rpx;
  702. color: #444444;
  703. }
  704. .map_tit2 {
  705. position: relative;
  706. top: -176rpx;
  707. }
  708. .jk_box {
  709. display: flex;
  710. flex-wrap: wrap;
  711. justify-content: space-between;
  712. width: 90%;
  713. margin: auto;
  714. }
  715. .img {
  716. width: 100%;
  717. height: 100%;
  718. }
  719. .jk_item {
  720. width: 310rpx;
  721. height: 230rpx;
  722. margin-top: 40rpx;
  723. }
  724. .zk_box {
  725. width: 90%;
  726. margin: auto;
  727. margin-top: 30rpx;
  728. }
  729. .zk_item {
  730. /* justify-content: space-between;
  731. display: flex; */
  732. font-size: 30rpx;
  733. font-weight: 600;
  734. margin-top: 40rpx;
  735. }
  736. .zk_item2 {
  737. display: block !important;
  738. font-size: 30rpx;
  739. font-weight: 600;
  740. margin-top: 40rpx;
  741. }
  742. .tjxc {
  743. width: 670rpx;
  744. height: 88rpx;
  745. margin: auto;
  746. font-size: 32rpx;
  747. font-weight: 600;
  748. color: #fef3e1;
  749. margin-top: 50rpx;
  750. line-height: 82rpx;
  751. text-align: center;
  752. background-color: #c87d5a;
  753. }
  754. .pop_box {
  755. width: 635rpx;
  756. padding: 80rpx 40rpx 40rpx 40rpx;
  757. font-size: 30rpx;
  758. font-weight: 600;
  759. }
  760. .pop_item {
  761. height: 60rpx;
  762. border-radius: 10rpx;
  763. text-align: center;
  764. padding: 10rpx;
  765. border: 2rpx solid #d67b54;
  766. }
  767. .lx {
  768. display: flex;
  769. justify-content: space-between;
  770. width: 410rpx;
  771. height: 70rpx;
  772. margin: auto;
  773. margin-top: 30rpx;
  774. border: 2rpx solid #d67b54;
  775. border-radius: 10rpx;
  776. line-height: 70rpx;
  777. padding-left: 20rpx;
  778. padding-right: 20rpx;
  779. color: #7b6d67;
  780. }
  781. .tit_box {
  782. width: 540rpx;
  783. display: flex;
  784. justify-content: space-between;
  785. align-items: center;
  786. margin-top: 40rpx;
  787. }
  788. .tit_box2 {
  789. width: 630rpx;
  790. display: flex;
  791. justify-content: space-between;
  792. align-items: center;
  793. margin-top: 40rpx;
  794. margin-left: 80rpx;
  795. }
  796. .zque {
  797. width: 260rpx;
  798. height: 70rpx;
  799. margin: auto;
  800. text-align: center;
  801. line-height: 70rpx;
  802. color: #ffffff;
  803. background-color: #c87d5a;
  804. border-radius: 10rpx;
  805. }
  806. .xxxc_box {
  807. /* height: 400rpx; */
  808. margin: auto;
  809. padding: 50rpx 70rpx 80rpx 90rpx;
  810. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xxxc_top.png');
  811. background-size: 100% 100%;
  812. }
  813. .wwmc {
  814. display: flex;
  815. align-items: center;
  816. justify-content: space-around;
  817. }
  818. .wwmc_left {
  819. display: flex;
  820. align-items: center;
  821. justify-content: space-around;
  822. width: 250rpx;
  823. height: 60rpx;
  824. line-height: 60rpx;
  825. background-color: #f1bd8e;
  826. border-radius: 10rpx;
  827. font-size: 30rpx;
  828. }
  829. .wwmc_right {
  830. width: 250rpx;
  831. height: 60rpx;
  832. text-align: center;
  833. line-height: 60rpx;
  834. background-color: #f1bd8e;
  835. border-radius: 6rpx;
  836. font-size: 30rpx;
  837. }
  838. .wwmc_right2 {
  839. width: 250rpx;
  840. height: 60rpx;
  841. text-align: center;
  842. /* line-height: 60rpx; */
  843. background-color: #f1bd8e;
  844. border-radius: 6rpx;
  845. font-size: 30rpx;
  846. }
  847. .top_box {
  848. padding: 20rpx;
  849. width: 100%;
  850. margin: auto;
  851. display: flex;
  852. border: 2rpx solid #ebc9a9;
  853. background-color: #fefdfb;
  854. }
  855. </style>