imageAIVerifyErr.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <div class="imageAIVerifyErr">
  3. <el-dialog
  4. title="图像识别结果"
  5. :visible.sync="vanPopup"
  6. width="80%"
  7. :append-to-body="true"
  8. :show-close="false"
  9. :close-on-click-modal="false"
  10. custom-class="AIVerifyErrdialog">
  11. <div class="AIVerifyErrMask">
  12. <div class="contentAIVerify">
  13. <div class="AIVerify">{{ contentMessage }}</div>
  14. <div class="uploadImgAIVerify" @click="uploadImg" v-if="shopSignChange != 1">
  15. <div class="labelAIVerify"><span class="van-f-red-AIVerify">*</span>重新拍照上传</div>
  16. <div class="iconAIVerify">
  17. <van-icon class="photoAIVerify" name="photograph" size="22px" color="#969696" />
  18. </div>
  19. </div>
  20. </div>
  21. <div class="uploadBtnAIVerify" v-if="shotsNum >= 3 && shopSignChange != 1">
  22. <div class="tipsAIVerify">
  23. <!-- <div class="tipsAIVerify" @click="openTips"> -->
  24. <!-- <van-icon name="question-o" />上传后会有何影响 -->
  25. <van-icon name="question-o" />不规范的照片上传后会更换本店标准店招,未来每次拜访时校验。
  26. </div>
  27. <div class="confirmUploadAIVerify" @click="confirmUpload">仍要上传</div>
  28. </div>
  29. <div class="uploadBtnAIVerify" v-if="shopSignChange == 1">
  30. <div class="confirmUploadAIVerify" @click="uploadImg">重新拍照</div>
  31. <div class="changeImageAIVerify" @click="confirmUpload('isUpdate')">更换门店照</div>
  32. </div>
  33. <div class="historyImageAIVerify" v-if="shopSignChange == 1">
  34. <div class="initImage imageItemAIVerify" v-if="imageAIVerifyData.createStoreUrl">
  35. <img
  36. :src="imageAIVerifyData.createStoreUrl"
  37. width="100px"
  38. height="100px"
  39. @click="previewsImg(imageAIVerifyData.createStoreUrl)" />
  40. <span>建店时店招</span>
  41. </div>
  42. <div class="newestImage imageItemAIVerify" v-if="imageAIVerifyData.lastVisitUrl">
  43. <img
  44. :src="imageAIVerifyData.lastVisitUrl"
  45. width="100px"
  46. height="100px"
  47. @click="previewsImg(imageAIVerifyData.lastVisitUrl)" />
  48. <span>上次拜访店招</span>
  49. </div>
  50. <div class="presentImage imageItemAIVerify" v-if="imageAIVerifyData.url">
  51. <img
  52. :src="imageAIVerifyData.url"
  53. width="100px"
  54. height="100px"
  55. @click="previewsImg(imageAIVerifyData.url)" />
  56. <span>本次拜访店招</span>
  57. </div>
  58. </div>
  59. <div class="tipsRemarkAIVerify" v-if="shopSignChange == 1">
  60. <div>若历史照片拍摄不规范,请选择<span style="color: #81b337">更新门店照</span></div>
  61. <div>本次拜访店招会作为本店标准店招,未来每次拜访时校验</div>
  62. </div>
  63. </div>
  64. </el-dialog>
  65. </div>
  66. </template>
  67. <script>
  68. import store from '@/store';
  69. import { mapState } from 'vuex';
  70. export default {
  71. props: {
  72. imageAIVerifyFlag: {
  73. type: Boolean,
  74. default: false,
  75. },
  76. imageAIVerifyData: {
  77. type: [Array, Object],
  78. },
  79. source: {
  80. // 新建店还是门店拜访 visit/newCreated
  81. type: String,
  82. },
  83. },
  84. computed: {
  85. ...mapState({
  86. shotsNum: (state) => state.otheStore.shotsNum,
  87. }),
  88. },
  89. watch: {
  90. imageAIVerifyFlag: {
  91. handler(val) {
  92. console.log('imageAIVerifyFlag=' + val);
  93. if (val) this.initData();
  94. },
  95. immediate: true,
  96. },
  97. },
  98. data() {
  99. return {
  100. contentMessage: '', //提示内容
  101. vanPopup: true,
  102. shopSignChange: 0,
  103. };
  104. },
  105. methods: {
  106. initData() {
  107. // 图匠识别目的(1:店招内容识别,2:门店代码识别,3:调色机识别,4:更换店招)
  108. // shopSignChange 是否更换店招(0:未更换,1:更换) 1不一致,0一致
  109. // checkInfo 图片检查结果
  110. // cheatState 是否作弊(0:未作弊,1:作弊)
  111. // cheatType 作弊类型
  112. // qualifiedState 是否合格(0:不合格,1:合格)
  113. // unqualifiedReason 不合格原因
  114. let npkpiData =
  115. this.source == 'visit'
  116. ? this.imageAIVerifyData.npkpiData
  117. : this.imageAIVerifyData[0].npkpiData;
  118. // 照片和历史照片是否一致
  119. this.shopSignChange = npkpiData.shopSignChange;
  120. this.shopSignMatchList = npkpiData.shopSignMatchList;
  121. if (npkpiData.shopSignChange == 1) {
  122. this.contentMessage = '与历史照片不一致,请确认店招是否更换?';
  123. return;
  124. }
  125. // 照片是否合格
  126. if (npkpiData.checkInfo) {
  127. // 照片合格并且没有作弊
  128. if (npkpiData.checkInfo.qualifiedState == 1 && npkpiData.checkInfo.cheatState == 0) {
  129. this.close();
  130. this.$emit('normalFlow', { data: this.imageAIVerifyData });
  131. } else {
  132. // 失败次数增加超过三次特殊处理
  133. store.dispatch('setShotsNum', this.shotsNum + 1);
  134. // 不合格
  135. if (npkpiData.checkInfo.qualifiedState == 0) {
  136. this.contentMessage = this.contentMessage + npkpiData.checkInfo.unqualifiedReason;
  137. }
  138. // 作弊
  139. if (npkpiData.checkInfo.cheatState == 1) {
  140. this.contentMessage = this.contentMessage + npkpiData.checkInfo.cheatType;
  141. }
  142. }
  143. }
  144. },
  145. // 重新拍照
  146. uploadImg() {
  147. this.$emit('close');
  148. this.$emit('uploadImgFun');
  149. },
  150. // 仍要上传
  151. confirmUpload(isUpdate) {
  152. this.$emit('close');
  153. this.$emit('confirmUpload', {
  154. data: this.imageAIVerifyData,
  155. isUpdate: isUpdate ? 'true' : null,
  156. });
  157. },
  158. close() {
  159. this.$emit('close');
  160. },
  161. openTips() {
  162. this.$dialog
  163. .confirm({
  164. title: '提示',
  165. message: '不规范的照片上传后会更换本店标准店招,未来每次拜访时校验。',
  166. showCancelButton: false,
  167. className: 'openTips',
  168. overlayClass: 'openTipsMask',
  169. })
  170. .then(() => {});
  171. },
  172. previewsImg(url) {
  173. ImagePreview({
  174. images: [url],
  175. });
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="scss">
  181. .el-dialog__wrapper {
  182. z-index: 3333 !important;
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. background: rgba(0, 0, 0, 0.5) !important;
  187. .el-dialog__body {
  188. padding: 6px !important;
  189. }
  190. .el-dialog__header {
  191. text-align: center;
  192. }
  193. .AIVerifyErrdialog {
  194. width: 95% !important;
  195. margin-top: 1vh !important;
  196. border-radius: 8px !important;
  197. }
  198. .AIVerifyErrMask {
  199. width: 100%;
  200. padding: 8px;
  201. overflow: hidden;
  202. /* min-height: 180px; */
  203. }
  204. .van-popup {
  205. width: 90%;
  206. padding: 8px;
  207. border-radius: 8px;
  208. overflow: hidden;
  209. }
  210. .van-f-red-AIVerify {
  211. color: red;
  212. width: 8px;
  213. display: inline-block;
  214. line-height: 26px;
  215. }
  216. .photoAIVerify {
  217. /*margin-top: 9px;*/
  218. float: right;
  219. }
  220. .title {
  221. font-size: 16px;
  222. font-weight: 600;
  223. text-align: center;
  224. padding: 5px;
  225. }
  226. .contentAIVerify {
  227. .AIVerify {
  228. padding: 6px 0;
  229. font-size: 14px;
  230. color: red;
  231. text-align: center;
  232. border-top: 1px solid #ccc;
  233. }
  234. .uploadImgAIVerify {
  235. display: flex;
  236. align-items: center;
  237. justify-content: space-between;
  238. padding: 5px 0;
  239. border-top: 1px solid #ccc;
  240. .labelAIVerify {
  241. font-size: 14px;
  242. }
  243. }
  244. }
  245. .uploadBtnAIVerify {
  246. border-top: 1px solid #ccc;
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. padding: 8px 0;
  251. div {
  252. width: 40%;
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. font-size: 14px;
  257. color: #fff;
  258. border-radius: 6px;
  259. }
  260. .tipsAIVerify {
  261. font-size: 14px;
  262. color: red;
  263. /* white-space: nowrap; */
  264. }
  265. .confirmUploadAIVerify {
  266. background-color: red;
  267. padding: 8px 0;
  268. }
  269. .changeImageAIVerify {
  270. background-color: #81b337;
  271. padding: 8px 0;
  272. }
  273. }
  274. .historyImageAIVerify {
  275. display: flex;
  276. justify-content: space-between;
  277. padding: 5px 0;
  278. .imageItemAIVerify {
  279. width: 30%;
  280. display: flex;
  281. flex-direction: column;
  282. align-items: center;
  283. justify-content: center;
  284. span {
  285. font-size: 12px;
  286. }
  287. }
  288. }
  289. .tipsRemarkAIVerify {
  290. border-top: 1px solid #ccc;
  291. div {
  292. font-size: 12px;
  293. padding: 3px 0;
  294. }
  295. }
  296. }
  297. .openTipsMask,
  298. .openTips {
  299. z-index: 3334 !important;
  300. }
  301. </style>