1
0

index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. <template>
  2. <app-layout>
  3. <!-- 卡片 -->
  4. <view v-if="!first" class="head-card" :style="[{'background-color': `${list.form.card_bg}`}]">
  5. <image :src="list.form.head_card != 'statics/img/app/vip_card/default-card.png'?list.form.head_card:svipImg.default_card" class="card-bg" alt=""></image>
  6. <image class="card-bottom" :src="svipImg.card_bottom" alt=""></image>
  7. <view class="card-name dir-left-nowrap" :style="[{'color': `${list.form.card_color}`}]">
  8. <view>{{detail ? list.name: '暂未添加会员卡'}}</view>
  9. <view v-if="user.order.length > 0" @click="toggleLog" class="buy-log dir-left-nowrap cross-center"><view>购买记录</view><image class="buy-log-icon" src="./../image/right.png"></image></view>
  10. </view>
  11. <view class="open-info" :style="[{'color': `${list.form.card_color}`}]">
  12. <view>开通会员可享受以下权利</view>
  13. <view class="card-rights cross-center dir-left-nowrap">
  14. <image class="image" src="./../image/coupon-icon.png"></image>
  15. <view>{{user ? user.image_discount == 0 ? '免费' : user.image_discount + '折' : card.discount == 0 ? '免费' : card.discount + '折'}}</view>
  16. <image class="image free-icon" v-if="user ? user.image_is_free_delivery ==1 : card.is_free_delivery == 1" src="./../image/free.png"></image>
  17. <view v-if="user ? user.image_is_free_delivery ==1 : card.is_free_delivery == 1">自营商品包邮</view>
  18. <view @click="toRight" class="buy-log dir-left-nowrap cross-center"><view>查看权益</view><image class="buy-log-icon" src="./../image/right.png"></image></view>
  19. </view>
  20. <view class="userDay" v-if="user">有效时间:{{start_time}}-{{end_time}}</view>
  21. <view class="userDay" v-if="user && user.expire > 0">累积剩余{{user.expire}}天</view>
  22. <view class="userDay" v-if="user && user.expire < 1">已过期</view>
  23. </view>
  24. <image class="share-btn" @click="showShare = !showShare" src="./../image/share.png" alt=""></image>
  25. <view v-if="!is_buy && card.detail.length > 0" @click="toBuy(detail.id)" class="card-buy">立即开通</view>
  26. </view>
  27. <view class="placeholde"></view>
  28. <!-- 子卡列表 -->
  29. <view class="card-detail-title" v-if="is_buy">请选择续费时长</view>
  30. <view class="card-detail-list" v-if="card.detail.length > 0 && !first">
  31. <scroll-view :scroll-into-view="scroll_position" class="scroll-view" scroll-x="true">
  32. <view :id="'detail' + index" @click="choose(item,index)" :class="['scroll-item',`${item.id == detail.id ? 'active':''}`]" :key="item.id" v-for="(item,index) in card.detail">
  33. <view class="scroll-item-name">{{item.name}}</view>
  34. <view class="scroll-item-price">¥<text>{{item.price}}</text></view>
  35. <view class="cross-center main-center" @click.stop="lookAbout(item)">
  36. <text style="color: #999999">使用说明</text>
  37. <image class="card-more" v-if="item.id == detail.id" src="./../image/more-active.png"></image>
  38. <image class="card-more" v-else src="./../image/more.png"></image>
  39. </view>
  40. <image v-if="item.id == detail.id" class="choose-icon" src="./../image/right-bottom.png"></image>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. <view>
  45. <view class="list" v-for="(item,index) in list.form.sort" :key="index">
  46. <!-- 会员专享 -->
  47. <view v-if="item == 'member'" class="item vip-icon" :style="[{'background-color': `${list.form.vip_bg}`}]">
  48. <view class="item-title main-center cross-center">
  49. <image :src="svipImg.left" alt=""></image>
  50. <view :style="[{'color': `${list.form.vip_color}`}]" class="item-title-text">会员专享</view>
  51. <image :src="svipImg.right" alt=""></image>
  52. </view>
  53. <view style="width: 100%;overflow-x: auto">
  54. <view class="item-icon-list dir-left-wrap" :style="[{'color': `${list.form.vip_color}`, 'max-height': `${vipHeight}`,'width': `${icon_width}`}]">
  55. <view class="dir-left-wrap cross-top form-icon-list" :key="idx" v-for="(icon_list,idx) in list.form.vip_icon_list">
  56. <view class="item-icon dir-top-nowrap" :key="number" v-for="(res,number) in icon_list" :style="[{'width': `${vip_icon_width + 'rpx'}`}]">
  57. <image class="item-icon-img" :src="res.img"></image>
  58. <view class="item-icon-name">{{res.name}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 会员特权 -->
  65. <view v-if="item == 'right'" class="item">
  66. <view class="item-title main-center cross-center">
  67. <image :src="svipImg.left" alt=""></image>
  68. <view class="item-title-text">会员特权</view>
  69. <image :src="svipImg.right" alt=""></image>
  70. </view>
  71. <view v-for="(res,idx) in list.form.right_list" :key="idx" class="item-right">
  72. <image v-if="res.img == 'statics/img/app/vip_card/off.png'" :src="svipImg.off" alt=""></image>
  73. <image v-else-if="res.img == 'statics/img/app/vip_card/free-shipping.png'" :src="svipImg.shipping" alt=""></image>
  74. <image v-else :src="res.img" alt=""></image>
  75. <view class="item-right-text">
  76. <view :style="[{'color': `${res.big_color}`}]">{{res.big}}</view>
  77. <view :style="[{'color': `${res.small_color}`}]">{{res.small}}</view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 开卡即赠 -->
  82. <view v-if="item == 'gift' && (detail.send_integral_num > 0 || detail.send_balance > 0 || detail.vipCoupons.length > 0 || detail.vipCards.length > 0)" class="item">
  83. <view class="item-title main-center cross-center">
  84. <image :src="svipImg.left" alt=""></image>
  85. <view class="item-title-text">开卡即赠</view>
  86. <image :src="svipImg.right" alt=""></image>
  87. </view>
  88. <view v-if="detail.send_integral_num > 0" class="dir-left-nowrap cross-center item-gift">
  89. <image class="item-gift-img" :src="list.form.integral_icon != 'statics/img/app/vip_card/integral.png'?list.form.integral_icon:svipImg.integral"></image>
  90. <view>积分</view>
  91. <view class="item-gift-about">{{detail.send_integral_num}}积分</view>
  92. </view>
  93. <view v-if="detail.send_balance > 0" class="dir-left-nowrap cross-center item-gift">
  94. <image class="item-gift-img" :src="list.form.balance_icon != 'statics/img/app/vip_card/balance.png'?list.form.balance_icon:svipImg.balance"></image>
  95. <view>余额</view>
  96. <view class="item-gift-about">{{detail.send_balance}}元</view>
  97. </view>
  98. <view v-if="detail.vipCoupons.length > 0" class="dir-left-nowrap cross-center item-gift coupon">
  99. <image class="item-gift-img" :src="list.form.coupon_icon != 'statics/img/app/vip_card/coupon.png'?list.form.coupon_icon:svipImg.coupon"></image>
  100. <view>优惠券</view>
  101. <view class="item-gift-about">X{{couponNum}}</view>
  102. </view>
  103. <view v-if="detail.vipCoupons.length > 0" class="coupon-list">
  104. <scroll-view class="coupon-view" scroll-x="true" scroll-left="120">
  105. <view class="coupon-space"></view>
  106. <view class="coupon-item" :key="coupon.id" v-for="coupon in detail.vipCoupons">
  107. <image class="coupon-bg" src="./../image/coupon.png"></image>
  108. <view class="dir-top-nowrap coupon-info">
  109. <view class="coupon-price" v-if="coupon.type == 2">¥
  110. <text>{{coupon.sub_price}}</text>
  111. </view>
  112. <view class="coupon-price" v-else>
  113. <text>{{coupon.discount}}</text>折
  114. </view>
  115. <view class="coupon-total">满{{coupon.min_price}}可用</view>
  116. </view>
  117. </view>
  118. </scroll-view>
  119. </view>
  120. <view v-if="detail.vipCards.length > 0" class="dir-left-nowrap cross-center item-gift coupon">
  121. <image class="item-gift-img" :src="list.form.card_icon != 'statics/img/app/vip_card/card.png'?list.form.card_icon:svipImg.card"></image>
  122. <view>卡券</view>
  123. <view class="item-gift-about">X{{cardNum}}</view>
  124. </view>
  125. <view v-if="detail.vipCards.length > 0" class="card-list">
  126. <view class="card-item dir-left-nowrap" :key="cardIdx" v-for="(card,cardIdx) in detail.vipCards">
  127. <image :src="card.pic_url"></image>
  128. <view class="t-omit-two">{{card.name}}</view>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- 图片广告 -->
  133. <view v-if="item == 'rubik'" class="rubik" :style="[{'height': `${list.form.rubik.height*2 + 'rpx'}`}]">
  134. <view :style="[{'height': `${rubik.h*2 + 'rpx'}`,'width': `${rubik.w*2 + 'rpx'}`,'top': `${rubik.y*2 + 'rpx'}`,'left': `${rubik.x*2 + 'rpx'}`}]" :key="rubikIndex" v-for="(rubik,rubikIndex) in list.form.rubik.list">
  135. <app-jump-button :url="rubik.url" :open_type="rubik.open_type">
  136. <image :style="[{'height': `${rubik.h*2 + 'rpx'}`,'width': `${rubik.w*2 + 'rpx'}`}]" :src="rubik.pic"></image>
  137. </app-jump-button>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view v-if="detail.id > 0" :class="['bottom-place', `${iphone_x? 'iphone_x':''}`,`${tabbarbool? 'tabbarbool':''}`]"></view>
  143. <!-- 购买按钮 -->
  144. <view v-if="detail.id > 0" :class="['foot main-center cross-center', `${iphone_x? 'iphone_x':''}`,`${tabbarbool? 'tabbarbool':''}`]">
  145. <view>
  146. <view class="foot-button dir-left-nowrap">
  147. <view class="foot-info" :style="[{'background-color': `${list.form.bottom_style_1}`, 'color': `${list.form.bottom_style_2}`}]">
  148. <text>¥{{detail.price}}</text>/{{user ? (user.expire > 0 ? '剩余' + user.expire + '天到期' : '已过期') : '有效期' + detail.expire_day +'天'}}</view>
  149. <view class="foot-buy" @click="toBuy(detail.id)" :style="[{'background-color': `${list.form.bottom_btn_style_1}`, 'color': `${list.form.bottom_btn_style_2}`}]">{{user && is_buy? '立即续费':'立即开通'}}</view>
  150. </view>
  151. <view v-if="list.is_agreement" class="bottom-read main-center cross-bottom">
  152. <view @click="toRead" class="read-icon main-center cross-bottom">
  153. <image v-if="read" :style="[{'background-color': `${list.form.bottom_btn_style_1}`}]" src="./../image/vip-check.png" alt=""></image>
  154. <image v-else src="/static/image/icon/form-er.png" alt=""></image>
  155. </view>
  156. <view :style="[{'color': `${list.form.bottom_btn_style_2}`}]">我已仔细阅读并同意<text @click="toRule" :style="[{'color': `${list.form.bottom_btn_style_1}`}]">《{{list.agreement_title}}》</text></view>
  157. </view>
  158. </view>
  159. </view>
  160. <!-- 子卡使用说明 -->
  161. <view v-if="title && content" class="bg main-center cross-center">
  162. <view class="dialog">
  163. <image @click="lookAbout" class="dialog-close" src="/static/image/icon/icon-close.png"></image>
  164. <view class="dialog-title">{{title}}</view>
  165. <view class="dialog-content">
  166. <text>{{content}}</text>
  167. </view>
  168. <view class="dialog-btn cross-center main-center">
  169. <view @click="lookAbout" class="dialog-button">我知道了</view>
  170. <view class="line"></view>
  171. <view @click="toBuy(id)" class="dialog-button buy">{{user && is_buy? '立即续费':'立即购买'}}</view>
  172. </view>
  173. </view>
  174. </view>
  175. <view v-if="showLog" class="bg main-center cross-center">
  176. <view class="dialog buy-log">
  177. <view class="dialog-top medium">购买记录</view>
  178. <image @click="toggleLog" class="dialog-close" src="/static/image/icon/icon-close.png"></image>
  179. <view class="log-item main-center medium">
  180. <view>子卡名称</view>
  181. <view>有效期</view>
  182. <view>下单时间</view>
  183. </view>
  184. <view class="log-list">
  185. <view v-for="(item,index) in user.order" :key="index" class="log-item main-center">
  186. <view>{{item.detail_name}}</view>
  187. <view>{{item.expire}}天</view>
  188. <view>{{item.created_at}}</view>
  189. </view>
  190. </view>
  191. <view class="log-foot">
  192. <view @click="toggleLog" class="log-foot-btn">我知道了</view>
  193. </view>
  194. </view>
  195. </view>
  196. <view>
  197. <app-share-qr-code :theme="getTheme" v-model="showShare" :url="poster" title="生成海报"></app-share-qr-code>
  198. </view>
  199. </app-layout>
  200. </template>
  201. <script>
  202. import {mapGetters, mapState} from 'vuex';
  203. import appShareQrCode from '../../../components/page-component/app-share-qr-code-poster/app-share-qr-code-poster.vue';
  204. export default {
  205. data() {
  206. return {
  207. list: {
  208. form: {}
  209. },
  210. couponNum: 0,
  211. cardNum: 0,
  212. detail: {
  213. price: '',
  214. expire_day: '',
  215. },
  216. is_buy: false,
  217. first: true,
  218. showLog: false,
  219. showShare: false,
  220. poster: this.$api.vip_card.poster,
  221. card: {
  222. detail: []
  223. },
  224. scroll_position: '',
  225. iphone_x: false,
  226. read: false,
  227. vip_icon_width: 234,
  228. user: {},
  229. title: '',
  230. start_time: '',
  231. end_time: '',
  232. id: 0,
  233. expire_day: 0,
  234. vipHeight: '320rpx',
  235. content: '',
  236. icon_width: '702rpx',
  237. currentRoute: this.$platDiff.route(),
  238. tabbarbool: false,
  239. }
  240. },
  241. computed: {
  242. ...mapState({
  243. svipImg: state => state.mallConfig.__wxapp_img.vip_card,
  244. tabBarNavs: state => state.mallConfig.navbar.navs,
  245. }),
  246. ...mapGetters('mallConfig', {
  247. getTheme: 'getTheme',
  248. }),
  249. },
  250. components: {
  251. appShareQrCode
  252. },
  253. watch: {
  254. tabBarNavs: {
  255. handler: function() {
  256. this.b();
  257. },
  258. immediate: true,
  259. }
  260. },
  261. methods: {
  262. b() {
  263. let currentRoute = this.currentRoute;
  264. for (let i = 0; i < this.tabBarNavs.length; i++) {
  265. if(currentRoute.includes(this.tabBarNavs[i].url.split('?')[0])) {
  266. return this.tabbarbool = true;
  267. }
  268. }
  269. return this.tabbarbool = false;
  270. },
  271. toRight() {
  272. let that = this;
  273. if(that.user != null && +that.user.expire > 0) {
  274. uni.navigateTo({
  275. url: '/plugins/vip_card/rights/rights'
  276. });
  277. }else {
  278. uni.navigateTo({
  279. url: '/plugins/vip_card/rights/rights?id=' + that.detail.id
  280. });
  281. }
  282. },
  283. toRead() {
  284. this.read = !this.read
  285. },
  286. toggleLog() {
  287. this.showLog = !this.showLog
  288. },
  289. toBuy(id) {
  290. let expire_day = 0;
  291. if(this.user != null) {
  292. expire_day = this.user.expire
  293. }
  294. if((this.read && this.list.is_agreement) || !this.list.is_agreement) {
  295. this.title = '';
  296. uni.navigateTo({
  297. url: '/plugins/vip_card/buy/buy?id=' + id + '&end=' + this.end_time + '&expire_day=' + expire_day
  298. });
  299. }else {
  300. uni.showToast({
  301. title: '请先查看申请协议并同意',
  302. icon: 'none',
  303. duration: 1000
  304. });
  305. }
  306. },
  307. toRule() {
  308. // uni.navigateTo({
  309. // url: '/plugins/vip_card/rules/rules'
  310. // });
  311. uni.navigateTo({
  312. url: `/pages/rules/index?url=${encodeURIComponent(this.$api.vip_card.setting)}&key=agreement_content&title=超级会员卡使用说明`,
  313. });
  314. },
  315. lookAbout(item) {
  316. if(item.id > 0) {
  317. this.title = item.title;
  318. this.content = item.content;
  319. this.id = item.id;
  320. this.expire_day = item.expire_day;
  321. }else {
  322. this.title = '';
  323. this.content = '';
  324. }
  325. },
  326. choose(detail,index) {
  327. let that = this;
  328. that.is_buy = false;
  329. that.couponNum = 0;
  330. that.cardNum = 0;
  331. if(index > 1 || index < (that.card.detail.lenth - 2)) {
  332. index--;
  333. }else if(index < 2){
  334. index = 0;
  335. }else {
  336. index = his.card.detail.lenth - 1;
  337. }
  338. that.detail = detail;
  339. that.scroll_position = 'detail' + index;
  340. if(detail.coupons.length > 0) {
  341. for(let i in detail.coupons) {
  342. that.couponNum += +detail.coupons[i].send_num
  343. }
  344. }
  345. if(detail.cards.length > 0) {
  346. for(let i in detail.cards) {
  347. that.cardNum += +detail.cards[i].send_num
  348. }
  349. }
  350. if(that.user && that.user.order) {
  351. that.user.order.forEach(v => {
  352. if(v.detail_id == detail.id) {
  353. that.is_buy = true;
  354. }
  355. })
  356. }
  357. },
  358. getList() {
  359. let that = this;
  360. that.$request({
  361. url: that.$api.vip_card.index,
  362. }).then(response=>{
  363. that.$hideLoading();
  364. that.first = false;
  365. if(response.code == 0) {
  366. that.user = response.data.user;
  367. response.data.user.order.forEach(v => {
  368. if(v.detail_id == that.card.detail[0].id) {
  369. that.is_buy = true;
  370. }
  371. })
  372. if(that.user) {
  373. that.start_time = that.user.start_time.slice(0,10).replace(/-/g,"/");
  374. that.end_time = that.user.end_time.slice(0,10).replace(/-/g,"/");
  375. }
  376. }else {
  377. if(response.msg == '超级会员卡已关闭' || response.msg == '无超级会员卡权限') {
  378. uni.redirectTo({
  379. url: '/pages/index/index'
  380. })
  381. }
  382. uni.showToast({
  383. title: response.msg,
  384. icon: 'none',
  385. duration: 1000
  386. });
  387. }
  388. }).catch(response => {
  389. that.$hideLoading();
  390. });
  391. },
  392. getSetting() {
  393. let that = this;
  394. that.$showLoading({
  395. type: 'global',
  396. text: '加载中...'
  397. });
  398. that.$request({
  399. url: that.$api.vip_card.setting,
  400. }).then(response=>{
  401. if(response.code == 0) {
  402. that.getCard();
  403. that.list = response.data;
  404. for(let index in that.list.form.vip_icon_list) {
  405. for(let i in that.list.form.vip_icon_list[index]){
  406. switch(that.list.form.vip_icon_list[index][i].img) {
  407. case 'statics/img/app/vip_card/icon1.png':
  408. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon1;
  409. break;
  410. case 'statics/img/app/vip_card/icon2.png':
  411. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon2;
  412. break;
  413. case 'statics/img/app/vip_card/icon3.png':
  414. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon3;
  415. break;
  416. case 'statics/img/app/vip_card/icon4.png':
  417. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon4;
  418. break;
  419. case 'statics/img/app/vip_card/icon5.png':
  420. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon5;
  421. break;
  422. case 'statics/img/app/vip_card/icon6.png':
  423. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon6;
  424. break;
  425. case 'statics/img/app/vip_card/icon7.png':
  426. that.list.form.vip_icon_list[index][i].img = that.svipImg.icon7;
  427. break;
  428. }
  429. }
  430. }
  431. if(that.list.form.vip_number == 3) {
  432. that.vip_icon_width = 234
  433. }else if(that.list.form.vip_number == 4) {
  434. that.vip_icon_width = 175
  435. }else if(that.list.form.vip_number == 5) {
  436. that.vip_icon_width = 140
  437. }
  438. that.vipHeight = +that.list.form.vip_line * 160 + 'rpx';
  439. that.icon_width = 702*that.list.form.vip_icon_list.length + 'rpx'
  440. }else {
  441. uni.showToast({
  442. title: response.msg,
  443. icon: 'none',
  444. duration: 1000
  445. });
  446. }
  447. }).catch(response => {
  448. that.$hideLoading();
  449. });
  450. },
  451. getCard() {
  452. let that = this;
  453. that.$request({
  454. url: that.$api.vip_card.card,
  455. }).then(response=>{
  456. if(response.code == 0) {
  457. that.card = response.data;
  458. that.detail = that.card.detail[0];
  459. if(that.detail.coupons.length > 0) {
  460. for(let i in that.detail.coupons) {
  461. that.couponNum += +that.detail.coupons[i].send_num
  462. }
  463. }
  464. if(that.detail.cards.length > 0) {
  465. for(let i in that.detail.cards) {
  466. that.cardNum += +that.detail.cards[i].send_num
  467. }
  468. }
  469. that.getList();
  470. }else {
  471. uni.showToast({
  472. title: response.msg,
  473. icon: 'none',
  474. duration: 1000
  475. });
  476. }
  477. }).catch(response => {
  478. that.$hideLoading();
  479. });
  480. },
  481. },
  482. onShareAppMessage: function() {
  483. return this.$shareAppMessage({
  484. title: '我是' + this.card.name + ',召唤小伙伴一起来加入会员吧!',
  485. imageUrl: this.svipImg.image_share,
  486. path: "/plugins/vip_card/index/index",
  487. });
  488. },
  489. onLoad(options) {
  490. let that = this;
  491. that.getSetting();
  492. uni.getSystemInfo({
  493. success: function (res) {
  494. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1) {
  495. that.iphone_x = true;
  496. }
  497. }
  498. })
  499. },
  500. onShow() {
  501. let that = this;
  502. uni.getStorage({
  503. key: 'vip_card_is_read',
  504. success: function (res) {
  505. that.read = res.data;
  506. uni.removeStorage({
  507. key: 'vip_card_is_read'
  508. });
  509. }
  510. });
  511. if(!that.first) {
  512. that.getList();
  513. }
  514. },
  515. }
  516. </script>
  517. <style scoped lang="scss">
  518. .medium {
  519. font-weight: 600
  520. }
  521. .head-card {
  522. height: #{344rpx};
  523. position: relative;
  524. .buy-log {
  525. margin-left: #{20rpx};
  526. font-size: #{20rpx};
  527. color: #b17426;
  528. .buy-log-icon {
  529. width: #{15rpx};
  530. height: #{15rpx};
  531. margin-left: #{10rpx};
  532. }
  533. }
  534. .share-btn {
  535. position: absolute;
  536. top: 80rpx;
  537. right: 48rpx;
  538. height: 60rpx;
  539. width: 60rpx;
  540. z-index: 12;
  541. }
  542. .card-bg {
  543. position: absolute;
  544. z-index: 11;
  545. top: #{64rpx};
  546. left: 0;
  547. right: 0;
  548. margin: 0 auto;
  549. height: #{360rpx};
  550. width: #{702rpx};
  551. border-radius: #{30rpx};
  552. background-color: #fff;
  553. box-shadow: 0 0 #{20rpx} rgba(0, 0, 0, .3)
  554. }
  555. .card-name {
  556. position: absolute;
  557. top: #{114rpx};
  558. left: #{80rpx};
  559. font-size: #{40rpx};
  560. z-index: 12;
  561. }
  562. .open-info {
  563. position: absolute;
  564. top: #{200rpx};
  565. left: #{80rpx};
  566. font-size: #{24rpx};
  567. z-index: 12;
  568. .card-rights {
  569. margin-top: #{20rpx};
  570. margin-bottom: #{30rpx};
  571. height: #{30rpx};
  572. }
  573. .free-icon {
  574. margin-left: #{65rpx};
  575. }
  576. .image {
  577. width: #{42rpx};
  578. margin-right: #{12rpx};
  579. height: #{30rpx};
  580. }
  581. .userDay {
  582. color: #b17426;
  583. margin-bottom: #{16rpx};
  584. }
  585. }
  586. .card-bottom {
  587. position: absolute;
  588. bottom: 0;
  589. left: 0;
  590. height: #{80rpx};
  591. width: 100%;
  592. z-index: 5;
  593. }
  594. .card-buy {
  595. position: absolute;
  596. top: #{342rpx};
  597. right: #{57rpx};
  598. height: #{44rpx};
  599. line-height: #{44rpx};
  600. width: #{144rpx};
  601. border-radius: #{22rpx};
  602. font-size: #{26rpx};
  603. color: #dba158;
  604. background-color: #ffefde;
  605. text-align: center;
  606. z-index: 12;
  607. }
  608. }
  609. .placeholde {
  610. height: #{120rpx};
  611. }
  612. .scroll-view {
  613. height: #{225rpx};
  614. padding-left: #{11rpx};
  615. white-space: nowrap;
  616. .scroll-item {
  617. display: inline-block;
  618. height: #{223rpx};
  619. width: #{215rpx};
  620. background-color: #fff;
  621. border-radius: #{15rpx};
  622. text-align: center;
  623. padding-top: #{24rpx};
  624. margin-left: #{13rpx};
  625. border: #{2rpx} solid #e5e5e5;
  626. font-size: #{22rpx};
  627. color: #5d5d5d;
  628. position: relative;
  629. .scroll-item-name {
  630. font-size: #{24rpx};
  631. margin-bottom: #{16rpx};
  632. font-weight: bold;
  633. }
  634. .scroll-item-price {
  635. font-size: #{30rpx};
  636. width: #{215rpx};
  637. text-align: center;
  638. white-space: nowrap;
  639. overflow: hidden;
  640. text-overflow: ellipsis;
  641. color: #ff5151;
  642. margin-bottom: #{30rpx};
  643. text {
  644. font-size: #{40rpx};
  645. }
  646. }
  647. .card-more {
  648. width: #{21rpx};
  649. margin-left: #{8rpx};
  650. height: #{21rpx};
  651. }
  652. .choose-icon {
  653. position: absolute;
  654. bottom: 0;
  655. right: 0;
  656. width: #{40rpx};
  657. height: #{37rpx};
  658. }
  659. }
  660. .scroll-item.active {
  661. background-color: #fff8ef;
  662. border-radius: #{15rpx};
  663. text-align: center;
  664. padding-top: #{24rpx};
  665. margin-left: #{13rpx};
  666. border: #{5rpx} solid #ffd8a9;
  667. }
  668. }
  669. .rubik {
  670. position: relative;
  671. margin-top: #{32rpx};
  672. view {
  673. position: absolute;
  674. }
  675. }
  676. .item {
  677. position: relative;
  678. width: #{702rpx};
  679. margin: 0 auto;
  680. padding: #{40rpx} #{36rpx};
  681. font-size: #{32rpx};
  682. border-radius: #{15rpx};
  683. padding-top: #{110rpx};
  684. background-color: #fff;
  685. box-shadow: 0 0 #{8rpx} rgb(239, 239, 239);
  686. .item-title {
  687. position: absolute;
  688. top: #{48rpx};
  689. left: 0;
  690. width: #{702rpx};
  691. .item-title-text {
  692. margin: 0 #{20rpx};
  693. font-size: #{32rpx};
  694. color: #342e25;
  695. }
  696. image {
  697. width: #{60rpx};
  698. height: #{19rpx};
  699. }
  700. }
  701. .item-icon-list {
  702. overflow-y: hidden;
  703. margin: 0 auto;
  704. color: #666666;
  705. .form-icon-list {
  706. width: #{702rpx};
  707. height: #{1rpx};
  708. }
  709. .form-icon-list:first-of-type {
  710. height: auto;
  711. }
  712. }
  713. .item-icon {
  714. text-align: center;
  715. height: #{140rpx};
  716. margin-top: #{20rpx};
  717. .item-icon-img {
  718. width: #{80rpx};
  719. height: #{80rpx};
  720. margin-bottom: #{20rpx};
  721. border-radius: 50%;
  722. margin: 0 auto;
  723. }
  724. .item-icon-name {
  725. font-size: #{26rpx};
  726. }
  727. }
  728. .item-right {
  729. margin-top: #{30rpx};
  730. position: relative;
  731. height: #{160rpx};
  732. .item-right-text {
  733. position: absolute;
  734. left: #{50rpx};
  735. top: #{20rpx};
  736. font-size: #{33rpx};
  737. view:first-of-type {
  738. font-size: #{43rpx};
  739. margin-bottom: #{5rpx};
  740. }
  741. }
  742. image{
  743. width: #{630rpx};
  744. height: #{160rpx};
  745. border-radius: #{15rpx};
  746. }
  747. }
  748. .item-right:first-of-type {
  749. margin-top: 0;
  750. }
  751. .item-gift {
  752. height: #{118rpx};
  753. font-size: #{32rpx};
  754. color: #342e25;
  755. border-bottom: 2rpx solid #e2e2e2;
  756. .item-gift-img {
  757. height: #{52rpx};
  758. width: #{56rpx};
  759. margin-right: #{31rpx};
  760. }
  761. .item-gift-about {
  762. margin-left: #{10rpx};
  763. font-size: #{28rpx};
  764. color: #999999;
  765. }
  766. }
  767. .item-gift.coupon {
  768. border-bottom: 0;
  769. }
  770. .coupon-list {
  771. border-bottom: #{2rpx} solid #e2e2e2;
  772. padding-bottom: #{30rpx};
  773. .coupon-view {
  774. height: #{130rpx};
  775. padding-left: #{15rpx};
  776. white-space: nowrap;
  777. .coupon-space {
  778. height: #{130rpx};
  779. width: #{88rpx};
  780. display: inline-block;
  781. }
  782. .coupon-item {
  783. position: relative;
  784. width: #{256rpx};
  785. height: #{130rpx};
  786. margin-right: #{15rpx};
  787. display: inline-block;
  788. .coupon-bg {
  789. width: #{256rpx};
  790. height: #{130rpx};
  791. }
  792. .coupon-info {
  793. position: absolute;
  794. z-index: 10;
  795. top: #{14rpx};
  796. right: #{75rpx};
  797. height: #{130rpx};
  798. color: #5d402f;
  799. font-size: #{20rpx};
  800. text-align: right;
  801. .coupon-price {
  802. font-size: #{30rpx};
  803. margin-bottom: #{10rpx};
  804. text {
  805. font-size: #{48rpx};
  806. }
  807. }
  808. }
  809. }
  810. }
  811. }
  812. .card-list {
  813. width: #{542rpx};
  814. padding-left: #{88rpx};
  815. .card-item {
  816. height: #{136rpx};
  817. width: #{542rpx};
  818. border-radius: #{15rpx};
  819. font-size: #{28rpx};
  820. color: #000000;
  821. border: #{2rpx} solid #e2e2e2;
  822. padding: #{28rpx} #{24rpx};
  823. margin-bottom: #{16rpx};
  824. image {
  825. width: #{80rpx};
  826. height: #{80rpx};
  827. border-radius: 50%;
  828. margin-right: #{25rpx};
  829. }
  830. }
  831. }
  832. }
  833. .card-detail-title {
  834. margin-left: #{24rpx};
  835. margin-bottom: #{24rpx};
  836. }
  837. .card-detail-list {
  838. margin-bottom: #{32rpx};
  839. }
  840. .list {
  841. margin-top: #{32rpx};
  842. }
  843. .list:first-of-type {
  844. margin-top: 0;
  845. }
  846. .item.vip-icon {
  847. padding: #{110rpx} 0 #{36rpx};
  848. }
  849. .item-gift:last-of-type {
  850. border-bottom: 0
  851. }
  852. .bottom-place {
  853. height: #{200rpx};
  854. }
  855. .bottom-place.tabbarbool {
  856. height: #{200rpx};
  857. }
  858. .bottom-place.iphone_x {
  859. height: #{275rpx};
  860. }
  861. .bottom-place.iphone_x.tabbarbool {
  862. height: #{200rpx};
  863. }
  864. .foot {
  865. position: fixed;
  866. z-index: 101;
  867. bottom: 0;
  868. left: 0;
  869. width: 100%;
  870. padding-top: #{10rpx};
  871. height: #{185rpx};
  872. padding-bottom: #{25rpx};
  873. background-color: #fff;
  874. .foot-button {
  875. width: #{702rpx};
  876. margin: #{10rpx} auto 0;
  877. height: #{80rpx};
  878. line-height: #{80rpx};
  879. font-size: #{24rpx};
  880. text {
  881. font-size: #{36rpx};
  882. }
  883. .foot-info {
  884. width: #{502rpx};
  885. padding-left: #{40rpx};
  886. border-top-left-radius: #{40rpx};
  887. border-bottom-left-radius: #{40rpx};
  888. }
  889. .foot-buy {
  890. width: #{200rpx};
  891. text-align: center;
  892. border-top-right-radius: #{40rpx};
  893. border-bottom-right-radius: #{40rpx};
  894. }
  895. }
  896. .bottom-read {
  897. height: #{34rpx};
  898. font-size: #{20rpx};
  899. .read-icon {
  900. height: #{34rpx};
  901. width: #{44rpx};
  902. image {
  903. width: #{24rpx};
  904. height: #{24rpx};
  905. border-radius: 50%;
  906. }
  907. }
  908. }
  909. }
  910. .foot.iphone_x {
  911. height: #{260rpx};
  912. padding-bottom: #{100rpx};
  913. }
  914. .foot.iphone_x.tabbarbool {
  915. height: #{340rpx};
  916. padding-bottom: #{170rpx};
  917. }
  918. .foot.tabbarbool {
  919. height: #{300rpx};
  920. padding-bottom: #{130rpx};
  921. }
  922. .bg {
  923. position: fixed;
  924. z-index: 200;
  925. top: 0;
  926. left: 0;
  927. background-color: rgba(0,0,0,.3);
  928. width: 100%;
  929. height: 100%;
  930. .dialog {
  931. width: #{650rpx};
  932. background-color: #fff;
  933. padding-bottom: #{122rpx};
  934. border-radius: #{15rpx};
  935. position: relative;
  936. .dialog-top {
  937. height: #{95rpx};
  938. width: #{410rpx};
  939. padding-top: #{20rpx};
  940. font-size: #{32rpx};
  941. color: #342e25;
  942. position: absolute;
  943. text-align: center;
  944. left: 0;
  945. right: 0;
  946. top: 0;
  947. margin: #{-34rpx} auto 0;
  948. background-image: url('./../image/dialog-title.png');
  949. background-size: 100% 100%;
  950. background-repeat: no-repeat;;
  951. background-position: center center;
  952. }
  953. .log-item {
  954. font-size: #{32rpx};
  955. width: #{586rpx};
  956. margin: 0 auto;
  957. height: #{90rpx};
  958. line-height: #{90rpx};
  959. color: #000000;
  960. view{
  961. width: #{175rpx};
  962. text-align: center;
  963. }
  964. }
  965. .log-list {
  966. max-height: #{790rpx};
  967. min-height: #{140rpx};
  968. overflow-y: auto;
  969. .log-item {
  970. border-top: 2rpx solid #e2e2e2;
  971. font-size: #{28rpx};
  972. color: #333333;
  973. }
  974. }
  975. .log-foot {
  976. padding: #{25rpx} 0 #{50rpx};
  977. width: 100%;
  978. .log-foot-btn {
  979. height: #{88rpx};
  980. width: #{586rpx};
  981. text-align: center;
  982. line-height: #{88rpx};
  983. border-radius: #{44rpx};
  984. background-color: #efc493;
  985. font-size: #{32rpx};
  986. color: #fff;
  987. margin: 0 auto;
  988. }
  989. }
  990. .dialog-close {
  991. position: absolute;
  992. top: #{24rpx};
  993. right: #{24rpx};
  994. width: #{30rpx};
  995. height: #{30rpx};
  996. }
  997. .dialog-title {
  998. margin: #{34rpx} auto;
  999. text-align: center;
  1000. width: 75%;
  1001. font-size: #{32rpx};
  1002. color: #353535;
  1003. }
  1004. .dialog-content {
  1005. width: #{586rpx};
  1006. margin: 0 auto;
  1007. max-height: #{517rpx};
  1008. overflow-y: auto;
  1009. border-radius: #{15rpx};
  1010. border: #{2rpx} solid #e2e2e2;
  1011. padding: #{16rpx} #{32rpx};
  1012. }
  1013. .dialog-btn {
  1014. position: absolute;
  1015. bottom: 0;
  1016. left: 0;
  1017. width: #{650rpx};
  1018. height: #{90rpx};
  1019. line-height: #{90rpx};
  1020. border-top: #{2rpx} solid #e2e2e2;
  1021. .dialog-button {
  1022. width: 50%;
  1023. text-align: center;
  1024. color: #666666;
  1025. font-size: #{32rpx};
  1026. }
  1027. .dialog-button.buy {
  1028. color: #e5b883;
  1029. }
  1030. .line {
  1031. height: #{35rpx};
  1032. width: #{1rpx};
  1033. background-color: #e2e2e2;
  1034. }
  1035. }
  1036. }
  1037. .dialog.buy-log {
  1038. width: #{640rpx};
  1039. padding-top: #{92rpx};
  1040. padding-bottom: 0;
  1041. }
  1042. }
  1043. </style>