特易招,招聘小程序
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.

339 lines
6.6 KiB

6 months ago
4 months ago
4 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <!-- 会员充值 -->
  3. <view class="page">
  4. <navbar title="会员充值" bgColor="#3796F8" leftClick color="#fff" @leftClick="$utils.navigateBack" />
  5. <view class="head">
  6. <view class="headImage">
  7. <image :src="userInfo.headImage" mode="aspectFill"></image>
  8. </view>
  9. <view class="info">
  10. <view class="name">
  11. {{userInfo.nickName}}
  12. <view>
  13. <uv-icon name="edit-pen" size="40rpx" color="#fff"></uv-icon>
  14. 修改资料
  15. </view>
  16. </view>
  17. <view class="tips">
  18. 手机号{{userInfo.phone}}
  19. </view>
  20. <!-- <view>
  21. {{numInfo.vipType}}
  22. </view> -->
  23. </view>
  24. </view>
  25. <view class="openvip">{{numInfo.vipType}}</view>
  26. <view class="options">
  27. <view @click="vipId = item.id" :class="{option : true, act : vipId == item.id}" v-for="(item,index) in list"
  28. :key="index">
  29. <view style="font-weight: 600;">{{ item.name }}</view>
  30. <view style="color: #FF2E2E;">
  31. <text style="font-size: 20rpx;"></text>
  32. <text style="font-size: 36rpx;">{{ item.price }}</text>
  33. </view>
  34. <view>{{ item.remark }}</view>
  35. </view>
  36. </view>
  37. <view class="block" v-if="vip.id">
  38. <view class="privilege">{{ vip.name }}</view>
  39. <view class="cells">
  40. <view class="cell" v-for="(item, index) in vip.keys">
  41. <image src="../static/mine/characteristic.png" mode="aspectFill" />
  42. <view class="text">
  43. <view>{{ item[0] }}</view>
  44. <view style="font-size: 24rpx;">{{ item[1] }}</view>
  45. </view>
  46. </view>
  47. <!-- <view class="cell">
  48. <image src="../static/mine/integral.png" mode="aspectFill" />
  49. <view class="text">
  50. <view>特权二</view>
  51. <view style="font-size: 24rpx;">快速发布优先审核</view>
  52. </view>
  53. </view> -->
  54. </view>
  55. <view class="tail">
  56. <view>
  57. <uv-radio-group v-model="radiovalue">
  58. <uv-radio size="30rpx">
  59. </uv-radio>
  60. </uv-radio-group>
  61. </view>
  62. <view>开通前请阅读会员服务协议</view>
  63. </view>
  64. </view>
  65. <view class="confirm">
  66. <view class="box">
  67. <view>
  68. 总计金额{{ vip.price }}
  69. </view>
  70. <view @click="submit(vip.id)">
  71. 确认协议并支付
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import mixinList from '@/mixins/list.js'
  79. import {
  80. mapState
  81. } from 'vuex'
  82. export default {
  83. mixins: [mixinList],
  84. data() {
  85. return {
  86. radiovalue: false,
  87. mixinsListApi: 'commonQueryVipType',
  88. vipId: '',
  89. numInfo: {}
  90. }
  91. },
  92. onShow() {
  93. this.$store.commit('getUserInfo')
  94. //判断如果是登录状态则获取信息
  95. this.getUserCenterData();
  96. },
  97. computed: {
  98. headImage() {
  99. return '/static/image/center/headImage.png'
  100. },
  101. //获取个人中心基础信息的接口
  102. getUserCenterData() {
  103. this.$api('getUserCenterData', {}, res => {
  104. if (res.code == 200) {
  105. this.numInfo = res.result
  106. }
  107. })
  108. },
  109. vip() {
  110. let vip = {}
  111. this.list.forEach(n => {
  112. if (n.id == this.vipId) {
  113. let keys = n.perquisite.split('##')
  114. keys.forEach((s, i) => {
  115. keys[i] = s.split('$$')
  116. })
  117. n.keys = keys
  118. vip = n
  119. }
  120. })
  121. return vip
  122. },
  123. },
  124. methods: {
  125. submit(id) {
  126. console.log("当前标识:" + id)
  127. this.$api('addVIP', {
  128. id: id
  129. }, res => {
  130. uni.requestPayment({
  131. provider: 'wxpay', // 服务提提供商
  132. timeStamp: res.result.timeStamp, // 时间戳
  133. nonceStr: res.result.nonceStr, // 随机字符串
  134. package: res.result.packageValue,
  135. signType: res.result.signType, // 签名算法
  136. paySign: res.result.paySign, // 签名
  137. success: function(res) {
  138. console.log('支付成功', res);
  139. self.$refs.confirmationPopupUpload.open()
  140. // self.$refs.confirmationPopup.close()
  141. },
  142. fail: function(err) {
  143. console.log('支付失败', err);
  144. self.$refs.confirmationPopup.close()
  145. uni.showToast({
  146. icon: 'none',
  147. title: "支付失败"
  148. })
  149. }
  150. });
  151. })
  152. },
  153. getDataThen(list) {
  154. this.vipId = list[0] && list[0].id
  155. },
  156. },
  157. }
  158. </script>
  159. <style scoped lang="scss">
  160. .page {
  161. background-color: #fff;
  162. height: 100vh;
  163. .head {
  164. display: flex;
  165. background-color: $uni-color;
  166. padding: 40rpx 20rpx;
  167. align-items: center;
  168. position: relative;
  169. color: #fff;
  170. padding-bottom: 70rpx;
  171. .headImage {
  172. width: 120rpx;
  173. height: 120rpx;
  174. background-size: 100% 100%;
  175. overflow: hidden;
  176. border-radius: 50%;
  177. margin-right: 40rpx;
  178. image {
  179. height: 100%;
  180. width: 100%;
  181. }
  182. }
  183. .info {
  184. font-size: 28rpx;
  185. .name {
  186. font-size: 32rpx;
  187. display: flex;
  188. padding-bottom: 10rpx;
  189. view {
  190. display: flex;
  191. font-size: 20rpx;
  192. align-items: center;
  193. padding-left: 20rpx;
  194. }
  195. }
  196. .tips {
  197. font-size: 26rpx;
  198. color: #fff;
  199. }
  200. }
  201. }
  202. .openvip {
  203. width: 100%;
  204. text-align: center;
  205. padding: 40rpx 0;
  206. font-size: 36rpx;
  207. font-weight: 500;
  208. }
  209. .options {
  210. display: flex;
  211. flex-wrap: wrap;
  212. .option {
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. flex-direction: column;
  217. border: 2rpx solid #3796F8;
  218. width: 220rpx;
  219. height: 240rpx;
  220. border-radius: 16rpx;
  221. box-sizing: border-box;
  222. margin: 12rpx;
  223. view {
  224. margin-top: 15rpx;
  225. font-size: 28rpx;
  226. }
  227. }
  228. .act {
  229. border: 4rpx solid $uni-color;
  230. box-shadow: 0 0 10rpx 10rpx rgba($uni-color, 0.2);
  231. }
  232. }
  233. .block {
  234. width: 90%;
  235. margin-left: 5%;
  236. .privilege {
  237. font-size: 34rpx;
  238. padding: 60rpx 0rpx 40rpx;
  239. }
  240. .cells {
  241. display: flex;
  242. flex-direction: column;
  243. .cell {
  244. display: flex;
  245. align-items: center;
  246. margin: 20rpx 0;
  247. .text {
  248. margin-left: 20rpx;
  249. color: #707070;
  250. font-size: 28rpx;
  251. }
  252. image {
  253. height: 70rpx;
  254. width: 70rpx;
  255. }
  256. }
  257. }
  258. .tail {
  259. display: flex;
  260. align-items: center;
  261. margin-top: 30rpx;
  262. view:nth-child(2) {
  263. margin-left: 10rpx;
  264. color: #707070;
  265. font-size: 24rpx;
  266. }
  267. }
  268. }
  269. .confirm {
  270. display: flex;
  271. position: fixed;
  272. bottom: 0px;
  273. width: 100%;
  274. justify-content: center;
  275. align-items: center;
  276. padding: 8rpx 0;
  277. box-shadow: 0 -2rpx 6rpx 0 #d9d9d9;
  278. .box {
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. width: 92%;
  283. font-size: 28rpx;
  284. view:nth-child(1) {
  285. color: #999999;
  286. }
  287. view:nth-child(2) {
  288. padding: 25rpx 60rpx;
  289. color: #FFFFFF;
  290. background-color: #3796F8;
  291. border-radius: 12rpx;
  292. }
  293. view:nth-child(1) {
  294. color: #999999;
  295. }
  296. }
  297. }
  298. }
  299. </style>