infoDetail.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <view class="center">
  3. <view class="box">
  4. <view class="discounts">
  5. <view class="title">{{ $t('hea.yz') }}:</view>
  6. <view class="money">
  7. <text>{{ item.money * 2 || 0 }}</text>
  8. </view>
  9. </view>
  10. <view class="main-box">
  11. <view class="main-title">
  12. <view class="main-title-image"><image class="image" src="../../static/icon/title.png" mode=""></image></view>
  13. <view class="main-title-font" v-if="item.v2_layer == 0">{{ item.name }}</view>
  14. <view class="main-title-font" v-else-if="(status == '1' && item.income * 1 >= item.v2_limit * 1 && item.v2_layer != 0) || status == '2'">黑钻VIP义工受益</view>
  15. <view class="main-title-font" v-else>VIP义工受益</view>
  16. </view>
  17. <view class="main">
  18. <view class="main-item" v-for="(ls, index) in revenueList">
  19. <view class="main-image"><image :src="image[index]" mode=""></image></view>
  20. <view class="main-font">
  21. <view class="textDetail-title">{{ index < 2 ? index + 1 + $t('hea.dsy') : index + 1 + $t('hea.dsy') + '(' + $t('hea.vipzs') + ')' }}</view>
  22. <view class="textDetail-content">{{ ls }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="baodan" @click="baodan(id)" v-if="status == '0'">{{ $t('hea.wyyz') }}</view>
  29. <view class="baodan1" @click="baodan(id)" v-if="status == '1' && item.income * 1 < item.v2_limit * 1 && item.v2_layer != 0">{{ $t('hea.lksj') }}</view>
  30. <view class="baodan" @click="baodan(id)" v-if="status == '1' && item.income * 1 >= item.v2_limit * 1 && item.v2_layer != 0">{{ $t('hea.ljsj') }}</view>
  31. <view class="baodan" v-if="status == '2' || (status == '1' && item.v2_layer == 0)" style="background: #020202;">{{ $t('hea.ywc') }}</view>
  32. <uni-popup ref="popup" type="center">
  33. <view class="popup-box">
  34. <view class="img"><image src="../../static/img/tishi.png" mode=""></image></view>
  35. <view class="mian">
  36. <view class="font" v-if="item.v2_layer == 0">
  37. {{ $t('hea.nsfsjqrndbfcj') }}
  38. <br />
  39. {{ $t('hea.rndbfytrmycj') }}
  40. <br />
  41. {{ $t('hea.dndkzcqrjh') }}
  42. <br />
  43. </view>
  44. <view class="font" v-else>
  45. {{ $t('hea.nsfsjqrndbf') }}
  46. <br />
  47. {{ $t('hea.rndbfytrmy') }}
  48. <br />
  49. {{ $t('hea.dndkzcqrjh') }}
  50. <br />
  51. </view>
  52. <view class="comfirm-box">
  53. <view class="cancel" @click="cancel">{{ $t('foo.qx') }}</view>
  54. <view class="comfirm" @click="confirm">{{ countDown == 0 ? $t('hea.zcqd') : countDown }}</view>
  55. </view>
  56. </view>
  57. </view>
  58. </uni-popup>
  59. </view>
  60. </template>
  61. <script>
  62. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  63. import { mapState, mapMutations } from 'vuex';
  64. import { activitys } from '@/api/active.js';
  65. export default {
  66. data() {
  67. return {
  68. id: '',
  69. revenueList: [],
  70. item: '',
  71. status: '',
  72. show1: false,
  73. time: '', //保存倒计时对象
  74. countDown: 0, //倒计时
  75. image: [
  76. '../../static/icon/1.png',
  77. '../../static/icon/2.png',
  78. '../../static/icon/3.png',
  79. '../../static/icon/4.png',
  80. '../../static/icon/5.png',
  81. '../../static/icon/6.png',
  82. '../../static/icon/7.png'
  83. ] //七层的图片
  84. };
  85. },
  86. watch: {
  87. // 监听倒计时
  88. countDown(i) {
  89. if (i == 0) {
  90. clearInterval(this.time);
  91. }
  92. }
  93. },
  94. components: {
  95. uniPopup
  96. },
  97. computed: {
  98. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  99. },
  100. onLoad(option) {
  101. uni.setNavigationBarTitle({
  102. title: this.$t('foo.xq')
  103. });
  104. this.id = option.id;
  105. this.loadData();
  106. },
  107. methods: {
  108. loadData() {
  109. const obj = this;
  110. activitys({}, this.id).then(e => {
  111. console.log(e);
  112. obj.item = e.data;
  113. if (e.data.my_join) {
  114. obj.status = e.data.my_join.status;
  115. } else {
  116. obj.status = '0';
  117. obj.isU = false;
  118. }
  119. let i = e.data.v1_layer + e.data.v2_layer;
  120. if (e.data.v2_layer && (obj.status == '0' || (obj.status == '1' && e.data.income * 1 < e.data.v2_limit * 1))) {
  121. i = e.data.v1_layer;
  122. }
  123. let money = e.data.money * 1;
  124. let money1 = e.data.money * 1;
  125. let people = 1;
  126. for (let j = 0; j < i; j++) {
  127. people = people * 5;
  128. money = money * 1 * 5;
  129. obj.revenueList[j] = people + '人x' + money1 + '元=' + this.unit(money);
  130. }
  131. });
  132. },
  133. //换算单位
  134. unit(num) {
  135. let i = 0;
  136. if (num / 10000 >= 1) {
  137. i = num / 10000 + '万元';
  138. if (num / 100000000 >= 1) {
  139. i = num / 100000000 + '亿元';
  140. }
  141. } else {
  142. i = num + '元';
  143. }
  144. return i;
  145. },
  146. // 弹窗 - 取消
  147. cancel() {
  148. this.countDown = 0;
  149. this.$refs.popup.close();
  150. },
  151. confirm() {
  152. if (this.countDown != 0) {
  153. return;
  154. }
  155. this.$refs.popup.close();
  156. uni.navigateTo({
  157. url: '/pages/index/info?id=' + this.id
  158. });
  159. },
  160. baodan(id) {
  161. const obj = this;
  162. console.log(this.userInfo.nickname, '11111');
  163. let a =/[0-9]{3}[*]{4}[0-9]{4}/;
  164. if (a.test(this.userInfo.nickname)){
  165. uni.showModal({
  166. title: this.$t('foo.ts'),
  167. content: this.$t('foo.ndqwtxzsxm'),
  168. success: function(res) {
  169. if (res.confirm) {
  170. uni.navigateTo({
  171. url: '/pages/set/userinfo'
  172. });
  173. } else if (res.cancel) {
  174. console.log('用户点击取消');
  175. }
  176. }
  177. });
  178. }else {
  179. if (!this.userInfo.bank_card_no && !this.userInfo.bank_of_deposit && this.userInfo.bank_card_no == '' && this.userInfo.bank_of_deposit == '') {
  180. uni.showModal({
  181. title: this.$t('foo.ts'),
  182. content: this.$t('foo.ndqwtxskxx'),
  183. success: function(res) {
  184. if (res.confirm) {
  185. uni.navigateTo({
  186. url: '/pages/set/userinfo'
  187. });
  188. } else if (res.cancel) {
  189. console.log('用户点击取消');
  190. }
  191. }
  192. });
  193. } else {
  194. if (this.status == '1' && this.item.income < this.item.v2_limit * 1) {
  195. this.$api.msg('当前援助额度不足以升级黑钻VIP义工');
  196. return;
  197. }
  198. if (this.status == '0') {
  199. // 判断是否在倒计时
  200. if (obj.countDown > 0) {
  201. return false;
  202. } else {
  203. obj.countDown = 15;
  204. obj.time = setInterval(() => {
  205. obj.countDown--;
  206. }, 1000);
  207. //调用验证码接口
  208. this.$refs.popup.open();
  209. }
  210. } else {
  211. uni.navigateTo({
  212. url: '/pages/index/info?id=' + id
  213. });
  214. }
  215. }
  216. // uni.navigateTo({
  217. // url: '/pages/index/info?id=' + id
  218. // });
  219. }
  220. }
  221. }
  222. };
  223. </script>
  224. <style lang="scss">
  225. .center {
  226. padding-bottom: 50rpx;
  227. }
  228. .box {
  229. .discounts {
  230. margin: 0 30rpx;
  231. position: relative;
  232. padding: 20rpx;
  233. background-color: #1f2020;
  234. border-radius: 10rpx;
  235. .title {
  236. width: 100%;
  237. text-align: left;
  238. color: #e6c3a1;
  239. }
  240. .money {
  241. margin-top: 30rpx;
  242. padding-bottom: 30rpx;
  243. font-size: 32rpx;
  244. font-family: Source Han Sans CN;
  245. font-weight: bold;
  246. color: #c63535;
  247. width: 100%;
  248. text-align: center;
  249. text {
  250. font-size: 116rpx;
  251. font-family: Source Han Sans CN;
  252. font-weight: 800;
  253. color: #c63535;
  254. line-height: 115rpx;
  255. }
  256. }
  257. }
  258. .zhushi {
  259. color: #e6c3a1;
  260. padding: 20rpx 40rpx;
  261. }
  262. }
  263. .baodan {
  264. width: 452rpx;
  265. height: 80rpx;
  266. margin: 50rpx auto 0;
  267. text-align: center;
  268. line-height: 80rpx;
  269. color: #ffffff;
  270. background: #4e2c0e;
  271. font-size: 40rpx;
  272. border-radius: 10rpx;
  273. }
  274. .baodan1 {
  275. width: 452rpx;
  276. height: 80rpx;
  277. margin: 50rpx auto 0;
  278. text-align: center;
  279. line-height: 80rpx;
  280. color: #ffffff;
  281. background: #9f9f9f;
  282. font-size: 40rpx;
  283. border-radius: 10rpx;
  284. }
  285. .main-box {
  286. margin: 80rpx 30rpx 0;
  287. position: relative;
  288. padding: 20rpx;
  289. background-color: #1f2020;
  290. border-radius: 10rpx;
  291. .main-title {
  292. width: 400rpx;
  293. height: 80rpx;
  294. margin: -60rpx auto 0;
  295. border-radius: 50rpx;
  296. position: relative;
  297. .main-title-image {
  298. position: absolute;
  299. left: 0;
  300. top: 0;
  301. width: 400rpx;
  302. height: 80rpx;
  303. .image {
  304. width: 100%;
  305. height: 100%;
  306. border-radius: 50rpx;
  307. }
  308. }
  309. .main-title-font {
  310. position: relative;
  311. z-index: 10;
  312. text-align: center;
  313. line-height: 80rpx;
  314. font-size: 46rpx;
  315. font-weight: bold;
  316. color: #54300f;
  317. }
  318. }
  319. .main {
  320. padding: 40rpx 0;
  321. .main-item {
  322. margin-top: 20rpx;
  323. width: 100%;
  324. padding: 14rpx;
  325. background: #e6c3a1;
  326. position: relative;
  327. border-radius: 20rpx;
  328. .main-image {
  329. position: absolute;
  330. top: -2rpx;
  331. left: -2rpx;
  332. width: 110rpx;
  333. height: 110rpx;
  334. image {
  335. width: 100%;
  336. height: 100%;
  337. }
  338. }
  339. .main-font {
  340. font-size: 28rpx;
  341. padding-left: 80rpx;
  342. }
  343. }
  344. }
  345. }
  346. .popup-box {
  347. width: 650rpx;
  348. padding-bottom: 40rpx;
  349. background-color: #ffffff;
  350. border-radius: 20rpx;
  351. position: relative;
  352. .img {
  353. position: relative;
  354. top: -56rpx;
  355. left: 0;
  356. width: 650rpx;
  357. height: 132rpx;
  358. display: flex;
  359. justify-content: center;
  360. image {
  361. border-radius: 20rpx 20rpx 0 0;
  362. width: 450rpx;
  363. height: 132rpx;
  364. }
  365. }
  366. .mian {
  367. margin-top: -44rpx;
  368. display: flex;
  369. flex-direction: column;
  370. align-items: center;
  371. // padding: 32rpx 32rpx;
  372. background-color: #ffffff;
  373. border-radius: 0 0 20rpx 20rpx;
  374. text-align: center;
  375. padding: 30rpx;
  376. .font {
  377. text-align: left;
  378. line-height: 54rpx;
  379. color: #7e7457;
  380. font-size: 30rpx;
  381. }
  382. .comfirm-box {
  383. margin-top: 52rpx;
  384. display: flex;
  385. // margin-bottom: 32rpx;
  386. // justify-content: space-around;
  387. .cancel {
  388. display: flex;
  389. align-items: center;
  390. justify-content: center;
  391. width: 250rpx;
  392. height: 80rpx;
  393. border: 1px solid #dcc786;
  394. border-radius: 10rpx;
  395. font-size: 32rpx;
  396. color: #605128;
  397. }
  398. .comfirm {
  399. margin-left: 50rpx;
  400. display: flex;
  401. align-items: center;
  402. justify-content: center;
  403. width: 250rpx;
  404. height: 80rpx;
  405. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  406. border-radius: 10rpx;
  407. font-size: 32rpx;
  408. color: #605128;
  409. }
  410. }
  411. }
  412. }
  413. </style>