modifyInfo.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view>
  3. <view style="margin-top: 60rpx;">
  4. <u-form :model="form" ref="uForm" :rules="rules">
  5. <view class="store">
  6. <u-form-item label="店铺信息" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  7. <u-input input-align='right' disabled=true
  8. v-model="form.shopsName"></u-input>
  9. </u-form-item>
  10. </view>
  11. <view class="store">
  12. <u-form-item label="店铺电话" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  13. <u-input input-align='right' disabled=true
  14. v-model="form.shopsTel"></u-input>
  15. </u-form-item>
  16. </view>
  17. <view class="store">
  18. <u-form-item label="店铺地址" :leftIconStyle="{color: '#2E4F1C', fontSize: '40rpx'}" label-width="180">
  19. <u-input input-align='right' disabled=true
  20. v-model="form.shopsAddress"></u-input>
  21. </u-form-item>
  22. </view>
  23. </u-form>
  24. <view class="store">
  25. <view class="font-color3 font-twenty distance">
  26. 店铺简介
  27. </view>
  28. <textarea v-model="form.shopsIntroduce" disabled=true />
  29. </view>
  30. <view class="store">
  31. <view class="font-color2 font-twenty distance">
  32. 照片修改(重新上传一张新照片,否则默认之前)
  33. </view>
  34. <view style="padding-bottom:40rpx;">
  35. <image :src="image(form.shopsPic)" class="img"></image>
  36. </view>
  37. </view>
  38. <view class="store" v-if="!flag">
  39. <view class="font-color3 font-twenty distance">
  40. 审核意见
  41. </view>
  42. <textarea v-model="form.remark" disabled=true />
  43. </view>
  44. <view class="btn-display" v-if="flag">
  45. <button type="default" class="button btn-color1" @click="show('通过')">通过</button>
  46. <button type="default" class="button btn-color2" @click="show('不通过')">不通过</button>
  47. </view>
  48. </view>
  49. <ming-pop ref="statement" direction="below" :is_mask="true" :width="100" height="42%" :maskFun="true">
  50. <pop @close="close()" @noPass='handle' ref="pop"></pop>
  51. </ming-pop>
  52. <u-toast ref="uToast" />
  53. </view>
  54. </template>
  55. <script>
  56. import server from "@/api/index";
  57. import http from '@/common/http.js'
  58. export default {
  59. onLoad() {},
  60. data() {
  61. return {
  62. width: '240rpx',
  63. height: '135rpx',
  64. flag: true,
  65. form:{
  66. storeName: '店铺名称', //店铺名称
  67. storeTel: '15045178945', //店铺电话
  68. storeAddress: '长春市', //店铺地址
  69. action: '',
  70. shopsDiscount:'',
  71. pic:[]
  72. },
  73. remark: '', //不通过原因
  74. id:null,
  75. userInfo: {},
  76. type: null
  77. }
  78. },
  79. onLoad(e) {
  80. console.log(e)
  81. this.id = e.id;
  82. if(e.flag){
  83. this.flag = false
  84. }else{
  85. this.flag = true
  86. }
  87. this.getListFn();
  88. this.userInfo = uni.getStorageSync('userInfo');
  89. },
  90. methods: {
  91. image(e) {
  92. return http.webUrl + e
  93. },
  94. handlePass(data){
  95. let _this = this;
  96. uni.showModal({
  97. title: '提示',
  98. content: '确定通过审核吗?',
  99. success: function (res) {
  100. if (res.confirm) {
  101. let params ={
  102. shopsId: _this.id,
  103. shopsStatus: '2',
  104. shopsReviewer: _this.userInfo.userId,
  105. reviewerName: _this.userInfo.nickName,
  106. remark: data
  107. }
  108. server.getIndexData(params).then(res =>{
  109. _this.$refs.uToast.show({
  110. title: '通过审核成功!',
  111. type: 'default',
  112. })
  113. setTimeout(function() {
  114. uni.navigateBack({
  115. delta: 1
  116. });
  117. }, 2000);
  118. })
  119. } else if (res.cancel) {
  120. console.log('用户点击取消');
  121. }
  122. }
  123. });
  124. },
  125. handle(data){
  126. if(this.type === '不通过'){
  127. this.handleNoPass(data)
  128. }else if(this.type === '通过'){
  129. this.handlePass(data)
  130. }
  131. },
  132. handleNoPass(data){
  133. let _this = this;
  134. let params ={
  135. shopsId: this.id,
  136. shopsStatus: '3',
  137. shopsReviewer: _this.userInfo.userId,
  138. reviewerName: _this.userInfo.nickName,
  139. remark: data
  140. }
  141. server.getIndexData(params).then(res =>{
  142. _this.$refs.uToast.show({
  143. title: '操作成功!',
  144. type: 'default',
  145. })
  146. setTimeout(function() {
  147. uni.navigateBack({
  148. delta: 1
  149. });
  150. }, 2000);
  151. })
  152. },
  153. getListFn(){
  154. server.getInfonew(this.id).then(res =>{
  155. if(res){
  156. this.form = res
  157. }
  158. })
  159. },
  160. show(type) {
  161. this.$refs.statement.show(type);
  162. this.$refs.pop.show(type);
  163. this.type = type;
  164. },
  165. close() {
  166. this.$refs.statement.close();
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. page {
  173. background-color: #F8F8F8;
  174. }
  175. .store {
  176. width: 690rpx;
  177. background: rgba(46, 79, 28, 0.13);
  178. border-radius: 16rpx;
  179. margin: 20rpx auto;
  180. padding: 0 35rpx;
  181. .img{
  182. width: 200rpx;
  183. height: 135rpx;
  184. margin-right: 10rpx;
  185. }
  186. }
  187. .distance {
  188. padding: 20rpx 0rpx;
  189. }
  190. .btn-display {
  191. display: flex;
  192. justify-content: space-between;
  193. margin-top: 60rpx;
  194. .button {
  195. width: 330rpx;
  196. border-radius: 48rpx;
  197. color: #ffffff;
  198. }
  199. .btn-color1 {
  200. background: #2E4F1C
  201. }
  202. .btn-color2 {
  203. background: #CC1019
  204. }
  205. }
  206. </style>