packs_details.vue 9.4 KB

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