hyktdis.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <u-navbar :is-back="false" :border-bottom="false" :background="background">
  5. <view style="width: 100%;padding: 0 10rpx;">
  6. <view class="flztoa inlbhhe ">
  7. <navigator class="indihh" url="../index/index" open-type="redirect" hover-class="none">
  8. <text>最新</text>
  9. </navigator>
  10. <view class="indihh">
  11. <text style="font-size: 44rpx;color: #374B6E;">会员</text>
  12. <view
  13. style="width: 26rpx;height: 4rpx;background: #374B6E;border-radius: 4rpx;margin-top: 10rpx;">
  14. </view>
  15. </view>
  16. <navigator class="indihh" url="../index/zylx" open-type="redirect" hover-class="none">
  17. <text>治愈练习</text>
  18. </navigator>
  19. <navigator class="indihh" url="../index/hd" open-type="redirect" hover-class="none">
  20. <text>活动</text>
  21. </navigator>
  22. </view>
  23. </view>
  24. </u-navbar>
  25. <view class="hyinnr" style="overflow: hidden;">
  26. <image src="/static/my/my01.png" style="width: 100%; height: 103%; position: absolute; left: 0; top: 0rpx; z-index: -1;" mode=""></image>
  27. <view class="hyinnrks">
  28. <view style="margin: 60rpx 40rpx 36rpx 40rpx;">
  29. <image src="/static/my/my02.png" style="width: 227.14rpx;height: 56rpx;" mode=""></image>
  30. </view>
  31. <view class="hyintxt">
  32. <text>开通会员尽享三大权益</text>
  33. </view>
  34. <view class="hyinrq">
  35. <text>到期:{{info.vip.over_time}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="myxmkstt">
  40. <view class="myhbtui">
  41. <view class="myshutt"></view>
  42. <text>专属权益</text>
  43. </view>
  44. <view class="flztoa" style="margin: 0 66rpx; margin-top: 20rpx;">
  45. <view class="myiodde">
  46. <image src="/static/my/myb01.png" style="width: 80rpx;height: 80rpx;margin-bottom: 6rpx;" mode="">
  47. </image>
  48. <text>会员价</text>
  49. </view>
  50. <view class="myiodde">
  51. <image src="/static/my/myb02.png" style="width: 80rpx;height: 80rpx;margin-bottom: 6rpx;" mode="">
  52. </image>
  53. <text>体检理疗</text>
  54. </view>
  55. <view class="myiodde">
  56. <image src="/static/my/myb03.png" style="width: 80rpx;height: 80rpx;margin-bottom: 6rpx;" mode="">
  57. </image>
  58. <text>更多优惠</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="myxmkstt">
  63. <view class="myhbtui">
  64. <view class="myshutt"></view>
  65. <text>会员规则</text>
  66. </view>
  67. <view class="mytxtjs">
  68. <rich-text :nodes="info.vip_set.agreement"></rich-text>
  69. </view>
  70. </view>
  71. <view class="btn" @click="pay" v-if="is_vip == 0">开通会员/¥{{info.vip_card[0].price}}</view>
  72. <view style="height: 130rpx;"></view>
  73. <view class="dibuboot">
  74. <navigator class="dibubootlb" url="../index/index" open-type="redirect" hover-class="none">
  75. <image src="/static/dibu/bob1.png" style="width: 48rpx;height: 48rpx;"></image>
  76. <text style="color: #374B6E">首页</text>
  77. </navigator>
  78. <!-- <navigator class="dibubootlb" url="../lecturer/wdzx" open-type="redirect" hover-class="none">
  79. <image src="/static/dibu/boa2.png" style="width: 48rpx;height: 48rpx;"></image>
  80. <text>咨询</text>
  81. </navigator>
  82. <navigator class="dibubootlb" url="../index/jiehuo" open-type="redirect" hover-class="none">
  83. <image src="/static/dibu/boa3.png" style="width: 48rpx;height: 48rpx;"></image>
  84. <text>解惑</text>
  85. </navigator> -->
  86. <navigator class="dibubootlb" url="../lecturer/my" open-type="redirect" hover-class="none">
  87. <image src="/static/dibu/boa4.png" style="width: 48rpx;height: 48rpx;"></image>
  88. <text>我的</text>
  89. </navigator>
  90. </view>
  91. </view>
  92. </template>
  93. <style>
  94. page {
  95. background: #FAFAFA;
  96. }
  97. </style>
  98. <script>
  99. export default {
  100. data() {
  101. return {
  102. background: {
  103. backgroundColor: '#ffffff',
  104. },
  105. info: {},
  106. is_vip:0,
  107. deviceType:'wxapp'
  108. }
  109. },
  110. onLoad() {
  111. // #ifdef APP-PLUS
  112. this.deviceType = 'wxh5'
  113. // #endif
  114. // #ifdef MP-WEIXIN
  115. this.deviceType = 'wxapp'
  116. // #endif
  117. this.getvipinfo();
  118. this.is_vip = uni.getStorageSync('is_vip');
  119. },
  120. methods: {
  121. getvipinfo() {
  122. let user_id = uni.getStorageSync('id');
  123. this.$post({
  124. data: {
  125. do: 'Vip',
  126. data: {
  127. user_id: user_id,
  128. pw: '375'
  129. }
  130. }
  131. }).then(res => {
  132. this.info = res.data
  133. })
  134. },
  135. pay() {
  136. let that = this;
  137. let user_id = uni.getStorageSync('id');
  138. that.$post({
  139. data:{
  140. do: 'VipOrder',
  141. data: {
  142. card_id: that.info.vip_card[0].id,
  143. cdkey: '',
  144. user_id: user_id,
  145. pw: '375'
  146. },
  147. deviceType:this.deviceType
  148. }
  149. }).then(res => {
  150. that.wechatpay(res.data);
  151. })
  152. },
  153. wechatpay(pay){
  154. var that = this
  155. // #ifdef APP-PLUS
  156. uni.requestPayment({
  157. "provider": "wxpay",
  158. orderInfo: pay.orderinfo, //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
  159. success: function (res) {
  160. console.log('success:' + JSON.stringify(res));
  161. uni.showToast({
  162. title: '支付成功'
  163. })
  164. that.is_vip = 1;
  165. uni.setStorageSync('is_vip',1)
  166. that.getvipinfo();
  167. },
  168. fail: function (err) {
  169. console.log(pay.orderinfo,'eeeeeeeeeeeeeeeee')
  170. console.log('fail:' + JSON.stringify(err));
  171. uni.showToast({
  172. title: '支付失败',
  173. icon: 'error'
  174. })
  175. }
  176. });
  177. // #endif
  178. // #ifdef MP-WEIXIN
  179. uni.requestPayment({
  180. provider: 'wxpay',
  181. timeStamp: pay.timeStamp,
  182. nonceStr: pay.nonceStr,
  183. package: pay.package,
  184. signType: 'MD5',
  185. paySign: pay.paySign,
  186. success() {
  187. uni.showToast({
  188. title: '支付成功'
  189. })
  190. that.is_vip = 1;
  191. uni.setStorageSync('is_vip',1)
  192. that.getvipinfo();
  193. },
  194. fail(res) {
  195. console.log(res)
  196. uni.showToast({
  197. title: '支付失败',
  198. icon: 'error'
  199. })
  200. }
  201. })
  202. // #endif
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. .status_bar {
  209. height: var(--status-bar-height);
  210. width: 100%;
  211. }
  212. .btn {
  213. width: 524upx;
  214. height: 100upx;
  215. background: #F8DAB9;
  216. font-size: 36upx;
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. border-radius: 100upx;
  221. margin: 50upx auto;
  222. }
  223. </style>