packs_details.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view style="width: 100%;height: 100%;background-color: #ececec;">
  3. <!-- 卡券 -->
  4. <view class="card">
  5. <view class="card_view">
  6. <!-- 放图片 标题 -->
  7. <view class="title">
  8. <image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/横占位图.png" class="img"></image>
  9. </view>
  10. <!-- 放描述 -->
  11. <view class="describe">
  12. <view style="font-size: 40rpx;font-weight: bold;">{{packs.name}}</view>
  13. <view style="font-size: 28rpx;font-weight: bold;padding-top: 60rpx;">有效期</view>
  14. <view style="font-size: 26rpx;color: #999999;padding-top: 30rpx;">自购买服务起{{packs.effective_days}}天</view>
  15. <view style="font-size: 28rpx;font-weight: bold;padding-top: 50rpx;">服务包内容介绍</view>
  16. <view style="font-size: 26rpx;color: #999999;">
  17. <view style="padding: 27rpx 0 12rpx 0;">{{packs.intro}}</view>
  18. <rich-text style="padding: 12rpx 0;" :nodes="packs.desc"></rich-text>
  19. </view>
  20. <view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">{{packs.team.name}}</view>
  21. <view class="list" v-for="(item,index) in packs.team.docter" :key="index">
  22. <!-- 头像 -->
  23. <view class="portrait">
  24. <view style="padding-top: 20rpx;">
  25. <image class="img" :src="item.avatar"></image>
  26. <view class="bun_true" @click="submitCollect" :data-index="index" :data-id="item.id" v-if="item.is_collect==0">关注</view>
  27. <view class="bun_false" @click="submitCollect" :data-index="index" :data-id="item.id" v-else>已关注</view>
  28. </view>
  29. </view>
  30. <!-- 文字 -->
  31. <view class="text">
  32. <!-- 名字+标签 -->
  33. <view class="name">
  34. <view style="margin-right: 15rpx;">{{item.name}}</view>
  35. <view class="label" v-for="(itm,idx) in item.label_texts" :key="idx">{{itm.label_name}}</view>
  36. </view>
  37. <!-- 科室 -->
  38. <view class="department">
  39. <text>科室:</text>
  40. <text style="color: #333333;">{{item.office.name||'暂无'}}</text>
  41. <text style="color: #333333;">{{item.qualification.name||'暂无'}}</text>
  42. </view>
  43. <!-- 选项 -->
  44. <view class="option">
  45. <view v-if="item.is_chat">图文</view>
  46. <view v-if="item.is_phone">电话</view>
  47. <view v-if="item.is_appoint">门诊</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 协议 -->
  55. <view style="height: 200rpx;width: 100%;display: flex;justify-content: left;">
  56. <view @click="isqueren" style="height: 35rpx;width: auto;font-size: 24rpx;margin-left: 30rpx;display: flex;align-items: center;">
  57. <image :src="imgitem.name" mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
  58. <text style="color: #999999;">已阅读并同意</text>
  59. <text style="color: #0B73B9;">《熙宝HMO》</text>
  60. <text style="color: #999999;">服务协议</text>
  61. </view>
  62. </view>
  63. <!-- 两个半圆 -->
  64. <view class="round" style="position:absolute;top: 25vh;right:0;"></view>
  65. <view class="round" style="position:absolute;top: 25vh;"></view>
  66. <!-- 底部按钮 -->
  67. <view class="footer">
  68. <view class="cu-bar bg-white tabbar border shop" style="width: 100%;">
  69. <button class="action" @click="show=true" style="width: 33%;">
  70. <view class="cuIcon-service text-green">
  71. </view>
  72. 客服
  73. </button>
  74. <view class="submit" @click="next" style="background-color: #0B73B9; color: #FFFFFF;">下一步</view>
  75. </view>
  76. </view>
  77. <u-popup v-model="show" mode="bottom" border-radius="14" height="300rpx">
  78. <u-button open-type="contact" :custom-style="customStyle">会话客服</u-button>
  79. <u-button @click="playphone" :custom-style="customStyle">电话客服</u-button>
  80. </u-popup>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. name: 'productdetailspage',
  86. onLoad(op) {
  87. this.serviceid = op.id
  88. },
  89. mounted() {
  90. this.getservice()
  91. },
  92. data() {
  93. return {
  94. //关注
  95. isfollow: false,
  96. //协议
  97. num: 1,
  98. imgitem: {
  99. istrue: false,
  100. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  101. },
  102. packs: {},
  103. serviceid: "",
  104. show:false,
  105. customStyle:{
  106. width:'600rpx',
  107. marginTop:"35rpx"
  108. }
  109. }
  110. },
  111. methods: {
  112. playphone(){
  113. uni.makePhoneCall({
  114. phoneNumber:"123456"
  115. })
  116. this.show = false
  117. },
  118. //关注
  119. submitCollect: async function(e) {
  120. console.log(e)
  121. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  122. type: 1,
  123. relation_id: e.currentTarget.dataset.id
  124. })
  125. if (res.status == 0) {
  126. if (res.data.is_collect == 0) {
  127. uni.showToast({
  128. title: "取消成功",
  129. icon: "none"
  130. })
  131. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  132. } else {
  133. uni.showToast({
  134. title: "关注成功",
  135. icon: "none"
  136. })
  137. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  138. }
  139. }
  140. },
  141. getservice: async function() {
  142. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  143. service_pack_id: this.serviceid
  144. })
  145. console.log(res)
  146. if (res.status == 0) {
  147. this.packs = res.data
  148. }
  149. },
  150. isqueren() {
  151. this.num++
  152. if (this.num % 2 == 0) {
  153. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyixuan.png"
  154. this.imgitem.istrue = true
  155. } else {
  156. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  157. this.imgitem.istrue = false
  158. }
  159. },
  160. next(e) {
  161. if (!this.imgitem.istrue) {
  162. uni.showToast({
  163. icon: 'none',
  164. position: 'bottom',
  165. title: '请先同意《协议》'
  166. });
  167. } else {
  168. this.packs.label = []
  169. this.packs.label_texts = []
  170. console.log(this.packs)
  171. uni.navigateTo({
  172. url: '/pages/service_packs/packs_information?data=' + JSON.stringify(this.packs)
  173. })
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss">
  180. .footer {
  181. width: 100%;
  182. height: auto;
  183. display: flex;
  184. position: fixed;
  185. bottom: 0;
  186. }
  187. .round {
  188. height: 45rpx;
  189. width: 50rpx;
  190. border-radius: 50%;
  191. background-color: #ececec;
  192. }
  193. .card {
  194. padding: 30rpx 30rpx;
  195. box-sizing: border-box;
  196. .card_view {
  197. width: 100%;
  198. background-color: #ffffff;
  199. border-radius: 15rpx;
  200. .title {
  201. width: 100%;
  202. height: 20vh;
  203. display: flex;
  204. justify-content: center;
  205. align-items: flex-end;
  206. .img {
  207. width: 90%;
  208. height: 90%;
  209. }
  210. }
  211. .describe {
  212. width: 100%;
  213. height: 1;
  214. padding: 100rpx 40rpx 20rpx 40rpx;
  215. }
  216. }
  217. }
  218. .list {
  219. margin: 20rpx 0 10rpx 0;
  220. display: flex;
  221. width: 100%;
  222. height: 200rpx;
  223. border-radius: 15rpx;
  224. background-color: #FFFFFF;
  225. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  226. .portrait {
  227. width: 30%;
  228. height: 100%;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. .img {
  233. width: 100rpx;
  234. height: 100rpx;
  235. border-radius: 50%;
  236. }
  237. .bun_true {
  238. text-align: center;
  239. width: 80rpx;
  240. height: 36rpx;
  241. background-color: #D92975;
  242. margin: 0 10rpx;
  243. border-radius: 60rpx;
  244. position: relative;
  245. top: -20rpx;
  246. font-size: 20rpx;
  247. color: #FFFFFF;
  248. padding: 3rpx 0;
  249. }
  250. .bun_false {
  251. border: 1rpx solid #D92975;
  252. text-align: center;
  253. width: 80rpx;
  254. height: 36rpx;
  255. background-color: #FFFFFF;
  256. margin: 0 10rpx;
  257. border-radius: 60rpx;
  258. position: relative;
  259. top: -20rpx;
  260. font-size: 20rpx;
  261. color: #D92975;
  262. padding: 3rpx 0;
  263. }
  264. }
  265. //文字
  266. .text {
  267. width: 70%;
  268. height: 100%;
  269. padding: 20rpx 0;
  270. //名字+标签
  271. .name {
  272. font-size: 30rpx;
  273. font-weight: bold;
  274. display: flex;
  275. align-items: center;
  276. .label {
  277. font-weight: 400;
  278. margin-right: 15rpx;
  279. background-color: #E5F5FF;
  280. color: #0B73B9;
  281. width: 100rpx;
  282. height: 28rpx;
  283. font-size: 20rpx;
  284. border-radius: 10rpx;
  285. display: flex;
  286. justify-content: center;
  287. align-items: center;
  288. }
  289. }
  290. //科室
  291. .department {
  292. padding: 20rpx 0;
  293. color: #666666;
  294. text {
  295. margin-right: 15rpx;
  296. }
  297. }
  298. // 选项
  299. .option {
  300. display: flex;
  301. view {
  302. background-color: #E4E4E4;
  303. width: 100rpx;
  304. height: 48rpx;
  305. border-radius: 12px;
  306. margin-right: 15rpx;
  307. display: flex;
  308. justify-content: center;
  309. align-items: center;
  310. }
  311. }
  312. }
  313. }
  314. </style>