memberConvert.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="member-convert-page">
  3. <view class="convert-top">
  4. <!-- <view class="jz-member">
  5. <image src="/static/images/new/jz-logo-member.png" mode="aspectFill"></image>
  6. <text>鲸致生活·超级鲸会员</text>
  7. </view>
  8. <view class="jz-slogan">— 专注自营品质家庭服务 —</view> -->
  9. <view class="user-info">
  10. <image mode="aspectFill" class="user-avatar" :src="memberUserInfo.avatarUrl ? memberUserInfo.avatarUrl : '/static/images/new/icon-user.png'"></image>
  11. <view class="user-detail">
  12. <view class="user-name">
  13. <text>{{ memberUserInfo.nickName }}</text>
  14. </view>
  15. <view class="member-date">
  16. <image
  17. mode="aspectFill"
  18. src="https://jzmall.lifejingzhi.com/file/jzmall/weixin/memberCard-1229/icon-vip.png"
  19. style="width: 22rpx; height: 22rpx; margin-right: 4rpx"
  20. ></image>
  21. <text v-if="memberUserInfo.level == 0">您未开通会员</text>
  22. <text v-if="memberUserInfo.level == 1">您已开通会员</text>
  23. <text v-if="memberUserInfo.level == 2">您的会员已到期</text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="code-wrapper">
  28. <input class="code-input" maxlength="8" placeholder="请输入兑换码" @input="codeInput" :value="code" />
  29. </view>
  30. <view class="confirm-convert" @tap="confirmConvert">确认兑换</view>
  31. <view class="jz-slogan">——— 鲸致生活·专注自营品质家庭服务 ———</view>
  32. </view>
  33. <!-- 活动规则 -->
  34. <view class="activity-rule-title">
  35. <!-- <view class="title-hardline">
  36. </view> -->
  37. <text>活动规则</text>
  38. <!-- <view class="title-hardline">
  39. </view> -->
  40. </view>
  41. <view class="activity-rule-content">
  42. <!-- <view>1.兑换后的超级鲸会员权益将绑定在您本次登录的账号上,一经兑换无法修改权益账号; </view>
  43. <view>2.每个兑换码仅限使用一次; </view>
  44. <view>3.如您是通过外部合作渠道(非鲸致生活平台内)获得超级鲸会员的兑换资格,此超级会员资格仅包含鲸致生活平台内的基本特权,不包含其他外部特权或专属福利,具体外部权益以对应渠道的公示为准; </view>
  45. <view>4.兑换前可转赠亲友,一旦兑换后不支持转赠; </view> -->
  46. <view>1. 超级鲸会员权益将绑定在您本次登录的账号中,支付成功后 立即生效,不支持转增。</view>
  47. <view>2.每个兑换码仅限使用一次。</view>
  48. <view>3.通过外部合作渠道(非鲸致生活平台内)获得超级鲸会员资格的此超级会员资格仅包含鲸致生活平台内的基本特权,不包括其他外部联名或合作渠道的特权和专属福利。</view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. var util = require('../../../utils/util.js');
  54. var api = require('../../../config/api');
  55. var user = require('../../../utils/user.js');
  56. var app = getApp();
  57. export default {
  58. data() {
  59. return {
  60. code: '',
  61. userInfo: null,
  62. hasLogin: false,
  63. memberUserInfo: {
  64. nickName: '用户',
  65. avatarUrl: '/static/images/new/icon-user.png',
  66. level: '0'
  67. }
  68. };
  69. }
  70. /**
  71. * 生命周期函数--监听页面加载
  72. */,
  73. onLoad: function (options) {},
  74. /**
  75. * 生命周期函数--监听页面初次渲染完成
  76. */
  77. onReady: function () {},
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function () {
  82. if (app.globalData.hasLogin) {
  83. let userInfo = uni.getStorageSync('userInfo');
  84. console.info(userInfo);
  85. this.setData({
  86. userInfo: userInfo,
  87. hasLogin: true,
  88. memberUserInfo: app.globalData.memberUserInfo
  89. });
  90. } else {
  91. uni.navigateTo({
  92. url: '/pages/auth/login/login'
  93. });
  94. }
  95. },
  96. /**
  97. * 生命周期函数--监听页面隐藏
  98. */
  99. onHide: function () {},
  100. /**
  101. * 生命周期函数--监听页面卸载
  102. */
  103. onUnload: function () {},
  104. /**
  105. * 页面相关事件处理函数--监听用户下拉动作
  106. */
  107. onPullDownRefresh: function () {},
  108. /**
  109. * 页面上拉触底事件的处理函数
  110. */
  111. onReachBottom: function () {},
  112. /**
  113. * 用户点击右上角分享
  114. */
  115. onShareAppMessage: function () {},
  116. methods: {
  117. codeInput(e) {
  118. this.setData({
  119. code: e.detail.value
  120. });
  121. },
  122. confirmConvert() {
  123. if (this.code == '') {
  124. uni.showToast({
  125. title: '请输入兑换码',
  126. icon: 'none',
  127. duration: 2000
  128. });
  129. } else {
  130. this.exchangeMemberCoupon();
  131. }
  132. },
  133. exchangeMemberCoupon() {
  134. util.request(
  135. api.exchangeMemberCoupon,
  136. {
  137. userId: app.globalData.userInfo.id,
  138. memberCode: this.code
  139. },
  140. 'GET'
  141. ).then((res) => {
  142. console.info(res);
  143. if (res.errno === 0) {
  144. let endTime = res.data.endTime.substr(0, 10);
  145. uni.navigateTo({
  146. url: '/pages/member/becomeMember/becomeMember?endTime=' + endTime
  147. });
  148. } else {
  149. util.showErrorToast(res.errmsg);
  150. }
  151. });
  152. }
  153. }
  154. };
  155. </script>
  156. <style>
  157. .convert-top {
  158. background: url('https://jzmall.lifejingzhi.com/file/jzmall/weixin/memberCard-1229/member-pay-bg.png') no-repeat center top;
  159. background-size: 100%;
  160. height: 560rpx;
  161. width: 750rpx;
  162. padding: 30rpx 0 0;
  163. }
  164. .jz-member {
  165. height: 44rpx;
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. margin: 0 0 30rpx 0;
  170. }
  171. .jz-member image {
  172. width: 52rpx;
  173. height: 44rpx;
  174. margin: 0 24rpx 0 0;
  175. }
  176. .jz-member text {
  177. line-height: 44rpx;
  178. font-size: 44rpx;
  179. font-weight: bold;
  180. background: linear-gradient(78deg, #f1e3c8 0%, #e6c162 100%);
  181. -webkit-background-clip: text;
  182. -webkit-text-fill-color: transparent;
  183. }
  184. .activity-rule-title {
  185. /* height:112rpx; */
  186. padding: 36rpx 28rpx 20rpx;
  187. /* display: flex;
  188. align-items:center; */
  189. font-size: 34rpx;
  190. font-weight: bold;
  191. }
  192. .title-hardline {
  193. height: 2rpx;
  194. background: #85868a;
  195. flex: 1;
  196. }
  197. .activity-rule-title text {
  198. font-size: 33rpx;
  199. margin: 0 16rpx;
  200. }
  201. .activity-rule-content {
  202. padding: 0 40rpx 0 36rpx;
  203. font-size: 24rpx;
  204. color: #85868a;
  205. line-height: 44rpx;
  206. text-align: justify;
  207. }
  208. .jz-slogan {
  209. /* background: linear-gradient(78deg, #F1E3C8 0%, #E6C162 100%);
  210. -webkit-background-clip: text;
  211. -webkit-text-fill-color: transparent; */
  212. font-size: 22rpx;
  213. text-align: center;
  214. margin-top: 38rpx;
  215. color: #bababa;
  216. }
  217. .code-wrapper {
  218. width: 530rpx;
  219. height: 100rpx;
  220. margin: 52rpx auto 30rpx;
  221. background: #fff;
  222. border-radius: 100rpx;
  223. }
  224. .code-input {
  225. height: 100rpx;
  226. text-align: center;
  227. font-size: 32rpx;
  228. }
  229. .confirm-convert {
  230. width: 530rpx;
  231. height: 100rpx;
  232. line-height: 100rpx;
  233. background: linear-gradient(0deg, #e4cfa8, #e4cfa8);
  234. box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(111, 111, 111, 0.06);
  235. border-radius: 100rpx;
  236. color: #663315;
  237. margin: 0 auto;
  238. text-align: center;
  239. font-size: 36rpx;
  240. text-shadow: 2rpx 6rpx 8rpx rgba(30, 4, 4, 0.18);
  241. }
  242. .user-info {
  243. height: 112rpx;
  244. margin: 0 0 32rpx;
  245. display: flex;
  246. justify-content: space-between;
  247. align-items: flex-end;
  248. padding-left: 40rpx;
  249. }
  250. .user-avatar {
  251. width: 112rpx;
  252. height: 112rpx;
  253. background-color: #fff;
  254. border-radius: 112rpx;
  255. margin: 0 20rpx 0 0;
  256. }
  257. .user-detail {
  258. flex: 1;
  259. padding: 0 0 12rpx;
  260. color: #fff;
  261. font-size: 26rpx;
  262. }
  263. .user-name {
  264. height: 30rpx;
  265. display: flex;
  266. align-items: center;
  267. margin: 0 0 20rpx 0;
  268. }
  269. .user-name text {
  270. font-size: 32rpx;
  271. }
  272. .member-date {
  273. height: 30rpx;
  274. font-size: 22rpx;
  275. line-height: 30rpx;
  276. color: #828387;
  277. display: flex;
  278. align-items: center;
  279. }
  280. </style>