zhouka.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view>
  3. <view class="title">
  4. <image src="https://zhaopin.xianmaxiong.com/file/uploadPath/2022/09/16/72cec755962491d930f833f4bb5dfedd.png"
  5. mode="widthFix"></image>
  6. <image src="https://zhaopin.xianmaxiong.com/file/uploadPath/2022/09/16/ee0fee52f1e4e8eea4716e2bbe79ce9c.png"
  7. mode=""></image>
  8. <view v-if="weekMember !=1" class="title-text">
  9. 人才库周卡
  10. </view>
  11. <view v-if="weekMember ==1" class="title-text">
  12. 已开通人才库周卡
  13. </view>
  14. <view class="title-texts">
  15. <!-- <text>开通只需{{price}}元</text> -->
  16. <text v-if="weekMember !=1">开通只需{{price}}元</text>
  17. <!-- <text v-if="weekMember ==1">已开通周卡</text> -->
  18. <text v-if="weekMember ==1">到期:{{endWeekMemberTime.substring(0,10)}}</text>
  19. </view>
  20. <view v-if="weekMember !=1" class="payBtn flex align-center justify-center" @click="payPrice">
  21. 立即开通
  22. </view>
  23. </view>
  24. <view class="flex align-center" v-if="weekMember !=1" style="padding-left: 40rpx;margin-top: 20rpx;width: 100%;">
  25. <u-checkbox style="margin-top: 10rpx;" size="28rpx" v-model="checked" shape="circle"></u-checkbox>
  26. <view style="margin-left: 10rpx;" class="flex align-center">开通即同意<navigator url="/my/setting/weekXiYi" open-type="navigate">《周卡开通协议》</navigator></view>
  27. </view>
  28. <view class="flex align-center" v-else style="padding-left: 40rpx;margin-top: 20rpx;width: 100%;">
  29. <view style="margin-left: 10rpx;" class="flex align-center">点击查看<navigator url="/my/setting/weekXiYi" open-type="navigate">《周卡开通协议》</navigator></view>
  30. </view>
  31. <view class="info flex justify-center">
  32. <view class="info-box">
  33. <image
  34. src="https://zhaopin.xianmaxiong.com/file/uploadPath/2022/09/16/81502b2d381c52aab7845b3b4cce4f26.png"
  35. mode="scaleToFill"></image>
  36. <view class="info-box-txt">
  37. 每天{{number}}次
  38. </view>
  39. <view class="info-box-txts">
  40. 全周可使用
  41. </view>
  42. </view>
  43. </view>
  44. <view class="info flex justify-center" style="margin-top: 20rpx;">
  45. <view class="info-box">
  46. <image
  47. src="https://zhaopin.xianmaxiong.com/file/uploadPath/2022/09/22/bb0c83f38e83afa74f749aa160b07c62.png"
  48. mode="scaleToFill"></image>
  49. <view class="info-box-txt1">
  50. 当前剩余<text style="color: rgb(59, 105, 255);">{{viewResumes}}</text>次
  51. </view>
  52. <!-- <view class="info-box-txts1">
  53. 到期:{{endWeekMemberTime.substring(0,10)}}
  54. </view> -->
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. checked:false,
  64. number: 0,
  65. price: '',
  66. members:'',//是否会员
  67. weekMember:'',//是否开通周卡 1:开通 null/0 未开通
  68. endWeekMemberTime:'',//到期时间
  69. viewResumes:0,//今日剩余获取次数
  70. };
  71. },
  72. onLoad() {
  73. this.getNumber();
  74. if (this.members==2) {
  75. this.getPriceVip();
  76. } else {
  77. this.getPriceNo();
  78. }
  79. this.getUserInfo();
  80. },
  81. methods: {
  82. //获取用户数据
  83. getUserInfo() {
  84. this.$Request.get("/app/user/selectUserById").then(res => {
  85. if (res.code == 0) {
  86. this.members = res.data.member
  87. this.weekMember = res.data.weekMember
  88. this.endWeekMemberTime = res.data.endWeekMemberTime
  89. this.viewResumes = res.data.viewResumes
  90. }
  91. });
  92. },
  93. //支付开通
  94. payPrice() {
  95. let _this = this
  96. if(this.checked==false){
  97. uni.showToast({
  98. title:'请同意《周卡开通协议》',
  99. icon:'none'
  100. })
  101. }else{
  102. this.$Request.post('/app/wxPay/openWeekMember', {
  103. classify: 3
  104. }).then(res => {
  105. if (res.code == 0) {
  106. // 调起微信支付
  107. uni.requestPayment({
  108. provider: 'wxpay', // 服务提提供商
  109. timeStamp: res.data.timestamp, // 时间戳
  110. nonceStr: res.data.noncestr, // 随机字符串
  111. package: res.data.package,
  112. signType: res.data.signType, // 签名算法
  113. paySign: res.data.sign, // 签名
  114. success: function(res) {
  115. uni.showToast({
  116. title:'开通成功'
  117. })
  118. setTimeout(()=>{
  119. _this.getUserInfo();
  120. },1000)
  121. },
  122. fail: function(err) {
  123. console.log('支付失败', err);
  124. uni.showToast({
  125. title:'支付失败',
  126. icon:'none'
  127. })
  128. }
  129. });
  130. }
  131. });
  132. }
  133. },
  134. //获取免费刷新简历次数
  135. getNumber() {
  136. this.$Request.get('/app/common/type/313').then(res => {
  137. if (res.code == 0) {
  138. this.number = res.data.value
  139. }
  140. });
  141. },
  142. //获取价格(会员)
  143. getPriceVip() {
  144. this.$Request.get('/app/common/type/314').then(res => {
  145. if (res.code == 0) {
  146. this.price = res.data.value
  147. }
  148. });
  149. },
  150. //获取价格(普通)
  151. getPriceNo() {
  152. this.$Request.get('/app/common/type/312').then(res => {
  153. if (res.code == 0) {
  154. this.price = res.data.value
  155. }
  156. });
  157. },
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background-color: #FDFDFD;
  164. width: 750rpx;
  165. overflow: hidden;
  166. }
  167. .title {
  168. width: 103%;
  169. height: 293rpx;
  170. margin-left: -15rpx;
  171. position: relative;
  172. image:nth-of-type(1) {
  173. width: 100%;
  174. position: absolute;
  175. top: 0;
  176. left: 0;
  177. z-index: -1;
  178. }
  179. image:nth-of-type(2) {
  180. width: 170rpx;
  181. height: 3rpx;
  182. position: absolute;
  183. top: 170rpx;
  184. left: 76rpx;
  185. z-index: 1;
  186. }
  187. .title-text {
  188. position: absolute;
  189. top: 90rpx;
  190. left: 76rpx;
  191. font-size: 40rpx;
  192. font-weight: 800;
  193. // color: #E5AD8C;
  194. background-image: -webkit-linear-gradient(left, #F3D5BB, #E5AD8C);
  195. -webkit-background-clip: text;
  196. -webkit-text-fill-color: transparent;
  197. }
  198. .title-texts {
  199. position: absolute;
  200. top: 195rpx;
  201. left: 76rpx;
  202. font-size: 32rpx;
  203. font-weight: 500;
  204. color: #D0A183;
  205. }
  206. .payBtn {
  207. position: absolute;
  208. top: 120rpx;
  209. right: 63rpx;
  210. width: 177rpx;
  211. height: 73rpx;
  212. border-radius: 37rpx;
  213. background: linear-gradient(90deg, #EADEC8 0%, #D6B197 100%);
  214. color: #634338;
  215. font-size: 28rpx;
  216. font-weight: bold;
  217. }
  218. }
  219. .info {
  220. width: 100%;
  221. height: 333rpx;
  222. margin-top: 20rpx;
  223. .info-box {
  224. width: 714rpx;
  225. height: 100%;
  226. position: relative;
  227. image {
  228. position: absolute;
  229. top: 0%;
  230. left: 0%;
  231. width: 100%;
  232. height: 100%;
  233. z-index: -1;
  234. }
  235. .info-box-txt {
  236. position: absolute;
  237. z-index: 1;
  238. top: 120rpx;
  239. left: 110rpx;
  240. font-size: 32rpx;
  241. color: #333333;
  242. }
  243. .info-box-txt1 {
  244. position: absolute;
  245. z-index: 1;
  246. top: 120rpx;
  247. left: 42rpx;
  248. font-size: 32rpx;
  249. color: #333333;
  250. }
  251. .info-box-txts1 {
  252. position: absolute;
  253. z-index: 1;
  254. top: 208rpx;
  255. left: 42rpx;
  256. font-size: 32rpx;
  257. color: #333333;
  258. }
  259. .info-box-txts {
  260. position: absolute;
  261. z-index: 1;
  262. top: 208rpx;
  263. left: 110rpx;
  264. font-size: 32rpx;
  265. color: #333333;
  266. }
  267. }
  268. }
  269. </style>