You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

290 lines
6.2 KiB

6 months ago
  1. <template>
  2. <view>
  3. 无效页面
  4. <!-- <view class="content1" v-if="issq">
  5. <text class="success-icon yticon icon-xuanzhong2"></text>
  6. <text class="tit">{{statedesc}}</text>
  7. <view class="btn-group" v-if="issq">
  8. <navigator url="/pages/user/user" open-type="switchTab" class="mix-btn hollow">点我返回</navigator>
  9. </view>
  10. </view>
  11. <view class="content" v-if="!issq">
  12. <view class="row">
  13. <view class="nominal">
  14. 姓名
  15. </view>
  16. <view class="input">
  17. <input placeholder="请输入姓名" type="text" v-model="name" />
  18. </view>
  19. </view>
  20. <view class="row">
  21. <view class="nominal">
  22. 电话号码
  23. </view>
  24. <view class="input">
  25. <input placeholder="请输入电话号码" type="text" v-model="tel" />
  26. </view>
  27. </view>
  28. <view class="row">
  29. <view class="nominal">
  30. 所在地区
  31. </view>
  32. <view class="input" @tap="chooseCity">
  33. {{region.label}}
  34. </view>
  35. </view>
  36. <view class="row">
  37. <view class="nominal">
  38. 备注
  39. </view>
  40. <view class="input">
  41. <textarea v-model="detailed" auto-height="true" placeholder="输入申请备注"></textarea>
  42. </view>
  43. </view>
  44. <view class="row">
  45. <view class="nominal">
  46. 所在小区
  47. </view>
  48. <view class="input">
  49. <textarea v-model="xqtext" auto-height="true" placeholder="输入所在小区"></textarea>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="save" @tap="save" v-if="!issq">
  54. <view class="btn">
  55. 提交申请
  56. </view>
  57. </view>
  58. <mpvue-city-picker :themeColor="themeColor" ref="mpvueCityPicker" :pickerValueDefault="cityPickerValue" @onCancel="onCancel" @onConfirm="onConfirm"></mpvue-city-picker>
  59. -->
  60. </view>
  61. </template>
  62. <script>
  63. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue';
  64. import xflSelect from '@/components/xfl-select/xfl-select.vue';
  65. export default {
  66. components: {
  67. mpvueCityPicker,
  68. xflSelect
  69. },
  70. data() {
  71. return {
  72. editType:'edit',
  73. id:'',
  74. name:'',
  75. tel:'',
  76. detailed:'',
  77. isDefault:false,
  78. cityPickerValue: [0, 0, 1],
  79. themeColor: '#007AFF',
  80. region:{label:"请点击选择地址",value:[],cityCode:""},
  81. list: ['龙湖区','花园小区','黑谷街道'],
  82. listBoxStyle: `border: none;`,
  83. xqtext:'',
  84. issq:0,
  85. statedesc:'正在审核中'
  86. };
  87. },
  88. methods: {
  89. async getarealist() {
  90. let reinfo=await this.$api.getarealist({action:'getarealist'});
  91. this.list=reinfo.data;
  92. },
  93. //地区选择器相关函数回调
  94. onCancel(e) {
  95. console.log(e)
  96. },
  97. chooseCity() {
  98. this.$refs.mpvueCityPicker.show()
  99. },
  100. onConfirm(e) {
  101. this.region = e;
  102. this.cityPickerValue = e.value;
  103. },
  104. isDefaultChange(e){
  105. this.isDefault = e.detail.value;
  106. },
  107. //入驻申请请求接口
  108. async sqruzhu() {
  109. let userinfo=uni.getStorageSync('userinfo');
  110. let re = await this.$api.sqruzhu({action:'sqruzhu',uid:userinfo.uid,name:this.name,phone:this.tel,address:this.region.label,beiz:this.detailed,xiaoqu:this.xqtext});
  111. if(re.code==1){
  112. uni.showToast({
  113. title:re.msg,icon:'none'
  114. })
  115. setTimeout(function(){
  116. uni.hideLoading();
  117. uni.navigateBack({
  118. delta:1
  119. })
  120. },1000)
  121. }else{
  122. uni.hideLoading();
  123. uni.showToast({
  124. title:re.msg,icon:'none'
  125. })
  126. }
  127. },
  128. async checkruzhu() {
  129. let userinfo=uni.getStorageSync('userinfo');
  130. let re = await this.$api.checkruzhu({action:'checkruzhu',uid:userinfo.uid});
  131. if(re.code==1){
  132. this.statedesc=re.data.desc;
  133. this.issq=1;
  134. }
  135. },
  136. //选择小区改变触发函数
  137. change({newVal, oldVal, index, orignItem}){
  138. console.log(newVal, oldVal, index, orignItem);
  139. this.xqtext=newVal;
  140. },
  141. save(){
  142. if(!this.name){
  143. uni.showToast({title:'请输入姓名',icon:'none'});
  144. return ;
  145. }
  146. if(!this.tel){
  147. uni.showToast({title:'请输入手机号',icon:'none'});
  148. return ;
  149. }
  150. if(this.region.value==''){
  151. uni.showToast({title:'请选择地址',icon:'none'});
  152. return ;
  153. }
  154. if(this.xqtext==''){
  155. uni.showToast({title: '请填所属小区',icon: 'none'})
  156. return false;
  157. }
  158. uni.showLoading({
  159. title:'正在提交'
  160. })
  161. this.sqruzhu();
  162. }
  163. },
  164. onLoad(e) {
  165. //获取传递过来的参数
  166. this.getarealist();
  167. this.checkruzhu();
  168. },
  169. onBackPress() {
  170. if (this.$refs.mpvueCityPicker.showPicker) {
  171. this.$refs.mpvueCityPicker.pickerCancel();
  172. return true;
  173. }
  174. },
  175. onUnload() {
  176. if (this.$refs.mpvueCityPicker.showPicker) {
  177. this.$refs.mpvueCityPicker.pickerCancel()
  178. }
  179. }
  180. };
  181. </script>
  182. <style lang="scss">
  183. .content1{
  184. display: flex;
  185. flex-direction: column;
  186. justify-content: center;
  187. align-items: center;
  188. .success-icon{
  189. font-size: 160upx;
  190. color: #fa436a;
  191. margin-top: 100upx;
  192. }
  193. .tit{
  194. font-size: 38upx;
  195. color: #303133;
  196. }
  197. .btn-group{
  198. padding-top: 100upx;
  199. }
  200. .mix-btn {
  201. margin-top: 30upx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. width: 600upx;
  206. height: 80upx;
  207. font-size: $font-lg;
  208. color: #fff;
  209. background-color: $base-color;
  210. border-radius: 10upx;
  211. &.hollow{
  212. background: #fff;
  213. color: #303133;
  214. border: 1px solid #ccc;
  215. }
  216. }
  217. }
  218. .save{
  219. view{
  220. display: flex;
  221. }
  222. position: fixed;
  223. bottom: 0;
  224. width: 100%;
  225. height: 120upx;
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. .btn{
  230. box-shadow: 0upx 5upx 10upx rgba(0,0,0,0.4);
  231. width: 70%;
  232. height: 80upx;
  233. border-radius: 80upx;
  234. background-color: #f06c7a;
  235. color: #fff;
  236. justify-content: center;
  237. align-items: center;
  238. .icon{
  239. height: 80upx;
  240. color: #fff;
  241. font-size: 30upx;
  242. justify-content: center;
  243. align-items: center;
  244. }
  245. font-size: 30upx;
  246. }
  247. }
  248. .content{
  249. display: flex;
  250. flex-wrap: wrap;
  251. .row{
  252. width: 94%;
  253. display: flex;
  254. margin: 20upx 3%;
  255. border-top: solid 1upx #eee;
  256. align-items: center;
  257. .nominal{
  258. width: 30%;
  259. font-weight: 200;
  260. font-size: 30upx;
  261. align-items: center;
  262. }
  263. .input{
  264. width: 70%;
  265. padding: 20upx 0;
  266. align-items: center;
  267. font-size: 30upx;
  268. &.switch{
  269. justify-content: flex-end;
  270. }
  271. .textarea{
  272. margin: 20upx 0;
  273. min-height: 120upx;
  274. }
  275. }
  276. }
  277. }
  278. </style>