mch-detail.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <app-layout>
  3. <view class="mch-detail" v-if="pageShow">
  4. <view class="title">
  5. 基本信息
  6. </view>
  7. <view class="information">
  8. <view class="line line-margin dir-left-nowrap">
  9. <view class="label">
  10. 申请人
  11. </view>
  12. <view class="expression">
  13. {{detail.user.nickname}}
  14. </view>
  15. </view>
  16. <view class="line line-margin dir-left-nowrap">
  17. <view class="label">
  18. 联系人
  19. </view>
  20. <view class="expression">
  21. {{detail.realname}}
  22. </view>
  23. </view>
  24. <view class="line line-margin dir-left-nowrap">
  25. <view class="label">
  26. 联系电话
  27. </view>
  28. <view class="expression">
  29. {{detail.mobile}}
  30. </view>
  31. </view>
  32. <view class="line line-margin dir-left-nowrap">
  33. <view class="label">
  34. 微信号
  35. </view>
  36. <view class="expression">
  37. {{detail.wechat}}
  38. </view>
  39. </view>
  40. <view class="line dir-left-nowrap cross-center">
  41. <view class="label have-icon dir-left-nowrap cross-center">
  42. <image class="icon" src="../image/price.png"></image>
  43. <text>手续费</text>
  44. </view>
  45. <view class="expression dir-left-nowrap cross-center">
  46. <input type="number" maxlength="4" max="1000" v-model="transfer_rate" @input="onInput" placeholder-style="color: #cdcdcd;" class="input" placeholder="设置0~1000整数商户交易手续费率">
  47. <view>‰</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="title">
  52. 店铺信息
  53. </view>
  54. <view class="information">
  55. <view class="line line-margin dir-left-nowrap">
  56. <view class="label">
  57. 店铺名称
  58. </view>
  59. <view class="expression">
  60. {{detail.scope}}
  61. </view>
  62. </view>
  63. <view class="line line-margin dir-left-nowrap">
  64. <view class="label">
  65. 所在地区
  66. </view>
  67. <view class="expression">
  68. {{detail.districts}}
  69. </view>
  70. </view>
  71. <view class="line line-margin dir-left-nowrap">
  72. <view class="label">
  73. 详细地址
  74. </view>
  75. <view class="expression">
  76. {{detail.address}}
  77. </view>
  78. </view>
  79. <view class="line line-margin dir-left-nowrap">
  80. <view class="label">
  81. 所售类目
  82. </view>
  83. <view class="expression">
  84. {{detail.cat_name}}
  85. </view>
  86. </view>
  87. <view class="line dir-left-nowrap">
  88. <view class="label">
  89. 客服电话
  90. </view>
  91. <view class="expression">
  92. {{detail.service_mobile}}
  93. </view>
  94. </view>
  95. </view>
  96. <view class="title" v-if="showForm">
  97. 其他信息
  98. </view>
  99. <view class="information" v-if="showForm">
  100. <block v-for="(item, index) in detail.form_data" :key="index">
  101. <template
  102. v-if="item.key === 'text' || item.key === 'date' || item.key === 'radio'|| item.key === 'time'|| item.key === 'checkbox'"
  103. >
  104. <view class="line line-margin dir-left-nowrap" v-if="item.value">
  105. <view class="label">
  106. {{item.label}}
  107. </view>
  108. <view class="expression break-word">
  109. {{item.value}}
  110. </view>
  111. </view>
  112. </template>
  113. <template v-else-if="item.key === 'img_upload' && item.value">
  114. <view class="line line-margin dir-left-nowrap">
  115. <view class="label">
  116. {{item.label}}
  117. </view>
  118. <view class="expression dir-left-wrap">
  119. <template v-if="getTypeof(item.value) === 'string'" >
  120. <image class="image" v-if="item.value" :src="item.value" @click="preview(item.value)"></image>
  121. </template>
  122. <template v-if="getTypeof(item.value) === 'object'">
  123. <image class="image" v-if="image" v-for="(image, i) in item.value" @click="preview(image)" :key="i" :src="image"></image>
  124. </template>
  125. </view>
  126. </view>
  127. </template>
  128. </block>
  129. </view>
  130. <view class="button dir-left-nowrap main-between" style="visibility: hidden;">
  131. <view class="fail">
  132. <app-form-id>
  133. 不通过
  134. </app-form-id>
  135. </view>
  136. <view class="by">
  137. <app-form-id>
  138. 通过
  139. </app-form-id>
  140. </view>
  141. </view>
  142. <view class="button fixed dir-left-nowrap main-between">
  143. <view class="fail" @click="fail">
  144. <app-form-id>
  145. 不通过
  146. </app-form-id>
  147. </view>
  148. <view class="by" @click="by">
  149. <app-form-id>
  150. 通过
  151. </app-form-id>
  152. </view>
  153. </view>
  154. <view @touchmove.stop.prevent="" class="model" v-if="model">
  155. <template v-if="modelType === 1">
  156. <view class="refuse">
  157. <view class="top">不通过申请</view>
  158. <view class="content">
  159. <textarea v-model="reasonRefusal" class="textarea" placeholder="请填写拒绝理由"></textarea>
  160. </view>
  161. <view class="buttons dir-left-nowrap cross-center">
  162. <view class="but cancel" @click="cancel">
  163. <app-form-id>
  164. 取消
  165. </app-form-id>
  166. </view>
  167. <view class="line"></view>
  168. <view class="but confirm" @click="confirm">
  169. <app-form-id>确认</app-form-id>
  170. </view>
  171. </view>
  172. </view>
  173. </template>
  174. <template v-if="modelType === 2">
  175. <view class="by">
  176. <view class="top">通过申请</view>
  177. <view class="content">
  178. 是否确认通过申请
  179. </view>
  180. <view class="buttons dir-left-nowrap cross-center">
  181. <view class="but cancel" @click="cancel">
  182. <app-form-id>
  183. 取消
  184. </app-form-id>
  185. </view>
  186. <view class="line"></view>
  187. <view class="but confirm" @click="confirm">
  188. <app-form-id>确认</app-form-id>
  189. </view>
  190. </view>
  191. </view>
  192. </template>
  193. </view>
  194. </view>
  195. </app-layout>
  196. </template>
  197. <script>
  198. export default {
  199. name: 'mch-detail',
  200. data() {
  201. return {
  202. detail: {
  203. user: {
  204. nickname: '',
  205. },
  206. realname: '',
  207. mobile: '',
  208. wechat: '',
  209. scope: '',
  210. districts: '',
  211. address: '',
  212. cat_name: '',
  213. service_mobile: '',
  214. form_data: [],
  215. },
  216. model: false,
  217. modelType: 0,
  218. reasonRefusal: '',
  219. transfer_rate: null,
  220. pageShow: false,
  221. showForm: false,
  222. }
  223. },
  224. onLoad(options) { this.$commonLoad.onload(options);
  225. this.$showLoading({
  226. type: 'global',
  227. text: '加载中...'
  228. });
  229. this.$request({
  230. url: this.$api.app_admin.review_detail,
  231. data: {
  232. id: options.id
  233. }
  234. }).then(response => {
  235. this.$hideLoading();
  236. if (response.code === 0) {
  237. this.pageShow = true;
  238. this.detail = response.data.detail;
  239. for(let item of this.detail.form_data) {
  240. if(item.value) {
  241. this.showForm = true;
  242. }
  243. }
  244. }
  245. }).catch(() => {
  246. this.$hideLoading();
  247. });
  248. },
  249. methods: {
  250. getTypeof(data) {
  251. return typeof(data);
  252. },
  253. fail() {
  254. this.model = true;
  255. this.modelType = 1;
  256. },
  257. by() {
  258. this.model = true;
  259. this.modelType = 2;
  260. },
  261. cancel() {
  262. this.model = false;
  263. this.modelType = 0;
  264. },
  265. confirm() {
  266. if (this.modelType === 2) {
  267. this.detail.transfer_rate = this.transfer_rate;
  268. this.$request({
  269. url: this.$api.app_admin.review_switch,
  270. method: 'post',
  271. data: {
  272. type: 1,
  273. status: 1,
  274. form: JSON.stringify(this.detail),
  275. user_id: this.detail.id
  276. }
  277. }).then(response => {
  278. if (response.code === 0) {
  279. uni.navigateBack();
  280. this.model = false;
  281. } else if (response.code === 1) {
  282. uni.showToast({
  283. title: response.msg
  284. })
  285. }
  286. })
  287. } else if (this.modelType === 1) {
  288. this.detail.review_remark = this.reasonRefusal;
  289. this.$request({
  290. url: this.$api.app_admin.review_switch,
  291. method: 'post',
  292. data: {
  293. type: 1,
  294. status: 2,
  295. form: JSON.stringify(this.detail),
  296. user_id: this.detail.id
  297. }
  298. }).then(response => {
  299. if (response.code === 0) {
  300. uni.navigateBack();
  301. this.model = false;
  302. } else if (response.code === 1) {
  303. uni.showToast({
  304. title: response.msg
  305. })
  306. }
  307. });
  308. }
  309. },
  310. preview(data) {
  311. uni.previewImage({
  312. urls: [data]
  313. });
  314. },
  315. onInput(data) {
  316. if (Number(data.detail.value) > 1000) {
  317. setTimeout(() => {
  318. this.transfer_rate = 1000;
  319. });
  320. }
  321. }
  322. }
  323. }
  324. </script>
  325. <style scoped lang="scss">
  326. @import './mch-detail.scss';
  327. </style>