index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. <template>
  2. <view class="container">
  3. <block v-if="isload">
  4. <no-none-two/>
  5. </block>
  6. <block v-else>
  7. <swiper class="card-swiper square-dot"
  8. :indicator-dots="true"
  9. :circular="true"
  10. :autoplay="true" interval="5000" duration="500" @change="cardSwiper"
  11. indicator-color="#8799a3"
  12. indicator-active-color="#0081ff" >
  13. <swiper-item v-for="(item,index) in bannerList" :key="index"
  14. :class="cardCur==index?'cur':''">
  15. <view class="swiper-item">
  16. <image :src="item.path" ></image>
  17. <!-- <video :src="item.path" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video> -->
  18. </view>
  19. </swiper-item>
  20. </swiper>
  21. <view class="block-title flex-row">
  22. <image src="../../static/images/icon_1.png" mode="aspectFit" class="icon"></image>
  23. <view class="title">推荐功能</view>
  24. </view>
  25. <view class="nav-list">
  26. <block v-for="(item,index) of list" :key='index'>
  27. <navigator v-if="item.id==1" url="/pages/index/enable" class="nav">
  28. <image src="../../static/images/index_1.png" class="bg-img"></image>
  29. <view class="content flex-row-between">
  30. <view class="info">
  31. <view class="title">收款码{{$test.$test}}</view>
  32. <view class="desc">{{$test.$desc}}</view>
  33. </view>
  34. <view class="btn" style="background-color: #43b2ff;">立即推广</view>
  35. </view>
  36. </navigator>
  37. <navigator v-if="item.id==2" url="/pages/index/article" class="nav">
  38. <image src="../../static/images/index_2.png" class="bg-img"></image>
  39. <view class="content flex-row-between">
  40. <view class="info">
  41. <view class="title">网站{{$test.$test}}</view>
  42. <view class="desc">网页/活动链接/百度文章{{$test.$test}}</view>
  43. </view>
  44. <view class="btn" style="background-color: #AF8DFF;">立即推广</view>
  45. </view>
  46. </navigator>
  47. <navigator v-if="item.id==3" url="/pages/index/public" class="nav">
  48. <image src="../../static/images/index_3.png" class="bg-img"></image>
  49. <view class="content flex-row-between">
  50. <view class="info">
  51. <view class="title">公众号{{$test.$test}}</view>
  52. <view class="desc">公众号文章/关注公众号{{$test.$test}}</view>
  53. </view>
  54. <view class="btn" style="background-color: #FFBC26;">立即推广</view>
  55. </view>
  56. </navigator>
  57. <navigator v-if="item.id==4" url="/pages/index/standard" class="nav">
  58. <image src="../../static/images/index_1.png" class="bg-img"></image>
  59. <view class="content flex-row-between">
  60. <view class="info">
  61. <view class="title">二维码{{$test.$test}}</view>
  62. <view class="desc">链接二维码/文章二维码</view>
  63. </view>
  64. <view class="btn" style="background-color: #43b2ff;">立即推广</view>
  65. </view>
  66. </navigator>
  67. <navigator v-if="item.id==5" url="/pages/replace/replace" class="nav">
  68. <image src="../../static/images/index_2.png" class="bg-img"></image>
  69. <view class="content flex-row-between">
  70. <view class="info">
  71. <view class="title">智能替换</view>
  72. <view class="desc">替换图片二维码</view>
  73. </view>
  74. <view class="btn" style="background-color: #AF8DFF;">立即尝鲜</view>
  75. </view>
  76. </navigator>
  77. <navigator v-if="item.id==6" url="/pages/index/video" class="nav">
  78. <image src="../../static/images/index_3.png" class="bg-img"></image>
  79. <view class="content flex-row-between">
  80. <view class="info">
  81. <view class="title">视频{{$test.$test}}</view>
  82. <view class="desc">视频链接{{$test.$test}}/本地视频{{$test.$test}}</view>
  83. </view>
  84. <view class="btn" style="background-color: #FFBC26;">立即推广</view>
  85. </view>
  86. </navigator>
  87. <navigator v-if="item.id==7" url="/pages/index/games" class="nav">
  88. <image src="../../static/images/index_2.png" class="bg-img"></image>
  89. <view class="content flex-row-between">
  90. <view class="info">
  91. <view class="title">小游戏</view>
  92. <view class="desc">大转盘/砸金蛋</view>
  93. </view>
  94. <view class="btn" style="background-color: #AF8DFF;">立即尝鲜</view>
  95. </view>
  96. </navigator>
  97. </block>
  98. </view>
  99. </block>
  100. </view>
  101. </template>
  102. <script>
  103. export default {
  104. data() {
  105. return {
  106. dotStyle:true,
  107. bannerList: [],
  108. info: {
  109. youbi: 0
  110. },
  111. $test: this.$test.$test,
  112. list: [],
  113. cardCur: 0,
  114. isload:true
  115. }
  116. },
  117. onLoad() {
  118. if (uni.getStorageSync("is_login")==3 && uni.getStorageSync("store_id")) {
  119. uni.reLaunch({
  120. url: "../../storeInfoIng/storeInfo"
  121. })
  122. return;
  123. }
  124. if (uni.getStorageSync("is_login")==2 && uni.getStorageSync("admin_id")) {
  125. uni.reLaunch({
  126. url: "../../statistics/index/index"
  127. })
  128. return;
  129. }
  130. this.types();
  131. this.getname();
  132. this.banner();
  133. },
  134. onShareAppMessage(e) {
  135. },
  136. onShow() {
  137. if (uni.getStorageSync("is_login")=="3"||uni.getStorageSync("is_login")=="2") {
  138. return;
  139. }
  140. this.request({
  141. url: "Spread/index",
  142. data: {
  143. token: uni.getStorageSync("token"),
  144. },
  145. showLoading: true,
  146. }).then(res => {
  147. console.log(res, "res")
  148. if (res.code === '200') {
  149. this.info = res.data;
  150. }
  151. }).catch((res) => {});
  152. },
  153. methods: {
  154. cardSwiper(e) {
  155. this.cardCur = e.detail.current
  156. },
  157. types() {
  158. this.request({
  159. url: "index/types",
  160. data: {
  161. token: uni.getStorageSync("token"),
  162. },
  163. }).then(res => {
  164. console.log(res, "res")
  165. if (res.code == "200") {
  166. this.isload = false;
  167. this.list = res.data;
  168. }
  169. }).catch((res) => {
  170. });
  171. },
  172. getname() {
  173. this.request({
  174. url: "index/login_name",
  175. }).then(res => {
  176. console.log(res, "res")
  177. if (res.code == "200") {
  178. this.isload = false;
  179. if (res.data.funeng) {
  180. this.$test.setTest(res.data.funeng, res.data.desc)
  181. }
  182. }
  183. }).catch((res) => {
  184. });
  185. },
  186. banner() {
  187. //请求验证码
  188. this.request({
  189. url: "index/banner",
  190. data: {
  191. token: uni.getStorageSync("token"),
  192. },
  193. }).then(res => {
  194. console.log(res, "res")
  195. if (res.code === '200') {
  196. this.isload = false;
  197. this.bannerList = res.data
  198. }
  199. }).catch((res) => {});
  200. },
  201. }
  202. }
  203. </script>
  204. <style>
  205. .page-title {
  206. padding: 32rpx 40rpx;
  207. font-size: 48rpx;
  208. color: #242424;
  209. font-weight: 500;
  210. }
  211. /* .swiper {
  212. width: 670rpx;
  213. height: 320rpx;
  214. margin: 0 auto;
  215. border-radius: 10rpx;
  216. overflow: hidden;
  217. box-shadow: 0 10rpx 20rpx #ccc;
  218. }
  219. .swiper .img {
  220. display: block;
  221. width: 100%;
  222. height: 100%;
  223. } */
  224. /* ==================
  225. 轮播
  226. ==================== */
  227. /* swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active::after,
  228. swiper.round-dot .a-swiper-dot.a-swiper-dot-active::after,
  229. swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active::after {
  230. content: "";
  231. position: absolute;
  232. width: 10upx;
  233. height: 10upx;
  234. top: 0upx;
  235. left: 0upx;
  236. right: 0;
  237. bottom: 0;
  238. margin: auto;
  239. background-color: #ffffff;
  240. border-radius: 20upx;
  241. } */
  242. .screen-swiper {
  243. min-height: 375upx;
  244. }
  245. .screen-swiper image,
  246. .screen-swiper video,
  247. .swiper-item image,
  248. .swiper-item video {
  249. width: 100%;
  250. display: block;
  251. height: 100%;
  252. margin: 0;
  253. pointer-events: none;
  254. }
  255. .card-swiper {
  256. height: 420upx !important;
  257. }
  258. .card-swiper swiper-item {
  259. width: 610upx !important;
  260. left: 70upx;
  261. box-sizing: border-box;
  262. padding: 40upx 0upx 70upx;
  263. overflow: initial;
  264. }
  265. .card-swiper swiper-item .swiper-item {
  266. width: 100%;
  267. display: block;
  268. height: 100%;
  269. border-radius: 10upx;
  270. transform: scale(0.9);
  271. transition: all 0.2s ease-in 0s;
  272. overflow: hidden;
  273. }
  274. .card-swiper swiper-item.cur .swiper-item {
  275. transform: none;
  276. transition: all 0.2s ease-in 0s;
  277. }
  278. .block-title {
  279. width: 670rpx;
  280. margin: 20rpx auto 19rpx;
  281. }
  282. .block-title .icon {
  283. display: block;
  284. flex: none;
  285. width: 40rpx;
  286. height: 40rpx;
  287. margin-right: 12rpx;
  288. }
  289. .block-title .title {
  290. font-size: 36rpx;
  291. color: #242424;
  292. font-weight: 500;
  293. }
  294. .nav-list .nav {
  295. display: block;
  296. width: 718rpx;
  297. height: 228rpx;
  298. margin: 0 auto;
  299. position: relative;
  300. }
  301. .nav-list .nav .bg-img {
  302. position: absolute;
  303. left: 0;
  304. top: 0;
  305. /* z-index: -1; */
  306. display: block;
  307. width: 100%;
  308. height: 100%;
  309. }
  310. .nav-list .nav .content {
  311. width: 100%;
  312. height: 100%;
  313. box-sizing: border-box;
  314. padding: 0 63rpx 0 87rpx;
  315. position: relative;
  316. }
  317. .nav-list .nav .content .title {
  318. font-size: 34rpx;
  319. font-weight: 500;
  320. color: #fff;
  321. margin-bottom: 6rpx;
  322. }
  323. .nav-list .nav .content .desc {
  324. font-size: 26rpx;
  325. font-weight: 400;
  326. color: #fff;
  327. margin-bottom: 6rpx;
  328. }
  329. .nav-list .nav .content .desc_ci {
  330. font-size: 22rpx;
  331. font-weight: 400;
  332. color: #fff;
  333. }
  334. .nav-list .nav .content .btn {
  335. width: 165rpx;
  336. height: 60rpx;
  337. border-radius: 30rpx;
  338. font-size: 24rpx;
  339. font-weight: 500;
  340. text-align: center;
  341. line-height: 60rpx;
  342. color: #ffffff;
  343. }
  344. </style>