packs_details.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. <view style="padding: 12rpx 0;">{{packs.desc}}</view>
  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">{{itm}}</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 style="height: 35rpx;width: auto;font-size: 24rpx;margin-left: 30rpx;display: flex;align-items: center;">
  57. <image @click="isqueren" :src="imgitem.name" mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
  58. <text style="color: #999999;">已阅读并同意</text>
  59. <text style="color: #0B73B9;">《超级宝妈宝》</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" open-type="contact" 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. </view>
  78. </template>
  79. <script>
  80. export default {
  81. name: 'productdetailspage',
  82. onLoad(op) {
  83. this.serviceid = op.id
  84. },
  85. mounted() {
  86. this.getservice()
  87. },
  88. data() {
  89. return {
  90. //关注
  91. isfollow: false,
  92. //协议
  93. num: 1,
  94. imgitem: {
  95. istrue: false,
  96. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  97. },
  98. packs: {},
  99. serviceid: ""
  100. }
  101. },
  102. methods: {
  103. //关注
  104. submitCollect: async function(e) {
  105. console.log(e)
  106. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  107. type: 1,
  108. relation_id: e.currentTarget.dataset.id
  109. })
  110. if (res.status == 0) {
  111. if (res.data.is_collect == 0) {
  112. uni.showToast({
  113. title: "取消成功",
  114. icon: "none"
  115. })
  116. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  117. } else {
  118. uni.showToast({
  119. title: "关注成功",
  120. icon: "none"
  121. })
  122. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  123. }
  124. }
  125. },
  126. getservice: async function() {
  127. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  128. service_pack_id: this.serviceid
  129. })
  130. console.log(res)
  131. if (res.status == 0) {
  132. this.packs = res.data
  133. }
  134. },
  135. isqueren() {
  136. this.num++
  137. if (this.num % 2 == 0) {
  138. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyixuan.png"
  139. this.imgitem.istrue = true
  140. } else {
  141. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  142. this.imgitem.istrue = false
  143. }
  144. },
  145. next(e) {
  146. if (!this.imgitem.istrue) {
  147. uni.showToast({
  148. icon: 'none',
  149. position: 'bottom',
  150. title: '请先同意《协议》'
  151. });
  152. } else {
  153. uni.navigateTo({
  154. url: '/pages/service_packs/packs_information?data=' + JSON.stringify(this.packs)
  155. })
  156. }
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. .footer {
  163. width: 100%;
  164. height: auto;
  165. display: flex;
  166. position: fixed;
  167. bottom: 0;
  168. }
  169. .round {
  170. height: 45rpx;
  171. width: 50rpx;
  172. border-radius: 50%;
  173. background-color: #ececec;
  174. }
  175. .card {
  176. padding: 30rpx 30rpx;
  177. box-sizing: border-box;
  178. .card_view {
  179. width: 100%;
  180. background-color: #ffffff;
  181. border-radius: 15rpx;
  182. .title {
  183. width: 100%;
  184. height: 20vh;
  185. display: flex;
  186. justify-content: center;
  187. align-items: flex-end;
  188. .img {
  189. width: 90%;
  190. height: 90%;
  191. }
  192. }
  193. .describe {
  194. width: 100%;
  195. height: 1;
  196. padding: 100rpx 40rpx 20rpx 40rpx;
  197. }
  198. }
  199. }
  200. .list {
  201. margin: 20rpx 0 10rpx 0;
  202. display: flex;
  203. width: 100%;
  204. height: 200rpx;
  205. border-radius: 15rpx;
  206. background-color: #FFFFFF;
  207. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  208. .portrait {
  209. width: 30%;
  210. height: 100%;
  211. display: flex;
  212. justify-content: center;
  213. align-items: center;
  214. .img {
  215. width: 100rpx;
  216. height: 100rpx;
  217. border-radius: 50%;
  218. }
  219. .bun_true {
  220. text-align: center;
  221. width: 80rpx;
  222. height: 36rpx;
  223. background-color: #D92975;
  224. margin: 0 10rpx;
  225. border-radius: 60rpx;
  226. position: relative;
  227. top: -20rpx;
  228. font-size: 20rpx;
  229. color: #FFFFFF;
  230. padding: 3rpx 0;
  231. }
  232. .bun_false {
  233. border: 1rpx solid #D92975;
  234. text-align: center;
  235. width: 80rpx;
  236. height: 36rpx;
  237. background-color: #FFFFFF;
  238. margin: 0 10rpx;
  239. border-radius: 60rpx;
  240. position: relative;
  241. top: -20rpx;
  242. font-size: 20rpx;
  243. color: #D92975;
  244. padding: 3rpx 0;
  245. }
  246. }
  247. //文字
  248. .text {
  249. width: 70%;
  250. height: 100%;
  251. padding: 20rpx 0;
  252. //名字+标签
  253. .name {
  254. font-size: 30rpx;
  255. font-weight: bold;
  256. display: flex;
  257. align-items: center;
  258. .label {
  259. font-weight: 400;
  260. margin-right: 15rpx;
  261. background-color: #E5F5FF;
  262. color: #0B73B9;
  263. width: 100rpx;
  264. height: 28rpx;
  265. font-size: 20rpx;
  266. border-radius: 10rpx;
  267. text-align: center;
  268. }
  269. }
  270. //科室
  271. .department {
  272. padding: 20rpx 0;
  273. color: #666666;
  274. text {
  275. margin-right: 15rpx;
  276. }
  277. }
  278. // 选项
  279. .option {
  280. display: flex;
  281. view {
  282. background-color: #E4E4E4;
  283. width: 100rpx;
  284. height: 48rpx;
  285. border-radius: 12px;
  286. margin-right: 15rpx;
  287. display: flex;
  288. justify-content: center;
  289. align-items: center;
  290. }
  291. }
  292. }
  293. }
  294. </style>