set.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="body">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <block v-for="(item,index) in list" :key="index">
  6. <my-list-item :item="item" :index="index" @authModal="authModal" @weixinMsg="weixinMsg"
  7. @zhifubaoMsg="zhifubaoMsg" :someData="status"></my-list-item>
  8. </block>
  9. <button class="my-3 mt-4 mx-3 dis a-c j-c btn" type="primary" @tap="logout">退出登录</button>
  10. <auth-Modal :authShow="authShow" @btnClick="authShow=false" @maskClick="authShow=false"></auth-Modal>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. mapState
  16. } from "vuex"
  17. import {
  18. mapMutations
  19. } from "vuex"
  20. import authModal from '@/components/modules/user/authModal.vue'; //实名认证弹窗
  21. import myListItem from "@/components/modules/my/my-list-item.vue";
  22. export default {
  23. components: {
  24. myListItem,
  25. authModal
  26. },
  27. data() {
  28. return {
  29. authShow: false,
  30. list: [{
  31. icon: "",
  32. name: "账号管理",
  33. clicktype: "navigateTo",
  34. url: "/pages/set/safe",
  35. auth: true
  36. },
  37. // {
  38. // icon: "",
  39. // name: "实名认证",
  40. // clicktype: "auth",
  41. // text: "",
  42. // borderColor: "",
  43. // backColor: "",
  44. // url: ""
  45. // },
  46. {
  47. icon: "",
  48. name: "微信绑定",
  49. clicktype: "weixin",
  50. url: "",
  51. text: '未绑定',
  52. },
  53. {
  54. icon: "",
  55. name: "支付宝绑定",
  56. clicktype: "zhifubao",
  57. url: "",
  58. text: '未绑定',
  59. },
  60. // {
  61. // icon: "",
  62. // name: "清除缓存",
  63. // clicktype: "clear",
  64. // url: "",
  65. // },
  66. // {
  67. // icon: "",
  68. // name: "常见问题",
  69. // clicktype: "navigateTo",
  70. // url: "/pages/set/question",
  71. // auth: true
  72. // },
  73. {
  74. icon: "",
  75. name: "关于合伙人",
  76. clicktype: "navigateTo",
  77. url: "/pages/set/about",
  78. text: "",
  79. auth: false
  80. },
  81. ],
  82. status: {
  83. weixinstatus: false,
  84. zhifubaostatus: false,
  85. }
  86. }
  87. },
  88. computed: {
  89. ...mapState(['userInfo'])
  90. },
  91. // mounted() {
  92. // this.bindingStatus();
  93. // this.isBindAlipay();
  94. // },
  95. onLoad() {
  96. // #ifdef APP
  97. this.bindingStatus();
  98. this.isBindAlipay();
  99. //#endif
  100. if (this.userInfo.sysUser.status == '0' && this.userInfo.sysUser.managementSource == '2') {
  101. if (this.userInfo.sysUser.factorVerify == '2') {
  102. this.list[1].text = '实名认证失败';
  103. this.list[1].borderColor = '#FF0000';
  104. this.list[1].backColor = '#FFE2E2';
  105. this.lsit[1].url = '/pages/user/authInfo';
  106. } else {
  107. this.list[1].text = '未认证';
  108. this.list[1].borderColor = '#0052FF';
  109. this.list[1].backColor = '#DDE8FF';
  110. }
  111. } else if (this.userInfo.sysUser.status == '8') {
  112. this.list[1].text = '待补充资料';
  113. this.list[1].borderColor = '#FFB800';
  114. this.list[1].backColor = '#FFF3D3';
  115. this.lsit[1].url = '/pages/user/practitionerInfo';
  116. } else if (this.userInfo.sysUser.status == '3') {
  117. this.list[1].text = '审核不通过';
  118. this.list[1].borderColor = '#FF0000';
  119. this.list[1].backColor = '#FFE2E2';
  120. this.lsit[1].url = '/pages/user/practitionerInfo';
  121. } else if (this.userInfo.sysUser.status == '2') {
  122. this.list[1].text = '资料审核中';
  123. this.list[1].borderColor = '#FFB800';
  124. this.list[1].backColor = '#FFF3D3';
  125. this.lsit[1].url = '/pages/user/authResult1';
  126. } else if (this.userInfo.sysUser.status == '1') {
  127. this.list[1].text = '已认证';
  128. this.list[1].borderColor = '#0052FF';
  129. this.list[1].backColor = '#DDE8FF';
  130. }
  131. },
  132. async onShow() {
  133. // #ifdef APP
  134. let args = plus.runtime.arguments;
  135. if (args) {
  136. plus.runtime.arguments = null; //进入之后就把urlscheme清空要不然下一次oushow时还会执行
  137. // 处理args参数,如直达到某新页面等
  138. //通过code请求获取user_id
  139. var authCode = args.split("=")[1];
  140. if (authCode != undefined && authCode != "" && authCode != null) {
  141. let res = await this.$http.post("/APPPartner/bindAlipay", {
  142. code: authCode,
  143. })
  144. if (res.code == '200') {
  145. uni.showToast({
  146. title: res.msg,
  147. icon: "success"
  148. });
  149. this.isBindAlipay();
  150. } else {
  151. uni.showToast({
  152. title: res.msg,
  153. icon: "none"
  154. });
  155. }
  156. }
  157. }
  158. //#endif
  159. },
  160. methods: {
  161. ...mapMutations(['emptyUserInfo']),
  162. logout() {
  163. this.emptyUserInfo();
  164. setTimeout(() => {
  165. uni.reLaunch({
  166. url: "/pages/login/login"
  167. })
  168. return true;
  169. }, 500);
  170. },
  171. authModal(res) {
  172. this.authShow = res;
  173. },
  174. //微信绑定查询
  175. async bindingStatus() {
  176. let res = await this.$http.get("/APPPartner/checkBindWechat")
  177. if (res.code == '200') {
  178. this.list[2].text = "已绑定"
  179. this.status.weixinstatus = true;
  180. } else {
  181. this.status.weixinstatus = false;
  182. }
  183. },
  184. //支付宝绑定查询
  185. async isBindAlipay() {
  186. let res = await this.$http.get("/APPPartner/checkBindAlipay")
  187. if (res.code == '200') {
  188. this.list[3].text = "已绑定"
  189. this.status.zhifubaostatus = true;
  190. } else {
  191. this.status.zhifubaostatus = false;
  192. }
  193. },
  194. weixinMsg(res) {
  195. if (res.code == '200') {
  196. uni.showToast({
  197. title: res.msg,
  198. icon: "success"
  199. });
  200. this.bindingStatus();
  201. } else {
  202. uni.showToast({
  203. title: res.msg,
  204. icon: "none"
  205. });
  206. }
  207. },
  208. zhifubaoMsg(res) {
  209. if (res.code == '200') {
  210. uni.showToast({
  211. title: res.msg,
  212. icon: "success"
  213. });
  214. this.isBindAlipay();
  215. } else {
  216. uni.showToast({
  217. title: res.msg,
  218. icon: "none"
  219. });
  220. }
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .btn {
  227. background: #fff;
  228. border-radius: 4px;
  229. border: 1px solid #343EEF;
  230. color: #343EEF;
  231. font-size: 32rpx;
  232. }
  233. </style>