info.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="padding padding-lr-sm" v-if="fetch && fetch.user && fetch.user.logo" @click="Dever.close()">
  3. <use-tabbar :tabbar="false"></use-tabbar>
  4. <!-- 会员区域 -->
  5. <view class="vip-area border-radius padding-lg padding-bottom padding-lr-xl w-full dflex-b dflex-flow-c">
  6. <view class="dflex-b w-full">
  7. <view class="dflex-c">
  8. <image :src="fetch.user.logo" class="border-radius-c margin-right-sm"
  9. style="width: 40px; height: 40px;"></image>
  10. <view class="ft-white">
  11. <view class="fwb fs-30">{{fetch.user.name}}</view>
  12. <view class="fs-xxs">{{fetch.role.info}}</view>
  13. </view>
  14. </view>
  15. <view class="bg-base border-radius-lg fs-xs padding-lr-sm padding-tb-xxs">{{fetch.user.title}}</view>
  16. </view>
  17. <view class="dflex-b w-full">
  18. <view class="dflex">
  19. <text class="iconfont iconhuiyuan ft-base fs-xl margin-right-xs" style="line-height: 30px;"></text>
  20. <text class="fs-xs" style="color: rgb(92, 92, 92);">{{fetch.user.card}}</text>
  21. </view>
  22. <view class="fs-xs">
  23. <text style="color: rgb(92, 92, 92);">{{fetch.user.info}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. <u-empty v-if="fetch.level && fetch.level.length <= 0" marginTop="150" mode="permission"
  28. :text="`暂无${fetch.role.name}`"></u-empty>
  29. <view v-else>
  30. <u-tabs :list="fetch.level" @click="click" :current="current"></u-tabs>
  31. <view>
  32. <!-- 会员权益标题 -->
  33. <view class="role-area border-radius-big fwb tac padding-tb-16 ft-base pos-r pos-l-c fs">
  34. {{level.name}}/{{level.day_desc}}
  35. </view>
  36. <!-- 权益列表 -->
  37. <view class="bg-main border-radius padding padding-top-lg padding-bottom-big dflex-wrap-w">
  38. <view class="tac margin-top-sm" style="color: #888;">
  39. {{level.info}}
  40. </view>
  41. <u-empty v-if="level.profit && level.profit.length <= 0" marginTop="50" mode="permission"
  42. text="暂无权益,敬请期待"></u-empty>
  43. <u-subsection class="tabs" v-else :list="level.profit" activeColor="#f56c6c" :current="level.active"
  44. @change="sectionChange"></u-subsection>
  45. <view class="tab-content">
  46. <!-- 永久权益 -->
  47. <view v-if="level.active === 0">
  48. <view class="" v-for="(item, index) in level.upgrade" :key="index">
  49. <view class="coupon_box border-radius margin-top-sm bg-main"
  50. @click="showModal(item.title, item.tip)">
  51. <view class="dflex-b">
  52. <view class="left pos-a h-full dflex-c dflex-flow-c">
  53. <view class="fs-sm">{{item.type_name}}</view>
  54. </view>
  55. <view class="right padding left_t flex1">
  56. <view class="dflex-b padding-bottom-xs">
  57. <view class="fwb fs">{{ item.name }}</view>
  58. <text class="arrow" v-if="item.tip">›</text>
  59. </view>
  60. <view class="dflex-b ft-dark fs-xs padding-bottom border-line">
  61. <view class="">{{ item.desc }}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 周期权益 -->
  69. <view v-if="level.active === 1">
  70. <view class="" v-for="(item, index) in level.period" :key="index">
  71. <view class="coupon_box border-radius margin-top-sm bg-main"
  72. @click="showModal(item.title, item.tip)">
  73. <view class="dflex-b">
  74. <view class="left pos-a h-full dflex-c dflex-flow-c">
  75. <view class="fs-sm">{{item.type_name}}</view>
  76. </view>
  77. <view class="right padding left_t flex1">
  78. <view class="dflex-b padding-bottom-xs">
  79. <view class="fwb fs">{{ item.name }}</view>
  80. <text class="arrow" v-if="item.tip">›</text>
  81. </view>
  82. <view class="dflex-b ft-dark fs-xs padding-bottom border-line">
  83. <view class="">{{ item.desc }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 底部按钮 -->
  93. <view class="margin-top-big border-radius-lg"
  94. style="position: fixed;bottom: 28px; left: 14px; right: 14px;">
  95. <view class="tac fwb flex1 bg-base dflex overflow-hidden">
  96. <view class="flex1 padding-tb-sm tal" style="text-align: center;">
  97. <u-popover position="top" width="200px">
  98. <text class="fs-34 line-height-1">{{level.price_text}}</text>
  99. <view v-if="level.promotion_text" style="margin-left:5px;display: inline-block;">
  100. <u-icon name="question-circle"
  101. color="#00000042"></u-icon>
  102. </view>
  103. <template v-slot:content>
  104. <view style="color: white;">
  105. <u-parse :content="level.promotion_text"></u-parse>
  106. </view>
  107. </template>
  108. </u-popover>
  109. </view>
  110. <view class="bg-warn ft-white padding-tb-sm" style="width: 40%;" @click="buy">{{level.button}}
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. <u-modal @confirm="closeModal" :show="show.state" :title="show.title" :closeOnClickOverlay="true">
  116. <view class="slot-content">
  117. <u-parse :content="show.content"></u-parse>
  118. </view>
  119. </u-modal>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. export default {
  125. data() {
  126. return {
  127. fetch: {},
  128. level: {},
  129. id: 0,
  130. current: 0,
  131. show: {
  132. state: false,
  133. title: '',
  134. content: '',
  135. },
  136. };
  137. },
  138. //下拉刷新
  139. onPullDownRefresh() {
  140. this.loadData();
  141. },
  142. onLoad(options) {
  143. if (options && options.id) {
  144. this.id = options.id;
  145. } else {
  146. return this.Dever.goHome();
  147. }
  148. this.loadData();
  149. },
  150. onShow() {
  151. this.current = 0;
  152. this.loadData();
  153. },
  154. methods: {
  155. showModal(title, content) {
  156. if (content) {
  157. this.show.title = title;
  158. this.show.content = content;
  159. this.show.state = true;
  160. }
  161. },
  162. closeModal() {
  163. this.show.state = false;
  164. },
  165. loadData() {
  166. this.DeverApi.get(this, 'role.info', {
  167. id: this.id
  168. }, res => {
  169. this.level = res.level[this.current];
  170. });
  171. },
  172. sectionChange(index) {
  173. this.level.active = index;
  174. },
  175. click(e) {
  176. this.current = e.index
  177. this.level = e;
  178. },
  179. buy() {
  180. var detail = [{
  181. id: this.level.id,
  182. num: 1,
  183. }]
  184. this.Dever.data('detail', {
  185. type: 'role',
  186. type_id: this.fetch.role.id,
  187. detail: detail,
  188. jump: 'user/index',
  189. });
  190. this.Dever.location('order/create');
  191. },
  192. }
  193. };
  194. </script>
  195. <style lang="scss">
  196. .vip-area {
  197. background-image: url('/static/images/role.png');
  198. background-repeat: no-repeat;
  199. background-size: 100% 100%;
  200. height: 134px;
  201. }
  202. .margin-top-sm {
  203. margin-top: 12rpx;
  204. }
  205. .role-area {
  206. width: 202px;
  207. top: 19px;
  208. z-index: 1;
  209. border: 1px solid rgb(255, 106, 108);
  210. background: rgb(254, 240, 239);
  211. }
  212. .tabs {
  213. display: flex;
  214. border-bottom: 2rpx solid #eee;
  215. margin-bottom: 20rpx;
  216. margin-top: 30rpx;
  217. }
  218. .tab-item {
  219. flex: 1;
  220. text-align: center;
  221. padding: 20rpx;
  222. font-weight: 500;
  223. color: #666;
  224. }
  225. .tab-item.active {
  226. color: #007aff;
  227. border-bottom: 4rpx solid #007aff;
  228. }
  229. .fs-xxs {
  230. font-size: 24rpx;
  231. }
  232. .coupon_box {
  233. background-color: #eee8eb45;
  234. position: relative;
  235. &:last-child {
  236. margin-bottom: 20rpx;
  237. }
  238. .left {
  239. background-color: #6a92ffa1;
  240. color: #fff;
  241. width: 30%;
  242. .price {
  243. color: #fff !important;
  244. }
  245. }
  246. .right {
  247. margin-left: 30%;
  248. }
  249. .border-line {
  250. border-bottom: 1px dotted #ededed;
  251. }
  252. }
  253. /* 按钮样式 */
  254. .btn-receive {
  255. background: $base-color;
  256. color: #fff;
  257. font-weight: bold;
  258. }
  259. .btn-receive-disabled {
  260. color: #fff;
  261. font-weight: bold;
  262. }
  263. .btn-container {
  264. left: 9px;
  265. right: 9px;
  266. bottom: 0;
  267. }
  268. .btn-exchange {
  269. background: #ff6ade;
  270. color: #fff;
  271. font-weight: bold;
  272. }
  273. .u-popover {
  274. display: block !important;
  275. }
  276. </style>