about.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view>
  3. <u-navbar :border-bottom="false" back-icon-size="35" title="关于我们" title-size="32" :background="background"
  4. :back-text-style="hhyanm" title-color="#000000" back-icon-color="#000000"></u-navbar>
  5. <view class="box" v-if="state == 0 || state == 3">
  6. <view class="item-submit" v-if="state == 3">
  7. <view>审核未通过, 请重新提交审核</view>
  8. </view>
  9. <view class="item">
  10. <view class="item-text">联系我们</view>
  11. </view>
  12. <view class="item">
  13. <view class="item-text">反馈意见</view>
  14. </view>
  15. <view class="item">
  16. <view class="item-text">检查更新</view>
  17. </view>
  18. </view>
  19. <view class="item">
  20. <view class="item-text">清除缓存</view>
  21. </view>
  22. <view class="item">
  23. <view class="item-text">性别</view>
  24. </view>
  25. </view>
  26. <view v-if="state == 1">
  27. <view class="item-submit">
  28. 目前正在审核请耐心等待
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. title: '',
  38. phone: '',
  39. username: '',
  40. password: '',
  41. img: '',
  42. content: '',
  43. array: [{
  44. name: '男'
  45. }, {
  46. name: '女'
  47. }],
  48. action: 'https://xlzx.vvv5g.com/app/index.php?i=2&c=entry&a=wxapp&m=yzd_edu&do=UploadImg', // 图片上传地址
  49. index: 0,
  50. state: 0,
  51. }
  52. },
  53. onLoad() {
  54. this.getMyIdentity();
  55. },
  56. methods: {
  57. getMyIdentity: function(e) {
  58. this.$post({
  59. data: {
  60. do: 'GetMyIdentity',
  61. data: {
  62. user_id: uni.getStorageSync('id'),
  63. }
  64. }
  65. }).then(res => {
  66. this.state = res.data.state;
  67. })
  68. },
  69. // 选择图片上传
  70. choodeImage() {
  71. uni.chooseImage({
  72. count: 1,
  73. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  74. sourceType: ['album'], //从相册选择
  75. success: (res) => {
  76. // this.img = res.tempFilePaths[0]
  77. uni.showLoading({
  78. title: '上传中...'
  79. })
  80. uni.uploadFile({
  81. url: 'https://xlzx.vvv5g.com/app/index.php?i=2&c=entry&a=wxapp&m=yzd_edu&do=UploadImg', //仅为示例,非真实的接口地址
  82. filePath: res.tempFilePaths[0],
  83. name: 'upfile',
  84. success: (uploadFileRes) => {
  85. uni.hideLoading()
  86. console.log(uploadFileRes, '111111111111111')
  87. console.log(uploadFileRes);
  88. this.img = uploadFileRes.data
  89. }
  90. });
  91. }
  92. })
  93. },
  94. bindPickerChange: function(e) {
  95. console.log('picker发送选择改变,携带值为:' + e.detail.value)
  96. this.index = e.detail.value
  97. },
  98. submit: function(e) {
  99. if (!this.title) {
  100. uni.showToast({
  101. title: '请输入姓名',
  102. icon: 'none'
  103. })
  104. return
  105. }
  106. if (!this.phone) {
  107. uni.showToast({
  108. title: '请输入手机号码',
  109. icon: 'none'
  110. })
  111. return
  112. }
  113. if (!this.username) {
  114. uni.showToast({
  115. title: '请输入账号',
  116. icon: 'none'
  117. })
  118. return
  119. }
  120. var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z]).{6,30}');
  121. if (!pwdRegex.test(this.password)) {
  122. uni.showToast({
  123. title: "您的密码复杂度太低(密码中必须包含字母、数字),请及时修改密码!",
  124. icon: 'none'
  125. })
  126. return
  127. }
  128. if (!this.img) {
  129. uni.showToast({
  130. title: '请上传您的资质',
  131. icon: 'none'
  132. })
  133. return
  134. }
  135. this.$post({
  136. data: {
  137. do: 'LecturerSettled',
  138. data: {
  139. "title": this.title,
  140. "phone": this.phone,
  141. "username": this.username,
  142. "password": this.password,
  143. "img": this.img,
  144. "content": '',
  145. "sex": this.index + 1,
  146. "user_id": uni.getStorageSync('id'),
  147. }
  148. }
  149. }).then(res => {
  150. console.log(res, 'ssssssssssssssssssssss')
  151. uni.showToast({
  152. title: '添加成功',
  153. mask: true
  154. })
  155. setTimeout(() => {
  156. uni.navigateBack()
  157. }, 1500)
  158. })
  159. }
  160. }
  161. }
  162. </script>
  163. <style>
  164. .item {
  165. display: flex;
  166. padding: 27rpx 0;
  167. border-bottom: 1px solid #f3f3f3;
  168. align-items: center;
  169. }
  170. .box {
  171. padding: 10rpx 30rpx;
  172. }
  173. .item-input {
  174. padding-left: 10rpx;
  175. width: 70%;
  176. }
  177. .item-text {
  178. min-width: 115rpx;
  179. }
  180. .img {
  181. width: 100%;
  182. height: 320rpx;
  183. }
  184. .item-button {
  185. width: 247rpx;
  186. max-content: 80rpx;
  187. text-align: center;
  188. line-height: 80rpx;
  189. background-color: #04ba8f;
  190. color: #fff;
  191. border-radius: 94rpx;
  192. box-shadow: 0 6rpx 6rpx rgba(0, 0, 0, .05);
  193. margin: 20rpx 0;
  194. }
  195. .item-submit {
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. }
  200. .item-u {
  201. display: flex;
  202. padding: 10rpx 0;
  203. align-items: center;
  204. }
  205. .choose-outer{
  206. width: 290rpx;
  207. height: 198rpx;
  208. border: 2px dotted #CCCCCC;
  209. border-radius: 15rpx;
  210. display: flex;
  211. flex-direction: column;
  212. justify-content: center;
  213. align-items: center;
  214. }
  215. </style>