shareUser.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view class="flex-col justify-start page">
  3. <cu-custom isBack="true" bgColor="#000000"><view slot="content" style="color: #FFFFFF">UU睡眠</view></cu-custom>
  4. <view class="flex-col justify-start section">
  5. <view class="flex-col section_2 space-y-421">
  6. <view class="flex-col">
  7. <text class="self-start font_1 text_2">共享用户</text>
  8. <view class="flex-col group_3 space-y-10">
  9. <view class="flex-row justify-between items-center section_6" v-for="(item, index) in tableData" :key="index">
  10. <view class="flex-row">
  11. <image v-if="item.face === null || item.face === ''" class="image_6" src="http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/7F70B5FF967F44BC97BD7CD8786A70B4.png"/>
  12. <image v-else class="image_6" :src="item.face"/>
  13. <view class="flex-col items-start group_4 space-y-10">
  14. <text class="font_1 text_3">{{ item.nickname }}</text>
  15. <text class="text_5">{{ item.mobile }}</text>
  16. <text class="text_6 text_7">{{ formatTime(item.create_time) }}</text>
  17. </view>
  18. </view>
  19. <view class="flex-col justify-start items-center text-wrapper" @click="deleteById(item.id)"><text class="text_4">删除</text></view>
  20. </view>
  21. <view class="flex-row justify-center items-center section_7 space-x-10" @click="modalName ='DialogModal'">
  22. <image class="image_7" src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/649415135a7e3f0310661c1e/649415b654fe0000116ae544/16874414496441492308.png"/>
  23. <text class="text_8">添加用户</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="flex-row justify-center items-center relative group_5">
  28. <view class="flex-col justify-start items-center button"><text class="font_2" @click="back">完成</text></view>
  29. <!-- <text class="font_2 text_6 pos_2">跳过</text>-->
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cu-modal" :class="modalName ==='DialogModal'?'show':''">
  34. <view class="cu-dialog">
  35. <view class="cu-bar bg-white justify-end">
  36. <view style="color: black" class="content">共享用户</view>
  37. <view class="action" @tap="hideModal">
  38. <text class="cuIcon-close text-red"></text>
  39. </view>
  40. </view>
  41. <view class="padding-xl">
  42. <input v-model="searchPhone" placeholder="请输入对方手机号" name="input" />
  43. </view>
  44. <view class="cu-bar bg-white justify-end">
  45. <view class="action">
  46. <button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
  47. <button class="cu-btn bg-green margin-left" @tap="addLook">申请查看</button>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import Storage from '@/utils/storage'
  56. import { unixToDate } from '@/ui-utils/Foundation'
  57. import * as API_vitalSignsLook from '@/api/vitalSignsLook'
  58. import {addByMobile} from "../../api/vitalSignsLook";
  59. export default {
  60. data() {
  61. return {
  62. page_size: 20,
  63. page_no: 1,
  64. tableData: [],
  65. finishedLoad: false,
  66. uid: '',
  67. modalName: false,
  68. searchPhone: ''
  69. }
  70. },
  71. onShow() {
  72. this.uid = Storage.getItem('uid')
  73. if (this.uid) {
  74. this.sx()
  75. }
  76. },
  77. onPullDownRefresh() {
  78. this.sx()
  79. },
  80. onReachBottom() {
  81. if (!this.finishedLoad) {
  82. this.page_no += 1;
  83. this.GET_MemberList()
  84. }
  85. },
  86. methods: {
  87. sx() {
  88. this.page_no = 1
  89. this.finishedLoad = false
  90. this.tableData = []
  91. this.GET_MemberList()
  92. },
  93. /** 加载用户列表 */
  94. GET_MemberList() {
  95. const params = {
  96. page_no: this.page_no,
  97. page_size: this.page_size,
  98. }
  99. params.fixedCondition = ' ccll.status=1 and ccll.friend_id=' + this.uid + ' and ccll.member_id = em.member_id'
  100. let _this = this
  101. API_vitalSignsLook.getList(params).then(res => {
  102. console.log('res====', res)
  103. if (res.data.length > 0) {
  104. _this.tableData.push(...res.data);
  105. } else {
  106. _this.finishedLoad = true;
  107. }
  108. }).catch(() => {
  109. _this.loading = false
  110. })
  111. },
  112. back() {
  113. uni.navigateBack()
  114. },
  115. formatTime(value) {
  116. return unixToDate(value, '')
  117. },
  118. deleteById(id) {
  119. let _this = this
  120. uni.showModal({
  121. title: '警告',
  122. content: '删除操作后数据不可复原,您确定要删除此数据?',
  123. success: function (res) {
  124. if (res.confirm) {
  125. API_vitalSignsLook.deleteLogLook(id).then(
  126. res => {
  127. _this.sx()
  128. uni.showToast({
  129. title: '已删除!'
  130. })
  131. }
  132. )
  133. }
  134. }
  135. })
  136. },
  137. hideModal(e) {
  138. this.modalName = null
  139. },
  140. addLook() {
  141. if (this.searchPhone === '') {
  142. uni.showModal({
  143. content: '请输入对方手机号',
  144. showCancel: false
  145. })
  146. return
  147. }
  148. let params = {
  149. friend_id: this.uid,
  150. type: 0,
  151. add_member_id: this.uid,
  152. status: 1,
  153. phone: this.searchPhone
  154. }
  155. const _this = this
  156. API_vitalSignsLook.addByMobile(params).then(res => {
  157. if (!res.success) {
  158. uni.showModal({
  159. content: res.message,
  160. showCancel: false
  161. })
  162. } else {
  163. uni.showToast({
  164. title: '操作成功',
  165. icon: 'none'
  166. })
  167. _this.modalName = null
  168. _this.searchPhone = ''
  169. _this.sx()
  170. }
  171. })
  172. }
  173. }
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. .page {
  178. background-color: #000000;
  179. width: 100%;
  180. overflow-y: auto;
  181. overflow-x: hidden;
  182. height: 100%;
  183. .section {
  184. background-image: url("http://wdklmall.oss-cn-shenzhen.aliyuncs.com/mallgoods/goods/2E8800F59CE14717A09884B811B3C608.png");
  185. background-size: auto;
  186. background-repeat: no-repeat;
  187. .section_2 {
  188. padding-bottom: 1.25rem;
  189. background-image: linear-gradient(180deg, #1e1ef7e3 0%, #1dbff59c 100%);
  190. .section_3 {
  191. padding: 1.13rem 0.44rem 0.38rem;
  192. background-color: #ffffff4d;
  193. .group {
  194. padding: 0 0.5rem;
  195. .image {
  196. width: 1.06rem;
  197. height: 0.69rem;
  198. }
  199. .image_2 {
  200. width: 0.94rem;
  201. height: 0.69rem;
  202. }
  203. .image_3 {
  204. width: 1.5rem;
  205. height: 0.72rem;
  206. }
  207. }
  208. .space-x-6-reverse {
  209. & > view:not(:last-child),
  210. & > text:not(:last-child),
  211. & > image:not(:last-child) {
  212. margin-right: 0.38rem;
  213. }
  214. }
  215. .group_2 {
  216. padding: 0.63rem 0 0.38rem;
  217. .text {
  218. font-size: 1.16rem;
  219. }
  220. .section_4 {
  221. padding: 0.38rem 0.75rem;
  222. background-color: #ffffff99;
  223. border-radius: 1rem;
  224. border: solid 0.031rem #00000014;
  225. .image-wrapper {
  226. width: 1.19rem;
  227. .image_5 {
  228. width: 1.19rem;
  229. height: 0.44rem;
  230. }
  231. .image_4 {
  232. width: 1.13rem;
  233. height: 1.06rem;
  234. }
  235. }
  236. .section_5 {
  237. background-color: #00000033;
  238. width: 0.063rem;
  239. height: 1.16rem;
  240. }
  241. }
  242. .space-x-11 {
  243. & > view:not(:first-child),
  244. & > text:not(:first-child),
  245. & > image:not(:first-child) {
  246. margin-left: 0.69rem;
  247. }
  248. }
  249. .pos {
  250. position: absolute;
  251. right: 0;
  252. top: 50%;
  253. transform: translateY(-50%);
  254. }
  255. }
  256. }
  257. .space-y-22 {
  258. & > view:not(:first-child),
  259. & > text:not(:first-child),
  260. & > image:not(:first-child) {
  261. margin-top: 1.38rem;
  262. }
  263. }
  264. .font_1 {
  265. font-size: 1.13rem;
  266. font-family: PingFangSC;
  267. line-height: 1.06rem;
  268. color: #ffffff;
  269. }
  270. .text_2 {
  271. margin-left: 1.25rem;
  272. margin-top: 1.38rem;
  273. }
  274. .group_3 {
  275. margin-top: 0.88rem;
  276. padding: 0 1.25rem;
  277. .section_6 {
  278. padding: 0.94rem 0 0.94rem 0.94rem;
  279. background-color: #ffffff33;
  280. border-radius: 1rem;
  281. .image_6 {
  282. border-radius: 50%;
  283. width: 4rem;
  284. height: 4rem;
  285. }
  286. .group_4 {
  287. margin: 0.25rem 0 0.25rem 1.25rem;
  288. .text_3 {
  289. line-height: 1.03rem;
  290. }
  291. .text_5 {
  292. color: #ffffff;
  293. font-size: 0.88rem;
  294. font-family: PingFangSC;
  295. line-height: 0.63rem;
  296. }
  297. .text_7 {
  298. color: #ffffff;
  299. font-size: 0.63rem;
  300. font-family: PingFangSC;
  301. line-height: 0.47rem;
  302. }
  303. }
  304. .text-wrapper {
  305. padding: 0.25rem 0;
  306. background-image: linear-gradient(90deg, #2c3ff2 0%, #1e09de 100%);
  307. border-radius: 6.25rem 0px 0px 6.25rem;
  308. width: 2.75rem;
  309. height: 1.25rem;
  310. .text_4 {
  311. color: #ffffff;
  312. font-size: 0.75rem;
  313. font-family: PingFangSC;
  314. line-height: 0.69rem;
  315. }
  316. }
  317. }
  318. .section_7 {
  319. padding: 2.13rem 0;
  320. background-color: #ffffff33;
  321. border-radius: 1rem;
  322. .image_7 {
  323. width: 1.5rem;
  324. height: 1.5rem;
  325. }
  326. .text_8 {
  327. color: #ffffff;
  328. font-size: 1.5rem;
  329. font-family: PingFangSC;
  330. line-height: 1.41rem;
  331. }
  332. }
  333. .space-x-10 {
  334. & > view:not(:first-child),
  335. & > text:not(:first-child),
  336. & > image:not(:first-child) {
  337. margin-left: 0.63rem;
  338. }
  339. }
  340. }
  341. .space-y-10 {
  342. & > view:not(:first-child),
  343. & > text:not(:first-child),
  344. & > image:not(:first-child) {
  345. margin-top: 0.63rem;
  346. }
  347. }
  348. .group_5 {
  349. padding: 0 1.75rem;
  350. .button {
  351. padding: 0.5rem 0;
  352. background-image: linear-gradient(90deg, #5611f780 0%, #2c3ff7 100%);
  353. border-radius: 1rem;
  354. width: 8.69rem;
  355. }
  356. .font_2 {
  357. font-size: 1rem;
  358. font-family: PingFangSC;
  359. line-height: 0.94rem;
  360. color: #ffffff;
  361. }
  362. .pos_2 {
  363. position: absolute;
  364. right: 1.78rem;
  365. top: 50%;
  366. transform: translateY(-50%);
  367. }
  368. }
  369. .text_6 {
  370. opacity: 0.5;
  371. }
  372. }
  373. .space-y-421 {
  374. & > view:not(:first-child),
  375. & > text:not(:first-child),
  376. & > image:not(:first-child) {
  377. margin-top: 26.31rem;
  378. }
  379. }
  380. }
  381. }
  382. </style>