flow.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <view class="content">
  3. <view class="header">
  4. <image src="../../static/images/skm_fn_bg.png" mode="aspectFill" class="bg-img"></image>
  5. <view class="info-block">
  6. <view class="box-pack-between ft32 item flex-y-center flex-grow-1" style="margin: 0;">
  7. <navigator :url="'cash?money='+info.advertiser_money" hover-class="none">总收入
  8. <text class="ft24" style="margin-left: 10rpx;">提现</text>
  9. <text class="iconfont icon-prev ft22" style="font-size: 22rpx;"></text>
  10. </navigator>
  11. <view class="ft24 item-off flex">
  12. <view class="flex-grow-1 flex-center" @click="bindcheck" :data-index="index"
  13. v-for="(item,index) of switch_list" :key="index" :class="index==act_index?'act':''">
  14. {{item.name}}</view>
  15. </view>
  16. </view>
  17. <view class="ft60">
  18. {{info.money_total}}
  19. </view>
  20. <view class="flex-center item-content">
  21. <view class="flex-grow-1 tr">
  22. <view class="ft24 tr-title">
  23. 待结算金额
  24. </view>
  25. <view class="ft30 mab-24 tr-title">
  26. {{!info.settlement?0:info.settlement}}
  27. </view>
  28. </view>
  29. <view class="line"></view>
  30. <view class="flex-grow-1 tr-title">
  31. <view class="ft24">
  32. 可提现金额
  33. </view>
  34. <view class="ft30 mab-24 tc">
  35. {{!info.advertiser_money?0:info.advertiser_money}}
  36. </view>
  37. </view>
  38. <view class="line"></view>
  39. <view class="flex-grow-1 tr-title">
  40. <view class="ft24">
  41. 已提现金额
  42. </view>
  43. <view class="ft30 mab-24 tc">
  44. {{!info.cash_money?0:info.cash_money}}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="main">
  51. <view class="main-home">
  52. <!-- <form @submit="Submit"> -->
  53. <view class="">
  54. <view class="box-pack-between ft32 main-item">
  55. <view>流量主记录池</view>
  56. <view class="flex-center add-home ft24" @click="addEnable">
  57. 添加
  58. </view>
  59. </view>
  60. </view>
  61. <no-none v-if='power_list.length<=0'></no-none>
  62. <block v-if="power_list.length>0">
  63. <view class="item-bg" v-for="(item,index) in power_list" :data-index='index' :key="item.id">
  64. <view class="item flex-row box-pack-between">
  65. <view class="flex-grow-1 flex-y-center">
  66. <image src="../../static/images/icon_game.png" mode="aspectFit" class="type-img"
  67. v-if="item.type == 7"></image>
  68. <image src="../../static/images/icon_6.png" mode="aspectFit" class="type-img"
  69. v-if="item.type == 4"></image>
  70. <image src="../../static/images/icon_5.png" mode="aspectFit" class="type-img"
  71. v-if="item.type == 3"></image>
  72. <image src="../../static/images/icon_2.png" mode="aspectFit" class="type-img"
  73. v-if="item.type == 2"></image>
  74. <image src="../../static/images/icon_4.png" mode="aspectFit" class="type-img"
  75. v-if="item.type == 1"></image>
  76. <image src="../../static/images/icon_7.png" mode="aspectFit" class="type-img"
  77. v-if="item.type == 6"></image>
  78. <view class="info">
  79. <view class="title text-1" v-if="item.mid_title">{{item.mid_title}}</view>
  80. <view class="title text-1" v-if="item.short">{{item.short}}</view>
  81. <view class="title text-1" v-if="item.create_time">{{item.create_time}}</view>
  82. </view>
  83. </view>
  84. <image class="del" :data-index="index" :data-id="item.id" @click="del"
  85. src="../../static/images/del.png" mode=""></image>
  86. </view>
  87. </view>
  88. </block>
  89. <navigator url="flow-detail" class="box-pack-between">
  90. <view class="box-pack-between ft32 main-item">
  91. <view>流量主数据明细</view>
  92. </view>
  93. <view class="flex-center ft24 col">
  94. 数据明细
  95. <view class="iconfont iconfont icon-prev"></view>
  96. </view>
  97. </navigator>
  98. </view>
  99. </view>
  100. <!-- <view class="rule flex-center col" @click="rule">
  101. 流量主功能规则 <image class="zhiyin" src="/static/images/wen1.png" mode=""></image>
  102. </view> -->
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. info: {},
  110. switch_list: [{
  111. name: "开启流量"
  112. }, {
  113. name: "关闭流量"
  114. }, ],
  115. act_index: 0,
  116. power_list: [],
  117. }
  118. },
  119. onLoad(e) {
  120. },
  121. onShow() {
  122. this.getExchange();
  123. },
  124. methods: {
  125. addEnable(e) {
  126. this.request({
  127. url: "user/funeng_list",
  128. data: {
  129. page: this.page,
  130. token: uni.getStorageSync("token"),
  131. },
  132. showLoading: true,
  133. }).then(res => {
  134. if (res.code === '200' && res.data.length > 0) {
  135. uni.navigateTo({
  136. url: "./record?type=2"
  137. })
  138. } else {
  139. uni.showToast({
  140. title: "没有记录",
  141. icon: 'none'
  142. })
  143. }
  144. })
  145. },
  146. rule(e) {
  147. // var arr = JSON.stringify(this.arr)
  148. // uni.navigateTo({
  149. // url: "./rule?arr=" + arr + "&id=" + this.info.id
  150. // })
  151. },
  152. getExchange() {
  153. this.request({
  154. url: "Advertiser/index",
  155. data: {
  156. token: uni.getStorageSync("token"),
  157. },
  158. }).then(res => {
  159. console.log(res, "res")
  160. if (res.code === '200') {
  161. this.info = res.data;
  162. this.act_index = res.data.is_advertiser == "Y" ? 0 : 1;
  163. this.power_list = res.data.power_list;
  164. }
  165. }).catch((res) => {
  166. uni.showToast({
  167. title: res.message,
  168. icon: 'none'
  169. })
  170. });
  171. },
  172. bindcheck(e) {
  173. var index = e.currentTarget.dataset.index;
  174. this.act_index = index;
  175. this.request({
  176. url: "Advertiser/AdvertiserSwitch",
  177. data: {
  178. is_advertiser: index == 1 ? 'N' : 'Y',
  179. token: uni.getStorageSync("token"),
  180. },
  181. }).then(res => {
  182. console.log(res, "res")
  183. if (res.code === '200') {
  184. uni.showToast({
  185. title: res.message,
  186. icon: 'none'
  187. })
  188. }
  189. }).catch((res) => {
  190. uni.showToast({
  191. title: res.message,
  192. icon: 'none'
  193. })
  194. this.act_index = 1;
  195. });
  196. },
  197. del(e) {
  198. let id = e.currentTarget.dataset.id,
  199. index = e.currentTarget.dataset.index;
  200. uni.showModal({
  201. title: '提示',
  202. content: '确定要删除此记录吗?',
  203. showCancel: true,
  204. cancelText: '取消',
  205. confirmText: '删除',
  206. success: res => {
  207. if (res.confirm) {
  208. this.request({
  209. url: "Advertiser/AdvertiserPowerSwitch",
  210. data: {
  211. token: uni.getStorageSync("token"),
  212. is_advertiser: "N",
  213. id: id,
  214. },
  215. }).then(res => {
  216. console.log(res, "res")
  217. if (res.code === '200') {
  218. this.power_list.splice(index, 1)
  219. uni.showToast({
  220. title: "删除成功",
  221. icon: 'none'
  222. })
  223. }
  224. }).catch((res) => {
  225. uni.showToast({
  226. title: res.message,
  227. icon: 'none'
  228. })
  229. });
  230. }
  231. },
  232. fail: () => {},
  233. complete: () => {}
  234. });
  235. },
  236. },
  237. }
  238. </script>
  239. <style>
  240. .rule {
  241. position: absolute;
  242. bottom: 40rpx;
  243. width: 100%;
  244. text-align: center;
  245. font-size: 24rpx;
  246. }
  247. .zhiyin {
  248. width: 28rpx;
  249. height: 28rpx;
  250. margin-left: 3px;
  251. }
  252. .ft60 {
  253. font-size: 60rpx;
  254. margin-bottom: 22rpx;
  255. }
  256. .item-content .tr-title {
  257. padding: 0 15px;
  258. text-align: left;
  259. }
  260. .item-bg-right {
  261. min-width: 207rpx;
  262. }
  263. .coh .rotate {
  264. transition: all 1.2s ease-out 0s;
  265. transform: rotate(360deg);
  266. }
  267. .tr-title {
  268. color: #D1E4FF;
  269. }
  270. .info-block {
  271. width: 670rpx;
  272. margin: 0 auto;
  273. }
  274. .info-block .item {
  275. padding: 30rpx 0 20rpx 0;
  276. }
  277. .item-off {
  278. width: 252rpx;
  279. height: 54rpx;
  280. border-radius: 8rpx;
  281. color: #ffff;
  282. border: 2rpx solid #3387ff;
  283. background: rgba(255, 255, 255, 0.2);
  284. }
  285. .item-off .act {
  286. background: #fff;
  287. color: #3387ff;
  288. border-radius: 8rpx;
  289. }
  290. .item-content {
  291. text-align: center;
  292. }
  293. .header {
  294. width: 100%;
  295. height: 334rpx;
  296. position: relative;
  297. }
  298. .header .bg-img {
  299. display: block;
  300. position: absolute;
  301. left: 0;
  302. top: 0;
  303. z-index: -1;
  304. width: 100%;
  305. height: 334rrpx;
  306. }
  307. .header .info-block {
  308. /* padding: 0 40rpx 0 48rpx; */
  309. height: 198rpx;
  310. color: #FFFFFF;
  311. }
  312. .header .info-block .title {
  313. font-size: 36rpx;
  314. color: #fff;
  315. font-weight: 500;
  316. line-height: 50rpx;
  317. }
  318. .header .info-block .desc {
  319. font-size: 28rpx;
  320. font-weight: 500;
  321. color: #fff;
  322. line-height: 40rpx;
  323. margin-top: 8rpx;
  324. }
  325. .line {
  326. width: 2rpx;
  327. height: 46rpx;
  328. opacity: 0.5;
  329. background: #ffffff;
  330. }
  331. .mab-24 {
  332. margin-bottom: 24rpx;
  333. }
  334. .wen {
  335. width: 22rpx;
  336. height: 22rpx;
  337. margin-left: 8rpx;
  338. }
  339. .main-home {
  340. width: 670rpx;
  341. margin: 0 auto;
  342. }
  343. .main-item {
  344. margin: 20rpx 0 32rpx 0;
  345. }
  346. .add-home {
  347. color: #FFFFFF;
  348. width: 126rpx;
  349. height: 54rpx;
  350. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  351. border-radius: 8rpx;
  352. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.2);
  353. }
  354. .item-bg .mar64:last-child {
  355. margin-bottom: 0rpx;
  356. }
  357. .item-bg {
  358. width: 670rpx;
  359. background: #f6f8fe;
  360. border-radius: 12rpx;
  361. margin: 0 auto;
  362. font-size: 28rpx;
  363. font-family: PingFang SC, PingFang SC-Regular;
  364. font-weight: 400;
  365. color: #333333;
  366. padding: 36rpx 32rpx;
  367. margin-bottom: 20rpx;
  368. }
  369. .item-bg-time {
  370. width: 180rpx;
  371. height: 66rpx;
  372. background: #ffffff;
  373. border-radius: 8rpx;
  374. display: inline-block;
  375. margin-right: 30rpx;
  376. margin-bottom: 30rpx;
  377. }
  378. .item {
  379. margin: 20rpx 0;
  380. }
  381. .info {
  382. width: 501rpx;
  383. }
  384. .item-bg .item-bg-time:nth-child(3n) {
  385. margin-right: 0rpx;
  386. }
  387. .item-bg-time .flex-center {
  388. height: 100%;
  389. }
  390. .type-img {
  391. display: block;
  392. flex: none;
  393. width: 40rpx;
  394. height: 40rpx;
  395. margin-right: 26rpx;
  396. }
  397. .del {
  398. width: 32rpx;
  399. height: 32rpx;
  400. }
  401. .maps {
  402. min-width: 31rpx;
  403. width: 31rpx;
  404. height: 31rpx;
  405. margin-right: 10rpx;
  406. }
  407. .iconzhongxindingwei {
  408. margin-right: 10rpx;
  409. }
  410. .model {
  411. position: fixed;
  412. top: 0;
  413. width: 100%;
  414. height: 100%;
  415. background: rgba(0, 0, 0, 0.5);
  416. }
  417. .model_cotent {
  418. width: 600rpx;
  419. /* height: 300rpx; */
  420. text-align: center;
  421. border-radius: 16rpx;
  422. background: #fff;
  423. }
  424. .model_cotent_title {
  425. font-size: 34rpx;
  426. font-weight: 700;
  427. margin: 40rpx 0 40rpx 0;
  428. }
  429. .model_cotent_qd {
  430. font-size: 30rpx;
  431. padding-bottom: 65rpx;
  432. border-bottom: 1rpx solid #f1f1f1;
  433. }
  434. .model_cotent_shezhi {
  435. margin: 0;
  436. font-weight: 700;
  437. font-size: 30rpx;
  438. color: #4e6ef2;
  439. padding: 15rpx 0;
  440. background-color: #fff;
  441. border-radius: none;
  442. border: none;
  443. }
  444. </style>