vipCard.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <view class="box">
  3. <view class="headerBox">
  4. <view class="vip">
  5. <view class="headerTop">
  6. <image src="../../static/img/vipheader.png" mode="" style="width: 80rpx;height: 80rpx;"></image>
  7. <view class="headerRight">
  8. <view class="nameBox">
  9. <view class="name">{{vipData.name}}</view>
  10. <image src="../../static/img/icon_vip.png" mode=""
  11. style="width: 112rpx;height: 34rpx;margin-left: 10rpx;"></image>
  12. </view>
  13. <view class="phone">{{userInfo.mobilePhone}}</view>
  14. </view>
  15. </view>
  16. <view class="kahaoBox">
  17. <image src="../../static/img/icon_kahao.png" mode=""
  18. style="width: 28rpx;height: 28rpx;margin-right: 10rpx;"></image>
  19. <view class="kahao">卡号 {{vipData.cardCode}}</view>
  20. </view>
  21. </view>
  22. <view class="tab">
  23. <view>
  24. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">计次</view>
  25. <view :class="{line:tabIndex==1}"></view>
  26. </view>
  27. <viw>
  28. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">储值</view>
  29. <view :class="{line:tabIndex==2}"></view>
  30. </viw>
  31. </view>
  32. </view>
  33. <!-- 计次 -->
  34. <view class="mainBox" v-if="tabIndex==1">
  35. <view class="btnBox" @click="dis=!dis">
  36. <image v-if="dis" src="../../static/img/icon_selectY.png" mode="" style="width: 36rpx;height: 36rpx;">
  37. </image>
  38. <image v-else src="../../static/img/icon_selectN.png" mode="" style="width: 36rpx;height: 36rpx;">
  39. </image>
  40. <view style="margin-left: 10rpx;color: #3C3C3C;font-size: 24rpx;">不展示剩余为0项</view>
  41. </view>
  42. <view v-for="(item,index) in vipData.cardTimeList">
  43. <view v-if="AmountQtyJs(item.list)" class="itemBox">
  44. <view class="itemTop">
  45. <view class="itemName">{{item.PackName}}</view>
  46. <view class="tiaokuan" @click="useCl(item.useComment)">使用条款</view>
  47. </view>
  48. <view class="itemBottom" :class="{active:item.open}">
  49. <view class="shopName">{{item.shopName}}</view>
  50. <image @click="changeState(item)" v-if="item.open==false" src="../../static/img/icon_arrow_down.png"
  51. mode="" style="width: 34rpx;height: 22rpx;"></image>
  52. <image @click="changeState(item)" v-if="item.open==true" src="../../static/img/icon_arrow_up.png"
  53. mode="" style="width: 34rpx;height: 22rpx;"></image>
  54. </view>
  55. <view v-if="item.open">
  56. <!-- 不展示剩余为0项 -->
  57. <view class="itemBg" v-if="dis&&v.AmountQty!=0" v-for="(v,index2) in item.list" :key="index2">
  58. <view class="nameTop" v-if="v.FlowType==2"><span class="type">项目</span> {{v.FlowName}}</view>
  59. <view class="nameTop" v-if="v.FlowType==1"><span class="type">商品</span> {{v.FlowName}}</view>
  60. <view class="timeBottom">
  61. <view class="time" v-if="v.ExpireTime">有效期:{{v.ExpireTime.slice(0,10)}}</view>
  62. <view class="time" v-else>有效期:永久</view>
  63. <view>剩余/总:<span
  64. style="color: #FF3B30;">{{v.AmountQty}}</span>/{{v.TotalQty}}
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 展示所有 -->
  69. <view class="itemBg" v-if="!dis" v-for="(v,index2) in item.list" :key="index2">
  70. <view class="nameTop" v-if="v.FlowType==2"><span class="type">项目</span> {{v.FlowName}}</view>
  71. <view class="nameTop" v-if="v.FlowType==1"><span class="type">商品</span> {{v.FlowName}}</view>
  72. <view class="timeBottom">
  73. <view class="time" v-if="v.ExpireTime">有效期:{{v.ExpireTime.slice(0,10)}}</view>
  74. <view class="time" v-else>有效期:永久</view>
  75. <view>剩余/总:<span
  76. style="color: #FF3B30;">{{v.AmountQty}}</span>/{{v.TotalQty}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <!-- 无数据空白页 -->
  84. <nodata v-if="vipData.cardTimeList.length==0"></nodata>
  85. <!-- 使用条款-->
  86. <view class="shiyongBox" v-if="shiyongShow" @click="shiyongShow=false">
  87. <view class="shiyongCont" @click.stop="">
  88. <view class="shiyongContTop">
  89. <view class="shiyongContTopTitle">使用条款</view>
  90. <image src="../../static/img/icon_close.png" alt="" class="shiyongContTopX"
  91. @click="shiyongShow=false"></image>
  92. </view>
  93. <view class="shiyonghtml">
  94. <view v-html="useComment" v-if="useComment"></view>
  95. <view v-else class="shiyongno">使用条款暂无内容</view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 储值 -->
  101. <view class="mainBox" v-if="tabIndex==2">
  102. <view class="btnBox" @click="disCz=!disCz">
  103. <image v-if="disCz" src="../../static/img/icon_selectY.png" mode="" style="width: 36rpx;height: 36rpx;">
  104. </image>
  105. <image v-else src="../../static/img/icon_selectN.png" mode="" style="width: 36rpx;height: 36rpx;">
  106. </image>
  107. <view style="margin-left: 10rpx;color: #3C3C3C;font-size: 24rpx;">不展示剩余为0项</view>
  108. </view>
  109. <view v-for="(item,index) in vipData.carMoneyList">
  110. <!-- 不展示剩余为0项 -->
  111. <view v-if="disCz&&item.Money!=0" class="itemBox">
  112. <view class="itemTop">
  113. <view class="itemName">{{item.PacKName}}</view>
  114. <view class="tiaokuan" @click="useCl(item.useComment)">使用条款</view>
  115. </view>
  116. <view class="itemBottom" :class="{active:item.open}">
  117. <view class="shopName">{{item.ShopName}}</view>
  118. <view class="moneyBox"><span style="font-size: 24rpx; color: #FF3B30; padding-top: 2rpx;">¥</span><span class="money">{{item.Money}}</span> <span
  119. style="color: #999999;font-size: 24rpx;">( 充{{item.ChargeMoney}}送{{item.GiftMoney}} )</span>
  120. </view>
  121. <image @click="changeState(item)" v-if="item.open==false" src="../../static/img/icon_arrow_down.png"
  122. mode="" style="width: 34rpx;height: 22rpx;"></image>
  123. <image @click="changeState(item)" v-if="item.open==true" src="../../static/img/icon_arrow_up.png"
  124. mode="" style="width: 34rpx;height: 22rpx;"></image>
  125. </view>
  126. <view class="itemBg" v-if="item.open" v-for="(v,index2) in item.payList" :key="index2">
  127. <view class="timeBottom">
  128. <view class="time" v-if="v.CreateTime">{{v.CreateTime}}</view>
  129. <view v-if="v.Type==2">-{{v.Money}}</view>
  130. <view class="count" v-else>+{{v.Money}}</view>
  131. </view>
  132. </view>
  133. </view>
  134. <!-- 展示所有 -->
  135. <view v-if="!disCz" class="itemBox">
  136. <view class="itemTop">
  137. <view class="itemName">{{item.PacKName}}</view>
  138. <view class="tiaokuan" @click="useCl(item.useComment)">使用条款</view>
  139. </view>
  140. <view class="itemBottom" :class="{active:item.open}">
  141. <view class="shopName">{{item.ShopName}}</view>
  142. <view class="moneyBox"><span style="font-size: 24rpx; color: #FF3B30; padding-top: 2rpx;">¥</span><span class="money">{{item.Money}}</span> <span
  143. style="color: #999999;font-size: 24rpx;">( 充{{item.ChargeMoney}}送{{item.GiftMoney}} )</span>
  144. </view>
  145. <image @click="changeState(item)" v-if="item.open==false" src="../../static/img/icon_arrow_down.png"
  146. mode="" style="width: 34rpx;height: 22rpx;"></image>
  147. <image @click="changeState(item)" v-if="item.open==true" src="../../static/img/icon_arrow_up.png"
  148. mode="" style="width: 34rpx;height: 22rpx;"></image>
  149. </view>
  150. <view class="itemBg" v-if="item.open" v-for="(v,index2) in item.payList" :key="index2">
  151. <view class="timeBottom">
  152. <view class="time" v-if="v.CreateTime">{{v.CreateTime}}</view>
  153. <view v-if="v.Type==2">-{{v.Money}}</view>
  154. <view class="count" v-else>+{{v.Money}}</view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <!-- 无数据空白页 -->
  160. <nodata v-if="vipData.carMoneyList.length==0"></nodata>
  161. <!-- 使用条款-->
  162. <view class="shiyongBox" v-if="shiyongShow" @click="shiyongShow=false">
  163. <view class="shiyongCont" @click.stop="">
  164. <view class="shiyongContTop">
  165. <view class="shiyongContTopTitle">使用条款</view>
  166. <image src="../../static/img/icon_close.png" alt="" class="shiyongContTopX"
  167. @click="shiyongShow=false"></image>
  168. </view>
  169. <view class="shiyonghtml">
  170. <view v-html="useComment" v-if="useComment"></view>
  171. <view v-else class="shiyongno">使用条款暂无内容</view>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. </template>
  178. <script>
  179. import nodata from '../../components/nodata/nodata.vue'
  180. export default {
  181. components: {
  182. nodata,
  183. },
  184. data() {
  185. return {
  186. tabIndex: '1',
  187. vipData: {},
  188. userInfo: '',
  189. shiyongShow: false,
  190. useComment: '',
  191. dis: true,
  192. disCz: true,
  193. }
  194. },
  195. onLoad() {
  196. this.userInfo = uni.getStorageSync("userInfo")
  197. this.myOrderCoupon();
  198. },
  199. methods: {
  200. AmountQtyJs (item) {
  201. var state = false
  202. if (this.dis) {
  203. item.forEach(v => {
  204. if (v.AmountQty != 0) {
  205. state = true
  206. }
  207. })
  208. } else {
  209. state = true
  210. }
  211. return state
  212. },
  213. useCl(useComment) {
  214. this.useComment = useComment;
  215. this.shiyongShow = true;
  216. },
  217. myOrderCoupon() {
  218. uni.showLoading({
  219. title: '加载中'
  220. })
  221. this.$http('openweiXinCardInfoController/queryCardTimeAndMondyList', {
  222. // page: this.page,
  223. // limit: 10,
  224. }, 'POST').then(res => {
  225. uni.hideLoading();
  226. // var list = res.data.Items
  227. var list = res.data
  228. list.cardTimeList.forEach((item, index) => {
  229. for (const key in item) {
  230. item['open'] = false
  231. }
  232. })
  233. list.carMoneyList.forEach((item, index) => {
  234. for (const key in item) {
  235. item['open'] = false
  236. }
  237. })
  238. this.vipData = list
  239. })
  240. },
  241. tabClick(tag) {
  242. this.tabIndex = tag
  243. },
  244. changeState(item) {
  245. item.open = !item.open
  246. },
  247. gonavigateTo(url) {
  248. uni.navigateTo({
  249. url: url
  250. })
  251. }
  252. }
  253. }
  254. </script>
  255. <style scoped>
  256. .box {
  257. min-height: 100vh;
  258. padding-bottom: 60rpx;
  259. }
  260. .headerBox {
  261. background-color: #171723;
  262. height: 525rpx;
  263. width: 100vw;
  264. padding: 30rpx 0rpx;
  265. /* position: fixed;
  266. left: 0;
  267. top: 0;
  268. z-index: 999; */
  269. }
  270. .vip {
  271. background: url(http://dmsphoto.66km.com.cn/thFiles/0EEEE7DB-02ED-41B4-A633-2F2669E0DF7E.png);
  272. background-size: 100% 100%;
  273. height: 320rpx;
  274. /* width: 100vw; */
  275. margin: 0rpx 24rpx;
  276. padding: 48rpx 30rpx;
  277. display: flex;
  278. flex-direction: column;
  279. justify-content: space-between;
  280. }
  281. .headerTop {
  282. display: flex;
  283. justify-content: flex-start;
  284. }
  285. .headerRight {
  286. padding-left: 18rpx;
  287. }
  288. .nameBox {
  289. display: flex;
  290. justify-content: flex-start;
  291. align-items: center;
  292. }
  293. .name {
  294. font-size: 30rpx;
  295. font-weight: bold;
  296. color: #523509;
  297. line-height: 42rpx;
  298. }
  299. .phone {
  300. margin-top: 12rpx;
  301. font-size: 24rpx;
  302. font-weight: bold;
  303. color: #523509;
  304. line-height: 33rpx;
  305. }
  306. .kahaoBox {
  307. display: flex;
  308. justify-content: flex-start;
  309. align-items: center;
  310. }
  311. .kahao {
  312. font-size: 24rpx;
  313. font-weight: bold;
  314. color: #523509;
  315. line-height: 33rpx;
  316. }
  317. .tab {
  318. background: #FFFFFF;
  319. margin-top: 30rpx;
  320. display: flex;
  321. justify-content: space-around;
  322. line-height: 60rpx;
  323. height: 60rpx;
  324. border-radius: 26rpx 26rpx 0rpx 0rpx;
  325. padding: 28rpx;
  326. }
  327. .tabLine {
  328. font-size: 30rpx;
  329. line-height: 42rpx;
  330. color: #3C3C3C;
  331. text-align: center;
  332. }
  333. .line{
  334. width: 40rpx;
  335. margin: 0rpx 10rpx;
  336. height: 4rpx;
  337. background: #FF0000;
  338. margin-top: 8rpx;
  339. }
  340. .tabActive {
  341. color: #3C3C3C;
  342. font-weight: bold;
  343. }
  344. .mainBox {
  345. /* margin-top: 590rpx; */
  346. background-color: #F4F5F7;
  347. padding: 24rpx;
  348. min-height: 100vh;
  349. }
  350. .btnBox {
  351. display: flex;
  352. }
  353. .itemBox {
  354. background-color: #FFFFFF;
  355. border-radius: 10rpx;
  356. padding: 30rpx 20rpx;
  357. margin-top: 20rpx;
  358. }
  359. .itemTop {
  360. display: flex;
  361. justify-content: space-between;
  362. align-items: baseline;
  363. }
  364. .itemBottom {
  365. display: flex;
  366. justify-content: space-between;
  367. align-items: center;
  368. margin-top: 15rpx;
  369. }
  370. .active {
  371. margin-bottom: 30rpx;
  372. }
  373. .itemName {
  374. font-size: 30rpx;
  375. font-weight: bold;
  376. color: #333333;
  377. line-height: 42rpx;
  378. }
  379. .tiaokuan {
  380. width: 136rpx;
  381. height: 52rpx;
  382. background: #FFFFFF;
  383. border-radius: 28rpx;
  384. border: 1rpx solid #DDDDDD;
  385. color: #666666;
  386. font-size: 24rpx;
  387. text-align: center;
  388. line-height: 52rpx;
  389. }
  390. .shopName {
  391. border-radius: 5rpx;
  392. border: 1rpx solid #DDDDDD;
  393. color: #999999;
  394. font-size: 24rpx;
  395. padding: 2rpx 12rpx;
  396. }
  397. .itemBg {
  398. padding: 30rpx 0rpx;
  399. border-top: 1rpx solid #EEEEEE;
  400. }
  401. .nameTop {
  402. font-size: 28rpx;
  403. font-weight: 400;
  404. color: #333333;
  405. line-height: 40rpx;
  406. margin-bottom: 20rpx;
  407. }
  408. .type {
  409. width: 72rpx;
  410. height: 36rpx;
  411. border-radius: 5rpx;
  412. border: 1rpx solid #F19D01;
  413. margin-right: 10rpx;
  414. font-size: 24rpx;
  415. color: #F19D01;
  416. line-height: 36rpx;
  417. padding: 2rpx 12rpx;
  418. text-align: center;
  419. }
  420. .timeBottom {
  421. display: flex;
  422. justify-content: space-between;
  423. color: #999999;
  424. font-size: 24rpx;
  425. }
  426. .money {
  427. font-size: 36rpx;
  428. font-weight: bold;
  429. color: #FF0000;
  430. line-height: 50rpx;
  431. }
  432. .moneyBox{
  433. flex-grow: 1;
  434. display: flex;
  435. justify-content: flex-end;
  436. margin-right: 10rpx;
  437. align-items: center;
  438. }
  439. .count {
  440. color: #FF0000;
  441. }
  442. .shiyongBox {
  443. width: 100%;
  444. height: 100vh;
  445. background: rgba(0, 0, 0, 0.4);
  446. position: fixed;
  447. left: 0;
  448. top: 0;
  449. z-index: 9999;
  450. }
  451. .shiyongCont {
  452. width: 100%;
  453. height: 70vh;
  454. background: #ffffff;
  455. left: 0;
  456. bottom: 0;
  457. position: absolute;
  458. border-radius: 24rpx 24rpx 0rpx 0rpx;
  459. }
  460. .shiyongContTopX {
  461. width: 36rpx;
  462. height: 36rpx;
  463. }
  464. .shiyongContTop {
  465. display: flex;
  466. justify-content: space-between;
  467. padding: 24rpx;
  468. color: #3C3C3C;
  469. font-size: 30rpx;
  470. border-bottom: 1rpx solid #EEEEEE;
  471. align-items: center;
  472. }
  473. .shiyongContTopTitle {
  474. font-size: 30rpx;
  475. color: #3C3C3C;
  476. font-weight: bold;
  477. }
  478. .shiyonghtml {
  479. padding: 24rpx;
  480. height: calc(70vh - 100px);
  481. overflow-y: scroll;
  482. }
  483. .shiyongno {
  484. color: #666666;
  485. font-size: 26rpx;
  486. }
  487. </style>