message_error.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view class="wrap">
  3. <view class="error_class_header">
  4. <view class="error_title">请选择<view class="line"></view></view>
  5. </view>
  6. <view class="select">
  7. <view class="now_select"@tap="showSelect"><view class="iconfont header_bottom"></view>{{message}}</view>
  8. <!-- 下拉选择框 -->
  9. <view :class="['options',isShow === 1?'show':'']">
  10. <view class="now_select options1" v-for="item,index in messageList" :key="index" @tap="changeIndex(item)">{{item.title}}</view>
  11. </view>
  12. </view>
  13. <!-- 位置信息报错 -->
  14. <view class="location_error" v-if="index == 0">
  15. <view class="error_class_header">
  16. <view class="error_title">位置信息<view class="line"></view></view>
  17. </view>
  18. <view class="address_message">
  19. <view class="message_top clear">
  20. <view class="address1">地址</view>
  21. <input v-model="rightInfo" class="inp" placeholder="请输入地址" placeholder-style="font-size:28rpx;color:#999999;"></input>
  22. <view :class="['reset']" @tap="reset">重置</view>
  23. </view>
  24. <map class="map" @tap="openMap"></map>
  25. <view class="chose_img_title">上传图片(选填)</view>
  26. <view class="chose_img clear">
  27. <image :src="chooseimg" @tap="chooseImage"></image>
  28. <view class="small_title">上传清晰门头图和指示牌可以加快审核哦~~</view>
  29. </view>
  30. <view class="chose_img_title">备注(选填)</view>
  31. <textarea v-model="remark" maxlength="500" class="textarea" placeholder="备注信息…" placeholder-style="font-size:26rpx;color:#999999;"></textarea>
  32. </view>
  33. <view class="back2"></view>
  34. <!--底部提交 -->
  35. <view class="footer">
  36. <button class="submit" @tap="save">提交</button>
  37. </view>
  38. </view>
  39. <!-- 商户电话报错 -->
  40. <view class="iphone_error" v-if="index == 1">
  41. <view class="error_class_header">
  42. <view class="error_title">商户电话<view class="line"></view></view>
  43. </view>
  44. <view class="address_message">
  45. <view class="message_top clear">
  46. <view class="address1">电话</view>
  47. <input v-model="rightInfo" class="inp" placeholder="请输入电话" placeholder-style="font-size:28rpx;color:#999999;"></input>
  48. </view>
  49. <view class="chose_img_title">上传图片(选填)</view>
  50. <view class="chose_img clear">
  51. <image :src="chooseimg" @tap="chooseImage"></image>
  52. <view class="small_title">上传清晰门头图和指示牌可以加快审核哦~~</view>
  53. </view>
  54. <view class="chose_img_title">备注(选填)</view>
  55. <textarea v-model="remark" maxlength="500" class="textarea" placeholder="备注信息…" placeholder-style="font-size:26rpx;color:#999999;"></textarea>
  56. </view>
  57. <view class="footer">
  58. <button class="submit" @tap="save">提交</button>
  59. </view>
  60. </view>
  61. <!-- 商户名错误 -->
  62. <view class="shopName_error" v-if="index == 2">
  63. <view class="error_class_header">
  64. <view class="error_title">商户名错误<view class="line"></view></view>
  65. </view>
  66. <view class="address_message">
  67. <view class="message_top clear">
  68. <view class="address1">商户名</view>
  69. <input v-model="rightInfo" class="inp" placeholder="请输入商户名" placeholder-style="font-size:28rpx;color:#999999;"></input>
  70. <view class="reset" bindtap="reset">重置</view>
  71. </view>
  72. <view class="chose_img_title">上传图片(选填)</view>
  73. <view class="chose_img clear">
  74. <image :src="chooseimg" @tap="chooseImage"></image>
  75. <view class="small_title">上传清晰门头图和指示牌可以加快审核哦~~</view>
  76. </view>
  77. <view class="chose_img_title">备注(选填)</view>
  78. <textarea v-model="remark" maxlength="500" class="textarea" placeholder="备注信息…" placeholder-style="font-size:26rpx;color:#999999;"></textarea>
  79. </view>
  80. <view class="footer">
  81. <button class="submit" @tap="save">提交</button>
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. let app = getApp()
  88. import api from "../../api.js";
  89. export default {
  90. data() {
  91. return {
  92. isShow:0,//是否展示下拉菜单
  93. message:'位置信息错误',//菜单栏展示
  94. messageList:[
  95. {index:0,title:'位置信息错误'},
  96. {index:1,title:'商户电话错误/补充'},
  97. {index:2,title:'商户名错误'},
  98. ],
  99. index:0,//展示哪一项
  100. allData:null,//后台返回所有数据
  101. rightInfo:'',//填写的正确信息 地址 电话
  102. detail:'',//错误信息展示
  103. chooseimg:'https://wx.fujinyangche.com/nvrnetwork/images/choseimg.png',//默认加载图片
  104. img:'',//上传图片信息 服务器返回
  105. remark:'',//备注信息
  106. }
  107. },
  108. props:['storeid','type'],
  109. mounted() {
  110. this.getData();
  111. },
  112. methods: {
  113. //查询数据
  114. getData(){
  115. let data = {
  116. storeId: this.storeid,
  117. token: app.globalData.token,
  118. }
  119. api.getShopError(data).then((res)=>{
  120. console.log(res);
  121. this.allData = res.data.data;
  122. this.detail = this.allData.provider.address;
  123. this.rightInfo = this.allData.provider.address;
  124. })
  125. },
  126. //是否出现下拉框
  127. showSelect(){
  128. if(this.isShow == 0){
  129. this.isShow = 1;
  130. }else{
  131. this.isShow = 0;
  132. }
  133. },
  134. //下拉框点击切换对应组件
  135. changeIndex(item){
  136. this.index = item.index;
  137. let value = item.title;
  138. if (value == '位置信息错误'){
  139. this.detail = this.allData.provider.address
  140. }
  141. if (value == '商户电话错误/补充'){
  142. this.detail = this.allData.provider.telphone
  143. }
  144. if (value == '商户名错误') {
  145. this.detail = this.allData.provider.name
  146. }
  147. this.message = value;
  148. this.chooseimg = 'https://wx.fujinyangche.com/nvrnetwork/images/choseimg.png';
  149. this.rightInfo = '';
  150. this.remark = '';
  151. this.showSelect();
  152. },
  153. // 重置按钮
  154. reset(){
  155. this.rightInfo = "";
  156. },
  157. //上传图片
  158. chooseImage(){
  159. uni.chooseImage({
  160. count: 1,
  161. sizeType: ['original', 'compressed'],
  162. sourceType: ['album', 'camera'],
  163. success: res=> {
  164. let tempFilePaths = res.tempFilePaths[0];
  165. this.chooseimg = tempFilePaths;
  166. uni.uploadFile({
  167. url: app.globalData.url + '/p_search/upload_img',
  168. filePath: tempFilePaths,
  169. name: 'img',
  170. success:(res)=>{
  171. let data = JSON.parse(res.data);
  172. this.img = data.data;
  173. }
  174. })
  175. },
  176. })
  177. },
  178. //打开地图
  179. openMap(){
  180. uni.getLocation({
  181. success: (res) => {
  182. let latitude = res.latitude;
  183. let longitude = res.longitude;
  184. uni.chooseLocation()({
  185. latitude: latitude,
  186. longitude: longitude,
  187. scale: 28
  188. })
  189. }
  190. })
  191. },
  192. //保存按钮
  193. save(){
  194. let data = {
  195. storeId: this.storeid,
  196. subUserId: this.allData.userId,
  197. type:this.type,
  198. description:this.message,
  199. detail:this.detail,
  200. rightInfo: this.rightInfo,
  201. img: this.img,
  202. remark:this.remark
  203. }
  204. api.submitShopError(data).then((res)=>{
  205. console.log(res);
  206. if(res.data.is){
  207. uni.showToast({
  208. title:res.data.msg
  209. })
  210. }else{
  211. uni.showToast({
  212. title:res.data.msg
  213. })
  214. }
  215. })
  216. }
  217. }
  218. }
  219. </script>
  220. <style scoped>
  221. .clear:after{
  222. content: "";
  223. display: block;
  224. clear:both;
  225. }
  226. .error_class_header{
  227. padding-left: 30rpx;
  228. box-sizing: border-box;
  229. }
  230. .error_title{
  231. font-size: 32rpx;
  232. color:#222222;
  233. font-weight: bold;
  234. margin-top:32rpx;
  235. position: relative;
  236. padding-left: 14rpx;
  237. }
  238. .line{
  239. width:6rpx;
  240. height:30rpx;
  241. background-color: #E77817;
  242. position: absolute;
  243. top:6rpx;
  244. left:0rpx;
  245. }
  246. .message_top{
  247. position: relative;
  248. }
  249. .select{
  250. width:100%;
  251. padding:0 48rpx 40rpx 54rpx;
  252. box-sizing: border-box;
  253. margin-top:38rpx;
  254. position: relative;
  255. }
  256. .now_select{
  257. width:100%;
  258. height:72rpx;
  259. line-height: 72rpx;
  260. box-sizing: border-box;
  261. background:rgba(255,255,255,1);
  262. border-radius:2rpx;
  263. border:1px solid rgba(207,207,207,1);
  264. font-size: 28rpx;
  265. color:#222222;
  266. padding-left: 20rpx;
  267. position: relative;
  268. }
  269. .header_bottom{
  270. color:#999999;
  271. font-size: 16rpx;
  272. position: absolute;
  273. right:26rpx;
  274. bottom:0rpx;
  275. }
  276. .options{
  277. width:100%;
  278. overflow: hidden;
  279. box-sizing: border-box;
  280. display: none;
  281. }
  282. .show{
  283. display: block;
  284. }
  285. .options1{
  286. border-top:none;
  287. }
  288. .back{
  289. width:100%;
  290. height:20rpx;
  291. background-color: #f7f7f7;
  292. }
  293. .address1{
  294. font-size:28rpx;
  295. color:#666666;
  296. float:left;
  297. height:46rpx;
  298. text-align: left;
  299. line-height: 46rpx;
  300. margin-right: 20rpx;
  301. }
  302. .address_message{
  303. width:100%;
  304. overflow: hidden;
  305. padding:0 46rpx 140rpx;
  306. box-sizing: border-box;
  307. margin-top:38rpx;
  308. }
  309. .inp{
  310. width:60%;
  311. float:left;
  312. font-size:28rpx;
  313. color:#222222;
  314. }
  315. .reset{
  316. width:100rpx;
  317. height:40rpx;
  318. background:rgba(250,225,203,1);
  319. border-radius:36rpx;
  320. border:1px solid rgba(231,120,23,1);
  321. text-align: center;
  322. line-height: 40rpx;
  323. font-size: 24rpx;
  324. color:#E77817;
  325. position: absolute;
  326. right:0;
  327. z-index:100;
  328. }
  329. .map{
  330. width:100%;
  331. height:200rpx;
  332. border-radius: 6rpx;
  333. overflow: hidden;
  334. margin-top:20rpx;
  335. }
  336. .chose_img_title{
  337. font-size: 28rpx;
  338. color:#666666;
  339. margin-top:50rpx;
  340. }
  341. .chose_img{
  342. width:100%;
  343. margin-top:30rpx;
  344. }
  345. .chose_img image{
  346. display: block;
  347. width:148rpx;
  348. height:148rpx;
  349. float:left;
  350. }
  351. .small_title{
  352. float:left;
  353. font-size: 24rpx;
  354. color:#999999;
  355. line-height: 148rpx;
  356. margin-left: 20rpx;
  357. }
  358. .textarea{
  359. width:100%;
  360. height:200rpx;
  361. background:rgba(249,249,249,1);
  362. border-radius:6rpx;
  363. border:1px solid rgba(202,202,202,1);
  364. margin-top:12rpx;
  365. padding:14rpx 0 0 20rpx;
  366. box-sizing: border-box;
  367. position: relative;
  368. }
  369. .length{
  370. position: absolute;
  371. bottom:10rpx;
  372. right:10rpx;
  373. font-size: 24rpx;
  374. color:#999999;
  375. }
  376. .back2{
  377. width:100%;
  378. height:40rpx;
  379. background-color: #f7f7f7;
  380. }
  381. .footer{
  382. width:100%;
  383. height:100rpx;
  384. background:rgba(255,255,255,1);
  385. box-shadow:0px 4rpx 8rpx 0px rgba(0,0,0,0.5);
  386. position: fixed;
  387. bottom:0;
  388. left:0;
  389. }
  390. .submit{
  391. width:690rpx;
  392. height:80rpx;
  393. background:linear-gradient(270deg,rgba(254,107,21,1) 0%,rgba(254,163,48,1) 100%);
  394. border-radius:40rpx;
  395. text-align: center;
  396. font-size: 32rpx;
  397. color:#ffffff;
  398. position: absolute;
  399. top:10rpx;
  400. left:50%;
  401. transform: translateX(-50%)
  402. }
  403. .hidden{
  404. display: block;
  405. }
  406. .none{
  407. display: none;
  408. }
  409. .iphone_error{
  410. width:100%;
  411. overflow: hidden;
  412. }
  413. .radio{
  414. width:30rpx;
  415. height:30rpx;
  416. border-radius: 50%;
  417. position: absolute;
  418. top:8rpx;
  419. left: -40rpx;
  420. }
  421. .radio image,.right1 image{
  422. width:100%;
  423. height:100%;
  424. display: block;
  425. }
  426. .right1{
  427. width:30rpx;
  428. height:30rpx;
  429. border-radius: 50%;
  430. position: absolute;
  431. top:8rpx;
  432. left: -40rpx;
  433. }
  434. .message_top_right{
  435. position: absolute;
  436. right:0;
  437. top:0rpx;
  438. z-index:100;
  439. }
  440. .this_error{
  441. font-size: 28rpx;
  442. color:#222222;
  443. display: inline-block;
  444. height: 46rpx;
  445. line-height: 46rpx;
  446. vertical-align:text-top;
  447. }
  448. .tel_input{
  449. width:100%;
  450. height:72rpx;
  451. background:rgba(255,255,255,1);
  452. border-radius:2rpx;
  453. border:1px solid rgba(207,207,207,1);
  454. box-sizing: border-box;
  455. margin-top:30rpx;
  456. }
  457. .tel_input input{
  458. width:100%;
  459. height:100%;
  460. padding-left: 26rpx;
  461. box-sizing: border-box;
  462. }
  463. .tel_input_place{
  464. font-size: 28rpx;
  465. color:#999999;
  466. line-height: 72rpx;
  467. }
  468. </style>