personalInfo.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <!--
  2. 个人信息收集清单
  3. http://localhost:5173/card/#/pages/app/info/personalInfo
  4. https://oss-mbh5.colormaprun.com/card/#/pages/app/info/personalInfo
  5. -->
  6. <template>
  7. <view class="main">
  8. <view class="title">彩图奔跑个人信息收集清单</view>
  9. <uni-table ref="table" class="table" border emptyText="暂无更多数据">
  10. <uni-tr class="tbHeader">
  11. <uni-th class="th" width="80" align="center">信息名称</uni-th>
  12. <uni-th class="th" width="80" align="center">使用目的</uni-th>
  13. <uni-th class="th" width="80" align="center">使用场景</uni-th>
  14. <uni-th class="th" width="80" align="center">收集情况</uni-th>
  15. <uni-th class="th" width="80" align="center">信息内容</uni-th>
  16. </uni-tr>
  17. <uni-tr v-for="(item, index) in tableData" :key="index">
  18. <uni-td class="tbText" align="center">
  19. <view>{{item.name}}</view>
  20. </uni-td>
  21. <uni-td class="tbText" align="center">
  22. <view>{{item.purpose}}</view>
  23. </uni-td>
  24. <uni-td class="tbText" align="center">
  25. <view>{{item.scene}}</view>
  26. </uni-td>
  27. <uni-td class="tbText" align="center">
  28. <view>{{item.status}}</view>
  29. </uni-td>
  30. <uni-td class="tbText" align="center">
  31. <image v-if="item.contentType == 'img'" class="headimg" mode="aspectFit" :src="item.content"></image>
  32. <view v-else>{{item.content}}</view>
  33. </uni-td>
  34. </uni-tr>
  35. </uni-table>
  36. </view>
  37. </template>
  38. <script>
  39. import tools from '../../../common/tools';
  40. import {
  41. token,
  42. apiUserBasicInformationQuery,
  43. checkResCode
  44. } from '../../../common/api';
  45. export default {
  46. data() {
  47. return {
  48. queryObj: {},
  49. queryString: "",
  50. token: "",
  51. userInfo: {},
  52. // userInfo: {
  53. // "oId": 8,
  54. // "phone": "15168870729",
  55. // "nickName": "虚室生白",
  56. // "headUrl": "https://orienteering.beswell.com/orienteering_head_1713776302_8_%E8%99%9A%E5%AE%A4%E7%94%9F%E7%99%BD.jpeg",
  57. // "height": 1890,
  58. // "weight": 112500,
  59. // "sex": 1,
  60. // "staticHr": 60,
  61. // "age": 39
  62. // },
  63. tableData: [{
  64. name: "用户ID",
  65. purpose: "展示用户ID",
  66. scene: "用户注册账号、用户报名参赛、赛事成绩展示",
  67. status: "未收集",
  68. content: ""
  69. },
  70. {
  71. name: "昵称",
  72. purpose: "完善网络身份标识、展示昵称",
  73. scene: "注册账号、报名参赛、赛事成绩展示",
  74. status: "未收集",
  75. content: ""
  76. },
  77. {
  78. name: "头像",
  79. purpose: "完善网络身份标识、展示头像",
  80. scene: "报名参赛、赛事成绩展示",
  81. status: "未收集",
  82. content: "",
  83. contentType: "img"
  84. },
  85. {
  86. name: "手机号",
  87. purpose: "账号登录、赛事安全服务",
  88. scene: "身份验证、报名参赛凭据、用户赛事安全服务",
  89. status: "未收集",
  90. content: ""
  91. },
  92. {
  93. name: "身高",
  94. purpose: "计算卡路里",
  95. scene: "比赛过程中计算用户的卡路里消耗情况",
  96. status: "未收集",
  97. content: ""
  98. },
  99. {
  100. name: "体重",
  101. purpose: "计算卡路里",
  102. scene: "比赛过程中计算用户的卡路里消耗情况",
  103. status: "未收集",
  104. content: ""
  105. },
  106. {
  107. name: "年龄",
  108. purpose: "计算卡路里",
  109. scene: "比赛过程中计算用户的卡路里消耗情况",
  110. status: "未收集",
  111. content: ""
  112. },
  113. {
  114. name: "静息心率",
  115. purpose: "计算卡路里",
  116. scene: "比赛过程中计算用户的卡路里消耗情况",
  117. status: "未收集",
  118. content: ""
  119. },
  120. {
  121. name: "位置信息",
  122. purpose: "计算配速里程",
  123. scene: "比赛过程中计算用户的配速、里程信息",
  124. status: "未收集",
  125. content: ""
  126. },
  127. /* {
  128. name: "位置信息",
  129. purpose: "XXX",
  130. scene: "XXX",
  131. status: "未收集",
  132. content: ""
  133. }, */
  134. ]
  135. }
  136. },
  137. onLoad(query) { // 类型非必填,可自动推导
  138. // console.log(query);
  139. this.queryObj = query;
  140. this.queryString = tools.objectToQueryString(this.queryObj);
  141. // console.log(queryString);
  142. this.token = query["token"] ?? token;
  143. this.userBasicInformationQuery();
  144. // this.dealUserInfo();
  145. },
  146. methods: {
  147. // 用户基本信息查询
  148. userBasicInformationQuery() {
  149. uni.request({
  150. url: apiUserBasicInformationQuery,
  151. header: {
  152. "Content-Type": "application/x-www-form-urlencoded",
  153. "Authorization": "Bearer " + this.token,
  154. // "token": this.token
  155. },
  156. method: "GET",
  157. data: {},
  158. success: (res) => {
  159. // console.log("userBasicInformationQuery", res);
  160. if (checkResCode(res)) {
  161. const userinfo = res.data.data.list;
  162. this.userInfo = userinfo;
  163. this.dealUserInfo();
  164. }
  165. },
  166. fail: (err) => {
  167. console.log("userBasicInformationQuery err", err)
  168. },
  169. });
  170. },
  171. dealUserInfo() {
  172. // console.log("dealUserInfo length", Object.keys(this.userInfo).length);
  173. if (Object.keys(this.userInfo).length > 0) {
  174. if (this.userInfo.oId > 0) {
  175. this.tableData[0].status = "已收集";
  176. this.tableData[0].content = this.userInfo.oId;
  177. }
  178. if (this.userInfo.nickName.length > 0) {
  179. this.tableData[1].status = "已收集";
  180. this.tableData[1].content = this.userInfo.nickName;
  181. }
  182. if (this.userInfo.headUrl.length > 0) {
  183. this.tableData[2].status = "已收集";
  184. this.tableData[2].content = this.userInfo.headUrl;
  185. }
  186. if (this.userInfo.phone.length > 0) {
  187. this.tableData[3].status = "已收集";
  188. this.tableData[3].content = this.userInfo.phone;
  189. }
  190. if (this.userInfo.height > 0) {
  191. this.tableData[4].status = "已收集";
  192. this.tableData[4].content = this.userInfo.height;
  193. }
  194. if (this.userInfo.weight > 0) {
  195. this.tableData[5].status = "已收集";
  196. this.tableData[5].content = this.userInfo.weight;
  197. }
  198. if (this.userInfo.age > 0) {
  199. this.tableData[6].status = "已收集";
  200. this.tableData[6].content = this.userInfo.age;
  201. }
  202. if (this.userInfo.staticHr > 0) {
  203. this.tableData[7].status = "已收集";
  204. this.tableData[7].content = this.userInfo.staticHr;
  205. }
  206. // this.tableData[8].content = this.userInfo.sex;
  207. }
  208. }
  209. }
  210. }
  211. </script>
  212. <style scoped>
  213. .main {
  214. width: 100vw;
  215. height: 100vh;
  216. background-color: #f5f5f5;
  217. }
  218. .title {
  219. padding-top: 40px;
  220. padding-bottom: 20px;
  221. text-align: center;
  222. font-size: 18px;
  223. font-weight: bold;
  224. }
  225. .table {}
  226. .tbHeader {
  227. background-color: #fcfcfc;
  228. }
  229. .th {
  230. color: #000;
  231. font-size: 14px;
  232. }
  233. .tbText {
  234. font-size: 14px;
  235. }
  236. .headimg {
  237. width: 60px;
  238. height: 60px;
  239. }
  240. </style>