兼兼街公众号代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
4.0 KiB

  1. <template>
  2. <view>
  3. <view v-if="userInfo.isPay === 0">
  4. <view class="from">
  5. <view class="call-title">
  6. 会员权益:
  7. </view>
  8. <view class="call-title">
  9. 1.每天不限制查看兼职联系方式次数
  10. </view>
  11. <view class="call-title">
  12. 2.一经开通永久有效.
  13. </view>
  14. </view>
  15. <view v-if="userInfo.isPay === 0" class="pay-btn" @click="wxPay()">
  16. 支付6.66元开通永久会员
  17. </view>
  18. <view v-if="userInfo.isPay === 1" class="pay-btn disabled">
  19. 您已成为会员
  20. </view>
  21. </view>
  22. <view v-if="userInfo.isPay === 1" class="scuescc"></view>
  23. </view>
  24. </template>
  25. <script>
  26. import userCard from '@/components/user-card/index.vue'
  27. export default{
  28. components:{
  29. userCard
  30. },
  31. data(){
  32. return{
  33. userInfo:{
  34. name:"开通会员",
  35. cardId:"成为VIP",
  36. isPay: 0
  37. },
  38. current:1,
  39. activiteList:[],
  40. informationList:[],
  41. params:{
  42. pageNo:1,
  43. pageSize:10,
  44. total: null,
  45. isLock: true
  46. },
  47. }
  48. },
  49. onShow() {
  50. this.getmyInfo()
  51. },
  52. onLoad() {
  53. },
  54. onReady() {
  55. this.$com.displayNav()
  56. },
  57. methods:{
  58. getmyInfo(){
  59. this.$api('myInfo')
  60. .then(res=>{
  61. if(res.code == 200){
  62. this.role = res.result.role;
  63. this.userInfo = res.result;
  64. this.$store.commit('set_userInfo',res.result)
  65. }else{
  66. this.userInfo = null
  67. }
  68. })
  69. },
  70. wxPay(){
  71. let that = this;
  72. that.$api('create',{name:"成为会员",card:"开通会员"})
  73. .then(res=>{
  74. that.$jweixin.config({
  75. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  76. appId: 'wx6fb4a17b28186d58', // 必填,公众号的唯一标识
  77. timestamp: res.result.timestamp, // 必填,生成签名的时间戳
  78. nonceStr: res.result.noncestr, // 必填,生成签名的随机串
  79. signature: res.result.sgture, // 必填,签名
  80. jsApiList: ['updateAppMessageShareData','updateTimelineShareData','onMenuShareTimeline','onMenuShareAppMessage','chooseWXPay']
  81. });
  82. that.$jweixin.chooseWXPay({
  83. appId: 'wx6fb4a17b28186d58',
  84. timestamp: res.result.timeStamp, // 支付签名时间戳,注意微信 jssdk 中的所有使用 timestamp 字段均为小写。但最新版的支付后台生成签名使用的 timeStamp 字段名需大写其中的 S 字符
  85. nonceStr: res.result.nonceStr, // 支付签名随机串,不长于 32 位
  86. package: res.result.packageValue, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
  87. signType: res.result.signType, // 微信支付V3的传入 RSA ,微信支付V2的传入格式与V2统一下单的签名格式保持一致
  88. paySign: res.result.paySign, // 支付签名
  89. success: function (res) {
  90. // 支付成功后的回调函数
  91. uni.switchTab({
  92. url:'/pages/my/index'
  93. })
  94. }
  95. });
  96. })
  97. },
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .from {
  103. margin-top: 120rpx;
  104. margin-right: 20rpx;
  105. margin-left: 100rpx;
  106. }
  107. .call-title {
  108. font-size: 30rpx;
  109. color: #000000;
  110. position: relative;
  111. line-height: 40rpx;
  112. padding: 15rpx 0 32rpx;
  113. &::after{
  114. content: '';
  115. position: absolute;
  116. display: block;
  117. width: 148rpx;
  118. height: 15rpx;
  119. border-radius: 8px;
  120. top: 46rpx;
  121. }
  122. }
  123. .from-line {
  124. height: 128rpx;
  125. display: flex;
  126. .label-class{
  127. text-align: justify;
  128. text-align-last: justify;
  129. line-height: 128rpx;
  130. width: 108rpx;
  131. padding: 0 24rpx;
  132. }
  133. input{
  134. padding-left: 20rpx;
  135. height: 128rpx;
  136. line-height: 128rpx;
  137. }
  138. }
  139. .pay-btn{
  140. margin:160rpx auto;
  141. width: 487rpx;
  142. border-radius: 8rpx;
  143. text-align: center;
  144. height: 88rpx;
  145. line-height: 88rpx;
  146. background-color: #00CCCC;
  147. font-size: 36rpx;
  148. color: #FFFFFF;
  149. }
  150. .disabled {
  151. background-color: #999;
  152. }
  153. .scuescc {
  154. background: url("@/static/3.png");
  155. background-size: 100% 100%;
  156. width: 100vw;
  157. height: calc(100vh - 88rpx);
  158. }
  159. </style>