customerDetail.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view>
  3. <view class="topBgline plr20">
  4. <view class="justify-start p30 bgcolf radius12">
  5. <u-avatar :src='detailUser.avatar'></u-avatar>
  6. <view class="ml16">
  7. <view class="bold fs28">{{detailUser.name}}</view>
  8. <view class="fs24 base-color-3">备注:{{detailUser.remark}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="bgf p20">
  13. <view>会员资料</view>
  14. <view class="justify-between">
  15. <view class="justify-start align-center fs24 mt20 widthpath" >
  16. <view class="base-color-6 mr40">性别</view>
  17. <view>{{moreInfo.sex?moreInfo.sex:'未知'}}</view>
  18. </view>
  19. <view class="justify-start align-center fs24 mt20 widthpath" >
  20. <view class="base-color-6 mr40">年龄</view>
  21. <view>{{moreInfo.age?moreInfo.age:'未知'}}</view>
  22. </view>
  23. </view>
  24. <view class="justify-start align-center fs24 mtb20">
  25. <view class="base-color-6 mr40">行为习惯</view>
  26. <view>{{moreInfo.habits?moreInfo.habits:'无'}}</view>
  27. </view>
  28. <view class="justify-start align-center fs24">
  29. <view class="base-color-6 mr40">患病时间</view>
  30. <view>{{moreInfo.illnessTime?moreInfo.illnessTime:'无'}}</view>
  31. </view>
  32. <view class="justify-start align-center fs24 mt20" >
  33. <view class="base-color-6 mr40">身体状态</view>
  34. <view>{{moreInfo.body?moreInfo.mebodydicine:'无'}}</view>
  35. </view>
  36. <view class="justify-start align-center fs24 mt20" >
  37. <view class="base-color-6 mr40">家人的疾病</view>
  38. <view>{{moreInfo.familyDisease?moreInfo.familyDisease:'无'}}</view>
  39. </view>
  40. <view class="justify-between align-center">
  41. <view class="justify-start align-center fs24 mt20 widthpath">
  42. <view class="base-color-6 mr40">是否线下就诊</view>
  43. <view>{{moreInfo.isLine?'已线下就诊':'无'}}</view>
  44. </view>
  45. <view class="justify-start align-center fs24 mt20 widthpath" >
  46. <view class="base-color-6 mr40 ">体质</view>
  47. <view>{{moreInfo.constitution?moreInfo.constitution:'无'}}</view>
  48. </view>
  49. </view>
  50. <view class="justify-start align-center fs24 mt20" >
  51. <view class="base-color-6 mr40">使用药品</view>
  52. <view>{{moreInfo.medicine?moreInfo.medicine:'无'}}</view>
  53. </view>
  54. <view class="justify-start align-center fs24 mt20" >
  55. <view class="base-color-6 mr40">咨询产品</view>
  56. <view>{{moreInfo.consultProduct?moreInfo.consultProduct:'无'}}</view>
  57. </view>
  58. <view class="justify-start align-center fs24 mt20" >
  59. <view class="base-color-6 mr40">是否已经购买产品</view>
  60. <view>{{moreInfo.isBuy?'已购买':'无'}}</view>
  61. </view>
  62. </view>
  63. <view class="center bgf fs28">看课记录</view>
  64. <view class="bgf p20">
  65. <view class="justify-start ">
  66. <view v-for="(item,index) in titname" :key="index" class="justify-start align-center ml28">
  67. <view :style="{ backgroundColor: statusColors[index] || '#CCCCCC' }"
  68. class="w24 h24 radius4"></view>
  69. <view class="fs24 mr6 ml10">{{item}}</view>
  70. </view>
  71. </view>
  72. <view class="fs24 mt20 base-color-6" >近{{typestate==0?'7':'30'}}天看课记录</view>
  73. <view class="justify-between mt20">
  74. <view class="justify-start align-center mt12 " style="width: 80%;flex-wrap: wrap">
  75. <view class="w54 h54 mr20 radius4 mb12" v-for="(item,index) in answerlist" :key="index"
  76. >
  77. <view class="fs24 base-color-6">{{item.date.slice(-2)}}</view>
  78. <view :style="{ backgroundColor: statusColors[item.logType] || '#CCCCCC' }"
  79. class="w30 h30 radius4"></view>
  80. </view>
  81. </view>
  82. <view class="u-border lh45 plr20 fs24 radius40 base-color-3 h50"
  83. @click="todetail">{{typestate==0?'详情':'收起'}}</view>
  84. </view>
  85. <view class="pt120"></view>
  86. </view>
  87. <view class="justify-around botfun bgf">
  88. <view class="justify-start align-center bottom-btns base-bg"
  89. @click="navTo('/pages/user/courseManage?externalUserId='+externalUserId)" >
  90. <view class="colorf ml12">课程管理</view>
  91. </view>
  92. <view class="justify-start align-center bottom-btns base-bg"
  93. @click="navTo('/pages/user/UrgeClasses?externalUserId='+externalUserId)">
  94. <view class="colorf ml12" >催课管理</view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. import {
  101. getcustomerlist,
  102. getcustomer
  103. } from "@/api/user.js";
  104. export default {
  105. data() {
  106. return {
  107. typeOption: [{
  108. label: '全部',
  109. value: 0
  110. }, {
  111. label: '今天',
  112. value: 1
  113. }, {
  114. label: '昨天',
  115. value: 2
  116. }, {
  117. label: '前天',
  118. value: 3
  119. }, {
  120. label: '近七天',
  121. value: 4
  122. }],
  123. tabindex: 0,
  124. detailUser: [],
  125. user: [],
  126. answerlist:[],
  127. answerText:'禁用',
  128. userId:[],
  129. id:'',
  130. dateTag:'',
  131. externalUserId:'',
  132. qwUserId:'',
  133. startTime:"",
  134. endTime:'',
  135. todayday: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
  136. moreInfo:{},
  137. statusColors: {
  138. 0: '#909399',
  139. 1: '#0bc6ff',
  140. 2: '#67c23a',
  141. 3: '#f55a4f',
  142. 4: '#ffd700',
  143. },
  144. titname:['未看课','看课中','完课','待看课','看课中断',],
  145. statelist:[
  146. { status: 4 },
  147. { status: 1 },
  148. { status: 2 },
  149. { status: 5 },
  150. { status: 3 },
  151. { status: 5 },
  152. { status: 3 },
  153. ],
  154. typestate:0
  155. }
  156. },
  157. onShow() {
  158. this.getuser()
  159. // this.detailUser =uni.getStorageSync('detailUser')
  160. // if(this.detailUser.status==0){
  161. // this.answerText='取消禁用'
  162. // }
  163. this.qwUserId=uni.getStorageSync('qwUserId')
  164. this.$nextTick(()=>{
  165. setTimeout(()=>{
  166. this.getAnswerlists()
  167. },200)
  168. })
  169. },
  170. mounted() {
  171. },
  172. onLoad(option) {
  173. // this.id=option.id
  174. // this.corpId=options.corpId;
  175. // uni.setStorageSync("corpId",this.corpId);
  176. },
  177. methods: {
  178. todetail(){
  179. if(this.typestate==0){
  180. this.typestate=1
  181. }else{
  182. this.typestate=0
  183. }
  184. this.getAnswerlists()
  185. },
  186. getuser(){
  187. const data={
  188. qwExternalContactId:50
  189. }
  190. getcustomer(data).then(res=>{
  191. if (res.code == 200) {
  192. this.detailUser=res.data
  193. this.moreInfo=res.moreInfo
  194. } else {
  195. uni.showToast({
  196. icon: 'none',
  197. title: res.msg
  198. })
  199. }
  200. })
  201. },
  202. getAnswerlists() {
  203. const params = {
  204. type:this.typestate,
  205. qwExternalContactId:50
  206. }
  207. getcustomerlist(params).then(res => {
  208. if (res.code == 200) {
  209. this.answerlist=res.data.data
  210. } else {
  211. uni.showToast({
  212. icon: 'none',
  213. title: res.msg
  214. })
  215. }
  216. })
  217. },
  218. navTo(url){
  219. uni.navigateTo({
  220. url
  221. })
  222. },
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. .widthpath {
  228. width: 50%;
  229. }
  230. .topBgline {
  231. background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
  232. padding-top: 40rpx;
  233. }
  234. .bgcolf {
  235. background: rgba(255, 255, 255, 0.4);
  236. }
  237. .actsel {
  238. background-color: #1773ff;
  239. color: #fff;
  240. transition: background-color 0.4s ease-in-out;
  241. }
  242. .notact {
  243. background-color: #f8f8f8;
  244. }
  245. .livebox {
  246. width: calc(50% - 10rpx);
  247. background-color: #f8f8f8;
  248. padding: 20rpx 10rpx;
  249. border-radius: 12rpx;
  250. }
  251. .liveboxs {
  252. width: calc(33% - 10rpx);
  253. background-color: #f8f8f8;
  254. padding: 20rpx 10rpx;
  255. border-radius: 12rpx;
  256. }
  257. .bottom-btns {
  258. padding: 10rpx 40rpx;
  259. border-radius: 50rpx;
  260. }
  261. .botfun {
  262. position: fixed;
  263. width: 100%;
  264. bottom: 0rpx;
  265. padding: 20rpx 0;
  266. }
  267. </style>