community-detail.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <app-layout>
  3. <view class="info">
  4. <image class="avatar" :src="detail.avatar"></image>
  5. <view class="dir-left-nowrap form-item">
  6. <view class="label">姓名</view>
  7. <view class="item-content">{{detail.nickname}}</view>
  8. </view>
  9. <view class="dir-left-nowrap form-item">
  10. <view class="label">手机号</view>
  11. <view class="item-content t-omit">{{detail.mobile}}</view>
  12. </view>
  13. <view class="dir-left-nowrap form-item">
  14. <view class="label">所在地区</view>
  15. <view class="item-content" v-if="detail.user_id > 0">{{detail.province}}{{detail.city}}{{detail.district}}{{detail.location}}</view>
  16. </view>
  17. <view class="dir-left-nowrap form-item">
  18. <view class="label">提货地址</view>
  19. <view class="item-content">{{detail.detail}}</view>
  20. </view>
  21. </view>
  22. <view class="button dir-left-nowrap main-between">
  23. <view class="fail" @click="refuse">拒绝</view>
  24. <view class="by" @click="by">通过</view>
  25. </view>
  26. <view @touchmove.stop.prevent="" class="model" v-if="model">
  27. <template v-if="modelType === 1">
  28. <view class="refuse">
  29. <view class="top">{{type > 2 ? '拒绝申请' : '不通过申请'}}</view>
  30. <view class="content">
  31. <textarea v-model="reasonRefusal" class="textarea" placeholder="请填写拒绝理由"></textarea>
  32. </view>
  33. <view class="buttons dir-left-nowrap cross-center">
  34. <view class="but cancel" @click="cancel">
  35. <app-form-id>
  36. 取消
  37. </app-form-id>
  38. </view>
  39. <view class="line"></view>
  40. <view class="but confirm" @click="confirm">
  41. <app-form-id>确认</app-form-id>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <template v-if="modelType === 2">
  47. <view class="by">
  48. <view class="top">通过申请</view>
  49. <view class="content">
  50. 是否确认通过申请
  51. </view>
  52. <view class="buttons dir-left-nowrap cross-center">
  53. <view class="but cancel" @click="cancel">
  54. <app-form-id>
  55. 取消
  56. </app-form-id>
  57. </view>
  58. <view class="line"></view>
  59. <view class="but confirm" @click="confirm">
  60. <app-form-id>确认</app-form-id>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. </view>
  66. </app-layout>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. id: 0,
  73. detail: {},
  74. modelType: 1,
  75. reasonRefusal: '',
  76. model: false,
  77. iphone_x: false,
  78. }
  79. },
  80. onLoad(options) {
  81. let that = this;
  82. uni.getSystemInfo({
  83. success: function (res) {
  84. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1 || res.model.indexOf('Unknown Device') > -1) {
  85. that.iphone_x = true;
  86. }
  87. }
  88. })
  89. that.$showLoading({
  90. type: 'global',
  91. text: '加载中...'
  92. });
  93. that.id = options.id;
  94. that.getDetail();
  95. },
  96. methods: {
  97. getDetail() {
  98. this.$request({
  99. url: this.$api.app_admin.review_detail_v2,
  100. data: {
  101. key: 'community',
  102. user_id: this.id
  103. }
  104. }).then(response => {
  105. this.$hideLoading();
  106. uni.hideLoading();
  107. if (response.code === 0) {
  108. this.detail = response.data;
  109. }
  110. }).catch(() => {
  111. this.$hideLoading();
  112. uni.hideLoading();
  113. });
  114. },
  115. refuse() {
  116. this.modelType = 1;
  117. this.model = true;
  118. },
  119. by() {
  120. this.modelType = 2;
  121. this.model = true;
  122. },
  123. confirm() {
  124. if (this.modelType === 2) {
  125. this.$request({
  126. url: this.$api.app_admin.review_switch_v2,
  127. method: 'post',
  128. data: {
  129. key: 'community',
  130. status: 1,
  131. user_id: this.detail.user_id
  132. }
  133. }).then(response => {
  134. if (response.code === 0) {
  135. uni.showToast({
  136. title: '通过申请',
  137. duration: 1000
  138. });
  139. this.model = false;
  140. setTimeout(function(){
  141. uni.navigateBack();
  142. })
  143. }
  144. })
  145. } else if (this.modelType === 1) {
  146. this.$request({
  147. url: this.$api.app_admin.review_switch_v2,
  148. method: 'post',
  149. data: {
  150. key: 'community',
  151. status: 2,
  152. reason: this.reasonRefusal,
  153. user_id: this.detail.user_id
  154. }
  155. }).then(response => {
  156. if (response.code === 0) {
  157. this.reasonRefusal = '';
  158. this.model = false;
  159. uni.showToast({
  160. title: '拒绝申请',
  161. icon: 'none',
  162. duration: 1000
  163. });
  164. setTimeout(function(){
  165. uni.navigateBack();
  166. })
  167. }else {
  168. uni.showToast({
  169. title: response.msg,
  170. icon: 'none',
  171. duration: 1000
  172. });
  173. }
  174. });
  175. }
  176. },
  177. cancel() {
  178. this.model=false;
  179. }
  180. }
  181. }
  182. </script>
  183. <style scoped lang="scss">
  184. .info {
  185. position: relative;
  186. z-index: 10;
  187. width: 702rpx;
  188. margin: 94rpx auto 0;
  189. border-radius: 16rpx;
  190. background-color: #fff;
  191. font-size: 32rpx;
  192. color: #353535;
  193. padding: 98rpx 40rpx 15rpx;
  194. .avatar {
  195. width: 140rpx;
  196. height: 140rpx;
  197. border-radius: 70rpx;
  198. border: 4rpx solid #fff;
  199. position: absolute;
  200. top: -70rpx;
  201. left: 50%;
  202. margin-left: -70rpx;
  203. }
  204. .form-item {
  205. margin-bottom: 26rpx;
  206. .label {
  207. color: #999999;
  208. width: 170rpx;
  209. flex-shrink: 0;
  210. }
  211. .item-content {
  212. width: 450rpx;
  213. .placeholder {
  214. margin: 0 10rpx;
  215. }
  216. }
  217. }
  218. }
  219. .button {
  220. width: #{750-48rpx};
  221. height: #{80rpx};
  222. margin: #{80rpx} #{12rpx};
  223. >view {
  224. width: #{346rpx};
  225. height: #{80rpx};
  226. line-height: #{80rpx};
  227. text-align: center;
  228. border-radius: #{40rpx};
  229. font-size: #{28rpx};
  230. }
  231. .fail {
  232. background-color: #e2e2e2;
  233. color: #353535;
  234. }
  235. .by {
  236. background-color: #446dfd;
  237. color: white;
  238. }
  239. }
  240. .model {
  241. position: fixed;
  242. z-index: 1600;
  243. width: 100%;
  244. height: 100%;
  245. top: 0;
  246. left: 0;
  247. background-color: rgba(0,0,0,.3);
  248. .dialog-list {
  249. padding: 46rpx 30rpx;
  250. .dialog-item {
  251. margin: 10rpx;
  252. height: 62rpx;
  253. line-height: 60rpx;
  254. display: inline-block;
  255. padding: 0 32rpx;
  256. font-size: 32rpx;
  257. color: #353535;
  258. border-radius: 32rpx;
  259. border: 2rpx solid #bbbbbb;
  260. &.active {
  261. color: #446dfd;
  262. border: 2rpx solid #446dfd;
  263. }
  264. }
  265. }
  266. .top {
  267. margin-top: #{40rpx};
  268. margin-bottom: #{32rpx};
  269. color: #353535;
  270. font-size: #{32rpx};
  271. text-align: center;
  272. }
  273. .content {
  274. width: calc(100% - #{64rpx});
  275. margin: 0 #{32rpx};
  276. }
  277. .buttons {
  278. width: 100%;
  279. border-top: #{1rpx} solid #e2e2e2;
  280. margin-top: #{32rpx};
  281. .but {
  282. width: calc(50% - #{1rpx});
  283. height: #{88rpx};
  284. line-height: #{88rpx};
  285. font-size: #{32rpx};
  286. text-align: center;
  287. }
  288. .line {
  289. width: #{2rpx};
  290. height: #{32rpx};
  291. background-color: #e2e2e2;
  292. }
  293. .cancel {
  294. color: #666666;
  295. }
  296. .confirm {
  297. color: #446dfd;
  298. }
  299. }
  300. .refuse {
  301. width: #{620rpx};
  302. position: absolute;
  303. top: 50%;
  304. left: 50%;
  305. transform: translate(-50%, -50%);
  306. border-radius: #{16rpx};
  307. background-color: white;
  308. .content {
  309. border-radius: #{16rpx};
  310. border: #{1rpx} solid #e2e2e2;
  311. height: #{300rpx};
  312. box-sizing: border-box;
  313. padding: #{24rpx} #{32rpx};
  314. }
  315. .textarea {
  316. width: #{620-64-64rpx};
  317. height: #{300-48rpx};
  318. font-size: #{28rpx};
  319. color: #80848f;
  320. }
  321. }
  322. .by {
  323. width: #{620rpx};
  324. position: absolute;
  325. top: 50%;
  326. left: 50%;
  327. transform: translate(-50%, -50%);
  328. border-radius: #{16rpx};
  329. background-color: white;
  330. .content {
  331. font-size: #{32rpx};
  332. color: #353535;
  333. text-align: center;
  334. }
  335. }
  336. }
  337. </style>