index.vue 45 KB

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