瑶都万能墙
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.

225 lines
4.3 KiB

6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <uv-popup ref="popup" :round="30">
  3. <view class="page">
  4. <view class="UniversalWall">
  5. <view class="logo">
  6. <image src="/static/image/logo.jpg" mode="aspectFill"></image>
  7. </view>
  8. <view class="wall">
  9. 瑶都万能墙
  10. </view>
  11. <view class="invite">
  12. <button open-type="share">
  13. <uv-icon name="attach"></uv-icon>
  14. 邀请好友
  15. </button>
  16. </view>
  17. </view>
  18. <view class="vipList">
  19. <view
  20. @click="selectVip(item)"
  21. :class="{vip : true, act : item == vipKeyName}"
  22. :key="index"
  23. v-for="(item, index) in vipList">
  24. <view class="title">
  25. {{ headInfo[item].keyName }}
  26. <view :class="vipStatus.class"
  27. v-if="vipList.indexOf(item) + 1 == vipLog.type">
  28. {{ vipStatus.title }}
  29. </view>
  30. </view>
  31. <view class="price">
  32. {{ headInfo[item].keyValue }}
  33. </view>
  34. <view class="end_time"
  35. v-if="vipList.indexOf(item) + 1 == vipLog.type">
  36. {{ vipLog.endTime }}到期
  37. </view>
  38. <uv-parse :content="headInfo[item].keyDetails"></uv-parse>
  39. <view class="">
  40. </view>
  41. </view>
  42. </view>
  43. <view class="uni-color-btn"
  44. @click="submit">
  45. <text v-if="vipStatus.success
  46. && vipLog.type != vipList.indexOf(vipKeyName) + 1">
  47. 升级会员{{ headInfo[vipKeyName].keyValue }}/每月
  48. </text>
  49. <text v-else>
  50. {{ vipStatus.submit }}{{ headInfo[vipKeyName].keyValue }}/每月
  51. </text>
  52. </view>
  53. </view>
  54. </uv-popup>
  55. </template>
  56. <script>
  57. import { mapState } from 'vuex'
  58. export default {
  59. data() {
  60. return {
  61. vipKeyName : 'vip',
  62. vipList : ['vip', 'vipBig'],
  63. }
  64. },
  65. computed : {
  66. ...mapState(['headInfo', 'vipLogList']),
  67. vipLog(){
  68. return this.vipLogList.length ? this.vipLogList[0] : {}
  69. },
  70. vipStatus(){
  71. if(!this.vipLog.endTime){
  72. return {
  73. title : '',
  74. class : 'status',
  75. submit : '开通',
  76. }
  77. }
  78. let endTime = new Date(this.vipLog.endTime).getTime()
  79. let time = new Date().getTime()
  80. if(endTime > time){
  81. return {
  82. title : '进行中',
  83. class : 'status',
  84. submit : '续费',
  85. success : true,//进行中
  86. }
  87. }else{
  88. return {
  89. title : '过期',
  90. class : 'status end',
  91. submit : '续费',
  92. }
  93. }
  94. }
  95. },
  96. methods: {
  97. selectVip(item){
  98. this.vipKeyName = item
  99. },
  100. open() {
  101. this.$refs.popup.open('bottom')
  102. this.$store.commit('getMemberInfo')
  103. },
  104. submit(){
  105. this.$api('openMember', {
  106. type : this.vipList.indexOf(this.vipKeyName) + 1,
  107. }, res => {
  108. if(res.code == 200){
  109. uni.requestPaymentWxPay(res)
  110. .then(res => {
  111. this.$refs.popup.close()
  112. this.$store.commit('getMemberInfo')
  113. uni.showToast({
  114. title: '会员开通成功',
  115. icon: 'none'
  116. })
  117. })
  118. }
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style scoped lang="scss">
  125. .page {
  126. padding: 20rpx;
  127. .vipList{
  128. display: flex;
  129. .vip{
  130. flex: 1;
  131. border-radius: 10rpx;
  132. border: 4rpx solid #00000033;
  133. padding: 16rpx;
  134. box-sizing: border-box;
  135. margin: 5rpx;
  136. line-height: 40rpx;
  137. font-size: 24rpx;
  138. .title{
  139. font-weight: 900;
  140. display: flex;
  141. align-items: center;
  142. .status{
  143. font-size: 20rpx;
  144. font-weight: 500;
  145. padding: 2rpx 10rpx;
  146. border-radius: 10rpx;
  147. background-color: #5ac725;
  148. color: #fff;
  149. margin-left: auto;
  150. }
  151. .status.end{
  152. background-color: #909399;
  153. }
  154. }
  155. .price{
  156. font-weight: 900;
  157. color: #fa0;
  158. font-size: 32rpx;
  159. line-height: 50rpx;
  160. }
  161. }
  162. .act{
  163. border: 4rpx solid #fa0;
  164. }
  165. }
  166. .uni-color-btn{
  167. width: 80%;
  168. }
  169. .UniversalWall {
  170. height: 100%;
  171. width: 100%;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. .wall {
  176. font-size: 30rpx;
  177. letter-spacing: 2px;
  178. color: black;
  179. }
  180. .invite {
  181. margin-left: auto;
  182. button {
  183. background-color: white;
  184. font-size: 30rpx;
  185. display: flex;
  186. width: 200rpx;
  187. justify-content: center;
  188. align-items: center;
  189. border-radius: 20rpx !important;
  190. padding: 0 !important;
  191. margin: 0 !important;
  192. }
  193. }
  194. .logo {
  195. width: 120rpx;
  196. height: 120rpx;
  197. margin: 20rpx;
  198. image {
  199. width: 100%;
  200. height: 100%;
  201. border-radius: 15rpx;
  202. }
  203. }
  204. }
  205. }
  206. </style>