org_member.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <view class="content">
  3. <view>
  4. <view class="active-title-box">
  5. <picker @change="bindPickerChange" :value="index" :range="orgArray" :range-key="'name'">
  6. <view class="uni-input">{{orgValue}}</view>
  7. <image src="/static/arrow_down.svg" mode="aspectFit"></image>
  8. </picker>
  9. </view>
  10. <view class="active-box" v-for="(item,index) in orgList" :key="index">
  11. <view class="active-content-box">
  12. <view class="active-content">
  13. <view class="active-name">{{item.name}}</view>
  14. <view class="active-date">({{item.office}})</view>
  15. </view>
  16. <view class="active-content" style="margin-top: 10rpx">
  17. <view>{{item.phone}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view v-if="!orgList.length" style="text-align: center;">
  22. <image src="/static/nodata.svg" mode="aspectFit" style="width: 300rpx;height: 300rpx;"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import md5 from "@/common/md5.js";
  29. export default {
  30. components: {
  31. },
  32. data() {
  33. return {
  34. isAuth:getApp().globalData.globalAuth,
  35. userHeadImg: getApp().globalData.user_headUrl,
  36. userNickName:getApp().globalData.user_name,
  37. orgValue:'',
  38. orgArray:[],
  39. orgId:'',
  40. index: 0,
  41. orgList:[]
  42. };
  43. },
  44. onShow() {
  45. },
  46. onLoad(){
  47. this.getMemberGroup();
  48. },
  49. methods: {
  50. bindPickerChange: function(e) {
  51. this.orgValue = this.orgArray[e.target.value].name;
  52. this.orgId = this.orgArray[e.target.value].branch_id;
  53. this.getMemberList(this.orgId);
  54. },
  55. change(e) {
  56. this.single = e;
  57. console.log("-change事件:", e);
  58. },
  59. getMemberGroup() {
  60. let md5Sign = md5(
  61. "method=" +"member" + "&timestamp=" + getApp().globalData.globalTimestamp +
  62. "&secret=" + getApp().globalData.secret
  63. );
  64. let url = getApp().globalData.shareUrl +"api/api.php" +
  65. "?method=member&action=member_branch&timestamp=" +
  66. getApp().globalData.globalTimestamp +
  67. "&sign=" +
  68. md5Sign;
  69. uni.request({
  70. url: url,
  71. method: "POST",
  72. header: {
  73. "content-type": "application/x-www-form-urlencoded",
  74. },
  75. data: {
  76. openid: getApp().globalData.open_id,
  77. },
  78. success: (res) => {
  79. if (res.data.code === 200) {
  80. this.orgArray = res.data.data;
  81. if(this.orgArray.length){
  82. this.orgValue = this.orgArray[0].name;
  83. this.getMemberList(this.orgArray[0].branch_id)
  84. }
  85. }
  86. },
  87. fail: () => {
  88. console.log("连接失败");
  89. },
  90. });
  91. },
  92. getMemberList(branchId) {
  93. let md5Sign = md5(
  94. "method=" +"member" + "&timestamp=" + getApp().globalData.globalTimestamp +
  95. "&secret=" + getApp().globalData.secret
  96. );
  97. let url = getApp().globalData.shareUrl +"api/api.php" +
  98. "?method=member&action=member_by_branch&timestamp=" +
  99. getApp().globalData.globalTimestamp +
  100. "&sign=" +
  101. md5Sign;
  102. uni.request({
  103. url: url,
  104. method: "POST",
  105. header: {
  106. "content-type": "application/x-www-form-urlencoded",
  107. },
  108. data: {
  109. openid: getApp().globalData.open_id,
  110. branch_id:branchId,
  111. },
  112. success: (res) => {
  113. if (res.data.code === 200) {
  114. this.orgList = res.data.data;
  115. }
  116. },
  117. fail: () => {
  118. console.log("连接失败");
  119. },
  120. });
  121. },
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .content {
  127. display: flex;
  128. flex-direction: column;
  129. .self-inf {
  130. // border-radius: 0rpx 0rpx 100% 100%;
  131. .img-name-box {
  132. height: 150rpx;
  133. margin-top: 20rpx;
  134. margin-bottom: 20rpx;
  135. display: flex;
  136. align-items: center;
  137. width: 85%;
  138. .auth-btn {
  139. margin-left: 30rpx;
  140. margin-top: 20rpx;
  141. font-size: 28rpx;
  142. background-color: #02a7f0;
  143. color: #fff;
  144. }
  145. .heade-img {
  146. z-index: 1;
  147. width: 100rpx;
  148. height: 100rpx;
  149. border-radius: 50%;
  150. // margin-left: 80rpx;
  151. }
  152. }
  153. .nickname {
  154. font-weight: 600;
  155. font-size: 28rpx;
  156. margin-left: 30rpx;
  157. margin-top: 20rpx;
  158. color: #555;
  159. letter-spacing: 1rpx;
  160. }
  161. }
  162. }
  163. .antu-box {
  164. display: flex;
  165. flex-direction: column;
  166. align-items: center;
  167. background: #fff;
  168. margin-left: 5%;
  169. margin-top: 50rpx;
  170. border-radius: 10rpx;
  171. width: 90%;
  172. color: #555;
  173. box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.2);
  174. }
  175. .org-info-box {
  176. display: flex;
  177. justify-content: space-evenly;
  178. height: 80rpx;
  179. align-items: center;
  180. width: 100%;
  181. border-top: 1px solid #d4d4d4;
  182. color: #555;
  183. font-size: 28rpx;
  184. background: #fff;
  185. }
  186. .org-line {
  187. width: 1px;
  188. height: 82rpx;
  189. background: #d4d4d4;
  190. }
  191. .active-title-box {
  192. display: flex;
  193. align-items: center;
  194. margin-top: 10rpx;
  195. font-size: 26rpx;
  196. height: 100rpx;
  197. border-bottom: 1px solid #d7d7d7;
  198. margin-top: 10rpx;
  199. .time-select-box {
  200. width: 32%;
  201. margin-left: 5%;
  202. }
  203. picker {
  204. width: 30%;
  205. border: 1px solid #d7d7d7;
  206. height: 60rpx;
  207. line-height: 60rpx;
  208. border-radius: 10rpx;
  209. margin-left: 20rpx;
  210. padding: 0 10rpx;
  211. position: relative;
  212. image {
  213. width: 20rpx;
  214. height: 20rpx;
  215. position: absolute;
  216. top: 11px;
  217. right: 5px;
  218. }
  219. }
  220. button {
  221. width: 24%;
  222. font-size: 25rpx;
  223. background: #4988fd;
  224. color: #fff;
  225. margin-left: 25rpx;
  226. }
  227. }
  228. .active-box {
  229. display: flex;
  230. align-items: center;
  231. position: relative;
  232. font-size: 28rpx;
  233. padding: 15rpx;
  234. border-bottom: 1px solid #d7d7d7;
  235. .active-type {
  236. width: 100rpx;
  237. height: 100rpx;
  238. border-radius: 50%;
  239. background-color: yellow;
  240. text-align: center;
  241. display: flex;
  242. align-items: center;
  243. font-size: 26rpx;
  244. color: #fff;
  245. }
  246. .active-content-box {
  247. display: flex;
  248. flex-direction: column;
  249. margin-left: 10rpx;
  250. width: 100%;
  251. }
  252. .active-content {
  253. display: flex;
  254. align-items: center;
  255. height: 45rpx;
  256. font-size: 28rpx;
  257. .active-name {
  258. font-size: 30rpx;
  259. width: 18%;
  260. }
  261. .active-date {
  262. color: #999;
  263. }
  264. }
  265. .edit-icon-box {
  266. position: absolute;
  267. right: 10px;
  268. top: 10px;
  269. image {
  270. width: 35rpx;
  271. height: 35rpx;
  272. margin-right: 10rpx;
  273. }
  274. }
  275. .bg-yellow {
  276. background-color: #ffdd40;
  277. }
  278. .bg-red {
  279. background-color: #ec808d;
  280. }
  281. .bg-blue {
  282. background-color: #81d3f8;
  283. }
  284. }
  285. </style>